-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Weights for enacting candidates in paras inherent #4172
base: master
Are you sure you want to change the base?
Conversation
runtime/parachains/src/hrmp.rs
Outdated
/// Worst case weight for queue outbound hrmp. | ||
pub(crate) fn queue_outbound_hrmp_weight(hrmp_max_message_num_per_candidate: u32) -> Weight { | ||
let read_writes = (2 * hrmp_max_message_num_per_candidate).into(); | ||
T::DbWeight::get().reads_writes(read_writes, read_writes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// - in loop
// - get 1r,
// - insert 1w
// - append 1w
// - get 1r
// - insert 1r
runtime/parachains/src/paras.rs
Outdated
@@ -1002,6 +1002,11 @@ impl<T: Config> Pallet<T> { | |||
}) | |||
} | |||
|
|||
/// Worst case weight for `schedule_code_upgrade`. | |||
pub(crate) fn schedule_code_upgrade_weight() -> Weight { | |||
T::DbWeight::get().reads_writes(2 + 1, 3 + 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// - mutate 1r,1w
// - insert 1r
// - mutate 1r, 1w
// - write 1w
// - mutate, insert 1r,2w
// - insert 1w
@@ -203,6 +203,10 @@ impl<T: Config> Pallet<T> { | |||
T::DbWeight::get().reads_writes(1, 1) | |||
} | |||
|
|||
pub(crate) fn prune_dmq_weight() -> Weight { | |||
T::DbWeight::get().reads_writes(1, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// - 1 mutate.
runtime/parachains/src/paras.rs
Outdated
@@ -1040,6 +1045,11 @@ impl<T: Config> Pallet<T> { | |||
} | |||
} | |||
|
|||
/// Worst case weight for `note_new_head`. | |||
pub(crate) fn note_new_head_weight() -> Weight { | |||
T::DbWeight::get().reads_writes(2 + 3, 3 + 1 + 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// - insert 1w
// - remove 1r
// - remove 1r
// - take 1r,1w
// - get 1r
// - insert 1w
// - deposit_log (append) 1w
// - note_past_code
// - mutate 1r,1w
// - insert 1w
// - mutate 1r, 1w
runtime/parachains/src/hrmp.rs
Outdated
.max(hrmp_max_parathread_inbound_channels).into(); | ||
|
||
T::DbWeight::get() | ||
.reads_writes(1 + 2 * max_pruneable_channels, 1 + 1 + 2 * max_pruneable_channels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// - mutate 1r,1w
// - max_pruneable_channels * {insert || remove, mutate, get} r2, w2
// - insert w1
} else { | ||
0 | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// - mutate
// - mutate
// - mutate
…ytech/polkadot into zeke-track-enact-candidate
runtime/parachains/src/paras.rs
Outdated
} | ||
}) | ||
} | ||
|
||
/// Worst case weight for `schedule_code_upgrade`. | ||
pub(crate) fn schedule_code_upgrade_weight() -> Weight { | ||
T::DbWeight::get().reads_writes(4, 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// - mutate 1r, 1w
// - mutate 1r, 1w
// - insert 1w
// - mutate 1r, 1w
// - deposit_log (append) 1w
// - increase_code_ref 1r, 2w
// - insert 1w
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ these are notes about how I counted reads and writes
…ytech/polkadot into zeke-track-enact-candidate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous review was moot, only saw part of the diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two follow up issues needed, other than that, LGTM! 👍 Thank you!
@drahnr Can this be closed? |
I think it's still desirable to account for the enacted candidates, but it depends how much work that'd entail to update vs reimpl? |
This PR
enact_candidate
call and adds it to the returned weight of paras inherententer
. Previously we where not tracking the weight from enacting candidates.enact_candidate_weight
, which gives us the worst case weight which we can then use prior to calling enter.cc @pepyakin
Notes for reviewers:
relates to #4044
skip check-dependent-cumulus