1 Introduction
Polygon zkEVM nodes can provide the following services:
- 1) Synchronizer service: the basic service that the running zkEVM node must run, and other services must depend on the synchronizer service. Responsible for synchronizing data between L1 and L2 networks.
- 2) eth-tx-manager service
- 3) Sequencer service: build new batches with transactions stored in the Pool database.
- 4) sequencerSender service
- 5) RPC service: relay the transaction to the Trusted sequencer.
The startup script can be:/app/zkevm-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components rpc --http.api eth,net,debug,zkevm,txpool,web3
Depends on:- synchronizer service
- statedb database
- rpc database, namely pooldb
- Merkle Tree and Executor services provided by Prover
- 6) aggregator service: As the Prover server, it receives the Prover connection request and is responsible for generating proofs for the batches to be proved.
- 7) l2gaspricer service
The JSON RPC endpoints supported by the Polygon zkEVM node RPC service are different from those of the Ethereum node. The currently supported JSON RPC endpoints are:
- 1) The corresponding debug APIs are: [debug endpoints indicate that the corresponding interface has not been tested in depth] [corresponding to functions in endpoints_debug.go]
debug_traceBlockByHash
debug_traceBlockByNumber
debug_traceTransaction
- 2) The corresponding eth api is: [corresponding to each function in endpoints_eth.go]
eth_blockNumber
eth_call
eth_chainId
eth_estimateGas
* if the block number is set to pending we assume it is the latesteth_gasPrice
eth_getBalance
* if the block number is set to pending we assume it is the latesteth_getBlockByHash
eth_getBlockByNumber
eth_getBlockTransactionCountByHash
eth_getBlockTransactionCountByNumber
eth_getCode
* if the block number is set to pending we assume it is the latesteth_getCompilers
* response is always emptyeth_getFilterChanges
eth_getFilterLogs
eth_getLogs
eth_getStorageAt
* if the block number is set to pending we assume it is the latesteth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
* if the block number is set to pending we assume it is the latesteth_getTransactionByHash
eth_getTransactionCount
eth_getTransactionReceipt
* doesn’t include effectiveGasPrice. Will include once EIP1559 is implementedeth_getUncleByBlockHashAndIndex
* response is always emptyeth_getUncleByBlockNumberAndIndex
* response is always emptyeth_getUncleCountByBlockHash
* response is always zeroeth_getUncleCountByBlockNumber
* response is always zeroeth_newBlockFilter
eth_newFilter
eth_protocolVersion
* response is always zeroeth_sendRawTransaction
* can relay TXs to another nodeeth_subscribe
eth_syncing
eth_uninstallFilter
eth_unsubscribe
- 3) The corresponding net api is: [corresponding to each function in endpoints_net.go]
net_version
- 4) The corresponding txpool apis are: [corresponding to each function in endpoints_txpool.go]
txpool_content
* response is always empty
- 5) Corresponding to web3 api: [corresponding to each function in endpoints_web3.go]
web3_clientVersion
web3_sha3
- 6) Corresponding to zkevm api are: [corresponding to each function in endpoints_zkevm.go]
zkevm_batchNumber
zkevm_batchNumberByBlockNumber
zkevm_consolidatedBlockNumber
zkevm_getBatchByNumber
zkevm_isBlockConsolidated
zkevm_isBlockVirtualized
zkevm_verifiedBatchNumber
zkevm_virtualBatchNumber
References
[1] Component: RPC
[2] JSON RPC Endpoints
Appendix: Polygon Hermez 2.0 zkEVM series blog
- Working principle of ZK-Rollups
- Polygon zkEVM - Introduction to Hermez 2.0
- Polygon zkEVM network node
- Basic concept of Polygon zkEVM
- Polygon zkEVM Prover
- Polygon zkEVM tools - PIL and CIRCOM
- Polygon zkEVM node code analysis
- First experience of Polygon zkEVM's pil-stark Fibonacci state machine
- Polygon zkEVM's pil-stark Fibonacci state machine code analysis
- Polygon zkEVM PIL compiler - pilcom code analysis
- Polygon zkEVM Arithmetic state machine
- Constant polynomials in Polygon zkEVM
- Polygon zkEVM Binary state machine
- Polygon zkEVM Memory state machine
- Polygon zkEVM Memory Align state machine
- Polygon zkEVM zkASM Compiler - zkasmcom
- Polygon zkEVM hash state machine - Keccak-256 and Poseidon
- Polygon zkEVM zkASM Syntax
- Polygon zkEVM Verifiable Computational Simple State Machine Example
- The corresponding set of Polygon zkEVM zkASM and Ethereum virtual machine opcode
- Polygon zkEVM zkROM code analysis (1)
- Collection of functions in Polygon zkEVM zkASM
- Polygon zkEVM zkROM code analysis (2)
- Polygon zkEVM zkROM code analysis (3)
- Polygon zkEVM formula combing
- Merkle tree in Polygon zkEVM
- Goldilocks domain element circom constraint in Polygon zkEVM
- Circom constraints of Polygon zkEVM Merkle tree
- Circom constraints for Polygon zkEVM FFT and polynomial evaluate calculations
- Polygon zkEVM R1CS and Plonk circuit conversion
- Subconstraint system in Polygon zkEVM
- Polygon zkEVM transaction analysis
- Polygon zkEVM audit and recursive proof
- Polygon zkEVM Releases Public Testnet 2.0
- Polygon zkEVM test set - create contract transactions
- Recursive STARKs in Polygon zkEVM
- Gas pricing for Polygon zkEVM
- Polygon zkEVM zkProver basic design principles and Storage state machine
- Polygon zkEVM bridge technical documentation
- Polygon zkEVM Trustless L2 State Management Technical Documentation
- Custom errors in Polygon zkEVM