Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
7953a59
patch encointer deps
clangenb Apr 10, 2025
4072d93
add first draft of xcm treasury payment
clangenb Apr 10, 2025
9cd0513
minor fix
clangenb Apr 11, 2025
000dba5
add withdraw asset
clangenb Apr 11, 2025
ce8852a
some improvements, still getting lacking funds error
clangenb Apr 11, 2025
0a07a17
almost compiling version of the unit tests
clangenb Apr 14, 2025
7779ed0
compiles and xcm message is the expected
clangenb Apr 14, 2025
83e14f5
ensure that the account has balance
clangenb Apr 14, 2025
423213b
fix unused warnings
clangenb Apr 14, 2025
2af4bd9
Rename to TransferRemoteViaXcm and make the type more generic
clangenb Apr 14, 2025
248821e
minor improvements for the test fixes
clangenb Apr 14, 2025
18682a4
add debugging and uncover why withdrawing does not work.
clangenb Apr 15, 2025
f6581c4
integrate changes from pallets
clangenb Apr 15, 2025
3543011
some renaming
clangenb Apr 15, 2025
86828c8
successfully transfer funds remotely
clangenb Apr 15, 2025
0bf8300
add comment about fee handling
clangenb Apr 15, 2025
6b479cc
successfully pay back the withdrawer, but the amount seems off
clangenb Apr 16, 2025
339f0d9
put the refund surplus and deposit in the appendix
clangenb Apr 16, 2025
ae609af
some renaming and cosmetics
clangenb Apr 17, 2025
8e5aa31
fmt
clangenb Apr 17, 2025
fd3b44f
fix zepter
clangenb Apr 17, 2025
0018a15
fix TransferOverXcm implementation
clangenb Apr 17, 2025
7648ad6
fmt
clangenb Apr 17, 2025
cce9563
taplo fmt
clangenb Apr 17, 2025
8f0f0ac
clippy
clangenb Apr 17, 2025
bbfdb74
bump encointer
clangenb Apr 17, 2025
ea61c94
fix benchmark
clangenb Apr 17, 2025
0340f5d
bump encointer deps again
clangenb Apr 17, 2025
d68a834
fix benchmarking build
clangenb Apr 17, 2025
51fb2dd
fix benchmarking build
clangenb Apr 17, 2025
0155121
clippy autofixes
clangenb Apr 17, 2025
2f2ffc2
clippy manual autofixes
clangenb Apr 18, 2025
4e66120
Merge branch 'main' into cl/xcm-treasury-rebased
clangenb Jun 2, 2025
0f3200c
Merge branch 'main' into cl/xcm-treasury-rebased
clangenb Jun 15, 2025
ced1e28
bump encointer-pallets
clangenb Jun 15, 2025
be46da3
fix encointer treasury tests after stable2503 update
clangenb Jun 16, 2025
2a4b929
better logging in the tests
clangenb Jun 16, 2025
db478d8
bump pallets
clangenb Jun 16, 2025
771b110
taplo fmt
clangenb Jun 16, 2025
85ddca1
bump encointer-primitives
clangenb Jun 16, 2025
c6da366
add some more logging
clangenb Jun 17, 2025
fdca75c
fix refunding by adding a proper weight trader to the mock
clangenb Jun 17, 2025
e375c46
fmt
clangenb Jun 17, 2025
8838d05
extract `remote_transfer_xcm`
clangenb Jun 17, 2025
8547aab
minor refactor
clangenb Jun 17, 2025
18a76ef
extrat GetRemoteFee trait
clangenb Jun 17, 2025
5c51dbb
add todo
clangenb Jun 17, 2025
5567445
fmt
clangenb Jun 17, 2025
badd649
fix clippy
clangenb Jun 17, 2025
8d0835d
extract `get_remote_transfer_xcm`
clangenb Jun 17, 2025
834c1c1
make some treasury stuff public
clangenb Jun 17, 2025
1ccd94d
WIP adding simple encointer emulated test
clangenb Jun 17, 2025
81aee72
minor fixes
clangenb Jun 17, 2025
621c71f
add encointer-kusama-emulated chain
clangenb Jun 18, 2025
9451382
add encointer-kusama-emulated to the kusama emulated network
clangenb Jun 18, 2025
b92f464
querying the remote execution fee on assethub works in the integratio…
clangenb Jun 18, 2025
e3cb6f9
fix comment
clangenb Jun 18, 2025
83610be
fmt
clangenb Jun 18, 2025
39ca8e5
fmt
clangenb Jun 18, 2025
52ec3cc
clippy
clangenb Jun 18, 2025
8d188e7
zepter and taplo
clangenb Jun 18, 2025
8554bba
the constant fee ignores the XCM
clangenb Jun 18, 2025
8d45329
WIP adding an integration test
clangenb Jun 18, 2025
1df9ccb
extract deriving treasury account
clangenb Jun 18, 2025
968189f
getting correct treasury account but funds are still unavailable
clangenb Jun 18, 2025
5489b16
more checks, still getting the funds unavailable error
clangenb Jun 18, 2025
c51bbcf
add sender_on_remote_convenience function and test
clangenb Jun 19, 2025
85e6926
ensure the encointer account conversion matches ah account conversion
clangenb Jun 19, 2025
8c9af6c
add account conversion unit tests
clangenb Jun 19, 2025
ad62fcb
verify that we fund the correct account
clangenb Jun 19, 2025
8636775
more explicity code
clangenb Jun 19, 2025
a918779
more explicit testing
clangenb Jun 19, 2025
7467fd8
zepter
clangenb Jun 19, 2025
352d056
fmt
clangenb Jun 19, 2025
39f2e64
clippy
clangenb Jun 19, 2025
882d7b4
remove obsolete todo
clangenb Jun 19, 2025
c3fe9c6
clippy
clangenb Jun 19, 2025
18a9c06
taplo
clangenb Jun 19, 2025
3be13f0
add more integration tests to encointer
clangenb Jun 24, 2025
ac2b53f
fix teleport integration tests except delivery fee
clangenb Jun 24, 2025
b822b83
fix teleport integration tests except delivery fee
clangenb Jun 24, 2025
8fecd0b
add reserver transfer and teleport to assethub tests
clangenb Jun 24, 2025
cfebd6e
wip: remote xcm works
clangenb Jun 24, 2025
1b6121f
remove unused warnings
clangenb Jun 24, 2025
cc25e8a
Fix: Remove unnecessary withdraw
clangenb Jun 25, 2025
2be2479
tests: extract treasury spend helper
clangenb Jun 25, 2025
b19761d
fix warning
clangenb Jun 25, 2025
4ba5448
Revert "tests: extract treasury spend helper"
clangenb Jun 25, 2025
d818e18
add test for spending the native currency
clangenb Jun 25, 2025
f0c4071
some simplifications on remote transfer
clangenb Jun 25, 2025
9011aed
some more simplifications on remote transfer
clangenb Jun 25, 2025
f9acb63
Merge branch 'main' into cl/xcm-treasury-rebased
clangenb Jun 25, 2025
3623d38
bump remove execution fees
clangenb Jun 25, 2025
a4a1485
fix warnings
clangenb Jun 25, 2025
b276a6a
clippy and fmt
clangenb Jun 25, 2025
e2f8b4b
taplo
clangenb Jun 25, 2025
a469f39
comment failing code
clangenb Jun 25, 2025
cbb6dde
clippy
clangenb Jun 25, 2025
d6676c1
Merge branch 'main' into cl/xcm-treasury-rebased
clangenb Jul 11, 2025
73cc7e8
merge main
clangenb Aug 18, 2025
a35108b
merge main
clangenb Aug 18, 2025
d3f0a9b
bump encointer pallets with respect to remote treasury payment
clangenb Aug 18, 2025
13b386d
update constant fee
clangenb Aug 18, 2025
840fe51
Merge branch 'main' into cl/xcm-treasury-rebased
clangenb Aug 18, 2025
8814143
remove encointer-pallet patches
clangenb Aug 18, 2025
291dd63
fix clippy and remove debug logs
clangenb Aug 18, 2025
202ebd3
fix clippy and remove debug logs 2
clangenb Aug 18, 2025
dcaa7a0
fmt
clangenb Aug 18, 2025
777a854
Add Changelog entry
clangenb Aug 18, 2025
1babd4b
fix dangling comment
clangenb Aug 18, 2025
b3395e6
udpate teleport test
clangenb Aug 18, 2025
65ceade
fix teleport test
clangenb Aug 18, 2025
31792de
fmt
clangenb Aug 18, 2025
984963d
fmt
clangenb Aug 18, 2025
cf1f0a8
fmt
clangenb Aug 18, 2025
67b23c0
add licence headers
clangenb Aug 19, 2025
a61f442
Update system-parachains/encointer/src/treasuries_xcm_payout.rs
clangenb Aug 19, 2025
baa59c8
Update system-parachains/encointer/src/tests/unit_tests.rs
clangenb Aug 19, 2025
d788698
fix comment
clangenb Aug 19, 2025
b71a96f
add review
clangenb Aug 19, 2025
209f664
Merge branch 'main' into cl/xcm-treasury-rebased
clangenb Aug 19, 2025
80fae86
Merge branch 'main' into cl/xcm-treasury-rebased
clangenb Aug 21, 2025
abce776
re-introduce hashed description.
clangenb Aug 21, 2025
cae3ea1
Fix Changelog entry
clangenb Aug 21, 2025
baa0630
Revert "remove encointer-pallet patches"
clangenb Aug 22, 2025
ea2a28c
bump encointer to fix integritee-tests
clangenb Aug 22, 2025
96e75d8
add benchmark helper to Paymaster (builds)
clangenb Aug 22, 2025
69e64a8
add encointer patches
clangenb Aug 22, 2025
8f25618
Remove encointer patches
clangenb Aug 22, 2025
74e91ad
Fix encointer-treasuries benchmarks
clangenb Aug 22, 2025
6ca9feb
fmt
clangenb Aug 22, 2025
6cafb3c
Merge branch 'main' into cl/xcm-treasury-rebased
clangenb Aug 22, 2025
21b1e14
encointer runtime: replace `features = ["std"]` with default-features…
clangenb Aug 22, 2025
6470710
remove encointer licence in the integration tests
clangenb Aug 22, 2025
79747b1
remove default features from parachain-runtimes-test-utils
clangenb Aug 22, 2025
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Upgrade to Polkadot-SDK `unstable2507` ([polkadot-fellows/runtimes/pull/849](https://github.com/polkadot-fellows/runtimes/pull/849))
- [#8684](https://github.com/paritytech/polkadot-sdk/pull/8684) Add optional auto-rebag within on-idle to enable incremental correction of account positions within the bags-list during the idle phase of block execution
- [#8693](https://github.com/paritytech/polkadot-sdk/pull/8693) Add XCM Precompile to pallet-xcm
- [Encointer] use XCM V5 to remotely spend funds from encointer treasury accounts on AHK [polkadot-fellows/runtimes/pull/679](https://github.com/polkadot-fellows/runtimes/pull/679)

### Changed

Expand Down
64 changes: 58 additions & 6 deletions Cargo.lock

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

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ emulated-integration-tests-common = { version = "24.0.0" }
encointer-balances-tx-payment = { version = "~20.1.0", default-features = false }
encointer-balances-tx-payment-rpc-runtime-api = { version = "~20.1.0", default-features = false }
encointer-kusama-runtime = { path = "system-parachains/encointer" }
encointer-primitives = { version = "~20.4.0", default-features = false }
encointer-kusama-emulated-chain = { path = "integration-tests/emulated/chains/parachains/encointer/encointer-kusama" }
encointer-primitives = { version = "~20.5.0", default-features = false }
enumflags2 = { version = "0.7.7" }
frame-benchmarking = { version = "42.0.0", default-features = false }
frame-election-provider-support = { version = "42.0.0", default-features = false }
Expand Down Expand Up @@ -113,11 +114,11 @@ pallet-encointer-ceremonies = { version = "~20.1.0", default-features = false }
pallet-encointer-ceremonies-rpc-runtime-api = { version = "~20.1.0", default-features = false }
pallet-encointer-communities = { version = "~20.1.0", default-features = false }
pallet-encointer-communities-rpc-runtime-api = { version = "~20.1.0", default-features = false }
pallet-encointer-democracy = { version = "~20.4.0", default-features = false }
pallet-encointer-democracy = { version = "~20.6.0", default-features = false }
pallet-encointer-faucet = { version = "~20.2.0", default-features = false }
pallet-encointer-reputation-commitments = { version = "~20.1.0", default-features = false }
pallet-encointer-scheduler = { version = "~20.1.0", default-features = false }
pallet-encointer-treasuries = { version = "~20.4.0", default-features = false }
pallet-encointer-treasuries = { version = "~20.7.0", default-features = false }
pallet-encointer-treasuries-rpc-runtime-api = { version = "~20.3.0", default-features = false }
pallet-fast-unstake = { version = "41.0.0", default-features = false }
pallet-glutton = { version = "28.0.0", default-features = false }
Expand Down Expand Up @@ -273,6 +274,7 @@ members = [
"integration-tests/emulated/chains/parachains/collectives/collectives-polkadot",
"integration-tests/emulated/chains/parachains/coretime/coretime-kusama",
"integration-tests/emulated/chains/parachains/coretime/coretime-polkadot",
"integration-tests/emulated/chains/parachains/encointer/encointer-kusama",
"integration-tests/emulated/chains/parachains/people/people-kusama",
"integration-tests/emulated/chains/parachains/people/people-polkadot",
"integration-tests/emulated/chains/parachains/testing/penpal",
Expand All @@ -289,6 +291,7 @@ members = [
"integration-tests/emulated/tests/collectives/collectives-polkadot",
"integration-tests/emulated/tests/coretime/coretime-kusama",
"integration-tests/emulated/tests/coretime/coretime-polkadot",
"integration-tests/emulated/tests/encointer/encointer-kusama",
"integration-tests/emulated/tests/governance/kusama",
"integration-tests/emulated/tests/governance/polkadot",
"integration-tests/emulated/tests/people/people-kusama",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[package]
name = "encointer-kusama-emulated-chain"
authors.workspace = true
edition.workspace = true
version.workspace = true
license = "Apache-2.0"
description = "Encointer Kusama emulated chain used for integration tests"
publish = false


[dependencies]
# Substrate
sp-core = { workspace = true, default-features = true }
sp-keyring = { workspace = true }
frame-support = { workspace = true, default-features = true }

# Cumulus
parachains-common = { workspace = true, default-features = true }
cumulus-primitives-core = { workspace = true, default-features = true }
emulated-integration-tests-common = { workspace = true }
xcm = { workspace = true, default-features = true }
xcm-builder = { workspace = true, default-features = true }
polkadot-parachain-primitives = { workspace = true }

# Runtimes
encointer-kusama-runtime = { workspace = true }
kusama-emulated-chain = { workspace = true }


# Emulated tests
integration-tests-helpers = { workspace = true }

[features]
runtime-benchmarks = [
"cumulus-primitives-core/runtime-benchmarks",
"encointer-kusama-runtime/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"integration-tests-helpers/runtime-benchmarks",
"kusama-emulated-chain/runtime-benchmarks",
"parachains-common/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Substrate

// Cumulus
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
};
use encointer_kusama_runtime::{BalanceType, CeremonyPhaseType};
use parachains_common::Balance;
use xcm::prelude::*;

pub const PARA_ID: u32 = 1001;
pub const ED: Balance = encointer_kusama_runtime::ExistentialDeposit::get();

frame_support::parameter_types! {
pub UniversalLocation: InteriorLocation = [GlobalConsensus(Kusama), Parachain(PARA_ID)].into();
}

pub fn genesis() -> sp_core::storage::Storage {
let genesis_config = encointer_kusama_runtime::RuntimeGenesisConfig {
system: encointer_kusama_runtime::SystemConfig::default(),
balances: encointer_kusama_runtime::BalancesConfig {
balances: accounts::init_balances()
.iter()
.cloned()
.map(|k| (k, ED * 4096 * 4096))
.collect(),
dev_accounts: None,
},
parachain_info: encointer_kusama_runtime::ParachainInfoConfig {
parachain_id: PARA_ID.into(),
..Default::default()
},
collator_selection: encointer_kusama_runtime::CollatorSelectionConfig {
invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(),
candidacy_bond: ED * 16,
..Default::default()
},
session: encointer_kusama_runtime::SessionConfig {
keys: collators::invulnerables()
.into_iter()
.map(|(acc, aura)| {
(
acc.clone(), // account id
acc, // validator id
encointer_kusama_runtime::SessionKeys { aura }, // session keys
)
})
.collect(),
..Default::default()
},
polkadot_xcm: encointer_kusama_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
..Default::default()
},
encointer_scheduler: encointer_kusama_runtime::EncointerSchedulerConfig {
current_phase: CeremonyPhaseType::Registering,
current_ceremony_index: 1,
phase_durations: vec![
(CeremonyPhaseType::Registering, 604800000u64), // 7d
(CeremonyPhaseType::Assigning, 86400000u64), // 1d
(CeremonyPhaseType::Attesting, 172800000u64), // 2d
],
..Default::default()
},
encointer_ceremonies: encointer_kusama_runtime::EncointerCeremoniesConfig {
ceremony_reward: BalanceType::from_num(1),
time_tolerance: 600_000u64, // +-10min
location_tolerance: 1_000, // [m]
endorsement_tickets_per_bootstrapper: 10,
endorsement_tickets_per_reputable: 5,
reputation_lifetime: 5,
inactivity_timeout: 5, // idle ceremonies before purging community
meetup_time_offset: 0,
..Default::default()
},
encointer_communities: encointer_kusama_runtime::EncointerCommunitiesConfig {
min_solar_trip_time_s: 1, // [s]
max_speed_mps: 1, // [m/s] suggested would be 83m/s for security,
..Default::default()
},
encointer_balances: encointer_kusama_runtime::EncointerBalancesConfig {
// for relative adjustment.
fee_conversion_factor: 7_143u128,
..Default::default()
},
encointer_faucet: encointer_kusama_runtime::EncointerFaucetConfig {
reserve_amount: 10_000_000_000_000u128,
..Default::default()
},
..Default::default()
};

build_genesis_storage(
&genesis_config,
encointer_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pub mod genesis;

// Substrate
use frame_support::traits::OnInitialize;

// Cumulus
use emulated_integration_tests_common::{
impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain,
impl_xcm_helpers_for_parachain, impls::Parachain, xcm_emulator::decl_test_parachains,
};

// EncointerKusama Parachain declaration
decl_test_parachains! {
pub struct EncointerKusama {
genesis = genesis::genesis(),
on_init = {
encointer_kusama_runtime::AuraExt::on_initialize(1);
},
runtime = encointer_kusama_runtime,
core = {
XcmpMessageHandler: encointer_kusama_runtime::XcmpQueue,
LocationToAccountId: encointer_kusama_runtime::xcm_config::LocationToAccountId,
ParachainInfo: encointer_kusama_runtime::ParachainInfo,
MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin,
},
pallets = {
PolkadotXcm: encointer_kusama_runtime::PolkadotXcm,
Balances: encointer_kusama_runtime::Balances,
}
},
}

// EncointerKusama implementation
impl_accounts_helpers_for_parachain!(EncointerKusama);
impl_assert_events_helpers_for_parachain!(EncointerKusama);
impl_xcm_helpers_for_parachain!(EncointerKusama);
2 changes: 2 additions & 0 deletions integration-tests/emulated/networks/kusama-system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ emulated-integration-tests-common = { workspace = true }
# Runtimes
asset-hub-kusama-emulated-chain = { workspace = true }
bridge-hub-kusama-emulated-chain = { workspace = true }
encointer-kusama-emulated-chain = { workspace = true }
kusama-emulated-chain = { workspace = true }
penpal-emulated-chain = { workspace = true }
people-kusama-emulated-chain = { workspace = true }
Expand All @@ -25,6 +26,7 @@ runtime-benchmarks = [
"asset-hub-kusama-emulated-chain/runtime-benchmarks",
"bridge-hub-kusama-emulated-chain/runtime-benchmarks",
"coretime-kusama-emulated-chain/runtime-benchmarks",
"encointer-kusama-emulated-chain/runtime-benchmarks",
"kusama-emulated-chain/runtime-benchmarks",
"penpal-emulated-chain/runtime-benchmarks",
"people-kusama-emulated-chain/runtime-benchmarks",
Expand Down
Loading
Loading