-
Notifications
You must be signed in to change notification settings - Fork 1.6k
companion for pallet order fix. #4181
Changes from 7 commits
a230e5d
687ba03
8f59d95
357b0f9
b6cb588
f00ee26
6dcf0f9
69a64bf
8e0588e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,12 +292,10 @@ fn run_to_block(n: u32) { | |
assert!(System::block_number() < n); | ||
while System::block_number() < n { | ||
let block_number = System::block_number(); | ||
AllPallets::on_finalize(block_number); | ||
System::on_finalize(block_number); | ||
AllPalletsWithSystem::on_finalize(block_number); | ||
System::set_block_number(block_number + 1); | ||
System::on_initialize(block_number + 1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. System::on_initialize is now inside AllPalletsWithSystem. And it is no-op so having it after is fine. |
||
maybe_new_session(block_number + 1); | ||
AllPallets::on_initialize(block_number + 1); | ||
AllPalletsWithSystem::on_initialize(block_number + 1); | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1480,7 +1480,7 @@ construct_runtime! { | |
// Basic stuff; balances is uncallable initially. | ||
System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 0, | ||
|
||
// Must be before session. | ||
// Babe must be before session. | ||
Babe: pallet_babe::{Pallet, Call, Storage, Config, ValidateUnsigned} = 1, | ||
|
||
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, | ||
|
@@ -1489,6 +1489,8 @@ construct_runtime! { | |
TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33, | ||
|
||
// Consensus support. | ||
// Authorship must be before session in order to note author in the correct session and era | ||
// for im-online and staking. | ||
Authorship: pallet_authorship::{Pallet, Call, Storage} = 5, | ||
Staking: pallet_staking::{Pallet, Call, Storage, Config<T>, Event<T>} = 6, | ||
Offences: pallet_offences::{Pallet, Storage, Event} = 7, | ||
|
@@ -1602,7 +1604,7 @@ pub type Executive = frame_executive::Executive< | |
Block, | ||
frame_system::ChainContext<Runtime>, | ||
Runtime, | ||
AllPallets, | ||
AllPalletsWithSystem, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So here we have switched from reverse order, to not-reversed order. I was expecting this to cause some items in construct_runtime to be swapped. How so? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the only constraint I have found are those I put into comment, and switching to no-reversed order actually fix them. because pallet-authoship is executed after pallet-session. About babe and session AFAICT the order is not relevant, all cases are handled in their implementation |
||
(SessionHistoricalPalletPrefixMigration,), | ||
>; | ||
/// The payload being signed in the transactions. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System::on_finalize is inside AllPalletsWithSystem now