Skip to content

Commit 002102b

Browse files
committed
chore: add docs explaining why merkle leaves do not need to be hashed in sdk
1 parent 5a28bc8 commit 002102b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

batcher/aligned-sdk/src/sdk/aggregation.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ impl AggregationModeVerificationData {
4949

5050
// We use a newtype wrapper around `[u8; 32]` because Rust's orphan rule
5151
// prevents implementing a foreign trait (`IsMerkleTreeBackend`) for a foreign type (`[u8; 32]`).
52-
#[derive(Default, PartialEq, Eq)]
53-
struct Hash32([u8; 32]);
52+
#[derive(Default, Debug, PartialEq, Eq)]
53+
pub struct Hash32([u8; 32]);
5454

5555
impl IsMerkleTreeBackend for Hash32 {
5656
type Data = Hash32;
5757
type Node = [u8; 32];
5858

59+
/// We don't have to hash the data, as the blob already contains the proof commitments (which represent the merkle leaves)
5960
fn hash_data(leaf: &Self::Data) -> Self::Node {
6061
leaf.0
6162
}

0 commit comments

Comments
 (0)