go-ethereum/cmd/geth
rjl493456442 37c0e6992e
cmd, core, miner: rework genesis setup (#30907)
This pull request refactors the genesis setup function, the major
changes are highlighted here:

**(a) Triedb is opened in verkle mode if `EnableVerkleAtGenesis` is
configured in chainConfig or the database has been initialized previously with
`EnableVerkleAtGenesis` configured**.

A new config field `EnableVerkleAtGenesis` has been added in the
chainConfig. This field must be configured with True if Geth wants to initialize 
the genesis in Verkle mode.

In the verkle devnet-7, the verkle transition is activated at genesis.
Therefore, the verkle rules should be used since the genesis. In production
networks (mainnet and public testnets), verkle activation always occurs after
the genesis block. Therefore, this flag is only made for devnet and should be
deprecated later. Besides, verkle transition at non-genesis block hasn't been
implemented yet, it should be done in the following PRs.

**(b) The genesis initialization condition has been simplified**
There is a special mode supported by the Geth is that: Geth can be
initialized with an existing chain segment, which can fasten the node sync
process by retaining the chain freezer folder.

Originally, if the triedb is regarded as uninitialized and the genesis block can
be found in the chain freezer, the genesis block along with genesis state will be
committed. This condition has been simplified to checking the presence of chain
config in key-value store. The existence of chain config can represent the genesis
has been committed.
2025-01-14 11:49:30 +01:00
..
testdata all: remove TerminalTotalDifficultyPassed (#30609) 2024-10-23 08:26:18 +02:00
accountcmd.go cmd/geth: remove unlock commandline flag (#30737) 2024-11-15 10:15:15 +01:00
accountcmd_test.go cmd/geth: remove unlock commandline flag (#30737) 2024-11-15 10:15:15 +01:00
attach_test.go all: fix mismatched names in comments (#29348) 2024-03-26 21:01:28 +01:00
chaincmd.go cmd, core, miner: rework genesis setup (#30907) 2025-01-14 11:49:30 +01:00
config.go metrics, cmd/geth: change init-process of metrics (#30814) 2024-12-10 13:27:29 +01:00
consolecmd.go internal/flags: remove Merge, it's identical to slices.Concat (#30706) 2024-10-31 19:26:02 +02:00
consolecmd_test.go build, internal, version: break ci.go/version->common dependency (#30638) 2024-10-20 19:28:39 +03:00
dbcmd.go internal/flags: remove Merge, it's identical to slices.Concat (#30706) 2024-10-31 19:26:02 +02:00
exportcmd_test.go all: simplify tests using t.TempDir() (#30150) 2024-07-15 15:26:58 +02:00
genesis_test.go all: remove TerminalTotalDifficultyPassed (#30609) 2024-10-23 08:26:18 +02:00
logging_test.go all: simplify tests using t.TempDir() (#30150) 2024-07-15 15:26:58 +02:00
logtestcmd_active.go cmd/geth, internal/debug: get rid of by-default log config (#28801) 2024-01-12 15:59:03 +02:00
logtestcmd_inactive.go cmd/geth: test for logging-output (#28373) 2023-10-25 17:57:12 +02:00
main.go metrics, cmd/geth: change init-process of metrics (#30814) 2024-12-10 13:27:29 +01:00
misccmd.go build, internal, version: break ci.go/version->common dependency (#30638) 2024-10-20 19:28:39 +03:00
run_test.go cmd, les, tests: remove light client code (#28586) 2023-11-23 16:28:26 +02:00
snapshot.go internal/flags: remove Merge, it's identical to slices.Concat (#30706) 2024-10-31 19:26:02 +02:00
verkle.go internal/flags: remove Merge, it's identical to slices.Concat (#30706) 2024-10-31 19:26:02 +02:00
version_check.go cmd: migrate to urfave/cli/v2 (#24751) 2022-06-27 18:22:36 +02:00
version_check_test.go build: update to golangci-lint 1.61.0 (#30587) 2024-10-14 19:25:22 +02:00