From 616cfd33908df1e479c5dd0980367ede8de82a5d Mon Sep 17 00:00:00 2001 From: terencechain Date: Fri, 29 Jul 2022 15:20:56 -0700 Subject: [PATCH] Add flag for validator gas limit catch-all (#11134) * Add flag for validator gas limit catch-all * Update flags.go --- cmd/validator/flags/flags.go | 7 +++++++ cmd/validator/main.go | 1 + cmd/validator/usage.go | 1 + validator/node/node.go | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/validator/flags/flags.go b/cmd/validator/flags/flags.go index d8bbfa63b..d2409a647 100644 --- a/cmd/validator/flags/flags.go +++ b/cmd/validator/flags/flags.go @@ -351,6 +351,13 @@ var ( Usage: "Enables Builder validator registration APIs for the validator client to update settings such as fee recipient and gas limit. Note* this flag is not required if using proposer settings config file", Value: false, } + + // BuilderGasLimitFlag defines the gas limit for the builder to use for constructing a payload. + BuilderGasLimitFlag = &cli.IntFlag{ + Name: "suggested-gas-limit", + Usage: "Sets gas limit for the builder to use for constructing a payload for all the validators", + Value: int(params.BeaconConfig().DefaultBuilderGasLimit), + } ) // DefaultValidatorDir returns OS-specific default validator directory. diff --git a/cmd/validator/main.go b/cmd/validator/main.go index 33e39d071..fe2e358a8 100644 --- a/cmd/validator/main.go +++ b/cmd/validator/main.go @@ -79,6 +79,7 @@ var appFlags = []cli.Flag{ flags.ProposerSettingsURLFlag, flags.ProposerSettingsFlag, flags.EnableBuilderFlag, + flags.BuilderGasLimitFlag, //////////////////// cmd.DisableMonitoringFlag, cmd.MonitoringHostFlag, diff --git a/cmd/validator/usage.go b/cmd/validator/usage.go index f8bba4585..c7b50db51 100644 --- a/cmd/validator/usage.go +++ b/cmd/validator/usage.go @@ -113,6 +113,7 @@ var appHelpFlagGroups = []flagGroup{ flags.ProposerSettingsURLFlag, flags.SuggestedFeeRecipientFlag, flags.EnableBuilderFlag, + flags.BuilderGasLimitFlag, }, }, { diff --git a/validator/node/node.go b/validator/node/node.go index 2b92bed21..4090e15b5 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -501,7 +501,7 @@ func proposerSettings(cliCtx *cli.Context) (*validatorServiceConfig.ProposerSett if cliCtx.Bool(flags.EnableBuilderFlag.Name) { vr = &validatorServiceConfig.BuilderConfig{ Enabled: true, - GasLimit: reviewGasLimit(params.BeaconConfig().DefaultBuilderGasLimit), + GasLimit: reviewGasLimit(uint64(cliCtx.Int(flags.BuilderGasLimitFlag.Name))), } } fileConfig = &validatorServiceConfig.ProposerSettingsPayload{