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

Commit

Permalink
Merge remote-tracking branch 'origin/gav-xcm-v3' into bko-gav-xcm-v3-…
Browse files Browse the repository at this point in the history
…bench
  • Loading branch information
bkontur committed Jan 2, 2023
2 parents e16273a + 7f3727f commit 79531a0
Show file tree
Hide file tree
Showing 91 changed files with 2,808 additions and 2,758 deletions.
538 changes: 269 additions & 269 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"

[dependencies]
clap = { version = "4.0.29", features = ["derive"] }
clap = { version = "4.0.32", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
url = "2.3.1"

Expand Down
2 changes: 1 addition & 1 deletion client/consensus/aura/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"

[dependencies]
async-trait = "0.1.59"
async-trait = "0.1.60"
codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] }
futures = "0.3.25"
tracing = "0.1.37"
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"

[dependencies]
async-trait = "0.1.59"
async-trait = "0.1.60"
codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] }
dyn-clone = "1.0.10"
futures = "0.3.25"
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/relay-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"

[dependencies]
async-trait = "0.1.59"
async-trait = "0.1.60"
futures = "0.3.25"
parking_lot = "0.12.1"
tracing = "0.1.37"
Expand Down
2 changes: 1 addition & 1 deletion client/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description = "Cumulus-specific networking protocol"
edition = "2021"

[dependencies]
async-trait = "0.1.59"
async-trait = "0.1.60"
codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] }
futures = "0.3.25"
futures-timer = "3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion client/relay-chain-inprocess-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
async-trait = "0.1.59"
async-trait = "0.1.60"
futures = "0.3.25"
futures-timer = "3.0.2"

Expand Down
2 changes: 1 addition & 1 deletion client/relay-chain-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "mas

tokio = { version = "1.21.2", features = ["sync"] }
futures = "0.3.25"
async-trait = "0.1.59"
async-trait = "0.1.60"
thiserror = "1.0.38"
jsonrpsee-core = "0.16.2"
parity-scale-codec = "3.2.1"
2 changes: 1 addition & 1 deletion client/relay-chain-minimal-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cumulus-primitives-core = { path = "../../primitives/core" }
array-bytes = "6.0"
lru = "0.8"
tracing = "0.1.37"
async-trait = "0.1.59"
async-trait = "0.1.60"
futures = "0.3.25"
url = "2.2.2"
tokio = { version = "1.23.0", features = ["macros"] }
4 changes: 2 additions & 2 deletions client/relay-chain-rpc-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ futures-timer = "3.0.2"
parity-scale-codec = "3.2.1"
jsonrpsee = { version = "0.16.2", features = ["ws-client"] }
tracing = "0.1.37"
async-trait = "0.1.59"
async-trait = "0.1.60"
url = "2.3.1"
serde_json = "1.0.91"
serde = "1.0.151"
serde = "1.0.152"
lru = "0.8.1"
4 changes: 2 additions & 2 deletions parachain-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ edition = "2021"
build = "build.rs"

[dependencies]
clap = { version = "4.0.29", features = ["derive"] }
clap = { version = "4.0.32", features = ["derive"] }
log = "0.4.17"
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.151", features = ["derive"] }
serde = { version = "1.0.152", features = ["derive"] }
jsonrpsee = { version = "0.16.2", features = ["server"] }

# Local
Expand Down
116 changes: 90 additions & 26 deletions parachains/integration-tests/collectives/0_xcm/1_teleport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,40 @@ settings:
wsPort: 9710
paraId: &cp_id 1001
variables:
xcm_version: &xcm_version '2'
weight_to_send_teleport: &weight_to_send_teleport 2,000,000,000 # must be same for both chains
weight_to_receive_teleport: &weight_to_receive_teleport 4,000,000,000 # must be same for both chains
chains:
accounts:
alice_signer: &alice_signer //Alice
alice_account32: &alice_acc32 '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
alice_ss58: &acc_alice_ss58 '15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5'
accounts:
alice_signer: &acc_alice_signer //Alice
alice_account32: &acc_alice_acc32 '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
alice_ss58: &acc_alice_ss58 '15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5'

tests:
- name: Teleport assets from Relay Chain to Collectives Parachain successful
- name: Teleport assets from Relay Chain to Collectives Parachain successful.
before:
- name: Get the Alice balances on Relay & Collectives Chains.
actions:
- queries:
balance_rc_alice_1:
chain: *relay_chain
pallet: system
call: account
args: [ *acc_alice_acc32 ]
balance_cp_alice_1:
chain: *collectives_parachain
pallet: system
call: account
args: [ *acc_alice_acc32 ]
its:
- name: Teleport assets from Relay Chain to Collectives Parachain
actions:
- extrinsics:
- chain: *relay_chain
signer: *alice_signer
signer: *acc_alice_signer
pallet: xcmPallet
call: teleportAssets
args: [
{ v1: { 0, interior: { x1: { parachain: *cp_id }}}}, # destination
{ v1: { parents: 0, interior: { x1: { accountId32: { network: { any: true }, id: *alice_acc32 }}}}}, # beneficiary
{ v1: { parents: 0, interior: { x1: { accountId32: { network: { any: true }, id: *acc_alice_acc32 }}}}}, # beneficiary
{
v1: [
# {
Expand All @@ -53,33 +65,56 @@ tests:
xcmOutcome: Complete
# the weight must be static
value: *weight_to_send_teleport
- name: balances.Deposit
chain: *collectives_parachain
attributes:
- type: u128
# TODO (P2)
# Flaky assert since sent assets used to pay a fee
# query and assert Alice balance before and after teleport (see example in kick_member test)
# drop this event assert
value: 19,999,953,648,988 # amount received
- name: dmpQueue.ExecutedDownward
chain: *collectives_parachain
attributes:
- type: XcmV2TraitsOutcome
xcmOutcome: Complete
# the weight must be static
value: *weight_to_receive_teleport
- queries:
balance_rc_alice_2:
chain: *relay_chain
pallet: system
call: account
args: [ *acc_alice_acc32 ]
balance_cp_alice_2:
chain: *collectives_parachain
pallet: system
call: account
args: [ *acc_alice_acc32 ]
- name: Alice deposit check, balance decreased on Relay Chain, increased on Collectives.
actions:
- asserts:
balanceDecreased:
args: [
{
balances: {
before: $balance_rc_alice_1,
after: $balance_rc_alice_2,
}
}
]
balanceIncreased:
args: [
{
balances: {
before: $balance_cp_alice_1,
after: $balance_cp_alice_2,
}
}
]

- name: Teleport assets from Collectives Parachain to Relay Chain successful
actions:
- extrinsics:
- chain: *collectives_parachain
signer: *alice_signer
signer: *acc_alice_signer
pallet: polkadotXcm
call: teleportAssets
args: [
{ v1: { parents: 1, interior: { here: true }}}, # destination
{ v1: { parents: 0, interior: { x1: { accountId32: { network: { any: true }, id: *alice_acc32 }}}}}, # beneficiary
{ v1: { parents: 0, interior: { x1: { accountId32: { network: { any: true }, id: *acc_alice_acc32 }}}}}, # beneficiary
{
v1: [
{
Expand All @@ -90,9 +125,7 @@ tests:
}, # assets
0, # feeAssetItem
]
events:
# TODO assert balance.Deposit event on relay chain
# not possible now / issue - https://github.com/paritytech/parachains-integration-tests/issues/58
events:
- name: balances.Withdraw
attributes:
- type: AccountId32
Expand Down Expand Up @@ -120,7 +153,38 @@ tests:
xcmOutcome: Complete
# the weight must be static
value: *weight_to_receive_teleport
- queries:
balance_rc_alice_3:
chain: *relay_chain
pallet: system
call: account
args: [ *acc_alice_acc32 ]
balance_cp_alice_3:
chain: *collectives_parachain
pallet: system
call: account
args: [ *acc_alice_acc32 ]

# TODO (P2) assert Alice balance before and after teleport (see example in kick_member test)

#TODO (P1) test: teleport of non relay chain assets fails
- name: Alice deposit check, balance decreased on Collectives, increased on Relay Chain.
actions:
- asserts:
balanceDecreased:
args: [
{
balances: {
before: $balance_cp_alice_2,
after: $balance_cp_alice_3,
}
}
]
balanceIncreased:
args: [
{
balances: {
before: $balance_rc_alice_2,
after: $balance_rc_alice_3,
}
}
]
# TODO (P2) assert Alice balance before and after teleport (see example in kick_member test)
# TODO (P1) test: teleport of non relay chain assets fails
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ settings:
[
*acc_liam_acc32,
*acc_olivia_acc32,
*acc_noah_acc32
],
[
*acc_noah_acc32,
*acc_emma_acc32,
*acc_james_acc32,
*acc_ava_acc32
Expand All @@ -58,7 +56,6 @@ settings:
*acc_ava_acc32,
*acc_mia_acc32
],
[],
[]
]
disband:
Expand All @@ -67,7 +64,7 @@ settings:
call: disband
args: [
{
votingMembers: 6,
fellowMembers: 6,
allyMembers: 1
}
]
Expand Down Expand Up @@ -185,7 +182,7 @@ tests:
chain: *collectives_parachain
attributes:
- type: u32
key: votingMembers
key: fellowMembers
value: 6
- type: u32
key: allyMembers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ settings:
init_teleport_amount: &init_teleport_amount 20000000000000 # 20_000_000_000_000
weight_to_send_teleport: &weight_to_send_teleport 2,000,000,000 # must be same for both chains
weight_to_receive_teleport: &weight_to_receive_teleport 4,000,000,000 # must be same for both chains
weight_to_receive_transact: &weight_to_receive_transact 3,000,000,000 # must be same for both chains
accounts:
alice_signer: &acc_alice_signer //Alice
treasury_account32: &acc_treasury_acc32 '0x6d6f646c70792f74727372790000000000000000000000000000000000000000'
Expand Down Expand Up @@ -134,7 +135,7 @@ tests:
{
Transact: {
originType: Superuser,
requireWeightAtMost: 1000000000,
requireWeightAtMost: 2000000000,
call: $alliance_kick_member
}
}
Expand All @@ -159,7 +160,7 @@ tests:
- type: XcmV2TraitsOutcome
xcmOutcome: Complete
# must be static
value: *weight_to_send_teleport
value: *weight_to_receive_transact

- queries:
balance_rc_treasury_after:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! Autogenerated weights for `cumulus_pallet_xcmp_queue`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-12-05, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2022-12-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024

Expand Down Expand Up @@ -48,16 +48,16 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo<T> {
// Storage: XcmpQueue QueueConfig (r:1 w:1)
fn set_config_with_u32() -> Weight {
// Minimum execution time: 7_953 nanoseconds.
Weight::from_ref_time(8_268_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
// Minimum execution time: 6_844 nanoseconds.
Weight::from_ref_time(7_122_000)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: XcmpQueue QueueConfig (r:1 w:1)
fn set_config_with_weight() -> Weight {
// Minimum execution time: 7_825 nanoseconds.
Weight::from_ref_time(8_190_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
// Minimum execution time: 6_960 nanoseconds.
Weight::from_ref_time(7_173_000)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
}
Loading

0 comments on commit 79531a0

Please sign in to comment.