-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
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 focused on the core pallet logic and will take a closer look once its fully done.
If the preimages pallet compiles in can push the migration.
…into gav-no-stored-call
@ggwpez Should be ready for a full review now. |
## fixes KILTProtocol/ticket#2289 and KILTProtocol/ticket#2296 * Upgrades from Polkadot v0.9.29 to v0.9.32 * Adds missing feature implementations for all tomls (checked via `subalfred check features` in all crates) * Actually necessary for application of paritytech/substrate#10592 (see runtime changes in [dd81eac](dd81eac)) * Migrates Democracy, Preimage and Scheduler pallets to use bounded Calls, see below ## Summary of changes (Polkadot v0.9.30-0.9.32) * Weights v2 are not fully there yet, but the struct now includes the [second field for storage size](paritytech/substrate#12277) (tracking issue: https://github.com/paritytech/substrate/issues/12176) ### Breaking Changes * Breaking: Outer enums (paritytech/substrate#11981) * `Origin` --> `RuntimeOrigin` * `Call` --> `RuntimeCall` * `Event` --> `RuntimeEvent` * ~Convention seems to be to keep `Event`, `Call`, `Origin` for inner pallet usage, e.g. `Did::Origin`~ Update: We use `Runtime` prefix internally as well ### Noteworthy PRs * paritytech/substrate#12109 * paritytech/substrate#12328 * paritytech/cumulus#1585 * Following the effort of decoupling collators and full relay nodes, this PR adds the possibility of pointing the collator to an “external” (non in-process) relay node. This is still considered experimental, and the **relay node is suggested to run on the same machine than the collator for the moment**. * To specify the relay full node rpc: `polkadot-parachain --alice --collator --relay-chain-rpc-url <rpc-websocket-url>` * paritytech/substrate#12486 * Before this change only the interpreted WASM executor was included in per default compilations. Making the compiled executor opt-in, now, compiled WASM executor is set by default and an opt-out instead. This could lead to **big performance difference** between using these two, as more recent versions of the interpreter see a regression in performance. ### Scheduler, Preimage, Democracy Migration * paritytech/substrate#11649 * Referenda, Democracy, Scheduler and Preimage pallets are all now bounded in storage access footprint * Removed the concept of a "hard deadline" or weight-override priority and no longer guarantees that at least one scheduled item will be executed per block (since these are both dangerous to parachains which have a strict need of weight limits). This means you must ensure that scheduled items are below the MaximumWeight or they will not be executed. * Interesting comment: paritytech/substrate#11649 (comment) > There is migration code which moves existing proposals and referenda over to the new format. However IT DOES NOT MIGRATE EVERYTHING: > > * Preimages are **NOT** migrated. Any registered preimages in Democracy at the time of migration are dropped. Their balance is **NOT UNRESERVED**. > * The re-dispatcher used in the old Democracy implementation is removed. Any proposals scheduled for dispatch by Democracy **WILL NOT EXECUTE**. > > This means you SHOULD ensure that: > > * **the preimage for the runtime upgrade is placed as an imminent preimage, not with a deposit;** > * **no other preimages are in place at the time of upgrade;** > * **there are no other proposals scheduled for dispatch by Democracy at the time of upgrade.** > > The Democracy pallet will be marked as deprecated immediately once Referenda is considered production-ready. **ALL TEAMS ARE RECOMMENDED TO SWITCH SWAY FROM DEMOCRACY PALLET TO REFERENDA/CONVICTION-VOTING PALLETS ASAP** #### Result of `try-runtime` against Spiritnet on Friday Nov 18, 2022: ``` 2022-11-18 09:27:23.917 INFO main runtime::preimage::migration::v1: Migrating 0 images 2022-11-18 09:27:23.917 INFO main runtime::scheduler::migration: Trying to migrate 0 agendas... 2022-11-18 09:27:23.917 INFO main runtime::scheduler::migration: Migrated 0 agendas. 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: 0 public proposals will be migrated. 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: 25 referenda will be migrated. 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #7 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #20 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #13 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #5 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #8 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #1 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #19 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #9 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #16 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #14 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #21 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #15 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #24 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #22 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #2 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #10 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #0 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #6 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #11 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #3 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #17 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #18 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #23 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #4 2022-11-18 09:27:23.917 INFO main runtime::democracy::migration::v1: migrating referendum #25 2022-11-18 09:27:23.918 INFO main runtime::democracy::migration::v1: 0 public proposals migrated, 25 referenda migrated ``` ## Checklist: - [x] I have verified that the code works - [x] No panics! (checked arithmetic ops, no indexing `array[3]` use `get(3)`, ...) - [x] I have verified that the code is easy to understand - [ ] If not, I have left a well-balanced amount of inline comments - [x] I have [left the code in a better state](https://deviq.com/principles/boy-scout-rule) - [x] I have documented the changes (where applicable)
# Goal The goal of this PR is to upgrade substrate to polkadot release .9.30 Closes #704 Notes: [PR for Substrate upgrade to 0.9.30](https://github.com/substrate-developer-hub/substrate-parachain-template/pull/133) [Release Notes](https://github.com/paritytech/polkadot/releases/tag/v0.9.30) # Major updates from 0.9.29 to 0.9.30: * Only breaking changes: Rename of Enums in Pallet Config ```Call``` -> ```RuntimeCall``` ```Event``` -> ```RuntimeEvent``` and ```Origin``` -> ```RuntimeOrigin``` . Here is the PR paritytech/substrate#11981 * Upgrades from Polkadot v0.9.29 to v0.9.30, version update in dependencies tree * Weights update: V2 is slowly getting released and benign updates carried in this PR. https://github.com/paritytech/substrate/issues/12176 and paritytech/substrate#12277 * @enddynayn @shannonwells some updates in vesting pallet paritytech/substrate#12109 * @wilwade some pubsub stuff paritytech/substrate#12328 * @wilwade paritytech/cumulus#1585 * @shannonwells some updates in Democracy paritytech/substrate#11649 # Checklist - [ ] n/a Chain spec updated - [ ] n/a Custom RPC OR Runtime API added/changed? Updated js/api-augment. - [ ] n/a Design doc(s) updated - [ ] n/a Tests added - [ ] n/a Benchmarks added - [x] Weights updated - [x] Run benchmarks Co-authored-by: Dmitri <[email protected]> Co-authored-by: Jenkins <[email protected]>
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/polkadot-digest-11-jan-2023/1654/1 |
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-34/1432/8 |
* Anchor polkadot-v0.9.33 * Companion for paritytech/cumulus#1685 * Companion for paritytech/cumulus#1585 * Companion for paritytech/cumulus#1745 * Companion for paritytech/cumulus#1759 * Companion for paritytech/cumulus#1782 * Companion for paritytech/cumulus#1793 * Companion for paritytech/cumulus#1808 * Temp use prepare branch of messages-substrate * Use darwinia fork frontier * Use correct moonbeam substrate commit * Correct bp-darwinia-core std * Use prepare moonbeam v0.9.33 * Update ethereum to 0.14.0 * Companion for paritytech/substrate#11649, paritytech/polkadot#5729 democracy * Companion for paritytech/substrate#11649, paritytech/polkadot#5729 scheduler * Companion for paritytech/substrate#11649, paritytech/polkadot#5729 preimage * Companion for paritytech/substrate#12109 * Type create origin * Format * Fix type CreateOrigin * Format * Companion for polkadot-evm/frontier#935 * Fix compile * Fix service * Format * `Frontier` upgrade (#196) * Delete BaseFee * Fix todo * Update prepare branch * Fix mock * Add pallet-evm-precompile-dispatch/std * Format * Format * Correct version after merge * Fix review * Fix review * Fix CI test * Fix compile after merge Co-authored-by: bear <[email protected]>
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-38/2122/1 |
* Introduce preimages module in traits * Multisize Preimages * Len not actually necessary * Tweaks to the preimage API * Fixes * Get Scheduler building with new API * Scheduler tests pass * Bounded Scheduler 🎉 * Use Agenda holes and introduce IncompleteSince to avoid need to reschedule * Tests pass with new weight system * New benchmarks * Add missing file * Drop preimage when permenantly overeight * Drop preimage when permenantly overeight * Referenda uses latest preimage API * Testing ok * Adding tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fmt Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add preimage migration Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Docs * Remove dbg * Refactor Democracy * Refactor Democracy * Add final MEL * Remove silly maps * Fixes * Minor refactor * Formatting * Fixes * Fixes * Fixes * Update frame/preimage/src/lib.rs Co-authored-by: Shawn Tabrizi <[email protected]> * Add migrations to Democracy * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Resolve conflicts Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Resolve conflicts" This reverts commit a89cd0a. * Undo wrong resolves... Signed-off-by: Oliver Tale-Yazdi <[email protected]> * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Make compile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * massage clippy Signed-off-by: Oliver Tale-Yazdi <[email protected]> * More clippy Signed-off-by: Oliver Tale-Yazdi <[email protected]> * clippy annoyance Signed-off-by: Oliver Tale-Yazdi <[email protected]> * clippy annoyance Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix benchmarks Signed-off-by: Oliver Tale-Yazdi <[email protected]> * add missing file * Test <Preimage as QueryPreimage> Signed-off-by: Oliver Tale-Yazdi <[email protected]> * More tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Clippy harassment Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add test Signed-off-by: Oliver Tale-Yazdi <[email protected]> * clippy Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fixup tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Remove old stuff Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fmt Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Test <Scheduler as Anon> trait functions Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update pallet-ui tests Why is this needed? Should not be the case unless master is broken... Signed-off-by: Oliver Tale-Yazdi <[email protected]> * More scheduler trait test Signed-off-by: Oliver Tale-Yazdi <[email protected]> * More tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Apply review suggestion Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Beauty fixes Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add Scheduler test migration_v3_to_v4_works Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Merge fixup Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Keep referenda benchmarks instantiatable Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update weights Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use new scheduler weight functions Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use new democracy weight functions Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use weight compare functions Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update pallet-ui tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * More renaming… Signed-off-by: Oliver Tale-Yazdi <[email protected]> * More renaming… Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add comment Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Implement OnRuntimeUpgrade for scheduler::v3_to_v4 migration Put the migration into a proper `MigrateToV4` struct and implement the OnRuntimeUpgrade hooks for it. Also move the test to use that instead. This should make it easier for adding it to Polkadot. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Clippy Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Handle undecodable Agendas Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Remove trash Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix test Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use new OnRuntimeUpgrade functions Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fix test Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix BoundedSlice::truncate_from Co-authored-by: jakoblell Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix pre_upgrade hook return values Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add more error logging Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Find too large preimages in the pre_upgrade hook Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Test that too large Calls in agendas are ignored Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use new OnRuntimeUpgrade hooks Why did the CI not catch this?! Signed-off-by: Oliver Tale-Yazdi <[email protected]> * works fine - just more logs Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix staking migration Causing issues on Kusama... Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix UI tests No idea why this is needed. This is actually undoing an earlier change. Maybe the CI has different rustc versions!? Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Remove multisig's Calls (paritytech#12072) * Remove multisig's Calls * Multisig: Fix tests and re-introduce reserve logic (paritytech#12241) * Fix tests and re-introduce reserve logic * fix benches * add todo * remove irrelevant bench * [Feature] Add a migration that drains and refunds stored calls (paritytech#12313) * [Feature] Add a migration that drains and refunds stored calls * migration fixes * fixes * address review comments * consume the whole block weight * fix assertions * license header * fix interface Co-authored-by: parity-processbot <> Co-authored-by: parity-processbot <> Co-authored-by: Roman Useinov <[email protected]> * Fix test Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix multisig benchmarks Signed-off-by: Oliver Tale-Yazdi <[email protected]> * ".git/.scripts/bench-bot.sh" pallet dev pallet_democracy * ".git/.scripts/bench-bot.sh" pallet dev pallet_scheduler * ".git/.scripts/bench-bot.sh" pallet dev pallet_preimage Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]> Co-authored-by: parity-processbot <> Co-authored-by: Roman Useinov <[email protected]>
* Darwinia 2.0 * Darwinia shell chain (#27) * Skeleton * XCM configs * Bump toolchain * Code cleaning part.1 * Code cleaning part.2 * Update SS58 * Rename * Update token decimals * Format * Extract darwinia core primitives * License * Benchmarks * Extract constants * Docs * CI part.1 * Adjust the runtime pallets structure (#29) * frame-system * pallet-timestamp * pallet-authorship * pallet-balances * pallet-transaction-payment * pallet-parachain-system * pallet-parachain-info * pallet-aura-ext * pallet-xcmp-queue * pallet-dmp-queue * pallet-session * pallet-aura * pallet-collator-selection * format * deal ambiguous name * fix compile * clear imports * update visibility for pallets * add license for pallets * update darwinia comments * CI part.2 Signed-off-by: Xavier Lau <[email protected]> * CI part.3 * CI part.4 * Add missing features * Case * Setup build environment * CI part.5 * Enable `kusama-native`, `rococo-native` Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: Guantong <[email protected]> * Docs & formatting (#33) * Add EVM stuff (#30) * Skeleton * XCM configs * Bump toolchain * Code cleaning part.1 * Code cleaning part.2 * Update SS58 * Rename * Update token decimals * Format * Extract darwinia core primitives * Add frontier deps without fork! * License * Add pallets to runtime * Benchmarks * Append command part * Extract constants * Docs * CI part.1 * Adjust the runtime pallets structure (#29) * frame-system * pallet-timestamp * pallet-authorship * pallet-balances * pallet-transaction-payment * pallet-parachain-system * pallet-parachain-info * pallet-aura-ext * pallet-xcmp-queue * pallet-dmp-queue * pallet-session * pallet-aura * pallet-collator-selection * format * deal ambiguous name * fix compile * clear imports * update visibility for pallets * add license for pallets * update darwinia comments * Adapt main * Delete duplicated consts * Hack rpc * Client compile fix * Fix client * Move to ethereum mod * Add more precompile * Fix some issue * Solve conflict * Merge issues * Format * Add basic code for precompiles * Update EthRpcConfig * Use Hashing type * Foramt issue * Adjust service config * Add evm, ethereum feature * Add missing features * Move const * Doc * Format * Format * Format * Format * Format * Safer truncated * Clean importing * Suppress warnings * Remove empty line * Clean importing * Clean importing * Format * Clean importing * Restructure Co-authored-by: Xavier Lau <[email protected]> Co-authored-by: Guantong <[email protected]> * Polish RPC & service (#36) * Use full path * Abstract APIs & types * Format * Extract darwinia-runtime (#32) * Skeleton * XCM configs * Bump toolchain * Code cleaning part.1 * Code cleaning part.2 * Update SS58 * Rename * Update token decimals * Format * Extract darwinia core primitives * License * Benchmarks * Extract constants * Docs * CI part.1 * Adjust the runtime pallets structure (#29) * frame-system * pallet-timestamp * pallet-authorship * pallet-balances * pallet-transaction-payment * pallet-parachain-system * pallet-parachain-info * pallet-aura-ext * pallet-xcmp-queue * pallet-dmp-queue * pallet-session * pallet-aura * pallet-collator-selection * format * deal ambiguous name * fix compile * clear imports * update visibility for pallets * add license for pallets * update darwinia comments * CI part.2 Signed-off-by: Xavier Lau <[email protected]> * CI part.3 * CI part.4 * Add missing features * Case * Setup build environment * CI part.5 * init * adjust structure & fix compile * Move`type Barrier` out of `common` because of different runtimes may require different barriers * Add required xcm barriers * format * remove redundant files * format * format * try fix ci * merge main * fix ci * Format * remove unused dependencies * format * format * format * Format Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: Xavier Lau <[email protected]> * Polish service (#38) * use full path * RuntimeApi Co-authored-by: Xavier Lau <[email protected]> * Enable `FrontierDb` subcommand (#37) * Refactor `new_partial` * Try fix compile * Update `new_partial` * Yeah, make compiler happy * Code clean * Something about command * Resolve conflict * Adapt for main style * Self review * Ready for review * Revert full-path in command mod * Code cleaning Co-authored-by: Xavier Lau <[email protected]> * Use zero existential deposit (#48) * Update ED * Update `candidacy_bond` * Add messages-substrate deps (#49) * add messages-substrate deps * fix ci * add messages-substrate deps * fix ci * update messages-substrate deps * update cargo.lock * Format Co-authored-by: Xavier Lau <[email protected]> * Process system and balances state (#39) * Process state part.1 * More detail * Take storages * Take KV * Merge balances * Extract balance lock * Format * Flatten account * Preprocess storage key * Fix properties * Add shell config * Modularize processor * Calculate total issuance * Recover nonce * Add darwinia's precompiles (#50) * Use `H160` as `AccountId` (#55) * Configure `H160` for runtime * Configure `H160` genesis Signed-off-by: Xavier Lau <[email protected]> * Docs * Improve code * Add missing features * Format and enable missing features for #50 * Format * Fix evm config * Revert the rename Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: bear <[email protected]> * Testnet preparation (#57) * More testing tokens * Update runtime version * Correct name * Adjust genesis accounts (#59) * Adjust genesis accounts * Docs * Typo * Adjust runtime and add pallets (#60) * Adjust runtime and add sudo * Adjust parameter types and add vesting * Fix compile * Add utility * Add collective, elections-phragmen, identity and treasury * Add preimage and scheduler * Add democracy and membership * Add multisig and proxy * License * License * Set balances's index to 5 * Code cleaning * Crab & Pangolin Runtime (#56) * Add assets component (#69) * Add asset pallet * Add asset precompile * Add precompile interface * Impl all asset precompile interfaces * Self review * Code clean * Add mock file * Fix test compile * Add test 1 * Add test 2 * Add test 3 * Add test 4 * Finish test * Add another type * Update asset origin * Fix CI * Move out from Others * Add asset to other runtimes * Bridge related pallets (#70) * Copy from Crab Parachain * Replace Crab Parachain > Darwinia * bridge pallets, many errors need to fix � Conflicts: � Cargo.lock � runtime/common/Cargo.toml � runtime/darwinia/src/pallets/mod.rs * Add fee_market � Conflicts: � runtime/common/Cargo.toml * Update deps * Update deps * Add bridge related pallets to darwinia * Add bridge related pallets to crab * format * Update deps * review * comment Co-authored-by: bear <[email protected]> * Fix #72 (#79) * Add `message-transact` back (#74) * Update chain id (#85) * Update parachain IDs (#89) * Change paraId 1000 > 2105 * Darwinia paraId 2046 * Correct block time (#93) * Add parachain staking (#68) * Avoid large enum variant (#98) * Avoid large enum variant * Fix tests Co-authored-by: bear <[email protected]> * Add account migration pallet (#86) * Init commit * Add todos * Add `ValidateUnsigned` * Add signature verify * Add event * Add comment * Update message hash * Add mock file * Compile mock * Add basic tests * Add more tests * Code clean * Clean toml * Format * Install it to the runtimes * Rename Co-authored-by: HackFisher <[email protected]> Co-authored-by: Xavier Lau <[email protected]> * Handle reference count (#102) * Handle reference count * Fix test * Housekeeping (#105) * Housekeeping * Format * Adjust path style (#99) * Bridge related pallets * fee market * format * evm * xcm * format * MaxMessagesToPruneAtOnce * move ByteArray * move AccountToAssetId * move UniqueSaturatedInto * Const * format * Add sudo key (#107) * Update XCM filter (#88) * Improve code (#111) * Update AssetId (#109) * Update asset id * Rename * Release collator staking restriction (#114) * Account migration (#108) * Add `staking` and `deposit` pre-compiles (#81) * Some optimization (#116) * Change sudo to Alith * Format * Doc * Security * Security * Opt * Grammar * Add staking & deposit to Crab & Pangolin (#112) * Some adjustment (#120) * Fast runtime * Valid genesis exposure * Assets genesis * Add `bridge_parachains` pallet (#122) * Update Grandpa Name * Add bridge parachain pallet * Correct bridge message verify * type HeadersToKeep * Fix CI * Fix CI * Account genesis (#123) * Handle EVM accounts and pruge locks Signed-off-by: Xavier Lau <[email protected]> * Refactor account genesis * Purge locks * Update scope * Update special accounts list Signed-off-by: Xavier Lau <[email protected]> * Vesting genesis (#127) * Handle EVM accounts and pruge locks Signed-off-by: Xavier Lau <[email protected]> * Refactor account genesis * Purge locks * Update scope * Update special accounts list * Vesting genesis * Improve state management Signed-off-by: Xavier Lau <[email protected]> * Merge balance after update decimal (#128) * Update order * Update README * Update reserve transfer filter (#130) * Frontier pallets storage process (#121) * Build test * Add licenses * Add ethereum schema process * Add evm state process * Self review * Delte useless file * Bump deps * Free license * Refactor * Correct prefixes Signed-off-by: Xavier Lau <[email protected]> Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: Xavier Lau <[email protected]> * Configure instant sealing for dev chains (#119) * Add start_dev_node * Add start_dev_node to command Fix compile * Don't check relay chain for dev node * Correct chain spec Identify * Add instant finalize * Clean * Add tip * Fix CI * opt * format * Revert "Fix CI" This reverts commit 63ae56a8a4ff329a708de8ae7287b3a2133fac19. * Format Signed-off-by: Xavier Lau <[email protected]> * Remove redundant clone Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: bear <[email protected]> Co-authored-by: fisher <[email protected]> Co-authored-by: Xavier Lau <[email protected]> * Optimize storage (#132) * Update bridge deps (#134) * Update bridge deps * Correct version of cfg-if for `twox-hash` * Fix account insert key (#139) * Fix account insert bug * Code clean * Delete empty line * Correct `RuntimeApi` & `RuntimeExecutor` (#141) * Convert the rest locations to H160 by hashing it (#138) * Convert the rest locations to H160 by hashing it * format * fix review * Process staking (#133) * Process staking * Correct type * Refactor * Introduce `Adjust` trait * Refactor * Format * Update links * Doc * Fix * Doc * Fix vesting processor (#144) * Fix vesting processor Signed-off-by: Xavier Lau <[email protected]> * Format Signed-off-by: Xavier Lau <[email protected]> * Update KTON owner (#145) * Add genesis (#148) * Add genesis * Fix compile * Clippy (#150) * Fix revert (#149) Co-authored-by: Xavier Lau <[email protected]> * Fix hash key (#152) * Process indices & more utility fns (#151) * More tools * Process indices * More error logs Signed-off-by: Xavier Lau <[email protected]> Signed-off-by: Xavier Lau <[email protected]> * Fix contract account `sufficients` (#146) * Update sufficient * Inc sufficient for contract account * Fix * Use new style * Fix type & code optimization (#154) * Fix type & code optimization * Use `u16` to bypass the polkadot-js/apps#8591 * Fix bonded prefix (#155) * Fix bonded prefix * Restore * Fix * Update type (#156) * Kton state migrate (#137) * Step 1 * Step 2 * Step 3 * Step 4 * Finish processor side * Add runtime side * Add metadata insert * Fix approvals inc * Fresh new details * Use Vec * Adapt new way * Code clean * Remove `sp-core` * Fix todo and review * Fix link and format * Cross compile support (#159) * Improve deposit (#160) * Improve deposit * Test more cases * Fix tests * Some fixes (#162) * Improve config for pallet_bridge_grandpa (#161) * Update max bridged authorities follow https://github.com/paritytech/parity-bridges-common/blob/c28b3ff66c29c6c9d9955583b50c2114de14e98c/primitives/chain-rococo/src/lib.rs#L45-L48 * Update max bridged header size to 65536 * Update weight info follow https://github.com/paritytech/parity-bridges-common/blob/c28b3ff66c29c6c9d9955583b50c2114de14e98c/bin/millau/runtime/src/lib.rs#L431 * Keep WeightInfo to () * Code Clean * Improve kton migration (#163) * Improve kton migration * Typo * Doc * Name * Fix * Fix * Use `DealWithFees` in `transaction_payment` (#164) * Add `claim_with_penalty` interface (#165) * Handle different account types (#168) * Handle different account types * Format * State process test (#153) * First commit * Add balance test * Try fix * test total_issuance * Test the kton part removed * Add evm related test * Assert evm account storages * Update evm storage tests * Add vesting info test * Add indices test * Add staking test * Add staking test 2 * Fix tests * Add deposit items test * Finish staking test * Add tests for assets * Test kton transfer to asset pallet * Test kton total issuance * Fix todo * Add parachain support * Remove ignored case * Add combine solo,para account tests * Code clean * Add filter * Refactor the test * Ignore two cases * Rwrite all tests * Update evm codes test * Code format * Fix indices tests * Remove debug line * Format * Format * Fix review Co-authored-by: Xavier Lau <[email protected]> * Happy new year (#170) * Happy new year * Fix * Process proxy and support generic runtime (#172) * Format * Process proxy and support generic runtime * Format * Format * Fixes * Adjust XCM trader (#143) * init LocalAssetTrader * LocalAssetTrader * Update trader for pangolin & crab * format * Update comments * Update logs * format * Format * Simplify code Co-authored-by: fisher <[email protected]> Co-authored-by: Xavier Lau <[email protected]> * Adjust common functions (#167) * WeightToFee * darwinia_deposit * Move darwinia_deposit to primitives * fix review * remove unused smallvec * Pangolin2 preparation (#174) * New data path * Simplify staking migration * Refactor * Build spec automatically * Download specs automatically * Use `take` * Remove unnecessary doc * Add darwinia dispatch precompile (#173) * Add darwinia dispatch * Fix test Co-authored-by: Xavier Lau <[email protected]> Co-authored-by: fisher <[email protected]> * Process sudo (#177) * Process sudo * Add testing key * Fixes (#179) * Fix * Bump to fix * Fix genesis * Fix build spec * Test env * Fund Alith (#182) * Fund Alith * Use local chain type * Optional download (#183) * Fix processor tests (#175) * Fix test * Fix test * Delete sudo and metadata * ECDSA authority (#184) * Add message gadget * Fix compile * Fix mock * Fix test * Add ecdsa-authority * License * Add `restake` and fix some bugs (#188) * Add `restake` and fix some bugs * More tests * More tests * Doc * Add restake interface (#189) * Add `Proxy` tests (#190) * Check key prefix * Add tests * Use `any` * Improve existing check (#191) * Improve existing check * Remove unused variable * Modify testnet time (#192) * Improve tips * Clippy * Set testnet time to 5 mins * `account-migration` runtime tests (#169) * Add validate unsigned test * Add validation tests * Account migrate test * Fix redundant encode * Kton asset * prepare accounts * Remove migration * Pass tests * kton tests * Add staking test * Fix test * Staking test * Finish pangolin tests * Add crab and darwinia tests * Revert changes Co-authored-by: Xavier Lau <[email protected]> * Human readable sign message (#195) * Human readable sign message * Update spec * Update proxy filter (#197) * Use features check action (#198) Signed-off-by: Xavier Lau <[email protected]> Signed-off-by: Xavier Lau <[email protected]> * Merge collator payout (#200) * Merge collator payout * Bump runtime version * Improve code * Doc * Refactor runtime tests (#204) * Test only code (#206) * Fix precompiles genesis (#207) * Tweak the genesis config * Add tests * Use check runtime action (#208) * Use check runtime action * Try * Try Signed-off-by: Xavier Lau <[email protected]> * Test all runtimes Signed-off-by: Xavier Lau <[email protected]> * Done * Remove compress step * Remove unused env var Signed-off-by: Xavier Lau <[email protected]> * To `polkadot-v0.9.33` and some other changes (#171) * Anchor polkadot-v0.9.33 * Companion for paritytech/cumulus#1685 * Companion for paritytech/cumulus#1585 * Companion for paritytech/cumulus#1745 * Companion for paritytech/cumulus#1759 * Companion for paritytech/cumulus#1782 * Companion for paritytech/cumulus#1793 * Companion for paritytech/cumulus#1808 * Temp use prepare branch of messages-substrate * Use darwinia fork frontier * Use correct moonbeam substrate commit * Correct bp-darwinia-core std * Use prepare moonbeam v0.9.33 * Update ethereum to 0.14.0 * Companion for paritytech/substrate#11649, paritytech/polkadot#5729 democracy * Companion for paritytech/substrate#11649, paritytech/polkadot#5729 scheduler * Companion for paritytech/substrate#11649, paritytech/polkadot#5729 preimage * Companion for paritytech/substrate#12109 * Type create origin * Format * Fix type CreateOrigin * Format * Companion for polkadot-evm/frontier#935 * Fix compile * Fix service * Format * `Frontier` upgrade (#196) * Delete BaseFee * Fix todo * Update prepare branch * Fix mock * Add pallet-evm-precompile-dispatch/std * Format * Format * Correct version after merge * Fix review * Fix review * Fix CI test * Fix compile after merge Co-authored-by: bear <[email protected]> * pallet-identity state process (#124) * Add types folder * Read storage out * Decimal update * Add remove subsOf and superOf * Remove useless file * Add README * Process in runtime side * Format * Add SUDO back * Fix doc link * Identity migrate * Fix runtime * Add tests * Add tests * Code clean * Remove sp-runtime * Code format * Delete useless reserve * Reset the judgements * Self review * Fix * Add identities runtime tests * Fix tests * Just format * Tiny updates * Update doc Co-authored-by: Xavier Lau <[email protected]> * Keep identity judgments (#210) * Keep identity judgments * Doc * Bump toolchain to `nightly-2022-11-15` (#212) * Add metadata for front end (#219) * Burn parachain backing RING (#218) * Fix state judgement (#222) * Fix judgement * Use adjust() * Format * Readable address (#224) * Add missing field (#226) * Fix `try-runtime` (#223) * Try fix * Try fix * Adjust toml file * Fix compile * Foramat * Adjust session consumer part.1 (#229) * Clean unused deps (#228) * Clean unused deps * Update messages-substrate deps * Try fix CI * Adapt PolkadotJS (#231) * Release Pangolin2 (#225) * Reorder * Adjust genesis * Typo * State types check (#230) * Check * Use type * Update processor files * Find others * Format * Default pangolin * Fix review * Account migration signer tool (#235) * Doc * Bump version for devnet * Account migration signer tool * Doc * Update docs (#237) Co-authored-by: Xavier Lau <[email protected]> * Fix call indexes (#238) * Fix signer cli (#239) * Improve testing (#241) * Improve testing * Fix formula * Opt * State processor CI * Unset * Try Signed-off-by: Xavier Lau <[email protected]> * Opt * Opt * Try Signed-off-by: Xavier Lau <[email protected]> * Opt * Opt * Final test * Fix * Bump * Fix * Fix --------- Signed-off-by: Xavier Lau <[email protected]> * Rebuild accounts' reservation (#242) * Set reservation to zero * Configure genesis collator * Rebuild accounts' reservation and update tests * Update tests * Add EVM tests (#234) * Support Ethereum for dev node * Add first test * Add rpc constants test * Add balance test * Add contract test * Finish balance and contract basic tests * Add bloom filter test * Test `eth_getCode` * Test nonce update * Test opcodes * Add event test * Finally, basic tests are covered. * Use `impl_self_contained_call` (#250) * Rebuild account reference counters (#249) * Rebuild account reference counters part.1 * part.2 * part.3 * TODO * Fix * Fixes Signed-off-by: Xavier Lau <[email protected]> * Doc --------- Signed-off-by: Xavier Lau <[email protected]> * Add evm checks (#252) * Add evm checks Signed-off-by: Xavier Lau <[email protected]> * Fix --------- Signed-off-by: Xavier Lau <[email protected]> * Clean empty ledger (#253) Signed-off-by: Xavier Lau <[email protected]> * Add bridge extension validation (#251) * Add bridger extension validatioin * Update comments * Revert changes * Fix review * Add `reserve` and `references count` tests (#259) * Fix TODO * Add reserve test * Add another case * Add more samples * Code clean * Fix local test error * Handle special accounts (#265) * Handle special accounts * Refactor * More readable * Doc * Add staging workflow (#258) * Add staging workflow * Test CI * CI * Add deps * CI * CI * CI * Updte trigger --------- Co-authored-by: Xavier Lau <[email protected]> * To `polkadot-v0.9.36` (#213) * Anchor polkadot-v0.9.36 * Companion for paritytech/cumulus#1860 * Companion for paritytech/cumulus#1876 * Companion for paritytech/cumulus#1904 * Companion for paritytech/substrate#12310 * Companion for paritytech/substrate#12740 * Bump array-bytes to 6.0.0 * Companion for paritytech/substrate#12868 * Companion for paritytech/cumulus#1930 * Companion for paritytech/cumulus#1905 * Companion for paritytech/cumulus#1880 * Companion for paritytech/cumulus#1997 * Companion for paritytech/cumulus#1559 * Prepare messages-substrate * Companion for paritytech/substrate#12684 * Companion for paritytech/substrate#12740 * Fix compile paritytech/substrate#12740 * Compile done * Format * Add call index * Compile done * Fix CI * Bump moonbeam * Fix CI * Try fix tests * Use into instead of `Compact` * Patch substrate & Fix compile * Fix try-runtime * Remove parity-util-mem * Format * Format * Opt * Format * Use `codec::Compact<AssetId>` * Format --------- Co-authored-by: Xavier Lau <[email protected]> * Migrate `pallet-assets` (#260) * Anchor polkadot-v0.9.36 * Companion for paritytech/cumulus#1860 * Companion for paritytech/cumulus#1876 * Companion for paritytech/cumulus#1904 * Companion for paritytech/substrate#12310 * Companion for paritytech/substrate#12740 * Bump array-bytes to 6.0.0 * Companion for paritytech/substrate#12868 * Companion for paritytech/cumulus#1930 * Companion for paritytech/cumulus#1905 * Companion for paritytech/cumulus#1880 * Companion for paritytech/cumulus#1997 * Companion for paritytech/cumulus#1559 * Prepare messages-substrate * Companion for paritytech/substrate#12684 * Companion for paritytech/substrate#12740 * Fix compile paritytech/substrate#12740 * Compile done * Format * Add call index * Compile done * Fix CI * Bump moonbeam * Fix CI * Try fix tests * Use into instead of `Compact` * Patch substrate & Fix compile * Fix try-runtime * Remove parity-util-mem * Companion for paritytech/substrate#12310 * Update state processor * Add type link * Fix review issues * Format --------- Co-authored-by: Guantong <[email protected]> * Clean imports (#271) * Clean imports * Fix tests * Migrate multisig (#272) * Migrate multisig * Unit tests * Doc * Fix * More checks * Doc * Reject duplicative submission * Add special accounts migration test (#268) * Part 1 * Part 2 * Rename * Better function names * Update state storage filter (#273) * Let ethereum go * Update pallet name * Fix --------- Co-authored-by: Xavier Lau <[email protected]> * Manage runtime through features (#274) * Format * Manage runtime through features * Total issuance assertions (#276) * Process parachain system (#278) * Try workspace's new feature (#277) * Update crate info * Update deps 1 * Update deps 2 * Update deps 3 * Update deps 4 * Format * Fix review * Rename `Staking` to `DarwiniaStaking` (#279) * Rename to `DarwiniaStaking` * Rename * Format (#280) * Add Pangoro2 (#281) * Format * Deduplicate * Add Pangoro2 * Rename * Fix * Fix * Rename * Doc * Set SS58 in runtime and remove from chain spec * To `polkadot-v0.9.37` (#266) * Anchor polkadot-v0.9.37 * Companion for paritytech/substrate#12307 * Companion for paritytech/cumulus#2057 * Use prepare branch for test * Companion for polkadot-evm/frontier#981 * Remove collator selection in bench * Fix BenchmarkHelper * Fix compile * Format * Fix compile * Fix compile feature benchmark * Fix test * Format toml * Format * Pangoro2 0.9.37 * Fix try-runtime * Fix try-runtime cmd * Format * Fix review * Use `Vec` * Typo --------- Co-authored-by: Xavier Lau <[email protected]> * Pangolin2 `6005` runtime upgrade (#283) * Update Pangolin CI * Bump runtime version * Set payout fraction to 40% (#284) * Set payout fraction to 40% * Format Signed-off-by: Xavier Lau <[email protected]> --------- Signed-off-by: Xavier Lau <[email protected]> * Add evm estimate gas tests (#282) * Add estimate gas tests * Fix CI * Fix ethereum block author (#286) * Fix ethereum block author * Move some structs to the common folder * Fix CI test * Clean * Pangolin2 <> Pangoro2 bridge (#285) * Copy darwinia bm => pangoro bm Copy crab bm => pangolin bm * Add pangolin&pangoro bridge-messages * Add bridge related pallets for pangolin&pangoro * Add bridge palles to runtime for pangolin & pangoro * Fix compile * Missing changes * Correct bridge-dispatch * Format * Update genesis * Update nonce test (#288) * Remove assertions in HRMP&DMP (#290) * Patch cumulus * Bump darwinia/cumulus * Preparation of Pangoro2 (#291) * Correct command * Some fixes * Update evm module runtime name (#293) * Fix evm runtime name * Format toml * Add migration * Fix state processor * Use latest polkadot-v0.9.37 commit * Fix tests * Bench upstream pallets (#292) * Fix balances benchmark * Add bridge related bench * Benchmark with steps 50 repeat 20 * Update weights for bridge pallets * Pangolin bench pallets * Bench s2 r1 for all runtimes * Update weights for all runtime * Add benchmarking items and bench darwinia-deposit (#294) * Add benchmarking items and bench darwinia-deposit * Format * Doc * Fix and update CI * Re-cache * Opt * Opt * Correct URI --------- Signed-off-by: Xavier Lau <[email protected]> * Auto load large genesis (#295) * Auto load large genesis * Remove unused feature * Format * Opt * Fix broken CI (#296) * Try fix * Fix it! * Remove multisig (#299) * Update Pangoro2 parachain id (#304) * Update cross compile docker image (#303) * Update cross compile docker image * Fix compile * Easy make (#305) * Easy make * Format * Update EthBlockGasLimit (#306) * Update pangolin's max gas limit * Update other runtimes * Move evm tests * Self review * Anchor v0.9.38 * Companion for paritytech/cumulus#2067 * Companion for paritytech/cumulus#697 XCM v3 * Companion for paritytech/cumulus#2096 * Companion for paritytech/cumulus#1863 * Companion for paritytech/cumulus#2073 * Companion for paritytech/cumulus#2126 * Use prepare branch * Companion for paritytech/substrate#13216 * Companion for darwinia-messages-substrate#254 * Companion for paritytech/polkadot#4097 * Part companion for paritytech/cumulus#2067 * Correct companion for cumulus#2073 * Fix xcm compilation * Fix compilation done * Fix compilation with benchmark * Replace prepare branch * Format * Fix compile * Format * Fix CI check features * Format * Patch cumulus assertion branch v0.9.38 * Companion for paritytech/cumulus#2287 * Remove unused polkadot-service * Revert changes * Format --------- Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: Xavier Lau <[email protected]> Co-authored-by: bear <[email protected]> Co-authored-by: HackFisher <[email protected]> Co-authored-by: fewensa <[email protected]> Co-authored-by: Guantong <[email protected]>
* Darwinia 2.0 * Darwinia shell chain (#27) * Skeleton * XCM configs * Bump toolchain * Code cleaning part.1 * Code cleaning part.2 * Update SS58 * Rename * Update token decimals * Format * Extract darwinia core primitives * License * Benchmarks * Extract constants * Docs * CI part.1 * Adjust the runtime pallets structure (#29) * frame-system * pallet-timestamp * pallet-authorship * pallet-balances * pallet-transaction-payment * pallet-parachain-system * pallet-parachain-info * pallet-aura-ext * pallet-xcmp-queue * pallet-dmp-queue * pallet-session * pallet-aura * pallet-collator-selection * format * deal ambiguous name * fix compile * clear imports * update visibility for pallets * add license for pallets * update darwinia comments * CI part.2 Signed-off-by: Xavier Lau <[email protected]> * CI part.3 * CI part.4 * Add missing features * Case * Setup build environment * CI part.5 * Enable `kusama-native`, `rococo-native` Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: Guantong <[email protected]> * Docs & formatting (#33) * Add EVM stuff (#30) * Skeleton * XCM configs * Bump toolchain * Code cleaning part.1 * Code cleaning part.2 * Update SS58 * Rename * Update token decimals * Format * Extract darwinia core primitives * Add frontier deps without fork! * License * Add pallets to runtime * Benchmarks * Append command part * Extract constants * Docs * CI part.1 * Adjust the runtime pallets structure (#29) * frame-system * pallet-timestamp * pallet-authorship * pallet-balances * pallet-transaction-payment * pallet-parachain-system * pallet-parachain-info * pallet-aura-ext * pallet-xcmp-queue * pallet-dmp-queue * pallet-session * pallet-aura * pallet-collator-selection * format * deal ambiguous name * fix compile * clear imports * update visibility for pallets * add license for pallets * update darwinia comments * Adapt main * Delete duplicated consts * Hack rpc * Client compile fix * Fix client * Move to ethereum mod * Add more precompile * Fix some issue * Solve conflict * Merge issues * Format * Add basic code for precompiles * Update EthRpcConfig * Use Hashing type * Foramt issue * Adjust service config * Add evm, ethereum feature * Add missing features * Move const * Doc * Format * Format * Format * Format * Format * Safer truncated * Clean importing * Suppress warnings * Remove empty line * Clean importing * Clean importing * Format * Clean importing * Restructure Co-authored-by: Xavier Lau <[email protected]> Co-authored-by: Guantong <[email protected]> * Polish RPC & service (#36) * Use full path * Abstract APIs & types * Format * Extract darwinia-runtime (#32) * Skeleton * XCM configs * Bump toolchain * Code cleaning part.1 * Code cleaning part.2 * Update SS58 * Rename * Update token decimals * Format * Extract darwinia core primitives * License * Benchmarks * Extract constants * Docs * CI part.1 * Adjust the runtime pallets structure (#29) * frame-system * pallet-timestamp * pallet-authorship * pallet-balances * pallet-transaction-payment * pallet-parachain-system * pallet-parachain-info * pallet-aura-ext * pallet-xcmp-queue * pallet-dmp-queue * pallet-session * pallet-aura * pallet-collator-selection * format * deal ambiguous name * fix compile * clear imports * update visibility for pallets * add license for pallets * update darwinia comments * CI part.2 Signed-off-by: Xavier Lau <[email protected]> * CI part.3 * CI part.4 * Add missing features * Case * Setup build environment * CI part.5 * init * adjust structure & fix compile * Move`type Barrier` out of `common` because of different runtimes may require different barriers * Add required xcm barriers * format * remove redundant files * format * format * try fix ci * merge main * fix ci * Format * remove unused dependencies * format * format * format * Format Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: Xavier Lau <[email protected]> * Polish service (#38) * use full path * RuntimeApi Co-authored-by: Xavier Lau <[email protected]> * Enable `FrontierDb` subcommand (#37) * Refactor `new_partial` * Try fix compile * Update `new_partial` * Yeah, make compiler happy * Code clean * Something about command * Resolve conflict * Adapt for main style * Self review * Ready for review * Revert full-path in command mod * Code cleaning Co-authored-by: Xavier Lau <[email protected]> * Use zero existential deposit (#48) * Update ED * Update `candidacy_bond` * Add messages-substrate deps (#49) * add messages-substrate deps * fix ci * add messages-substrate deps * fix ci * update messages-substrate deps * update cargo.lock * Format Co-authored-by: Xavier Lau <[email protected]> * Process system and balances state (#39) * Process state part.1 * More detail * Take storages * Take KV * Merge balances * Extract balance lock * Format * Flatten account * Preprocess storage key * Fix properties * Add shell config * Modularize processor * Calculate total issuance * Recover nonce * Add darwinia's precompiles (#50) * Use `H160` as `AccountId` (#55) * Configure `H160` for runtime * Configure `H160` genesis Signed-off-by: Xavier Lau <[email protected]> * Docs * Improve code * Add missing features * Format and enable missing features for #50 * Format * Fix evm config * Revert the rename Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: bear <[email protected]> * Testnet preparation (#57) * More testing tokens * Update runtime version * Correct name * Adjust genesis accounts (#59) * Adjust genesis accounts * Docs * Typo * Adjust runtime and add pallets (#60) * Adjust runtime and add sudo * Adjust parameter types and add vesting * Fix compile * Add utility * Add collective, elections-phragmen, identity and treasury * Add preimage and scheduler * Add democracy and membership * Add multisig and proxy * License * License * Set balances's index to 5 * Code cleaning * Crab & Pangolin Runtime (#56) * Add assets component (#69) * Add asset pallet * Add asset precompile * Add precompile interface * Impl all asset precompile interfaces * Self review * Code clean * Add mock file * Fix test compile * Add test 1 * Add test 2 * Add test 3 * Add test 4 * Finish test * Add another type * Update asset origin * Fix CI * Move out from Others * Add asset to other runtimes * Bridge related pallets (#70) * Copy from Crab Parachain * Replace Crab Parachain > Darwinia * bridge pallets, many errors need to fix � Conflicts: � Cargo.lock � runtime/common/Cargo.toml � runtime/darwinia/src/pallets/mod.rs * Add fee_market � Conflicts: � runtime/common/Cargo.toml * Update deps * Update deps * Add bridge related pallets to darwinia * Add bridge related pallets to crab * format * Update deps * review * comment Co-authored-by: bear <[email protected]> * Fix #72 (#79) * Add `message-transact` back (#74) * Update chain id (#85) * Update parachain IDs (#89) * Change paraId 1000 > 2105 * Darwinia paraId 2046 * Correct block time (#93) * Add parachain staking (#68) * Avoid large enum variant (#98) * Avoid large enum variant * Fix tests Co-authored-by: bear <[email protected]> * Add account migration pallet (#86) * Init commit * Add todos * Add `ValidateUnsigned` * Add signature verify * Add event * Add comment * Update message hash * Add mock file * Compile mock * Add basic tests * Add more tests * Code clean * Clean toml * Format * Install it to the runtimes * Rename Co-authored-by: HackFisher <[email protected]> Co-authored-by: Xavier Lau <[email protected]> * Handle reference count (#102) * Handle reference count * Fix test * Housekeeping (#105) * Housekeeping * Format * Adjust path style (#99) * Bridge related pallets * fee market * format * evm * xcm * format * MaxMessagesToPruneAtOnce * move ByteArray * move AccountToAssetId * move UniqueSaturatedInto * Const * format * Add sudo key (#107) * Update XCM filter (#88) * Improve code (#111) * Update AssetId (#109) * Update asset id * Rename * Release collator staking restriction (#114) * Account migration (#108) * Add `staking` and `deposit` pre-compiles (#81) * Some optimization (#116) * Change sudo to Alith * Format * Doc * Security * Security * Opt * Grammar * Add staking & deposit to Crab & Pangolin (#112) * Some adjustment (#120) * Fast runtime * Valid genesis exposure * Assets genesis * Add `bridge_parachains` pallet (#122) * Update Grandpa Name * Add bridge parachain pallet * Correct bridge message verify * type HeadersToKeep * Fix CI * Fix CI * Account genesis (#123) * Handle EVM accounts and pruge locks Signed-off-by: Xavier Lau <[email protected]> * Refactor account genesis * Purge locks * Update scope * Update special accounts list Signed-off-by: Xavier Lau <[email protected]> * Vesting genesis (#127) * Handle EVM accounts and pruge locks Signed-off-by: Xavier Lau <[email protected]> * Refactor account genesis * Purge locks * Update scope * Update special accounts list * Vesting genesis * Improve state management Signed-off-by: Xavier Lau <[email protected]> * Merge balance after update decimal (#128) * Update order * Update README * Update reserve transfer filter (#130) * Frontier pallets storage process (#121) * Build test * Add licenses * Add ethereum schema process * Add evm state process * Self review * Delte useless file * Bump deps * Free license * Refactor * Correct prefixes Signed-off-by: Xavier Lau <[email protected]> Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: Xavier Lau <[email protected]> * Configure instant sealing for dev chains (#119) * Add start_dev_node * Add start_dev_node to command Fix compile * Don't check relay chain for dev node * Correct chain spec Identify * Add instant finalize * Clean * Add tip * Fix CI * opt * format * Revert "Fix CI" This reverts commit 63ae56a8a4ff329a708de8ae7287b3a2133fac19. * Format Signed-off-by: Xavier Lau <[email protected]> * Remove redundant clone Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: bear <[email protected]> Co-authored-by: fisher <[email protected]> Co-authored-by: Xavier Lau <[email protected]> * Optimize storage (#132) * Update bridge deps (#134) * Update bridge deps * Correct version of cfg-if for `twox-hash` * Fix account insert key (#139) * Fix account insert bug * Code clean * Delete empty line * Correct `RuntimeApi` & `RuntimeExecutor` (#141) * Convert the rest locations to H160 by hashing it (#138) * Convert the rest locations to H160 by hashing it * format * fix review * Process staking (#133) * Process staking * Correct type * Refactor * Introduce `Adjust` trait * Refactor * Format * Update links * Doc * Fix * Doc * Fix vesting processor (#144) * Fix vesting processor Signed-off-by: Xavier Lau <[email protected]> * Format Signed-off-by: Xavier Lau <[email protected]> * Update KTON owner (#145) * Add genesis (#148) * Add genesis * Fix compile * Clippy (#150) * Fix revert (#149) Co-authored-by: Xavier Lau <[email protected]> * Fix hash key (#152) * Process indices & more utility fns (#151) * More tools * Process indices * More error logs Signed-off-by: Xavier Lau <[email protected]> Signed-off-by: Xavier Lau <[email protected]> * Fix contract account `sufficients` (#146) * Update sufficient * Inc sufficient for contract account * Fix * Use new style * Fix type & code optimization (#154) * Fix type & code optimization * Use `u16` to bypass the polkadot-js/apps#8591 * Fix bonded prefix (#155) * Fix bonded prefix * Restore * Fix * Update type (#156) * Kton state migrate (#137) * Step 1 * Step 2 * Step 3 * Step 4 * Finish processor side * Add runtime side * Add metadata insert * Fix approvals inc * Fresh new details * Use Vec * Adapt new way * Code clean * Remove `sp-core` * Fix todo and review * Fix link and format * Cross compile support (#159) * Improve deposit (#160) * Improve deposit * Test more cases * Fix tests * Some fixes (#162) * Improve config for pallet_bridge_grandpa (#161) * Update max bridged authorities follow https://github.com/paritytech/parity-bridges-common/blob/c28b3ff66c29c6c9d9955583b50c2114de14e98c/primitives/chain-rococo/src/lib.rs#L45-L48 * Update max bridged header size to 65536 * Update weight info follow https://github.com/paritytech/parity-bridges-common/blob/c28b3ff66c29c6c9d9955583b50c2114de14e98c/bin/millau/runtime/src/lib.rs#L431 * Keep WeightInfo to () * Code Clean * Improve kton migration (#163) * Improve kton migration * Typo * Doc * Name * Fix * Fix * Use `DealWithFees` in `transaction_payment` (#164) * Add `claim_with_penalty` interface (#165) * Handle different account types (#168) * Handle different account types * Format * State process test (#153) * First commit * Add balance test * Try fix * test total_issuance * Test the kton part removed * Add evm related test * Assert evm account storages * Update evm storage tests * Add vesting info test * Add indices test * Add staking test * Add staking test 2 * Fix tests * Add deposit items test * Finish staking test * Add tests for assets * Test kton transfer to asset pallet * Test kton total issuance * Fix todo * Add parachain support * Remove ignored case * Add combine solo,para account tests * Code clean * Add filter * Refactor the test * Ignore two cases * Rwrite all tests * Update evm codes test * Code format * Fix indices tests * Remove debug line * Format * Format * Fix review Co-authored-by: Xavier Lau <[email protected]> * Happy new year (#170) * Happy new year * Fix * Process proxy and support generic runtime (#172) * Format * Process proxy and support generic runtime * Format * Format * Fixes * Adjust XCM trader (#143) * init LocalAssetTrader * LocalAssetTrader * Update trader for pangolin & crab * format * Update comments * Update logs * format * Format * Simplify code Co-authored-by: fisher <[email protected]> Co-authored-by: Xavier Lau <[email protected]> * Adjust common functions (#167) * WeightToFee * darwinia_deposit * Move darwinia_deposit to primitives * fix review * remove unused smallvec * Pangolin2 preparation (#174) * New data path * Simplify staking migration * Refactor * Build spec automatically * Download specs automatically * Use `take` * Remove unnecessary doc * Add darwinia dispatch precompile (#173) * Add darwinia dispatch * Fix test Co-authored-by: Xavier Lau <[email protected]> Co-authored-by: fisher <[email protected]> * Process sudo (#177) * Process sudo * Add testing key * Fixes (#179) * Fix * Bump to fix * Fix genesis * Fix build spec * Test env * Fund Alith (#182) * Fund Alith * Use local chain type * Optional download (#183) * Fix processor tests (#175) * Fix test * Fix test * Delete sudo and metadata * ECDSA authority (#184) * Add message gadget * Fix compile * Fix mock * Fix test * Add ecdsa-authority * License * Add `restake` and fix some bugs (#188) * Add `restake` and fix some bugs * More tests * More tests * Doc * Add restake interface (#189) * Add `Proxy` tests (#190) * Check key prefix * Add tests * Use `any` * Improve existing check (#191) * Improve existing check * Remove unused variable * Modify testnet time (#192) * Improve tips * Clippy * Set testnet time to 5 mins * `account-migration` runtime tests (#169) * Add validate unsigned test * Add validation tests * Account migrate test * Fix redundant encode * Kton asset * prepare accounts * Remove migration * Pass tests * kton tests * Add staking test * Fix test * Staking test * Finish pangolin tests * Add crab and darwinia tests * Revert changes Co-authored-by: Xavier Lau <[email protected]> * Human readable sign message (#195) * Human readable sign message * Update spec * Update proxy filter (#197) * Use features check action (#198) Signed-off-by: Xavier Lau <[email protected]> Signed-off-by: Xavier Lau <[email protected]> * Merge collator payout (#200) * Merge collator payout * Bump runtime version * Improve code * Doc * Refactor runtime tests (#204) * Test only code (#206) * Fix precompiles genesis (#207) * Tweak the genesis config * Add tests * Use check runtime action (#208) * Use check runtime action * Try * Try Signed-off-by: Xavier Lau <[email protected]> * Test all runtimes Signed-off-by: Xavier Lau <[email protected]> * Done * Remove compress step * Remove unused env var Signed-off-by: Xavier Lau <[email protected]> * To `polkadot-v0.9.33` and some other changes (#171) * Anchor polkadot-v0.9.33 * Companion for paritytech/cumulus#1685 * Companion for paritytech/cumulus#1585 * Companion for paritytech/cumulus#1745 * Companion for paritytech/cumulus#1759 * Companion for paritytech/cumulus#1782 * Companion for paritytech/cumulus#1793 * Companion for paritytech/cumulus#1808 * Temp use prepare branch of messages-substrate * Use darwinia fork frontier * Use correct moonbeam substrate commit * Correct bp-darwinia-core std * Use prepare moonbeam v0.9.33 * Update ethereum to 0.14.0 * Companion for paritytech/substrate#11649, paritytech/polkadot#5729 democracy * Companion for paritytech/substrate#11649, paritytech/polkadot#5729 scheduler * Companion for paritytech/substrate#11649, paritytech/polkadot#5729 preimage * Companion for paritytech/substrate#12109 * Type create origin * Format * Fix type CreateOrigin * Format * Companion for polkadot-evm/frontier#935 * Fix compile * Fix service * Format * `Frontier` upgrade (#196) * Delete BaseFee * Fix todo * Update prepare branch * Fix mock * Add pallet-evm-precompile-dispatch/std * Format * Format * Correct version after merge * Fix review * Fix review * Fix CI test * Fix compile after merge Co-authored-by: bear <[email protected]> * pallet-identity state process (#124) * Add types folder * Read storage out * Decimal update * Add remove subsOf and superOf * Remove useless file * Add README * Process in runtime side * Format * Add SUDO back * Fix doc link * Identity migrate * Fix runtime * Add tests * Add tests * Code clean * Remove sp-runtime * Code format * Delete useless reserve * Reset the judgements * Self review * Fix * Add identities runtime tests * Fix tests * Just format * Tiny updates * Update doc Co-authored-by: Xavier Lau <[email protected]> * Keep identity judgments (#210) * Keep identity judgments * Doc * Bump toolchain to `nightly-2022-11-15` (#212) * Add metadata for front end (#219) * Burn parachain backing RING (#218) * Fix state judgement (#222) * Fix judgement * Use adjust() * Format * Readable address (#224) * Add missing field (#226) * Fix `try-runtime` (#223) * Try fix * Try fix * Adjust toml file * Fix compile * Foramat * Adjust session consumer part.1 (#229) * Clean unused deps (#228) * Clean unused deps * Update messages-substrate deps * Try fix CI * Adapt PolkadotJS (#231) * Release Pangolin2 (#225) * Reorder * Adjust genesis * Typo * State types check (#230) * Check * Use type * Update processor files * Find others * Format * Default pangolin * Fix review * Account migration signer tool (#235) * Doc * Bump version for devnet * Account migration signer tool * Doc * Update docs (#237) Co-authored-by: Xavier Lau <[email protected]> * Fix call indexes (#238) * Fix signer cli (#239) * Improve testing (#241) * Improve testing * Fix formula * Opt * State processor CI * Unset * Try Signed-off-by: Xavier Lau <[email protected]> * Opt * Opt * Try Signed-off-by: Xavier Lau <[email protected]> * Opt * Opt * Final test * Fix * Bump * Fix * Fix --------- Signed-off-by: Xavier Lau <[email protected]> * Rebuild accounts' reservation (#242) * Set reservation to zero * Configure genesis collator * Rebuild accounts' reservation and update tests * Update tests * Add EVM tests (#234) * Support Ethereum for dev node * Add first test * Add rpc constants test * Add balance test * Add contract test * Finish balance and contract basic tests * Add bloom filter test * Test `eth_getCode` * Test nonce update * Test opcodes * Add event test * Finally, basic tests are covered. * Use `impl_self_contained_call` (#250) * Rebuild account reference counters (#249) * Rebuild account reference counters part.1 * part.2 * part.3 * TODO * Fix * Fixes Signed-off-by: Xavier Lau <[email protected]> * Doc --------- Signed-off-by: Xavier Lau <[email protected]> * Add evm checks (#252) * Add evm checks Signed-off-by: Xavier Lau <[email protected]> * Fix --------- Signed-off-by: Xavier Lau <[email protected]> * Clean empty ledger (#253) Signed-off-by: Xavier Lau <[email protected]> * Add bridge extension validation (#251) * Add bridger extension validatioin * Update comments * Revert changes * Fix review * Add `reserve` and `references count` tests (#259) * Fix TODO * Add reserve test * Add another case * Add more samples * Code clean * Fix local test error * Handle special accounts (#265) * Handle special accounts * Refactor * More readable * Doc * Add staging workflow (#258) * Add staging workflow * Test CI * CI * Add deps * CI * CI * CI * Updte trigger --------- Co-authored-by: Xavier Lau <[email protected]> * To `polkadot-v0.9.36` (#213) * Anchor polkadot-v0.9.36 * Companion for paritytech/cumulus#1860 * Companion for paritytech/cumulus#1876 * Companion for paritytech/cumulus#1904 * Companion for paritytech/substrate#12310 * Companion for paritytech/substrate#12740 * Bump array-bytes to 6.0.0 * Companion for paritytech/substrate#12868 * Companion for paritytech/cumulus#1930 * Companion for paritytech/cumulus#1905 * Companion for paritytech/cumulus#1880 * Companion for paritytech/cumulus#1997 * Companion for paritytech/cumulus#1559 * Prepare messages-substrate * Companion for paritytech/substrate#12684 * Companion for paritytech/substrate#12740 * Fix compile paritytech/substrate#12740 * Compile done * Format * Add call index * Compile done * Fix CI * Bump moonbeam * Fix CI * Try fix tests * Use into instead of `Compact` * Patch substrate & Fix compile * Fix try-runtime * Remove parity-util-mem * Format * Format * Opt * Format * Use `codec::Compact<AssetId>` * Format --------- Co-authored-by: Xavier Lau <[email protected]> * Migrate `pallet-assets` (#260) * Anchor polkadot-v0.9.36 * Companion for paritytech/cumulus#1860 * Companion for paritytech/cumulus#1876 * Companion for paritytech/cumulus#1904 * Companion for paritytech/substrate#12310 * Companion for paritytech/substrate#12740 * Bump array-bytes to 6.0.0 * Companion for paritytech/substrate#12868 * Companion for paritytech/cumulus#1930 * Companion for paritytech/cumulus#1905 * Companion for paritytech/cumulus#1880 * Companion for paritytech/cumulus#1997 * Companion for paritytech/cumulus#1559 * Prepare messages-substrate * Companion for paritytech/substrate#12684 * Companion for paritytech/substrate#12740 * Fix compile paritytech/substrate#12740 * Compile done * Format * Add call index * Compile done * Fix CI * Bump moonbeam * Fix CI * Try fix tests * Use into instead of `Compact` * Patch substrate & Fix compile * Fix try-runtime * Remove parity-util-mem * Companion for paritytech/substrate#12310 * Update state processor * Add type link * Fix review issues * Format --------- Co-authored-by: Guantong <[email protected]> * Clean imports (#271) * Clean imports * Fix tests * Migrate multisig (#272) * Migrate multisig * Unit tests * Doc * Fix * More checks * Doc * Reject duplicative submission * Add special accounts migration test (#268) * Part 1 * Part 2 * Rename * Better function names * Update state storage filter (#273) * Let ethereum go * Update pallet name * Fix --------- Co-authored-by: Xavier Lau <[email protected]> * Manage runtime through features (#274) * Format * Manage runtime through features * Total issuance assertions (#276) * Process parachain system (#278) * Try workspace's new feature (#277) * Update crate info * Update deps 1 * Update deps 2 * Update deps 3 * Update deps 4 * Format * Fix review * Rename `Staking` to `DarwiniaStaking` (#279) * Rename to `DarwiniaStaking` * Rename * Format (#280) * Add Pangoro2 (#281) * Format * Deduplicate * Add Pangoro2 * Rename * Fix * Fix * Rename * Doc * Set SS58 in runtime and remove from chain spec * To `polkadot-v0.9.37` (#266) * Anchor polkadot-v0.9.37 * Companion for paritytech/substrate#12307 * Companion for paritytech/cumulus#2057 * Use prepare branch for test * Companion for polkadot-evm/frontier#981 * Remove collator selection in bench * Fix BenchmarkHelper * Fix compile * Format * Fix compile * Fix compile feature benchmark * Fix test * Format toml * Format * Pangoro2 0.9.37 * Fix try-runtime * Fix try-runtime cmd * Format * Fix review * Use `Vec` * Typo --------- Co-authored-by: Xavier Lau <[email protected]> * Pangolin2 `6005` runtime upgrade (#283) * Update Pangolin CI * Bump runtime version * Set payout fraction to 40% (#284) * Set payout fraction to 40% * Format Signed-off-by: Xavier Lau <[email protected]> --------- Signed-off-by: Xavier Lau <[email protected]> * Add evm estimate gas tests (#282) * Add estimate gas tests * Fix CI * Fix ethereum block author (#286) * Fix ethereum block author * Move some structs to the common folder * Fix CI test * Clean * Pangolin2 <> Pangoro2 bridge (#285) * Copy darwinia bm => pangoro bm Copy crab bm => pangolin bm * Add pangolin&pangoro bridge-messages * Add bridge related pallets for pangolin&pangoro * Add bridge palles to runtime for pangolin & pangoro * Fix compile * Missing changes * Correct bridge-dispatch * Format * Update genesis * Update nonce test (#288) * Remove assertions in HRMP&DMP (#290) * Patch cumulus * Bump darwinia/cumulus * Preparation of Pangoro2 (#291) * Correct command * Some fixes * Update evm module runtime name (#293) * Fix evm runtime name * Format toml * Add migration * Fix state processor * Use latest polkadot-v0.9.37 commit * Fix tests * Bench upstream pallets (#292) * Fix balances benchmark * Add bridge related bench * Benchmark with steps 50 repeat 20 * Update weights for bridge pallets * Pangolin bench pallets * Bench s2 r1 for all runtimes * Update weights for all runtime * Add benchmarking items and bench darwinia-deposit (#294) * Add benchmarking items and bench darwinia-deposit * Format * Doc * Fix and update CI * Re-cache * Opt * Opt * Correct URI --------- Signed-off-by: Xavier Lau <[email protected]> * Auto load large genesis (#295) * Auto load large genesis * Remove unused feature * Format * Opt * Fix broken CI (#296) * Try fix * Fix it! * Remove multisig (#299) * Update Pangoro2 parachain id (#304) * Update cross compile docker image (#303) * Update cross compile docker image * Fix compile * Easy make (#305) * Easy make * Format * Update EthBlockGasLimit (#306) * Update pangolin's max gas limit * Update other runtimes * Move evm tests * Self review * Anchor v0.9.38 * Companion for paritytech/cumulus#2067 * Companion for paritytech/cumulus#697 XCM v3 * Companion for paritytech/cumulus#2096 * Companion for paritytech/cumulus#1863 * Companion for paritytech/cumulus#2073 * Companion for paritytech/cumulus#2126 * Use prepare branch * Companion for paritytech/substrate#13216 * Companion for darwinia-messages-substrate#254 * Companion for paritytech/polkadot#4097 * Part companion for paritytech/cumulus#2067 * Correct companion for cumulus#2073 * Fix xcm compilation * Fix compilation done * Fix compilation with benchmark * Replace prepare branch * Format * Add EthereumXcm and XcmTransactor * Some fix * Fix compile 2 * Compile done * Format * Fix compilation done * Format * Add DarwiniaCall * Patch moonbeam debug branch * Patch polkadot debug branch * Patch frontier debug branch * Add many logs * Patch substrate debug branch * Update frontier&moonbeam debug logs * Add `EthereumXcm` and `XcmTransactor` for pangolin * Optimize bls precompile by arkworks lib (#993) * Optimize bls precompile by arkworks lib * Pin bls-test precompose at `address(2017)` * Fmt * Update deps * Add openssl deps in nix * Remove empty line * Format and fix compile * Fix * Resolve conv * Fix * Use rustup on nixos * Fix * Disable in the crab and darwinia network * Add `shell.nix` to .gitigore * Format * Format --------- Co-authored-by: Xavier Lau <[email protected]> Co-authored-by: bear <[email protected]> * Opt `deserialize_compressed` -> `deserialize_compressed_unchecked` (#1009) * Remove frontier log * Debug log in ecdsa * XcmTransactor weight v2 * Correct barrier * Remove xcmTransactor from Pangolin * Remove xcmTransactor from Pangoro * Message root record should be updated correctly (#1048) * Adjustable collator count (#1012) * Fix compile * Add missed bls commit * Remove moonbeam-relay-encoder * Refactor * Bench * Unused log * Revert "Update ecdsa-authority spec (#1022)" This reverts commit 3c07f7b. * Fix * Fix corner cases and add more unit tests Signed-off-by: Xavier Lau <[email protected]> * Add ethereum-xcm to darwinia runtime * Companion for polkadot-evm/frontier#1011, #1014 * Remove debug patch * Fix merging * Revert "Revert "Update ecdsa-authority spec (#1022)"" This reverts commit 2b1a07b. * Fix tests * Fix benchmark compile * Fix try-runtime features * GITHUB_CACHE_VERSION * Format * Move ethereumXcm pallet to EVM stuff * Disable transactThroughProxy * Fix runtime benchmarks * Fix review * Format --------- Signed-off-by: Xavier Lau <[email protected]> Co-authored-by: Xavier Lau <[email protected]> Co-authored-by: bear <[email protected]> Co-authored-by: HackFisher <[email protected]> Co-authored-by: fewensa <[email protected]> Co-authored-by: Guantong <[email protected]> Co-authored-by: echo <[email protected]>
* chore: bump js script deps * fix: js upgrade script after bounded democracy calls paritytech/substrate#11649 * refactor: post upgrade waiting sessions as const * docs: clarify magic prop length bounds * chore: bump js script deps * refactor: improve var naming * docs: apply suggestion from @NunoAlexandre
Polkadot companion: paritytech/polkadot#5729
Related: #12070
Introduces a new utility type
Bounded<T>
and two new traitsQueryPreimage
andStorePreimage
which are meant to be used instead of the old (and probably soon to be deprecated)PreimageProvider
andPreimageRecipient
. A new Scheduler API is also introduced (undertraits::scheduler::v3
) which uses theBounded<Call>
type for being passed the dispatchable (rather than the previousValueOrHash<Call>
).As a result, Referenda, Democracy, Scheduler and Preimage pallets are all now bounded in storage access footprint. Preimage pallet takes a complexity parameter in the
note
API allowing the expected PoV weight to be properly profiled without using the impractically pessimistic MEL for the storage item which is degeneratively large. TheQueryPreimage
andStorePreimage
trait APIs also ensure that a length is retained to allow any users of them to similarly profile and bound their weight. This is in use in Scheduler pallet, but will need similar logic introducing for any other pallets which expect to do hash lookups of wildly varying preimage sizes.Specific Changes
Runtime Primitives
General
DispatchError
variantsExhausted
,Corruption
,Unavailable
.Bounded
Default
forBoundedSlice
BoundedSlice::truncate_from
BoundedVec
,try_insert
&try_push
return the item to be introduced if the case of error. (NOTE: This has resulted in some minor alterations throughout the codebase.)BoundedVec::try_from
returns the sourceVec
in case of error.Frame Support
Schedule
Introduce
v3
which removes unbounded components from the previousv2
API.call
param is nowBounded<Call>
.id
param is nowTaskName
=[u8; 32]
Preimages
Introduce
preimages.rs
containing:StorePreimage
andQueryPreimage
with more succinct language in use for the operations;Bounded<T>
which takes a MEL-unbounded typeT
and provides a MEL-bounded wrapper which can yield the originalT
through a preimage-based API.Bounded<T>
may be created with aStorePreimage::into_bounded(T) -> Result<Bounded<T>>
, or alternatively withBounded<T>::unrequested(hash: Hash, len: u32)
orBounded<T>::requested(hash: Hash, len: u32)
and efficiently placed in storage. If the latter API is used, then it cannot be retrieved until the hash's preimage is introduced into the preimages backend (e.g. the Preimage pallet). This makes it quite useful for governance use-cases like Referenda where only the hash is supplied initially.T
value is needed, it can be retrieved withQueryPreimage::into_value(b: &Bounded<T>) -> Result<T>
.CallerTrait
Origin::Caller
which allows attempting conversion into theRawOrigin
(referenced or consuming).into_caller()
andas_system_ref
toOriginTrait
which make use ofCallerTrait
.OriginTrait::as_signed
to use these functions.Frame System
frame_system::Config::Call
is now bounded sensibly (Parameter
andDispatchable
with the rightOrigin
) to avoid the need to re-bound in other pallets which may need to use it.Scheduler
on_initialize
into four calls which can be weighted in isolationservice_agendas
,service_agenda
,service_task_*
andexecute_dispatch_*
. This is primarily due to the two-stage weight check (first we check PoV-weight for the possible lookup and bail if too much, then we check overall weight for dispatch and bail if too much). It's also quite a lot easier to comprehend.on_initialize
weight/benchmark combination in favour of individual benchmarks for the decomposed functions.[u8; 32]
rather than an (unbounded)Vec
.IncompleteSince
allowing O(1) postponing of agenda items.place_task
).Referenda
Refactor to ensure well-bounded in PoV footprint.
v3
withBounded<Call>
instead of using call or its hash directly.Preimage
MaxSize
parameter and just handle all reasonable sizes.note_preimage
records the preimage and also requests it if it is coming from a superuser (i.e. if there is no depositor). The assumption being that if you're the superuser and are noting a preimage then you probably want it to stick around until you're done with it.Democracy
Refactor to ensure well-bounded in PoV footprint.
Bounded<Call>
instead of aHash
of the proposal throughout except when the preimage is unneeded for the function (e.g. for blacklisting).MEL
to types throughout.EncodeInto
(though this should probably be moved toparity_scale_codec
in due course).Migration notes
Runtime storage migrations must be run for:
Democracy
Three items in the
Config
trait are removedProposal
,PreimageByteDeposit
,OperationalPreimageOrigin
.Three items have been added
Preimages
,MaxDeposits
,MaxBlacklisted
; assuming your runtime already uses thePreimages
pallet, here are example changes:becomes:
There is migration code which moves existing proposals and referenda over to the new format. However IT DOES NOT MIGRATE EVERYTHING:
This means you SHOULD ensure that:
The Democracy pallet will be marked as deprecated immediately once Referenda is considered production-ready. ALL TEAMS ARE RECOMMENDED TO SWITCH SWAY FROM DEMOCRACY PALLET TO REFERENDA/CONVICTION-VOTING PALLETS ASAP
Preimage
Preimage pallet has had
MaxSize
type removed from itsConfig
trait. Example code changes:becomes
Scheduler
In Scheduler's
Config
trait,PreimageProvider
has been renamed toPreimages
andNoPreimagePostponement
has been removed (since its corresponding feature is also removed), so:becomes
The scheduler will drop all un-decodable Agendas. This can happen in case a
Call
in an Agenda becomes un-decodable.The migration will print how many Agendas have been dropped.
If you find tests are breaking, and especially where Scheduler appears not to be executing scheduled items check the
MaximumWeight
config parameter of Scheduler and the weight of whatever function is being called. Scheduler has been changed to remove the concept of a "hard deadline" or weight-override priority and no longer guarantees that at least one scheduled item will be executed per block (since these are both dangerous to parachains which have a strict need of weight limits). This means you must ensure that scheduled items are below theMaximumWeight
or they will not be executed.TODO
ReferendumInfoOf
,NextExternal
,PublicProps
.