Skip to content

binary-merkle-tree: optimize ProofCollection by preallocating proof with size ceil(log2(n)) #9106

Description

@StackOverflowExcept1on

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Motivation

/// The struct collects a proof for single leaf.
struct ProofCollection<T> {
proof: Vec<T>,
position: u32,
}
impl<T> ProofCollection<T> {
fn new(position: u32) -> Self {
ProofCollection { proof: Default::default(), position }
}
}

Request

n/a

Solution

n/a

Are you willing to help with this request?

Yes!

Metadata

Metadata

Assignees

No one assigned

    Labels

    I5-enhancementAn additional feature request.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions