Skip to content
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

chore(builder): disable authorized pubkeys checks for testing on the devnet #282

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions builder/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,22 +362,31 @@ func (b *Builder) subscribeToRelayForConstraints(relayBaseEndpoint string) error
}

for _, constraint := range constraintsSigned {
oneValidSignature := false
// TODO: re-enable this once testing the devnet has ended
// oneValidSignature := false
// Check if the signature is valid against any of the authorized pubkeys
for _, pubkey := range b.slotConstraintsPubkeys {
valid, err := constraint.VerifySignature(pubkey, b.GetConstraintsDomain())
if err != nil || !valid {
log.Error("Failed to verify constraint signature", "err", err)
continue
}

oneValidSignature = true
// for _, pubkey := range b.slotConstraintsPubkeys {
// valid, err := constraint.VerifySignature(pubkey, b.GetConstraintsDomain())
// if err != nil || !valid {
// log.Error("Failed to verify constraint signature", "err", err)
// continue
// }
//
// oneValidSignature = true
// }

// TODO: remove this once testing the devnet has ended, we should check for authorized keys
valid, err := constraint.VerifySignature(constraint.Message.Pubkey, b.GetConstraintsDomain())
if err != nil || !valid {
log.Error("Failed to verify constraint signature", "err", err)
continue
}

// TODO: re-enable this once testing the devnet has ended
// If there is no valid signature, continue with the next constraint
if !oneValidSignature {
continue
}
// if !oneValidSignature {
// continue
// }

decodedConstraints, err := DecodeConstraints(constraint)
if err != nil {
Expand Down Expand Up @@ -472,7 +481,6 @@ func (b *Builder) onSealedBlock(opts SubmitBlockOpts) error {
log.Info(message)

inclusionProof, _, err := CalculateMerkleMultiProofs(opts.Block.Transactions(), constraints)

if err != nil {
log.Error("[BOLT]: could not calculate merkle multiproofs", "err", err)
return err
Expand Down