diff --git a/builder/builder.go b/builder/builder.go index 2abaf11..a35ee1b 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -88,6 +88,7 @@ type Builder struct { relay IRelay eth IEthereumService dryRun bool + verifyConstraints bool ignoreLatePayloadAttributes bool validator *blockvalidation.BlockValidationAPI beaconClient IBeaconClient @@ -123,6 +124,7 @@ type BuilderArgs struct { discardRevertibleTxOnErr bool eth IEthereumService dryRun bool + verifyConstraints bool ignoreLatePayloadAttributes bool validator *blockvalidation.BlockValidationAPI beaconClient IBeaconClient @@ -189,6 +191,7 @@ func NewBuilder(args BuilderArgs) (*Builder, error) { relay: args.relay, eth: args.eth, dryRun: args.dryRun, + verifyConstraints: args.verifyConstraints, ignoreLatePayloadAttributes: args.ignoreLatePayloadAttributes, validator: args.validator, beaconClient: args.beaconClient, @@ -286,7 +289,7 @@ func (b *Builder) subscribeToRelayForConstraints(relayBaseEndpoint string) error // Main loop to reconnect to the relay for { - log.Info("Attempting to subscribe to constraints...", "relayBaseEndpoint", relayBaseEndpoint) + log.Info("Attempting to subscribe to constraints...", "relayBaseEndpoint", relayBaseEndpoint, "verifyConstertraints", b.verifyConstraints) if attempts >= maxAttempts { log.Error(fmt.Sprintf("Failed to subscribe to constraints after %d attempts", maxAttempts), "relayBaseEndpoint", relayBaseEndpoint) @@ -376,10 +379,12 @@ func (b *Builder) subscribeToRelayForConstraints(relayBaseEndpoint string) error continue } - valid, err := constraint.VerifySignature(constraint.Message.Pubkey, b.GetConstraintsDomain()) - if err != nil || !valid { - log.Error("Failed to verify constraint signature", "err", err) - continue + if b.verifyConstraints { + valid, err := constraint.VerifySignature(constraint.Message.Pubkey, b.GetConstraintsDomain()) + if err != nil || !valid { + log.Error("Failed to verify constraint signature", "err", err) + continue + } } decodedConstraints, err := DecodeConstraints(constraint) diff --git a/builder/config.go b/builder/config.go index e3099fd..f788dd2 100644 --- a/builder/config.go +++ b/builder/config.go @@ -30,6 +30,7 @@ type Config struct { DiscardRevertibleTxOnErr bool `toml:",omitempty"` EnableCancellations bool `toml:",omitempty"` BlockProcessorURL string `toml:",omitempty"` + VerifyConstraints bool `toml:",omitempty"` } // DefaultConfig is the default config for the builder. @@ -58,6 +59,7 @@ var DefaultConfig = Config{ BuilderRateLimitMaxBurst: RateLimitBurstDefault, DiscardRevertibleTxOnErr: false, EnableCancellations: false, + VerifyConstraints: true, } // RelayConfig is the config for a single remote relay. diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index d7d63db..095ec55 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -632,6 +632,12 @@ var ( Usage: "Enable the validator checks", Category: flags.BuilderCategory, } + BuilderVerifyConstraints = &cli.BoolFlag{ + Name: "builder.verify_constraints", + Usage: "Verify signatures on incoming constraints", + Value: true, + Category: flags.BuilderCategory, + } BuilderBlockValidationBlacklistSourceFilePath = &cli.StringFlag{ Name: "builder.blacklist", Usage: "Path to file containing blacklisted addresses, json-encoded list of strings. " + @@ -1610,6 +1616,7 @@ func SetBuilderConfig(ctx *cli.Context, cfg *builder.Config) { cfg.SecondsInSlot = ctx.Uint64(BuilderSecondsInSlot.Name) cfg.DisableBundleFetcher = ctx.IsSet(BuilderDisableBundleFetcher.Name) cfg.DryRun = ctx.IsSet(BuilderDryRun.Name) + cfg.VerifyConstraints = ctx.Bool(BuilderVerifyConstraints.Name) cfg.IgnoreLatePayloadAttributes = ctx.IsSet(BuilderIgnoreLatePayloadAttributes.Name) cfg.BuilderSecretKey = ctx.String(BuilderSecretKey.Name) cfg.RelaySecretKey = ctx.String(BuilderRelaySecretKey.Name)