-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
core/chains/evm/client: eth_call: include duplicate legacy field for compatability #12140
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
98d9a74
to
70e9296
Compare
core/chains/evm/client/rpc_client.go
Outdated
} | ||
if len(msg.Data) > 0 { | ||
arg["input"] = hexutil.Bytes(msg.Data) | ||
arg["data"] = hexutil.Bytes(msg.Data) // duplicate legacy field for compatability |
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 is interesting - so geth included these before and has now removed it in the latest version. Is that correct?
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 is indeed nonstandard: https://ethereum.org/en/developers/docs/apis/json-rpc#eth_call
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.
The server for a long time has accepted both (>6 years?), and they recently switched the client from data to input.
|
||
// COPIED FROM go-ethereum/ethclient/gethclient - must be kept up to date! |
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.
What commit sha of go-ethereum was this copied from?
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.
The one that is imported in the go.mod
70e9296
to
2a1126e
Compare
2a1126e
to
f83f128
Compare
|
||
// COPIED FROM go-ethereum/ethclient/gethclient - must be kept up to date! | ||
// Modified to include legacy 'data' as well as 'input' in order to support non-compliant servers. | ||
func toCallArg(msg ethereum.CallMsg) interface{} { |
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.
@jmank88 ethereum recently updated this function to and added extra fields, should we reflect those changes?
https://github.com/ethereum/go-ethereum/blob/master/ethclient/ethclient.go#L642
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.
nvm 1.13.8 doesnot use it, just need to ensure we update this function if we do modify to new geth version
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 copied from the version we import to minimize changes
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
f83f128
to
464fdd5
Compare
Quality Gate passedIssues Measures |
No description provided.