Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Commit e0d6ff9

Browse files
zjg555543scf0220
authored andcommitted
rebranding to X1 (#36)
* update name * rename * renmae * fix e2e * fix e2e * fix e2e * fix e2e * fix e2e * fix e2e * fix e2e * fix e2e * update e2e image * update mod file * update e2e image
1 parent dabf197 commit e0d6ff9

53 files changed

Lines changed: 1829 additions & 2505 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
name: Report a bug
3-
about: Something with Polygon zkEVM is not working as expected
3+
about: Something with X1 is not working as expected
44
title: ''
55
labels: 'type:bug'
66
assignees: ''
77
---
88

99
#### System information
1010

11-
zkEVM Node version: `v0.0.X-RCXX`
11+
X1 Node version: `v0.0.X-RCXX`
1212
OS & Version: `Windows/Linux/OSX`
1313
Commit hash : (if `develop`)
1414
Network: `Mainnet/Testnet`

.github/workflows/test-from-prover.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test from zkevm-prover call
1+
name: Test from x1-prover call
22
on:
33
workflow_call:
44
inputs:
@@ -17,15 +17,15 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
go-version: [ 1.21.x ]
20+
go-version: [ 1.19.x ]
2121
goarch: [ "amd64" ]
2222
e2e-group: [ 2 ]
2323

2424
steps:
2525
- name: Checkout code
2626
uses: actions/checkout@v3
2727
with:
28-
repository: 0xPolygonHermez/zkevm-node
28+
repository: okx/x1-node
2929

3030
- name: Install Go
3131
uses: actions/setup-go@v3
@@ -35,7 +35,7 @@ jobs:
3535
GOARCH: ${{ matrix.goarch }}
3636

3737
- name: Login to DockerHub
38-
uses: docker/login-action@v3
38+
uses: docker/login-action@v2
3939
with:
4040
username: ${{ secrets.DOCKERHUB_USERNAME }}
4141
password: ${{ secrets.DOCKERHUB_TOKEN }}

README.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# zkEVM Node
1+
# X1 Node
22

3-
zkEVM Node is a Go implementation of a node that operates the Polygon zkEVM Network.
3+
X1 Node is a Go implementation of a node that operates the X1 Network.
44

5-
## About the Polygon zkEVM network
5+
## About the X1 network
66

7-
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.
7+
Since this is an implementation of a protocol it's fundamental to understand it, [here]() you can find the specification of the protocol.
88

99
Glossary:
1010

1111
- 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.
12-
- L2: the rollup network aka the Polygon zkEVM network.
13-
- 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
12+
- L2: the rollup network aka the X1 network.
13+
- Batch: a group of transactions that are executed/proved, using the [X1 prover]() and sent to / synchronized from L1
1414
- Sequencer: the actor that is responsible for selecting transactions, putting them in a specific order, and sending them in batches to L1
1515
- 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)
1616
- 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.
@@ -20,8 +20,9 @@ Glossary:
2020
- 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
2121
- 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
2222
- 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.
23-
- 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)
23+
- 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 X1 (each batch can make use of a limited amount of resources such as the total amount of keccak hashes that can be computed)
2424
- 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.
25+
- Proof of Efficiency (PoE): name of the protocol used by the network, it's enforced by the [smart contracts](https://github.com/okx/x1-contracts)
2526

2627
## Architecture
2728

@@ -31,21 +32,19 @@ Glossary:
3132

3233
The diagram represents the main components of the software and how they interact between them. Note that this reflects a single entity running a node, in particular a node that acts as the trusted sequencer. But there are many entities running nodes in the network, and each of these entities can perform different roles. More on this later.
3334

34-
- (JSON) RPC: an HTTP interface that allows users (dApps, metamask, etherscan, ...) to interact with the node. Fully compatible with Ethereum RPC + some extra [custom endpoints](./docs/zkEVM-custom-endpoints.md) specifics of the network. It interacts with the `state` (to get data and process transactions) as well as the `pool` (to store transactions).
35-
- L2GasPricer: it fetches the L1 gas price and applies some formula to calculate the gas price that will be suggested for the users to use for paying fees on L2. The suggestions are stored on the `pool`, and will be consumed by the `rpc`
35+
- (JSON) RPC: an interface that allows users (metamask, etherscan, ...) to interact with the node. Fully compatible with Ethereum RPC + some extra endpoints specifics of the network. It interacts with the `state` to get data and process transactions and with the `pool` to store transactions
3636
- Pool: DB that stores transactions by the `RPC` to be selected/discarded by the `sequencer` later on
37-
- Sequencer: responsible for building the trusted state. To do so, it gets transactions from the pool and puts them in a specific order. It needs to take care of opening and closing batches while trying to make them as full as possible. To achieve this it needs to use the executor to actually process the transaction not only to execute the state transition (and update the hashDB) but also to check the consumed resources by the transactions and the remaining resources of the batch. After executing a transaction that fits into a batch, it gets stored on the `state`. Once transactions are added into the state, they are immediately available through the `rpc`.
38-
- SequenceSender: gets closed batches from the `state`, tries to aggregate as many of them as possible, and at some point, decides that it's time to send those batches to L1, turning the state from trusted to virtualized. In order to send the L1 tx, it uses the `ethtxmanager`
39-
- EthTxManager: handles requests to send L1 transactions from `sequencesender` and `aggregator`. It takes care of dealing with the nonce of the accounts, increasing the gas price, and other actions that may be needed to ensure that L1 transactions get mined
37+
- Trusted Sequencer: get transactions from the `pool`, check if they are valid by processing them using the `state`, and create sequences. Once transactions are added into the state, they are immediately available through the `rpc`. Sequences are sent to L1 using the `etherman`
38+
- Permissionless Sequencer: *coming soon*
4039
- Etherman: abstraction that implements the needed methods to interact with the Ethereum network and the relevant smart contracts.
41-
- Synchronizer: Updates the `state` (virtual batches, verified batches, forced batches, ...) by fetching data from L1 through the `etherman`. If the node is not a `trusted sequencer` it also updates the state with the data fetched from the `rpc` of the `trusted sequencer`. It also detects and handles reorgs that can happen if the `trusted sequencer` sends different data in the rpc vs the sequences sent to L1 (trusted reorg aka L2 reorg). Also handles L1 reorgs (reorgs that happen on the L1 network)
40+
- Synchronizer: Updates the `state` by fetching data from Ethereum through the `etherman`. If the node is not a `trusted sequencer` it also updates the state with the data fetched from the `rpc` of the `trusted sequencer`. It also detects and handles reorgs that can happen if the `trusted sequencer` sends different data in the rpc vs the sequences sent to L1 (trusted vs virtual state)
4241
- 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
43-
- State DB: persistence layer for the state data (except the Merkletree that is handled by the `HashDB` service), it stores informationrelated to L1 (blocks, global exit root updates, ...) and L2 (batches, L2 blocks, transactions, ...)
44-
- 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 sends a request to send an L1 tx to verify the proof and move the state from virtual to verified to the `ethtxmanager`. Note that provers connect to the aggregator and not the other way arround. The aggregator can handle multiple connected provers at once and make them work concurrently in the generation of different proofs
45-
- Prover/Executor/hashDB: 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/binary, it implements three services:
46-
- Executor: Provides an EVM implementation that allows processing batches as well as getting metadata (state root, transaction receipts, logs, ...) of all the needed results.
47-
- Prover: Generates ZKPs for batches, batches aggregation, and final proofs.
48-
- HashDB: service that stores the Merkletree, containing all the account information (balances, nonces, smart contract code, and smart contract storage)
42+
- State DB: persistence layer for the state data (except the Merkletree that is handled by the `Merkletree` service)
43+
- 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`
44+
- 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/x1-prover). Although it's the same software/service, it has two very different purposes:
45+
- Provide an EVM implementation that allows processing transactions and getting all needed results metadata (state root, receipts, logs, ...)
46+
- Generate ZKPs
47+
- 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/x1-prover)
4948

5049
## Roles of the network
5150

@@ -64,8 +63,8 @@ Required services and components:
6463

6564
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
6665

67-
- [`zkEVM RPC endpoints`](./docs/json-rpc-endpoints.md)
68-
- [`zkEVM RPC Custom endpoints documentation`](./docs/zkEVM-custom-endpoints.md)
66+
- [`X1 RPC endpoints`](./docs/json-rpc-endpoints.md)
67+
- [`X1 RPC Custom endpoints documentation`](./docs/zkEVM-custom-endpoints.md)
6968

7069
### Trusted sequencer
7170

@@ -81,6 +80,10 @@ Required services and components:
8180

8281
Note that the JSON RPC is required to receive transactions. It's recommended that the JSON RPC runs on separated instances, and potentially more than one (depending on the load of the network). It's also recommended that the JSON RPC and the Sequencer don't share the same executor instance, to make sure that the sequencer has exclusive access to an executor
8382

83+
### Permissionless sequencer
84+
85+
TBD
86+
8487
### Aggregator
8588

8689
This role can be performed by anyone.
@@ -107,7 +110,7 @@ It's recommended to use `make` for building, and testing the code, ... Run `make
107110

108111
### Requirements
109112

110-
- Go 1.21
113+
- Go 1.19
111114
- Docker
112115
- Docker Compose
113116
- Make

0 commit comments

Comments
 (0)