iotex-core icon indicating copy to clipboard operation
iotex-core copied to clipboard

Archive mode related RPC return wrong result

Open ququzone opened this issue 1 year ago • 0 comments

What version of iotex-core image (or code branch) are you using?

All

What did you do? If possible, provide a recipe for reproducing the error.

Query chain' state from block height related RPC, the result always return latest state, not queried height.

curl https://babel-api.mainnet.iotex.io \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getBalance","params":["0x3c3acce50f7bb6390937139f9e10f99478a83702", "0x1f4"],"id":1,"jsonrpc":"2.0"}'

{"jsonrpc":"2.0","id":1,"result":"0x399a62af592971339dcb"}

What did you expect to see?

{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"missing trie node 945e00a1e6f72d0cea125f726a81a110c5f04da829238e186cdcf5e887e8be79 (path )"}}

A pruned node cannot serve API requests for certain RPC methods older than 128 blocks.

Should fixed API:

  • eth_getBalance
  • eth_getCode
  • eth_getTransactionCount
  • eth_getStorageAt
  • eth_call

ququzone avatar Mar 06 '24 05:03 ququzone