Skip to content

Commit

Permalink
fix: constraint signature check
Browse files Browse the repository at this point in the history
  • Loading branch information
mempirate committed Oct 2, 2024
1 parent ed71779 commit 48700e6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions builder/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,21 @@ func (b *Builder) subscribeToRelayForConstraints(relayBaseEndpoint string) error
}

for _, constraint := range constraintsSigned {
oneValidSignature := false
// Check if the signature is valid against any of the authorized pubkeys
for _, pubkey := range b.slotConstraintsPubkeys {
valid, err := constraint.VerifySignature(pubkey)
if err != nil || !valid {
log.Error("Failed to verify constraint signature", "err", err)
continue
}

oneValidSignature = true
}

// If there is no valid signature, continue with the next constraint
if !oneValidSignature {
continue
}

decodedConstraints, err := DecodeConstraints(constraint)
Expand Down

0 comments on commit 48700e6

Please sign in to comment.