Skip to content

Commit

Permalink
Merge pull request #101 from ethereum-optimism/feature/mininny/audit-4
Browse files Browse the repository at this point in the history
Use modulo instead of and operation to validate the proof size
  • Loading branch information
mininny authored Jan 22, 2025
2 parents 726df05 + c3b3996 commit 59b7883
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 @@ -136,7 +136,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))), shortToU256(60*32)) != toU256(0) {

Check failure on line 139 in rvgo/slow/vm.go

View workflow job for this annotation

GitHub Actions / rvgo-lint

undefined: toU256 (typecheck)

Check failure on line 139 in rvgo/slow/vm.go

View workflow job for this annotation

GitHub Actions / rvgo-lint

undefined: toU256) (typecheck)

Check failure on line 139 in rvgo/slow/vm.go

View workflow job for this annotation

GitHub Actions / rvgo-tests

undefined: toU256
// 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 59b7883

Please sign in to comment.