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

feat: 6 second block time #672

Merged
merged 26 commits into from
Oct 28, 2024
Merged

feat: 6 second block time #672

merged 26 commits into from
Oct 28, 2024

Conversation

vgantchev
Copy link
Contributor

@vgantchev vgantchev commented Oct 2, 2024

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

Copy link

github-actions bot commented Oct 2, 2024

Crate versions that have been updated:

  • runtime-integration-tests: v1.0.4 -> v1.0.5
  • basilisk: v16.0.0 -> v17.0.0
  • pallet-asset-registry: v2.3.4 -> v2.3.5
  • primitives: v6.6.3 -> v6.6.4
  • basilisk-runtime: v121.0.0 -> v122.0.0

Runtime version has been increased.

@vgantchev vgantchev marked this pull request as ready for review October 24, 2024 18:26
@vgantchev vgantchev requested a review from mrq1911 October 24, 2024 18:26
// Very limited proposal time.
authoring_duration: Duration::from_millis(500),
collation_request_receiver: None,
authoring_duration: Duration::from_millis(1500),
Copy link
Contributor

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

Copy link
Member

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

@mrq1911 mrq1911 changed the title feat: async backing feat: 6 second block time Oct 26, 2024
Copy link
Member

@mrq1911 mrq1911 left a 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),
Copy link
Member

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),
Copy link
Member

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]
Copy link
Member

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;
Copy link
Member

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

@mrq1911 mrq1911 merged commit 5ef4e22 into master Oct 28, 2024
7 checks passed
@jak-pan jak-pan mentioned this pull request Nov 22, 2024
5 tasks
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.

3 participants