Return Error Gracefully When Removing 4881 Flag (#13096)

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Nishant Das
2023-10-27 21:24:43 +08:00
committed by GitHub
parent 022ee17af9
commit 56c65b8527
3 changed files with 9 additions and 5 deletions

View File

@@ -754,6 +754,10 @@ func (s *Service) initializeEth1Data(ctx context.Context, eth1DataInDB *ethpb.ET
}
}
} else {
if eth1DataInDB.Trie == nil && eth1DataInDB.DepositSnapshot != nil {
return errors.Errorf("trying to use old deposit trie after migration to the new trie. "+
"Run with the --%s flag to resume normal operations.", features.EnableEIP4881.Name)
}
s.depositTrie, err = trie.CreateTrieFromProto(eth1DataInDB.Trie)
}
if err != nil {

View File

@@ -251,8 +251,8 @@ func ConfigureBeaconChain(ctx *cli.Context) error {
logEnabled(disableResourceManager)
cfg.DisableResourceManager = true
}
if ctx.IsSet(enableEIP4881.Name) {
logEnabled(enableEIP4881)
if ctx.IsSet(EnableEIP4881.Name) {
logEnabled(EnableEIP4881)
cfg.EnableEIP4881 = true
}
cfg.AggregateIntervals = [3]time.Duration{aggregateFirstInterval.Value, aggregateSecondInterval.Value, aggregateThirdInterval.Value}

View File

@@ -144,7 +144,7 @@ var (
Name: "prepare-all-payloads",
Usage: "Informs the engine to prepare all local payloads. Useful for relayers and builders",
}
enableEIP4881 = &cli.BoolFlag{
EnableEIP4881 = &cli.BoolFlag{
Name: "enable-eip-4881",
Usage: "Enables the deposit tree specified in EIP4881",
}
@@ -168,7 +168,7 @@ var (
// devModeFlags holds list of flags that are set when development mode is on.
var devModeFlags = []cli.Flag{
enableVerboseSigVerification,
enableEIP4881,
EnableEIP4881,
enableExperimentalState,
}
@@ -216,7 +216,7 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c
aggregateFirstInterval,
aggregateSecondInterval,
aggregateThirdInterval,
enableEIP4881,
EnableEIP4881,
disableResourceManager,
DisableRegistrationCache,
disableAggregateParallel,