Commit Graph

148 Commits

Author SHA1 Message Date
Shawn Tabrizi 3d18ad34a9 Introduce XCM Weight Traits (#3802)
* introduce xcm weight traits

* patch some low hanging fruit

* add weightinfobound

* use checked math rather than saturating

* Update xcm/xcm-builder/src/weight.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Revert "Update xcm/xcm-builder/src/weight.rs"

This reverts commit 6331b874f3dccf7f01a051ca6d4ee4d14a23a82d.

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2021-09-07 23:42:05 +00:00
Shawn Tabrizi 4b928b0f22 make parts of the xcm-executor public (#3795) 2021-09-06 17:52:33 +00:00
dependabot[bot] c71a221097 Bump futures from 0.3.16 to 0.3.17 (#3742)
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.16 to 0.3.17.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.16...0.3.17)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-04 21:16:23 +02:00
Gavin Wood 82ffe7dd17 XCM: Automatic Version Negotiation (#3736)
* XCM: Automatic Version Negotiation

* Introduce the version instructions and subscription trait

* Notification and subscription data migration

* Version change subscriptions

* Fixes

* Formatting

* Spelling

* Fixes

* Fixes

* Automatic unsubscription

* Formatting

* Expose remote origin in VM and ensure it is unchanged from actual origin in subscription instructions.

* Barrier

* Unsubscription extrinsic

* Remove top_level param

* Formatting

* Fixes

* Automatic subscription

* Formatting

* Spelling

* Unit tests for XCM executor

* Formatting

* Spellin

* Unit test for XCM pallet subscriber side

* Formatting

* More tests

* Formatting

* Fixes

* Subscription-side tests

* Formatting

* Unit tests for XCM pallet

* Formatting

* Update roadmap/implementers-guide/src/types/overseer-protocol.md

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Remove commented code

* Grumbles

* Multi-stage XCM version migration

* Formatting

* v1 subscriptions backport

* Warning

* Spelling

* Fix grumbles

* Formatting

* Avoid running through old notifications

* Formatting

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-09-02 18:47:38 +02:00
Keith Yeung 64cbeab3b3 Return a Result in invert_location (#3730)
* Return a Result in invert_location

* Add invertible to spellcheck dictionary

* Fix Some -> Ok
2021-08-28 02:17:51 +02:00
Gavin Wood 636d0b030f XCM: Allow reclaim of assets dropped from holding (#3727)
* XCM: Introduce AssetTrap

* Revert reversions

* Remove attempts at weighing and add test

* Less storage use for asset trapping

* Add missing file

* Fixes

* Fixes

* Formatting

* Fixes

* Docs

* Filter types to allow runtimes to dictate which assets/origins should be trapped

* Formatting

* Tests

* Formatting

* Fixes

* Docs
2021-08-28 02:09:36 +02:00
Gavin Wood 8b80b283d4 XCM v2: Scripting, Query responses, Exception handling and Error reporting (#3629)
* Intoduce XCM v2

Also some minor fix for v0/v1

* Minor version cleanup

* Minor version cleanup

* Introduce SendError for XcmSend trait to avoid cycles with having Outcome in Xcm

* comment

* Corrent type

* Docs

* Fix build

* Fixes

* Introduce the basic impl

* Docs

* Add function

* Basic implementation

* Weighed responses and on_report

* Make XCM more script-like

* Remove BuyExecution::orders

* Fixes

* Fixes

* Fixes

* Formatting

* Initial draft and make pallet-xcm build

* fix XCM tests

* Formatting

* Fixes

* Formatting

* spelling

* Fixes

* Fixes

* spelling

* tests for translation

* extra fields to XCM pallet

* Formatting

* Fixes

* spelling

* first integration test

* Another integration test

* Formatting

* fix tests

* all tests

* Fixes

* Fixes

* Formatting

* Fixes

* Fixes

* Formatting

* Bump

* Remove unneeded structuring

* add instruction

* Fixes

* spelling

* Fixes

* Fixes

* Formatting

* Fixes

* Fixes

* Formatting

* Introduce and use VersionedResponse

* Introduce versioning to dispatchables' params

* Fixes

* Formatting

* Rest of merge

* more work

* Formatting

* Basic logic

* Fixes

* Fixes

* Add test

* Fixes

* Formatting

* Fixes

* Fixes

* Fixes

* Nits

* Simplify

* Spelling

* Formatting

* Return weight of unexecuted instructions in case of error as surplus

* Formatting

* Fixes

* Test for instruction count limiting

* Formatting

* Docs
2021-08-26 12:41:16 +02:00
Gavin Wood e0244f9769 XCM: Introduce versioning to dispatchables' params (#3693)
* Introduce versioning to dispatchables' params

* Fixes

* Formatting

* Bump
2021-08-23 19:53:59 +02:00
Shaun Wang 26dec7a3ec Impl WeightTrader for tuple (#3601)
* Impl WeightTrader for tuple.

* fmt

* Renaming.

* add tracing for buy_weight

* Add comment clarifying the default behavior of a WeightTrader tuple

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2021-08-18 00:02:24 +00:00
Gavin Wood e16c8d9902 Remove BuyExecution::orders (#3640)
* Remove BuyExecution::orders

* Fixes

* Fixes

* Fixes

* Formatting
2021-08-16 12:51:56 +02:00
Gavin Wood 0bb5434e08 Make RelayedFrom typesafe (#3617)
* Corrent type

* Fix build

* Fixes

* Fixes

* Formatting
2021-08-11 12:40:10 +02:00
Keith Yeung 1556873060 Ensure MultiLocation always has a canonical representation (#3404)
* MultiAsset TWO

* Ensure MultiLocation always has a canonical representation

* Remove v1 module

* Draft next MultiAsset API.

* Implement custom encoding/decoding scheme for MultiLocation

* Properly implement IntoIterator for Junctions

* Implement TryFrom<MultiLocation> for Junctions

* Fix spelling mistakes

* Fix tests in xcm-executor

* XCM core builds

* XCM Executor builds

* XCM Builder builds

* Fix xcm-builder tests and compilation

* Make pallet-xcm compile

* Use MultiLocation::default()

* Make polkadot-runtime-common compile

* Make rococo-runtime compile

* Change return type of parent_count to u8

* Change MAX_MULTILOCATION_LENGTH to 255

* Make kusama-runtime compile

* Fix logic in pallet-xcm

* Use MultiLocation::empty()

* Fix logic in location_conversion

* Fix logic in origin_conversion.rs

* Make westend-runtime compile

* Rename prefixes and suffixes variables

* Rename non_parent to interior

* Rename non_parent to interior

* Add test for encode/decode roundtrip and fix decode algorithm

* API changes making their way throughout

* Some TODOs

* Further build fixes

* Rename non_parent/junctions to interior

* Basic compile builds

* First test fixed

* All executor tests fixed

* Typo

* Optimize subsume_assets and add test

* Optimize checked_sub

* XCM Builder first test fixed

* Fix builder tests

* Fix doc test

* Make xcm-simulator compile

* Make xcm-simulator-example compile

* Make spellcheck happy

* cargo fmt

* fix some doc tests

* spelling

* named fields for AllOf

* Fix subtle bug where Null is treated as an identifier

* Add FIXME comment awaiting for const generics eval stabilization

* Update xcm/src/v0/multiasset.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/src/v0/multiasset.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/src/v0/multiasset.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/src/v0/multiasset.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Reformat

* Move to XCM version 1

* Spelling

* warnings

* Replace some more v0->v1s

* warnings

* format

* Add max_assets param

* building

* test fixes

* tests

* another test

* final test

* Update rustdocs and add debug_assert where sensible

* Revert debug_assert in const fn len()

* tests

* Rename Null -> Here

* Introduce

* More ergonomics

* More ergonomics

* test fix

* test fixes

* docs

* BuyExecution includes

* Fix XCM extrinsics

* fmt

* Make Vec<MultiAsset>/MultiAssets conversions safe

* More MultiAssets conversion safety

* spelling

* fix doc test

* Apply suggestions from code review

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* Apply suggestions from code review

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* fmt

* Add v0, remove VersionedMultiAsset

* Remove VersionedMultiLocation

* Update xcm/src/v1/order.rs

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* Update xcm/src/v1/mod.rs

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* XCM v0 backwards compatibility

* Full compatibility

* fmt

* Update xcm/pallet-xcm/src/lib.rs

* Update xcm/src/v0/order.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Tweaks to versioning system

* Fixes

* fmt

* Fix pallet-xcm tests

* fix

* Substitute with_parent with with_parents_const

* Rename argument name from a to m

* Rename split_last to split_last_interior

* Allow adding multiple parents in MultiLocation

* Rename pop_parent to dec_parent

* Ensure relay chain XCM sender receives a MultiLocation without any parents

* Block only when MultiLocation destination length is 8

* Cargo fmt

* Remove reverse iterators, implement DoubleEndedIterator and add tests

* Fix iter_rev lifetime requirements

* Cargo fmt

* Add an into() method for Junctions for conciseness in const context

* Ensure parent count is 0 while executing who in RelayedFrom

* Appease spellchecker

* Use and_then instead of repeated map_err

* Remove custom codec indices for v1 Junctions

* Add convenience 'contains_parents_only' method to MultiLocation

* Fix merge conflict

* Use more convenience methods

* Remove with_parachain_interior

* Prefer matching against tuple instead of using match guards

* Match against tuple instead of using more match guards

* Update encode/decode test for MultiLocation

* Minor tweaks

* Fixes

* Fixes

* Fixes

* Fix MultiLocation

* Add deprecation note for iter_rev and into_iter_rev

* Update some rustdocs

* cargo fmt

* Fix xcm-executor unit tests

* Fix compilation and unit tests in xcm-builder

* cargo fmt

* Fix tests in xcm-simulator-example

* Publicize MultiLocation fields

* Match on the MultiLocation struct directly in xcm-builder

* Do not dereference undereferenceable types

* Add convenience MultiLocation conversions for tuples

* Use clearer import paths

* Remove unused dependency

* fix junction + response

* Import from latest opaque xcm module

* Update xcm/src/v1/mod.rs

* better comment

* Fix ownership transfer

* Fix merge

* Fix merge

* cargo fmt

* Fix merge

* Fix merge

* Fix integration test

* More readable Parent syntax

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cargo fmt

* Fixes

* Fix doc test

Co-authored-by: Gav Wood <gavin@parity.io>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-08-09 18:55:40 +00:00
Shawn Tabrizi 9ee8013d6d Harden XCM v1 for Recursions (#3586)
* Guard against XCM recursive bombs by setting a recursion limit

* Add test and set a lower recursion limit

* Use u32 instead of usize for recursion limit

* Make spellcheck happy

* Cargo fmt

* Limit XCM decoding depth in UMP message processing

* Modify test to check for recursion in BuyExecution

* Update xcm/xcm-simulator/example/src/lib.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Make cargo fmt happy

* WIP for testing recursion limit in WASM

* Revert "WIP for testing recursion limit in WASM"

This reverts commit 39181b46d1adf79358f5ae8aafcf480e0c0c22e6.

* Remove XCM recursion limit test

* Add recursion test for XCM message execution

* Set a more sensible recursion limit

* Cargo fmt

* Implement successful_origin for benchmarks

* Set recursion limit to 8 and create integration tests directory for xcm-executor

* Cargo fmt

* Add runtime-benchmarks feature to test-runtime

* Give up creating ConvertOriginToLocal and use EnsureXcm

* Re-add ConvertOriginToLocal

* Fix compilation

* Update xcm/xcm-executor/src/lib.rs

Co-authored-by: Gavin Wood <gavin@parity.io>

* Add decoding limit to all versioned XCM decode calls

* Fix recursion limit test

* Set a lower recursion count for recursion test

* move integration tests to their own folder, fix recursion check in execute_effects

* Remove xcm-executor integration tests directory

* fix up

* Update Cargo.lock

* Update runtime/parachains/src/ump.rs

* use proper decode limit

* fix decode depth limit

* here too

* Update traits.rs

* fix compile

* fix test

* Revert `decode_all_with_depth_limit` changes in parachain.rs

* Remove unused imports in parachain.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
Co-authored-by: Gavin Wood <gavin@parity.io>
2021-08-07 19:29:12 +00:00
Gavin Wood ce80bc2d4c XCM v1 (#2815)
* MultiAsset TWO

* Draft next MultiAsset API.

* XCM core builds

* XCM Executor builds

* XCM Builder builds

* API changes making their way throughout

* Some TODOs

* Further build fixes

* Basic compile builds

* First test fixed

* All executor tests fixed

* Typo

* Optimize subsume_assets and add test

* Optimize checked_sub

* XCM Builder first test fixed

* Fix builder tests

* Fix doc test

* fix some doc tests

* spelling

* named fields for AllOf

* Update xcm/src/v0/multiasset.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/src/v0/multiasset.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/src/v0/multiasset.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/src/v0/multiasset.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Reformat

* Move to XCM version 1

* Spelling

* warnings

* Replace some more v0->v1s

* warnings

* format

* Add max_assets param

* building

* test fixes

* tests

* another test

* final test

* tests

* Rename Null -> Here

* Introduce

* More ergonomics

* More ergonomics

* test fix

* test fixes

* docs

* BuyExecution includes

* Fix XCM extrinsics

* fmt

* Make Vec<MultiAsset>/MultiAssets conversions safe

* More MultiAssets conversion safety

* spelling

* fix doc test

* Apply suggestions from code review

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* Apply suggestions from code review

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* fmt

* Add v0, remove VersionedMultiAsset

* Remove VersionedMultiLocation

* Update xcm/src/v1/order.rs

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* Update xcm/src/v1/mod.rs

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* XCM v0 backwards compatibility

* Full compatibility

* fmt

* Update xcm/pallet-xcm/src/lib.rs

* Update xcm/src/v0/order.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Tweaks to versioning system

* Fixes

* fmt

* Update xcm/xcm-executor/src/assets.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update xcm/xcm-executor/src/assets.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Grumbles

* Update xcm/src/v1/multiasset.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* fmt

* Update xcm/src/v1/multiasset.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update xcm/src/v1/multiasset.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Fixes

* Formatting

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-08-06 18:25:01 +02:00
Martin Pugh 49a46f78d3 Bump versions, substrate and beefy in prep for v0.9.9 (#3567)
* bump versions, substrate and beefy

* bump substrate
2021-08-05 15:12:18 +02:00
Shawn Tabrizi ff5d56fb76 cargo +nightly fmt (#3540)
* cargo +nightly fmt

* add cargo-fmt check to ci

* update ci

* fmt

* fmt

* skip macro

* ignore bridges
2021-08-02 10:47:33 +00:00
Alexander Popiak 86f6a173e4 Fix TransactAsset Implementation (#3345)
* convert local AssetNotFound errors into XcmError::AssetNotFound

aims allow the tuple implementation of TransactAsset to iterate properly

* add more XcmError descriptions

* adjust the rest of the TransactAsset tuple implementation to the behavior of can_check_in

* fix copy paste errors

* keep iterating tuple on Unimplemented error in TransactAsset

* add tests for tuple implementation of TransactAsset

* Update xcm/src/v0/traits.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Andronik Ordian <write@reusable.software>
2021-07-26 10:43:14 +00:00
Denis Pisarev fc253e6e4d WIP: CI: add spellcheck (#3421)
* CI: add spellcheck

* revert me

* CI: explicit command for spellchecker

* spellcheck: edit misspells

* CI: run spellcheck on diff

* spellcheck: edits

* spellcheck: edit misspells

* spellcheck: add rules

* spellcheck: mv configs

* spellcheck: more edits

* spellcheck: chore

* spellcheck: one more thing

* spellcheck: and another one

* spellcheck: seems like it doesn't get to an end

* spellcheck: new words after rebase

* spellcheck: new words appearing out of nowhere

* chore

* review edits

* more review edits

* more edits

* wonky behavior

* wonky behavior 2

* wonky behavior 3

* change git behavior

* spellcheck: another bunch of new edits

* spellcheck: new words are koming out of nowhere

* CI: finding the master

* CI: fetching master implicitly

* CI: undebug

* new errors

* a bunch of new edits

* and some more

* Update node/core/approval-voting/src/approval_db/v1/mod.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* Update xcm/xcm-executor/src/assets.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* Apply suggestions from code review

Co-authored-by: Andronik Ordian <write@reusable.software>

* Suggestions from the code review

* CI: scan only changed files

Co-authored-by: Andronik Ordian <write@reusable.software>
2021-07-14 19:22:58 +02:00
Alexander Popiak 4a345045a9 Add XCM Tracing (#3353)
* add missing bridges logging target

* trace send_xcm

* trace execute_xcm

* trace calls in xcm-executor

* trace tuple implementations of xcm traits

* update cargo.lock

* remove bridge log target

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* log argument formatting

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-07-05 22:44:46 +00:00
Martin Pugh cfbfefc972 Bump version, specs & substrate in prep for v0.9.8 (#3387)
* bump version

* bump substrate

* bump spec_versions
2021-07-01 12:09:41 +02:00
Martin Pugh 022e8bc11c Bump versions & spec_versions (#3368)
* bump versions & spec_versions

* bump Cargo.lock
2021-06-25 12:59:14 +02:00
Martin Pugh 396b38b355 Bump version, spec_version & substrate in prep for release v0.9.5 (#3238)
* bump spec_version and version

* bump substrate

* remove migrations

* Revert "remove migrations"

This reverts commit ceeab924d1cd5c2d3d05f24ab28315f0566f89d8.

* remove stale migration for kusama + westend
2021-06-14 23:10:45 +02:00
Martin Pugh b63184e4ec Bump version, substrate, beefy in prep for v0.9.4 (#3169)
* bump version, substrate, beefy

* bump substrate
2021-06-03 17:05:31 +02:00
Gavin Wood 53de6871e0 Fix teleport accounting and add some events (#3167)
* Stuff to help inspect the DMP activity

* Fix teleport accounting

* Fixes

* Fixes

* Fixes

* Fixes
2021-06-03 15:39:08 +02:00
Alexander Popiak a28d4a5c5d XCM docs and tests (#2948)
* WIP

* add tests and docs for DoubleEncoded

* reformat parent_count

* add test for match_and_split

* fix append_with docs and add tests

* move Parachain enum variant to tuple

* Fix stuff

* add to append test

* simplify match

* formatting

* format and extend doc comments (including examples)

* fix typo

* add some doc comments

* add test for location inverter

* Add more tests/docs

* Fix build

* matches fungibles

* currency adapter.

* add more tests for location inverter

* extract max length magic number into constant

* adapters.

* Apply suggestions from code review

* Final touches.

* Repot and fixes

* Remove last todo

* Apply suggestions from code review

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/xcm-builder/src/barriers.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/xcm-builder/src/barriers.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/xcm-builder/src/currency_adapter.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/xcm-builder/src/filter_asset_location.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/xcm-builder/src/matches_fungible.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/xcm-executor/src/traits/conversion.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/xcm-executor/src/traits/conversion.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/xcm-executor/src/traits/transact_asset.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/xcm-executor/src/traits/should_execute.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

Co-authored-by: kianenigma <kian@parity.io>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-06-03 02:01:25 +00:00
Martin Pugh 2174d9475e bump version & substrate (#3085) 2021-05-24 12:36:30 +02:00
Martin Pugh fe97c3a3a2 Bump version & spec version in prep for v0.9.2 (#3046)
* bump version & spec version

* update Cargo.lock

* bump substrate
2021-05-18 23:03:45 +02:00
Gavin Wood 41a93127a9 Check out/in assets when teleporting to maintain total issuance (#3007)
* Check out/in assets when teleporting to maintain total issuance

* Fixes

* Fixes

* Fixes

* Fixes

* Update xcm/xcm-executor/src/traits/transact_asset.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Docs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-05-12 08:39:16 +02:00
Martin Pugh 25cd67436c Bump version to v0.9.1 and spec_version to v9010 (#3001)
* bump version and spec_version

* fix generate_release_text.rb

* Revert "fix generate_release_text.rb"

This reverts commit 9e01e0ae4f6db2155d123f69063db7d7564588e0.

* fix publish_draft_release

* fix publish_draft_release

* update target cache
2021-05-11 15:27:52 +02:00
Gavin Wood 36b9d23923 Dispatchable for teleporting assets (#2995)
* Dispatchable for teleporting assets

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Update node/network/protocol/src/peer_set.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update xcm/src/v0/traits.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-05-10 16:13:46 +02:00
Martin Pugh 7a99a18d1d v0.9.0 prep (#2959)
* bump version and unify spec version

* bump substrate

* spec_version to 900
2021-04-29 18:21:58 +02:00
Gavin Wood ce457a91e1 Implement null weight trader (#2957) 2021-04-29 15:35:07 +02:00
Gavin Wood c0bf7e3d8c Required weight is returned in case it exceeds limit. (#2952) 2021-04-28 18:24:39 +02:00
Martin Pugh 9c60982989 Bump version, bump substrate & update benchmarks in preparation for v0.8.31 (#2938)
* bump version

* bump cargo

* update benchmarks

* cargo run --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_identity --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/

* cargo run --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/

Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
2021-04-28 13:23:54 +02:00
Gavin Wood 9194219586 Add XCM Origin and converter (#2896)
* Add XCM Origin and converter

* IsMajority filter can be location-prefixed

* Update xcm/pallet-xcm/src/lib.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/src/v0/multi_location.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Introduce UsingComponents to allow reuse of fee payment in XCM

* Use Drop rather than finalize

* Add errors for weight.

* Apply suggestions from code review

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Fixes

* Update xcm/xcm-builder/src/weight.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Various XCM fixes and improvements

* Fixes

* Update xcm/xcm-builder/src/weight.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/xcm-builder/src/weight.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update xcm/xcm-builder/src/weight.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Fixes

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2021-04-27 14:33:40 +02:00
Gavin Wood c9102c11a4 XCM Revamp Continued (#2865)
* Introduce plurality XCM locations

* Add RelayedFrom

* DMP dispatch weight handling.

* Add pallet for XCM sending, add routing logic.

* Update error types & doc

* Fix warnings.

* Fixes

* Fixes

* Fixes

* Bump Substrate

* Fixes

* Docs

* Docs

* Docs

* Fixes

* Fixes

* Fixes

* Update xcm/pallet-xcm/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Docs

* Fixes

* Update lib.rs

* Fixes

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-04-09 20:34:28 +02:00
Gavin Wood 9b4844e853 Introduce plurality XCM locations (#2846)
* Introduce plurality XCM locations

* Add RelayedFrom
2021-04-08 20:58:06 +02:00
Gavin Wood adc238ad86 XCM revamp (#2836)
* Remove unused relaying XCM

* Aggregate HRMP (XCMP/HMP) messages. Payloads for spambot.

* Revert lock

* Fix

* Broken example

* Introduce fee payment mechanics into XCM.

* Weight limitations on XCM execution

* Mock environment for tests and the first test

* Tests for XCM and a few refactors.

* Remove code that's not ready

* Fix for an XCM and an additional test

* Query response system

* XCMP message dispatch system reimagining

- Moved most of the logic into xcm-handler pallet
- Altered the outgoing XCMP API from push to pull
- Changed underlying outgoing queue data structures to avoid multi-page read/writes
- Introduced queuing for incoming messages
- Introduced signal messages as a flow-control sub-stream
- Introduced flow-control with basic threshold back-pressure
- Introduced overall weight limitation on messages executed
- Additonal alterations to XCM APIs for the new system

* Some build fixes

* Remove the Encode bounds sprayed around

* More faff

* Fix bounds amek use latest scale codec.

* remove println

* fixes

* Fix XcmExecutor Tests

* Fix XCM bounds using derivative crate

* Refactor names of XcmGeneric &c into Xcm

* Repot the xcm-executor into xcm-builder

* Docs

* Docs

* Fixes

* Update xcm/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Fixes

* Docs

* Update runtime/parachains/src/ump.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Docs

* Fixes

* Fixes

* Fixes

* Docs

* Fixes

* Fixes

* Introduce transfer_asset specialisation.

* Fixes

* Fixes

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-04-07 22:38:29 +02:00
Gavin Wood 0395b5dd16 Fungibles adapter and MultiLocation::X8 (#2662)
* Fungibles adapter and MultiLocation::X8

* Comments

* Comment & whitespace

* Fix up CI/CD for the new labels.

* Fix labels

* Whitespace

* Fixes

* Update Cargo.lock

* Update xcm/xcm-builder/src/fungibles_adapter.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-03-30 17:52:50 +02:00
Martin Pugh 9938513e71 Bump version , weights and substrate in prep for v0.8.30 (#2690)
* bump version and substrate

* bump old forgotten versions

* update weights

* bump substrate

* Revert "bump substrate"

This reverts commit 8b5004b6fe9ce9ccdf143d3fe878802931ea4f2f.

Co-authored-by: André Silva <andrerfosilva@gmail.com>
2021-03-25 11:29:11 +01:00
Shaun Wang d859734ed9 Replace XCM Error::Undefined usage (#2580)
* Replace undefined error in currency adapter.

* Update tranact asset errors.

* Update TransactAsset trait documentations.

* Update currency adapter error documentation.
2021-03-09 15:46:30 +01:00
Bastian Köcher 7a2c7aa3fe Companion for init the RuntimeLogger automatically (#2522)
* Lol

* Add the features

* Remove some more runtime logger init calls

* Make companion check work

* Revert "Make companion check work"

This reverts commit a255c798076466c0fa20a4db713fc712772c2b4d.

* Update Substrate
2021-03-01 16:15:34 +01:00
Guillaume Thiolliere 29f12f3f48 Upgrade codec to 2.0 and bitvec to 0.20 (companion) (#2343)
* upgrade codec and bitvec

* "Update Substrate"

Co-authored-by: parity-processbot <>
2021-01-29 14:35:45 +01:00
Guillaume Thiolliere a3682f8d9d bump codec minor version (#2247) 2021-01-11 23:00:07 +01:00
Andronik Ordian 0a8a607a58 update most of the dependencies (#1946)
* update tiny-keccak to 0.2

* update deps except bitvec and shared_memory

* fix some warning after futures upgrade

* remove useless package rename caused by bug in cargo-upgrade

* revert parity-util-mem *

* remove unused import

* cargo update

* remove all renames on parity-scale-codec

* remove the leftovers

* remove unused dep
2020-11-17 11:16:31 +01:00
Shawn Tabrizi d79b37b8fd Finish XCM Executor Assets w/ Tests (#1821)
* adding some basic tests

* min error

* fix min

* fix saturating_take

* all fungible and non fungible

* min abstract

* fix saturating take

* clean up

* some comments and fixes

* another fix

* more fixes

* comment

* remove unnecessary collect

* improve iter cloning

* better saturating_take impl

* feedback

* fix no_std build

* add doc tests

* mem::replace to be a bit more efficient

* better api
2020-10-27 20:00:14 +01:00
Pierre Krieger 23b7542fee Tweak Cargo.tomls to make burnin easier (#1805) 2020-10-13 13:32:30 +02:00
Sergei Shulepov 22e7d54f4d XCM: Land xcm-handler and xcm-executor (#1771)
Co-authored-by: Gavin Wood <gavin@parity.io>
2020-10-06 10:03:07 +02:00