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

Instantly seal parachain block with async backing #4437

Closed
AurevoirXavier opened this issue May 12, 2024 · 5 comments · Fixed by #4442
Closed

Instantly seal parachain block with async backing #4437

AurevoirXavier opened this issue May 12, 2024 · 5 comments · Fixed by #4442

Comments

@AurevoirXavier
Copy link
Contributor

I originally posted this question on https://substrate.stackexchange.com/questions/11457/how-to-instantly-seal-parachain-block-with-async-backing, but it seems I can't find help there.

@alexggh
Copy link
Contributor

alexggh commented May 13, 2024

Looking into it, meanwhile can you give me some reproducing steps, what exactly are you running ?

@bkchr
Copy link
Member

bkchr commented May 13, 2024

Yes the issue is valid, we don't have tests for this stuff.

@librelois could you port your mentioned commit to polkadot-sdk? https://substrate.stackexchange.com/a/11461/73 I left here a comment on what would need to change to make it correct.

github-merge-queue bot pushed a commit that referenced this issue May 13, 2024
…ing (#4442)

Support async backing in `--dev` mode

This PR improve the relay mock `MockValidationDataInherentDataProvider`
to mach expectations of async backing runtimes.

* Add para_head in the mock relay proof
* Add relay slot in the mock relay proof 

fix #4437
AurevoirXavier pushed a commit to darwinia-network/polkadot-sdk that referenced this issue May 23, 2024
…ng (paritytech#4442)

Support async backing in `--dev` mode

This PR improve the relay mock `MockValidationDataInherentDataProvider`
to mach expectations of async backing runtimes.

* Add para_head in the mock relay proof
* Add relay slot in the mock relay proof

fix paritytech#4437
@AurevoirXavier
Copy link
Contributor Author

AurevoirXavier commented May 23, 2024

After applying patch #4442, I still received a slot mismatched error.

Adding this hack (https://github.com/darwinia-network/darwinia/pull/1492/files#diff-daced65c5a2c24e21e748746a2501eb6f6006d23e3d5fc15804227d84496f57aR804-R814) resolved the slot mismatch issue, but I encountered another error. Any ideas? @bkchr, I think the current_para_block_head isn't being applied to the proof correctly. (If everything works as expected, I don't think I'll need that hack.)

[node/src/service/mod.rs:822] &current_para_block = 0
[node/src/service/mod.rs:823] &current_para_block_head = Some(
    HeadData(
        [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            87,
            229,
            159,
            236,
            242,
            254,
            1,
            175,
            162,
            82,
            180,
            17,
            157,
            138,
            34,
            85,
            56,
            114,
            226,
            13,
            95,
            20,
            102,
            137,
            69,
            161,
            24,
            100,
            240,
            198,
            83,
            54,
            3,
            23,
            10,
            46,
            117,
            151,
            183,
            183,
            227,
            216,
            76,
            5,
            57,
            29,
            19,
            154,
            98,
            177,
            87,
            231,
            135,
            134,
            216,
            192,
            130,
            242,
            157,
            207,
            76,
            17,
            19,
            20,
            0,
        ],
    ),
)
2024-05-23 13:27:54 🙌 Starting consensus session on top of parent 0x4a83030f4aba3757811d1debd705b21139ae5f5d662dfef9957dd2b88ac4ba75    
2024-05-23 13:27:54 panicked at /Users/xavier/.cargo/git/checkouts/polkadot-sdk-38f315c8db144fd3/a8cf515/cumulus/pallets/parachain-system/src/lib.rs:1232:30:
included head not present in relay storage proof    
2024-05-23 13:27:54 1 storage transactions are left open by the runtime. Those will be rolled back.    
2024-05-23 13:27:54 1 storage transactions are left open by the runtime. Those will be rolled back.    
2024-05-23 13:27:54 ❗️ 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: 0x4f37fe - <unknown>!rust_begin_unwind
    1: 0x157ee - <unknown>!core::panicking::panic_fmt::h7a368385936888dc
    2: 0x42fb72 - <unknown>!cumulus_pallet_parachain_system::<impl cumulus_pallet_parachain_system::pallet::Pallet<T>>::maybe_drop_included_ancestors::h640741b418b44079
    3: 0x2115be - <unknown>!frame_support::storage::transactional::with_transaction::h458621a732ccff50
    4: 0x310c9d - <unknown>!<cumulus_pallet_parachain_system::pallet::Call<T> as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::{{closure}}::h62f75eb84ba9559e
    5: 0x3182f6 - <unknown>!frame_support::dispatch_context::run_in_context::h18e926ebed681127
    6: 0x157f6f - <unknown>!<pangolin_runtime::RuntimeCall as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::h577607987f407648
    7: 0x14d6a0 - <unknown>!<pangolin_runtime::RuntimeCall as sp_runtime::traits::Dispatchable>::dispatch::h8a5e4456e060abbf
    8: 0x3b7148 - <unknown>!<fp_self_contained::checked_extrinsic::CheckedExtrinsic<AccountId,Call,Extra,SelfContainedSignedInfo> as sp_runtime::traits::Applyable>::apply::h4ab3c6f0958c5c49
    9: 0x296503 - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::apply_extrinsic::hef131d48fe7740fd
   10: 0x4d1cda - <unknown>!BlockBuilder_apply_extrinsic. Dropping.    
2024-05-23 13:27:54 panicked at /Users/xavier/.cargo/git/checkouts/polkadot-sdk-38f315c8db144fd3/a8cf515/cumulus/pallets/parachain-system/src/lib.rs:248:13:
set_validation_data inherent needs to be present in every block!    
2024-05-23 13:27:54 Proposing failed: Import failed: 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: 0x4f37fe - <unknown>!rust_begin_unwind
    1: 0x157ee - <unknown>!core::panicking::panic_fmt::h7a368385936888dc
    2: 0x429213 - <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::h9bc11a447bb8e170
    3: 0x1ded41 - <unknown>!<(TupleElement0,TupleElement1,TupleElement2,TupleElement3,TupleElement4,TupleElement5,TupleElement6,TupleElement7,TupleElement8,TupleElement9,TupleElement10,TupleElement11,TupleElement12,TupleElement13,TupleElement14,TupleElement15,TupleElement16,TupleElement17,TupleElement18,TupleElement19,TupleElement20,TupleElement21,TupleElement22,TupleElement23,TupleElement24,TupleElement25,TupleElement26,TupleElement27,TupleElement28,TupleElement29,TupleElement30,TupleElement31,TupleElement32,TupleElement33,TupleElement34,TupleElement35,TupleElement36,TupleElement37) as frame_support::traits::hooks::OnFinalize<BlockNumber>>::on_finalize::h29249672646509af
    4: 0x296c01 - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::idle_and_finalize_hook::h408a9ae0d8bf5a1b
    5: 0x4d1e2a - <unknown>!BlockBuilder_finalize_block 

@bkchr
Copy link
Member

bkchr commented May 23, 2024

@AurevoirXavier #4555 this should make it more obvious that you need to set para_id. In your case you can fix the MockXcm::new to pass the proper para_id.

@AurevoirXavier
Copy link
Contributor Author

AurevoirXavier commented May 23, 2024

@AurevoirXavier #4555 this should make it more obvious that you need to set para_id. In your case you can fix the MockXcm::new to pass the proper para_id.

Unfortunately, I still have this problem. I checked Moonbeam's code, and they also left the paraid as the default value. Link to code

AurevoirXavier pushed a commit to darwinia-network/polkadot-sdk that referenced this issue May 23, 2024
…ing (paritytech#4442)

Support async backing in `--dev` mode

This PR improve the relay mock `MockValidationDataInherentDataProvider`
to mach expectations of async backing runtimes.

* Add para_head in the mock relay proof
* Add relay slot in the mock relay proof 

fix paritytech#4437
hitchhooker pushed a commit to ibp-network/polkadot-sdk that referenced this issue Jun 5, 2024
…ing (paritytech#4442)

Support async backing in `--dev` mode

This PR improve the relay mock `MockValidationDataInherentDataProvider`
to mach expectations of async backing runtimes.

* Add para_head in the mock relay proof
* Add relay slot in the mock relay proof 

fix paritytech#4437
liuchengxu pushed a commit to liuchengxu/polkadot-sdk that referenced this issue Jun 19, 2024
…ing (paritytech#4442)

Support async backing in `--dev` mode

This PR improve the relay mock `MockValidationDataInherentDataProvider`
to mach expectations of async backing runtimes.

* Add para_head in the mock relay proof
* Add relay slot in the mock relay proof 

fix paritytech#4437
AurevoirXavier pushed a commit to darwinia-network/polkadot-sdk that referenced this issue Jun 26, 2024
…ing (paritytech#4442)

Support async backing in `--dev` mode

This PR improve the relay mock `MockValidationDataInherentDataProvider`
to mach expectations of async backing runtimes.

* Add para_head in the mock relay proof
* Add relay slot in the mock relay proof 

fix paritytech#4437
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this issue Aug 2, 2024
…ing (paritytech#4442)

Support async backing in `--dev` mode

This PR improve the relay mock `MockValidationDataInherentDataProvider`
to mach expectations of async backing runtimes.

* Add para_head in the mock relay proof
* Add relay slot in the mock relay proof 

fix paritytech#4437
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants