Skip to content

fix: Fix timestamp of genesis block#5098

Merged
mversic merged 1 commit intohyperledger-iroha:mainfrom
dima74:diralik/fix-genesis-block-time
Sep 25, 2024
Merged

fix: Fix timestamp of genesis block#5098
mversic merged 1 commit intohyperledger-iroha:mainfrom
dima74:diralik/fix-genesis-block-time

Conversation

@dima74
Copy link
Copy Markdown
Contributor

@dima74 dima74 commented Sep 24, 2024

Context

Currently, genesis block might be created with time equal to genesis transaction creation time. We have invariant that "transaction creation time" < "block creation time" (added in #4928), so this will result in error:

thread 'tokio-runtime-worker' panicked at crates/iroha_core/src/kura.rs:331:14:
INTERNAL BUG: Failed to decode block: ParityScale("Could not decode `SignedBlock::V1.0`:\n\tCould not decode `SignedBlockCandidate::payload`:\n\t\tTransaction creation time is ahead of block creation time\n")

Solution

Ensure that genesis block time is at least 1 millisecond ahead of genesis transaction time.

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.

Signed-off-by: Dmitry Murzin <diralik@yandex.ru>
@mversic mversic merged commit c3ad903 into hyperledger-iroha:main Sep 25, 2024
@dima74 dima74 deleted the diralik/fix-genesis-block-time branch September 25, 2024 08:09
@alexstroke1 alexstroke1 self-assigned this Sep 25, 2024
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.

4 participants