Skip to content

Commit

Permalink
Increase buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
seadanda committed Aug 16, 2024
1 parent e22ff32 commit ea60f16
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
16 changes: 10 additions & 6 deletions system-parachains/coretime/coretime-kusama/src/coretime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use frame_support::{
tokens::{Fortitude, Preservation},
DefensiveResult, OnUnbalanced,
},
weights::constants::{WEIGHT_PROOF_SIZE_PER_KB, WEIGHT_REF_TIME_PER_MICROS},
};
use frame_system::Pallet as System;
use kusama_runtime_constants::{system_parachain::coretime, time::DAYS as RELAY_DAYS};
Expand Down Expand Up @@ -139,8 +140,9 @@ impl CoretimeInterface for CoretimeAllocator {
// Weight for `request_core_count` from Kusama runtime benchmarks:
// `ref_time`, `proof_size`, reads, writes
// 9_670_000, 1640, 3, 1
// Add 10% to each component and round to 3 significant figures.
let call_weight = Weight::from_parts(203_000_000, 1800);
// Add 30% to each component with a healthy round up.
let call_weight =
Weight::from_parts(250 * WEIGHT_REF_TIME_PER_MICROS, 3 * WEIGHT_PROOF_SIZE_PER_KB);

let message = Xcm(vec![
Instruction::UnpaidExecution {
Expand Down Expand Up @@ -175,8 +177,9 @@ impl CoretimeInterface for CoretimeAllocator {
// Weight for `request_revenue_at` from Kusama runtime benchmarks:
// `ref_time`, `proof_size`, reads, writes
// 94_091_000, 6384, 7, 5
// Add 10% to each component and round to 3 significant figures.
let call_weight = Weight::from_parts(846_000_000, 7020);
// Add 30% to each component with a healthy round up.
let call_weight =
Weight::from_parts(1000 * WEIGHT_REF_TIME_PER_MICROS, 9 * WEIGHT_PROOF_SIZE_PER_KB);

let message = Xcm(vec![
Instruction::UnpaidExecution {
Expand Down Expand Up @@ -224,8 +227,9 @@ impl CoretimeInterface for CoretimeAllocator {
// Weight for `assign_core` from Kusama runtime benchmarks:
// `ref_time`, `proof_size`, reads, writes
// 12_042_907 + 80 * 13_919, 3545, 1, 2
// Add 10% to each component and round to 3 significant figures.
let call_weight = Weight::from_parts(262_000_000, 3900);
// Add 30% to each component with a healthy round up.
let call_weight =
Weight::from_parts(350 * WEIGHT_REF_TIME_PER_MICROS, 5 * WEIGHT_PROOF_SIZE_PER_KB);

// The relay chain currently only allows `assign_core` to be called with a complete mask
// and only ever with increasing `begin`. The assignments must be truncated to avoid
Expand Down
19 changes: 13 additions & 6 deletions system-parachains/coretime/coretime-polkadot/src/coretime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use frame_support::{
tokens::{Fortitude, Preservation},
DefensiveResult, OnUnbalanced,
},
weights::constants::{WEIGHT_PROOF_SIZE_PER_KB, WEIGHT_REF_TIME_PER_MICROS},
};
use frame_system::Pallet as System;
use pallet_broker::{CoreAssignment, CoreIndex, CoretimeInterface, PartsOf57600, RCBlockNumberOf};
Expand Down Expand Up @@ -139,8 +140,10 @@ impl CoretimeInterface for CoretimeAllocator {
// Weight for `request_core_count` from Polkadot runtime benchmarks:
// `ref_time`, `proof_size`, reads, writes
// 9_660_000, 1640, 3, 1
// Use overestimates for reads and writes, add 10% and round to 3sf.
let call_weight = Weight::from_parts(203_000_000, 1800);
// Use overestimates for reads and writes, add 30% to each component with a healthy round
// up.
let call_weight =
Weight::from_parts(250 * WEIGHT_REF_TIME_PER_MICROS, 3 * WEIGHT_PROOF_SIZE_PER_KB);

let message = Xcm(vec![
Instruction::UnpaidExecution {
Expand Down Expand Up @@ -175,8 +178,10 @@ impl CoretimeInterface for CoretimeAllocator {
// Weight for `request_revenue_at` from Polkadot runtime benchmarks:
// `ref_time`, `proof_size`, reads, writes
// 93_731_000, 6313, 7, 5
// Use overestimates for reads and writes, add 10% and round to 3sf.
let call_weight = Weight::from_parts(846_000_000, 6940);
// Use overestimates for reads and writes, add 30% to each component with a healthy round
// up.
let call_weight =
Weight::from_parts(1000 * WEIGHT_REF_TIME_PER_MICROS, 9 * WEIGHT_PROOF_SIZE_PER_KB);

let message = Xcm(vec![
Instruction::UnpaidExecution {
Expand Down Expand Up @@ -224,8 +229,10 @@ impl CoretimeInterface for CoretimeAllocator {
// Weight for `assign_core` from Polkadot runtime benchmarks:
// `ref_time`, `proof_size`, reads, writes
// 12_201_135 + 80 * 13_556, 3579, 1, 2
// Use overestimates for reads and writes, add 10% and round to 3sf.
let call_weight = Weight::from_parts(262_000_000, 3940);
// Use overestimates for reads and writes, add 30% to each component with a healthy round
// up.
let call_weight =
Weight::from_parts(350 * WEIGHT_REF_TIME_PER_MICROS, 5 * WEIGHT_PROOF_SIZE_PER_KB);

// The relay chain currently only allows `assign_core` to be called with a complete mask
// and only ever with increasing `begin`. The assignments must be truncated to avoid
Expand Down

0 comments on commit ea60f16

Please sign in to comment.