Skip to content

Parachains-Aura: Only produce once per slot#3308

Merged
bkchr merged 4 commits intomasterfrom
bkchr-aura-one-block-per-slot
Feb 13, 2024
Merged

Parachains-Aura: Only produce once per slot#3308
bkchr merged 4 commits intomasterfrom
bkchr-aura-one-block-per-slot

Conversation

@bkchr
Copy link
Copy Markdown
Member

@bkchr bkchr commented Feb 13, 2024

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: #3282

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.
@bkchr bkchr added the T0-node This PR/Issue is related to the topic “node”. label Feb 13, 2024
@skunert
Copy link
Copy Markdown
Contributor

skunert commented Feb 13, 2024

Hmm why do we need this? After switching to the lookahead collator, everything seems to be fine: #3282 (comment)

@alexggh
Copy link
Copy Markdown
Contributor

alexggh commented Feb 13, 2024

Hmm why do we need this? After switching to the lookahead collator, everything seems to be fine: #3282 (comment)

Once we enable async backing in kusama everyone will get this warnings in their logs, it would help if we can just point them to a new release that they can just pick without them having to switch to the lookahead collator.

@bkchr
Copy link
Copy Markdown
Member Author

bkchr commented Feb 13, 2024

After switching to the lookahead collator, everything seems to be fine

This requires everyone to switch and also this implementation is "broken" the way it is.

if last_processed_slot >= *claim.slot() {
continue
} else {
last_processed_slot = *claim.slot();
Copy link
Copy Markdown
Contributor

@alexggh alexggh Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this assignment at the end of the loop, so that we don't save the slot in case we have errors down the road and let the next block try as well.

Just want to be extra safe and make sure we don't end up in a situation where at first slot pass we don't build the block because runtime doesn't accept it and then at second pass we don't even try anymore.

@skunert
Copy link
Copy Markdown
Contributor

skunert commented Feb 13, 2024

After switching to the lookahead collator, everything seems to be fine

This requires everyone to switch and also this implementation is "broken" the way it is.

My main concern was that by upgrading the runtime according to the upgrade guide, you will have a runtime with the parameterized ConsensusHook. However with the basic collator we will not call into the runtime to check whether we should build a new block. So if you upgrade the runtime to be ready for async-backing, best would be to also use lookahead collator until the slot-based one is ready.

@bkchr
Copy link
Copy Markdown
Member Author

bkchr commented Feb 13, 2024

My main concern was that by upgrading the runtime according to the upgrade guide, you will have a runtime with the parameterized ConsensusHook. However with the basic collator we will not call into the runtime to check whether we should build a new block. So if you upgrade the runtime to be ready for async-backing, best would be to also use lookahead collator until the slot-based one is ready.

The point being that this error also appearing without you having done any kind of upgrade of your runtime. Without you having done any "preparations" for async backing. The problem is that we call every 6s into block production and it builds a block every 6s, which is forbidden with a slot duration of 12s and no special ConsensusHook nor allowing multiple blocks per slot.

Looking for example at rococo-contract you see the exact same error:

	
2024-02-13 20:13:00.206	
2024-02-13 19:13:00.206 ERROR tokio-runtime-worker aura::cumulus: [Parachain] err=Error { inner: Proposing

Caused by:
    0: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
       WASM backtrace:
       error while executing at wasm backtrace:
           0: 0x3ec581 - <unknown>!rust_begin_unwind
           1: 0x35b530 - <unknown>!core::panicking::panic_fmt::h7a368385936888dc
           2: 0x35c0df - <unknown>!core::option::expect_failed::h6f4ce1bb06a99e85
           3: 0xdcf92 - <unknown>!<cumulus_pallet_parachain_system::pallet::Pallet<T> as frame_support::traits::hooks::OnFinalize<<<<T as frame_system::pallet::Config>::Block as sp_runtime::traits::HeaderProvider>::HeaderT as sp_runtime::traits::Header>::Number>>::on_finalize::h4e4fe4715a42fc86
           4: 0x2f5ab8 - <unknown>!<(TupleElement0,TupleElement1,TupleElement2,TupleElement3,TupleElement4,TupleElement5,TupleElement6,TupleElement7,TupleElement8,TupleElement9,TupleElement10,TupleElement11,TupleElement12,TupleElement13,TupleElement14,TupleElement15,TupleElement16,TupleElement17,TupleElement18,TupleElement19) as frame_support::traits::hooks::OnFinalize<BlockNumber>>::on_finalize::h8002c271ad9845c5
           5: 0xcc2a4 - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::idle_and_finalize_hook::h9d8dc7cdb43e265b
           6: 0xcc31a - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::finalize_block::he4390deed033dc44
           7: 0x1dffa8 - <unknown>!BlockBuilder_finalize_block
    1: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
       WASM backtrace:
       error while executing at wasm backtrace:
           0: 0x3ec581 - <unknown>!rust_begin_unwind
           1: 0x35b530 - <unknown>!core::panicking::panic_fmt::h7a368385936888dc
           2: 0x35c0df - <unknown>!core::option::expect_failed::h6f4ce1bb06a99e85
           3: 0xdcf92 - <unknown>!<cumulus_pallet_parachain_system::pallet::Pallet<T> as frame_support::traits::hooks::OnFinalize<<<<T as frame_system::pallet::Config>::Block as sp_runtime::traits::HeaderProvider>::HeaderT as sp_runtime::traits::Header>::Number>>::on_finalize::h4e4fe4715a42fc86
           4: 0x2f5ab8 - <unknown>!<(TupleElement0,TupleElement1,TupleElement2,TupleElement3,TupleElement4,TupleElement5,TupleElement6,TupleElement7,TupleElement8,TupleElement9,TupleElement10,TupleElement11,TupleElement12,TupleElement13,TupleElement14,TupleElement15,TupleElement16,TupleElement17,TupleElement18,TupleElement19) as frame_support::traits::hooks::OnFinalize<BlockNumber>>::on_finalize::h8002c271ad9845c5
           5: 0xcc2a4 - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::idle_and_finalize_hook::h9d8dc7cdb43e265b
           6: 0xcc31a - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::finalize_block::he4390deed033dc44
           7: 0x1dffa8 - <unknown>!BlockBuilder_finalize_block }
	
	
2024-02-13 20:13:00.205	
2024-02-13 19:13:00.204 ERROR tokio-runtime-worker runtime: [Parachain] panicked at /build/cumulus/pallets/parachain-system/src/lib.rs:265:18:
set_validation_data inherent needs to be present in every block!    
	
	
2024-02-13 20:13:00.205	
2024-02-13 19:13:00.199  WARN tokio-runtime-worker basic-authorship: [Parachain] ❗️ Inherent extrinsic returned unexpected error: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:
error while executing at wasm backtrace:
    0: 0x3ec581 - <unknown>!rust_begin_unwind
    1: 0x35b530 - <unknown>!core::panicking::panic_fmt::h7a368385936888dc
    2: 0xe26a0 - <unknown>!cumulus_pallet_parachain_system::<impl cumulus_pallet_parachain_system::pallet::Pallet<T>>::maybe_drop_included_ancestors::h258e888dadafbe2e
    3: 0x33ad11 - <unknown>!frame_support::storage::transactional::with_transaction::he21fbc1e8e99aa0d
    4: 0x1b082e - <unknown>!<cumulus_pallet_parachain_system::pallet::Call<T> as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::{{closure}}::hc3f0b1f2c83df24e
    5: 0x1bcff3 - <unknown>!environmental::local_key::LocalKey<T>::with::hfd57165ae274502d
    6: 0x2aa35a - <unknown>!<contracts_rococo_runtime::RuntimeCall as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::h029a8aeff1d8105b
    7: 0x2a82b8 - <unknown>!<contracts_rococo_runtime::RuntimeCall as sp_runtime::traits::Dispatchable>::dispatch::h73846a040550c6a6
    8: 0xcbb7f - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::apply_extrinsic::h1dbe3e3b186edb58
    9: 0x1dfeee - <unknown>!BlockBuilder_apply_extrinsic. Dropping.    

@bkchr bkchr enabled auto-merge February 13, 2024 19:44
@bkchr bkchr added this pull request to the merge queue Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T0-node This PR/Issue is related to the topic “node”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no space left for the block in the unincluded segment

4 participants