Skip to content

Commit

Permalink
rebranding (#23)
Browse files Browse the repository at this point in the history
* rebrand

* update

* fix license

* fix build docker
  • Loading branch information
zjg555543 authored Oct 13, 2023
1 parent c9c53c6 commit 216c926
Show file tree
Hide file tree
Showing 31 changed files with 283 additions and 283 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: Report a bug
about: Something with Polygon zkEVM is not working as expected
about: Something with Xagon is not working as expected
title: ''
labels: 'type:bug'
assignees: ''
---

#### System information

zkEVM Node version: `v0.0.X-RCXX`
Xagon Node version: `v0.0.X-RCXX`
OS & Version: `Windows/Linux/OSX`
Commit hash : (if `develop`)
Network: `Mainnet/Testnet`
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-from-prover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: 0xPolygonHermez/zkevm-node
repository: okx/xagon-node

- name: Install Go
uses: actions/setup-go@v3
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ RUN cd /src && make build

# CONTAINER FOR RUNNING BINARY
FROM alpine:3.18.0
COPY --from=build /src/dist/zkevm-node /app/zkevm-node
COPY --from=build /src/dist/xagon-node /app/xagon-node
COPY --from=build /src/config/environments/testnet/node.config.toml /app/example.config.toml
RUN apk update && apk add postgresql15-client
EXPOSE 8123
CMD ["/bin/sh", "-c", "/app/zkevm-node run"]
CMD ["/bin/sh", "-c", "/app/xagon-node run"]
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif
GOBASE := $(shell pwd)
GOBIN := $(GOBASE)/dist
GOENVVARS := GOBIN=$(GOBIN) CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH)
GOBINARY := zkevm-node
GOBINARY := xagon-node
GOCMD := $(GOBASE)/cmd

LDFLAGS += -X 'github.com/0xPolygonHermez/zkevm-node.Version=$(VERSION)'
Expand All @@ -35,21 +35,21 @@ build: ## Builds the binary locally into ./dist

.PHONY: build-docker
build-docker: ## Builds a docker image with the node binary
docker build -t zkevm-node -f ./Dockerfile .
docker build -t xagon-node -f ./Dockerfile .

.PHONY: build-docker-nc
build-docker-nc: ## Builds a docker image with the node binary - but without build cache
docker build --no-cache=true -t zkevm-node -f ./Dockerfile .
docker build --no-cache=true -t xagon-node -f ./Dockerfile .

.PHONY: run-rpc
run-rpc: ## Runs all the services need to run a local zkEMV RPC node
docker-compose up -d zkevm-state-db zkevm-pool-db
docker-compose up -d xagon-state-db xagon-pool-db
sleep 2
docker-compose up -d zkevm-prover
docker-compose up -d xagon-prover
sleep 5
docker-compose up -d zkevm-sync
docker-compose up -d xagon-sync
sleep 2
docker-compose up -d zkevm-rpc
docker-compose up -d xagon-rpc

.PHONY: stop
stop: ## Stops all services
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# zkEVM Node
# Xagon Node

zkEVM Node is a Go implementation of a node that operates the Polygon zkEVM Network.
Xagon Node is a Go implementation of a node that operates the Xagon Network.

## About the Polygon zkEVM network
## About the Xagon network

Since this is an implementation of a protocol it's fundamental to understand it, [here](https://zkevm.polygon.technology/docs/zknode/zknode-overview) you can find the specification of the protocol.
Since this is an implementation of a protocol it's fundamental to understand it, [here]() you can find the specification of the protocol.

Glossary:

- L1: Base blockchain where the rollup smart contracts are deployed. It's Ethereum or a testnet of Ethereum, but it could be any EVM compatible blockchain.
- L2: the rollup network aka the Polygon zkEVM network.
- Batch: a group of transactions that are executed/proved, using the [zkEVM prover](https://github.com/0xPolygonHermez/zkevm-prover) and sent to / synchronized from L1
- L2: the rollup network aka the Xagon network.
- Batch: a group of transactions that are executed/proved, using the [Xagon prover]() and sent to / synchronized from L1
- Sequencer: the actor that is responsible for selecting transactions, putting them in a specific order, and sending them in batches to L1
- Trusted sequencer: sequencer that has special privileges, there can only be one trusted sequencer. The privileges granted to the trusted sequencer allow it to forecast the batches that will be applied to L1. This way it can commit to a specific sequence before interacting with L1. This is done to achieve fast finality and reduce costs associated with using the network (lower gas fees)
- Permissionless sequencer: sequencer role that can be performed by anyone. It has competitive disadvantages compared to the trusted sequencer (slow finality, MEV attacks). Its main purpose is to provide censorship resistance and unstoppability features to the network.
Expand All @@ -20,9 +20,9 @@ Glossary:
- Trusted state: state reached through processing transactions that have been shared by the trusted sequencer. This state is considered trusted as the trusted sequencer could commit to a certain sequence, and then send a different one to L1
- Virtual state: state reached through processing transactions that have already been submitted to L1. These transactions are sent in batches by either trusted or permissionless sequencers. Those batches are also called virtual batches. Note that this state is trustless as it relies on L1 security assumptions
- Consolidated state: state that is proven on-chain by submitting a ZKP (Zero Knowledge Proof) that proves the execution of a sequence of the last virtual batch.
- Invalid transaction: a transaction that can't be processed and doesn't affect the state. Note that such a transaction could be included in a virtual batch. The reason for a transaction to be invalid could be related to the Ethereum protocol (invalid nonce, not enough balance, ...) or due to limitations introduced by the zkEVM (each batch can make use of a limited amount of resources such as the total amount of keccak hashes that can be computed)
- Invalid transaction: a transaction that can't be processed and doesn't affect the state. Note that such a transaction could be included in a virtual batch. The reason for a transaction to be invalid could be related to the Ethereum protocol (invalid nonce, not enough balance, ...) or due to limitations introduced by the Xagon (each batch can make use of a limited amount of resources such as the total amount of keccak hashes that can be computed)
- Reverted transaction: a transaction that is executed, but is reverted (because of smart contract logic). The main difference with *invalid transaction* is that this transaction modifies the state, at least to increment nonce of the sender.
- Proof of Efficiency (PoE): name of the protocol used by the network, it's enforced by the [smart contracts](https://github.com/0xPolygonHermez/zkevm-contracts)
- Proof of Efficiency (PoE): name of the protocol used by the network, it's enforced by the [smart contracts](https://github.com/okx/xagon-contracts)

## Architecture

Expand All @@ -41,10 +41,10 @@ The diagram represents the main components of the software and how they interact
- State: Responsible for managing the state data (batches, blocks, transactions, ...) that is stored on the `state SB`. It also handles the integration with the `executor` and the `Merkletree` service
- State DB: persistence layer for the state data (except the Merkletree that is handled by the `Merkletree` service)
- Aggregator: consolidates batches by generating ZKPs (Zero Knowledge proofs). To do so it gathers the necessary data that the `prover` needs as input through the `state` and sends a request to it. Once the proof is generated it's sent to Ethereum through the `etherman`
- Prover/Executor: service that generates ZK proofs. Note that this component is not implemented in this repository, and it's treated as a "black box" from the perspective of the node. The prover/executor has two implementations: [JS reference implementation](https://github.com/0xPolygonHermez/zkevm-proverjs) and [C production-ready implementation](https://github.com/0xPolygonHermez/zkevm-prover). Although it's the same software/service, it has two very different purposes:
- Prover/Executor: service that generates ZK proofs. Note that this component is not implemented in this repository, and it's treated as a "black box" from the perspective of the node. The prover/executor has two implementations: [JS reference implementation](https://github.com/0xPolygonHermez/zkevm-proverjs) and [C production-ready implementation](https://github.com/okx/xagon-prover). Although it's the same software/service, it has two very different purposes:
- Provide an EVM implementation that allows processing transactions and getting all needed results metadata (state root, receipts, logs, ...)
- Generate ZKPs
- Merkletree: service that stores the Merkletree, containing all the account information (balances, nonces, smart contract code, and smart contract storage). This component is also not implemented in this repo and is consumed as an external service by the node. The implementation can be found [here](https://github.com/0xPolygonHermez/zkevm-prover)
- Merkletree: service that stores the Merkletree, containing all the account information (balances, nonces, smart contract code, and smart contract storage). This component is also not implemented in this repo and is consumed as an external service by the node. The implementation can be found [here](https://github.com/okx/xagon-prover)

## Roles of the network

Expand All @@ -63,8 +63,8 @@ Required services and components:

There must be only one synchronizer, and it's recommended that it has exclusive access to an executor instance, although it's not necessary. This role can perfectly be run in a single instance, however, the JSON RPC and executor services can benefit from running in multiple instances, if the performance decreases due to the number of requests received

- [`zkEVM RPC endpoints`](./docs/json-rpc-endpoints.md)
- [`zkEVM RPC Custom endpoints documentation`](./docs/zkEVM-custom-endpoints.md)
- [`Xagon RPC endpoints`](./docs/json-rpc-endpoints.md)
- [`Xagon RPC Custom endpoints documentation`](./docs/zkEVM-custom-endpoints.md)

### Trusted sequencer

Expand Down
10 changes: 5 additions & 5 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Outputs = ["stderr"]
User = "state_user"
Password = "state_password"
Name = "state_db"
Host = "zkevm-state-db"
Host = "xagon-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand All @@ -36,7 +36,7 @@ FreeGasAddress = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
User = "pool_user"
Password = "pool_password"
Name = "pool_db"
Host = "zkevm-pool-db"
Host = "xagon-pool-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand Down Expand Up @@ -141,10 +141,10 @@ CleanHistoryPeriod = "1h"
CleanHistoryTimeRetention = "5m"
[MTClient]
URI = "zkevm-prover:50061"
URI = "xagon-prover:50061"
[Executor]
URI = "zkevm-prover:50071"
URI = "xagon-prover:50071"
MaxResourceExhaustedAttempts = 3
WaitOnResourceExhaustion = "1s"
MaxGRPCMessageSize = 100000000
Expand All @@ -158,7 +158,7 @@ Enabled = false
User = "prover_user"
Password = "prover_pass"
Name = "prover_db"
Host = "zkevm-state-db"
Host = "xagon-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand Down
12 changes: 6 additions & 6 deletions config/environments/local/local.node.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Outputs = ["stderr"]
User = "state_user"
Password = "state_password"
Name = "state_db"
Host = "zkevm-state-db"
Host = "xagon-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand All @@ -29,7 +29,7 @@ FreeGasAddress = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
User = "pool_user"
Password = "pool_password"
Name = "pool_db"
Host = "zkevm-pool-db"
Host = "xagon-pool-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand All @@ -47,7 +47,7 @@ Port = 8545
ReadTimeout = "60s"
WriteTimeout = "60s"
MaxRequestsPerIPAndSecond = 5000
SequencerNodeURI = "https://internal.zkevm-test.net:2083/"
SequencerNodeURI = "https://internal.xagon-test.net:2083/"
EnableL2SuggestedGasPricePolling = true
[RPC.WebSockets]
Enabled = true
Expand Down Expand Up @@ -142,10 +142,10 @@ MaxGasPriceWei = 0
#L2CoinId = 7184

[MTClient]
URI = "zkevm-prover:50061"
URI = "xagon-prover:50061"

[Executor]
URI = "zkevm-prover:50071"
URI = "xagon-prover:50071"
MaxResourceExhaustedAttempts = 3
WaitOnResourceExhaustion = "1s"
MaxGRPCMessageSize = 100000000
Expand All @@ -162,7 +162,7 @@ ProfilingEnabled = false
User = "prover_user"
Password = "prover_pass"
Name = "prover_db"
Host = "zkevm-state-db"
Host = "xagon-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
12 changes: 6 additions & 6 deletions config/environments/mainnet/node.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Outputs = ["stderr"]
User = "state_user"
Password = "state_password"
Name = "state_db"
Host = "zkevm-state-db"
Host = "xagon-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand All @@ -24,7 +24,7 @@ FreeGasAddress = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
User = "pool_user"
Password = "pool_password"
Name = "pool_db"
Host = "zkevm-pool-db"
Host = "xagon-pool-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand All @@ -42,7 +42,7 @@ Port = 8545
ReadTimeout = "60s"
WriteTimeout = "60s"
MaxRequestsPerIPAndSecond = 5000
SequencerNodeURI = "https://zkevm-rpc.com"
SequencerNodeURI = "https://xagon-rpc.com"
EnableL2SuggestedGasPricePolling = false
[RPC.WebSockets]
Enabled = true
Expand All @@ -54,10 +54,10 @@ SyncChunkSize = 100
TrustedSequencerURL = "" # If it is empty or not specified, then the value is read from the smc

[MTClient]
URI = "zkevm-prover:50061"
URI = "xagon-prover:50061"

[Executor]
URI = "zkevm-prover:50071"
URI = "xagon-prover:50071"
MaxResourceExhaustedAttempts = 3
WaitOnResourceExhaustion = "1s"
MaxGRPCMessageSize = 100000000
Expand All @@ -74,7 +74,7 @@ ProfilingEnabled = false
User = "prover_user"
Password = "prover_pass"
Name = "prover_db"
Host = "zkevm-state-db"
Host = "xagon-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
12 changes: 6 additions & 6 deletions config/environments/testnet/node.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Outputs = ["stderr"]
User = "state_user"
Password = "state_password"
Name = "state_db"
Host = "zkevm-state-db"
Host = "xagon-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand All @@ -26,7 +26,7 @@ FreeGasAddress = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
User = "pool_user"
Password = "pool_password"
Name = "pool_db"
Host = "zkevm-pool-db"
Host = "xagon-pool-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand All @@ -44,7 +44,7 @@ Port = 8545
ReadTimeout = "60s"
WriteTimeout = "60s"
MaxRequestsPerIPAndSecond = 5000
SequencerNodeURI = "https://rpc.public.zkevm-test.net/"
SequencerNodeURI = "https://rpc.public.xagon-test.net/"
EnableL2SuggestedGasPricePolling = false
[RPC.WebSockets]
Enabled = true
Expand All @@ -55,10 +55,10 @@ SyncInterval = "2s"
SyncChunkSize = 100

[MTClient]
URI = "zkevm-prover:50061"
URI = "xagon-prover:50061"

[Executor]
URI = "zkevm-prover:50071"
URI = "xagon-prover:50071"
MaxResourceExhaustedAttempts = 3
WaitOnResourceExhaustion = "1s"
MaxGRPCMessageSize = 100000000
Expand All @@ -75,7 +75,7 @@ ProfilingEnabled = false
User = "prover_user"
Password = "prover_pass"
Name = "prover_db"
Host = "zkevm-state-db"
Host = "xagon-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Loading

0 comments on commit 216c926

Please sign in to comment.