Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONRPC: eth_call proceed 'input' field unexpectedly for view functions #95

Closed
topcai opened this issue Oct 31, 2023 · 1 comment · Fixed by #104 or #103
Closed

JSONRPC: eth_call proceed 'input' field unexpectedly for view functions #95

topcai opened this issue Oct 31, 2023 · 1 comment · Fixed by #104 or #103
Assignees

Comments

@topcai
Copy link

topcai commented Oct 31, 2023

According to JSON-RPC spec( https://ethereum.github.io/execution-apis/api-documentation/ ), eth_call accepts 'input' as a parameter.

However, calling eth_call for contract view functions with 'input' filed instead of 'data' filed, the RPC returned 'execution reverted'. Replace 'input' with 'data' works.

Reproduce step for testnet:
non-working: {"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"from":"0x0000000000000000000000000000000000000000","input":"0x54fd4d50","to":"0x40d046f41b6e161909054c0f3ae075199d363c23"},"latest"]}
working: {"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"from":"0x0000000000000000000000000000000000000000","data":"0x54fd4d50","to":"0x40d046f41b6e161909054c0f3ae075199d363c23"},"latest"]}

@topcai
Copy link
Author

topcai commented Oct 31, 2023

found the cause. it is because silkworm rpc ignores 'input' filed and set 'data' as empty bytes when there's no 'data' filed present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment