-
Notifications
You must be signed in to change notification settings - Fork 20.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
internal/ethapi: use same state for each invocation within EstimateGas #27505
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please explain this change in the PR description. |
@fjl done. |
holiman
approved these changes
Jun 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Tristan-Wilson
added a commit
to OffchainLabs/go-ethereum
that referenced
this pull request
Aug 3, 2023
….12.1-pre internal/ethapi/api.go: Upstream, the body of ethapi.DoCall was mostly moved into ethapi.doCall, leaving DoCall as a wrapper to get the state only once, fixing the issue described in ethereum/go-ethereum#27505, and this conflicts with our addition of the core.MessageRunMode parameter to DoCall. Resolved by adding that parameter to the wrapper and the wrapped functions.
devopsbo3
pushed a commit
to HorizenOfficial/go-ethereum
that referenced
this pull request
Nov 10, 2023
ethereum#27505) EstimateGas repeatedly executes a transaction, performing a binary search with multiple gas prices to determine proper #. Each call retrieves a new copy of the state (https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/api.go#L1017) . Because the pending/latest state can change during the execution of EstimateGas, this can potentially cause strange behavior (as noted here: ethereum#27502 (comment)). This PR modifies EstimateGas to retrieve the state once and use a copy of it for every call invocation it does.
devopsbo3
added a commit
to HorizenOfficial/go-ethereum
that referenced
this pull request
Nov 10, 2023
…timateGas (ethereum#27505)" This reverts commit 7394908.
devopsbo3
added a commit
to HorizenOfficial/go-ethereum
that referenced
this pull request
Nov 10, 2023
…timateGas (ethereum#27505)" This reverts commit 7394908.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
EstimateGas repeatedly executes a transaction, performing a binary search with multiple gas prices to determine proper #. Each call retrieves a new copy of the state https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/api.go#L1017 . Because the pending/latest state can change during the execution of
EstimateGas
, this can potentially cause strange behavior (as noted here).This PR modifies
EstimateGas
to retrieve the state once and use a copy of it for every call invocation it does.