Skip to content

Commit b9f269e

Browse files
committed
increment height in peptide proof
1 parent 1dcd580 commit b9f269e

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

contracts/core/proofAPI/CrossL2Prover.sol

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
pragma solidity ^0.8.0;
18+
pragma solidity 0.8.15;
1919

2020
import {RLPReader} from "optimism/libraries/rlp/RLPReader.sol";
2121
import {MerkleTrie} from "optimism/libraries/trie/MerkleTrie.sol";
@@ -60,7 +60,9 @@ contract CrossL2Prover is AppStateVerifier, ICrossL2Prover {
6060
// VerifyMembership verifies the receipt root through an ics23 proof of peptide state that attests that the
6161
// given eventHeight has the receipt root at the peptide height
6262
this.verifyMembership(
63-
bytes32(_getPeptideAppHash(peptideAppProof.height)),
63+
bytes32(_getPeptideAppHash(peptideAppProof.height - 1)), // a proof generated at height H can only be
64+
// verified against state root (app hash) from block H - 1. this means the relayer must have updated the
65+
// contract with the app hash from the previous block and that is why we use proof.height - 1 here.
6466
Ibc.receiptRootKey(peptideClientId, eventHeight),
6567
abi.encodePacked(receiptRoot),
6668
peptideAppProof

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@open-ibc/vibc-core-smart-contracts",
3-
"version": "4.0.13",
3+
"version": "4.0.14",
44
"main": "dist/index.js",
55
"bin": {
66
"verify-vibc-core-smart-contracts": "./dist/scripts/verify-contract-script.js",

0 commit comments

Comments
 (0)