-
Notifications
You must be signed in to change notification settings - Fork 177
Labels
PlatformTickets pertaining to the platformTickets pertaining to the platform
Milestone
Description
As a follow up to issue #21030 and PR #21523, The State API needs a way to turn the Merkle Path long
into a MerkleProof
The MerkleProof
needs to have the following things:
- The
StateItem
as bytes orStateItem
protobuf object or alternatively theMerkleLeaf
containing aStateItem
. Whichever form is easiest and the least computation to provide is fine. - A List called
siblingHashes
from the leaf StateItem to the root of the state. - A List<byte[]> of
innerParentHashes
where the following properties hold
- innerParentHashes.get(0) == Hash(MerkleLeaf) or Hash(StateItem)
- whichever is actually used for the hash of the leaf.
- innerParentHashes.get(n+1) == Hash(innerParentHashes.get(n) [+] siblingHashes.get(n).hash())
- where the order around [+] can be swapped based on whether the sibling hash is left or right.
A SiblingHash
contains:
- A boolean indicating if its a right or left sibling
- The SHA-384 hash of the sibling in the merkle tree.
When hashing the StateItem
and combining with the SiblingHash
es in the order of the list, the root hash of the state should be derived.
- This should be verified in unit tests for Singletons, Queues, and Maps.
Metadata
Metadata
Assignees
Labels
PlatformTickets pertaining to the platformTickets pertaining to the platform
Type
Projects
Status
🛠 In Progress