Skip to content
This repository has been archived by the owner on Feb 18, 2025. It is now read-only.

blockchain: fix inconsistent reorg behavior #391

Merged
merged 4 commits into from
Jan 17, 2024

Conversation

NganSM
Copy link
Contributor

@NganSM NganSM commented Jan 9, 2024

If the chain is reorganized because the newly submit block has higher justified block number, it can be reverted back to the old chain prior to reorg because the old blocks cause ErrKnownBlock during insertion via the insertChain method, which invokes writeKnownBlock to set the old chain as the canonical chain again.

@NganSM NganSM force-pushed the fix-inconsistent-reorg branch from 65df573 to c988786 Compare January 9, 2024 10:52
NganSM and others added 4 commits January 16, 2024 10:52
If the chain is reorganized because the newly submit block has higher
justified block number, it can be reverted back to the old chain prior
to reorg because the old blocks cause ErrKnownBlock during insertion
via the insertChain method, which invokes writeKnownBlock to set the
old chain as the canonical chain again.
…face

When testing, we may need to create the standalone consortium-v2 engine so we
need to make it fully implement FastFinalityPoSA interface.
When generating Consortium blocks, we need to modify the block after
FinalizeAndAssemble to change the block signature in header's extra data. New
function GenerateConsortiumChain adds a new parameter so the caller can pass a
function to modify block after FinalizeAndAssemble. Besides, the fake chain
reader also needs to return correct block header to be used by consensus engine
in FinalizeAndAssemble.
@minh-bq minh-bq force-pushed the fix-inconsistent-reorg branch from c988786 to cd2adc8 Compare January 17, 2024 06:06
@NganSM NganSM requested review from minh-bq and DNK90 January 17, 2024 07:07
@minh-bq minh-bq merged commit bf2f0d1 into axieinfinity:master Jan 17, 2024
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants