Skip to content

Commit

Permalink
go/consensus/supplementarysanity: Fix checks for legacy validators
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrus committed Feb 7, 2023
1 parent fd955b7 commit e88263a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changelog/5168.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go/consensus/supplementarysanity: Fix checks for legacy validators
1 change: 1 addition & 0 deletions go/consensus/tendermint/apps/supplementarysanity/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func checkRegistry(ctx *abciAPI.Context, now beacon.EpochTime) error {
if err != nil {
return fmt.Errorf("SignedNodes: %w", err)
}

_, err = registry.SanityCheckNodes(logger, params, signedNodes, seenEntities, runtimeLookup, false, now, ctx.Now(), uint64(ctx.BlockHeight()))
if err != nil {
return fmt.Errorf("SanityCheckNodes: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion go/registry/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,10 @@ func VerifyRegisterNodeArgs( // nolint: gocyclo
}
expectedSigners = append(expectedSigners, n.P2P.ID)
p2pAddressRequired := n.HasRoles(P2PAddressRequiredRoles)
switch isGenesis {
switch isGenesis || isSanityCheck {
case true:
// Allow legacy descriptor with optional p2p address for validator.
// XXX: Remove this after 23.0.x.
if n.HasRoles(node.RoleValidator) {
p2pAddressRequired = false
}
Expand Down

0 comments on commit e88263a

Please sign in to comment.