Skip to content
Snippets Groups Projects
Unverified Commit 5b8abbc8 authored by asynchronous rob's avatar asynchronous rob Committed by GitHub
Browse files

statement-dist: activate leaves before unconditional deactivate (#3048)

https://github.com/paritytech/polkadot-sdk/pull/3042/files#r1465115145

---------

Co-authored-by: command-bot <>
parent 50eb12cf
Branches
No related merge requests found
Pipeline #437855 failed with stages
in 39 minutes and 42 seconds
......@@ -319,10 +319,12 @@ impl<R: rand::Rng> StatementDistributionSubsystem<R> {
if let Some(ref activated) = activated {
let mode = prospective_parachains_mode(ctx.sender(), activated.hash).await?;
if let ProspectiveParachainsMode::Enabled { .. } = mode {
// Ensure we deactivate first, before we activate the new block.
// Activation can fail and then we would skip the deactivation.
let res =
v2::handle_active_leaves_update(ctx, state, activated, mode).await;
// Regardless of the result of leaf activation, we always prune before
// handling it to avoid leaks.
v2::handle_deactivate_leaves(state, &deactivated);
v2::handle_active_leaves_update(ctx, state, activated, mode).await?;
res?;
} else if let ProspectiveParachainsMode::Disabled = mode {
for deactivated in &deactivated {
crate::legacy_v1::handle_deactivate_leaf(legacy_v1_state, *deactivated);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment