parity-ethereum icon indicating copy to clipboard operation
parity-ethereum copied to clipboard

trace_call doesn't work with the "pending" block argument: Couldn't parse parameters: `BlockNumber::Pending` is not supported

Open max-block opened this issue 4 years ago • 1 comments

  • OpenEthereum version: v3.0.1
  • Operating system: Linux
  • Installation: binary from github
  • Fully synchronized: yes
  • Network: goerli
  • Restarted: no

trace_call request works fine with "latest" block:

curl  -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"trace_call","params":[{"to": "0x509ee0d083ddf8ac028f2a56731412edd63223b9", "data": "0x18160ddd"}, ["trace"], "latest"],"id":71}'

{"jsonrpc":"2.0","result":{"output":"0x000000000000000000000000000000000000000000000000000000174876e800","stateDiff":null,"trace":[{"action":{"callType":"call","from":"0x0000000000000000000000000000000000000000","gas":"0x1dcd12b8","input":"0x18160ddd","to":"0x509ee0d083ddf8ac028f2a56731412edd63223b9","value":"0x0"},"result":{"gasUsed":"0x7db","output":"0x000000000000000000000000000000000000000000000000000000174876e800"},"subtraces":0,"traceAddress":[],"type":"call"}],"vmTrace":null},"id":71}

But it fails with the "pending" block parameter:

curl  -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"trace_call","params":[{"to": "0x509ee0d083ddf8ac028f2a56731412edd63223b9", "data": "0x18160ddd"}, ["trace"], "pending"],"id":71}'


{"jsonrpc":"2.0","error":{"code":-32602,"message":"Couldn't parse parameters: `BlockNumber::Pending` is not supported","data":"()"},"id":71}

Docs say that trace_call supports "pending" block parameter: https://openethereum.github.io/wiki/JSONRPC-trace-module.html#trace_call

Quantity or Tag - (optional) Integer of a block number, or the string 'earliest', 'latest' or 'pending'.

max-block avatar Jun 20 '20 08:06 max-block

Hi, Pending was made deprecated, I suppose that there were some problems with it. We need to change that wiki.

BlockNumber::Pending => return Err(errors::invalid_params("`BlockNumber::Pending` is not supported", ())),

rakita avatar Aug 11 '20 12:08 rakita