Skip to content

Commit b046a67

Browse files
rockbmbbkchrgithub-actions[bot]
authored
Parachains configurations nit comment (#8957)
# Description I found the previous version of the comment for the `schedule_config_update` function slightly unclear. I understood it to mean that the application of two configuration changes in the same session would lead to the change being applied in the current session, instead of having to wait until the session change as usual. I tried this out on `chopsticks` just to be sure. --------- Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent a511802 commit b046a67

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

polkadot/runtime/parachains/src/configuration.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,13 +1347,16 @@ impl<T: Config> Pallet<T> {
13471347
/// will check if the previous configuration was valid. If it was invalid, we proceed with
13481348
/// updating the configuration, giving a chance to recover from such a condition.
13491349
///
1350-
/// The actual configuration change take place after a couple of sessions have passed. In case
1351-
/// this function is called more than once in a session, then the pending configuration change
1352-
/// will be updated and the changes will be applied at once.
1353-
// NOTE: Explicitly tell rustc not to inline this because otherwise heuristics note the incoming
1354-
// closure making it's attractive to inline. However, in this case, we will end up with lots of
1355-
// duplicated code (making this function to show up in the top of heaviest functions) only for
1356-
// the sake of essentially avoiding an indirect call. Doesn't worth it.
1350+
/// The actual configuration change takes place after a couple of sessions have passed. In case
1351+
/// this function is called more than once in the same session, then the pending configuration
1352+
/// change will be updated.
1353+
/// In other words, all the configuration changes made in the same session will be folded
1354+
/// together in the order they were made, and only once the scheduled session is reached will
1355+
/// the final pending configuration be applied.
1356+
// NOTE: Explicitly tell rustc not to inline this, because otherwise heuristics note the
1357+
// incoming closure make it attractive to inline. However, in that case, we will end up with
1358+
// lots of duplicated code (making this function show up on top of the heaviest functions) only
1359+
// for the sake of essentially avoiding an indirect call. It is not worth it.
13571360
#[inline(never)]
13581361
pub(crate) fn schedule_config_update(
13591362
updater: impl FnOnce(&mut HostConfiguration<BlockNumberFor<T>>),

0 commit comments

Comments
 (0)