This repository was archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Change how RPCs eth_call and eth_estimateGas handle "Pending" #11127
Merged
dvdplm
merged 12 commits into
master
from
dp/fix/improve-handling-of-rpc-calls-with-pending
Oct 11, 2019
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6031672
Change how RPCs eth_call and eth_estimateGas handle "Pending"
dvdplm 6094ce7
Fetch jsonrpc from git
dvdplm 2af0f05
Merge branch 'master' into dp/fix/improve-handling-of-rpc-calls-with-…
dvdplm 35cafcc
No real need to wait for new jsonrpc
dvdplm 0e88191
Add tests for calling eth_call/eth_estimateGas with "Pending"
dvdplm dc1708d
Fix a todo, add another
dvdplm cee6661
Change client.latest_state to return the best header as well so we av…
dvdplm c7a95f0
Impl review suggestions
dvdplm 1624f65
Update rpc/src/v1/impls/eth.rs
dvdplm f51b4dd
Review grumbles
dvdplm d192924
Merge branch 'dp/fix/improve-handling-of-rpc-calls-with-pending' of g…
dvdplm c93387f
update docs
dvdplm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
I'm not a big fan of methods with
several responsibilities. Why not a separate methodfn best_header/latest_header()?Is this some kind of optimization that I don't understand?
Also, seems that we call this method a couple of this without caring about the header. I think the header type is quite big and might carry some cost to return by value when it's not needed.
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.
Looking up latest state first looks up latest header, so when we need both we:
So while I agree with you that it's generally best to have methods do a single thing, I think returning both pieces of data is warranted here.
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.
I think it was made to ensure atomicity of the operation - i.e. that the we don't import the block in the meantime and the state does not match header.