Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Add a new interface to remove keys from proof #127

Merged
merged 10 commits into from
Sep 5, 2023

Conversation

hrmhatef
Copy link
Contributor

@hrmhatef hrmhatef commented Aug 3, 2023

What was the problem?

This PR resolves #124

How was it solved?

  • Implement a new function to removing keys from proof.

How was it tested?

  • Add a new unit test for a new API
  • All tests passed

@hrmhatef hrmhatef force-pushed the 124_add_remove_key_from_proof branch 3 times, most recently from a7584e9 to 130b1c7 Compare August 3, 2023 15:46
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

Commit SHA:c670bf5652e7d6b28aa80332efddd058cbe73dde

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🔴 total 87.06 (-0.36) 69.65 (-0.28) 94.33 (0.1) 86.84 (-0.36)
🔴 sparse_merkle_tree.js 86 (-2.63) 66.66 (-2.57) 100 (0) 85.41 (-2.68)

@github-actions
Copy link

github-actions bot commented Aug 3, 2023

Commit SHA:c670bf5652e7d6b28aa80332efddd058cbe73dde
Current PR reduces the test coverage percentage by 0.2 for some tests

@hrmhatef hrmhatef force-pushed the 124_add_remove_key_from_proof branch 3 times, most recently from 1e477af to b2e4e6d Compare August 4, 2023 08:42
@github-actions
Copy link

github-actions bot commented Aug 4, 2023

Commit SHA:e31668b0a1518ecc373972a516827c829528c692

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.64 (0.22) 70.34 (0.41) 94.33 (0.1) 87.42 (0.22)
🟢 sparse_merkle_tree.js 90 (1.37) 73.33 (4.1) 100 (0) 89.58 (1.49)

@hrmhatef hrmhatef requested review from shuse2 and ricott1 August 4, 2023 09:29
@hrmhatef hrmhatef self-assigned this Aug 4, 2023
Copy link
Collaborator

@shuse2 shuse2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far I only reviewed remove_keys_from_proof. maybe it would be more descriptive if we create special type for some of the vector with mutation methods?

src/sparse_merkle_tree/smt.rs Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
@hrmhatef hrmhatef force-pushed the 124_add_remove_key_from_proof branch from 2e253ad to 6567fdd Compare August 11, 2023 17:09
@github-actions
Copy link

Commit SHA:37b54e0ec9ab50d4808fbc41b7a9541b357ff5f1

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.64 (0.22) 70.34 (0.41) 94.33 (0.1) 87.42 (0.22)
🟢 sparse_merkle_tree.js 90 (1.37) 73.33 (4.1) 100 (0) 89.58 (1.49)

@hrmhatef hrmhatef force-pushed the 124_add_remove_key_from_proof branch 2 times, most recently from c711de4 to 1c475c3 Compare August 12, 2023 10:15
@github-actions
Copy link

Commit SHA:0b07591131948673cefa9fe053de8249cb691955

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.64 (0.51) 70.34 (1.11) 94.33 (0.1) 87.42 (0.52)
🟢 sparse_merkle_tree.js 90 (1.37) 73.33 (4.1) 100 (0) 89.58 (1.49)
🟢 state_db.js 90.47 (0.68) 72.05 (1.47) 98.5 (0) 90.34 (0.69)

@github-actions
Copy link

Commit SHA:ed283783876ed59ca52efa9b54ec8686129aea80

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.64 (0.22) 70.34 (0.41) 94.33 (0.1) 87.42 (0.22)
🟢 sparse_merkle_tree.js 90 (1.37) 73.33 (4.1) 100 (0) 89.58 (1.49)

@github-actions
Copy link

Commit SHA:adb91010aff2d70efd657d82f84cd867e82bb18b

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.64 (0.22) 70.34 (0.41) 94.33 (0.1) 87.42 (0.22)
🟢 sparse_merkle_tree.js 90 (1.37) 73.33 (4.1) 100 (0) 89.58 (1.49)

sparse_merkle_tree.js Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
src/sparse_merkle_tree/in_memory_smt.rs Show resolved Hide resolved
test/sparse_merkle_tree.spec.js Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
@github-actions
Copy link

Commit SHA:b3863c0cb86e5b63878c4b088fbe93a3eb31b9e6

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.64 (0.22) 70.34 (0.41) 94.33 (0.1) 87.42 (0.22)
🟢 sparse_merkle_tree.js 90 (1.37) 73.33 (4.1) 100 (0) 89.58 (1.49)

Copy link
Contributor

@matjazv matjazv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's better to use passive adjectives form instead of an active, so we could change below variable names:

adding_sibling_hashes -> added_sibling_hashes
removing_sibling_hashes -> removed_sibling_hashes
adding_sibling_hash_index -> added_sibling_hash_index
removingKeys -> removedKeys
get_removing_keys_parameters -> get_removed_keys_parameters
removing_keys -> removed_keys
parsed_removing_keys -> parsed_removed_keys

src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
sparse_merkle_tree.js Outdated Show resolved Hide resolved
@github-actions
Copy link

Commit SHA:ac36e92d133cca3e8e360f353a92f2d6ab9cdecf

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.64 (0.22) 70.34 (0.41) 94.33 (0.1) 87.42 (0.22)
🟢 sparse_merkle_tree.js 90 (1.37) 73.33 (4.1) 100 (0) 89.58 (1.49)

@hrmhatef hrmhatef force-pushed the 124_add_remove_key_from_proof branch from 188f613 to c0ce5fb Compare August 15, 2023 08:45
@github-actions
Copy link

Commit SHA:20dca793a47c81208dbeb5b9d79d81da9b839915

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.64 (0.22) 70.34 (0.41) 94.33 (0.1) 87.42 (0.22)
🟢 sparse_merkle_tree.js 90 (1.37) 73.33 (4.1) 100 (0) 89.58 (1.49)

@hrmhatef hrmhatef force-pushed the 124_add_remove_key_from_proof branch from c0ce5fb to bf1ec0b Compare August 15, 2023 12:40
@github-actions
Copy link

Commit SHA:70eae292db9c680e0b58ff937bf6da1db28e26ee

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.35 (0.22) 69.65 (0.42) 94.33 (0.1) 87.13 (0.23)
🟢 sparse_merkle_tree.js 90 (1.37) 73.33 (4.1) 100 (0) 89.58 (1.49)

@hrmhatef hrmhatef force-pushed the 124_add_remove_key_from_proof branch from bf1ec0b to 0f527ec Compare August 30, 2023 11:49
@github-actions
Copy link

Commit SHA:cb7cdfb68e52a644831063aaf4a94cc8e50db6c7

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.64 (0.22) 70.34 (0.41) 94.33 (0.1) 87.42 (0.22)
🟢 sparse_merkle_tree.js 90 (1.37) 73.33 (4.1) 100 (0) 89.58 (1.49)

src/sparse_merkle_tree/smt.rs Outdated Show resolved Hide resolved
src/sparse_merkle_tree/in_memory_smt.rs Outdated Show resolved Hide resolved
@hrmhatef hrmhatef requested a review from matjazv August 31, 2023 06:51
@github-actions
Copy link

Commit SHA:4462aa4fdd375d4fad9d5493acf247ce9f2f0c25

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 124_add_remove_key_from_proof 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.64 (0.22) 70.34 (0.41) 94.33 (0.1) 87.42 (0.22)
🟢 sparse_merkle_tree.js 90 (1.37) 73.33 (4.1) 100 (0) 89.58 (1.49)

Copy link
Contributor

@matjazv matjazv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! 🚀

@shuse2 shuse2 merged commit c01798b into main Sep 5, 2023
8 checks passed
@shuse2 shuse2 deleted the 124_add_remove_key_from_proof branch September 5, 2023 08:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a new interface to remove query keys from proof
4 participants