-
Notifications
You must be signed in to change notification settings - Fork 20.3k
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
internal/ethapi: add block overrides to eth_call #26414
Conversation
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.
This requires a proper motivation, explaining why the existing functionality does not cover this usecase
I've rebased and deleted the |
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.
LGTM, some nits
BaseFee *big.Int | ||
} | ||
|
||
func (o BlockOverrides) MarshalJSON() ([]byte, error) { |
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.
Did you "generate" this manually?
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.
Yes it's handmade quality :)
@@ -265,3 +287,52 @@ func (a OverrideAccount) MarshalJSON() ([]byte, error) { | |||
} | |||
return json.Marshal(output) | |||
} | |||
|
|||
// BlockOverrides specifies the set of header fields to override. | |||
type BlockOverrides struct { |
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.
Perhaps add a comment that this struct is a direct "replica" of the BlockOverrides
defined in interna/ethapi/api.go
.
Would it make sense to have it defined in only one place (thus remove it from internal)?
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.
We kinda need both. The API needs fields with suitable types for input (i.e. hexutil
), and gethclient needs standard types which will then be serialized to be sent to the API. That's the reason why I copied the structure and changed the types.
Co-authored-by: Martin Holst Swende <martin@swende.se>
Adds an optional config parameter to eth_call which allows users to override block context fields (same functionality that was added to traceCall in ethereum#24871) --------- Co-authored-by: Martin Holst Swende <martin@swende.se>
Adds an optional config parameter to eth_call which allows users to override block context fields (same functionality that was added to traceCall in ethereum#24871) --------- Co-authored-by: Martin Holst Swende <martin@swende.se>
)" This reverts commit 1c66a6b.
)" This reverts commit 1c66a6b.
This update covers this PRs: - ethereum/go-ethereum#26414 - ethereum/go-ethereum#27183 - ethereum/go-ethereum#26291 - ethereum/go-ethereum#26048
Adds an optional config parameter to
eth_call
which allows users to override block context fields (same functionality that was added totraceCall
in #24871)Also I've integrated some of the changes from #25743, specially some test cases and modification to
GetEVM
.Fixes #24025.