Skip to content

empty merkle tree should not be all 0 #21

@jialinli98

Description

@jialinli98

Aim

impl<let N: u32, H> MerkleTree<N, H> {
    pub fn empty() -> Self {
        MerkleTree { leaves: [0; N], nodes: [0; N - 1] }
    }

It's a bit misleading to have an empty tree to be all 0.

Expected Behavior

We should be using calculate_empty_tree_root

Bug

impl<let N: u32, H> MerkleTree<N, H> {
    pub fn empty() -> Self {
        MerkleTree { leaves: [0; N], nodes: [0; N - 1] }
    }

To Reproduce

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

No response

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions