Polygon zkEVM RPC service

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
      • doesn’t support state override at the moment and pending block. Will be implemented #1990
      • doesn’t support from values that are smart contract addresses. Will be implemented #2017
    • eth_chainId
    • eth_estimateGas * if the block number is set to pending we assume it is the latest
    • eth_gasPrice
    • eth_getBalance * if the block number is set to pending we assume it is the latest
    • eth_getBlockByHash
    • eth_getBlockByNumber
    • eth_getBlockTransactionCountByHash
    • eth_getBlockTransactionCountByNumber
    • eth_getCode * if the block number is set to pending we assume it is the latest
    • eth_getCompilers * response is always empty
    • eth_getFilterChanges
    • eth_getFilterLogs
    • eth_getLogs
    • eth_getStorageAt * if the block number is set to pending we assume it is the latest
    • eth_getTransactionByBlockHashAndIndex
    • eth_getTransactionByBlockNumberAndIndex * if the block number is set to pending we assume it is the latest
    • eth_getTransactionByHash
    • eth_getTransactionCount
    • eth_getTransactionReceipt * doesn’t include effectiveGasPrice. Will include once EIP1559 is implemented
    • eth_getUncleByBlockHashAndIndex * response is always empty
    • eth_getUncleByBlockNumberAndIndex * response is always empty
    • eth_getUncleCountByBlockHash * response is always zero
    • eth_getUncleCountByBlockNumber * response is always zero
    • eth_newBlockFilter
    • eth_newFilter
    • eth_protocolVersion * response is always zero
    • eth_sendRawTransaction * can relay TXs to another node
    • eth_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

Guess you like

Origin blog.csdn.net/mutourend/article/details/130642477