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(consensus/cometbft): stable block time #2422

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

melekes
Copy link

@melekes melekes commented Jan 27, 2025

using FinalizeBlockResponse.NextBlockDelay feature
cometbft/cometbft#3089

func SetTargetBlockTime[
LoggerT log.AdvancedLogger[LoggerT],
](t time.Duration) func(*Service[LoggerT]) {
return func(bs *Service[LoggerT]) { bs.setTargetBlockTime(t) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

note that we do enforce some floor on timeouts in

func validateConfig(cfg *cmtcfg.Config) error {

Copy link
Author

Choose a reason for hiding this comment

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

Makes sense. I will factor this in.

Copy link
Author

Choose a reason for hiding this comment

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

It is unclear to me how to do it from the API perspective. Do you have any suggestions @abi87?


// ToBytes converts the blockDelay to bytes.
func (d *blockDelay) ToBytes() []byte {
bz, err := json.Marshal(d)
Copy link
Author

Choose a reason for hiding this comment

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

this is probably sub-optimal

consensus/cometbft/service/block_delay.go Outdated Show resolved Hide resolved
consensus/cometbft/service/service.go Show resolved Hide resolved
melekes added a commit to informalsystems/beacon-kit that referenced this pull request Feb 1, 2025
@abi87 abi87 linked an issue Feb 3, 2025 that may be closed by this pull request
using FinalizeBlockResponse.NextBlockDelay feature
cometbft/cometbft#3089
@melekes melekes marked this pull request as ready for review February 12, 2025 06:50
@melekes melekes requested a review from a team as a code owner February 12, 2025 06:50
@melekes melekes changed the title feat: stable block time feat(consensus/cometbft): stable block time Feb 12, 2025
@melekes
Copy link
Author

melekes commented Feb 12, 2025

Do we need to enforce a minimum for NextBlockDelay #2422 (comment)?

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.

feat(4788): Block Time Clock MVP
4 participants