Commit d2091d43 authored by smartcontracts's avatar smartcontracts Committed by GitHub

fix[contracts]: Remove verifyExclusionProof (#772)

* fix[contracts]: Remove verifyExclusionProof

* chore: Add changeset
parent b90cfb9e
---
'@eth-optimism/contracts': patch
---
Removed verifyExclusionProof function from MerkleTrie library.
...@@ -92,34 +92,6 @@ library Lib_MerkleTrie { ...@@ -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. * @notice Updates a Merkle trie and returns a new root hash.
* @param _key Key of the node to update, as a hex string. * @param _key Key of the node to update, as a hex string.
......
...@@ -42,31 +42,6 @@ library Lib_SecureMerkleTrie { ...@@ -42,31 +42,6 @@ library Lib_SecureMerkleTrie {
return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root); 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. * @notice Updates a Merkle trie and returns a new root hash.
* @param _key Key of the node to update, as a hex string. * @param _key Key of the node to update, as a hex string.
......
...@@ -29,24 +29,6 @@ contract TestLib_MerkleTrie { ...@@ -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( function update(
bytes memory _key, bytes memory _key,
bytes memory _value, bytes memory _value,
......
...@@ -30,24 +30,6 @@ contract TestLib_SecureMerkleTrie { ...@@ -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( function update(
bytes memory _key, bytes memory _key,
bytes memory _value, bytes memory _value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment