Skip to main content

πŸ›Ÿ CDK Erigon RPC Methods

CDK-Erigon RPC Methods​

Transaction Pool (txpool)​

txpool_content

Description:​

Returns details of all pending and queued transactions in the transaction pool.

Parameters:​

None

Response:​

Returns an object containing:

  • pending – A list of transactions waiting to be included in a block.
  • queued – A list of transactions that are queued due to nonce gaps.

Example:​

{
"pending": { "0xSenderAddress": [{ "to": "0xReceiver", "value": "0x10" }] },
"queued": { "0xSenderAddress": [{ "to": "0xReceiver", "value": "0x20" }] }
}
txpool_contentFrom

Description:​

Fetches all pending and queued transactions from a specific sender.

Parameters:​

  • address (string): The sender’s Ethereum address.

Response:​

Returns the list of transactions originating from the specified sender.

Example:​

{
"pending": [{ "to": "0xReceiver", "value": "0x10" }],
"queued": [{ "to": "0xReceiver", "value": "0x20" }]
}
txpool_limbo

Description:​

Returns transactions that are stuck in limbo due to missing dependencies or nonce gaps.

Parameters:​

None

Response:​

Returns an array of transactions that are unprocessable.

Example:​

{
"limbo": [{ "from": "0xSender", "nonce": 5, "to": "0xReceiver" }]
}

zkEVM Methods (zkevm)​

zkevm_batchNumber

Description:​

Returns the latest batch number finalized on L1.

Parameters:​

None

Response:​

  • batchNumber (integer): The latest verified batch.

Example:​

{
"batchNumber": 10045
}
zkevm_batchNumberByBlockNumber

Description:​

Fetches the batch number corresponding to a specific block number.

Parameters:​

  • blockNumber (integer): The L2 block number.

Response:​

  • batchNumber (integer): The batch associated with the block.

Example:​

{
"batchNumber": 9998
}
zkevm_consolidatedBlockNumber

Description:​

Retrieves the latest L2 block that has been consolidated.

Parameters:​

None

Response:​

  • blockNumber (integer): The latest consolidated L2 block.

Example:​

{
"blockNumber": 105432
}
zkevm_estimateCounters

Description:​

Estimates the counter usage for a given transaction, similar to estimateGas but for zkEVM.

Parameters:​

  • transaction (object): The transaction object to analyze.

Response:​

  • counterEstimate (integer): Estimated zk-counter usage.

Example:​

{
"counterEstimate": 25000
}
zkevm_getBatchByNumber

Description:​

Returns details about a specific batch by its number.

Parameters:​

  • batchNumber (integer): The batch ID to fetch.

Response:​

Batch details, including block range, state root, and L1 commitment status.

Example:​

{
"batch": {
"batchNumber": 10045,
"blockRange": "100430-100450",
"stateRoot": "0xabcdef"
}
}
zkevm_getBatchCountersByNumber

Description:​

Retrieves the counter usage details of a specific batch.

Parameters:​

  • batchNumber (integer): The batch ID.

Response:​

A list of counter values for that batch.

Example:​

{
"counters": {
"zkCountersUsed": 14000,
"gasUsed": 8000000
}
}
zkevm_getBatchWitness

Description:​

Returns the witness data used to generate a zk-proof for a batch.

Parameters:​

  • batchNumber (integer): The batch ID.

Response:​

A large witness dataset used in zk-proof computation.

Example:​

{
"witnessData": "0xabcdef12345..."
}
zkevm_getExitRootTable

Description:​

Returns the global exit root table.

Parameters:​

None

Response:​

A mapping of all exit roots across different rollups.

Example:​

{
"exitRoots": {
"rollup1": "0x123abc...",
"rollup2": "0x456def..."
}
}
zkevm_isBlockConsolidated

Description:​

Checks if an L2 block has been consolidated into a batch.

Parameters:​

  • blockNumber (integer): The L2 block ID.

Response:​

  • boolean (true/false): Whether the block is consolidated.

Example:​

{
"isConsolidated": true
}
zkevm_verifiedBatchNumber

Description:​

Returns the last verified batch number on L1.

Parameters:​

None

Response:​

  • batchNumber (integer): The latest verified batch.

Example:​

{
"batchNumber": 10432
}

Other zkEVM Methods​

MethodDescription
zkevm_getForkByIdFetches details of a specific fork by its ID.
zkevm_getForksLists all available forks in the zkEVM environment.
zkevm_getLatestDataStreamBlockRetrieves the latest block in the data stream.
zkevm_getLatestGlobalExitRootReturns the latest exit root for rollup transactions.
zkevm_getRollupAddressFetches the rollup contract address.
zkevm_getRollupManagerAddressRetrieves the address of the rollup manager contract.
zkevm_getVersionHistoryReturns a list of version upgrades and changes.

Notes on Usage​

  • State Verification: Some calls return trusted vs. verified results, meaning finality may depend on L1 settlement.
  • Performance Considerations: Calls returning large datasets (e.g., getWitness) may take longer to execute.
  • Gas Considerations: zkevm_estimateCounters helps optimize transaction gas usage in zkEVM environments.

For more details, refer to the Polygon zkEVM API Documentation: Polygon zkEVM Docs.