-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support padding for the leaves of the merkle tree #647
base: main
Are you sure you want to change the base?
Conversation
…can cause the test to seg-fault Signed-off-by: Koren-Brand <[email protected]>
This reverts commit 8018c0d.
…g to generate a proof of the last (and only) leaf index Signed-off-by: Koren-Brand <[email protected]>
Signed-off-by: Koren-Brand <[email protected]>
… padded_leaves (during build, init_padded_leaves, line 441) Signed-off-by: Koren-Brand <[email protected]>
…ing test for last value padding Signed-off-by: Koren-Brand <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support padding for the leaves of the merkle tree
346d918
to
c861d20
Compare
… cuda always has zeros in some parts Signed-off-by: Koren-Brand <[email protected]>
Signed-off-by: Koren-Brand <[email protected]>
…ed) and some additional memory leaks in Merkle tree cpu backend as well as the hash tests Signed-off-by: Koren-Brand <[email protected]>
Signed-off-by: Koren-Brand <[email protected]>
… the same test to cpp test_hash_api) Signed-off-by: Koren-Brand <[email protected]>
…ents weren't randomized properly Signed-off-by: Koren-Brand <[email protected]>
Signed-off-by: Koren-Brand <[email protected]>
~CPUMerkleTreeBackend() | ||
{ | ||
for (auto& pair : m_map_segment_id_2_inputs) { | ||
delete pair.second; // Ensure all dynamically allocated memory is freed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modern C++ should avoid new/malloc+delete/free and use smart pointers anyway. This would avoid the leak and also works when exceptions are thrown.
There is usually no reason to use malloc/new
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
m_map_segment_id_2_inputs.erase(completed_segment_id); | ||
auto segment = m_map_segment_id_2_inputs.find(completed_segment_id); | ||
if (segment != m_map_segment_id_2_inputs.end()) { | ||
delete segment->second; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment here. With smart pointers you only need to erase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Signed-off-by: Koren-Brand <[email protected]>
Signed-off-by: Koren-Brand <[email protected]>
…ding tests Signed-off-by: Koren-Brand <[email protected]>
… same test_merkle_tree function Signed-off-by: Koren-Brand <[email protected]>
Signed-off-by: Koren-Brand <[email protected]>
… been addressed Signed-off-by: Koren-Brand <[email protected]>
Signed-off-by: Koren-Brand <[email protected]>
Support padding for the leaves of the merkle tree