-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: 6 second block time #672
Conversation
Crate versions that have been updated:
Runtime version has been increased. |
// Very limited proposal time. | ||
authoring_duration: Duration::from_millis(500), | ||
collation_request_receiver: None, | ||
authoring_duration: Duration::from_millis(1500), |
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.
This doesn't mean execution time right? It's just how much time we have to propose a block
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.
this is node code, so the collators can have more time to propose blocks, size of block is defined in runtime
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.
ensure that session pallet doesnt break
// Very limited proposal time. | ||
authoring_duration: Duration::from_millis(500), | ||
collation_request_receiver: None, | ||
authoring_duration: Duration::from_millis(1500), |
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.
this is node code, so the collators can have more time to propose blocks, size of block is defined in runtime
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( | ||
WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), | ||
WEIGHT_REF_TIME_PER_SECOND.saturating_mul(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.
size of block (weight) is 4x what was before @jak-pan
@@ -507,7 +524,7 @@ impl pallet_transaction_pause::Config for Runtime { | |||
} | |||
|
|||
parameter_types! { | |||
pub const RewardPerCollator: Balance = 15_216_000_000_000_000; // 12.68[BSX/block] * 1200[block] | |||
pub const RewardPerCollator: Balance = 15_240_000_000_000_000; // 6.35[BSX/block] * 2400[block] |
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.
should be 1/2 if the session length remain the same (1200 blocks)
pub const MILLISECS_PER_BLOCK: u64 = 12000; | ||
/// Change this to adjust the block time. | ||
pub const MILLISECS_PER_BLOCK: u64 = 6000; | ||
pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; | ||
|
||
// Time is measured by number of blocks. | ||
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); | ||
pub const HOURS: BlockNumber = MINUTES * 60; |
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.
session length uses this constant, and that shouldn't probably change as it would break conversion from block number to session
This PR introduces async backing (6s block time)
The changes have been prepared following this guide: https://wiki.polkadot.network/docs/maintain-guides-async-backing