cdk-erigon is a fork of Erigon, currently in Alpha, optimized for syncing with the Polygon Hermez zkEVM network.
In order to use the optimal vectorized poseidon hashing for the Sparse Merkle Tree, on x86 the following packages are required (for Apple silicone it will fall back to the iden3 library and as such these dependencies are not required in that case.
Please install:
- Linux:
libgtest-dev
libomp-dev
libgmp-dev
- MacOS:
brew install libomp
brew install gmp
Using the Makefile command: make build-libs
will install these for the relevant architecture.
Enable Sequencer: CDK_ERIGON_SEQUENCER=1 ./build/bin/cdk-erigon <flags>
In order to enable the zkevm_ namespace, please add 'zkevm' to the http.api flag (see the example config below).
zkevm_batchNumber
zkevm_batchNumberByBlockNumber
zkevm_consolidatedBlockNumber
zkevm_getBatchByNumber
zkevm_isBlockConsolidated
zkevm_verifiedBatchNumber
zkevm_isBlockVirtualized
zkevm_virtualBatchNumber
zkevm_getFullBlockByHash
zkevm_getFullBlockByNumber
zkevm_getNativeBlockHashesInRange
- The golden poseidon hashing will be much faster on x86, so developers on Mac may experience slowness on Apple silicone
- Falling behind the network significantly will cause a SMT rebuild - which will take some time for longer chains
Config files are the easiest way to configure cdk-erigon, there are examples in the repository for each network e.g. hermezconfig-mainnet.yaml.example
.
Depending on the RPC provider you are using, you may wish to alter zkevm.rpc-ratelimit
.
- Build using
make cdk-erigon
- Set up your config file (copy an example and edit as required)
- run
./build/bin/cdk-erigon --config="./hermezconfig-{network}.yaml"
(complete the name of your config file as required)
NB: --externalcl
flag is removed in upstream erigon so beware of re-using commands/config
Network Name | Chain ID | ForkID | Genesis File | RPC URL | Rootchain | Rollup Address |
---|---|---|---|---|---|---|
zkEVM Mainnet | 1101 | 7 | Link | Mainnet RPC | Ethereum Mainnet | 0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2 |
zkEVM Cardona | 2442 | 7 | Link | Cardona RPC | Sepolia | 0x32d33D5137a7cFFb54c5Bf8371172bcEc5f310ff |
- Block Explorers:
- Mainnet: PolygonScan Mainnet
- Cardona: PolygonScan Cardona
Supported by Gateway.fm and Limechain.