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

fix: Fix timestamp of genesis block #5098

Merged

Conversation

dima74
Copy link
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.

@mversic mversic merged commit c3ad903 into hyperledger-iroha:main Sep 25, 2024
17 of 18 checks passed
@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