Skip to content

Commit 59b7883

Browse files
authored
Merge pull request #101 from ethereum-optimism/feature/mininny/audit-4
Use modulo instead of and operation to validate the proof size
2 parents 726df05 + c3b3996 commit 59b7883

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rvgo/slow/vm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func Step(calldata []byte, po PreimageOracle) (stateHash common.Hash, outErr err
136136

137137
proofContentOffset := shortToU64(uint16(stateContentOffset) + paddedStateSize + 32)
138138

139-
if and(b32asBEWord(calldataload(shortToU64(uint16(stateContentOffset)+paddedStateSize))), shortToU256(60-1)) != (U256{}) {
139+
if mod(b32asBEWord(calldataload(shortToU64(uint16(stateContentOffset)+paddedStateSize))), shortToU256(60*32)) != toU256(0) {
140140
// proof offset must be stateContentOffset+paddedStateSize+32
141141
// proof size: 64-5+1=60 * 32 byte leaf,
142142
// but multiple memProof can be used, so the proofSize must be a multiple of 60

0 commit comments

Comments
 (0)