-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
for the polkadot It seems we don't need any changes: |
frame/executive/src/lib.rs
Outdated
OnRuntimeUpgrade | ||
>::pre_upgrade().unwrap(); | ||
|
||
<(COnRuntimeUpgrade, AllPallets) as OnRuntimeUpgrade>::pre_upgrade().unwrap(); |
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.
I think this is also a noteworthy change. Here system pallet upgrades after the runtime upgrades.
Dunno actually if this can cause issues?
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.
I think for pre_upgrade/post_upgrade the order wasn't so important as it is just checks.
But the order of on_runtime_upgrade is important. That said the order was: custom, then system then pallets.
I will precise this in the note
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.
try_on_runtime_upgrade
should always imitate what the real on_runtime_upgrade would do, which is respected here, so no issues.
- The substrate verion for sp-core was updated to 4.1.0-dev. - The toolchain was updated to nightly-2021-12-10 due to incompatibilities with the toolchain nightly-2021-12-22 - "AllPallets" was replaces by AllPalletsReversedWithSystemFirst according to paritytech/substrate#10043 Co-authored-by: Gaudenz Kessler <gaudenz.kessler@scs.ch>
- The substrate verion for sp-core was updated to 4.1.0-dev. - "AllPallets" was replaces by AllPalletsReversedWithSystemFirst according to Fix order of hook execution paritytech/substrate#10043 Co-authored-by: Gaudenz Kessler <gaudenz.kessler@scs.ch>
* fix order * Update frame/support/procedural/src/construct_runtime/mod.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * format * more accurate description * format * better explicit types * fix tests * address feedback * add a type to ease non breaking implementation * add comment about constraint * fix test * add test for generated types Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
* fix order * Update frame/support/procedural/src/construct_runtime/mod.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * format * more accurate description * format * better explicit types * fix tests * address feedback * add a type to ease non breaking implementation * add comment about constraint * fix test * add test for generated types Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
* Add secp256k1 ecdsa recover (integritee-network#42) * implement secp256k1_ecdsa_recover * fix sgx compilation error * reorder libsecp256k1 in .toml Co-authored-by: suinuj <junius@litentry.com> * Update substrate to b9cafba (integritee-network#44) - The substrate verion for sp-core was updated to 4.1.0-dev. - "AllPallets" was replaces by AllPalletsReversedWithSystemFirst according to Fix order of hook execution paritytech/substrate#10043 Co-authored-by: Gaudenz Kessler <gaudenz.kessler@scs.ch> * Add runtime-api `get_metadata` (integritee-network#47) Co-authored-by: echevrier <edith.chevrier@scs.ch> * Bump substrate to commit 7c63420 (integritee-network#48) * update .tomls to match new substrate version * update rust toolchain * cargo update * revert unnecessary cargo update.. * updae sp-io version * redo toolchain bump - teaclave.. * fix version changes * add missing sp-io functions (integritee-network#49) * update sp-io trie * add root version 2 * add storage::root version2 * Bump substrate to commit f5f286db0da99761792b69bf4a997535dcc8f260 (integritee-network#50) Co-authored-by: echevrier <edith.chevrier@scs.ch> * Bump to polkadot 0.9.19 and switch to polkadot branches (integritee-network#53) Remove TransactionByteFee Apply WeightToFeePolynomials to pallet_transaction_payment Co-authored-by: echevrier <edith.chevrier@scs.ch> * fix cargo.lock * add some pubs * add one more pub Co-authored-by: suinuj <junius@litentry.com> Co-authored-by: gaudenzkessler <92718752+gaudenzkessler@users.noreply.github.com> Co-authored-by: Gaudenz Kessler <gaudenz.kessler@scs.ch> Co-authored-by: echevrier <84318241+echevrier@users.noreply.github.com> Co-authored-by: echevrier <edith.chevrier@scs.ch>
* fix order * Update frame/support/procedural/src/construct_runtime/mod.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * format * more accurate description * format * better explicit types * fix tests * address feedback * add a type to ease non breaking implementation * add comment about constraint * fix test * add test for generated types Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Fix #6280
Fix #9105
polkadot companion: paritytech/polkadot#4181
cumulus companion: paritytech/cumulus#711
Breaking Change:
AllPallets
is deprecated in favor of explicit:AllPalletsWithSystem
,AllPalletsWithoutSystem
,AllPalletsWithSystemReversed
,AllPalletsWithoutSystemReversed
. Before this PRAllPallets
represented all pallets without system in reversed order (i.e. same asAllPalletsWithoutSystemReversed
, it now representAllPalletsWithSystem
as it is a more sane expectation.frame_executive::Executive
requires as generic all pallets with system. Before this PR the type required as generic all pallets without system and always executed system pallet hook before all pallets hook. But this requires duplicate works and error prone implementation thus it now requires all pallets with system. The previous order was to execute the hook onsystem
pallet first and thenAllPallets
. It is recomended to use one ofAllPalletsWithSystem
orAllPalletsWithSystemReversed
orAllPalletsReversedWithSystemFirst
.Because before the PR all pallets represented all pallets in reversed, and system was executed first then if someone want to keep the same behavior as before they should use the type
AllPalletsReversedWithSystemFirst
when using the typeframe_executive::Executive
.Though it is recommended to be careful about the order of definition of the pallet in construct_runtime. and probably reorganize and use
AllPalletsWithSystem
, so the order is the expected normal order and not in reversed (as before this PR).NOTE: frame_executive::Executive will execute the hooks
on_initialize
,on_idle
,on_runtime_upgrade
,on_finalize
,offchain_worker
on the genericAllPallets
, so the order should be reviewed for those execution.Upgrade guide:
use
AllPalletsReversedWithSystemFirst
when instancing executive type, that mean the execution order is not changed from before this PR, thus no need to change anything inconstruct_runtime
.Use the new
AllPalletsWithSystem
, but this would mean that they might need to reorder some stuff inconstruct_runtime
.review other usage of
AllPallets
and change toAllPalletsWithoutSystemReversed
in case the old order must be kept, or change toAllPalletsWithoutSystem
to get the new definition with pallets defined in the order of their declaration inconstruct_runtime
.