Skip to content
Snippets Groups Projects
Unverified Commit 63bf73d5 authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

Aura: Ensure we are building on each relay chain fork (#5352)


We only want to build one block per slot for Aura on parachains.
However, we still need to build on each relay chain fork, which is using
the same slot.

Closes: https://github.com/paritytech/polkadot-sdk/issues/5349

---------

Co-authored-by: default avatarDavide Galassi <davxy@datawok.net>
Co-authored-by: default avatarSebastian Kunert <skunert49@gmail.com>
parent 048f4b8e
No related merge requests found
Pipeline #490458 waiting for manual action with stages
in 48 minutes and 41 seconds
......@@ -138,6 +138,7 @@ where
};
let mut last_processed_slot = 0;
let mut last_relay_chain_block = Default::default();
while let Some(request) = collation_requests.next().await {
macro_rules! reject_with_error {
......@@ -215,11 +216,13 @@ where
//
// Most parachains currently run with 12 seconds slots and thus, they would try to
// produce multiple blocks per slot which very likely would fail on chain. Thus, we have
// this "hack" to only produce on block per slot.
// this "hack" to only produce one block per slot per relay chain fork.
//
// With https://github.com/paritytech/polkadot-sdk/issues/3168 this implementation will be
// obsolete and also the underlying issue will be fixed.
if last_processed_slot >= *claim.slot() {
if last_processed_slot >= *claim.slot() &&
last_relay_chain_block < *relay_parent_header.number()
{
continue
}
......@@ -261,6 +264,7 @@ where
}
last_processed_slot = *claim.slot();
last_relay_chain_block = *relay_parent_header.number();
}
}
}
title: "Aura: Ensure parachains are building on all relay chain forks"
doc:
- audience: Node Dev
description: |
Ensure that parachains using the `basic` collator are building on all relay chain forks.
crates:
- name: cumulus-client-consensus-aura
bump: patch
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