Skip to content

Commit

Permalink
To polkadot-v0.9.38 (#1007)
Browse files Browse the repository at this point in the history
* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>
Co-authored-by: Guantong <04637@163.com>

* 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 <xavier@inv.cafe>
Co-authored-by: Guantong <04637@163.com>

* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Polish service (#38)

* use full path

* RuntimeApi

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>
Co-authored-by: bear <boundless.forest@outlook.com>

* 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 <boundless.forest@outlook.com>

* 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 <boundless.forest@outlook.com>

* 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 <denny.wang@itering.io>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* Refactor account genesis

* Purge locks

* Update scope

* Update special accounts list

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Vesting genesis (#127)

* Handle EVM accounts and pruge locks

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Refactor account genesis

* Purge locks

* Update scope

* Update special accounts list

* Vesting genesis

* Improve state management

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* Remove redundant clone

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: bear <boundless.forest@outlook.com>
Co-authored-by: fisher <denny.wang@itering.io>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* Format

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Update KTON owner (#145)

* Add genesis (#148)

* Add genesis

* Fix compile

* Clippy (#150)

* Fix revert (#149)

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Fix hash key (#152)

* Process indices & more utility fns (#151)

* More tools

* Process indices

* More error logs

Signed-off-by: Xavier Lau <xavier@inv.cafe>

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* 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 <denny.wang@itering.io>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* 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 <xavier@inv.cafe>
Co-authored-by: fisher <denny.wang@itering.io>

* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* Test all runtimes

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Done

* Remove compress step

* Remove unused env var

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* 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 <boundless.forest@outlook.com>

* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* Opt

* Opt

* Try

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Opt

* Opt

* Final test

* Fix

* Bump

* Fix

* Fix

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* Doc

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Add evm checks (#252)

* Add evm checks

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Fix

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Clean empty ledger (#253)

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* 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 <i@guantong.io>

* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* 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 <xavier@inv.cafe>

* 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 <xavier@inv.cafe>
Co-authored-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: bear <boundless.forest@outlook.com>
Co-authored-by: HackFisher <denny.wang@itering.io>
Co-authored-by: fewensa <37804932+fewensa@users.noreply.github.com>
Co-authored-by: Guantong <i@guantong.io>
  • Loading branch information
6 people authored Mar 28, 2023
1 parent 9f216e7 commit 90a7c67
Show file tree
Hide file tree
Showing 39 changed files with 1,035 additions and 976 deletions.
902 changes: 472 additions & 430 deletions Cargo.lock

Large diffs are not rendered by default.

461 changes: 149 additions & 312 deletions Cargo.toml

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ substrate-build-script-utils = { workspace = true }
# crates.io
array-bytes = { workspace = true }
async-trait = { version = "0.1" }
clap = { version = "4.0", features = ["derive"] }
clap = { version = "4.1", features = ["derive"] }
codec = { workspace = true, package = "parity-scale-codec" }
futures = { version = "0.3" }
jsonrpsee = { version = "0.16", features = ["server"] }
Expand Down Expand Up @@ -52,12 +52,11 @@ fp-storage = { workspace = true }
# polkadot
polkadot-cli = { workspace = true }
polkadot-primitives = { workspace = true }
polkadot-service = { workspace = true }
xcm = { workspace = true }

# substrate
frame-benchmarking = { workspace = true, optional = true }
frame-benchmarking-cli = { workspace = true, optional = true }
frame-benchmarking-cli = { workspace = true }
pallet-transaction-payment-rpc = { workspace = true }
sc-basic-authorship = { workspace = true }
sc-chain-spec = { workspace = true }
Expand Down Expand Up @@ -119,7 +118,6 @@ runtime-benchmarks = [

# substrate
"frame-benchmarking",
"frame-benchmarking-cli",
]

try-runtime = [
Expand Down
9 changes: 3 additions & 6 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,14 +652,11 @@ pub fn run() -> Result<()> {

runner.run_node_until_exit(|config| async move {
let chain_spec = &config.chain_spec;
let hwbench = if !cli.no_hardware_benchmarks {
let hwbench = (!cli.no_hardware_benchmarks).then_some(
config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
})
} else {
None
};
})).flatten();

set_default_ss58_version(chain_spec);

Expand All @@ -672,7 +669,7 @@ pub fn run() -> Result<()> {
);
let id = ParaId::from(para_id);
let parachain_account =
AccountIdConversion::<polkadot_primitives::v2::AccountId>::into_account_truncating(&id);
AccountIdConversion::<polkadot_primitives::AccountId>::into_account_truncating(&id);
let state_version = Cli::native_runtime_version(&config.chain_spec).state_version();
let block: Block =
cumulus_client_cli::generate_genesis_block(&*config.chain_spec, state_version)
Expand Down
17 changes: 11 additions & 6 deletions node/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,7 @@ where
hwbench.clone(),
)
.await
.map_err(|e| match e {
cumulus_relay_chain_interface::RelayChainError::ServiceError(
polkadot_service::Error::Sub(x),
) => x,
s => s.to_string().into(),
})?;
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;

let block_announce_validator =
cumulus_client_network::BlockAnnounceValidator::new(relay_chain_interface.clone(), para_id);
Expand Down Expand Up @@ -418,6 +413,16 @@ where

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

if let Some(ref mut telemetry) = telemetry {
let telemetry_handle = telemetry.handle();
Expand Down
5 changes: 4 additions & 1 deletion pallet/message-gadget/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ std = [
"sp-io/std",
]

try-runtime = ["frame-support/try-runtime"]
try-runtime = [
# substrate
"frame-support/try-runtime",
]
7 changes: 6 additions & 1 deletion pallet/message-transact/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,9 @@ std = [
"sp-std/std",
]

try-runtime = ["frame-support/try-runtime"]
runtime-benchmarks = []

try-runtime = [
# substrate
"frame-support/try-runtime",
]
12 changes: 9 additions & 3 deletions pallet/message-transact/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ use fp_ethereum::{TransactionData, ValidatedTransaction};
use fp_evm::{CheckEvmTransaction, CheckEvmTransactionConfig, InvalidEvmTransactionError};
use pallet_evm::{FeeCalculator, GasWeightMapping};
// substrate
use frame_support::{traits::EnsureOrigin, PalletError, RuntimeDebug};
use frame_support::{
sp_runtime::traits::BadOrigin, traits::EnsureOrigin, PalletError, RuntimeDebug,
};
use sp_core::{H160, U256};
use sp_std::boxed::Box;

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

fn ensure_origin(o: O) -> Result<Self::Success, BadOrigin> {
Self::try_origin(o).map_err(|_| BadOrigin)
}

fn try_origin(o: O) -> Result<Self::Success, O> {
o.into().map(|o| match o {
LcmpEthOrigin::MessageTransact(id) => id,
})
}

#[cfg(feature = "runtime-benchmarks")]
fn successful_origin() -> O {
O::from(LcmpEthOrigin::MessageTransact(Default::default()))
fn try_successful_origin() -> Result<O, ()> {
Ok(O::from(LcmpEthOrigin::MessageTransact(Default::default())))
}
}

Expand Down
8 changes: 0 additions & 8 deletions pallet/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -992,14 +992,6 @@ where
fn note_author(author: T::AccountId) {
Self::reward_by_ids(&[(author, 20)])
}

fn note_uncle(uncle_author: T::AccountId, _age: T::BlockNumber) {
if let Some(block_author) = <pallet_authorship::Pallet<T>>::author() {
Self::reward_by_ids(&[(block_author, 2), (uncle_author, 1)])
} else {
log::error!("[pallet::staking] block author not set, this should never happen; qed");
}
}
}

// Play the role of the session manager.
Expand Down
25 changes: 12 additions & 13 deletions runtime/common/src/xcm_configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ where
{
fn should_execute<RuntimeCall>(
origin: &MultiLocation,
message: &mut Xcm<RuntimeCall>,
max_weight: XcmWeight,
weight_credit: &mut XcmWeight,
message: &mut [Instruction<RuntimeCall>],
max_weight: Weight,
weight_credit: &mut Weight,
) -> Result<(), ()> {
Deny::should_execute(origin, message, max_weight, weight_credit)?;
Allow::should_execute(origin, message, max_weight, weight_credit)
Expand All @@ -83,12 +83,11 @@ pub struct DenyReserveTransferToRelayChain;
impl ShouldExecute for DenyReserveTransferToRelayChain {
fn should_execute<RuntimeCall>(
origin: &MultiLocation,

message: &mut Xcm<RuntimeCall>,
_max_weight: XcmWeight,
_weight_credit: &mut XcmWeight,
message: &mut [Instruction<RuntimeCall>],
_max_weight: Weight,
_weight_credit: &mut Weight,
) -> Result<(), ()> {
if message.0.iter().any(|inst| {
if message.iter().any(|inst| {
matches!(
inst,
InitiateReserveWithdraw {
Expand All @@ -107,7 +106,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
// An unexpected reserve transfer has arrived from the Relay Chain. Generally, `IsReserve`
// should not allow this, but we just log it here.
if matches!(origin, MultiLocation { parents: 1, interior: Here })
&& message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
&& message.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
{
log::warn!(
target: "xcm::barriers",
Expand Down Expand Up @@ -147,7 +146,7 @@ pub struct LocalAssetTrader<
OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
R: TakeRevenue,
>(
XcmWeight,
Weight,
Currency::Balance,
PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced, R)>,
);
Expand All @@ -161,12 +160,12 @@ impl<
> WeightTrader for LocalAssetTrader<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced, R>
{
fn new() -> Self {
Self(0, Zero::zero(), PhantomData)
Self(Weight::zero(), Zero::zero(), PhantomData)
}

fn buy_weight(&mut self, weight: XcmWeight, payment: Assets) -> Result<Assets, XcmError> {
log::trace!(target: "xcm::weight", "LocalAssetTrader::buy_weight weight: {:?}, payment: {:?}", weight, payment);
let amount = WeightToFee::weight_to_fee(&Weight::from_ref_time(weight));
let amount = WeightToFee::weight_to_fee(&weight);
let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?;
let required: MultiAsset = (Concrete(AssetId::get()), u128_amount).into();
let unused = payment.checked_sub(required.clone()).map_err(|_| XcmError::TooExpensive)?;
Expand All @@ -179,7 +178,7 @@ impl<
fn refund_weight(&mut self, weight: XcmWeight) -> Option<MultiAsset> {
log::trace!(target: "xcm::weight", "LocalAssetTrader::refund_weight weight: {:?}", weight);
let weight = weight.min(self.0);
let amount = WeightToFee::weight_to_fee(&Weight::from_ref_time(weight));
let amount = WeightToFee::weight_to_fee(&weight);
self.0 -= weight;
self.1 = self.1.saturating_sub(amount);
let amount: u128 = amount.saturated_into();
Expand Down
1 change: 1 addition & 0 deletions runtime/crab/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ runtime-benchmarks = [
"darwinia-common-runtime/runtime-benchmarks",
"darwinia-deposit/runtime-benchmarks",
"darwinia-ecdsa-authority/runtime-benchmarks",
"darwinia-message-transact/runtime-benchmarks",
"darwinia-staking/runtime-benchmarks",

# darwinia-messages-substrate
Expand Down
1 change: 0 additions & 1 deletion runtime/crab/src/bridges_message/darwinia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ impl MessageBridge for WithDarwiniaMessageBridge {
const BRIDGED_CHAIN_ID: bp_runtime::ChainId = DARWINIA_CHAIN_ID;
const BRIDGED_MESSAGES_PALLET_NAME: &'static str =
bridge_runtime_common::pallets::WITH_CRAB_MESSAGES_PALLET_NAME;
const RELAYER_FEE_PERCENT: u32 = 10;
const THIS_CHAIN_ID: bp_runtime::ChainId = CRAB_CHAIN_ID;
}

Expand Down
12 changes: 12 additions & 0 deletions runtime/crab/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ sp_api::impl_runtime_apis! {
) -> pallet_transaction_payment::FeeDetails<Balance> {
TransactionPayment::query_fee_details(uxt, len)
}
fn query_weight_to_fee(weight: frame_support::weights::Weight) -> Balance {
TransactionPayment::weight_to_fee(weight)
}
fn query_length_to_fee(length: u32) -> Balance {
TransactionPayment::length_to_fee(length)
}
}

impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
Expand All @@ -329,6 +335,12 @@ sp_api::impl_runtime_apis! {
) -> pallet_transaction_payment::FeeDetails<Balance> {
TransactionPayment::query_call_fee_details(call, len)
}
fn query_weight_to_fee(weight: frame_support::weights::Weight) -> Balance {
TransactionPayment::weight_to_fee(weight)
}
fn query_length_to_fee(length: u32) -> Balance {
TransactionPayment::length_to_fee(length)
}
}

impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {
Expand Down
2 changes: 0 additions & 2 deletions runtime/crab/src/pallets/authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,5 @@ use crate::*;

impl pallet_authorship::Config for Runtime {
type EventHandler = (DarwiniaStaking,);
type FilterUncle = ();
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Aura>;
type UncleGenerations = ConstU32<0>;
}
Loading

0 comments on commit 90a7c67

Please sign in to comment.