curl --request POST \
--url https://nd-363-550-219.p2pify.com/942aad90bb6a082676497030b81e40ba \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "zkevm_consolidatedBlockNumber",
"params": []
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}curl --request POST \
--url https://nd-363-550-219.p2pify.com/942aad90bb6a082676497030b81e40ba \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "zkevm_consolidatedBlockNumber",
"params": []
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}Polygon zkEVM API method that returns the latest consolidated block number. The Polygon zkEVM chain uses batch verification to improve scalability and reduce gas fees. This means that multiple transactions are grouped together and verified as a single batch using zero-knowledge proofs. Once a batch is verified, it is connected to the blockchain, and the block number of the most recent block in that batch becomes the “consolidated block number.”Documentation Index
Fetch the complete documentation index at: https://chainstack-mintlify-flesh-empty-pages.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
noneresult — the hexadecimal value of the node’s latest consolidated block number. The block number is used to identify the block’s position in the blockchain and is updated every time a new batch of transactions is added to the chain.zkevm_consolidatedBlockNumber code examplesconst Web3 = require("web3");
const NODE_URL = "YOUR_CHAINSTACK_ENDPOINT";
const web3 = new Web3(NODE_URL);
web3.extend({
property: 'zkEVM',
methods: [{
name: 'consolidatedBlockNumber',
call: 'zkevm_consolidatedBlockNumber',
params: 0,
inputFormatter: [],
outputFormatter: null
}]
});
async function consolidatedBlockNumber() {
const consolidated = await web3.zkEVM.consolidatedBlockNumber()
console.log(consolidated)
}
consolidatedBlockNumber();
Was this page helpful?