From 2d5a55e11176452e0cbe2f74ba622ec1183f55dc Mon Sep 17 00:00:00 2001 From: Minhyuk Kim Date: Tue, 10 Dec 2024 14:09:54 +0900 Subject: [PATCH] Check the proof size is a multiple of 60 --- rvsol/src/RISCV.sol | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rvsol/src/RISCV.sol b/rvsol/src/RISCV.sol index 1bbb681e..7f8654e3 100644 --- a/rvsol/src/RISCV.sol +++ b/rvsol/src/RISCV.sol @@ -346,6 +346,13 @@ contract RISCV is IBigStepper { } if iszero(eq(_proof.offset, proofContentOffset())) { revert(0, 0) } + if mod(calldataload(sub(proofContentOffset(), 32)), 60) { + // proof offset must be stateContentOffset+paddedStateSize+32 + // proof size: 64-5+1=60 * 32 byte leaf, + // so the proofSize must be a multiple of 60 + revert(0, 0) + } + // // State loading //