Skip to content
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

Merged
merged 4 commits into from
Sep 19, 2023
Merged

Conversation

EasterTheBunny
Copy link
Contributor

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.

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.
@EasterTheBunny EasterTheBunny requested a review from a team as a code owner September 18, 2023 16:05
@github-actions
Copy link
Contributor

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

RyanRHall
RyanRHall previously approved these changes Sep 18, 2023
@@ -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()))
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

@infiloop2 infiloop2 Sep 18, 2023

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

@cl-sonarqube-production
Copy link

@EasterTheBunny EasterTheBunny added this pull request to the merge queue Sep 19, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 19, 2023
@EasterTheBunny EasterTheBunny added this pull request to the merge queue Sep 19, 2023
Merged via the queue into develop with commit 2cafadb Sep 19, 2023
99 checks passed
@EasterTheBunny EasterTheBunny deleted the AUTO-5437/block-number-unmarshalling branch September 19, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants