Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
12537e1
contracts-bedrock: delete dead config (#14146)
tynes Feb 4, 2025
cde131d
feat: prevent ASR deployment collisions (#14134)
maurelian Feb 4, 2025
436a58a
supervisor: Refactor `Contains` ; Check Timestamps (#14152)
axelKingsley Feb 4, 2025
a3c8069
interop: Add metrics to track CrossUnsafe and CrossSafe heads. (#13923)
tcrypt25519 Feb 4, 2025
58a3e22
feat: Update forge-std to latest tag (#14151)
maurelian Feb 4, 2025
80d90ba
feat: use v4 engine APIs when Isthmus enabled (#13976)
meyer9 Feb 4, 2025
66c80c8
dependabot(gomod): bump github.com/consensys/gnark-crypto (#14089)
dependabot[bot] Feb 5, 2025
9dbcbd4
feat: add Prague to genesis script based on Isthmus (#14093)
meyer9 Feb 5, 2025
0d952bd
op-supervisor: Implement supervisor_syncStatus RPC (#14138)
Inphi Feb 5, 2025
cec3c82
op-e2e: Refactor interop fault proofs tests (#14135)
ajsutton Feb 5, 2025
e973521
ci: Record git hash with uploaded prestates (#14080)
ajsutton Feb 5, 2025
714d1e8
contracts-bedrock: delete dead code (#14163)
tynes Feb 5, 2025
909ee37
op-service/txmgr: fix `pending_txs` metric (#14168)
geoknee Feb 5, 2025
20e322d
feat: etch and reset upgrader (#14150)
maurelian Feb 5, 2025
723ece7
op-program: reuse EVM instance in L2 block processor (#14170)
pcw109550 Feb 5, 2025
420be9c
cannon: Expand test coverage (#14175)
mbaxter Feb 5, 2025
e59db82
Opcm/restore abs prestate (#14137)
maurelian Feb 5, 2025
70d936b
ci: Separate coverage and fuzzing jobs (#14178)
mslipper Feb 5, 2025
fde839a
op-supervisor: Refactor Database Nomenclature (#14157)
axelKingsley Feb 5, 2025
271a745
feat: reconfigure gas snapshot into standard test (#14153)
smartcontracts Feb 5, 2025
ac1bf06
add advice about triggering CI on external fork PRS (#14176)
geoknee Feb 5, 2025
f74572d
ci: Separate out contracts tests (#14189)
mslipper Feb 5, 2025
a96a098
ci: Tweak rerun parameters (#14193)
mslipper Feb 5, 2025
ab6283f
Revert "interop: Add metrics to track CrossUnsafe and CrossSafe heads…
axelKingsley Feb 5, 2025
8cef655
fix: bound DGF search tests for upgrade tests (#14195)
smartcontracts Feb 5, 2025
9e879c8
op-program: use withdrawalsRoot from header if Isthmus (#14180)
Inphi Feb 5, 2025
db62b8f
Maur/faster upgrade coverage (#14191)
maurelian Feb 5, 2025
37f0dc8
Merge branch 'develop' into fix/merge-conflict-lockbox-11
agusduha Feb 6, 2025
9c582f4
fix: pre pr
agusduha Feb 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 39 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ commands:
user=$(whoami)
echo "$user" > .executor-user
echo "Set executor user to $user."

if [[ "$user" == "root" ]]; then
# Self-hosted runners will persist this cache between runs. Cleaning it up means that we
# preserve the semantics of the cache regardless of executor type. It's also much faster
# to delete the cache and recreate it than it is to overwrite it in place.
rm -rf /data/mise-data
echo "Cleaned up cache data."

mkdir -p /data/mise-data
echo "Created Mise data dir."
mkdir -p ~/.cache
Expand All @@ -206,7 +206,7 @@ commands:
else
curl https://mise.run | sh
fi

echo "export PATH=\"$HOME/.local/bin:\$PATH\"" >> "$BASH_ENV"
echo "export MISE_DATA_DIR=/data/mise-data" >> "$BASH_ENV"
echo "export MISE_JOBS=$(nproc)" >> "$BASH_ENV"
Expand Down Expand Up @@ -676,8 +676,10 @@ jobs:
working_directory: packages/contracts-bedrock

contracts-bedrock-tests:
machine: true
resource_class: ethereum-optimism/latitude-1
circleci_ip_ranges: true
docker:
- image: <<pipeline.parameters.default_docker_image>>
resource_class: xlarge
parameters:
test_list:
description: List of test files to run
Expand Down Expand Up @@ -760,8 +762,10 @@ jobs:
- notify-failures-on-develop

contracts-bedrock-coverage:
machine: true
resource_class: ethereum-optimism/latitude-1
circleci_ip_ranges: true
docker:
- image: <<pipeline.parameters.default_docker_image>>
resource_class: 2xlarge
parameters:
test_flags:
description: Additional flags to pass to the test command
Expand Down Expand Up @@ -798,6 +802,15 @@ jobs:
command: |
sudo apt-get update
sudo apt-get install -y lcov
- run:
name: Write pinned block number for cache key
command: |
just print-pinned-block-number > ./pinnedBlockNumber.txt
cat pinnedBlockNumber.txt
working_directory: packages/contracts-bedrock
- restore_cache:
name: Restore forked state
key: forked-state-contracts-bedrock-tests-upgrade-{{ checksum "packages/contracts-bedrock/pinnedBlockNumber.txt" }}
- run:
name: Run coverage tests
command: just coverage-lcov-all <<parameters.test_flags>>
Expand Down Expand Up @@ -846,7 +859,6 @@ jobs:
command: |
just print-pinned-block-number > ./pinnedBlockNumber.txt
cat pinnedBlockNumber.txt
pwd
working_directory: packages/contracts-bedrock
- restore_cache:
name: Restore forked state
Expand Down Expand Up @@ -910,8 +922,6 @@ jobs:
command: validate-deploy-configs
- run-contracts-check:
command: lint
- run-contracts-check:
command: gas-snapshot-check
- run-contracts-check:
command: snapshots-check-no-build
- run-contracts-check:
Expand Down Expand Up @@ -952,8 +962,9 @@ jobs:
description: should load in foundry artifacts
type: boolean
default: false
machine: true
resource_class: ethereum-optimism/latitude-1
docker:
- image: <<pipeline.parameters.default_docker_image>>
resource_class: xlarge
steps:
- checkout-with-mise
- check-changed:
Expand Down Expand Up @@ -1063,7 +1074,8 @@ jobs:
gotestsum --format=testname \
--junitfile=./tmp/test-results/results.xml \
--jsonfile=./tmp/testlogs/log.json \
--rerun-fails=2 \
--rerun-fails=3 \
--rerun-fails-max-failures=50 \
--packages="$formatted_packages" \
-- -parallel=$PARALLEL -coverprofile=coverage.out -timeout=<<parameters.test_timeout>>
- codecov/upload:
Expand Down Expand Up @@ -1164,17 +1176,25 @@ jobs:
echo "Publishing ${PRESTATE_HASH}, ${PRESTATE_MT64_HASH}, ${PRESTATE_INTEROP_HASH} as ${BRANCH_NAME}"
if [[ "" != "<< pipeline.git.branch >>" ]]
then
# Upload the git commit info for each prestate since this won't be recorded in releases.json
(echo "Commit=<< pipeline.git.revision >>" && echo "Prestate=${PRESTATE_HASH}") | gsutil cp - "gs://oplabs-network-data/proofs/op-program/cannon/${BRANCH_NAME}.bin.gz.txt"
(echo "Commit=<< pipeline.git.revision >>" && echo "Prestate: ${PRESTATE_MT64_HASH}") | gsutil cp - "gs://oplabs-network-data/proofs/op-program/cannon/${BRANCH_NAME}-mt64.bin.gz.txt"
(echo "Commit=<< pipeline.git.revision >>" && echo "Prestate: ${PRESTATE_INTEROP_HASH}") | gsutil cp - "gs://oplabs-network-data/proofs/op-program/cannon/${BRANCH_NAME}-interop.bin.gz.txt"


# Use the branch name for branches to provide a consistent URL
PRESTATE_HASH="${BRANCH_NAME}"
PRESTATE_MT64_HASH="${BRANCH_NAME}"
PRESTATE_INTEROP_HASH="${BRANCH_NAME}"
PRESTATE_MT64_HASH="${BRANCH_NAME}-mt64"
PRESTATE_INTEROP_HASH="${BRANCH_NAME}-interop"
fi
gsutil cp ./op-program/bin/prestate.bin.gz \
"gs://oplabs-network-data/proofs/op-program/cannon/${PRESTATE_HASH}.bin.gz"

gsutil cp ./op-program/bin/prestate-mt64.bin.gz \
"gs://oplabs-network-data/proofs/op-program/cannon/${PRESTATE_MT64_HASH}-mt64.bin.gz"
"gs://oplabs-network-data/proofs/op-program/cannon/${PRESTATE_MT64_HASH}.bin.gz"

gsutil cp ./op-program/bin/prestate-interop.bin.gz \
"gs://oplabs-network-data/proofs/op-program/cannon/${PRESTATE_INTEROP_HASH}-interop.bin.gz"
"gs://oplabs-network-data/proofs/op-program/cannon/${PRESTATE_INTEROP_HASH}.bin.gz"
- notify-failures-on-develop:
mentions: "@proofs-team"

Expand Down Expand Up @@ -1480,6 +1500,8 @@ workflows:
uses_artifacts: true
requires: ["contracts-bedrock-build"]
- go-tests:
environment_overrides: |
export PARALLEL=48
packages: |
op-alt-da
op-batcher
Expand Down
34 changes: 17 additions & 17 deletions cannon/mipsevm/exec/mips_instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,18 @@ func ExecuteMipsInstruction(insn uint32, opcode uint32, fun uint32, rs, rt, mem
shiftAmt := (insn >> 6) & 0x1F
return SignExtend((rt<<shiftAmt)&U32Mask, 32)
case 0x02: // srl
return SignExtend((rt&0xFFFFFFFF)>>((insn>>6)&0x1F), 32)
return SignExtend((rt&U32Mask)>>((insn>>6)&0x1F), 32)
case 0x03: // sra
shamt := Word((insn >> 6) & 0x1F)
return SignExtend((rt&0xFFFFFFFF)>>shamt, 32-shamt)
return SignExtend((rt&U32Mask)>>shamt, 32-shamt)
case 0x04: // sllv
shiftAmt := rs & 0x1F
return SignExtend((rt<<shiftAmt)&U32Mask, 32)
case 0x06: // srlv
return SignExtend((rt&0xFFFFFFFF)>>(rs&0x1F), 32)
return SignExtend((rt&U32Mask)>>(rs&0x1F), 32)
case 0x07: // srav
shamt := Word(rs & 0x1F)
return SignExtend((rt&0xFFFFFFFF)>>shamt, 32-shamt)
return SignExtend((rt&U32Mask)>>shamt, 32-shamt)
// functs in range [0x8, 0x1b] for 32-bit and [0x8, 0x1f] for 64-bit are handled specially by other functions
case 0x08: // jr
return rs
Expand Down Expand Up @@ -360,14 +360,14 @@ func ExecuteMipsInstruction(insn uint32, opcode uint32, fun uint32, rs, rt, mem
case 0x22: // lwl
if arch.IsMips32 {
val := mem << ((rs & 3) * 8)
mask := Word(uint32(0xFFFFFFFF) << ((rs & 3) * 8))
return SignExtend(((rt & ^mask)|val)&0xFFFFFFFF, 32)
mask := Word(uint32(U32Mask) << ((rs & 3) * 8))
return SignExtend(((rt & ^mask)|val)&U32Mask, 32)
} else {
// similar to the above mips32 implementation but loads are constrained to the nearest 4-byte memory word
w := uint32(SelectSubWord(rs, mem, 4, false))
val := w << ((rs & 3) * 8)
mask := Word(uint32(0xFFFFFFFF) << ((rs & 3) * 8))
return SignExtend(((rt & ^mask)|Word(val))&0xFFFFFFFF, 32)
mask := Word(uint32(U32Mask) << ((rs & 3) * 8))
return SignExtend(((rt & ^mask)|Word(val))&U32Mask, 32)
}
case 0x23: // lw
return SelectSubWord(rs, mem, 4, true)
Expand All @@ -378,13 +378,13 @@ func ExecuteMipsInstruction(insn uint32, opcode uint32, fun uint32, rs, rt, mem
case 0x26: // lwr
if arch.IsMips32 {
val := mem >> (24 - (rs&3)*8)
mask := Word(uint32(0xFFFFFFFF) >> (24 - (rs&3)*8))
return SignExtend(((rt & ^mask)|val)&0xFFFFFFFF, 32)
mask := Word(uint32(U32Mask) >> (24 - (rs&3)*8))
return SignExtend(((rt & ^mask)|val)&U32Mask, 32)
} else {
// similar to the above mips32 implementation but constrained to the nearest 4-byte memory word
w := uint32(SelectSubWord(rs, mem, 4, false))
val := w >> (24 - (rs&3)*8)
mask := uint32(0xFFFFFFFF) >> (24 - (rs&3)*8)
mask := uint32(U32Mask) >> (24 - (rs&3)*8)
lwrResult := (uint32(rt) & ^mask) | val
if rs&3 == 3 { // loaded bit 31
return SignExtend(Word(lwrResult), 32)
Expand All @@ -401,26 +401,26 @@ func ExecuteMipsInstruction(insn uint32, opcode uint32, fun uint32, rs, rt, mem
case 0x2a: // swl
if arch.IsMips32 {
val := rt >> ((rs & 3) * 8)
mask := uint32(0xFFFFFFFF) >> ((rs & 3) * 8)
mask := uint32(U32Mask) >> ((rs & 3) * 8)
return (mem & Word(^mask)) | val
} else {
sr := (rs & 3) << 3
val := ((rt & 0xFFFFFFFF) >> sr) << (32 - ((rs & 0x4) << 3))
mask := (uint64(0xFFFFFFFF) >> sr) << (32 - ((rs & 0x4) << 3))
val := ((rt & U32Mask) >> sr) << (32 - ((rs & 0x4) << 3))
mask := (uint64(U32Mask) >> sr) << (32 - ((rs & 0x4) << 3))
return (mem & Word(^mask)) | val
}
case 0x2b: // sw
return UpdateSubWord(rs, mem, 4, rt)
case 0x2e: // swr
if arch.IsMips32 {
val := rt << (24 - (rs&3)*8)
mask := uint32(0xFFFFFFFF) << (24 - (rs&3)*8)
mask := uint32(U32Mask) << (24 - (rs&3)*8)
return (mem & Word(^mask)) | val
} else {
// similar to the above mips32 implementation but constrained to the nearest 4-byte memory word
w := uint32(SelectSubWord(rs, mem, 4, false))
val := rt << (24 - (rs&3)*8)
mask := uint32(0xFFFFFFFF) << (24 - (rs&3)*8)
mask := uint32(U32Mask) << (24 - (rs&3)*8)
swrResult := (w & ^mask) | uint32(val)
return UpdateSubWord(rs, mem, 4, Word(swrResult))
}
Expand All @@ -440,7 +440,7 @@ func ExecuteMipsInstruction(insn uint32, opcode uint32, fun uint32, rs, rt, mem
return val | (rt & mask)
case 0x27: // lwu
assertMips64(insn)
return (mem >> (32 - ((rs & 0x4) << 3))) & 0xFFFFFFFF
return (mem >> (32 - ((rs & 0x4) << 3))) & U32Mask
case 0x2C: // sdl
assertMips64(insn)
sr := (rs & 0x7) << 3
Expand Down
29 changes: 21 additions & 8 deletions cannon/mipsevm/tests/evm_common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ func TestEVM_SingleStep_MfhiMflo(t *testing.T) {
}

func TestEVM_SingleStep_MulDiv(t *testing.T) {
flip := testutil.FlipSign
cases := []mulDivTestCase{
{name: "mul", funct: uint32(0x2), opcode: uint32(28), rs: Word(5), rt: Word(2), rdReg: uint32(0x8), expectRes: Word(10)}, // mul t0, t1, t2
{name: "mul", funct: uint32(0x2), opcode: uint32(28), rs: Word(0x1), rt: ^Word(0), rdReg: uint32(0x8), expectRes: ^Word(0)}, // mul t1, t2
Expand All @@ -451,9 +452,17 @@ func TestEVM_SingleStep_MulDiv(t *testing.T) {
{name: "multu", funct: uint32(0x19), rs: Word(0xFF_FF_FF_D3), rt: Word(0xAA_BB_CC_DD), rdReg: uint32(0x0), opcode: uint32(0), expectHi: Word(0xAA_BB_CC_BE), expectLo: Word(0xFC_FC_FD_27)}, // multu t1, t2
{name: "multu", funct: uint32(0x19), rs: Word(0xFF_FF_FF_D3), rt: Word(0xAA_BB_CC_BE), rdReg: uint32(0x0), opcode: uint32(0), expectHi: Word(0xAA_BB_CC_9F), expectLo: Word(0xFC_FD_02_9A)}, // multu t1, t2

{name: "div", funct: uint32(0x1a), rs: Word(5), rt: Word(2), rdReg: uint32(0x0), opcode: uint32(0), expectHi: Word(1), expectLo: Word(2)}, // div t1, t2
{name: "div by zero", funct: uint32(0x1a), rs: Word(5), rt: Word(0), rdReg: uint32(0x0), opcode: uint32(0), panicMsg: "instruction divide by zero", revertMsg: "division by zero"}, // div t1, t2
{name: "divu", funct: uint32(0x1b), rs: Word(5), rt: Word(2), rdReg: uint32(0x0), opcode: uint32(0), expectHi: Word(1), expectLo: Word(2)}, // divu t1, t2
{name: "div", funct: uint32(0x1a), rs: Word(5), rt: Word(2), rdReg: uint32(0x0), opcode: uint32(0), expectHi: Word(1), expectLo: Word(2)}, // div t1, t2
{name: "div w neg dividend", funct: uint32(0x1a), rs: flip(9), rt: Word(2), rdReg: uint32(0x0), opcode: uint32(0), expectHi: flip(1), expectLo: flip(4)}, // div t1, t2
{name: "div w neg divisor", funct: uint32(0x1a), rs: 9, rt: flip(2), rdReg: uint32(0x0), opcode: uint32(0), expectHi: 1, expectLo: flip(4)}, // div t1, t2
{name: "div w neg operands", funct: uint32(0x1a), rs: flip(9), rt: flip(2), rdReg: uint32(0x0), opcode: uint32(0), expectHi: flip(1), expectLo: 4}, // div t1, t2
{name: "div by zero", funct: uint32(0x1a), rs: Word(5), rt: Word(0), rdReg: uint32(0x0), opcode: uint32(0), panicMsg: "instruction divide by zero", revertMsg: "division by zero"}, // div t1, t2
{name: "divu", funct: uint32(0x1b), rs: Word(5), rt: Word(2), rdReg: uint32(0x0), opcode: uint32(0), expectHi: Word(1), expectLo: Word(2)},
{name: "divu w neg dividend", funct: uint32(0x1b), rs: flip(9), rt: Word(2), rdReg: uint32(0x0), opcode: uint32(0), expectHi: 1, expectLo: (flip(9) & exec.U32Mask) >> 1}, // div t1, t2
{name: "divu w neg divisor", funct: uint32(0x1b), rs: 9, rt: flip(2), rdReg: uint32(0x0), opcode: uint32(0), expectHi: 9, expectLo: 0}, // div t1, t2
{name: "divu w neg divisor #2", funct: uint32(0x1b), rs: 2, rt: flip(9), rdReg: uint32(0x0), opcode: uint32(0), expectHi: 2, expectLo: 0}, // div t1, t2
{name: "divu w neg operands", funct: uint32(0x1b), rs: flip(9), rt: flip(2), rdReg: uint32(0x0), opcode: uint32(0), expectHi: flip(9), expectLo: 0}, // divu t1, t2
{name: "divu w neg operands #2", funct: uint32(0x1b), rs: flip(2), rt: flip(9), rdReg: uint32(0x0), opcode: uint32(0), expectHi: 7, expectLo: 1}, // divu t1, t2
{name: "divu by zero", funct: uint32(0x1b), rs: Word(5), rt: Word(0), rdReg: uint32(0x0), opcode: uint32(0), panicMsg: "instruction divide by zero", revertMsg: "division by zero"}, // divu t1, t2
}

Expand Down Expand Up @@ -557,15 +566,19 @@ func TestEVM_SingleStep_SlSr(t *testing.T) {
{name: "sll with sign extension", funct: uint16(4) << 6, rt: Word(0x0800_0000), rsReg: uint32(0x0), expectVal: signExtend64(0x8000_0000)},
{name: "sll with max shift, sign extension", funct: uint16(31) << 6, rt: Word(0x01), rsReg: uint32(0x0), expectVal: signExtend64(0x8000_0000)},
{name: "sll with max shift, overflow", funct: uint16(31) << 6, rt: Word(0x02), rsReg: uint32(0x0), expectVal: 0x0},
{name: "srl", funct: uint16(4)<<6 | 2, rt: Word(0x20), rsReg: uint32(0x0), expectVal: Word(0x20) >> uint8(4)}, // srl t0, t1, 3
{name: "sra", funct: uint16(4)<<6 | 3, rt: Word(0x80_00_00_20), rsReg: uint32(0x0), expectVal: signExtend64(0xF8_00_00_02)}, // sra t0, t1, 3
{name: "sllv", funct: uint16(4), rt: Word(0x20), rs: Word(4), rsReg: uint32(0xa), expectVal: Word(0x20) << Word(4)}, // sllv t0, t1, t2
{name: "srl", funct: uint16(4)<<6 | 2, rt: Word(0x20), rsReg: uint32(0x0), expectVal: Word(0x20) >> uint8(4)}, // srl t0, t1, 3
{name: "srl with sign extension", funct: uint16(0)<<6 | 2, rt: Word(0x8000_0000), rsReg: uint32(0x0), expectVal: signExtend64(0x8000_0000)}, // srl t0, t1, 3
{name: "sra", funct: uint16(4)<<6 | 3, rt: Word(0x70_00_00_20), rsReg: uint32(0x0), expectVal: signExtend64(0x07_00_00_02)}, // sra t0, t1, 3
{name: "sra with sign extension", funct: uint16(4)<<6 | 3, rt: Word(0x80_00_00_20), rsReg: uint32(0x0), expectVal: signExtend64(0xF8_00_00_02)}, // sra t0, t1, 3
{name: "sllv", funct: uint16(4), rt: Word(0x20), rs: Word(4), rsReg: uint32(0xa), expectVal: Word(0x20) << Word(4)}, // sllv t0, t1, t2
{name: "sllv with overflow", funct: uint16(4), rt: Word(0x8000_0000), rs: Word(1), rsReg: uint32(0xa), expectVal: 0x0},
{name: "sllv with sign extension", funct: uint16(4), rt: Word(0x0800_0000), rs: Word(4), rsReg: uint32(0xa), expectVal: signExtend64(0x8000_0000)},
{name: "sllv with max shift, sign extension", funct: uint16(4), rt: Word(0x01), rs: Word(31), rsReg: uint32(0xa), expectVal: signExtend64(0x8000_0000)},
{name: "sllv with max shift, overflow", funct: uint16(4), rt: Word(0x02), rs: Word(31), rsReg: uint32(0xa), expectVal: 0x0},
{name: "srlv", funct: uint16(6), rt: Word(0x20_00), rs: Word(4), rsReg: uint32(0xa), expectVal: Word(0x20_00) >> Word(4)}, // srlv t0, t1, t2
{name: "srav", funct: uint16(7), rt: Word(0xdeafbeef), rs: Word(12), rsReg: uint32(0xa), expectVal: signExtend64(Word(0xfffdeafb))}, // srav t0, t1, t2
{name: "srlv", funct: uint16(6), rt: Word(0x20_00), rs: Word(4), rsReg: uint32(0xa), expectVal: Word(0x20_00) >> Word(4)}, // srlv t0, t1, t2
{name: "srlv with sign extension", funct: uint16(6), rt: Word(0x8000_0000), rs: Word(0), rsReg: uint32(0xa), expectVal: signExtend64(0x8000_0000)}, // srlv t0, t1, t2
{name: "srav", funct: uint16(7), rt: Word(0x1deafbee), rs: Word(12), rsReg: uint32(0xa), expectVal: signExtend64(Word(0x0001deaf))}, // srav t0, t1, t2
{name: "srav with sign extension", funct: uint16(7), rt: Word(0xdeafbeef), rs: Word(12), rsReg: uint32(0xa), expectVal: signExtend64(Word(0xfffdeafb))}, // srav t0, t1, t2
}

for _, v := range versions {
Expand Down
5 changes: 5 additions & 0 deletions cannon/mipsevm/testutil/arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,8 @@ func Cannon32OnlyTest(t testing.TB, msg string, args ...any) {
t.Skipf(msg, args...)
}
}

// FlipSign flips the sign of a 2's complement Word
func FlipSign(val Word) Word {
return ^val + 1
}
15 changes: 15 additions & 0 deletions docs/handbook/pr-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ This is organized by current state of PR, so it can be easily referenced frequen
- **Explain Decisions/Tradeoffs**: Explain rationale for any design/architecture decisions and implementation details in the PR description. If it closes an issue, remember to mention the issue it closes, e.g. `Closes <issueUrl>`. Otherwise, just link to the issue. If there is no issue, whatever details would have been in the issue should be in the PR description.
- **Guide PR reviewers:** Let them know about areas of concern, under-tested areas, or vague requirements that should be ironed out.

### Triggering CI on PRs from external forks
If the PR is from an external fork, our CI suite will not automatically run on the PR. A reviewer with sufficient permissions (e.g. the automatically assigened reviewer) needs to comment on the PR wih

> /ci authorize COMMITHASH

or

> /ci authorize https://github.com/ethereum-optimism/optimism/pull/PR_NUMBER/commits/COMMITHASH

to trigger the CI suite to run. CI is a precondition for merging the PR and should be done before review is conducted, because it will reveal any failing tests or other problems such as linting errors.

> [!NOTE]
> COMMITHASH and PR_NUMBER have their usual meanings but you must use the **full** commit hash and not a shortened version. Otherwise CI will not be triggered.


### Reviewing PRs

- **Verify Requirements are Met**: If the PR claims to fix or close an issue, check that all the requirements in the issue are actually met. Otherwise the issue may be in a good place to merge, but just shouldn’t close the issue.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/btcsuite/btcd v0.24.2
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/cockroachdb/pebble v1.1.4
github.com/consensys/gnark-crypto v0.15.0
github.com/consensys/gnark-crypto v0.16.0
github.com/crate-crypto/go-kzg-4844 v1.1.0
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3
Expand Down
Loading