cmd: rename genesis flag to override.genesis

This commit is contained in:
lightclient 2025-10-21 07:16:43 -06:00
parent caf1b2a7a3
commit 23740764e7
No known key found for this signature in database
GPG key ID: 657913021EF45A6A
2 changed files with 9 additions and 9 deletions

View file

@ -66,6 +66,7 @@ var (
utils.OverrideBPO1, utils.OverrideBPO1,
utils.OverrideBPO2, utils.OverrideBPO2,
utils.OverrideVerkle, utils.OverrideVerkle,
utils.OverrideGenesisFlag,
utils.EnablePersonal, // deprecated utils.EnablePersonal, // deprecated
utils.TxPoolLocalsFlag, utils.TxPoolLocalsFlag,
utils.TxPoolNoLocalsFlag, utils.TxPoolNoLocalsFlag,
@ -84,7 +85,6 @@ var (
utils.SyncModeFlag, utils.SyncModeFlag,
utils.SyncTargetFlag, utils.SyncTargetFlag,
utils.ExitWhenSyncedFlag, utils.ExitWhenSyncedFlag,
utils.GenesisFlag,
utils.GCModeFlag, utils.GCModeFlag,
utils.SnapshotFlag, utils.SnapshotFlag,
utils.TxLookupLimitFlag, // deprecated utils.TxLookupLimitFlag, // deprecated

View file

@ -190,11 +190,6 @@ var (
Usage: "Exits after block synchronisation completes", Usage: "Exits after block synchronisation completes",
Category: flags.EthCategory, Category: flags.EthCategory,
} }
GenesisFlag = &cli.StringFlag{
Name: "genesis",
Usage: "Load genesis block and configuration from file at this path",
Category: flags.EthCategory,
}
// Dump command options. // Dump command options.
IterativeOutputFlag = &cli.BoolFlag{ IterativeOutputFlag = &cli.BoolFlag{
@ -267,6 +262,11 @@ var (
Usage: "Manually specify the Verkle fork timestamp, overriding the bundled setting", Usage: "Manually specify the Verkle fork timestamp, overriding the bundled setting",
Category: flags.EthCategory, Category: flags.EthCategory,
} }
OverrideGenesisFlag = &cli.StringFlag{
Name: "override.genesis",
Usage: "Load genesis block and configuration from file at this path",
Category: flags.EthCategory,
}
SyncModeFlag = &cli.StringFlag{ SyncModeFlag = &cli.StringFlag{
Name: "syncmode", Name: "syncmode",
Usage: `Blockchain sync mode ("snap" or "full")`, Usage: `Blockchain sync mode ("snap" or "full")`,
@ -1598,7 +1598,7 @@ func setRequiredBlocks(ctx *cli.Context, cfg *ethconfig.Config) {
// SetEthConfig applies eth-related command line flags to the config. // SetEthConfig applies eth-related command line flags to the config.
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
// Avoid conflicting network flags, don't allow network id override on preset networks // Avoid conflicting network flags, don't allow network id override on preset networks
flags.CheckExclusive(ctx, MainnetFlag, DeveloperFlag, SepoliaFlag, HoleskyFlag, HoodiFlag, NetworkIdFlag, GenesisFlag) flags.CheckExclusive(ctx, MainnetFlag, DeveloperFlag, SepoliaFlag, HoleskyFlag, HoodiFlag, NetworkIdFlag, OverrideGenesisFlag)
flags.CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer flags.CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
// Set configurations from CLI flags // Set configurations from CLI flags
@ -1878,8 +1878,8 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if !ctx.IsSet(MinerGasPriceFlag.Name) { if !ctx.IsSet(MinerGasPriceFlag.Name) {
cfg.Miner.GasPrice = big.NewInt(1) cfg.Miner.GasPrice = big.NewInt(1)
} }
case ctx.String(GenesisFlag.Name) != "": case ctx.String(OverrideGenesisFlag.Name) != "":
f, err := os.Open(ctx.String(GenesisFlag.Name)) f, err := os.Open(ctx.String(OverrideGenesisFlag.Name))
if err != nil { if err != nil {
Fatalf("Failed to read genesis file: %v", err) Fatalf("Failed to read genesis file: %v", err)
} }