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

feat: CheckMetadataHash extension #1865

Merged
merged 87 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
d6e0bf4
set dependency versions
lemunozm May 9, 2024
07bb334
upgrade libs/*
lemunozm May 10, 2024
446439a
upgrade pallet-anchors
lemunozm May 10, 2024
52d1b85
upgrade pallet-fees
lemunozm May 10, 2024
7183815
upgrade pallet-bridge
lemunozm May 13, 2024
3374bac
migrate simple pallets
lemunozm May 13, 2024
b161119
migrate pallet-order-book
lemunozm May 13, 2024
9fc71f5
migrated collator-allowlist & swaps
lemunozm May 13, 2024
f302388
upgrade rewards
lemunozm May 13, 2024
a38bfb6
upgraded pallet-mux
lemunozm May 13, 2024
5ccb3d0
upgrade transfer-allowlist
lemunozm May 13, 2024
056d942
Merge remote-tracking branch 'origin/main' into polkadot-v1.7.2
lemunozm May 13, 2024
5940897
fix hold reason in restricted tokens
lemunozm May 13, 2024
7d3335f
simplify set_balance removing the holding part
lemunozm May 13, 2024
3c2bb34
upgrade restricted-xtokens
lemunozm May 13, 2024
da56ef2
upgrade some pallets
lemunozm May 13, 2024
8ad0451
upgrade pallet-ethereum-transaction
lemunozm May 13, 2024
8461f41
upgrade pallet-loans
lemunozm May 13, 2024
873507d
upgrade pool-system
lemunozm May 14, 2024
3ae8b03
upgrade pool-fees
lemunozm May 14, 2024
4a2b98b
upgrade pool-registry
lemunozm May 14, 2024
3f94ea2
upgrade liquidity-pools stuffs
lemunozm May 14, 2024
45ca1c4
avoid duplicated polkadot-sdk repos
lemunozm May 16, 2024
45b3f11
minor fixes
lemunozm May 16, 2024
a783c9f
upgraded runtime-common
lemunozm May 17, 2024
1f70efe
CfgLocation to RestrictedTransferLocation
lemunozm May 17, 2024
f713417
restricted tokens with NativeIndex for native fungibles
lemunozm May 20, 2024
9f12a65
rename dependency
lemunozm May 20, 2024
f84ac93
upgraded development-runtime
lemunozm May 21, 2024
769afc5
fix partially benchmarks
lemunozm May 21, 2024
5f5f7b6
fix benchmarks
lemunozm May 22, 2024
aaceaf9
overpass xcmp-queue integrity tests
lemunozm May 22, 2024
1a23394
minor coments
lemunozm May 22, 2024
3a0e1cd
upgrade altair & centrifuge
lemunozm May 23, 2024
a259be5
remove some benchmarking pallets that are not needed
lemunozm May 23, 2024
c9729ef
fix runtime upgrades
lemunozm May 23, 2024
65b32a1
upgrade integration-test proc
lemunozm May 24, 2024
ed5b888
upgrade integration-tests framework
lemunozm May 27, 2024
493a602
upgraded all tests except liquidity pools
lemunozm May 27, 2024
55d28ee
99% upgraded liquidity-pools tests
lemunozm May 27, 2024
f172b1d
fix lookup
lemunozm May 28, 2024
b886c46
Merge remote-tracking branch 'origin/main' into polkadot-v1.7.2
lemunozm May 28, 2024
9c27823
cargo fmt
lemunozm May 28, 2024
55bfab5
taplo fmt
lemunozm May 28, 2024
75ae4a4
using nightly cargo in CI
lemunozm May 28, 2024
38377a9
restore set_balance as it was
lemunozm May 28, 2024
8071ffe
allow nightly support in CI
lemunozm May 28, 2024
338a573
use restricted_tokens again to fetch from investement portfolio
lemunozm May 28, 2024
8c92688
Install rust-src for docs
lemunozm May 28, 2024
625f9d2
fix tests
lemunozm May 28, 2024
1bd859b
remove unused restricted tokens
lemunozm May 28, 2024
a304d7f
fix block rewards
lemunozm May 28, 2024
99b4abc
fix WrongWitness for some tests in IT
lemunozm May 29, 2024
17a180c
fix liquidity-pools
lemunozm May 29, 2024
aa40ed0
minor fixes
lemunozm May 29, 2024
7b1b7e2
fix clippy
lemunozm May 30, 2024
a5dbd56
remove unneeded tests
lemunozm May 30, 2024
bc17d18
feat: Update client to Polkadot v1.7.2 (#1844)
wischli May 30, 2024
a95459b
cargo fmt
lemunozm May 30, 2024
3e44ef9
fix clippy
lemunozm May 30, 2024
f83d95f
feat: Polkadot v1.7.2 migrations (#1849)
wischli May 31, 2024
fb52bc4
last William iteration review
lemunozm Jun 3, 2024
988fcbb
increase passed blocks
lemunozm Jun 5, 2024
8410d16
use rococo instead of polkadot-test-runtime
lemunozm Jun 5, 2024
db844a5
fix tests
lemunozm Jun 5, 2024
beb13f0
remove line
lemunozm Jun 5, 2024
7e69e68
dirty fix to fix Hrmp test issue
lemunozm Jun 6, 2024
1c96ae1
use default weights for treasury
lemunozm Jun 6, 2024
7edbc3a
remove getrandom unused dep
lemunozm Jun 6, 2024
e1bad5f
upgrade to last polkadot-sdk version
lemunozm Jun 6, 2024
05efc33
feat: `CheckMetadataHash` extension
wischli Jun 6, 2024
4be5b03
fix it (#1866)
lemunozm Jun 7, 2024
c2b8ece
fmt: taplo
wischli Jun 7, 2024
22d0a38
refactor: signed ext order
wischli Jun 7, 2024
4f7d77e
fix: signed ext order for ITs
wischli Jun 7, 2024
b0a7d0f
Merge remote-tracking branch 'origin/main' into wf/polkadot-v1.7.2-me…
wischli Jun 25, 2024
1cc426c
IT: more support for router tests (#1885)
lemunozm Jun 25, 2024
9774844
Merge remote-tracking branch 'origin/main' into wf/polkadot-v1.7.2-me…
wischli Jun 25, 2024
c037d29
Merge remote-tracking branch 'origin/release-v0.11.1' into wf/polkado…
wischli Jun 25, 2024
265e509
v0.11.2 rc
wischli Jun 25, 2024
cbf8691
panic if event is not found in the expected blocks (#1880)
lemunozm Jun 25, 2024
2e8e44c
fix: ci
wischli Jun 25, 2024
e5c8926
remove generic module (#1887)
lemunozm Jun 26, 2024
7445232
Merge remote-tracking branch 'origin/main' into wf/polkadot-v1.7.2-me…
wischli Jun 26, 2024
8de5ae7
revert check metadata hash disable
wischli Jun 26, 2024
705c950
Merge remote-tracking branch 'origin/release-v0.11.1' into wf/polkado…
wischli Jun 27, 2024
37d6e90
fix: disable metadata hash check for integration tests
wischli Jun 27, 2024
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
64 changes: 60 additions & 4 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", default-featu
sp-trie = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, features = [
"tuples-96",
], branch = "release-polkadot-v1.7.2" } # Check when tuples-96 can be removed
Expand Down
1 change: 0 additions & 1 deletion pallets/liquidity-pools-gateway/routers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ where
T: frame_system::Config + pallet_xcm_transactor::Config,
{
pub xcm_domain: XcmDomain<T::CurrencyId>,
pub _marker: PhantomData<T>,
}

impl<T> XCMRouter<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use scale_info::{
TypeInfo,
};
use sp_core::{bounded::BoundedVec, ConstU32, H160};
use sp_std::{collections::btree_map::BTreeMap, marker::PhantomData, vec, vec::Vec};
use sp_std::{collections::btree_map::BTreeMap, vec, vec::Vec};

use crate::{
AccountIdOf, EVMRouter, MessageOf, AXELAR_DESTINATION_CHAIN_PARAM,
Expand All @@ -44,7 +44,6 @@ where
pub router: EVMRouter<T>,
pub evm_chain: BoundedVec<u8, ConstU32<MAX_AXELAR_EVM_CHAIN_SIZE>>,
pub liquidity_pools_contract_address: H160,
pub _marker: PhantomData<T>,
}

impl<T> AxelarEVMRouter<T>
Expand All @@ -66,7 +65,6 @@ where
router,
evm_chain,
liquidity_pools_contract_address,
_marker: Default::default(),
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use sp_core::{bounded::BoundedVec, ConstU32, H160};
use sp_runtime::DispatchError;
use sp_std::marker::PhantomData;

use crate::{
axelar_evm::get_axelar_encoded_msg, AccountIdOf, CurrencyIdOf, MessageOf, XCMRouter, XcmDomain,
Expand All @@ -37,7 +36,6 @@ where
pub router: XCMRouter<T>,
pub axelar_target_chain: BoundedVec<u8, ConstU32<MAX_AXELAR_EVM_CHAIN_SIZE>>,
pub axelar_target_contract: H160,
pub _marker: PhantomData<T>,
}

impl<T> AxelarXCMRouter<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use frame_support::{
};
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use sp_std::{collections::btree_map::BTreeMap, marker::PhantomData, vec, vec::Vec};
use sp_std::{collections::btree_map::BTreeMap, vec, vec::Vec};

use crate::{AccountIdOf, MessageOf, XCMRouter, FUNCTION_NAME, MESSAGE_PARAM};

Expand All @@ -30,7 +30,6 @@ where
+ pallet_liquidity_pools_gateway::Config,
{
pub router: XCMRouter<T>,
pub _marker: PhantomData<T>,
}

impl<T> EthereumXCMRouter<T>
Expand Down
15 changes: 0 additions & 15 deletions pallets/liquidity-pools-gateway/routers/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ mod xcm_router {

let router = XCMRouter::<Runtime> {
xcm_domain: test_data.xcm_domain.clone(),
_marker: Default::default(),
};

assert_ok!(router.do_init());
Expand All @@ -247,7 +246,6 @@ mod xcm_router {

let router = XCMRouter::<Runtime> {
xcm_domain: test_data.xcm_domain.clone(),
_marker: Default::default(),
};

assert_ok!(router.do_send(test_data.sender, test_data.msg.clone()));
Expand Down Expand Up @@ -293,7 +291,6 @@ mod xcm_router {

let router = XCMRouter::<Runtime> {
xcm_domain: test_data.xcm_domain.clone(),
_marker: Default::default(),
};

assert_ok!(router.do_init());
Expand Down Expand Up @@ -383,7 +380,6 @@ mod axelar_evm {
evm_chain: TEST_EVM_CHAIN.clone(),
liquidity_pools_contract_address: test_data
.liquidity_pools_contract_address,
_marker: Default::default(),
});

assert_ok!(domain_router.init());
Expand All @@ -404,7 +400,6 @@ mod axelar_evm {
evm_chain: TEST_EVM_CHAIN.clone(),
liquidity_pools_contract_address: test_data
.liquidity_pools_contract_address,
_marker: Default::default(),
});

assert_noop!(
Expand Down Expand Up @@ -453,7 +448,6 @@ mod axelar_evm {
evm_chain: TEST_EVM_CHAIN.clone(),
liquidity_pools_contract_address: test_data
.liquidity_pools_contract_address,
_marker: Default::default(),
});

assert_ok!(domain_router.send(test_data.sender, test_data.msg));
Expand All @@ -474,7 +468,6 @@ mod axelar_evm {
evm_chain: TEST_EVM_CHAIN.clone(),
liquidity_pools_contract_address: test_data
.liquidity_pools_contract_address,
_marker: Default::default(),
});

let res = domain_router.send(test_data.sender, test_data.msg);
Expand Down Expand Up @@ -551,11 +544,9 @@ mod axelar_xcm {
DomainRouter::<Runtime>::AxelarXCM(AxelarXCMRouter::<Runtime> {
router: XCMRouter {
xcm_domain: test_data.xcm_domain.clone(),
_marker: Default::default(),
},
axelar_target_chain: test_data.axelar_target_chain,
axelar_target_contract: test_data.axelar_target_contract,
_marker: Default::default(),
});

assert_ok!(domain_router.init());
Expand All @@ -575,11 +566,9 @@ mod axelar_xcm {
DomainRouter::<Runtime>::AxelarXCM(AxelarXCMRouter::<Runtime> {
router: XCMRouter {
xcm_domain: test_data.xcm_domain.clone(),
_marker: Default::default(),
},
axelar_target_chain: test_data.axelar_target_chain.clone(),
axelar_target_contract: test_data.axelar_target_contract,
_marker: Default::default(),
});

assert_ok!(domain_router.init());
Expand Down Expand Up @@ -694,9 +683,7 @@ mod ethereum_xcm {
DomainRouter::<Runtime>::EthereumXCM(EthereumXCMRouter::<Runtime> {
router: XCMRouter {
xcm_domain: test_data.xcm_domain.clone(),
_marker: Default::default(),
},
_marker: Default::default(),
});

assert_ok!(domain_router.init());
Expand All @@ -716,9 +703,7 @@ mod ethereum_xcm {
DomainRouter::<Runtime>::EthereumXCM(EthereumXCMRouter::<Runtime> {
router: XCMRouter {
xcm_domain: test_data.xcm_domain.clone(),
_marker: Default::default(),
},
_marker: Default::default(),
});

assert_ok!(domain_router.init());
Expand Down
1 change: 1 addition & 0 deletions pallets/pool-system/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ impl EnsureOriginWithArg<RuntimeOrigin, PoolId> for All {

#[cfg(feature = "runtime-benchmarks")]
fn try_successful_origin(_: &PoolId) -> Result<RuntimeOrigin, ()> {
use frame_support::dispatch::RawOrigin;
Ok(RawOrigin::Root.into())
}
}
Expand Down
12 changes: 12 additions & 0 deletions runtime/altair/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ sp-version = { workspace = true }

frame-benchmarking = { workspace = true, optional = true } # For benchmarking
frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame-system-benchmarking = { workspace = true, optional = true } # For benchmarking
Expand Down Expand Up @@ -169,6 +170,7 @@ std = [
"frame-system/std",
"frame-system-rpc-runtime-api/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-try-runtime?/std",
"frame-system-benchmarking?/std",
"frame-benchmarking?/std",
Expand Down Expand Up @@ -433,12 +435,22 @@ try-runtime = [
"staging-parachain-info/try-runtime",
]

# Enable the metadata hash generation.
#
# This is hidden behind a feature because it increases the compile time.
# The wasm binary needs to be compiled twice, once to fetch the metadata,
# generate the metadata hash and then a second time with the
# `RUNTIME_METADATA_HASH` environment variable set for the `CheckMetadataHash`
# extension.
metadata-hash = ["substrate-wasm-builder/metadata-hash"]

# A feature that should be enabled when the runtime should be build for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller like logging for example.
on-chain-release-build = [
"sp-api/disable-logging",
"runtime-common/on-chain-release-build",
"metadata-hash",
]

# Set timing constants (e.g. session period) to faster versions to speed up testing.
Expand Down
19 changes: 13 additions & 6 deletions runtime/altair/build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
use substrate_wasm_builder::WasmBuilder;
#[cfg(all(feature = "std", feature = "metadata-hash"))]
fn main() {
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("AIR", 18)
.build();
}

#[cfg(all(feature = "std", not(feature = "metadata-hash")))]
fn main() {
WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
substrate_wasm_builder::WasmBuilder::build_using_defaults();
}

/// The wasm builder is deactivated when compiling
/// this crate for wasm to speed up the compilation.
#[cfg(not(feature = "std"))]
fn main() {}
Loading