Skip to content

Commit

Permalink
Use modulo instead of and operation to validate the proof size
Browse files Browse the repository at this point in the history
  • Loading branch information
mininny committed Dec 10, 2024
1 parent 8ff9318 commit 953afcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rvgo/slow/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 953afcc

Please sign in to comment.