Skip to content

Commit

Permalink
Add disable bundle fetcher flag (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruteri authored and avalonche committed Mar 17, 2023
1 parent d642ecf commit 96ca166
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
11 changes: 7 additions & 4 deletions builder/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ type BuilderConfig struct {
Enabled bool
EnableValidatorChecks bool
EnableLocalRelay bool
DisableBundleFetcher bool
DryRun bool
BuilderSecretKey string
RelaySecretKey string
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ var (
utils.BuilderEnabled,
utils.BuilderEnableValidatorChecks,
utils.BuilderEnableLocalRelay,
utils.BuilderDisableBundleFetcher,
utils.BuilderDryRun,
utils.BuilderSecretKey,
utils.BuilderRelaySecretKey,
Expand Down
4 changes: 4 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,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",
Expand Down

0 comments on commit 96ca166

Please sign in to comment.