Skip to content

Commit 6ca8f42

Browse files
Ruteriavalonche
authored andcommitted
Add disable bundle fetcher flag (flashbots#48)
1 parent 3e0316a commit 6ca8f42

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

builder/service.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ type BuilderConfig struct {
108108
Enabled bool
109109
EnableValidatorChecks bool
110110
EnableLocalRelay bool
111+
DisableBundleFetcher bool
111112
DryRun bool
112113
BuilderSecretKey string
113114
RelaySecretKey string
@@ -203,10 +204,12 @@ func Register(stack *node.Node, backend *eth.Ethereum, cfg *BuilderConfig) error
203204
}
204205

205206
// Bundle fetcher
206-
mevBundleCh := make(chan []types.MevBundle)
207-
blockNumCh := make(chan int64)
208-
bundleFetcher := flashbotsextra.NewBundleFetcher(backend, ds, blockNumCh, mevBundleCh, true)
209-
go bundleFetcher.Run()
207+
if !cfg.DisableBundleFetcher {
208+
mevBundleCh := make(chan []types.MevBundle)
209+
blockNumCh := make(chan int64)
210+
bundleFetcher := flashbotsextra.NewBundleFetcher(backend, ds, blockNumCh, mevBundleCh, true)
211+
go bundleFetcher.Run()
212+
}
210213

211214
ethereumService := NewEthereumService(backend)
212215
builderBackend := NewBuilder(builderSk, ds, relay, builderSigningDomain, ethereumService, cfg.DryRun, validator)

cmd/geth/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ var (
158158
utils.BuilderEnabled,
159159
utils.BuilderEnableValidatorChecks,
160160
utils.BuilderEnableLocalRelay,
161+
utils.BuilderDisableBundleFetcher,
161162
utils.BuilderDryRun,
162163
utils.BuilderSecretKey,
163164
utils.BuilderRelaySecretKey,

cmd/utils/flags.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,10 @@ var (
698698
Name: "builder.local_relay",
699699
Usage: "Enable the local relay",
700700
}
701+
BuilderDisableBundleFetcher = &cli.BoolFlag{
702+
Name: "builder.no_bundle_fetcher",
703+
Usage: "Disable the bundle fetcher",
704+
}
701705
BuilderDryRun = &cli.BoolFlag{
702706
Name: "builder.dry-run",
703707
Usage: "Builder only validates blocks without submission to the relay",

0 commit comments

Comments
 (0)