Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Commit

Permalink
fix[contracts]: Remove verifyExclusionProof (ethereum-optimism#772)
Browse files Browse the repository at this point in the history
* fix[contracts]: Remove verifyExclusionProof

* chore: Add changeset
  • Loading branch information
smartcontracts authored May 5, 2021
1 parent 59467d4 commit 16ab4c1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 89 deletions.
5 changes: 5 additions & 0 deletions .changeset/thin-horses-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/contracts': patch
---

Removed verifyExclusionProof function from MerkleTrie library.
Original file line number Diff line number Diff line change
Expand Up @@ -92,34 +92,6 @@ library Lib_MerkleTrie {
);
}

/**
* @notice Verifies a proof that a given key is *not* present in
* the Merkle trie.
* @param _key Key of the node to search for, as a hex string.
* @param _proof Merkle trie inclusion proof for the node *nearest* the
* target node.
* @param _root Known root of the Merkle trie. Used to verify that the
* included proof is correctly constructed.
* @return _verified `true` if the key is absent in the trie, `false` otherwise.
*/
function verifyExclusionProof(
bytes memory _key,
bytes memory _proof,
bytes32 _root
)
internal
pure
returns (
bool _verified
)
{
(
bool exists,
) = get(_key, _proof, _root);

return exists == false;
}

/**
* @notice Updates a Merkle trie and returns a new root hash.
* @param _key Key of the node to update, as a hex string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,6 @@ library Lib_SecureMerkleTrie {
return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);
}

/**
* @notice Verifies a proof that a given key is *not* present in
* the Merkle trie.
* @param _key Key of the node to search for, as a hex string.
* @param _proof Merkle trie inclusion proof for the node *nearest* the
* target node.
* @param _root Known root of the Merkle trie. Used to verify that the
* included proof is correctly constructed.
* @return _verified `true` if the key is not present in the trie, `false` otherwise.
*/
function verifyExclusionProof(
bytes memory _key,
bytes memory _proof,
bytes32 _root
)
internal
pure
returns (
bool _verified
)
{
bytes memory key = _getSecureKey(_key);
return Lib_MerkleTrie.verifyExclusionProof(key, _proof, _root);
}

/**
* @notice Updates a Merkle trie and returns a new root hash.
* @param _key Key of the node to update, as a hex string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,6 @@ contract TestLib_MerkleTrie {
);
}

function verifyExclusionProof(
bytes memory _key,
bytes memory _proof,
bytes32 _root
)
public
pure
returns (
bool
)
{
return Lib_MerkleTrie.verifyExclusionProof(
_key,
_proof,
_root
);
}

function update(
bytes memory _key,
bytes memory _value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,6 @@ contract TestLib_SecureMerkleTrie {
);
}

function verifyExclusionProof(
bytes memory _key,
bytes memory _proof,
bytes32 _root
)
public
pure
returns (
bool
)
{
return Lib_SecureMerkleTrie.verifyExclusionProof(
_key,
_proof,
_root
);
}

function update(
bytes memory _key,
bytes memory _value,
Expand Down

0 comments on commit 16ab4c1

Please sign in to comment.