From 0bfaecafddd4d3f0e530a912f1228110f8fc9684 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Mon, 17 Mar 2025 19:19:28 +0800 Subject: [PATCH] Revert "cmd,eth: dry" This reverts commit 97dad429f2311029b74cd9b70a41237edc935558. Signed-off-by: jsvisa --- cmd/geth/chaincmd.go | 3 +-- cmd/utils/flags.go | 2 +- eth/ethconfig/config.go | 8 -------- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 744b7dd426..c30927d9ff 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -35,7 +35,6 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/internal/era" "github.com/ethereum/go-ethereum/log" @@ -223,7 +222,7 @@ func initGenesis(ctx *cli.Context) error { overrides.OverrideVerkle = &v } - chaindb, err := stack.OpenDatabaseWithFreezer(ethconfig.ChainDbName, 0, 0, ctx.String(utils.AncientFlag.Name), ethconfig.ChainDbNamespace, false) + chaindb, err := stack.OpenDatabaseWithFreezer("chaindata", 0, 0, ctx.String(utils.AncientFlag.Name), "", false) if err != nil { utils.Fatalf("Failed to open database: %v", err) } diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 759997a289..7a5562c3d2 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -2029,7 +2029,7 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node, readonly bool) ethdb. } chainDb = remotedb.New(client) default: - chainDb, err = stack.OpenDatabaseWithFreezer(ethconfig.ChainDbName, cache, handles, ctx.String(AncientFlag.Name), ethconfig.ChainDbNamespace, readonly) + chainDb, err = stack.OpenDatabaseWithFreezer("chaindata", cache, handles, ctx.String(AncientFlag.Name), "eth/db/chaindata/", readonly) } if err != nil { Fatalf("Could not open database: %v", err) diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index c9acea8030..ec6de9e663 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -36,14 +36,6 @@ import ( "github.com/ethereum/go-ethereum/params" ) -const ( - // ChainDbName is the name of the chain database - ChainDbName = "chaindata" - - // ChainDbNamespace is the namespace for the chain database - ChainDbNamespace = "eth/db/chaindata/" -) - // FullNodeGPO contains default gasprice oracle settings for full node. var FullNodeGPO = gasprice.Config{ Blocks: 20,