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: Add support for consensus time period in blocks (#17536) #17920

Merged
merged 5 commits into from
Feb 21, 2025

Conversation

derektriley
Copy link
Contributor

@derektriley derektriley commented Feb 18, 2025

Description:
Currently, blocks are created based on a fixed number of rounds per block (default 1). This PR adds support for creating blocks based on a configurable period of consensus time. In addition, a marker file is written to disk when each block file is considered closed.

General:
BlockStreamConfig: updated to have configurable consensus time period for blocks @ConfigProperty(defaultValue = "2") @Min(0) @NetworkProperty int blockPeriod

Hedera.java: Replaced BiConsumer with BiPredicate for onSealConsensusRound. Updated the manageBlockEndRound method to return a boolean.

Added new HapiSpecWaitUntilNextBlock in test-clients to reliably wait until the next block is written to disk. This fixes issues in some test cases which want to wait until the next block.

Miscellaneous Changes:
FileBlockItemWriter.java: Modified to write a marker file when closing a block to indicate completion.
Updated tests which simulate post upgrade boundary to wait until genesis block is closed as classifying pending work is performed at the beginning of a block.
Related issue(s):

Fixes #17469

Notes for reviewer:

Checklist

  • [] Documented (Code comments, README, etc.)
  • [] Tested (unit, integration, etc.)

@derektriley derektriley added this to the v0.60 milestone Feb 18, 2025
@derektriley derektriley self-assigned this Feb 18, 2025
@derektriley derektriley marked this pull request as ready for review February 19, 2025 16:35
@derektriley derektriley requested review from a team as code owners February 19, 2025 16:35
@derektriley derektriley force-pushed the 17469-consensus-time-perid-blocks-2 branch from f278b14 to 9c5f13a Compare February 20, 2025 15:20
Signed-off-by: Derek Riley <[email protected]>
Copy link
Contributor

@Neeharika-Sompalli Neeharika-Sompalli left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @derektriley

@derektriley derektriley merged commit 007b529 into main Feb 21, 2025
41 checks passed
@derektriley derektriley deleted the 17469-consensus-time-perid-blocks-2 branch February 21, 2025 13:49
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.

Update BlockStreamManagerImpl to support blocks based on a configurable period of consensus time
5 participants