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

<contract_func>.call modifies user input #1272

Open
charles-cooper opened this issue Mar 11, 2019 · 2 comments
Open

<contract_func>.call modifies user input #1272

charles-cooper opened this issue Mar 11, 2019 · 2 comments

Comments

@charles-cooper
Copy link
Contributor

charles-cooper commented Mar 11, 2019

What was wrong?

When a block hash is supplied as the block identifier, web3.py replaces the block param with that block's number (cf.

return web3.eth.getBlock(block_identifier)['number']
). This can result in eth_call being called on a different block than the intended block in the case of a reorg.

How can it be fixed?

  1. Raise an exception if a block hash is supplied to call instead of modifying user input
  2. Make an EIP to change the JSON RPC to accept block hash in addition to QUANTITY|TAG. Then just pass the block hash through instead of changing user input.
@pipermerriam
Copy link
Member

pipermerriam commented Mar 25, 2019

Raise an exception if a block hash is supplied to call instead of modifying user input

I'm in favor of this approach and this would be a breaking change that could squeek into v5

@charles-cooper
Copy link
Contributor Author

Make an EIP to change the JSON RPC to accept block hash in addition to QUANTITY|TAG. Then just pass the block hash through instead of changing user input.

Cf. ethereum/EIPs#1898, could be a ways until this is implemented by nodes though.

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

No branches or pull requests

4 participants