Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav committed May 22, 2023
1 parent a3fa551 commit 2386d87
Show file tree
Hide file tree
Showing 120 changed files with 1,193 additions and 1,182 deletions.
16 changes: 8 additions & 8 deletions .maintain/pallet-weight-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
// Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
Weight::from_ref_time({{underscore benchmark.base_weight}})
.saturating_add(Weight::from_proof_size({{benchmark.base_calculated_proof_size}}))
Weight::from_parts({{underscore benchmark.base_weight}}, 0)
.saturating_add(Weight::from_parts({{benchmark.base_calculated_proof_size}}, 0))
{{#each benchmark.component_weight as |cw|}}
// Standard Error: {{underscore cw.error}}
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
.saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into()))
{{/each}}
{{#if (ne benchmark.base_reads "0")}}
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}_u64))
Expand All @@ -73,7 +73,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
.saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
{{/each}}
{{#each benchmark.component_calculated_proof_size as |cp|}}
.saturating_add(Weight::from_proof_size({{cp.slope}}).saturating_mul({{cp.name}}.into()))
.saturating_add(Weight::from_parts({{cp.slope}}, 0).saturating_mul({{cp.name}}.into()))
{{/each}}
}
{{/each}}
Expand All @@ -97,11 +97,11 @@ impl WeightInfo for () {
// Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
// Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
Weight::from_ref_time({{underscore benchmark.base_weight}})
.saturating_add(Weight::from_proof_size({{benchmark.base_calculated_proof_size}}))
Weight::from_parts({{underscore benchmark.base_weight}}, 0)
.saturating_add(Weight::from_parts({{benchmark.base_calculated_proof_size}}, 0))
{{#each benchmark.component_weight as |cw|}}
// Standard Error: {{underscore cw.error}}
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
.saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into()))
{{/each}}
{{#if (ne benchmark.base_reads "0")}}
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}}_u64))
Expand All @@ -116,7 +116,7 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
{{/each}}
{{#each benchmark.component_calculated_proof_size as |cp|}}
.saturating_add(Weight::from_proof_size({{cp.slope}}).saturating_mul({{cp.name}}.into()))
.saturating_add(Weight::from_parts({{cp.slope}}, 0).saturating_mul({{cp.name}}.into()))
{{/each}}
}
{{/each}}
Expand Down
40 changes: 20 additions & 20 deletions pallet/account-migration/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `5667`
// Estimated: `52015`
// Minimum execution time: 169_486 nanoseconds.
Weight::from_ref_time(169_486_000)
.saturating_add(Weight::from_proof_size(52015))
Weight::from_parts(169_486_000, 0)
.saturating_add(Weight::from_parts(52015, 0))
.saturating_add(T::DbWeight::get().reads(12_u64))
.saturating_add(T::DbWeight::get().writes(18_u64))
}
Expand Down Expand Up @@ -143,16 +143,16 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `5328 + z * (3 ±0)`
// Estimated: `52015 + y * (7 ±0) + z * (3 ±0)`
// Minimum execution time: 24_233 nanoseconds.
Weight::from_ref_time(153_169_000)
.saturating_add(Weight::from_proof_size(52015))
Weight::from_parts(153_169_000, 0)
.saturating_add(Weight::from_parts(52015, 0))
// Standard Error: 7_204
.saturating_add(Weight::from_ref_time(13_888).saturating_mul(x.into()))
.saturating_add(Weight::from_parts(13_888, 0).saturating_mul(x.into()))
// Standard Error: 7_204
.saturating_add(Weight::from_ref_time(138_484).saturating_mul(z.into()))
.saturating_add(Weight::from_parts(138_484, 0).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(12_u64))
.saturating_add(T::DbWeight::get().writes(18_u64))
.saturating_add(Weight::from_proof_size(7).saturating_mul(y.into()))
.saturating_add(Weight::from_proof_size(3).saturating_mul(z.into()))
.saturating_add(Weight::from_parts(7, 0).saturating_mul(y.into()))
.saturating_add(Weight::from_parts(3, 0).saturating_mul(z.into()))
}
/// Storage: AccountMigration Multisigs (r:1 w:1)
/// Proof Skipped: AccountMigration Multisigs (max_values: None, max_size: None, mode: Measured)
Expand All @@ -163,8 +163,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `4848`
// Estimated: `9914`
// Minimum execution time: 20_927 nanoseconds.
Weight::from_ref_time(20_927_000)
.saturating_add(Weight::from_proof_size(9914))
Weight::from_parts(20_927_000, 0)
.saturating_add(Weight::from_parts(9914, 0))
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand Down Expand Up @@ -207,8 +207,8 @@ impl WeightInfo for () {
// Measured: `5667`
// Estimated: `52015`
// Minimum execution time: 169_486 nanoseconds.
Weight::from_ref_time(169_486_000)
.saturating_add(Weight::from_proof_size(52015))
Weight::from_parts(169_486_000, 0)
.saturating_add(Weight::from_parts(52015, 0))
.saturating_add(RocksDbWeight::get().reads(12_u64))
.saturating_add(RocksDbWeight::get().writes(18_u64))
}
Expand Down Expand Up @@ -252,16 +252,16 @@ impl WeightInfo for () {
// Measured: `5328 + z * (3 ±0)`
// Estimated: `52015 + y * (7 ±0) + z * (3 ±0)`
// Minimum execution time: 24_233 nanoseconds.
Weight::from_ref_time(153_169_000)
.saturating_add(Weight::from_proof_size(52015))
Weight::from_parts(153_169_000, 0)
.saturating_add(Weight::from_parts(52015, 0))
// Standard Error: 7_204
.saturating_add(Weight::from_ref_time(13_888).saturating_mul(x.into()))
.saturating_add(Weight::from_parts(13_888, 0).saturating_mul(x.into()))
// Standard Error: 7_204
.saturating_add(Weight::from_ref_time(138_484).saturating_mul(z.into()))
.saturating_add(Weight::from_parts(138_484, 0).saturating_mul(z.into()))
.saturating_add(RocksDbWeight::get().reads(12_u64))
.saturating_add(RocksDbWeight::get().writes(18_u64))
.saturating_add(Weight::from_proof_size(7).saturating_mul(y.into()))
.saturating_add(Weight::from_proof_size(3).saturating_mul(z.into()))
.saturating_add(Weight::from_parts(7, 0).saturating_mul(y.into()))
.saturating_add(Weight::from_parts(3, 0).saturating_mul(z.into()))
}
/// Storage: AccountMigration Multisigs (r:1 w:1)
/// Proof Skipped: AccountMigration Multisigs (max_values: None, max_size: None, mode: Measured)
Expand All @@ -272,8 +272,8 @@ impl WeightInfo for () {
// Measured: `4848`
// Estimated: `9914`
// Minimum execution time: 20_927 nanoseconds.
Weight::from_ref_time(20_927_000)
.saturating_add(Weight::from_proof_size(9914))
Weight::from_parts(20_927_000, 0)
.saturating_add(Weight::from_parts(9914, 0))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
Expand Down
24 changes: 12 additions & 12 deletions pallet/deposit/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `3208`
// Estimated: `11632`
// Minimum execution time: 51_636 nanoseconds.
Weight::from_ref_time(51_636_000)
.saturating_add(Weight::from_proof_size(11632))
Weight::from_parts(51_636_000, 0)
.saturating_add(Weight::from_parts(11632, 0))
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
Expand All @@ -94,8 +94,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `2906`
// Estimated: `6422`
// Minimum execution time: 73_239 nanoseconds.
Weight::from_ref_time(73_239_000)
.saturating_add(Weight::from_proof_size(6422))
Weight::from_parts(73_239_000, 0)
.saturating_add(Weight::from_parts(6422, 0))
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
Expand All @@ -112,8 +112,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `2420`
// Estimated: `9041`
// Minimum execution time: 52_162 nanoseconds.
Weight::from_ref_time(52_162_000)
.saturating_add(Weight::from_proof_size(9041))
Weight::from_parts(52_162_000, 0)
.saturating_add(Weight::from_parts(9041, 0))
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(3_u64))
}
Expand All @@ -136,8 +136,8 @@ impl WeightInfo for () {
// Measured: `3208`
// Estimated: `11632`
// Minimum execution time: 51_636 nanoseconds.
Weight::from_ref_time(51_636_000)
.saturating_add(Weight::from_proof_size(11632))
Weight::from_parts(51_636_000, 0)
.saturating_add(Weight::from_parts(11632, 0))
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
Expand All @@ -152,8 +152,8 @@ impl WeightInfo for () {
// Measured: `2906`
// Estimated: `6422`
// Minimum execution time: 73_239 nanoseconds.
Weight::from_ref_time(73_239_000)
.saturating_add(Weight::from_proof_size(6422))
Weight::from_parts(73_239_000, 0)
.saturating_add(Weight::from_parts(6422, 0))
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
Expand All @@ -170,8 +170,8 @@ impl WeightInfo for () {
// Measured: `2420`
// Estimated: `9041`
// Minimum execution time: 52_162 nanoseconds.
Weight::from_ref_time(52_162_000)
.saturating_add(Weight::from_proof_size(9041))
Weight::from_parts(52_162_000, 0)
.saturating_add(Weight::from_parts(9041, 0))
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
}
Expand Down
48 changes: 24 additions & 24 deletions pallet/ecdsa-authority/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `894`
// Estimated: `4167`
// Minimum execution time: 23_399 nanoseconds.
Weight::from_ref_time(23_399_000)
.saturating_add(Weight::from_proof_size(4167))
Weight::from_parts(23_399_000, 0)
.saturating_add(Weight::from_parts(4167, 0))
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand All @@ -93,8 +93,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `1071`
// Estimated: `4698`
// Minimum execution time: 34_089 nanoseconds.
Weight::from_ref_time(34_089_000)
.saturating_add(Weight::from_proof_size(4698))
Weight::from_parts(34_089_000, 0)
.saturating_add(Weight::from_parts(4698, 0))
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
Expand All @@ -109,8 +109,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `1182`
// Estimated: `5031`
// Minimum execution time: 40_182 nanoseconds.
Weight::from_ref_time(40_182_000)
.saturating_add(Weight::from_proof_size(5031))
Weight::from_parts(40_182_000, 0)
.saturating_add(Weight::from_parts(5031, 0))
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
Expand All @@ -125,8 +125,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `1202`
// Estimated: `5091`
// Minimum execution time: 25_077 nanoseconds.
Weight::from_ref_time(25_077_000)
.saturating_add(Weight::from_proof_size(5091))
Weight::from_parts(25_077_000, 0)
.saturating_add(Weight::from_parts(5091, 0))
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
Expand All @@ -145,8 +145,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `1299`
// Estimated: `8475`
// Minimum execution time: 33_450 nanoseconds.
Weight::from_ref_time(33_450_000)
.saturating_add(Weight::from_proof_size(8475))
Weight::from_parts(33_450_000, 0)
.saturating_add(Weight::from_parts(8475, 0))
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
Expand All @@ -159,8 +159,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Measured: `1260`
// Estimated: `3510`
// Minimum execution time: 27_202 nanoseconds.
Weight::from_ref_time(27_202_000)
.saturating_add(Weight::from_proof_size(3510))
Weight::from_parts(27_202_000, 0)
.saturating_add(Weight::from_parts(3510, 0))
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand All @@ -179,8 +179,8 @@ impl WeightInfo for () {
// Measured: `894`
// Estimated: `4167`
// Minimum execution time: 23_399 nanoseconds.
Weight::from_ref_time(23_399_000)
.saturating_add(Weight::from_proof_size(4167))
Weight::from_parts(23_399_000, 0)
.saturating_add(Weight::from_parts(4167, 0))
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
Expand All @@ -195,8 +195,8 @@ impl WeightInfo for () {
// Measured: `1071`
// Estimated: `4698`
// Minimum execution time: 34_089 nanoseconds.
Weight::from_ref_time(34_089_000)
.saturating_add(Weight::from_proof_size(4698))
Weight::from_parts(34_089_000, 0)
.saturating_add(Weight::from_parts(4698, 0))
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
Expand All @@ -211,8 +211,8 @@ impl WeightInfo for () {
// Measured: `1182`
// Estimated: `5031`
// Minimum execution time: 40_182 nanoseconds.
Weight::from_ref_time(40_182_000)
.saturating_add(Weight::from_proof_size(5031))
Weight::from_parts(40_182_000, 0)
.saturating_add(Weight::from_parts(5031, 0))
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
Expand All @@ -227,8 +227,8 @@ impl WeightInfo for () {
// Measured: `1202`
// Estimated: `5091`
// Minimum execution time: 25_077 nanoseconds.
Weight::from_ref_time(25_077_000)
.saturating_add(Weight::from_proof_size(5091))
Weight::from_parts(25_077_000, 0)
.saturating_add(Weight::from_parts(5091, 0))
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
Expand All @@ -247,8 +247,8 @@ impl WeightInfo for () {
// Measured: `1299`
// Estimated: `8475`
// Minimum execution time: 33_450 nanoseconds.
Weight::from_ref_time(33_450_000)
.saturating_add(Weight::from_proof_size(8475))
Weight::from_parts(33_450_000, 0)
.saturating_add(Weight::from_parts(8475, 0))
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
Expand All @@ -261,8 +261,8 @@ impl WeightInfo for () {
// Measured: `1260`
// Estimated: `3510`
// Minimum execution time: 27_202 nanoseconds.
Weight::from_ref_time(27_202_000)
.saturating_add(Weight::from_proof_size(3510))
Weight::from_parts(27_202_000, 0)
.saturating_add(Weight::from_parts(3510, 0))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
Expand Down
2 changes: 1 addition & 1 deletion pallet/message-transact/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ frame_support::parameter_types! {
pub const TransactionByteFee: u64 = 1;
pub const ChainId: u64 = 42;
pub const BlockGasLimit: sp_core::U256 = sp_core::U256::MAX;
pub const WeightPerGas: frame_support::weights::Weight = frame_support::weights::Weight::from_ref_time(20_000);
pub const WeightPerGas: frame_support::weights::Weight = frame_support::weights::Weight::from_parts(20_000, 0);
}

pub struct FixedGasPrice;
Expand Down
4 changes: 2 additions & 2 deletions pallet/message-transact/src/tests/eip1559.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ fn test_dispatch_eip1559_transaction_weight_mismatch() {
pallet_bridge_dispatch::Event::MessageWeightMismatch(
SOURCE_CHAIN_ID,
mock_message_id,
Weight::from_ref_time(1249900180000),
Weight::from_ref_time(1000000000000),
Weight::from_parts(1249900180000, 0),
Weight::from_parts(1000000000000, 0),
),
));
});
Expand Down
4 changes: 2 additions & 2 deletions pallet/message-transact/src/tests/eip2930.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ fn test_dispatch_eip2930_transaction_weight_mismatch() {
pallet_bridge_dispatch::Event::MessageWeightMismatch(
SOURCE_CHAIN_ID,
mock_message_id,
Weight::from_ref_time(1249900180000),
Weight::from_ref_time(1000000000000),
Weight::from_parts(1249900180000, 0),
Weight::from_parts(1000000000000, 0),
),
));
});
Expand Down
4 changes: 2 additions & 2 deletions pallet/message-transact/src/tests/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ fn test_dispatch_legacy_transaction_weight_mismatch() {
pallet_bridge_dispatch::Event::MessageWeightMismatch(
SOURCE_CHAIN_ID,
mock_message_id,
Weight::from_ref_time(1249900180000),
Weight::from_ref_time(1000000000000),
Weight::from_parts(1249900180000, 0),
Weight::from_parts(1000000000000, 0),
),
));
});
Expand Down
2 changes: 1 addition & 1 deletion pallet/message-transact/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub(crate) type SubChainId = [u8; 4];
pub(crate) const SOURCE_CHAIN_ID: SubChainId = *b"srce";
pub(crate) const TARGET_CHAIN_ID: SubChainId = *b"trgt";
pub(crate) const TEST_WEIGHT: frame_support::weights::Weight =
frame_support::weights::Weight::from_ref_time(1_000_000_000_000);
frame_support::weights::Weight::from_parts(1_000_000_000_000, 0);

// This ERC-20 contract mints the maximum amount of tokens to the contract creator.
// pragma solidity ^0.5.0;
Expand Down
Loading

0 comments on commit 2386d87

Please sign in to comment.