Skip to content

Commit

Permalink
Move logic behind flag
Browse files Browse the repository at this point in the history
  • Loading branch information
benhenryhunter committed Nov 12, 2024
1 parent 5d09ff3 commit ca86a7c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,13 @@ func (b *Builder) subscribeToRelayForConstraints(relayBaseEndpoint string) error
log.Info(fmt.Sprintf("Received %d new constraints", len(constraintsSigned)))

for _, constraint := range constraintsSigned {
if !slices.Contains(b.slotConstraintsPubkeys, constraint.Message.Pubkey) {
log.Warn("Received constraint from unauthorized pubkey", "pubkey", constraint.Message.Pubkey)
continue
}

if b.verifyConstraints {
if !slices.Contains(b.slotConstraintsPubkeys, constraint.Message.Pubkey) {
log.Warn("Received constraint from unauthorized pubkey", "pubkey", constraint.Message.Pubkey)
continue
}

valid, err := constraint.VerifySignature(constraint.Message.Pubkey, b.GetConstraintsDomain())
if err != nil || !valid {
log.Error("Failed to verify constraint signature", "err", err)
Expand Down

0 comments on commit ca86a7c

Please sign in to comment.