-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
all: update golang/x/ext and fix slice sorting fallout #27909
Conversation
// Note: sorting in descending number order. | ||
return a.Header.Number.Uint64() >= b.Header.Number.Uint64() | ||
return -a.Header.Number.Cmp(b.Header.Number) |
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.
return -a.Header.Number.Cmp(b.Header.Number) | |
return b.Header.Number.Cmp(a.Header.Number) |
Alternative version is to just swap the arguments. Use with whichever you feel like
p2p/protocol.go
Outdated
@@ -78,9 +79,15 @@ func (cap Cap) String() string { | |||
} | |||
|
|||
// Less defines the canonical sorting order of capabilities. | |||
func (cap Cap) Less(other Cap) bool { | |||
func (cap Cap) Less(other Cap) int { |
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.
func (cap Cap) Less(other Cap) int { | |
func (cap Cap) Cmp(other Cap) int { |
Wouldn't that be more correct? Adds more fallout, sorry ...
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.
Ah yes, indeed
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
The Go authors updated golang/x/ext to change the function signature of the slices sort method. It's an entire shitshow now because x/ext is not tagged, so everyone's codebase just picked a new version that some other dep depends on, causing our code to fail building. This PR updates the dep on our code too and does all the refactorings to follow upstream...
The Go authors updated golang/x/ext to change the function signature of the slices sort method. It's an entire shitshow now because x/ext is not tagged, so everyone's codebase just picked a new version that some other dep depends on, causing our code to fail building. This PR updates the dep on our code too and does all the refactorings to follow upstream...
…eum#27909)" This reverts commit 1c411fc.
…eum#27909)" This reverts commit 1c411fc.
We cannot upgrade beyond 1.12.1 because of the x/ext slices mess: - ethereum/go-ethereum#27909 - cosmos/cosmos-sdk#20159
The Go authors updated golang/x/ext to change the function signature of the slices sort method. It's an entire shitshow now because x/ext is not tagged, so everyone's codebase just picked a new version that some other dep depends on, causing our code to fail building.
This PR updates the dep on our code too and does all the refactorings to follow upstream...
Fixes #27897