Skip to content

Commit

Permalink
Refine hardcoded weights to reflect benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
seadanda committed Feb 15, 2024
1 parent a5a791b commit deeef97
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,20 @@ impl CoretimeInterface for CoretimeAllocator {
use crate::coretime::CoretimeProviderCalls::RequestCoreCount;
let request_core_count_call = RelayRuntimePallets::Coretime(RequestCoreCount(count));

// Weight for `request_core_count` from westend benchmarks:
// `ref_time` = 7889000 + (3 * 25000000) + (1 * 100000000) = 182889000
// `proof_size` = 1636
// Add 5% to each component and round to 2 significant figures.
let call_weight = Weight::from_parts(190_000_000, 1700);

let message = Xcm(vec![
Instruction::UnpaidExecution {
weight_limit: WeightLimit::Unlimited,
check_origin: None,
},
Instruction::Transact {
origin_kind: OriginKind::Native,
require_weight_at_most: Weight::from_parts(1000000000, 200000),
require_weight_at_most: call_weight,
call: request_core_count_call.encode().into(),
},
]);
Expand Down Expand Up @@ -180,14 +186,20 @@ impl CoretimeInterface for CoretimeAllocator {
let assign_core_call =
RelayRuntimePallets::Coretime(AssignCore(core, begin, assignment, end_hint));

// Weight for `assign_core` from westend benchmarks:
// `ref_time` = 10177115 + (1 * 25000000) + (2 * 100000000) + (57600 * 13932) = 937660315
// `proof_size` = 3612
// Add 5% to each component and round to 2 significant figures.
let call_weight = Weight::from_parts(980_000_000, 3800);

let message = Xcm(vec![
Instruction::UnpaidExecution {
weight_limit: WeightLimit::Unlimited,
check_origin: None,
},
Instruction::Transact {
origin_kind: OriginKind::Native,
require_weight_at_most: Weight::from_parts(1_000_000_000, 200000),
require_weight_at_most: call_weight,
call: assign_core_call.encode().into(),
},
]);
Expand Down

0 comments on commit deeef97

Please sign in to comment.