Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev mode with path enabled: panic when rewinding farther than 128 blocks. #29103

Closed
jwasinger opened this issue Feb 27, 2024 · 1 comment · Fixed by #29107
Closed

dev mode with path enabled: panic when rewinding farther than 128 blocks. #29103

jwasinger opened this issue Feb 27, 2024 · 1 comment · Fixed by #29107
Assignees
Labels

Comments

@jwasinger
Copy link
Contributor

jwasinger commented Feb 27, 2024

Steps to reproduce the behaviour

Start geth in dev mode with path enabled, --datadir omitted. Create many blocks. Rewind the chain farther than 128 blocks.

Backtrace

ERROR[02-27|14:41:06.774] RPC method debug_setHead crashed: runtime error: invalid memory address or nil pointer dereference
goroutine 11000 [running]:
github.com/ethereum/go-ethereum/rpc.(*callback).call.func1()
	github.com/ethereum/go-ethereum/rpc/service.go:199 +0x74
panic({0x1065ece40, 0x10744c9a0})
	runtime/panic.go:884 +0x204
github.com/ethereum/go-ethereum/core/rawdb.(*ResettableFreezer).AncientRange(0x14001eb02a0?, {0x105eff918?, 0x140006f5120?}, 0x140003a0b28?, 0x140003a0c28?, 0x1065d4140?)
	github.com/ethereum/go-ethereum/core/rawdb/freezer_resettable.go:127 +0x34
github.com/ethereum/go-ethereum/core/rawdb.ReadStateHistoryMetaList(...)
	github.com/ethereum/go-ethereum/core/rawdb/accessors_state.go:180
github.com/ethereum/go-ethereum/triedb/pathdb.checkHistories(0x0, 0x8e94f000774ec435?, 0xb89b7709dbd314c8?, 0x1400262ac58)
	github.com/ethereum/go-ethereum/triedb/pathdb/history.go:548 +0x70
github.com/ethereum/go-ethereum/triedb/pathdb.(*Database).Recoverable(0x140001ce280, {0x5f, 0x91, 0x4e, 0xb1, 0x6c, 0xef, 0xb9, 0xb5, 0x35, ...})
	github.com/ethereum/go-ethereum/triedb/pathdb/database.go:397 +0x160
github.com/ethereum/go-ethereum/triedb.(*Database).Recoverable(0x1067534c0?, {0x5f, 0x91, 0x4e, 0xb1, 0x6c, 0xef, 0xb9, 0xb5, 0x35, ...})
	github.com/ethereum/go-ethereum/triedb/database.go:286 +0x44
github.com/ethereum/go-ethereum/core.(*BlockChain).stateRecoverable(0x14000210400, {0x5f, 0x91, 0x4e, 0xb1, 0x6c, 0xef, 0xb9, 0xb5, 0x35, ...})
	github.com/ethereum/go-ethereum/core/blockchain_reader.go:331 +0x7c
github.com/ethereum/go-ethereum/core.(*BlockChain).setHeadBeyondRoot.func1({0x12f1f0398, 0x14002f3b1d0}, 0x14001a68780)
	github.com/ethereum/go-ethereum/core/blockchain.go:676 +0x908
github.com/ethereum/go-ethereum/core.(*HeaderChain).setHead(0x140004ac6c0, 0x1, 0x0, 0x1400262b298, 0x1400262b278)
	github.com/ethereum/go-ethereum/core/headerchain.go:609 +0x340
github.com/ethereum/go-ethereum/core.(*HeaderChain).SetHead(...)
	github.com/ethereum/go-ethereum/core/headerchain.go:554
github.com/ethereum/go-ethereum/core.(*BlockChain).setHeadBeyondRoot(0x14000210400, 0x1, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...)
	github.com/ethereum/go-ethereum/core/blockchain.go:788 +0x280
github.com/ethereum/go-ethereum/core.(*BlockChain).SetHead(0x14000210400, 0x104f5615c?)
	github.com/ethereum/go-ethereum/core/blockchain.go:570 +0x34
github.com/ethereum/go-ethereum/eth.(*EthAPIBackend).SetHead(0x140006e8e88, 0x0?)
	github.com/ethereum/go-ethereum/eth/api_backend.go:64 +0x48
github.com/ethereum/go-ethereum/internal/ethapi.(*DebugAPI).SetHead(0x0?, 0x0?)
	github.com/ethereum/go-ethereum/internal/ethapi/api.go:2111 +0x28
reflect.Value.call({0x14000e26460?, 0x1400097c9a0?, 0x12f1317e0?}, {0x105ef45fe, 0x4}, {0x14000b6fef0, 0x2, 0x105716974?})
	reflect/value.go:586 +0x87c
reflect.Value.Call({0x14000e26460?, 0x1400097c9a0?, 0x1?}, {0x14000b6fef0?, 0x0?, 0x14000d38648?})
	reflect/value.go:370 +0x90
github.com/ethereum/go-ethereum/rpc.(*callback).call(0x14000025140, {0x106843998?, 0x14000b6fea0}, {0x14000d38620, 0xd}, {0x14001aa4618, 0x1, 0x10570f750?})
	github.com/ethereum/go-ethereum/rpc/service.go:205 +0x364
github.com/ethereum/go-ethereum/rpc.(*handler).runMethod(0x14000d38618?, {0x106843998?, 0x14000b6fea0?}, 0x14001a1b260, 0x1?, {0x14001aa4618?, 0x14002dcee38?, 0x0?})
	github.com/ethereum/go-ethereum/rpc/handler.go:565 +0x40
github.com/ethereum/go-ethereum/rpc.(*handler).handleCall(0x14000456000, 0x14001875470, 0x14001a1b260)
	github.com/ethereum/go-ethereum/rpc/handler.go:512 +0x1dc
github.com/ethereum/go-ethereum/rpc.(*handler).handleCallMsg(0x14000456000, 0x14000b6fea0?, 0x14001a1b260)
	github.com/ethereum/go-ethereum/rpc/handler.go:470 +0x1d4
github.com/ethereum/go-ethereum/rpc.(*handler).handleNonBatchCall(0x14000456000, 0x14001875470, 0x14001a1b260)
	github.com/ethereum/go-ethereum/rpc/handler.go:296 +0x174
github.com/ethereum/go-ethereum/rpc.(*handler).handleMsg.func1.1(0x106843998?)
	github.com/ethereum/go-ethereum/rpc/handler.go:269 +0x2c
github.com/ethereum/go-ethereum/rpc.(*handler).startCallProc.func1()
	github.com/ethereum/go-ethereum/rpc/handler.go:387 +0xc0
created by github.com/ethereum/go-ethereum/rpc.(*handler).startCallProc
	github.com/ethereum/go-ethereum/rpc/handler.go:383 +0x8c
@laumeng
Copy link

laumeng commented Feb 28, 2024

I also encountered the same problem ,have you solved it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants