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

fix frontier template pending #366

Merged
merged 6 commits into from
Dec 14, 2023
Merged

Conversation

girazoki
Copy link
Collaborator

@girazoki girazoki commented Dec 14, 2023

Fixes the way we create pending blocks and thus fixes estimateGas on pending blocks for the frontier template. It also refactors and simplfifies the manual seal consensus provider

@girazoki girazoki added B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes not-breaking Does not need to be mentioned in breaking changes labels Dec 14, 2023
@@ -619,7 +615,7 @@ where
Timer::interval(Duration::from_millis(millis)),
|_| EngineCommand::SealNewBlock {
create_empty: true,
finalize: false,
finalize: true,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

otherwise the import was not working when doing the interval one

Copy link
Contributor

github-actions bot commented Dec 14, 2023

Coverage Report

(master)

@@                        Coverage Diff                        @@
##           master   girazoki-fix-template-pending      +/-   ##
=================================================================
+ Coverage   73.93%                          73.97%   +0.04%     
  Files          91                              91              
+ Lines       20488                           20534      +46     
=================================================================
+ Hits        15146                           15189      +43     
+ Misses       5342                            5345       +3     
Files Changed Coverage
/client/consensus/src/manual_seal.rs 94.59% (+0.04%) 🔼
/client/node-common/src/service.rs 48.48% (-0.31%) 🔽
/container-chains/templates/frontier/node/src/rpc/mod.rs 90.22% (+2.22%) 🔼
/container-chains/templates/frontier/node/src/service.rs 76.61% (-0.16%) 🔽
/pallets/inflation-rewards/src/lib.rs 90.91% (-2.27%) 🔽

Coverage generated Thu Dec 14 15:55:57 UTC 2023

@girazoki girazoki marked this pull request as ready for review December 14, 2023 14:21
@tmpolaczyk
Copy link
Contributor

Running the command manually doesn't seem to work, is that expected?

./target/release/container-chain-template-frontier-node --dev --sealing 10000
2023-12-14 16:09:38 Development Service Ready    
2023-12-14 16:09:43 💤 Idle (0 peers), best: #0 (0xff61…26cc), finalized #0 (0xff61…26cc), ⬇ 0 ⬆ 0    
2023-12-14 16:09:48 🙌 Starting consensus session on top of parent 0xff6136bc3182257e27ee779fb412c066458f35e73aa5a315ae53b8aefc5926cc    
2023-12-14 16:09:48 panicked at 'assertion failed: `(left == right)`
  left: `0xee1f119ffea896faf122ccd12d66b392b4ff668968ccf3436b1089d6ebc40168`,
 right: `0xff6136bc3182257e27ee779fb412c066458f35e73aa5a315ae53b8aefc5926cc`: expected parent to be included', /home/tomasz/.cargo/git/checkouts/polkadot-sdk-df3be1d6828443a1/d93a55a/cumulus/pallets/parachain-system/src/lib.rs:1294:17    
2023-12-14 16:09:48 1 storage transactions are left open by the runtime. Those will be rolled back.    
2023-12-14 16:09:48 1 storage transactions are left open by the runtime. Those will be rolled back.    
2023-12-14 16:09:48 ❗️ 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: 0x2fdd7f - <unknown>!rust_begin_unwind
    1: 0x2643ff - <unknown>!core::panicking::panic_fmt::hf5c4cd929d4aaa9e
    2: 0x26491d - <unknown>!core::panicking::assert_failed_inner::h2aa5e8e7fe201c6e
    3: 0x137364 - <unknown>!core::panicking::assert_failed::haf184cb31261c374
    4: 0x1371c1 - <unknown>!cumulus_pallet_parachain_system::<impl cumulus_pallet_parachain_system::pallet::Pallet<T>>::maybe_drop_included_ancestors::h7915a0af676ee198
    5: 0x23633c - <unknown>!frame_support::storage::transactional::with_storage_layer::h42ccb6f3d27a4071
    6: 0xe80f1 - <unknown>!<cumulus_pallet_parachain_system::pallet::Call<T> as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::{{closure}}::h37c407dc4e12d1a8
    7: 0xeb665 - <unknown>!environmental::using_once::h2c3838db49b00248
    8: 0x14810f - <unknown>!<container_chain_template_frontier_runtime::RuntimeCall as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::h99e4ab47fb77cde3
    9: 0x14b47d - <unknown>!<container_chain_template_frontier_runtime::RuntimeCall as sp_runtime::traits::Dispatchable>::dispatch::hdd7a18769be99ca4
   10: 0x24b280 - <unknown>!<fp_self_contained::checked_extrinsic::CheckedExtrinsic<AccountId,Call,Extra,SelfContainedSignedInfo> as sp_runtime::traits::Applyable>::apply::haa07973d51fc888e
   11: 0xfebfb - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::apply_extrinsic::h19d9756e3aa946e6
   12: 0x18154c - <unknown>!BlockBuilder_apply_extrinsic. Dropping.    
2023-12-14 16:09:48 panicked at 'Invalid relay chain state proof: RootMismatch', /home/tomasz/.cargo/git/checkouts/dancekit-b6c418692b12ca11/5964111/container-chain-pallets/authorities-noting/src/lib.rs:179:22    
2023-12-14 16:09:48 1 storage transactions are left open by the runtime. Those will be rolled back.    
2023-12-14 16:09:48 1 storage transactions are left open by the runtime. Those will be rolled back.    
2023-12-14 16:09:48 ❗️ 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: 0x2fdd7f - <unknown>!rust_begin_unwind
    1: 0x2643ff - <unknown>!core::panicking::panic_fmt::hf5c4cd929d4aaa9e
    2: 0x2649d7 - <unknown>!core::result::unwrap_failed::he0ddc269083098af
    3: 0x241764 - <unknown>!frame_support::storage::transactional::with_storage_layer::hde9d9b4727af0a76
    4: 0xe2a20 - <unknown>!<pallet_cc_authorities_noting::pallet::Call<T> as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::{{closure}}::h7654659882fa60ca
    5: 0xeb9de - <unknown>!environmental::using_once::h2dec0137e0c1445f
    6: 0x14850f - <unknown>!<container_chain_template_frontier_runtime::RuntimeCall as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::h99e4ab47fb77cde3
    7: 0x14b47d - <unknown>!<container_chain_template_frontier_runtime::RuntimeCall as sp_runtime::traits::Dispatchable>::dispatch::hdd7a18769be99ca4
    8: 0x24b280 - <unknown>!<fp_self_contained::checked_extrinsic::CheckedExtrinsic<AccountId,Call,Extra,SelfContainedSignedInfo> as sp_runtime::traits::Applyable>::apply::haa07973d51fc888e
    9: 0xfebfb - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::apply_extrinsic::h19d9756e3aa946e6
   10: 0x18154c - <unknown>!BlockBuilder_apply_extrinsic. Dropping.    
2023-12-14 16:09:48 panicked at 'Block invalid, supplied author is not eligible.', /home/tomasz/.cargo/git/checkouts/moonkit-c6defa46a244ac75/de13eac/pallets/author-inherent/src/lib.rs:136:13    
2023-12-14 16:09:48 1 storage transactions are left open by the runtime. Those will be rolled back.    
2023-12-14 16:09:48 1 storage transactions are left open by the runtime. Those will be rolled back.    
2023-12-14 16:09:48 ❗️ 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: 0x2fdd7f - <unknown>!rust_begin_unwind
    1: 0x2643ff - <unknown>!core::panicking::panic_fmt::hf5c4cd929d4aaa9e
    2: 0x24e34c - <unknown>!pallet_author_inherent::pallet::Pallet<T>::kick_off_authorship_validation::hbef518a121508452
    3: 0xeb212 - <unknown>!environmental::using_once::h1b25eb4ac9b18b06
    4: 0x148554 - <unknown>!<container_chain_template_frontier_runtime::RuntimeCall as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::h99e4ab47fb77cde3
    5: 0x14b47d - <unknown>!<container_chain_template_frontier_runtime::RuntimeCall as sp_runtime::traits::Dispatchable>::dispatch::hdd7a18769be99ca4
    6: 0x24b280 - <unknown>!<fp_self_contained::checked_extrinsic::CheckedExtrinsic<AccountId,Call,Extra,SelfContainedSignedInfo> as sp_runtime::traits::Applyable>::apply::haa07973d51fc888e
    7: 0xfebfb - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::apply_extrinsic::h19d9756e3aa946e6
    8: 0x18154c - <unknown>!BlockBuilder_apply_extrinsic. Dropping.    
2023-12-14 16:09:48 panicked at 'set_validation_data inherent needs to be present in every block!', /home/tomasz/.cargo/git/checkouts/polkadot-sdk-df3be1d6828443a1/d93a55a/cumulus/pallets/parachain-system/src/lib.rs:268:18    
2023-12-14 16:09:48 Consensus with no RPC sender encountered an 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: 0x2fdd7f - <unknown>!rust_begin_unwind
    1: 0x2643ff - <unknown>!core::panicking::panic_fmt::hf5c4cd929d4aaa9e
    2: 0x2643ad - <unknown>!core::option::expect_failed::hc36a69366777ce0b
    3: 0x12f9bf - <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::h408a1da847921346
    4: 0xd79b8 - <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) as frame_support::traits::hooks::OnFinalize<BlockNumber>>::on_finalize::h7cbf25859742aa4f
    5: 0xff0ab - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::idle_and_finalize_hook::haa412512477f2611
    6: 0xff152 - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::finalize_block::hc93d1de8fd7cb612
    7: 0x1815f5 - <unknown>!BlockBuilder_finalize_block    
2023-12-14 16:09:48 💤 Idle (0 peers), best: #0 (0xff61…26cc), finalized #0 (0xff61…26cc), ⬇ 0 ⬆ 0

@girazoki
Copy link
Collaborator Author

girazoki commented Dec 14, 2023

yes, you need to do ./target/release/container-chain-template-frontier-node --dev --sealing 10000 --para-id=2000 (or any other number that is not 1000)

The reason is that in dev mode we harcode 1000 as the orchestrator para id

@girazoki girazoki merged commit a9515f8 into master Dec 14, 2023
25 checks passed
@girazoki girazoki deleted the girazoki-fix-template-pending branch December 14, 2023 16:33
girazoki added a commit that referenced this pull request Dec 15, 2023
* fix pending block creation

* FMT

* fmt and rework

* test

* fixes

* fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes not-breaking Does not need to be mentioned in breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants