From 24a789bc71d99b80271f8870dea614085eb95184 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Wed, 1 May 2024 16:27:49 +0700 Subject: [PATCH] protection from starting e2 git branch on e3 db (#10150) --- cmd/utils/flags.go | 5 ----- eth/backend.go | 3 +++ turbo/cli/default_flags.go | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index a175bc24685..9472ea08d9f 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -661,10 +661,6 @@ var ( Usage: "Metrics HTTP server listening port", Value: metrics.DefaultConfig.Port, } - HistoryV3Flag = cli.BoolFlag{ - Name: "experimental.history.v3", - Usage: "(Also known as Erigon3) Not recommended yet: Can't change this flag after node creation. New DB and Snapshots format of history allows: parallel blocks execution, get state as of given transaction without executing whole block.", - } CliqueSnapshotCheckpointIntervalFlag = cli.UintFlag{ Name: "clique.checkpoint", @@ -1804,7 +1800,6 @@ func SetEthConfig(ctx *cli.Context, nodeConfig *nodecfg.Config, cfg *ethconfig.C setCaplin(ctx, cfg) cfg.Ethstats = ctx.String(EthStatsURLFlag.Name) - cfg.HistoryV3 = ctx.Bool(HistoryV3Flag.Name) if ctx.IsSet(RPCGlobalGasCapFlag.Name) { cfg.RPCGasCap = ctx.Uint64(RPCGlobalGasCapFlag.Name) diff --git a/eth/backend.go b/eth/backend.go index 94c77703f22..5da94c18d7f 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -263,6 +263,9 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger return nil, err } + if config.HistoryV3 { + return nil, errors.New("seems you using erigon2 git branch on erigon3 DB") + } ctx, ctxCancel := context.WithCancel(context.Background()) // kv_remote architecture does blocks on stream.Send - means current architecture require unlimited amount of txs to provide good throughput diff --git a/turbo/cli/default_flags.go b/turbo/cli/default_flags.go index ecc99c3a513..251094811bf 100644 --- a/turbo/cli/default_flags.go +++ b/turbo/cli/default_flags.go @@ -128,7 +128,6 @@ var DefaultFlags = []cli.Flag{ &utils.GpoBlocksFlag, &utils.GpoPercentileFlag, &utils.InsecureUnlockAllowedFlag, - &utils.HistoryV3Flag, &utils.IdentityFlag, &utils.CliqueSnapshotCheckpointIntervalFlag, &utils.CliqueSnapshotInmemorySnapshotsFlag,