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

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

Merged
merged 6 commits into from
Aug 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cumulus/client/consensus/aura/src/collators/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 on block per slot per relay chain fork.
bkchr marked this conversation as resolved.
Show resolved Hide resolved
//
// 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()
bkchr marked this conversation as resolved.
Show resolved Hide resolved
{
continue
}

Expand Down Expand Up @@ -261,6 +264,7 @@ where
}

last_processed_slot = *claim.slot();
last_relay_chain_block = *relay_parent_header.number();
}
}
}
Loading