-
Notifications
You must be signed in to change notification settings - Fork 722
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
base: main
Are you sure you want to change the base?
Conversation
node/cmd/guardiand/adminclient.go
Outdated
@@ -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 { |
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.
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 { |
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.
Same here, my preference would be Uint16
node/hack/repair_eth/repair_eth.go
Outdated
from = strconv.Itoa(int(currentHeight - step)) | ||
to = "latest" | ||
lastHeight = currentHeight | ||
} else { | ||
if lastHeight-step > math.MaxInt { |
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.
Does it make sense to also check negative values here?
WIP