Parachains-Aura: Only produce once per slot (#3308)

Given how the block production is driven for Parachains right now, with
the enabling of async backing we would produce two blocks per slot.
Until we have a proper collator implementation, the "hack" is to prevent
the production of multiple blocks per slot.


Closes: https://github.com/paritytech/polkadot-sdk/issues/3282
This commit is contained in:
Bastian Köcher
2024-02-13 21:07:51 +01:00
committed by GitHub
parent 96ebb305ed
commit aa68ea58f3
4 changed files with 60 additions and 2 deletions
@@ -258,6 +258,7 @@ where
pub struct SlotClaim<Pub> {
author_pub: Pub,
pre_digest: DigestItem,
slot: Slot,
timestamp: Timestamp,
}
@@ -272,7 +273,7 @@ impl<Pub> SlotClaim<Pub> {
P::Public: Codec,
P::Signature: Codec,
{
SlotClaim { author_pub, timestamp, pre_digest: aura_internal::pre_digest::<P>(slot) }
SlotClaim { author_pub, timestamp, pre_digest: aura_internal::pre_digest::<P>(slot), slot }
}
/// Get the author's public key.
@@ -285,6 +286,11 @@ impl<Pub> SlotClaim<Pub> {
&self.pre_digest
}
/// Get the slot assigned to this claim.
pub fn slot(&self) -> Slot {
self.slot
}
/// Get the timestamp corresponding to the relay-chain slot this claim was
/// generated against.
pub fn timestamp(&self) -> Timestamp {