Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change size of processing per blocks
  • Loading branch information
cheme committed May 15, 2023
commit bdd9ae39adc276bc43628f0df16b2ca24ccafa6f
6 changes: 5 additions & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2405,7 +2405,11 @@ mod init_state_migration {
if MigrationProcess::<Runtime>::get() == Default::default() &&
AutoLimits::<Runtime>::get().is_none()
{
AutoLimits::<Runtime>::put(Some(MigrationLimits { item: 160, size: 204800 }));
// We use limits to target 600ko proofs per block and
// avg 800_000_000_000 of weight per block.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

800 seconds?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

800_000_000_000 is 800ms I believe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can lower to 600 (using 3200 instead of 4800 move to 510 blocks the migration time so not taking really longer).

Could make sense to calculate better weight as I believe it is an overestimate (iterating on data since iterator improvement may be cheaper than random data access).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

800ms sounds good! For some reason I thought we measure ref time in nanoseconds, but ty @crystalin

// See spreadsheet 4800_400 in
// https://raw.githubusercontent.com/cheme/substrate/try-runtime-mig/ksm.ods
AutoLimits::<Runtime>::put(Some(MigrationLimits { item: 4_800, size: 204800 * 2 }));
log::info!("Automatic trie migration started.");
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(2, 1)
} else {
Expand Down