Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

EIP-1898 Support #460

Closed
FrancoCRO opened this issue Aug 19, 2021 · 2 comments · Fixed by #462
Closed

EIP-1898 Support #460

FrancoCRO opened this issue Aug 19, 2021 · 2 comments · Fixed by #462
Assignees

Comments

@FrancoCRO
Copy link

Proposal:
To handle the impact of reorg, thegraph calls eth_call using blockHash instead of blockNumber.
graphprotocol/graph-node#1905

The format of the call is defined at EIP-1898
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1898.md

Current behavior:
Currently eth_call can be only obtained by passing blockNumber (non EIP-1898-standard) to second argument

curl https://cronos.fran.co \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_call","params": [{"to": "0x2C68A5c3799E2da8f15b3dBa6b124f7e785FDE77", "data": "0x5855a25a"}, "0xcb"],"id":1}
   
{"jsonrpc":"2.0","id":1,"result":"0x58f463652aa22ce6fbc84f78c2b04b003ea073e87e5a3becae7cddb0ea2640cd"}

But not {"blockNumber": "0xcb"}

curl https://cronos.fran.co \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_call","params": [{"to": "0x2C68A5c3799E2da8f15b3dBa6b124f7e785FDE77", "data": "0x5855a25a"}, {"blockNumber": "0xcb"}],"id":1}

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

nor {"blockHash": "0xd6fed18b7c54b0d8e8bda44aa86373ee047210ec30c2772a1a97d5e33574769d"}

curl https://cronos.fran.co \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_call","params": [{"to": "0x2C68A5c3799E2da8f15b3dBa6b124f7e785FDE77", "data": "0x5855a25a"}, {"blockHash": "0xd6fed18b7c54b0d8e8bda44aa86373ee047210ec30c2772a1a97d5e33574769d"}],"id":1}

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

Desired behavior:
Take WETH contract in Rinkeby as example

curl https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161 \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_call","params": [{"to": "0xc778417E063141139Fce010982780140Aa0cD5Ab", "data": "0x06fdde03"}, {"blockHash": "0x78de820bce6781961c0cca12bfd6a6d26c62bb449aab4f8c0c1f246d37b77a26"}],"id":1}'
    
{"jsonrpc":"2.0","id":1,"result":"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000d5772617070656420457468657200000000000000000000000000000000000000"}
@thomas-nguy thomas-nguy self-assigned this Aug 20, 2021
@thomas-nguy thomas-nguy mentioned this issue Aug 20, 2021
11 tasks
@leejw51crypto
Copy link
Contributor

is it compatible with standard web3 protocol?

@FrancoCRO
Copy link
Author

Yes, it's included in geth since version 1.9.6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants