-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core)!: consensus hashing without extraneous length prefixes for …
…each write (#4420) Description --- - Removes extraneous length prefixes for each write done in consensus encoding. - cucumber: Corrects hashing for metadata, kernel and script sigs in cucumber tests - cucumber: Adds missing minimumValuePromise value from metadata hash - cucumber: fix use of hex string instead of buffer in hash - new genesis for esme and igor - new faucet utxos for esme Motivation and Context --- Because the `H.chain(a).chain(b) != H(a||b)` property does not hold in domain-separated hashes, we cannot allow writes to call Digest::update on a domain hasher. Prefixing the length for every element is redundant with ConsensusEncoding as it is canonical and well-defined (either fixed length, length prefixed, bit-prefixed (varint)). The PR uses a hash domain (`impl DomainSeparation`) to prepend a domain label, but uses consensus encoding directly after that so that `H.chain(a).chain(b) != H(a||b)` holds. Implementing the hashing in other languages, as in the cucumber tests, now becomes fairly trivial. How Has This Been Tested? --- `Clear out mempool` cucumber used for testing and passes confirming that all javascript hashes match the rust backend.
- Loading branch information
Showing
16 changed files
with
8,260 additions
and
4,322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8,002 changes: 4,001 additions & 4,001 deletions
8,002
base_layer/core/src/blocks/faucets/esmeralda_faucet.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.