-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
The field totalDifficulty
was removed from the official Ethereum JSON RPC Block
schema in ethereum/execution-apis#570.
It seems some clients did already remove it (Erigon), but others chose not to (Nethermind), leading to inconsistent answers between providers when calling the EVM RPC canister with eth_getBlockByNumber
.
Example with a recent block:
Ankr
when queried for the block 0x1312d00
returns a value containing the field totalDifficulty
, while the same query for PublicNode
does not:
curl -s --location 'https://rpc.ankr.com/eth' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc":"2.0",
"method":"eth_getBlockByNumber",
"params":[
"0x1312d00",
false
],
"id":1
}' | jq .result.totalDifficulty
"0xc70d815d562d3cfa955"
curl -s --location 'https://ethereum.publicnode.com' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc":"2.0",
"method":"eth_getBlockByNumber",
"params":[
"0x1312d00",
false
],
"id":1
}' | jq .result.totalDifficulty
Example with an old block:
The field totalDifficulty
is not only removed from blocks post-merge, but also pre-existing blocks are affected.
Ankr
when queried for the block 0x0
returns a value containing the field totalDifficulty
, while the same query for PublicNode
does not:
curl -s --location 'https://rpc.ankr.com/eth' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc":"2.0",
"method":"eth_getBlockByNumber",
"params":[
"0x0",
false
],
"id":1
}' | jq .result.totalDifficulty
"0x400000000"
curl -s --location 'https://ethereum.publicnode.com' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc":"2.0",
"method":"eth_getBlockByNumber",
"params":[
"0x0",
false
],
"id":1
}' | jq .result.totalDifficulty
Metadata
Metadata
Assignees
Labels
No labels