hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
438 stars 280 forks source link

fix: Fix timestamp of genesis block #5098

Closed dima74 closed 1 month ago

dima74 commented 1 month ago

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