From d25d88516b5bf221203239d94a4c1af32187f241 Mon Sep 17 00:00:00 2001 From: Mateusz Morusiewicz <11313015+Ruteri@users.noreply.github.com> Date: Thu, 3 Nov 2022 10:15:41 +0100 Subject: [PATCH] Add disable bundle fetcher flag (#48) --- builder/service.go | 11 +++++++---- cmd/geth/main.go | 1 + cmd/utils/flags.go | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/builder/service.go b/builder/service.go index 08f8aa20e2f4..2c311b1b3393 100644 --- a/builder/service.go +++ b/builder/service.go @@ -108,6 +108,7 @@ type BuilderConfig struct { Enabled bool EnableValidatorChecks bool EnableLocalRelay bool + DisableBundleFetcher bool DryRun bool BuilderSecretKey string RelaySecretKey string @@ -203,10 +204,12 @@ func Register(stack *node.Node, backend *eth.Ethereum, cfg *BuilderConfig) error } // Bundle fetcher - mevBundleCh := make(chan []types.MevBundle) - blockNumCh := make(chan int64) - bundleFetcher := flashbotsextra.NewBundleFetcher(backend, ds, blockNumCh, mevBundleCh, true) - go bundleFetcher.Run() + if !cfg.DisableBundleFetcher { + mevBundleCh := make(chan []types.MevBundle) + blockNumCh := make(chan int64) + bundleFetcher := flashbotsextra.NewBundleFetcher(backend, ds, blockNumCh, mevBundleCh, true) + go bundleFetcher.Run() + } ethereumService := NewEthereumService(backend) builderBackend := NewBuilder(builderSk, ds, relay, builderSigningDomain, ethereumService, cfg.DryRun, validator) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index df1c9ee2564a..fa0eb6311104 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -158,6 +158,7 @@ var ( utils.BuilderEnabled, utils.BuilderEnableValidatorChecks, utils.BuilderEnableLocalRelay, + utils.BuilderDisableBundleFetcher, utils.BuilderDryRun, utils.BuilderSecretKey, utils.BuilderRelaySecretKey, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index fe9cd04e8faf..5e98db771d01 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -697,6 +697,10 @@ var ( Name: "builder.local_relay", Usage: "Enable the local relay", } + BuilderDisableBundleFetcher = &cli.BoolFlag{ + Name: "builder.no_bundle_fetcher", + Usage: "Disable the bundle fetcher", + } BuilderDryRun = &cli.BoolFlag{ Name: "builder.dry-run", Usage: "Builder only validates blocks without submission to the relay",