From 953afcc546a1c19f55189f95638ca4f102b2b534 Mon Sep 17 00:00:00 2001 From: Minhyuk Kim Date: Tue, 10 Dec 2024 14:01:41 +0900 Subject: [PATCH] Use modulo instead of and operation to validate the proof size --- rvgo/slow/vm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rvgo/slow/vm.go b/rvgo/slow/vm.go index 458f00c6..aabefad9 100644 --- a/rvgo/slow/vm.go +++ b/rvgo/slow/vm.go @@ -129,7 +129,7 @@ func Step(calldata []byte, po PreimageOracle) (stateHash common.Hash, outErr err proofContentOffset := shortToU64(uint16(stateContentOffset) + paddedStateSize + 32) - if and(b32asBEWord(calldataload(shortToU64(uint16(stateContentOffset)+paddedStateSize))), shortToU256(60-1)) != (U256{}) { + if mod(b32asBEWord(calldataload(shortToU64(uint16(stateContentOffset)+paddedStateSize))), toU256(60)) != toU256(0) { // proof offset must be stateContentOffset+paddedStateSize+32 // proof size: 64-5+1=60 * 32 byte leaf, // but multiple memProof can be used, so the proofSize must be a multiple of 60