go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

all: remove forkchoicer and reorgNeeded

Open MariusVanDerWijden opened this issue 5 months ago • 2 comments

This PR changes how we view sidechains. Before the merge it was possible to import a chain with lower td and not set it as canonical in InsertChain. After the merge, we expect every chain that we get via InsertChain to be canonical, non-canonical blocks can still be inserted with InsertBlockWIthoutSetHead.

If during the InsertChain, the existing chain is not canonical anymore, we mark it as a sidechain and send the SideChainEvents normally.

MariusVanDerWijden avatar Mar 06 '24 14:03 MariusVanDerWijden

I commented out all the ethereum/tests that we're failing with this PR due to them expecting us to not import a sidechain with lower td. There is one test in core/blockchain_test.go that I didn't know how to make work, I added a comment with my thoughts about it. Would be nice if someone smarter could take a look

MariusVanDerWijden avatar Mar 06 '24 14:03 MariusVanDerWijden

core/blockchain_insert.go:174:27: func (*insertIterator).first is unused (unused)

Please fix the lint

rjl493456442 avatar Apr 03 '24 12:04 rjl493456442