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

Allow block identifier for Contract.estimateGas #1639

Merged
merged 7 commits into from
Jun 2, 2020

Conversation

palango
Copy link
Contributor

@palango palango commented May 5, 2020

What was wrong?

Related to Issue #1011 and PR #1046

How was it fixed?

Adds block_identifier to Contract.estimateGas(...)

Todo:

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@palango palango force-pushed the contract-estimate-gas branch 2 times, most recently from 66ad31d to 900c23b Compare May 5, 2020 17:13
This evens the API with eth.estimateGas.
@wolovim
Copy link
Member

wolovim commented May 5, 2020

Thanks for the PR @palango. Can we get one or more tests documenting this change?

@palango
Copy link
Contributor Author

palango commented May 6, 2020

Thanks for the PR @palango. Can we get one or more tests documenting this change?

Sure, I'll add some tests, but let me know if you want something particular.

@palango
Copy link
Contributor Author

palango commented May 6, 2020

@marcgarreau I wonder how #1046 actually works, the eth-tester still doesn't have a block_identifier parameter: https://github.com/ethereum/eth-tester/blob/035dde2c4ebc10a205748b37b940cb519251d9da/eth_tester/main.py#L431

Do I need to add that there?

@wolovim
Copy link
Member

wolovim commented May 6, 2020

Coming up to speed on the block identifier... just curious, if you're testing this locally, are you using parity/openethereum? Looks like the feature is available on that client, but not geth.

If we follow the precedent set by #1046, then we'd skip the implemention in eth-tester, and document that in the tests similar to this xfail.

@palango
Copy link
Contributor Author

palango commented May 12, 2020

Coming up to speed on the block identifier... just curious, if you're testing this locally, are you using parity/openethereum? Looks like the feature is available on that client, but not geth.

Yes, openethereum supports it, but geth not. See ethereum/go-ethereum#2586

If we follow the precedent set by #1046, then we'd skip the implemention in eth-tester, and document that in the tests similar to this xfail.

I remember vaguely that I read somewhere that py-evm supports a block identifier on this call. I f so, it would be nice to support it.

@wolovim
Copy link
Member

wolovim commented May 15, 2020

Had a quick chat with @carver who confirmed py-evm does have support for the block identifier, and that eth-tester would need to be updated to that effect. Are you interested in giving that a shot?

@palango
Copy link
Contributor Author

palango commented May 20, 2020

Are you interested in giving that a shot?

I don't have time for that at the moment. I'll come back if that gets better.

@wolovim
Copy link
Member

wolovim commented May 21, 2020

(started work on this today)

@wolovim
Copy link
Member

wolovim commented May 21, 2020

There's a PR up in eth-tester which satisfies these failing tests (and hopefully doesn't create any new ones).

@carver
Copy link
Collaborator

carver commented May 29, 2020

We can try to get new eth-tester released on Monday. In the meantime, it is possible to pin a requirement to a github-hosted commit, if you want to try it out. @marcgarreau

@wolovim wolovim requested a review from carver May 29, 2020 19:44
Copy link
Collaborator

@carver carver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! (to merge after the eth-tester dependency can be pulled from pypi again)

@wolovim wolovim merged commit 7cc9967 into ethereum:master Jun 2, 2020
@palango palango deleted the contract-estimate-gas branch June 2, 2020 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants