HCS running hash should concatenate message hash & not message #36
Labels
Bug
An error that causes the feature to behave differently than what was expected based on design.
Impact
Potentially impacts SDK, clients, docs and/or users.
P1
High priority issue, which must be completed in the milestone otherwise the release is at risk.
Release Note
Issues which need a release note created.
Summary of the defect
The new
topicRunningHash
of a topic receiving aConsensusSubmitMessage
should be theSHA-384
digest of, in order:topicRunningHash
of the topic (48 bytes)topicRunningHashVersion
(8 bytes)shard
(8 bytes)realm
(8 bytes)number
(8 bytes)ConsensusSubmitMessage
reached consensus (8 bytes)ConsensusSubmitMessage
reached consensus (4 bytes)topicSequenceNumber
(8 bytes)ConsensusSubmitMessage
(48 bytes)But in fact, we have not versioned the topic running hash; and are updating the digest with the bytes of the submitted message, not their SHA-384 hash.
Suggested resolution
topicRunningHashVersion
to the protobufTransactionReceipt
type.Impact
Mirror nodes should store for each message, the version number of the record for it. That way, when checking the running hash, they know how to calculate it for both old messages and new messages.
The text was updated successfully, but these errors were encountered: