-
Notifications
You must be signed in to change notification settings - Fork 115
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
go/consensus/supplementarysanity: Fix checks for legacy validators #5168
Conversation
8788bfc
to
886aea1
Compare
Codecov Report
@@ Coverage Diff @@
## master #5168 +/- ##
==========================================
+ Coverage 66.73% 66.98% +0.25%
==========================================
Files 497 499 +2
Lines 53300 53361 +61
==========================================
+ Hits 35570 35745 +175
+ Misses 13363 13256 -107
+ Partials 4367 4360 -7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
go/registry/api/api.go
Outdated
@@ -709,6 +709,7 @@ func VerifyRegisterNodeArgs( // nolint: gocyclo | |||
switch isGenesis { | |||
case true: | |||
// Allow legacy descriptor with optional p2p address for validator. | |||
// XXX: Remove this after 22.3.x. |
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.
// XXX: Remove this after 22.3.x. | |
// XXX: Remove this after 23.0.x. |
} | ||
|
||
// If legacy nodes registered at genesis can be present, use isGenesis=true version of the sanity check | ||
// to allow non-migrated nodes (for 22.3.x these are validator nodes with no p2p address). |
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.
// to allow non-migrated nodes (for 22.3.x these are validator nodes with no p2p address). | |
// to allow non-migrated nodes (for 23.0.x these are validator nodes with no p2p address). |
These changes also force that the public key has to be in the entity's node list for the first |
Note that this is only for supplementary sanity checks which are disabled by default, but yeah this seems like an unintended consequence as it could cause the sanity checks to incorrectly fail. Maybe it would be better to use the switch isGenesis || isSanityCheck {
case true:
// Allow legacy descriptor with optional p2p address for validator. |
886aea1
to
d8b2c6a
Compare
d8b2c6a
to
f790a1f
Compare
Changed to use the |
Before, when upgrading from 22.2.x the supplementary-sanity checks would fail for validator nodes that did not yet re-register with added P2P address.
(Unrelated change) update
minNodeDescriptorVersion
to 3, because V2 descriptors are automatically migrated to V3 in deserialization, so no need to allow V2 descriptors.