-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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
eth/catalyst: fix canon behind CurrentBlock #24988
eth/catalyst: fix canon behind CurrentBlock #24988
Conversation
@@ -144,7 +144,7 @@ func (api *ConsensusAPI) ForkchoiceUpdatedV1(update beacon.ForkchoiceStateV1, pa | |||
} | |||
} | |||
|
|||
if rawdb.ReadCanonicalHash(api.eth.ChainDb(), block.NumberU64()) != update.HeadBlockHash { | |||
if rawdb.ReadCanonicalHash(api.eth.ChainDb(), block.NumberU64()) != update.HeadBlockHash || block.NumberU64() > api.eth.BlockChain().CurrentBlock().NumberU64() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scenario is: the local canonical hash is matched with the block, but local chain head is lower than the block.
I am wondering why it can happen in the first place. Whenever reorg happens, all the canonical hash above the new head will be deleted.
Can you share the concrete test scenario description? |
|
I think the root cause is: after reorg, the newchain length is 1. The new head won't be processed in So here https://github.com/ethereum/go-ethereum/blob/master/core/blockchain.go#L2075 I will submit a PR to fix it |
So, I think @rjl493456442 's PR #24996 was it? |
I don't thinks so, I'll wait for hive to run and close this PR then |
This fixes all hive tests
Invalid Ancestor Chain Re-Org, Invalid StateRoot, Invalid P9', Reveal using newPayload (go-ethereum)
where we reveal using newPayload.
The issue is that the head block is marked as canonical but the current block is behind the head block.
I am not really confident in this as I suspect it might not fix the root cause (a block being marked canonical that is not really in our canonical chain).
Maybe @rjl493456442 could take a look at this