Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 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
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
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ var (
utils.BuilderDiscardRevertibleTxOnErr,
utils.BuilderEnableCancellations,
utils.BuilderBlockProcessorURL,
utils.BuilderVerifyConstraints,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, however I don't think this is enough because theBuilderVerifyConstraints flag isn't correctly propagated to where builder service is started because it is not read when creating the BuilderArgs struct to start the relay:

builderArgs := BuilderArgs{
sk: builderSk,
blockConsumer: blockConsumer,
ds: ds,
dryRun: cfg.DryRun,
eth: ethereumService,
relay: relay,
builderSigningDomain: builderSigningDomain,
builderBlockResubmitInterval: builderRateLimitInterval,
submissionOffsetFromEndOfSlot: submissionOffset,
discardRevertibleTxOnErr: cfg.DiscardRevertibleTxOnErr,
ignoreLatePayloadAttributes: cfg.IgnoreLatePayloadAttributes,
validator: validator,
beaconClient: beaconClient,
limiter: limiter,
}

By looking at the diffs this might be an oversight on our side when this has been introduced in 5f66af8. I can fix that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha good catch :) I haven't really looked into it enough yet!

}

rpcFlags = []cli.Flag{
Expand Down
8 changes: 4 additions & 4 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1525,16 +1525,16 @@ func (w *worker) fillTransactions(interrupt *atomic.Int32, env *environment, con

// Fill the block with all available pending transactions.
if len(localPlainTxs) > 0 || len(localBlobTxs) > 0 || len(constraints) > 0 {
plainTxs := newTransactionsByPriceAndNonce(env.signer, localPlainTxs, nil, nil, env.header.BaseFee)
blobTxs := newTransactionsByPriceAndNonce(env.signer, localBlobTxs, nil, nil, env.header.BaseFee)
plainTxs := newTransactionsByPriceAndNonce(env.signer, make(map[common.Address][]*txpool.LazyTransaction), nil, nil, env.header.BaseFee)
blobTxs := newTransactionsByPriceAndNonce(env.signer, make(map[common.Address][]*txpool.LazyTransaction), nil, nil, env.header.BaseFee)

if err := w.commitTransactions(env, plainTxs, blobTxs, constraints, interrupt); err != nil {
return nil, nil, nil, err
}
}
if len(remotePlainTxs) > 0 || len(remoteBlobTxs) > 0 || len(constraints) > 0 {
plainTxs := newTransactionsByPriceAndNonce(env.signer, remotePlainTxs, nil, nil, env.header.BaseFee)
blobTxs := newTransactionsByPriceAndNonce(env.signer, remoteBlobTxs, nil, nil, env.header.BaseFee)
plainTxs := newTransactionsByPriceAndNonce(env.signer, make(map[common.Address][]*txpool.LazyTransaction), nil, nil, env.header.BaseFee)
blobTxs := newTransactionsByPriceAndNonce(env.signer, make(map[common.Address][]*txpool.LazyTransaction), nil, nil, env.header.BaseFee)
Comment on lines +1529 to +1538
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we gate this to a flag BuilderConstraintsWithoutMempool (or similar name)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I wasn't planning on this PR ever being merged, this was just for current community driven usage

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you wish! For us it's not a problem to add some flags if requested :)


if err := w.commitTransactions(env, plainTxs, blobTxs, constraints, interrupt); err != nil {
return nil, nil, nil, err
Expand Down