From 792f5910ebd94c083326fd41e8452f8ce932c4e6 Mon Sep 17 00:00:00 2001 From: brenzi Date: Wed, 31 Jan 2024 13:24:39 +0100 Subject: [PATCH] Ab/fix weight bound (#257) * fix bogus weight for xcm execution. cpoy-paste from karura * tried many things, nothing fixes weight error * revert all changes and try anew * fix xcm weight estimates * cleanup unnecessary changes * cleanup * bump version --- Cargo.lock | 4 ++-- polkadot-parachains/Cargo.toml | 2 +- polkadot-parachains/integritee-runtime/Cargo.toml | 2 +- polkadot-parachains/integritee-runtime/src/lib.rs | 2 +- .../integritee-runtime/src/weights/pallet_xcm.rs | 5 ++--- polkadot-parachains/integritee-runtime/src/xcm_config.rs | 7 ++++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 078ec283..6d5c9f2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3602,7 +3602,7 @@ dependencies = [ [[package]] name = "integritee-collator" -version = "1.7.7" +version = "1.7.8" dependencies = [ "assert_cmd", "async-trait", @@ -3687,7 +3687,7 @@ dependencies = [ [[package]] name = "integritee-runtime" -version = "1.7.43" +version = "1.7.44" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", diff --git a/polkadot-parachains/Cargo.toml b/polkadot-parachains/Cargo.toml index 55bc8ba9..49d8d7e9 100644 --- a/polkadot-parachains/Cargo.toml +++ b/polkadot-parachains/Cargo.toml @@ -2,7 +2,7 @@ name = "integritee-collator" description = "The Integritee parachain collator binary" # align major.minor revision with the runtimes. bump patch revision ad lib. make this the github release tag -version = "1.7.7" +version = "1.7.8" authors = ["Integritee AG "] homepage = "https://integritee.network/" repository = "https://github.com/integritee-network/parachain" diff --git a/polkadot-parachains/integritee-runtime/Cargo.toml b/polkadot-parachains/integritee-runtime/Cargo.toml index 03779c00..d73f89c8 100644 --- a/polkadot-parachains/integritee-runtime/Cargo.toml +++ b/polkadot-parachains/integritee-runtime/Cargo.toml @@ -2,7 +2,7 @@ name = "integritee-runtime" description = "The Integritee parachain runtime" # patch revision must match runtime spec_version -version = "1.7.43" +version = "1.7.44" authors = ["Integritee AG "] homepage = "https://integritee.network/" repository = "https://github.com/integritee-network/parachain" diff --git a/polkadot-parachains/integritee-runtime/src/lib.rs b/polkadot-parachains/integritee-runtime/src/lib.rs index 5bf25aad..355b3f70 100644 --- a/polkadot-parachains/integritee-runtime/src/lib.rs +++ b/polkadot-parachains/integritee-runtime/src/lib.rs @@ -124,7 +124,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("integritee-parachain"), impl_name: create_runtime_str!("integritee-full"), authoring_version: 2, - spec_version: 43, + spec_version: 44, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 6, diff --git a/polkadot-parachains/integritee-runtime/src/weights/pallet_xcm.rs b/polkadot-parachains/integritee-runtime/src/weights/pallet_xcm.rs index ba28fc41..839d8037 100644 --- a/polkadot-parachains/integritee-runtime/src/weights/pallet_xcm.rs +++ b/polkadot-parachains/integritee-runtime/src/weights/pallet_xcm.rs @@ -59,7 +59,7 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) + Weight::from_parts(22_338_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: ParachainInfo ParachainId (r:1 w:0) @@ -79,8 +79,7 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) + Weight::from_parts(10_240_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: PolkadotXcm SupportedVersion (r:0 w:1) diff --git a/polkadot-parachains/integritee-runtime/src/xcm_config.rs b/polkadot-parachains/integritee-runtime/src/xcm_config.rs index c47c5dc7..270c37e9 100644 --- a/polkadot-parachains/integritee-runtime/src/xcm_config.rs +++ b/polkadot-parachains/integritee-runtime/src/xcm_config.rs @@ -76,6 +76,7 @@ parameter_types! { pub SelfReserve: MultiLocation = MultiLocation { parents:0, + //todo: why not `interior: Here` ? interior: Junctions::X1(TEER_GENERAL_KEY) }; pub CheckingAccount: AccountId = PolkadotXcm::check_account(); @@ -228,7 +229,7 @@ where parameter_types! { // Weight for one XCM operation. Copied from moonbeam. - pub UnitWeightCost: Weight = Weight::from_parts(200_000_000u64, DEFAULT_PROOF_SIZE); + pub UnitWeightCost: Weight = Weight::from_parts(1_000_000u64, DEFAULT_PROOF_SIZE); // One TEER buys 1 second of weight. pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), TEER); @@ -379,10 +380,10 @@ parameter_types! { } /// Copied from moonbeam: https://github.com/PureStake/moonbeam/blob/095031d171b0c163e5649ee35acbc36eef681a82/primitives/xcm/src/ethereum_xcm.rs#L34 -pub const DEFAULT_PROOF_SIZE: u64 = 128 * 1024; +pub const DEFAULT_PROOF_SIZE: u64 = 1024; parameter_types! { - pub const BaseXcmWeight: Weight= Weight::from_parts(200_000_000u64, DEFAULT_PROOF_SIZE); + pub const BaseXcmWeight: Weight= Weight::from_parts(1_000_000u64, DEFAULT_PROOF_SIZE); pub const MaxAssetsForTransfer: usize = 2; }