Skip to content

A potential chain config bug when switch to new version the first time. #2071

@zzzckck

Description

@zzzckck

System information

Geth version: v1.3.6
OS & Version: Linux
Commit hash : 5ee77bb

Expected behaviour

v1.3.6 should load correct chain config

Actual behaviour

v1.3.6 failed to load correct chain config the first time, but it can if it restart.
the issue only happen the first time that node is upgraded.

Steps to reproduce the behaviour

1.use v1.2.13 to init and run full sync for a while.
2.replace v1.2.13 with v1.3.6, then parlia.New(...) will be passed with previous old chainConfig, which does not contain the hardfork information of Hertzfix and Kepler
3.but if restart v1.3.6, then it would recover, since the chainConfig will be updated and store into DB after parlia.New(...)

Backtrace

//== v1.2.13
 0  0x0000000100bf1c2a in github.com/ethereum/go-ethereum/core.(*Genesis).configOrDefault
    at github.com/ethereum/go-ethereum/core/genesis.go:279
 1  0x0000000100bf127d in github.com/ethereum/go-ethereum/core.SetupGenesisBlockWithOverride
    at github.com/ethereum/go-ethereum/core/genesis.go:210
 2  0x00000001011609f3 in github.com/ethereum/go-ethereum/eth.New
    at github.com/ethereum/go-ethereum/eth/backend.go:153
 3  0x00000001013c3185 in github.com/ethereum/go-ethereum/cmd/utils.RegisterEthService
    at github.com/ethereum/go-ethereum/cmd/utils/flags.go:1915
 4  0x00000001019ab2df in main.makeFullNode
    at github.com/ethereum/go-ethereum/cmd/geth/config.go:167
 5  0x00000001019b5ff8 in main.geth
    at github.com/ethereum/go-ethereum/cmd/geth/main.go:324
 6  0x0000000100da30fa in gopkg.in/urfave/cli%2ev1.HandleAction
    at gopkg.in/urfave/cli.v1@v1.20.0/app.go:490
 7  0x0000000100da099d in gopkg.in/urfave/cli%2ev1.(*App).Run
    at gopkg.in/urfave/cli.v1@v1.20.0/app.go:264
 8  0x00000001019b5af5 in main.main
    at github.com/ethereum/go-ethereum/cmd/geth/main.go:282
 9  0x000000010003de07 in runtime.main
    at runtime/proc.go:250
10  0x00000001000734c1 in runtime.goexit
    at runtime/asm_amd64.s:1598


//== v1.3.6
(dlv) bt
 0  0x0000000100e7f1cf in github.com/ethereum/go-ethereum/core.LoadChainConfig
    at github.com/ethereum/go-ethereum/core/genesis.go:404
 1  0x0000000101402727 in github.com/ethereum/go-ethereum/eth.New
    at github.com/ethereum/go-ethereum/eth/backend.go:164
 2  0x000000010161c607 in github.com/ethereum/go-ethereum/cmd/utils.RegisterEthService
    at github.com/ethereum/go-ethereum/cmd/utils/flags.go:2155
 3  0x0000000101c32755 in main.makeFullNode
    at github.com/ethereum/go-ethereum/cmd/geth/config.go:175
 4  0x0000000101c40353 in main.geth
    at github.com/ethereum/go-ethereum/cmd/geth/main.go:341
 5  0x0000000100e00e2b in github.com/urfave/cli/v2.(*Command).Run
    at github.com/urfave/cli/v2@v2.25.7/command.go:274
 6  0x0000000100dfd5b6 in github.com/urfave/cli/v2.(*App).RunContext
    at github.com/urfave/cli/v2@v2.25.7/app.go:332
 7  0x0000000101c3fde7 in github.com/urfave/cli/v2.(*App).Run
    at github.com/urfave/cli/v2@v2.25.7/app.go:309
 8  0x0000000101c3fde7 in main.main
    at github.com/ethereum/go-ethereum/cmd/geth/main.go:284
 9  0x0000000100040667 in runtime.main
    at runtime/proc.go:250
10  0x0000000100075de1 in runtime.goexit
    at runtime/asm_amd64.s:1598


(dlv) bt
 0  0x0000000100e7f9ea in github.com/ethereum/go-ethereum/core.(*Genesis).configOrDefault
    at github.com/ethereum/go-ethereum/core/genesis.go:467
 1  0x0000000100e7ebed in github.com/ethereum/go-ethereum/core.SetupGenesisBlockWithOverride
    at github.com/ethereum/go-ethereum/core/genesis.go:363
 2  0x0000000100e546f5 in github.com/ethereum/go-ethereum/core.NewBlockChain
    at github.com/ethereum/go-ethereum/core/blockchain.go:322
 3  0x00000001014035cf in github.com/ethereum/go-ethereum/eth.New
    at github.com/ethereum/go-ethereum/eth/backend.go:252
 4  0x000000010161c607 in github.com/ethereum/go-ethereum/cmd/utils.RegisterEthService
    at github.com/ethereum/go-ethereum/cmd/utils/flags.go:2155
 5  0x0000000101c32755 in main.makeFullNode
    at github.com/ethereum/go-ethereum/cmd/geth/config.go:175
 6  0x0000000101c40353 in main.geth
    at github.com/ethereum/go-ethereum/cmd/geth/main.go:341
 7  0x0000000100e00e2b in github.com/urfave/cli/v2.(*Command).Run
    at github.com/urfave/cli/v2@v2.25.7/command.go:274
 8  0x0000000100dfd5b6 in github.com/urfave/cli/v2.(*App).RunContext
    at github.com/urfave/cli/v2@v2.25.7/app.go:332
 9  0x0000000101c3fde7 in github.com/urfave/cli/v2.(*App).Run
    at github.com/urfave/cli/v2@v2.25.7/app.go:309
10  0x0000000101c3fde7 in main.main
    at github.com/ethereum/go-ethereum/cmd/geth/main.go:284
11  0x0000000100040667 in runtime.main
    at runtime/proc.go:250
12  0x0000000100075de1 in runtime.goexit

When submitting logs: please submit them as text and not screenshots.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions