Polygon zkEVM RPC服务

1. 引言

Polygon zkEVM节点可提供如下服务:

  • 1)synchronizer服务:所运行zkEVM节点必须运行的基础服务,其它服务均需依赖于synchronizer服务。负责在L1与L2网络间同步数据。
  • 2)eth-tx-manager服务
  • 3)sequencer服务:用存储于Pool数据库中的交易构建new batches。
  • 4)sequencerSender服务
  • 5)RPC服务:将交易relay给Trusted sequencer。
    启动脚本可为:/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
    依赖:
    • synchronizer服务
    • statedb数据库
    • rpc数据库,即pooldb
    • Prover所提供的Merkle Tree和Executor服务
  • 6)aggregator服务:作为Prover的服务端,接收Prover连接请求,负责为待证明batches 生成proofs。
  • 7)l2gaspricer服务

Polygon zkEVM节点RPC服务所支持的JSON RPC endpoints与以太坊节点的有所不同,当前支持的JSON RPC endpoints有:

  • 1)对应debug api有:【debug endpoints表示相应接口未经深度测试】【对应endpoints_debug.go内各函数】
    • debug_traceBlockByHash
    • debug_traceBlockByNumber
    • debug_traceTransaction
  • 2)对应eth api有:【对应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)对应net api有:【对应endpoints_net.go内各函数】
    • net_version
  • 4)对应txpool api有:【对应endpoints_txpool.go内各函数】
    • txpool_content * response is always empty
  • 5)对应web3 api有:【对应endpoints_web3.go内各函数】
    • web3_clientVersion
    • web3_sha3
  • 6)对应zkevm api有:【对应endpoints_zkevm.go内各函数】
    • zkevm_batchNumber
    • zkevm_batchNumberByBlockNumber
    • zkevm_consolidatedBlockNumber
    • zkevm_getBatchByNumber
    • zkevm_isBlockConsolidated
    • zkevm_isBlockVirtualized
    • zkevm_verifiedBatchNumber
    • zkevm_virtualBatchNumber

参考资料

[1] Component: RPC
[2] JSON RPC Endpoints

附录:Polygon Hermez 2.0 zkEVM系列博客

  • ZK-Rollups工作原理
  • Polygon zkEVM——Hermez 2.0简介
  • Polygon zkEVM网络节点
  • Polygon zkEVM 基本概念
  • Polygon zkEVM Prover
  • Polygon zkEVM工具——PIL和CIRCOM
  • Polygon zkEVM节点代码解析
  • Polygon zkEVM的pil-stark Fibonacci状态机初体验
  • Polygon zkEVM的pil-stark Fibonacci状态机代码解析
  • Polygon zkEVM PIL编译器——pilcom 代码解析
  • Polygon zkEVM Arithmetic状态机
  • Polygon zkEVM中的常量多项式
  • Polygon zkEVM Binary状态机
  • Polygon zkEVM Memory状态机
  • Polygon zkEVM Memory Align状态机
  • Polygon zkEVM zkASM编译器——zkasmcom
  • Polygon zkEVM哈希状态机——Keccak-256和Poseidon
  • Polygon zkEVM zkASM语法
  • Polygon zkEVM可验证计算简单状态机示例
  • Polygon zkEVM zkASM 与 以太坊虚拟机opcode 对应集合
  • Polygon zkEVM zkROM代码解析(1)
  • Polygon zkEVM zkASM中的函数集合
  • Polygon zkEVM zkROM代码解析(2)
  • Polygon zkEVM zkROM代码解析(3)
  • Polygon zkEVM公式梳理
  • Polygon zkEVM中的Merkle tree
  • Polygon zkEVM中Goldilocks域元素circom约束
  • Polygon zkEVM Merkle tree的circom约束
  • Polygon zkEVM FFT和多项式evaluate计算的circom约束
  • Polygon zkEVM R1CS与Plonk电路转换
  • Polygon zkEVM中的子约束系统
  • Polygon zkEVM交易解析
  • Polygon zkEVM 审计及递归证明
  • Polygon zkEVM发布公开测试网2.0
  • Polygon zkEVM测试集——创建合约交易
  • Polygon zkEVM中的Recursive STARKs
  • Polygon zkEVM的gas定价
  • Polygon zkEVM zkProver基本设计原则 以及 Storage状态机
  • Polygon zkEVM bridge技术文档
  • Polygon zkEVM Trustless L2 State Management 技术文档
  • Polygon zkEVM中的自定义errors

你可能感兴趣的:(zkVM,zkVM)