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

Stale/Fresh Leaf mechanism in overseer might not actually get used #768

Closed
eskimor opened this issue Oct 3, 2022 · 7 comments · Fixed by #1565
Closed

Stale/Fresh Leaf mechanism in overseer might not actually get used #768

eskimor opened this issue Oct 3, 2022 · 7 comments · Fixed by #1565
Assignees

Comments

@eskimor
Copy link
Member

eskimor commented Oct 3, 2022

It is not clear whether a chain reversion actually triggers a BlockImport event, as technically no block got imported. We should verify through reading code/docs and trying whether that code is actually needed and if not, get rid of it.

Semantics of BlockImport event should in any case get clarified in code and docs on how it behaves on chain reversions.

@eskimor eskimor changed the title Stale/Fresh Leaf mechanism might not actually get used Stale/Fresh Leaf mechanism in overseer might not actually get used Oct 3, 2022
@tifecool
Copy link

How can I execute a "chain reversion"?

@eskimor
Copy link
Member Author

eskimor commented Nov 16, 2022

You need to trigger a dispute that resolves against a candidate. This will trigger a reversion right before the including block. A dispute can be triggered in Zombienet via malus nodes. See here for example.

@bkchr
Copy link
Member

bkchr commented Nov 16, 2022

A re-org is not triggering any block import event. We also don't directly re-org from the point of view of the database. Babe will just start building on a different fork as being told by the SelectChain implementation in Polkadot. The Substrate db re-orgs when there is a fork that is better than the current best chain (this is happening this way because of some legacy stuff AFAIK).

@eskimor
Copy link
Member Author

eskimor commented Nov 16, 2022

Got it, so this answers the question: The code is not actually in use and can be removed.

@tifecool
Copy link

I'm assuming the status for the ActivatedLeaves will be Stale as a chain revertion is still occurring, but the leaves are being encountered again?

@ordian
Copy link
Member

ordian commented Nov 17, 2022

I'm assuming the status for the ActivatedLeaves will be Stale as a chain revertion is still occurring, but the leaves are being encountered again?

No, LeafStatus::Stale is an unreachable state, so we can remove LeafStatus completely. As mentioned above, on chain reversion, there won't be an block import notification issued for the new (old) best block.

@tifecool
Copy link

I'm not sure I'll be able to assist with this issue 😓

@Sophia-Gold Sophia-Gold transferred this issue from paritytech/polkadot Aug 24, 2023
@ordian ordian self-assigned this Sep 14, 2023
ordian added a commit that referenced this issue Oct 23, 2023
claravanstaden added a commit to Snowfork/polkadot-sdk that referenced this issue Dec 8, 2023
)

* Calculate finalized header time on genesis config import

* Finishes up import time check fix.

* fmt

* Revert switching back to polkadot launch.

* Update parachain/pallets/ethereum-beacon-client/src/benchmarking/data.rs

Co-authored-by: David Dunn <26876072+doubledup@users.noreply.github.com>

Co-authored-by: claravanstaden <Cats 4 life!>
Co-authored-by: David Dunn <26876072+doubledup@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Status: Done
6 participants