Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add statemine #24

Merged
merged 169 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
aa67a43
rustc grumbles
joepetrowski Nov 17, 2022
9ab1739
add second instance
joepetrowski Nov 17, 2022
df40d77
leave some todos
joepetrowski Nov 17, 2022
94717a4
fix AssetsToBlockAuthor
joepetrowski Nov 17, 2022
47d96e0
make it almost compile
joepetrowski Nov 18, 2022
1e0515e
make it actually compile
joepetrowski Nov 18, 2022
6de6313
fix logical error
joepetrowski Nov 18, 2022
35d1e57
cargo fmt to resolve duplicate imports on merge
joepetrowski Nov 18, 2022
362a907
fix deps to make compile
joepetrowski Nov 18, 2022
b8ed7e7
fmt
joepetrowski Nov 18, 2022
633366b
(pallet-assets/pallet-asset-tx-payment) pathched with `sv-locked-for-…
bkontur Nov 21, 2022
5f7f8c2
statemine progress
joepetrowski Nov 22, 2022
e8afde4
ForeignCreators :tada:
joepetrowski Nov 22, 2022
e569b68
fix AssetFeeAsExistentialDepositMultiplier
joepetrowski Nov 30, 2022
c487586
no default instance
joepetrowski Nov 30, 2022
4191a4d
instantiate statemint
joepetrowski Dec 1, 2022
d9d5a9d
compile tests
bkontur Dec 22, 2022
4a9dec9
Init of pallet with `transfer_asset_via_bridge` call
bkontur Nov 11, 2022
39ba564
Init of pallet with `transfer_asset_via_bridge` call
bkontur Dec 14, 2022
c675531
Box wrap inputs
bkontur Dec 19, 2022
e127426
Added withdraw/deposit to bridge's reserve account
bkontur Dec 19, 2022
a7dd1fc
TODO: temporary hack pipelines because of https://github.com/parityte…
bkontur Dec 21, 2022
2ff5c4f
Allow receive bridged Xcm::Trap on Westmint
bkontur Jan 4, 2023
18ad58b
Allow (temporary) Statemine send xcm messages
bkontur Jan 4, 2023
fe7817e
refactor TrustedBridgedNetworks
bkontur Jan 4, 2023
a80781e
Allow (hacky) xcm::transact for remark/remark_with_event
bkontur Jan 4, 2023
0985898
Unit-test for Statemine - send_xcm_transact_with_remark_with_event_works
bkontur Jan 5, 2023
c3195d2
Fix for BridgedSignedAccountId32AsNative
bkontur Jan 5, 2023
3353263
don't rename pallet in runtime
joepetrowski Jan 11, 2023
9e211b8
don't rename and fix tests
joepetrowski Jan 11, 2023
31bc1c6
Added `allowed_target_location` + reanchored assets/destination + tests
bkontur Jan 12, 2023
25c2fc5
fix benchmark helper
joepetrowski Jan 12, 2023
a4a581b
fix benchmark build
joepetrowski Jan 12, 2023
7fbfeb3
Merge remote-tracking branch 'origin/joe-bridge-hub-westmint-assets' …
bkontur Jan 12, 2023
9cd2708
more benchmark fixes
joepetrowski Jan 12, 2023
23f9e4d
Merge remote-tracking branch 'origin/joe-bridge-hub-westmint-assets' …
bkontur Jan 12, 2023
81e9703
fix penpal and rococo
joepetrowski Jan 12, 2023
4365baa
Merge branch 'bridge-hub-base' into joe-bridge-hub-westmint-assets
bkontur Jan 15, 2023
f2c3569
Merge remote-tracking branch 'origin/joe-bridge-hub-westmint-assets' …
bkontur Jan 15, 2023
0c3f3b7
update BenchmarkHelper interface
joepetrowski Jan 17, 2023
c3d2108
fmt
joepetrowski Jan 17, 2023
0d75123
Merge remote-tracking branch 'origin/master' into joe-bridge-hub-west…
bkontur Jan 21, 2023
1d6fff4
Merge branch 'joe-bridge-hub-westmint-assets' into bko-transfer-asset…
bkontur Jan 21, 2023
8d809e4
Added weight `export_message` to statemint because of `pallet_xcm.send`
bkontur Jan 22, 2023
81abe45
add foreign assets to westmint
joepetrowski Jan 24, 2023
0da76e0
add foreign assets to statemine
joepetrowski Jan 24, 2023
57a2f00
Merge remote-tracking branch 'origin/master' into bko-transfer-asset-…
bkontur Jan 25, 2023
1ae22a7
Merge remote-tracking branch 'origin/master' into bko-transfer-asset-…
bkontur Jan 30, 2023
af4fe56
Governance can call `xcm:Transact` with bridges configuration management
bkontur Jan 30, 2023
063fef0
Merge remote-tracking branch 'origin/master' into joe-foreign-assets
Jan 30, 2023
bf2e4d3
Merge remote-tracking branch 'origin/joe-foreign-assets' into bko-tra…
bkontur Jan 30, 2023
78175ba
Revert temporary disabled `scripts/ci/gitlab/pipeline/test.yml`
bkontur Jan 30, 2023
761a500
Unit-test for handling `ReserveAssetDeposited` on Westmint for Foreig…
bkontur Feb 1, 2023
bc4664b
Merge remote-tracking branch 'origin/master' into joe-foreign-assets
Feb 9, 2023
b534445
Merge remote-tracking branch 'origin/master' into joe-foreign-assets
Feb 10, 2023
0590241
use updated api for ensure origin trait
muharem Feb 13, 2023
a1ce9b8
Merge remote-tracking branch 'origin/master' into joe-foreign-assets
Feb 23, 2023
0f80e76
Merge remote-tracking branch 'origin/master' into joe-foreign-assets
Feb 28, 2023
ae8cac6
Merge remote-tracking branch 'origin/master' into joe-foreign-assets
bkontur Mar 3, 2023
1b21403
Merge remote-tracking branch 'origin/master' into joe-foreign-assets
Mar 3, 2023
5cb396f
Merge remote-tracking branch 'origin/master' into joe-foreign-assets
Mar 8, 2023
56abaf5
Merge remote-tracking branch 'origin/master' into joe-foreign-assets
Mar 10, 2023
d5b71a7
Benchmarks for pallet-bridge-assets-transfer (#2316)
svyatonik Mar 15, 2023
4f70058
Merge remote-tracking branch 'origin/master' into joe-foreign-assets
Mar 15, 2023
60a6089
Assets/ForeignAssets tests and fixes (#2167)
bkontur Mar 16, 2023
018b800
Added `StartsWithExplicitGlobalConsensus` to ignores (#2338)
bkontur Mar 16, 2023
08bfe99
Merge remote-tracking branch 'origin/joe-foreign-assets' into bko-tra…
bkontur Mar 16, 2023
48b6877
Change to correct weight file for pallet_bridge_assets_transfer
bkontur Mar 17, 2023
c16f96d
Renamed `pallet-bridge-assets-transfer` to `pallet-bridge-transfer`
bkontur Mar 17, 2023
32a09c7
from_ref_time to from_parts
bkontur Mar 17, 2023
137ee81
".git/.scripts/commands/bench/bench.sh" pallet statemine assets palle…
Mar 17, 2023
36751ae
Added `ping_via_bridge`
bkontur Mar 19, 2023
b550a8e
".git/.scripts/commands/bench/bench.sh" pallet statemine assets palle…
Mar 19, 2023
47e0283
Merge remote-tracking branch 'origin/master' into joe-foreign-assets
Mar 20, 2023
a4e2b93
Fix test
bkontur Mar 20, 2023
ad13281
Merge remote-tracking branch 'origin/joe-foreign-assets' into bko-tra…
Mar 20, 2023
eff26cd
Revert not needed stuff
bkontur Mar 20, 2023
65fe38b
Added test-case `can_governance_change_bridge_transfer_configuration`
bkontur Mar 20, 2023
bc5a3ed
Added test `initiate_transfer_asset_via_bridge_for_native_asset_works`
bkontur Mar 21, 2023
ec44e0d
Merge remote-tracking branch 'origin/master' into bko-transfer-asset-…
bkontur Mar 23, 2023
abe9ad2
Fix compilation
bkontur Mar 24, 2023
98c09fa
Small fixes
bkontur Mar 24, 2023
d712d42
Added support for paid or unpaid execution by configuration
bkontur Mar 24, 2023
8dfe3b6
Merge remote-tracking branch 'origin/master' into bko-transfer-asset-…
bkontur Mar 24, 2023
a757c38
Merge remote-tracking branch 'origin/master' into bko-transfer-asset-…
Mar 27, 2023
a3eb549
Removed stuff
bkontur Mar 27, 2023
7d4319d
Bump futures from 0.3.26 to 0.3.27 (#2359)
dependabot[bot] Mar 27, 2023
ea6598c
Bump clap from 4.1.11 to 4.1.13 (#2388)
dependabot[bot] Mar 27, 2023
35d79f3
Remove HeaderBackend from RelayChainRPCClient (#2385)
skunert Mar 28, 2023
e0a27e6
Added `receive_reserve_asset_deposited_from_different_consensus_works`
bkontur Mar 27, 2023
0ef1444
Bump scale-info from 2.3.1 to 2.4.0 (#2386)
dependabot[bot] Mar 28, 2023
72d4010
Renamed Bridges -> AllowedExporters
bkontur Mar 28, 2023
066db6b
Bump serde_json from 1.0.94 to 1.0.95 (#2387)
dependabot[bot] Mar 28, 2023
1d8208b
Companion: wasm-builder support stable Rust (#2393)
bkchr Mar 29, 2023
99fca26
Added `IsReserve` handling for `ReserveAssetDeposited` + benchmarks
bkontur Mar 29, 2023
559f3ca
Bump thiserror from 1.0.38 to 1.0.40 (#2396)
dependabot[bot] Mar 29, 2023
bfaa974
Fix compile
bkontur Mar 29, 2023
1c459ed
Merge branch 'master' of https://github.com/paritytech/cumulus into HEAD
Mar 29, 2023
3bf39cf
".git/.scripts/commands/bench/bench.sh" pallet statemine assets palle…
Mar 29, 2023
69dd6ae
Bump syn from 1.0.109 to 2.0.9 (#2397)
dependabot[bot] Mar 29, 2023
247e843
Bump serde from 1.0.156 to 1.0.159 (#2395)
dependabot[bot] Mar 29, 2023
2ce882f
Companion for https://github.com/paritytech/substrate/pull/13725 (#2401)
altonen Mar 30, 2023
3ce4e83
Bump syn from 2.0.9 to 2.0.11 (#2405)
dependabot[bot] Mar 30, 2023
693e973
Bump scale-info from 2.4.0 to 2.5.0 (#2404)
dependabot[bot] Mar 30, 2023
f5340e7
Bump tempfile from 3.4.0 to 3.5.0 (#2406)
dependabot[bot] Mar 30, 2023
337bd17
bump zombienet version (#2411)
pepoviola Mar 30, 2023
f76ba2b
Fix conditional benchmarking
bkontur Mar 30, 2023
8bcceb6
Merge branch 'master' of https://github.com/paritytech/cumulus into HEAD
Mar 30, 2023
45ca89b
".git/.scripts/commands/bench/bench.sh" pallet statemine assets palle…
Mar 30, 2023
727b348
".git/.scripts/commands/bench/bench.sh" pallet westmint assets pallet…
Mar 30, 2023
826e1aa
Bump tokio from 1.26.0 to 1.27.0 (#2413)
dependabot[bot] Mar 31, 2023
a92aeb3
Change test weights
bkontur Mar 31, 2023
93d9b6a
Bump syn from 2.0.11 to 2.0.12 (#2414)
dependabot[bot] Mar 31, 2023
b1cd3d5
Bump proc-macro2 from 1.0.52 to 1.0.54 (#2415)
dependabot[bot] Mar 31, 2023
9106fa8
Companion PR for contract deletion updates (#2409)
pgherveou Mar 31, 2023
b82d6b1
Fix SafeCallFilter for westmint
bkontur Mar 31, 2023
e5035c8
Allow arbitrary key-values in RelayStateSproofBuilder (#2407)
tmpolaczyk Mar 31, 2023
e5d994b
help text examples + clean up (#2418)
skunert Apr 1, 2023
e67094e
Bump futures from 0.3.27 to 0.3.28 (#2420)
dependabot[bot] Apr 1, 2023
6bdcf1f
Bump clap from 4.1.13 to 4.1.14 (#2421)
dependabot[bot] Apr 1, 2023
66bfb2c
Update Substrate & Polkadot (#2422)
bkchr Apr 3, 2023
d12c6d0
Bump syn from 2.0.12 to 2.0.13 (#2428)
dependabot[bot] Apr 3, 2023
697f0cd
Bump hex-literal from 0.3.4 to 0.4.0 (#2426)
dependabot[bot] Apr 3, 2023
53c6b8d
Companion for #6986 (#2416)
bkontur Apr 4, 2023
7fd80c7
Merge remote-tracking branch 'origin/master' into bko-transfer-asset-…
bkontur Apr 4, 2023
5ed3677
[backport] weights 9400 (#2425)
EgorPopelyaev Apr 4, 2023
e25e1ef
Use send_xcm and add cost to event
bkontur Apr 4, 2023
88ead41
Cleanup: Remove polkadot-service dependency from minimal node (#2430)
skunert Apr 4, 2023
2cbaa39
Co #13699: Remove old calls (#2431)
ggwpez Apr 4, 2023
b49628f
[Backport] version bumps 9400 (#2424)
EgorPopelyaev Apr 5, 2023
77ad776
Refactor to support multiple MultiAsset + cleaning
bkontur Apr 5, 2023
b3edf24
Merge remote-tracking branch 'origin/master' into bko-transfer-asset-…
Apr 5, 2023
e6bd54a
".git/.scripts/commands/bench/bench.sh" xcm westmint assets pallet_xc…
Apr 5, 2023
98f6ca7
Bump hex-literal from 0.4.0 to 0.4.1 (#2434)
dependabot[bot] Apr 5, 2023
a5a79db
Updated bridge-hub-polkadot.json (#2435)
bkontur Apr 6, 2023
b0715f9
The Polkadot Fellowship import (#2236)
muharem Apr 9, 2023
03763dd
Companion for #13302 (#2357)
lexnv Apr 11, 2023
b4a50e2
use stable rust toolchain in ci
Apr 11, 2023
4733416
Bump syn from 2.0.13 to 2.0.14 (#2446)
dependabot[bot] Apr 12, 2023
5a0ebad
Bump serde from 1.0.159 to 1.0.160 (#2445)
dependabot[bot] Apr 12, 2023
030db02
Invoke cargo build commands with `--locked` (#2444)
Apr 12, 2023
df9ed24
Bump actions/checkout from 3.1.0 to 3.5.1 (#2448)
dependabot[bot] Apr 12, 2023
71d427f
Updated doc
bkontur Apr 13, 2023
73bdbdc
Merge remote-tracking branch 'origin/master' into bko-transfer-asset-…
Apr 13, 2023
574f425
Bump serde_json from 1.0.95 to 1.0.96 (#2453)
dependabot[bot] Apr 13, 2023
b42855d
Bump actions/checkout from 3.5.1 to 3.5.2 (#2452)
dependabot[bot] Apr 14, 2023
a26ebb2
Bump syn from 2.0.14 to 2.0.15 (#2454)
dependabot[bot] Apr 14, 2023
863e94d
Bump assert_cmd from 2.0.10 to 2.0.11 (#2457)
dependabot[bot] Apr 15, 2023
72349fc
Changed `query_account_balances` return type (#2455)
bkontur Apr 17, 2023
926799c
Companion for substrate#13883 (#2460)
andresilva Apr 18, 2023
3de5354
Optimize level monitor reconstruction (#2461)
davxy Apr 19, 2023
4449044
Bump clap from 4.1.14 to 4.2.3 (#2465)
dependabot[bot] Apr 19, 2023
ea44f8c
Bump Swatinem/rust-cache from 2.2.0 to 2.2.1 (#2456)
dependabot[bot] Apr 19, 2023
d403b49
Companion for substrate#13771 (#2410)
muharem Apr 19, 2023
eced0cb
Parachain node should not recover blocks while syncing (#2462)
skunert Apr 19, 2023
56644eb
Address review comments
serban300 Apr 20, 2023
8615ac8
[Polkadot Companion] for 7101 (#2470)
mrcnski Apr 21, 2023
5170168
Merge remote-tracking branch 'origin/master' into bko-transfer-asset-…
Apr 24, 2023
2c1dd4f
Align BridgeHub runtimes with other SP runtimes + reused test for tel…
bkontur Apr 24, 2023
5c479b7
Extract runtime_para_id for test
bkontur Apr 19, 2023
ad2fa5c
Typos
bkontur Apr 19, 2023
7bba7f0
Added helper for `execute_as_governance`
bkontur Apr 20, 2023
e58b442
Merge remote-tracking branch 'origin/master' into bko-transfer-asset-…
bkontur Apr 24, 2023
2e33b87
Fix test because `UnpaidRemoteExporter` adds now `UnpaidExecution` in…
bkontur Apr 24, 2023
43ee627
Use `execute_as_governance` function
bkontur Apr 24, 2023
2637a64
merge from bko-transfer-asset-via-bridge
alistair-singh May 11, 2023
d3bccec
typos
alistair-singh May 10, 2023
5632fa3
modified lock
alistair-singh May 11, 2023
94c880c
revert to parity/master
alistair-singh May 11, 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
13 changes: 10 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ for `release-parachains-v0.9.270`
5. Clone `it/release-<version>-fast-sudo` from Polkadot
In case the branch does not exists (it is a manual process): cherry pick paritytech/polkadot@791c8b8 and run
`find . -type f -name "*.toml" -print0 | xargs -0 sed -i '' -e 's/polkadot-vX.X.X/polkadot-v<version>/g'`
6. `cargo build --release features --fast-runtime`
6. `cargo build --release --features fast-runtime`
7. Copy `./target/polkadot` into `./bin` (in Cumulus)
8. Run the tests:
- Statemint: `yarn zombienet-test -c ./examples/statemint/config.toml -t ./examples/statemint`
Expand Down
6 changes: 2 additions & 4 deletions pallets/parachain-system/src/validate_block/implementation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ use cumulus_primitives_core::{
};
use cumulus_primitives_parachain_inherent::ParachainInherentData;

use polkadot_parachain::primitives::{
HeadData, RelayChainBlockNumber, ValidationParams, ValidationResult,
};
use polkadot_parachain::primitives::{HeadData, RelayChainBlockNumber, ValidationResult};

use codec::Encode;

Expand Down Expand Up @@ -238,7 +236,7 @@ where
.expect("Could not find `set_validation_data` inherent")
}

/// Validate the given [`PersistedValidationData`] against the [`ValidationParams`].
/// Validate the given [`PersistedValidationData`] against the [`MemoryOptimizedValidationParams`].
fn validate_validation_data(
validation_data: &PersistedValidationData,
relay_parent_number: RelayChainBlockNumber,
Expand Down
6 changes: 3 additions & 3 deletions parachains/runtimes/assets/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ pub mod constants;
mod weights;
pub mod xcm_config;

use assets_common::{
foreign_creators::ForeignCreators, matching::FromSiblingParachain, MultiLocationForAssetId,
};
use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
use sp_api::impl_runtime_apis;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
Expand Down Expand Up @@ -75,9 +78,6 @@ use xcm_config::{
pub use sp_runtime::BuildStorage;

// Polkadot imports
use assets_common::{
foreign_creators::ForeignCreators, matching::FromSiblingParachain, MultiLocationForAssetId,
};
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
use xcm::latest::BodyId;
Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/assets/statemine/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ pub type Barrier = DenyThenTry<
(
// If the message is one that immediately attemps to pay for execution, then allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent and its plurality (i.e. governance bodies) gets free execution.
// Parent and its pluralities (i.e. governance bodies) get free execution.
AllowExplicitUnpaidExecutionFrom<ParentOrParentsPlurality>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentOrSiblings>,
Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/assets/statemint/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ pub type Barrier = DenyThenTry<
(
// If the message is one that immediately attemps to pay for execution, then allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent, its plurality (i.e. governance bodies) and Fellows plurality gets free execution.
// Parent, its pluralities (i.e. governance bodies), and the Fellows plurality get free execution.
AllowExplicitUnpaidExecutionFrom<(ParentOrParentsPlurality, FellowsPlurality)>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentOrSiblings>,
Expand Down
10 changes: 5 additions & 5 deletions parachains/runtimes/assets/test-utils/src/test_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ macro_rules! include_teleports_for_native_asset_works(
const BOB: [u8; 32] = [2u8; 32];
let target_account = parachains_common::AccountId::from(BOB);

asset_test_utils::test_cases::teleports_for_native_asset_works::<
$crate::test_cases::teleports_for_native_asset_works::<
$runtime,
$xcm_config,
$checking_account,
Expand Down Expand Up @@ -604,7 +604,7 @@ macro_rules! include_teleports_for_foreign_assets_works(
const SOME_ASSET_OWNER: [u8; 32] = [5u8; 32];
let asset_owner = parachains_common::AccountId::from(SOME_ASSET_OWNER);

asset_test_utils::test_cases::teleports_for_foreign_assets_works::<
$crate::test_cases::teleports_for_foreign_assets_works::<
$runtime,
$xcm_config,
$checking_account,
Expand Down Expand Up @@ -721,7 +721,7 @@ macro_rules! include_asset_transactor_transfer_with_local_consensus_currency_wor
const BOB: [u8; 32] = [2u8; 32];
let target_account = parachains_common::AccountId::from(BOB);

asset_test_utils::test_cases::asset_transactor_transfer_with_local_consensus_currency_works::<
$crate::test_cases::asset_transactor_transfer_with_local_consensus_currency_works::<
$runtime,
$xcm_config
>(
Expand Down Expand Up @@ -975,7 +975,7 @@ macro_rules! include_asset_transactor_transfer_with_pallet_assets_instance_works
const CHARLIE: [u8; 32] = [3u8; 32];
let charlie_account = parachains_common::AccountId::from(CHARLIE);

asset_test_utils::test_cases::asset_transactor_transfer_with_pallet_assets_instance_works::<
$crate::test_cases::asset_transactor_transfer_with_pallet_assets_instance_works::<
$runtime,
$xcm_config,
$assets_pallet_instance,
Expand Down Expand Up @@ -1304,7 +1304,7 @@ macro_rules! include_create_and_manage_foreign_assets_for_local_consensus_parach
const BOB: [u8; 32] = [2u8; 32];
let bob_account = parachains_common::AccountId::from(BOB);

asset_test_utils::test_cases::create_and_manage_foreign_assets_for_local_consensus_parachain_assets_works::<
$crate::test_cases::create_and_manage_foreign_assets_for_local_consensus_parachain_assets_works::<
$runtime,
$xcm_config,
$weight_to_fee,
Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/assets/westmint/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ pub type Barrier = DenyThenTry<
(
// If the message is one that immediately attemps to pay for execution, then allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent or its plurality (i.e. governance bodies) gets free execution.
// Parent and its pluralities (i.e. governance bodies) get free execution.
AllowExplicitUnpaidExecutionFrom<ParentOrParentsPlurality>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<Everything>,
Expand Down
5 changes: 3 additions & 2 deletions parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pallet-authorship = { git = "https://github.com/paritytech/substrate", default-f
pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
Expand Down Expand Up @@ -72,6 +71,9 @@ pallet-collator-selection = { path = "../../../../pallets/collator-selection", d
parachain-info = { path = "../../../../parachains/pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../../parachains/common", default-features = false }

[dev-dependencies]
bridge-hub-test-utils = { path = "../test-utils"}

[features]
default = [
"std",
Expand Down Expand Up @@ -100,7 +102,6 @@ std = [
"pallet-collator-selection/std",
"pallet-multisig/std",
"pallet-session/std",
"pallet-sudo/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
Expand Down
12 changes: 4 additions & 8 deletions parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ use xcm_config::{
#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;

// Polkadot imports
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};

use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};

use parachains_common::{
opaque, AccountId, Balance, BlockNumber, Hash, Header, Index, Signature,
impls::DealWithFees, opaque, AccountId, Balance, BlockNumber, Hash, Header, Index, Signature,
AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
};

// XCM Imports
use xcm::latest::prelude::BodyId;
use xcm_executor::XcmExecutor;
Expand Down Expand Up @@ -143,11 +143,6 @@ pub fn native_version() -> NativeVersion {

parameter_types! {
pub const Version: RuntimeVersion = VERSION;

// This part is copied from Substrate's `bin/node/runtime/src/lib.rs`.
// The `RuntimeBlockLength` and `RuntimeBlockWeights` exist here because the
// `DeletionWeightLimit` and `DeletionQueueDepth` depend on those to parameterize
// the lazy contract deletion.
pub RuntimeBlockLength: BlockLength =
BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()
Expand Down Expand Up @@ -264,7 +259,8 @@ parameter_types! {

impl pallet_transaction_payment::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;
type OnChargeTransaction =
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightToFee = WeightToFee;
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
Expand Down
21 changes: 10 additions & 11 deletions parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ use frame_support::{
};
use frame_system::EnsureRoot;
use pallet_xcm::XcmPassthrough;
use parachains_common::xcm_config::{
ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry,
use parachains_common::{
impls::ToStakingPot,
xcm_config::{ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry},
};
use polkadot_parachain::primitives::Sibling;
use polkadot_runtime_common::impls::ToAuthor;
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
Expand Down Expand Up @@ -96,17 +96,16 @@ pub type XcmOriginToTransactDispatchOrigin = (
// transaction from the Root origin.
ParentAsSuperuser<RuntimeOrigin>,
// Native signed account converter; this just converts an `AccountId32` origin into a normal
// `Origin::Signed` origin of the same 32-byte value.
// `RuntimeOrigin::Signed` origin of the same 32-byte value.
SignedAccountId32AsNative<RelayNetwork, RuntimeOrigin>,
// Xcm origins can be represented natively under the Xcm pallet's Xcm origin.
XcmPassthrough<RuntimeOrigin>,
);

match_types! {
// TODO: map gov2 origins here - after merge https://github.com/paritytech/cumulus/pull/1895
pub type ParentOrParentsExecutivePlurality: impl Contains<MultiLocation> = {
pub type ParentOrParentsPlurality: impl Contains<MultiLocation> = {
MultiLocation { parents: 1, interior: Here } |
MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
MultiLocation { parents: 1, interior: X1(Plurality { .. }) }
};
pub type ParentOrSiblings: impl Contains<MultiLocation> = {
MultiLocation { parents: 1, interior: Here } |
Expand Down Expand Up @@ -165,10 +164,10 @@ pub type Barrier = DenyThenTry<
AllowKnownQueryResponses<PolkadotXcm>,
WithComputedOrigin<
(
// Allow anything to pay for execution.
// If the message is one that immediately attemps to pay for execution, then allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent and its exec plurality get free execution.
AllowExplicitUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
// Parent and its pluralities (i.e. governance bodies) get free execution.
AllowExplicitUnpaidExecutionFrom<ParentOrParentsPlurality>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentOrSiblings>,
),
Expand Down Expand Up @@ -197,7 +196,7 @@ impl xcm_executor::Config for XcmConfig {
MaxInstructions,
>;
type Trader =
UsingComponents<WeightToFee, KsmRelayLocation, AccountId, Balances, ToAuthor<Runtime>>;
UsingComponents<WeightToFee, KsmRelayLocation, AccountId, Balances, ToStakingPot<Runtime>>;
type ResponseHandler = PolkadotXcm;
type AssetTrap = PolkadotXcm;
type AssetClaims = PolkadotXcm;
Expand Down
56 changes: 56 additions & 0 deletions parachains/runtimes/bridge-hubs/bridge-hub-kusama/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright 2023 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.

// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.

pub use bridge_hub_kusama_runtime::{
constants::fee::WeightToFee, xcm_config::XcmConfig, Balances, ExistentialDeposit,
ParachainSystem, PolkadotXcm, Runtime, RuntimeEvent, SessionKeys,
};
use codec::Decode;
use frame_support::parameter_types;
use parachains_common::{AccountId, AuraId};

const ALICE: [u8; 32] = [1u8; 32];

parameter_types! {
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
}

bridge_hub_test_utils::test_cases::include_teleports_for_native_asset_works!(
Runtime,
XcmConfig,
CheckingAccount,
WeightToFee,
ParachainSystem,
bridge_hub_test_utils::CollatorSessionKeys::new(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }
),
ExistentialDeposit::get(),
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event),
_ => None,
}
}),
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::XcmpQueue(event)) => Some(event),
_ => None,
}
}),
1002
);
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pallet-authorship = { git = "https://github.com/paritytech/substrate", default-f
pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
Expand Down Expand Up @@ -72,6 +71,9 @@ pallet-collator-selection = { path = "../../../../pallets/collator-selection", d
parachain-info = { path = "../../../../parachains/pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../../parachains/common", default-features = false }

[dev-dependencies]
bridge-hub-test-utils = { path = "../test-utils"}

[features]
default = [
"std",
Expand Down Expand Up @@ -100,7 +102,6 @@ std = [
"pallet-collator-selection/std",
"pallet-multisig/std",
"pallet-session/std",
"pallet-sudo/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
Expand Down
Loading