-
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
Format Block Number As Hex #10680
Format Block Number As Hex #10680
Conversation
An unmarshalling error was reported on the block number being passed to an rpc client instance if the block number was a big.Int. The solution was to format it as a hex encoded uint64 value.
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
@@ -235,7 +235,7 @@ func (r *EvmRegistry) allowedToUseMercury(opts *bind.CallOpts, upkeepId *big.Int | |||
} | |||
|
|||
// call checkCallback function at the block which OCR3 has agreed upon | |||
err = r.client.CallContext(opts.Context, &resultBytes, "eth_call", args, opts.BlockNumber) | |||
err = r.client.CallContext(opts.Context, &resultBytes, "eth_call", args, hexutil.EncodeUint64(opts.BlockNumber.Uint64())) |
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.
can we use hexutil.EncodeBig
as is used in other places
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 both are being used in different place of the code. Uint makes more sense to me since negative numbers aren't valid blocks anyway.
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 other parts of code are within the same check pipeline flow on EVM registry https://github.com/smartcontractkit/chainlink/blob/develop/core/services/ocr2/plugins/ocr2keeper/evm21/registry_check_pipeline.go#L212-L219 so consistency would be better (which could be either way)
Please thoroughly test this e2e before merging
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.
Sounds good.
SonarQube Quality Gate |
An unmarshalling error was reported on the block number being passed to an rpc client instance if the block number was a big.Int. The solution was to format it as a hex encoded uint64 value.