Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

XCM v3 #4097

Merged
merged 313 commits into from
Jan 17, 2023
Merged

XCM v3 #4097

Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
313 commits
Select commit Hold shift + click to select a range
cd5df6d
cargo fmt
KiChjang Jan 13, 2022
22b4332
Create benchmarks for XCM instructions introduced in v3 (#4564)
KiChjang Jan 20, 2022
c0d4800
XCM v3: Introduce querier field into `QueryReponse` (#4732)
gavofyork Jan 21, 2022
79c6d55
Fixes
KiChjang Jan 21, 2022
a837427
Merge branch 'master' into gav-xcm-v3
gavofyork Jan 22, 2022
87e5815
Fixes
KiChjang Jan 23, 2022
2ccb1f4
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
gavofyork Jan 31, 2022
0dcdf44
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Feb 2, 2022
e640d82
Add `starts_with` function to `MultiLocation` and `Junctions` (#4835)
apopiak Feb 10, 2022
fdf6352
Merge branch 'master' into gav-xcm-v3
gavofyork Feb 14, 2022
6185cf3
XCM v3: Bridge infrastructure (#4681)
gavofyork Feb 14, 2022
93382d9
Merge branch 'gav-xcm-v3' of github.com:paritytech/polkadot into gav-…
gavofyork Feb 15, 2022
841bdb9
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Feb 19, 2022
8e8e7b2
Merge branch 'gav-xcm-v3' of github.com:paritytech/polkadot into gav-…
gavofyork Feb 19, 2022
2578af8
Bump Substrate
gavofyork Feb 19, 2022
768535f
XCM v3: `ExchangeAsset` and Remote-locking (#4945)
gavofyork Feb 20, 2022
ba20a96
Merge branch 'gav-xcm-v3' of github.com:paritytech/polkadot into gav-…
gavofyork Feb 20, 2022
bc866e2
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
gavofyork Feb 25, 2022
42b12db
Add simulator test for remote locking
KiChjang Mar 3, 2022
0fbf0c7
Fix tests
KiChjang Mar 4, 2022
adb6862
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
gavofyork Mar 7, 2022
6fda480
Bump
gavofyork Mar 7, 2022
3d5ab32
XCM v3: Support for non-fungibles (#4950)
gavofyork Mar 8, 2022
c117f99
XCM v3: Context & ID hash (#4756)
gavofyork Mar 8, 2022
76cad39
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Mar 9, 2022
3026e89
Fixes
KiChjang Mar 9, 2022
4c8ed73
Fixes
KiChjang Mar 9, 2022
16b9de8
Fixes
KiChjang Mar 9, 2022
abdccdd
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Mar 11, 2022
38fb089
Fixes
KiChjang Mar 11, 2022
ac9662c
Formatting
gavofyork Mar 11, 2022
0f3c3ed
Fixes
gavofyork Mar 11, 2022
59d3e17
Formatting
gavofyork Mar 11, 2022
70c32d6
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
gavofyork Mar 11, 2022
7a1bc07
Fixes
gavofyork Mar 11, 2022
df62f3c
Fixes
gavofyork Mar 11, 2022
5a916ca
Formatting
gavofyork Mar 11, 2022
9cf0ff5
Formatting
gavofyork Mar 11, 2022
d236b2f
Remove horrible names
KiChjang Mar 11, 2022
edd992e
Bump
gavofyork Mar 11, 2022
4421714
Remove InvertLocation trait (#5092)
gavofyork Mar 12, 2022
cb12467
Fixes
gavofyork Mar 12, 2022
41e7c47
Remove XCMv1 (#5094)
gavofyork Mar 13, 2022
2f214f2
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
gavofyork Mar 13, 2022
069c75f
derive serialize/deserialize for xcm primitives (#5036)
stanly-johnson Mar 14, 2022
8723e31
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Mar 14, 2022
55d09a5
Merge branch 'master' into gav-xcm-v3
gavofyork Mar 15, 2022
9cca36a
Update lock
gavofyork Mar 15, 2022
bedb342
Fixes
gavofyork Mar 15, 2022
a261384
Add benchmarks for the ExchangeAsset instruction
KiChjang Mar 20, 2022
39283ce
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Mar 20, 2022
92a0d76
`AliasOrigin` instruction stub (#5122)
gavofyork Mar 20, 2022
9de612c
Fixes
gavofyork Mar 21, 2022
07cdc71
Merge branch 'master' into gav-xcm-v3
KiChjang Mar 21, 2022
5e0d072
Update substrate
KiChjang Mar 21, 2022
6d92833
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
gavofyork Mar 22, 2022
f567ef4
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
gavofyork Mar 24, 2022
7f94156
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Mar 25, 2022
0e27b18
Fixes
KiChjang Mar 25, 2022
5c02901
Ensure same array length before using copy_from_slice
KiChjang Apr 8, 2022
f64a0b8
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Apr 8, 2022
990a5d1
Fixes
KiChjang Apr 8, 2022
a1828ac
Add benchmarks for the UniversalOrigin instruction
KiChjang Apr 8, 2022
7d05afd
Remove unused import
KiChjang Apr 8, 2022
e5052da
Remove unused import
KiChjang Apr 11, 2022
70723a4
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Apr 12, 2022
6632bff
Add benchmarks for SetFeesMode instruction
KiChjang Apr 12, 2022
54e3eb6
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Apr 14, 2022
865ee38
Add benchmarks for asset (un)locking instructions
KiChjang Apr 15, 2022
774945c
Leave AliasOrigin unbenchmarked
KiChjang Apr 15, 2022
aca38aa
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Apr 15, 2022
3425324
Fixes after merge
KiChjang Apr 15, 2022
c4a8da5
cargo fmt
KiChjang Apr 15, 2022
81ec7d2
Fixes
KiChjang Apr 15, 2022
325d469
Fixes
KiChjang Apr 15, 2022
41a4b79
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Apr 15, 2022
a8b2f7f
Set TrustedReserves to None on both Kusama and Westend
KiChjang Apr 15, 2022
5a409eb
Remove extraneous reserve_asset_deposited benchmark
KiChjang Apr 16, 2022
49cb4d7
Fix universal_origin benchmark
KiChjang Apr 17, 2022
0f4fb16
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Apr 17, 2022
784941b
cargo run --quiet --profile=production --features=runtime-benchmarks…
Apr 17, 2022
923acc8
Don't rely on skipped benchmark functions
KiChjang Apr 17, 2022
5e53cf5
Fixes
KiChjang Apr 18, 2022
94c76ce
cargo run --quiet --profile=production --features=runtime-benchmarks…
Apr 18, 2022
ae53f58
Fix unused variables
KiChjang Apr 18, 2022
994ef9c
Merge branch 'master' into gav-xcm-v3
KiChjang Jun 20, 2022
cfcb797
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Jun 21, 2022
34a969b
Fixes
KiChjang Jun 22, 2022
b63a68a
Spelling
KiChjang Jun 22, 2022
6b28a4b
Fixes
KiChjang Jun 22, 2022
99bf04d
Fix codec index of VersionedXcm
KiChjang Jun 23, 2022
21a59c2
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Jun 24, 2022
119a494
Allows to customize how calls are dispatched from XCM (#5657)
nanocryk Jun 29, 2022
6810d06
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Jun 29, 2022
b4f0aee
Update comment `NoteAssetLocked` -> `NoteUnlockable`
KiChjang Jul 26, 2022
2608ec9
Merge branch 'master' into gav-xcm-v3
KiChjang Aug 10, 2022
81b3068
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Aug 14, 2022
7540583
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Aug 23, 2022
dc5bb37
Fixes
KiChjang Aug 24, 2022
29499ba
Fixes
KiChjang Aug 24, 2022
6d2bae4
Adjust MultiAssets weights based on new wild card variants
KiChjang Sep 20, 2022
bf26e0d
Fixes
KiChjang Sep 20, 2022
c57e69b
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Sep 21, 2022
e0d906a
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Sep 21, 2022
4f5d45a
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Sep 21, 2022
7bd9d5f
Fixes
KiChjang Sep 21, 2022
ecdea05
Fixes
KiChjang Sep 21, 2022
64b2996
Fixes
KiChjang Sep 22, 2022
3c21067
Fixes
KiChjang Sep 22, 2022
f895642
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Sep 22, 2022
4c54eea
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
bkontur Oct 4, 2022
f073155
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
bkontur Oct 4, 2022
1879039
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
bkontur Oct 5, 2022
9c22a85
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
gavofyork Oct 7, 2022
fbc4327
Some late fixes for XCMv3 (#5237)
gavofyork Oct 7, 2022
da5c4f2
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Oct 11, 2022
37e49df
Update Substrate
KiChjang Oct 11, 2022
fa54983
Re-export `pub` stuff from universal_exports.rs + removed unecessary …
bkontur Oct 13, 2022
9fc6b88
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
bkontur Nov 4, 2022
41fb1f1
Use 2D weights in XCM v3 (#6134)
KiChjang Nov 10, 2022
80f9d03
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Nov 10, 2022
aef0231
Replace Weight::MAX with 100b weight units
KiChjang Nov 10, 2022
ca0aa37
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Nov 22, 2022
55c8e69
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Nov 22, 2022
2668b75
Add test to ensure all_gte in barriers is correct
KiChjang Nov 28, 2022
6280d1d
Update xcm/src/v3/junction.rs
KiChjang Nov 28, 2022
599158b
Add more weight tests
KiChjang Nov 28, 2022
320a49f
Merge branch 'master' into gav-xcm-v3
KiChjang Nov 29, 2022
7a99e39
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Nov 30, 2022
6f0339c
cargo fmt
KiChjang Dec 1, 2022
c34826f
Create thread_local in XCM executor to limit recursion depth (#6304)
KiChjang Dec 1, 2022
31d5410
Add upper limit on the number of overweight messages in the queue (#6…
KiChjang Dec 2, 2022
8aef2b9
Introduce whitelist for Transact and limit UMP processing to 10 messa…
KiChjang Dec 2, 2022
76ffe03
Update xcm/xcm-builder/src/universal_exports.rs
KiChjang Dec 2, 2022
979c60a
Fixes
KiChjang Dec 3, 2022
799ef59
Fixes
KiChjang Dec 3, 2022
4d6b758
Remove topic register and instead use the topic field in XcmContext
KiChjang Dec 3, 2022
07937f5
Derive some common traits for DispatchBlobError
KiChjang Dec 3, 2022
e428838
Fixes
KiChjang Dec 3, 2022
83f2fd3
cargo fmt
KiChjang Dec 3, 2022
57a9df8
Fixes
KiChjang Dec 3, 2022
e761a84
Fixes
KiChjang Dec 3, 2022
a374c9c
Fix comments
KiChjang Dec 3, 2022
0801bc5
Fixes
KiChjang Dec 3, 2022
ded3655
Introduce WithOriginFilter and apply it as the CallDispatcher for run…
KiChjang Dec 3, 2022
c5e7908
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Dec 6, 2022
5f8ffbb
Fixes
KiChjang Dec 6, 2022
dbb9ee7
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Dec 6, 2022
f5fde97
Appease clippy and fixes
KiChjang Dec 6, 2022
229bc00
Fixes
KiChjang Dec 6, 2022
0987294
Fix more clippy issues
KiChjang Dec 6, 2022
456ad93
Fixes
KiChjang Dec 6, 2022
10f864b
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Dec 6, 2022
d9ee95b
".git/.scripts/bench-bot.sh" runtime polkadot-dev pallet_xcm
Dec 6, 2022
59dea69
".git/.scripts/bench-bot.sh" runtime westend-dev pallet_xcm
Dec 6, 2022
67104c4
".git/.scripts/bench-bot.sh" runtime westend-dev pallet_xcm
Dec 6, 2022
f247313
Add benchmark function for ExportMessage
KiChjang Dec 7, 2022
4b26181
Fix comment
KiChjang Dec 7, 2022
b00a892
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Dec 7, 2022
947c4a9
Add upper limit to DownwardMessageQueues size
KiChjang Dec 7, 2022
e6f8cd7
Add max size check for queue in can_queue_downward_message
KiChjang Dec 7, 2022
233d95a
Fixes
KiChjang Dec 7, 2022
3b402dc
Make Transact runtime call configurable
KiChjang Dec 8, 2022
b1e6b47
Return Weight::MAX when there is no successful send XCM origin
KiChjang Dec 8, 2022
09ecd7b
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Dec 8, 2022
a6b0896
Update substrate
KiChjang Dec 8, 2022
6128e3f
Fixes
KiChjang Dec 8, 2022
07de17c
Fixes
KiChjang Dec 8, 2022
65bffb8
Remove ExportMessage benchmark
KiChjang Dec 8, 2022
843c8b0
Remove assertion on Transact instruction benchmark
KiChjang Dec 8, 2022
8923c9f
Make reachable destination configurable in XCM pallet benchmarks
KiChjang Dec 8, 2022
c533401
Fixes
KiChjang Dec 8, 2022
8a0398d
Fixes
KiChjang Dec 8, 2022
8e74d79
Remove cfg attribute in fuzzer
KiChjang Dec 8, 2022
5361832
Fixes
KiChjang Dec 8, 2022
a37b93a
Remove cfg attribute for XCM pallet in test runtime
KiChjang Dec 8, 2022
d9bfc89
Fixes
KiChjang Dec 8, 2022
420be3e
Use ReachableDest where possible
KiChjang Dec 8, 2022
1e3e9ad
Fixes
KiChjang Dec 8, 2022
937c4b7
Add benchmark for UnpaidExecution
KiChjang Dec 8, 2022
d91adbc
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Dec 8, 2022
fd388e0
Update substrate
KiChjang Dec 8, 2022
7f437a5
Ensure benchmark functions pass filters
KiChjang Dec 9, 2022
30a5760
Add runtime-benchmarks feature to fuzzer
KiChjang Dec 9, 2022
5801648
Ensure FixedRateOfFungible accounts for proof size weights
KiChjang Dec 9, 2022
15d7413
cargo fmt
KiChjang Dec 9, 2022
1e0132d
Whitelist remark_with_event when runtime-benchmarks feature is enabled
KiChjang Dec 9, 2022
8404147
Use remark_with_event for Transact benchmarks
KiChjang Dec 9, 2022
06ad511
Merge branch 'master' into gav-xcm-v3
KiChjang Dec 13, 2022
aa02858
Fix Cargo.lock
KiChjang Dec 13, 2022
30b2df3
Allow up to 3 DescendOrigin instructions before UnpaidExecution
KiChjang Dec 13, 2022
ceb0cd1
cargo fmt
KiChjang Dec 13, 2022
77713e5
Edit code comment
KiChjang Dec 13, 2022
a08303e
Check check_origin for unpaid execution privilege
KiChjang Dec 13, 2022
3e9cc17
Fixes
KiChjang Dec 13, 2022
4b9a8e8
Small nits for xcm-v3 (#6408)
bkontur Dec 13, 2022
e13d926
Revert changes to UnpaidExecution
KiChjang Dec 14, 2022
9f72f2c
Change AllowUnpaidExecutionFrom to be explicit
KiChjang Dec 15, 2022
c4a7569
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Dec 15, 2022
ac9af6e
Fix log text
KiChjang Dec 15, 2022
88d21b1
cargo fmt
KiChjang Dec 16, 2022
aea49b3
Add benchmarks for XCM pallet version migration (#6448)
KiChjang Dec 17, 2022
0142d5c
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Dec 21, 2022
a9a1a4f
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Dec 21, 2022
79933a6
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Dec 22, 2022
4ccf61a
Fixes
KiChjang Dec 22, 2022
7218adf
Fix comments (#6470)
bkontur Dec 22, 2022
a76c17a
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Dec 23, 2022
1020c2e
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Dec 28, 2022
90822a7
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Jan 3, 2023
f377a65
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Jan 4, 2023
c223f71
Specify Ethereum networks by their chain id (#6286)
vgeddes Jan 5, 2023
49b1999
Use for Kusama
gavofyork Jan 6, 2023
c795701
Merge branch 'gav-xcm-v3' of github.com:paritytech/polkadot into gav-…
gavofyork Jan 6, 2023
e3151f3
Use WithComputedOrigin for Polkadot, Rococo and Westend
KiChjang Jan 6, 2023
186dcb8
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
gavofyork Jan 6, 2023
7be5faf
Merge branches 'gav-xcm-v3' and 'gav-xcm-v3' of github.com:paritytech…
gavofyork Jan 6, 2023
61074d1
Update lock
gavofyork Jan 6, 2023
bd8e768
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Jan 7, 2023
9d659fd
Merge remote-tracking branch 'origin/master' into gav-xcm-v3
KiChjang Jan 10, 2023
f1319f1
Fix warning
KiChjang Jan 10, 2023
b7e40d7
Merge branch 'master' into gav-xcm-v3
KiChjang Jan 11, 2023
8652bfc
Update xcm/pallet-xcm/src/tests.rs
KiChjang Jan 11, 2023
f0b0847
Update runtime/parachains/src/ump/migration.rs
KiChjang Jan 11, 2023
e430f16
Update xcm/pallet-xcm/src/migration.rs
KiChjang Jan 12, 2023
1efae03
Fixes
KiChjang Jan 12, 2023
b85e12f
cargo fmt
KiChjang Jan 12, 2023
dbbdc9d
Merge branch 'gav-xcm-v3' of github.com:paritytech/polkadot into gav-…
gavofyork Jan 14, 2023
47f972b
Typo
gavofyork Jan 15, 2023
62752b3
Update xcm/src/v3/mod.rs
gavofyork Jan 15, 2023
3d0d3e7
Docs
gavofyork Jan 15, 2023
97436d7
Merge branch 'gav-xcm-v3' of github.com:paritytech/polkadot into gav-…
gavofyork Jan 15, 2023
9bc2ddb
Docs
gavofyork Jan 15, 2023
bbeb790
Docs
gavofyork Jan 15, 2023
6c8fb23
Docs
gavofyork Jan 15, 2023
ff59e4c
Docs
gavofyork Jan 15, 2023
76e6581
Update xcm/src/v3/multiasset.rs
KiChjang Jan 16, 2023
6308804
Add tests for MultiAssets::from_sorted_and_deduplicated
KiChjang Jan 16, 2023
88b187c
Fail gracefully when same instance NFTs are detected during push
KiChjang Jan 16, 2023
0dc2643
Update Substrate to fix benchmarks
bkchr Jan 16, 2023
40e0047
Apply suggestions from code review
gavofyork Jan 16, 2023
ceef029
Merge branch 'master' into gav-xcm-v3
shawntabrizi Jan 16, 2023
5184e73
Update runtime/kusama/src/xcm_config.rs
KiChjang Jan 16, 2023
1d76ac4
Rename arguments
KiChjang Jan 16, 2023
8ef427d
Attempt to fix benchmark
KiChjang Jan 16, 2023
9780e01
".git/.scripts/commands/bench/bench.sh" runtime polkadot-dev runtime_…
Jan 16, 2023
ae4a28a
Use actual weights for UMP pallet in Polkadot
KiChjang Jan 16, 2023
1353932
".git/.scripts/commands/bench/bench.sh" runtime kusama-dev runtime_pa…
Jan 16, 2023
e80c142
".git/.scripts/commands/bench/bench.sh" runtime westend-dev runtime_p…
Jan 16, 2023
05dc8f0
".git/.scripts/commands/bench/bench.sh" runtime rococo-dev runtime_pa…
Jan 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
409 changes: 218 additions & 191 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion node/core/pvf/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ async fn run(
futures::select_biased! {
() = cleanup_pulse.select_next_some() => {
// `select_next_some` because we don't expect this to fail, but if it does, we
// still don't fail. The tradeoff is that the compiled cache will start growing
// still don't fail. The trade-off is that the compiled cache will start growing
// in size. That is, however, rather a slow process and hopefully the operator
// will notice it.

Expand Down
2 changes: 1 addition & 1 deletion node/network/protocol/src/request_response/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const STATEMENTS_TIMEOUT: Duration = Duration::from_secs(1);

/// We don't want a slow peer to slow down all the others, at the same time we want to get out the
/// data quickly in full to at least some peers (as this will reduce load on us as they then can
/// start serving the data). So this value is a tradeoff. 3 seems to be sensible. So we would need
/// start serving the data). So this value is a trade-off. 3 seems to be sensible. So we would need
/// to have 3 slow nodes connected, to delay transfer for others by `STATEMENTS_TIMEOUT`.
pub const MAX_PARALLEL_STATEMENT_REQUESTS: u32 = 3;

Expand Down
3 changes: 1 addition & 2 deletions node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ fn default_parachains_host_configuration(
max_upward_queue_count: 8,
max_upward_queue_size: 1024 * 1024,
max_downward_message_size: 1024 * 1024,
ump_service_total_weight: Weight::from_ref_time(100_000_000_000)
.set_proof_size(MAX_POV_SIZE as u64),
ump_service_total_weight: Weight::from_parts(100_000_000_000, MAX_POV_SIZE as u64),
max_upward_message_size: 50 * 1024,
max_upward_message_num_per_candidate: 5,
hrmp_sender_deposit: 0,
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ mod tests {
weight.base_extrinsic = Weight::from_ref_time(100);
})
.for_class(DispatchClass::non_mandatory(), |weight| {
weight.max_total = Some(Weight::from_ref_time(1024).set_proof_size(u64::MAX));
weight.max_total = Some(Weight::from_parts(1024, u64::MAX));
})
.build_or_panic();
pub BlockLength: limits::BlockLength = limits::BlockLength::max(2 * 1024);
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ parameter_types! {
pub const BlockHashCount: u32 = 250;
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
Weight::from_ref_time(4 * 1024 * 1024).set_proof_size(u64::MAX),
Weight::from_parts(4 * 1024 * 1024, u64::MAX),
);
}

Expand Down
4 changes: 1 addition & 3 deletions runtime/common/src/paras_registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,7 @@ mod tests {
parameter_types! {
pub const BlockHashCount: u32 = 250;
pub BlockWeights: limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
Weight::from_ref_time(1024).set_proof_size(u64::MAX),
);
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, u64::MAX));
pub BlockLength: limits::BlockLength =
limits::BlockLength::max_with_normal_ratio(4 * 1024 * 1024, NORMAL_RATIO);
}
Expand Down
89 changes: 65 additions & 24 deletions runtime/common/src/xcm_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,75 @@

//! XCM sender for relay chain.

use frame_support::traits::Get;
use parity_scale_codec::Encode;
use runtime_parachains::{configuration, dmp};
use sp_std::marker::PhantomData;
use xcm::latest::prelude::*;
use primitives::v2::Id as ParaId;
use runtime_parachains::{
configuration::{self, HostConfiguration},
dmp,
};
use sp_std::{marker::PhantomData, prelude::*};
use xcm::prelude::*;
use SendError::*;

/// Simple value-bearing trait for determining/expressing the assets required to be paid for a
/// messages to be delivered to a parachain.
pub trait PriceForParachainDelivery {
gavofyork marked this conversation as resolved.
Show resolved Hide resolved
/// Return the assets required to deliver `message` to the given `para` destination.
fn price_for_parachain_delivery(para: ParaId, message: &Xcm<()>) -> MultiAssets;
}
impl PriceForParachainDelivery for () {
fn price_for_parachain_delivery(_: ParaId, _: &Xcm<()>) -> MultiAssets {
MultiAssets::new()
}
}

/// Implementation of `PriceForParachainDelivery` which returns a fixed price.
pub struct ConstantPrice<T>(sp_std::marker::PhantomData<T>);
impl<T: Get<MultiAssets>> PriceForParachainDelivery for ConstantPrice<T> {
fn price_for_parachain_delivery(_: ParaId, _: &Xcm<()>) -> MultiAssets {
T::get()
}
}

/// XCM sender for relay chain. It only sends downward message.
pub struct ChildParachainRouter<T, W>(PhantomData<(T, W)>);
pub struct ChildParachainRouter<T, W, P>(PhantomData<(T, W, P)>);

impl<T: configuration::Config + dmp::Config, W: xcm::WrapVersion> SendXcm
for ChildParachainRouter<T, W>
impl<T: configuration::Config + dmp::Config, W: xcm::WrapVersion, P: PriceForParachainDelivery>
SendXcm for ChildParachainRouter<T, W, P>
{
fn send_xcm(dest: impl Into<MultiLocation>, msg: Xcm<()>) -> SendResult {
let dest = dest.into();
match dest {
MultiLocation { parents: 0, interior: X1(Parachain(id)) } => {
// Downward message passing.
let versioned_xcm =
W::wrap_version(&dest, msg).map_err(|()| SendError::DestinationUnsupported)?;
let config = <configuration::Pallet<T>>::config();
<dmp::Pallet<T>>::queue_downward_message(
&config,
id.into(),
versioned_xcm.encode(),
)
.map_err(Into::<SendError>::into)?;
Ok(())
},
dest => Err(SendError::CannotReachDestination(dest, msg)),
}
type Ticket = (HostConfiguration<T::BlockNumber>, ParaId, Vec<u8>);

fn validate(
dest: &mut Option<MultiLocation>,
msg: &mut Option<Xcm<()>>,
) -> SendResult<(HostConfiguration<T::BlockNumber>, ParaId, Vec<u8>)> {
let d = dest.take().ok_or(MissingArgument)?;
let id = if let MultiLocation { parents: 0, interior: X1(Parachain(id)) } = &d {
*id
} else {
*dest = Some(d);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read both the trait definition and skimmed this code, but it is unclear to me why this is being mutated (i.e. why the function has side effects) despite returning an error..

return Err(NotApplicable)
};

// Downward message passing.
let xcm = msg.take().ok_or(MissingArgument)?;
let config = <configuration::Pallet<T>>::config();
KiChjang marked this conversation as resolved.
Show resolved Hide resolved
let para = id.into();
let price = P::price_for_parachain_delivery(para, &xcm);
let blob = W::wrap_version(&d, xcm).map_err(|()| DestinationUnsupported)?.encode();
<dmp::Pallet<T>>::can_queue_downward_message(&config, &para, &blob)
.map_err(Into::<SendError>::into)?;

Ok(((config, para, blob), price))
}

fn deliver(
(config, para, blob): (HostConfiguration<T::BlockNumber>, ParaId, Vec<u8>),
) -> Result<XcmHash, SendError> {
let hash = sp_io::hashing::blake2_256(&blob[..]);
<dmp::Pallet<T>>::queue_downward_message(&config, para, blob)
.map(|()| hash)
.map_err(|_| SendError::Transport(&"Error placing into DMP queue"))
}
}
44 changes: 30 additions & 14 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,9 @@ pub type Migrations = (
pallet_staking::migrations::v13::MigrateToV13<Runtime>,
parachains_disputes::migration::v1::MigrateToV1<Runtime>,
parachains_configuration::migration::v4::MigrateToV4<Runtime>,
// "Use 2D weights in XCM v3" <https://github.com/paritytech/polkadot/pull/6134>
pallet_xcm::migration::v1::MigrateToV1<Runtime>,
parachains_ump::migration::v1::MigrateToV1<Runtime>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down Expand Up @@ -1576,6 +1579,7 @@ mod benches {
[pallet_vesting, Vesting]
[pallet_whitelist, Whitelist]
// XCM
[pallet_xcm, XcmPallet]
[pallet_xcm_benchmarks::fungible, pallet_xcm_benchmarks::fungible::Pallet::<Runtime>]
[pallet_xcm_benchmarks::generic, pallet_xcm_benchmarks::generic::Pallet::<Runtime>]
);
Expand Down Expand Up @@ -1978,7 +1982,9 @@ sp_api::impl_runtime_apis! {
use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench;
use frame_benchmarking::baseline::Pallet as Baseline;
use xcm::latest::prelude::*;
use xcm_config::{CheckAccount, KsmLocation, SovereignAccountOf, Statemine, XcmConfig};
use xcm_config::{
LocalCheckAccount, SovereignAccountOf, Statemine, TokenLocation, XcmConfig,
};

impl pallet_session_benchmarking::Config for Runtime {}
impl pallet_offences_benchmarking::Config for Runtime {}
Expand All @@ -1993,10 +1999,10 @@ sp_api::impl_runtime_apis! {
fn valid_destination() -> Result<MultiLocation, BenchmarkError> {
Ok(Statemine::get())
}
fn worst_case_holding() -> MultiAssets {
fn worst_case_holding(_depositable_count: u32) -> MultiAssets {
// Kusama only knows about KSM.
vec![MultiAsset{
id: Concrete(KsmLocation::get()),
id: Concrete(TokenLocation::get()),
fun: Fungible(1_000_000 * UNITS),
}].into()
}
Expand All @@ -2005,24 +2011,19 @@ sp_api::impl_runtime_apis! {
parameter_types! {
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
Statemine::get(),
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(KsmLocation::get()) },
));
pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = Some((
Statemine::get(),
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(KsmLocation::get()) },
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(TokenLocation::get()) },
));
}

impl pallet_xcm_benchmarks::fungible::Config for Runtime {
type TransactAsset = Balances;

type CheckedAccount = CheckAccount;
type CheckedAccount = LocalCheckAccount;
type TrustedTeleporter = TrustedTeleporter;
type TrustedReserve = TrustedReserve;

fn get_multi_asset() -> MultiAsset {
MultiAsset {
id: Concrete(KsmLocation::get()),
id: Concrete(TokenLocation::get()),
fun: Fungible(1 * UNITS),
}
}
Expand All @@ -2035,8 +2036,18 @@ sp_api::impl_runtime_apis! {
(0u64, Response::Version(Default::default()))
}

fn transact_origin() -> Result<MultiLocation, BenchmarkError> {
Ok(Statemine::get())
fn worst_case_asset_exchange() -> Result<(MultiAssets, MultiAssets), BenchmarkError> {
// Kusama doesn't support asset exchanges
Err(BenchmarkError::Skip)
}

fn universal_alias() -> Result<Junction, BenchmarkError> {
// The XCM executor of Kusama doesn't have a configured `UniversalAliases`
Err(BenchmarkError::Skip)
}

fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> {
Ok((Statemine::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
}

fn subscribe_origin() -> Result<MultiLocation, BenchmarkError> {
Expand All @@ -2045,10 +2056,15 @@ sp_api::impl_runtime_apis! {

fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> {
let origin = Statemine::get();
let assets: MultiAssets = (Concrete(KsmLocation::get()), 1_000 * UNITS).into();
let assets: MultiAssets = (Concrete(TokenLocation::get()), 1_000 * UNITS).into();
let ticket = MultiLocation { parents: 0, interior: Here };
Ok((origin, ticket, assets))
}

fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
// Kusama doesn't support asset locking
Err(BenchmarkError::Skip)
}
}

let whitelist: Vec<TrackedStorageKey> = vec![
Expand Down
1 change: 1 addition & 0 deletions runtime/kusama/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub mod pallet_treasury;
pub mod pallet_utility;
pub mod pallet_vesting;
pub mod pallet_whitelist;
pub mod pallet_xcm;
pub mod runtime_common_auctions;
pub mod runtime_common_claims;
pub mod runtime_common_crowdloan;
Expand Down
Loading