-
Notifications
You must be signed in to change notification settings - Fork 351
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: decrease block time to 6s #3953
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ const ( | |
// interval isn't enforced at consensus, the real block interval isn't | ||
// guaranteed to exactly match GoalBlockTime. GoalBlockTime is currently targeted | ||
// through static timeouts (i.e. TimeoutPropose, TimeoutCommit). | ||
GoalBlockTime = time.Second * 15 | ||
GoalBlockTime = time.Second * 6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Remaining references to 15-second block time found.
Please revise these instances to reflect the new 🔗 Analysis chainChange aligns with PR objective, but consider broader impacts. The reduction of To ensure this change doesn't introduce unexpected behaviors, please run the following verification: Review the results to ensure that all relevant parts of the codebase are updated to accommodate the new block time. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for any hardcoded assumptions about block time in the codebase
# Search for any mentions of block time in seconds
rg --type go "(?i)(block\s*time|block\s*interval).*?(\d+)\s*(s|second)"
# Search for any time durations that might be related to block time
rg --type go "time\.(Second|Minute|Hour)\s*\*\s*\d+"
# Search for any mentions of the old block time (15 seconds)
rg --type go "15\s*(s|second)"
Length of output: 1323 |
||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,8 +29,8 @@ const ( | |
|
||
// DefaultUpgradeHeightDelay is the number of blocks after a quorum has been | ||
// reached that the chain should upgrade to the new version. Assuming a block | ||
// interval of 12 seconds, this is 7 days. | ||
DefaultUpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. | ||
// interval of 6 seconds, this is 7 days. | ||
DefaultUpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 6) // 7 days * 24 hours * 60 minutes * 60 seconds / 6 seconds per block = 100,800 blocks. | ||
) | ||
Comment on lines
30
to
34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm I think this is doable because users of the earlier version will still crash in any case when the state machine transitions to v3 (even if nodes in the network have different values of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't doable? Or is? Thanks for the review! |
||
|
||
var ( | ||
|
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.
I'm curious if this will cause block time to be less than 6s? As before it was 15, but block times average around 12s on all networks.
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.
Decreasing the value for this constant won't actually lower block times. It looks like this constant is used in 3 places:
Instead the timeouts that need to be decreased to modify the block time are
TimeoutPropose
andTimeoutCommit
which Sanaz is working on in #3882There 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.
thank you for following up here. I think then it may be safe to close this PR?
and do these need to be modified in #3882?
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.
yea we should re-evaluate what those values should be. It doesn't have to strictly happen in #3882 but let's create a follow-up to tackle that. Thanks!
Update: created #3959
Agreed safe to close this PR.
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.
sweet, thanks for the help and context.