Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hardcoded weights in coretime chain runtimes #8

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

seadanda
Copy link
Collaborator

@seadanda seadanda commented Aug 15, 2024

The new request_revenue_info extrinisic was added to Kusama and Polkadot and benchmarked for the first time for both.

This PR increases the buffers of the regularly sent XCMs between the Coretime Chain and Relay on both networks. The buffers use an overestimate for the read/write ref_time and add an additional 30% buffer, rounding up. This gives us freedom to update either chain independently of the other as long as the new benchmarks are within these bounds, while minimising weight overuse for the regularly sent XCMs.

  • TODO double check relay hardcoded weights against pallet-broker benchmarks

Weights check Polkadot relay:

	// 1.1 * max(Reserve, SetLease, NotifyCoreCount, NotifyRevenue, SwapLeases)
	// max(170, 207, 112, 113, 147) * WEIGHT_REF_TIME_PER_MICROS
	// max(15, 2, 0, 0, 2) * WEIGHT_PROOF_SIZE_PER_KB
	pub MaxXcmTransactWeight: Weight = Weight::from_parts(
		250 * WEIGHT_REF_TIME_PER_MICROS,
		20 * WEIGHT_PROOF_SIZE_PER_KB
	);

This leaves about a 30% buffer for the one-shot (migration) weights and ~70-100% for the regularly sent ones

Weights check Kusama relay:

	// 1.1 * max(Reserve, SetLease, NotifyCoreCount, NotifyRevenue, SwapLeases)
	// max(169, 207, 113, 113, 147) * WEIGHT_REF_TIME_PER_MICROS
	// max(15, 2, 0, 0, 2) * WEIGHT_PROOF_SIZE_PER_KB
	pub MaxXcmTransactWeight: Weight = Weight::from_parts(
		250 * WEIGHT_REF_TIME_PER_MICROS,
		20 * WEIGHT_PROOF_SIZE_PER_KB
	);

This is about the same

@seadanda seadanda marked this pull request as ready for review August 16, 2024 08:41
@bkontur bkontur merged commit f2116a9 into bkontur:bko-weights Aug 16, 2024
44 of 46 checks passed
@bkontur bkontur deleted the donal-coretime-weights branch August 16, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants