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

ci: Bump golang linter version #4224

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

ci: Bump golang linter version #4224

wants to merge 6 commits into from

Conversation

djb15
Copy link
Collaborator

@djb15 djb15 commented Jan 17, 2025

WIP

@@ -312,6 +314,11 @@ func runFindMissingMessages(cmd *cobra.Command, args []string) {
}
defer conn.Close()

// Although chains ids are constrained to be 16 bit, we only constrain to 32 bit here given the protobuf usage later
if chainID > math.MaxUint32 {
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO we can constrain this and similar uses to math.MaxUint16 instead. Opening up the range only makes bugs more likely, even if protobuf encodes them as uint32

@@ -343,6 +350,10 @@ func runDumpVAAByMessageID(cmd *cobra.Command, args []string) {
if err != nil {
log.Fatalf("invalid chain ID: %v", err)
}
// We only constrain this to int32 now, not uint16, given the ChainID protobuf definition
if chainID > math.MaxInt32 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, my preference would be Uint16

from = strconv.Itoa(int(currentHeight - step))
to = "latest"
lastHeight = currentHeight
} else {
if lastHeight-step > math.MaxInt {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to also check negative values here?

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.

2 participants