Skip to content

feat!: Finalize non-empty blocks by allowing empty blocks after them#5320

Merged
dima74 merged 4 commits intohyperledger-iroha:mainfrom
dima74:diralik/allow-empty-blocks
Mar 7, 2025
Merged

feat!: Finalize non-empty blocks by allowing empty blocks after them#5320
dima74 merged 4 commits intohyperledger-iroha:mainfrom
dima74:diralik/allow-empty-blocks

Conversation

@dima74
Copy link
Copy Markdown
Contributor

@dima74 dima74 commented Feb 18, 2025

Context

Fixes #5317

Solution

If there are no transactions after a timeout period, and the previous block has transactions, then an empty block will be created. Note that there can't be two sequential empty blocks.

Migration Guide

An empty block will be added after a non-empty one if there are no transactions, therefore e.g. pre-commit trigger might get executed more times than you expected.

Also note about /status endpoint response fields:

  • blocks - existing field (no change), note that it will include empty blocks
  • blocks_non_empty - new field, count of non-empty blocks

Checklist

  • I've read CONTRIBUTING.md.
  • (optional) I've written unit tests for the code changes.
  • All review comments have been resolved.
  • All CI checks pass.

@dima74 dima74 self-assigned this Feb 18, 2025
@github-actions github-actions bot added the api-changes Changes in the API for client libraries label Feb 18, 2025
@s8sato s8sato self-assigned this Feb 19, 2025
Comment thread crates/iroha_core/src/sumeragi/main_loop.rs Outdated
Comment thread crates/iroha_core/src/block.rs
mversic
mversic previously approved these changes Feb 24, 2025
@dima74 dima74 changed the title feat!: Allow empty blocks feat!: Finalize non-empty blocks by allowing empty blocks after them Feb 25, 2025
@dima74 dima74 force-pushed the diralik/allow-empty-blocks branch from 844348c to 121a676 Compare February 25, 2025 15:54
Comment thread crates/iroha_data_model/src/events/pipeline.rs
Comment thread crates/iroha/tests/queries/mod.rs
Comment thread crates/iroha_core/src/sumeragi/main_loop.rs
Comment thread crates/iroha_data_model/src/block.rs Outdated
dima74 added 3 commits March 6, 2025 16:58
Signed-off-by: Dmitry Murzin <diralik@yandex.ru>
Signed-off-by: Dmitry Murzin <diralik@yandex.ru>
Signed-off-by: Dmitry Murzin <diralik@yandex.ru>
@dima74 dima74 force-pushed the diralik/allow-empty-blocks branch from 121a676 to 6fb1996 Compare March 6, 2025 14:18
@mversic mversic self-requested a review March 6, 2025 19:05
mversic
mversic previously approved these changes Mar 6, 2025
@mversic mversic requested a review from s8sato March 6, 2025 19:05
s8sato
s8sato previously approved these changes Mar 7, 2025
@s8sato
Copy link
Copy Markdown
Contributor

s8sato commented Mar 7, 2025

Could you add a commit to CHANGELOG.md in this PR and create backport PRs?

Signed-off-by: Dmitry Murzin <diralik@yandex.ru>
@dima74 dima74 dismissed stale reviews from s8sato and mversic via cb695e0 March 7, 2025 09:35
@dima74 dima74 merged commit 5368669 into hyperledger-iroha:main Mar 7, 2025
17 checks passed
@dima74 dima74 deleted the diralik/allow-empty-blocks branch March 7, 2025 12:58
dima74 added a commit to dima74/iroha that referenced this pull request Mar 7, 2025
dima74 added a commit to dima74/iroha that referenced this pull request Mar 7, 2025
s8sato pushed a commit that referenced this pull request Mar 7, 2025
…fter them (#5344)

* feat!: Finalize non-empty blocks by allowing empty blocks after them (#5320)

Signed-off-by: Dmitry Murzin <diralik@yandex.ru>

* chore: update CHANGELOG.md

Signed-off-by: Dmitry Murzin <diralik@yandex.ru>

* chore: minor version bump to `2.0.0-rc.1.3`

Signed-off-by: Dmitry Murzin <diralik@yandex.ru>

---------

Signed-off-by: Dmitry Murzin <diralik@yandex.ru>
s8sato pushed a commit that referenced this pull request Mar 7, 2025
… blocks after them (#5345)

* feat!: Finalize non-empty blocks by allowing empty blocks after them (#5320)

Signed-off-by: Dmitry Murzin <diralik@yandex.ru>

* chore: update CHANGELOG.md

Signed-off-by: Dmitry Murzin <diralik@yandex.ru>

* chore: minor version bump to `2.0.0-rc.1.3`

Signed-off-by: Dmitry Murzin <diralik@yandex.ru>

---------

Signed-off-by: Dmitry Murzin <diralik@yandex.ru>
Comment thread crates/iroha_test_network/src/lib.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-changes Changes in the API for client libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Finalize non-empty blocks by proactively creating the next block, even if it is empty

4 participants