Skip to content

Commit 1a7e345

Browse files
authored
Merge pull request #24328 from karalabe/uke-catalyst
cmd: auto-enable beacon APIs if TTD is defined
2 parents afe344b + d99e759 commit 1a7e345

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

cmd/geth/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
161161
if ctx.GlobalIsSet(utils.OverrideTerminalTotalDifficulty.Name) {
162162
cfg.Eth.OverrideTerminalTotalDifficulty = new(big.Int).SetUint64(ctx.GlobalUint64(utils.OverrideTerminalTotalDifficulty.Name))
163163
}
164-
backend, _ := utils.RegisterEthService(stack, &cfg.Eth, ctx.GlobalBool(utils.CatalystFlag.Name))
164+
backend, _ := utils.RegisterEthService(stack, &cfg.Eth)
165165

166166
// Configure GraphQL if requested
167167
if ctx.GlobalIsSet(utils.GraphQLEnabledFlag.Name) {

cmd/geth/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ var (
157157
utils.GpoIgnoreGasPriceFlag,
158158
utils.MinerNotifyFullFlag,
159159
configFileFlag,
160-
utils.CatalystFlag,
161160
}
162161

163162
rpcFlags = []cli.Flag{

cmd/geth/usage.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ var AppHelpFlagGroups = []flags.FlagGroup{
229229
utils.SnapshotFlag,
230230
utils.BloomFilterSizeFlag,
231231
cli.HelpFlag,
232-
utils.CatalystFlag,
233232
},
234233
},
235234
}

cmd/utils/flags.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -790,11 +790,6 @@ var (
790790
Usage: "InfluxDB organization name (v2 only)",
791791
Value: metrics.DefaultConfig.InfluxDBOrganization,
792792
}
793-
794-
CatalystFlag = cli.BoolFlag{
795-
Name: "catalyst",
796-
Usage: "Catalyst mode (eth2 integration testing)",
797-
}
798793
)
799794

800795
// MakeDataDir retrieves the currently requested data directory, terminating
@@ -1717,14 +1712,14 @@ func SetDNSDiscoveryDefaults(cfg *ethconfig.Config, genesis common.Hash) {
17171712
// RegisterEthService adds an Ethereum client to the stack.
17181713
// The second return value is the full node instance, which may be nil if the
17191714
// node is running as a light client.
1720-
func RegisterEthService(stack *node.Node, cfg *ethconfig.Config, isCatalyst bool) (ethapi.Backend, *eth.Ethereum) {
1715+
func RegisterEthService(stack *node.Node, cfg *ethconfig.Config) (ethapi.Backend, *eth.Ethereum) {
17211716
if cfg.SyncMode == downloader.LightSync {
17221717
backend, err := les.New(stack, cfg)
17231718
if err != nil {
17241719
Fatalf("Failed to register the Ethereum service: %v", err)
17251720
}
17261721
stack.RegisterAPIs(tracers.APIs(backend.ApiBackend))
1727-
if isCatalyst {
1722+
if backend.BlockChain().Config().TerminalTotalDifficulty != nil {
17281723
if err := lescatalyst.Register(stack, backend); err != nil {
17291724
Fatalf("Failed to register the catalyst service: %v", err)
17301725
}
@@ -1741,7 +1736,7 @@ func RegisterEthService(stack *node.Node, cfg *ethconfig.Config, isCatalyst bool
17411736
Fatalf("Failed to create the LES server: %v", err)
17421737
}
17431738
}
1744-
if isCatalyst {
1739+
if backend.BlockChain().Config().TerminalTotalDifficulty != nil {
17451740
if err := ethcatalyst.Register(stack, backend); err != nil {
17461741
Fatalf("Failed to register the catalyst service: %v", err)
17471742
}

0 commit comments

Comments
 (0)