Skip to content

Commit

Permalink
fix: Fix benchmark issue in ocif-staking and recompute weights
Browse files Browse the repository at this point in the history
  • Loading branch information
arrudagates committed Aug 3, 2023
1 parent 198f068 commit ad4a785
Show file tree
Hide file tree
Showing 5 changed files with 387 additions and 233 deletions.
76 changes: 38 additions & 38 deletions INV4/pallet-inv4/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ pub trait WeightInfo {
// Proof Size summary in bytes:
// Measured: `273`
// Estimated: `6196`
// Minimum execution time: 84_000_000 picoseconds.
Weight::from_parts(85_854_618, 6196)
// Standard Error: 11
.saturating_add(Weight::from_parts(641, 0).saturating_mul(m.into()))
// Minimum execution time: 87_000_000 picoseconds.
Weight::from_parts(88_240_523, 6196)
// Standard Error: 6
.saturating_add(Weight::from_parts(718, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(8_u64))
}
Expand All @@ -79,10 +79,10 @@ pub trait WeightInfo {
// Proof Size summary in bytes:
// Measured: `234`
// Estimated: `13528`
// Minimum execution time: 11_000_000 picoseconds.
Weight::from_parts(12_194_379, 13528)
// Minimum execution time: 12_000_000 picoseconds.
Weight::from_parts(12_502_381, 13528)
// Standard Error: 5
.saturating_add(Weight::from_parts(635, 0).saturating_mul(m.into()))
.saturating_add(Weight::from_parts(659, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand All @@ -98,8 +98,8 @@ pub trait WeightInfo {
// Proof Size summary in bytes:
// Measured: `246`
// Estimated: `3593`
// Minimum execution time: 34_000_000 picoseconds.
Weight::from_parts(35_000_000, 3593)
// Minimum execution time: 35_000_000 picoseconds.
Weight::from_parts(36_000_000, 3593)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
Expand All @@ -115,8 +115,8 @@ pub trait WeightInfo {
// Proof Size summary in bytes:
// Measured: `438`
// Estimated: `3593`
// Minimum execution time: 37_000_000 picoseconds.
Weight::from_parts(39_000_000, 3593)
// Minimum execution time: 38_000_000 picoseconds.
Weight::from_parts(38_000_000, 3593)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
Expand All @@ -134,12 +134,12 @@ pub trait WeightInfo {
// Proof Size summary in bytes:
// Measured: `498`
// Estimated: `554807`
// Minimum execution time: 29_000_000 picoseconds.
Weight::from_parts(23_634_808, 554807)
// Standard Error: 14
.saturating_add(Weight::from_parts(537, 0).saturating_mul(m.into()))
// Standard Error: 2
.saturating_add(Weight::from_parts(1_917, 0).saturating_mul(z.into()))
// Minimum execution time: 30_000_000 picoseconds.
Weight::from_parts(26_605_303, 554807)
// Standard Error: 25
.saturating_add(Weight::from_parts(422, 0).saturating_mul(m.into()))
// Standard Error: 4
.saturating_add(Weight::from_parts(1_899, 0).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand Down Expand Up @@ -167,7 +167,7 @@ pub trait WeightInfo {
// Measured: `445`
// Estimated: `554807`
// Minimum execution time: 16_000_000 picoseconds.
Weight::from_parts(17_000_000, 554807)
Weight::from_parts(16_000_000, 554807)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand All @@ -178,7 +178,7 @@ pub trait WeightInfo {
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 9_000_000 picoseconds.
Weight::from_parts(9_000_000, 0)
Weight::from_parts(10_000_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
}
Expand All @@ -204,10 +204,10 @@ pub trait WeightInfo {
// Proof Size summary in bytes:
// Measured: `273`
// Estimated: `6196`
// Minimum execution time: 84_000_000 picoseconds.
Weight::from_parts(85_854_618, 6196)
// Standard Error: 11
.saturating_add(Weight::from_parts(641, 0).saturating_mul(m.into()))
// Minimum execution time: 87_000_000 picoseconds.
Weight::from_parts(88_240_523, 6196)
// Standard Error: 6
.saturating_add(Weight::from_parts(718, 0).saturating_mul(m.into()))
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(8_u64))
}
Expand All @@ -218,10 +218,10 @@ pub trait WeightInfo {
// Proof Size summary in bytes:
// Measured: `234`
// Estimated: `13528`
// Minimum execution time: 11_000_000 picoseconds.
Weight::from_parts(12_194_379, 13528)
// Minimum execution time: 12_000_000 picoseconds.
Weight::from_parts(12_502_381, 13528)
// Standard Error: 5
.saturating_add(Weight::from_parts(635, 0).saturating_mul(m.into()))
.saturating_add(Weight::from_parts(659, 0).saturating_mul(m.into()))
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
Expand All @@ -237,8 +237,8 @@ pub trait WeightInfo {
// Proof Size summary in bytes:
// Measured: `246`
// Estimated: `3593`
// Minimum execution time: 34_000_000 picoseconds.
Weight::from_parts(35_000_000, 3593)
// Minimum execution time: 35_000_000 picoseconds.
Weight::from_parts(36_000_000, 3593)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
Expand All @@ -254,8 +254,8 @@ pub trait WeightInfo {
// Proof Size summary in bytes:
// Measured: `438`
// Estimated: `3593`
// Minimum execution time: 37_000_000 picoseconds.
Weight::from_parts(39_000_000, 3593)
// Minimum execution time: 38_000_000 picoseconds.
Weight::from_parts(38_000_000, 3593)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
Expand All @@ -273,12 +273,12 @@ pub trait WeightInfo {
// Proof Size summary in bytes:
// Measured: `498`
// Estimated: `554807`
// Minimum execution time: 29_000_000 picoseconds.
Weight::from_parts(23_634_808, 554807)
// Standard Error: 14
.saturating_add(Weight::from_parts(537, 0).saturating_mul(m.into()))
// Standard Error: 2
.saturating_add(Weight::from_parts(1_917, 0).saturating_mul(z.into()))
// Minimum execution time: 30_000_000 picoseconds.
Weight::from_parts(26_605_303, 554807)
// Standard Error: 25
.saturating_add(Weight::from_parts(422, 0).saturating_mul(m.into()))
// Standard Error: 4
.saturating_add(Weight::from_parts(1_899, 0).saturating_mul(z.into()))
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
Expand Down Expand Up @@ -306,7 +306,7 @@ pub trait WeightInfo {
// Measured: `445`
// Estimated: `554807`
// Minimum execution time: 16_000_000 picoseconds.
Weight::from_parts(17_000_000, 554807)
Weight::from_parts(16_000_000, 554807)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
Expand All @@ -317,7 +317,7 @@ pub trait WeightInfo {
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 9_000_000 picoseconds.
Weight::from_parts(9_000_000, 0)
Weight::from_parts(10_000_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
}
2 changes: 1 addition & 1 deletion OCIF/staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ benchmarks! {
let description = vec![u8::MAX; d as usize];
let image = vec![u8::MAX; i as usize];

<T as Config>::Currency::make_free_balance_be(&derive_account::<T>(0u32.into()), T::RegisterDeposit::get());
<T as Config>::Currency::make_free_balance_be(&derive_account::<T>(0u32.into()), T::RegisterDeposit::get() + T::RegisterDeposit::get());
}: _(INV4Origin::Multisig(MultisigInternalOrigin::new(0u32.into())), name, description, image)
verify {
assert_last_event::<T>(Event::<T>::CoreRegistered {
Expand Down
1 change: 0 additions & 1 deletion OCIF/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ pub mod pallet {
<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;

#[pallet::pallet]
#[pallet::generate_store(pub(crate) trait Store)]
pub struct Pallet<T>(PhantomData<T>);

type NegativeImbalanceOf<T> = <<T as Config>::Currency as Currency<
Expand Down
Loading

0 comments on commit ad4a785

Please sign in to comment.