Skip to content

Commit 90a7c67

Browse files
jiguantongaurexavboundless-foresthackfisherfewensa
authored
To polkadot-v0.9.38 (#1007)
* 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]>
1 parent 9f216e7 commit 90a7c67

File tree

39 files changed

+1035
-976
lines changed

39 files changed

+1035
-976
lines changed

Cargo.lock

Lines changed: 472 additions & 430 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 149 additions & 312 deletions
Large diffs are not rendered by default.

node/Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ substrate-build-script-utils = { workspace = true }
1313
# crates.io
1414
array-bytes = { workspace = true }
1515
async-trait = { version = "0.1" }
16-
clap = { version = "4.0", features = ["derive"] }
16+
clap = { version = "4.1", features = ["derive"] }
1717
codec = { workspace = true, package = "parity-scale-codec" }
1818
futures = { version = "0.3" }
1919
jsonrpsee = { version = "0.16", features = ["server"] }
@@ -52,12 +52,11 @@ fp-storage = { workspace = true }
5252
# polkadot
5353
polkadot-cli = { workspace = true }
5454
polkadot-primitives = { workspace = true }
55-
polkadot-service = { workspace = true }
5655
xcm = { workspace = true }
5756

5857
# substrate
5958
frame-benchmarking = { workspace = true, optional = true }
60-
frame-benchmarking-cli = { workspace = true, optional = true }
59+
frame-benchmarking-cli = { workspace = true }
6160
pallet-transaction-payment-rpc = { workspace = true }
6261
sc-basic-authorship = { workspace = true }
6362
sc-chain-spec = { workspace = true }
@@ -119,7 +118,6 @@ runtime-benchmarks = [
119118

120119
# substrate
121120
"frame-benchmarking",
122-
"frame-benchmarking-cli",
123121
]
124122

125123
try-runtime = [

node/src/command.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -652,14 +652,11 @@ pub fn run() -> Result<()> {
652652

653653
runner.run_node_until_exit(|config| async move {
654654
let chain_spec = &config.chain_spec;
655-
let hwbench = if !cli.no_hardware_benchmarks {
655+
let hwbench = (!cli.no_hardware_benchmarks).then_some(
656656
config.database.path().map(|database_path| {
657657
let _ = std::fs::create_dir_all(database_path);
658658
sc_sysinfo::gather_hwbench(Some(database_path))
659-
})
660-
} else {
661-
None
662-
};
659+
})).flatten();
663660

664661
set_default_ss58_version(chain_spec);
665662

@@ -672,7 +669,7 @@ pub fn run() -> Result<()> {
672669
);
673670
let id = ParaId::from(para_id);
674671
let parachain_account =
675-
AccountIdConversion::<polkadot_primitives::v2::AccountId>::into_account_truncating(&id);
672+
AccountIdConversion::<polkadot_primitives::AccountId>::into_account_truncating(&id);
676673
let state_version = Cli::native_runtime_version(&config.chain_spec).state_version();
677674
let block: Block =
678675
cumulus_client_cli::generate_genesis_block(&*config.chain_spec, state_version)

node/src/service/mod.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,7 @@ where
312312
hwbench.clone(),
313313
)
314314
.await
315-
.map_err(|e| match e {
316-
cumulus_relay_chain_interface::RelayChainError::ServiceError(
317-
polkadot_service::Error::Sub(x),
318-
) => x,
319-
s => s.to_string().into(),
320-
})?;
315+
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;
321316

322317
let block_announce_validator =
323318
cumulus_client_network::BlockAnnounceValidator::new(relay_chain_interface.clone(), para_id);
@@ -418,6 +413,16 @@ where
418413

419414
if let Some(hwbench) = hwbench {
420415
sc_sysinfo::print_hwbench(&hwbench);
416+
// Here you can check whether the hardware meets your chains' requirements. Putting a link
417+
// in there and swapping out the requirements for your own are probably a good idea. The
418+
// requirements for a para-chain are dictated by its relay-chain.
419+
if !frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench)
420+
&& validator
421+
{
422+
log::warn!(
423+
"⚠️ The hardware does not meet the minimal requirements for role 'Authority'."
424+
);
425+
}
421426

422427
if let Some(ref mut telemetry) = telemetry {
423428
let telemetry_handle = telemetry.handle();

pallet/message-gadget/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@ std = [
4848
"sp-io/std",
4949
]
5050

51-
try-runtime = ["frame-support/try-runtime"]
51+
try-runtime = [
52+
# substrate
53+
"frame-support/try-runtime",
54+
]

pallet/message-transact/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,9 @@ std = [
6464
"sp-std/std",
6565
]
6666

67-
try-runtime = ["frame-support/try-runtime"]
67+
runtime-benchmarks = []
68+
69+
try-runtime = [
70+
# substrate
71+
"frame-support/try-runtime",
72+
]

pallet/message-transact/src/lib.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ use fp_ethereum::{TransactionData, ValidatedTransaction};
3636
use fp_evm::{CheckEvmTransaction, CheckEvmTransactionConfig, InvalidEvmTransactionError};
3737
use pallet_evm::{FeeCalculator, GasWeightMapping};
3838
// substrate
39-
use frame_support::{traits::EnsureOrigin, PalletError, RuntimeDebug};
39+
use frame_support::{
40+
sp_runtime::traits::BadOrigin, traits::EnsureOrigin, PalletError, RuntimeDebug,
41+
};
4042
use sp_core::{H160, U256};
4143
use sp_std::boxed::Box;
4244

@@ -63,15 +65,19 @@ impl<O: Into<Result<LcmpEthOrigin, O>> + From<LcmpEthOrigin>> EnsureOrigin<O>
6365
{
6466
type Success = H160;
6567

68+
fn ensure_origin(o: O) -> Result<Self::Success, BadOrigin> {
69+
Self::try_origin(o).map_err(|_| BadOrigin)
70+
}
71+
6672
fn try_origin(o: O) -> Result<Self::Success, O> {
6773
o.into().map(|o| match o {
6874
LcmpEthOrigin::MessageTransact(id) => id,
6975
})
7076
}
7177

7278
#[cfg(feature = "runtime-benchmarks")]
73-
fn successful_origin() -> O {
74-
O::from(LcmpEthOrigin::MessageTransact(Default::default()))
79+
fn try_successful_origin() -> Result<O, ()> {
80+
Ok(O::from(LcmpEthOrigin::MessageTransact(Default::default())))
7581
}
7682
}
7783

pallet/staking/src/lib.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -992,14 +992,6 @@ where
992992
fn note_author(author: T::AccountId) {
993993
Self::reward_by_ids(&[(author, 20)])
994994
}
995-
996-
fn note_uncle(uncle_author: T::AccountId, _age: T::BlockNumber) {
997-
if let Some(block_author) = <pallet_authorship::Pallet<T>>::author() {
998-
Self::reward_by_ids(&[(block_author, 2), (uncle_author, 1)])
999-
} else {
1000-
log::error!("[pallet::staking] block author not set, this should never happen; qed");
1001-
}
1002-
}
1003995
}
1004996

1005997
// Play the role of the session manager.

runtime/common/src/xcm_configs.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ where
6969
{
7070
fn should_execute<RuntimeCall>(
7171
origin: &MultiLocation,
72-
message: &mut Xcm<RuntimeCall>,
73-
max_weight: XcmWeight,
74-
weight_credit: &mut XcmWeight,
72+
message: &mut [Instruction<RuntimeCall>],
73+
max_weight: Weight,
74+
weight_credit: &mut Weight,
7575
) -> Result<(), ()> {
7676
Deny::should_execute(origin, message, max_weight, weight_credit)?;
7777
Allow::should_execute(origin, message, max_weight, weight_credit)
@@ -83,12 +83,11 @@ pub struct DenyReserveTransferToRelayChain;
8383
impl ShouldExecute for DenyReserveTransferToRelayChain {
8484
fn should_execute<RuntimeCall>(
8585
origin: &MultiLocation,
86-
87-
message: &mut Xcm<RuntimeCall>,
88-
_max_weight: XcmWeight,
89-
_weight_credit: &mut XcmWeight,
86+
message: &mut [Instruction<RuntimeCall>],
87+
_max_weight: Weight,
88+
_weight_credit: &mut Weight,
9089
) -> Result<(), ()> {
91-
if message.0.iter().any(|inst| {
90+
if message.iter().any(|inst| {
9291
matches!(
9392
inst,
9493
InitiateReserveWithdraw {
@@ -107,7 +106,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
107106
// An unexpected reserve transfer has arrived from the Relay Chain. Generally, `IsReserve`
108107
// should not allow this, but we just log it here.
109108
if matches!(origin, MultiLocation { parents: 1, interior: Here })
110-
&& message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
109+
&& message.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
111110
{
112111
log::warn!(
113112
target: "xcm::barriers",
@@ -147,7 +146,7 @@ pub struct LocalAssetTrader<
147146
OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
148147
R: TakeRevenue,
149148
>(
150-
XcmWeight,
149+
Weight,
151150
Currency::Balance,
152151
PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced, R)>,
153152
);
@@ -161,12 +160,12 @@ impl<
161160
> WeightTrader for LocalAssetTrader<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced, R>
162161
{
163162
fn new() -> Self {
164-
Self(0, Zero::zero(), PhantomData)
163+
Self(Weight::zero(), Zero::zero(), PhantomData)
165164
}
166165

167166
fn buy_weight(&mut self, weight: XcmWeight, payment: Assets) -> Result<Assets, XcmError> {
168167
log::trace!(target: "xcm::weight", "LocalAssetTrader::buy_weight weight: {:?}, payment: {:?}", weight, payment);
169-
let amount = WeightToFee::weight_to_fee(&Weight::from_ref_time(weight));
168+
let amount = WeightToFee::weight_to_fee(&weight);
170169
let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?;
171170
let required: MultiAsset = (Concrete(AssetId::get()), u128_amount).into();
172171
let unused = payment.checked_sub(required.clone()).map_err(|_| XcmError::TooExpensive)?;
@@ -179,7 +178,7 @@ impl<
179178
fn refund_weight(&mut self, weight: XcmWeight) -> Option<MultiAsset> {
180179
log::trace!(target: "xcm::weight", "LocalAssetTrader::refund_weight weight: {:?}", weight);
181180
let weight = weight.min(self.0);
182-
let amount = WeightToFee::weight_to_fee(&Weight::from_ref_time(weight));
181+
let amount = WeightToFee::weight_to_fee(&weight);
183182
self.0 -= weight;
184183
self.1 = self.1.saturating_sub(amount);
185184
let amount: u128 = amount.saturated_into();

0 commit comments

Comments
 (0)