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

Added missing checks and handling of invalid non-inclusion proof in smt.rs #133

Merged
merged 3 commits into from
Sep 20, 2023

Conversation

matjazv
Copy link
Contributor

@matjazv matjazv commented Sep 11, 2023

What was the problem?

This PR resolves #132.

How was it solved?

  • Implemented missing check that the queries length is equal to length of proof.queries before the loop in verifyInclusionProof and verifyNonInclusionProof functions.
  • Bumping RocksDB version from 0.19 to 0.21 to make CI on Windows machine working.
  • Fixed handling of invalid non-inclusion proof.

How was it tested?

  • New unit tests were added.
  • All previous unit tests passed.

@matjazv matjazv self-assigned this Sep 11, 2023
@matjazv matjazv force-pushed the 132-inclusion-non-inclusion-proof-check branch from d065798 to 511e26d Compare September 11, 2023 15:10
@github-actions
Copy link

Commit SHA:8a4f684843d31ae37618811cfeb4b5262b7cecb0

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 132-inclusion-non-inclusion-proof-check 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.5 (0.15) 70.46 (0.81) 94.33 (0) 87.28 (0.15)
🔴 sparse_merkle_tree.js 88.88 (-1.12) 73.68 (0.35) 100 (0) 88.46 (-1.12)
🟢 state_db.js 90.47 (0.68) 72.05 (1.47) 98.5 (0) 90.34 (0.69)

@github-actions
Copy link

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

@github-actions
Copy link

Commit SHA:f9f2659876bc60397396cd6031efaf06cd5160f0

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 132-inclusion-non-inclusion-proof-check 
Status File % Stmts % Branch % Funcs % Lines
🔴 total 87.5 (-0.14) 70.46 (0.12) 94.33 (0) 87.28 (-0.14)
🔴 sparse_merkle_tree.js 88.88 (-1.12) 73.68 (0.35) 100 (0) 88.46 (-1.12)

@github-actions
Copy link

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

@github-actions
Copy link

Commit SHA:a7be0fde65bea1d5ee137ce1130254c94d2625e1

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 132-inclusion-non-inclusion-proof-check 
Status File % Stmts % Branch % Funcs % Lines
🔴 total 87.5 (-0.14) 70.46 (0.12) 94.33 (0) 87.28 (-0.14)
🔴 sparse_merkle_tree.js 88.88 (-1.12) 73.68 (0.35) 100 (0) 88.46 (-1.12)

@github-actions
Copy link

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

@github-actions
Copy link

Commit SHA:a7be0fde65bea1d5ee137ce1130254c94d2625e1

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 132-inclusion-non-inclusion-proof-check 
Status File % Stmts % Branch % Funcs % Lines
🔴 total 87.5 (-0.14) 70.46 (0.12) 94.33 (0) 87.28 (-0.14)
🔴 sparse_merkle_tree.js 88.88 (-1.12) 73.68 (0.35) 100 (0) 88.46 (-1.12)

@github-actions
Copy link

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

@github-actions
Copy link

Commit SHA:5ecfb06fd541f2c53f917319e3e0e59f920d5ec7

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 132-inclusion-non-inclusion-proof-check 
Status File % Stmts % Branch % Funcs % Lines
🔴 total 87.5 (-0.14) 70.46 (0.12) 94.33 (0) 87.28 (-0.14)
🔴 sparse_merkle_tree.js 88.88 (-1.12) 73.68 (0.35) 100 (0) 88.46 (-1.12)

@github-actions
Copy link

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

@matjazv matjazv force-pushed the 132-inclusion-non-inclusion-proof-check branch from 1dae25a to 014583e Compare September 12, 2023 12:32
@github-actions
Copy link

Commit SHA:fba8a2f711881fbe870fcc13826394e2a4ea29eb

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 132-inclusion-non-inclusion-proof-check 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.78 (0.14) 71.14 (0.8) 94.33 (0) 87.57 (0.15)
🟢 sparse_merkle_tree.js 90.74 (0.74) 78.94 (5.61) 100 (0) 90.38 (0.8)

@matjazv matjazv changed the title Added missing check in verifyInclusionProof and verifyNonInclusionProof functions Added missing checks and handling of invalid non-inclusion proof in smt.rs Sep 20, 2023
@github-actions
Copy link

Commit SHA:5d4479ea05d10eda41fb32f8d472e3e0ac9ddeb7

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 132-inclusion-non-inclusion-proof-check 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 87.78 (0.14) 71.14 (0.8) 94.33 (0) 87.57 (0.15)
🟢 sparse_merkle_tree.js 90.74 (0.74) 78.94 (5.61) 100 (0) 90.38 (0.8)

@shuse2 shuse2 merged commit 4c5ff1a into main Sep 20, 2023
8 checks passed
@shuse2 shuse2 deleted the 132-inclusion-non-inclusion-proof-check branch September 20, 2023 09:44
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.

Missing checks for array length and handling of invalid non-inclusion proof
3 participants