Open ozgunozerk opened 5 months ago
As additional notes:
AllowMultipleBlocksPerSlot
is set to falseand the code piece that causes the error is from lib.rs
of aura pallet
:
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn on_initialize(_: BlockNumberFor<T>) -> Weight {
if let Some(new_slot) = Self::current_slot_from_digests() {
let current_slot = CurrentSlot::<T>::get();
if T::AllowMultipleBlocksPerSlot::get() {
assert!(current_slot <= new_slot, "Slot must not decrease");
} else {
assert!(current_slot < new_slot, "Slot must increase"); // THIS LINE CAUSES THE ERROR
}
CurrentSlot::<T>::put(new_slot);
if let Some(n_authorities) = <Authorities<T>>::decode_len() {
let authority_index = *new_slot % n_authorities as u64;
if T::DisabledValidators::is_disabled(authority_index as u32) {
panic!(
"Validator with index {:?} is disabled and should not be attempting to author blocks.",
authority_index,
);
}
}
// TODO [#3398] Generate offence report for all authorities that skipped their
// slots.
T::DbWeight::get().reads_writes(2, 1)
} else {
T::DbWeight::get().reads(1)
}
}
What happened?
We bootstrapped a custom experimental relay chain, and then registered a new parachain to it.
Steps to reproduce for creating a new parachain can be found here: https://github.com/KitHat/sub0-oz-workshop/
When the nodes for parachain starts (Alice and Bob in this case) the following happens:
Thread 'tokio-runtime-worker' panicked at 'Slot must increase', /Users/ozgunozerk/.cargo/git/checkouts/polkadot-sdk-cff69157b985ed76/2fe3145/substrate/frame/aura/src/lib.rs:139
(details can be found below)Below is the detailed logs:
platform
Expected behavior
This error should not be present
Contribution Guidelines