Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into tarekkma/state_migr…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
TarekkMA committed Sep 16, 2024
2 parents 381cfa4 + dd3a4a4 commit 1262d88
Show file tree
Hide file tree
Showing 56 changed files with 5,808 additions and 2,012 deletions.
40 changes: 33 additions & 7 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ members = [
"pallets/precompile-benchmarks",
"pallets/proxy-genesis-companion",
"pallets/xcm-transactor",
"pallets/xcm-weight-trader",
"precompiles/balances-erc20",
"precompiles/batch",
"precompiles/call-permit",
Expand Down Expand Up @@ -107,6 +108,7 @@ pallet-parachain-staking = { path = "pallets/parachain-staking", default-feature
pallet-precompile-benchmarks = { path = "pallets/precompile-benchmarks", default-features = false }
pallet-proxy-genesis-companion = { path = "pallets/proxy-genesis-companion", default-features = false }
pallet-xcm-transactor = { path = "pallets/xcm-transactor", default-features = false }
pallet-xcm-weight-trader = { path = "pallets/xcm-weight-trader", default-features = false }
precompile-foreign-asset-migrator = { path = "precompiles/foreign-asset-migrator", default-features = false }
xcm-primitives = { path = "primitives/xcm", default-features = false }

Expand Down Expand Up @@ -185,6 +187,7 @@ sp-runtime-interface = { git = "https://github.com/moonbeam-foundation/polkadot-
sp-session = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
sp-std = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
sp-state-machine = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
sp-tracing = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
sp-transaction-pool = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
sp-trie = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
sp-version = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Docker images are published for every tagged release. Learn more with `moonbeam

```bash
# Join the public testnet
docker run --network="host" moonbeamfoundation/moonbeam:v0.39.0 --chain alphanet
docker run --network="host" moonbeamfoundation/moonbeam:v0.40.0 --chain alphanet
```

You can find more detailed instructions to [run a full node in our TestNet](https://docs.moonbeam.network/node-operators/networks/run-a-node/overview/)
Expand All @@ -28,7 +28,7 @@ locally. You can quickly set up a single node without a relay chain backing it u

```bash
# Run a dev service node
docker run --network="host" moonbeamfoundation/moonbeam:v0.39.0 --dev
docker run --network="host" moonbeamfoundation/moonbeam:v0.40.0 --dev
```

For more information, see our detailed instructions to [run a development node](https://docs.moonbeam.network/builders/get-started/networks/moonbeam-dev/)
Expand All @@ -39,10 +39,10 @@ The above command will start the node in instant seal mode. It creates a block w

```bash
# Author a block every 6 seconds.
docker run --network="host" moonbeamfoundation/moonbeam:v0.39.0 --dev --sealing 6000
docker run --network="host" moonbeamfoundation/moonbeam:v0.40.0 --dev --sealing 6000

# Manually control the block authorship and finality
docker run --network="host" moonbeamfoundation/moonbeam:v0.39.0 --dev --sealing manual
docker run --network="host" moonbeamfoundation/moonbeam:v0.40.0 --dev --sealing manual
```

### Prefunded Development Addresses
Expand Down
2 changes: 1 addition & 1 deletion node/cli-opt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = { workspace = true }
edition = "2021"
homepage = "https://moonbeam.network"
license = "GPL-3.0-only"
version = "0.40.0"
version = "0.41.0"

[dependencies]
bip32 = { workspace = true, features = ["bip39"] }
Expand Down
2 changes: 1 addition & 1 deletion node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "moonbeam-cli"
authors = { workspace = true }
edition = "2021"
version = "0.40.0"
version = "0.41.0"

[dependencies]
clap = { workspace = true, features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion node/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = { workspace = true }
edition = "2021"
homepage = "https://moonbeam.network"
license = "GPL-3.0-only"
version = "0.40.0"
version = "0.41.0"

[dependencies]
async-io = { workspace = true }
Expand Down
75 changes: 0 additions & 75 deletions pallets/asset-manager/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,47 +36,7 @@ benchmarks! {
assert_eq!(Pallet::<T>::asset_id_type(asset_id), Some(asset_type));
}

set_asset_units_per_second {
// We make it dependent on the number of existing assets already
let x in 5..100;
for i in 0..x {
let asset_type: T::ForeignAssetType = Location::new(
0,
X1(GeneralIndex(i as u128))
).into();
let metadata = T::AssetRegistrarMetadata::default();
let amount = 1u32.into();
Pallet::<T>::register_foreign_asset(
RawOrigin::Root.into(),
asset_type.clone(),
metadata,
amount,
true
)?;
Pallet::<T>::set_asset_units_per_second(RawOrigin::Root.into(), asset_type.clone(), 1, i)?;
}

// does not really matter what we register, as long as it is different than the previous
let asset_type = T::ForeignAssetType::default();
let metadata = T::AssetRegistrarMetadata::default();
let amount = 1u32.into();
let asset_id: T::AssetId = asset_type.clone().into();
Pallet::<T>::register_foreign_asset(
RawOrigin::Root.into(),
asset_type.clone(),
metadata,
amount,
true
)?;

}: _(RawOrigin::Root, asset_type.clone(), 1, x)
verify {
assert!(Pallet::<T>::supported_fee_payment_assets().contains(&asset_type));
assert_eq!(Pallet::<T>::asset_type_units_per_second(asset_type), Some(1));
}

change_existing_asset_type {
// We make it dependent on the number of existing assets already
let x in 5..100;
for i in 0..x {
let asset_type: T::ForeignAssetType = Location::new(0, X1(GeneralIndex(i as u128))).into();
Expand All @@ -89,7 +49,6 @@ benchmarks! {
amount,
true
)?;
Pallet::<T>::set_asset_units_per_second(RawOrigin::Root.into(), asset_type.clone(), 1, i)?;
}

let new_asset_type = T::ForeignAssetType::default();
Expand All @@ -101,40 +60,9 @@ benchmarks! {
}: _(RawOrigin::Root, asset_id_to_be_changed, new_asset_type.clone(), x)
verify {
assert_eq!(Pallet::<T>::asset_id_type(asset_id_to_be_changed), Some(new_asset_type.clone()));
assert_eq!(Pallet::<T>::asset_type_units_per_second(&new_asset_type), Some(1));
assert!(Pallet::<T>::supported_fee_payment_assets().contains(&new_asset_type));
}

remove_supported_asset {
// We make it dependent on the number of existing assets already
let x in 5..100;
for i in 0..x {
let asset_type: T::ForeignAssetType = Location::new(0, X1(GeneralIndex(i as u128))).into();
let metadata = T::AssetRegistrarMetadata::default();
let amount = 1u32.into();
Pallet::<T>::register_foreign_asset(
RawOrigin::Root.into(),
asset_type.clone(),
metadata,
amount,
true
)?;
Pallet::<T>::set_asset_units_per_second(RawOrigin::Root.into(), asset_type.clone(), 1, i)?;
}
let asset_type_to_be_removed: T::ForeignAssetType = Location::new(
0,
X1(GeneralIndex((x-1) as u128))
).into();
// We try to remove the last asset type
}: _(RawOrigin::Root, asset_type_to_be_removed.clone(), x)
verify {
assert!(!Pallet::<T>::supported_fee_payment_assets().contains(&asset_type_to_be_removed));
assert_eq!(Pallet::<T>::asset_type_units_per_second(asset_type_to_be_removed), None);
}

remove_existing_asset_type {
// We make it dependent on the number of existing assets already
// Worst case is we need to remove it from SupportedAAssetsFeePayment too
let x in 5..100;
for i in 0..x {
let asset_type: T::ForeignAssetType = Location::new(0, X1(GeneralIndex(i as u128))).into();
Expand All @@ -147,7 +75,6 @@ benchmarks! {
amount,
true
)?;
Pallet::<T>::set_asset_units_per_second(RawOrigin::Root.into(), asset_type.clone(), 1, i)?;
}

let asset_type_to_be_removed: T::ForeignAssetType = Location::new(
Expand All @@ -158,8 +85,6 @@ benchmarks! {
}: _(RawOrigin::Root, asset_id, x)
verify {
assert!(Pallet::<T>::asset_id_type(asset_id).is_none());
assert!(Pallet::<T>::asset_type_units_per_second(&asset_type_to_be_removed).is_none());
assert!(!Pallet::<T>::supported_fee_payment_assets().contains(&asset_type_to_be_removed));
}
}

Expand Down
Loading

0 comments on commit 1262d88

Please sign in to comment.