Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
63feee3
cannon: Remove support for singlethreaded and 32-bit multithreaded ca…
ajsutton Apr 17, 2025
5f04f55
Update build-prestates.sh to handle some versions not having a cannon…
ajsutton Apr 17, 2025
0212f0f
Stop building 32 bit prestate
ajsutton Apr 17, 2025
48f394d
op-e2e: Remove st cannon tests.
ajsutton Apr 17, 2025
84b99df
cannon: Remove cannon stf diff check for singlethreaded vm.
ajsutton Apr 17, 2025
16ed8ea
Don't copy out st cannon meta.json
ajsutton Apr 17, 2025
c7cbc29
Stop analysis op-program for 32-bit compatibility.
ajsutton Apr 17, 2025
cea0832
Remove mipsevm tests. They were only run for 32bit.
ajsutton Apr 22, 2025
e4cff2d
op-e2e: Always use cannon mt prestates and variant.
ajsutton Apr 22, 2025
c22f6bf
cannon: There are no states that can be JSON marshalled.
ajsutton Apr 22, 2025
6e9d42e
cannon: Remove go patching.
ajsutton Apr 22, 2025
c06a061
ci: Remove build step for MIPS tests.
ajsutton Apr 22, 2025
1810eeb
cannon: Remove conditional build comment, restore test helper methods.
ajsutton Apr 22, 2025
15d8a6f
ci: Only run cannon lint and test for 64 bit.
ajsutton Apr 22, 2025
4964214
Remove RunVMTests_OpenMips - the OpenMIPS tests were removed and this…
ajsutton Apr 22, 2025
f4f9e33
contracts: Only build single ffi - no need for a separate cannon64 bu…
ajsutton Apr 22, 2025
d25ae47
cannon: Remove 32-bit solidity implementations.
ajsutton Apr 23, 2025
2ef636c
cannon: Load MIPS64 abi
ajsutton Apr 23, 2025
2c348fd
cannon: Remove support for 32bit vms when loading artifacts for tests.
ajsutton Apr 23, 2025
b67d1ed
cannon: Update deployment scripts to only support cannon MT.
ajsutton Apr 23, 2025
fe0e1a7
cannon: Update mips version in a lot of places.
ajsutton Apr 23, 2025
395759e
Fix another mipsVersion
ajsutton Apr 23, 2025
aba74fe
Format
ajsutton Apr 23, 2025
f8252e7
Fix more mipsVersions
ajsutton Apr 23, 2025
9c9f7f6
Fix test
ajsutton Apr 23, 2025
7dd55a8
Fix mipsVersion for TestImplementations
ajsutton Apr 23, 2025
b837531
Cut cannon64 --tags
mbaxter Apr 28, 2025
d24a29e
Don't build op-program for mips32
mbaxter Apr 28, 2025
e603d6b
Simplify cannon diff task - assume 64-bit
mbaxter Apr 28, 2025
a3f3ec4
op-program: Don't copy 32-bit elf
ajsutton Apr 28, 2025
aa00e6a
op-e2e: Use cannon64 as default VM.
ajsutton Apr 28, 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
94 changes: 17 additions & 77 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,6 @@ jobs:
description: Whether to notify on failure
type: boolean
default: false
mips_word_size:
type: integer
default: 32
steps:
- utils/checkout-with-mise
- check-changed:
Expand All @@ -271,44 +268,21 @@ jobs:
command: |
make lint
working_directory: cannon
- when:
condition:
equal: [32, <<parameters.mips_word_size>>]
steps:
- run:
name: Cannon Go 32-bit tests
command: |
export SKIP_SLOW_TESTS=<<parameters.skip_slow_tests>>
TIMEOUT="10m"
if [ "$SKIP_SLOW_TESTS" == "false" ]; then
TIMEOUT="30m"
fi
gotestsum --format=testname --junitfile=../tmp/test-results/cannon-32.xml --jsonfile=../tmp/testlogs/log-32.json \
-- -timeout=$TIMEOUT -parallel=$(nproc) -coverpkg=github.com/ethereum-optimism/optimism/cannon/... -coverprofile=coverage-32.out ./...
working_directory: cannon
- codecov/upload:
disable_search: true
files: ./cannon/coverage-32.out
flags: cannon-go-tests-32
- when:
condition:
equal: [64, <<parameters.mips_word_size>>]
steps:
- run:
name: Cannon Go 64-bit tests
command: |
export SKIP_SLOW_TESTS=<<parameters.skip_slow_tests>>
TIMEOUT="10m"
if [ "$SKIP_SLOW_TESTS" == "false" ]; then
TIMEOUT="30m"
fi
gotestsum --format=testname --junitfile=../tmp/test-results/cannon-64.xml --jsonfile=../tmp/testlogs/log-64.json \
-- --tags=cannon64 -timeout=$TIMEOUT -parallel=$(nproc) -coverpkg=github.com/ethereum-optimism/optimism/cannon/... -coverprofile=coverage-64.out ./...
working_directory: cannon
- codecov/upload:
disable_search: true
files: ./cannon/coverage-64.out
flags: cannon-go-tests-64
- run:
name: Cannon Go 64-bit tests
command: |
export SKIP_SLOW_TESTS=<<parameters.skip_slow_tests>>
TIMEOUT="10m"
if [ "$SKIP_SLOW_TESTS" == "false" ]; then
TIMEOUT="30m"
fi
gotestsum --format=testname --junitfile=../tmp/test-results/cannon-64.xml --jsonfile=../tmp/testlogs/log-64.json \
-- -timeout=$TIMEOUT -parallel=$(nproc) -coverpkg=github.com/ethereum-optimism/optimism/cannon/... -coverprofile=coverage-64.out ./...
working_directory: cannon
- codecov/upload:
disable_search: true
files: ./cannon/coverage-64.out
flags: cannon-go-tests-64
- store_test_results:
path: ./tmp/test-results
- store_artifacts:
Expand All @@ -320,26 +294,6 @@ jobs:
- notify-failures-on-develop:
mentions: "@proofs-team"

cannon-build-test-vectors:
docker:
- image: <<pipeline.parameters.default_docker_image>>
resource_class: large
steps:
- utils/checkout-with-mise
- check-changed:
patterns: cannon/mipsevm/tests/open_mips_tests/test
- run:
name: Install dependencies
command: |
sudo apt-get update
sudo apt-get install -y binutils-mips-linux-gnu
pip install capstone pyelftools
- run:
name: Build MIPS test vectors
command: |
python3 maketests.py && git diff --exit-code
working_directory: cannon/mipsevm/tests/open_mips_tests

diff-asterisc-bytecode:
machine: true
resource_class: ethereum-optimism/latitude-1
Expand Down Expand Up @@ -1300,7 +1254,7 @@ jobs:
command: make op-program
- run:
name: Sanitize op-program client
command: make sanitize-program GUEST_PROGRAM=../op-program/bin/op-program-client.elf
command: make sanitize-program GUEST_PROGRAM=../op-program/bin/op-program-client64.elf
working_directory: cannon


Expand Down Expand Up @@ -1893,9 +1847,7 @@ workflows:
- bedrock-go-tests:
requires:
- go-lint
- cannon-build-test-vectors
- cannon-go-lint-and-test-32-bit
- cannon-go-lint-and-test-64-bit
- cannon-go-lint-and-test
- check-generated-mocks-op-node
- check-generated-mocks-op-service
# TODO(#15353) - Need to regenerate data used in op-program-compat
Expand Down Expand Up @@ -1951,18 +1903,10 @@ workflows:
- circleci-repo-readonly-authenticated-github-token
- discord
- cannon-go-lint-and-test:
name: cannon-go-lint-and-test-<<matrix.mips_word_size>>-bit
requires:
- contracts-bedrock-build
skip_slow_tests: true
notify: true
matrix:
parameters:
mips_word_size: [32, 64]
context:
- circleci-repo-readonly-authenticated-github-token
- discord
- cannon-build-test-vectors:
context:
- circleci-repo-readonly-authenticated-github-token
- discord
Expand Down Expand Up @@ -2205,7 +2149,6 @@ workflows:
- circleci-repo-readonly-authenticated-github-token
- discord
- cannon-go-lint-and-test:
name: cannon-go-lint-and-test-<<matrix.mips_word_size>>-bit
requires:
- contracts-bedrock-build
skip_slow_tests: false
Expand All @@ -2214,9 +2157,6 @@ workflows:
- slack
- circleci-repo-readonly-authenticated-github-token
- discord
matrix:
parameters:
mips_word_size: [32, 64]

scheduled-docker-publish:
when:
Expand Down
4 changes: 0 additions & 4 deletions .semgrep/rules/sol-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ rules:
exclude:
- packages/contracts-bedrock/src/libraries/Bytes.sol
- packages/contracts-bedrock/src/legacy/LegacyMintableERC20.sol
- packages/contracts-bedrock/src/cannon/MIPS.sol
- packages/contracts-bedrock/src/cannon/MIPS2.sol
- packages/contracts-bedrock/src/cannon/libraries/MIPSMemory.sol
- packages/contracts-bedrock/src/cannon/libraries/MIPSInstructions.sol

Expand Down Expand Up @@ -330,8 +328,6 @@ rules:
- packages/contracts-bedrock/src/L2/FeeVault.sol
- packages/contracts-bedrock/src/L2/OptimismMintableERC721.sol
- packages/contracts-bedrock/src/L2/OptimismMintableERC721Factory.sol
- packages/contracts-bedrock/src/cannon/MIPS.sol
- packages/contracts-bedrock/src/cannon/MIPS2.sol
- packages/contracts-bedrock/src/cannon/MIPS64.sol
- packages/contracts-bedrock/src/cannon/PreimageOracle.sol
- packages/contracts-bedrock/src/dispute/AnchorStateRegistry.sol
Expand Down
11 changes: 2 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,16 @@ reproducible-prestate: ## Builds reproducible-prestate binary
.PHONY: reproducible-prestate

# Include any files required for the devnet to build and run.
DEVNET_CANNON_PRESTATE_FILES := op-program/bin/prestate-proof.json op-program/bin/prestate.bin.gz op-program/bin/prestate-proof-mt64.json op-program/bin/prestate-mt64.bin.gz op-program/bin/prestate-interop.bin.gz
DEVNET_CANNON_PRESTATE_FILES := op-program/bin/prestate-proof-mt64.json op-program/bin/prestate-mt64.bin.gz op-program/bin/prestate-interop.bin.gz


$(DEVNET_CANNON_PRESTATE_FILES):
make cannon-prestate
make cannon-prestate-mt64
make cannon-prestate-interop

cannon-prestates: cannon-prestate cannon-prestate-mt64 cannon-prestate-interop
cannon-prestates: cannon-prestate-mt64 cannon-prestate-interop
.PHONY: cannon-prestates

cannon-prestate: op-program cannon ## Generates prestate using cannon and op-program
./cannon/bin/cannon load-elf --type singlethreaded-2 --path op-program/bin/op-program-client.elf --out op-program/bin/prestate.bin.gz --meta op-program/bin/meta.json
./cannon/bin/cannon run --proof-at '=0' --stop-at '=1' --input op-program/bin/prestate.bin.gz --meta op-program/bin/meta.json --proof-fmt 'op-program/bin/%d.json' --output ""
mv op-program/bin/0.json op-program/bin/prestate-proof.json
.PHONY: cannon-prestate

cannon-prestate-mt64: op-program cannon ## Generates prestate using cannon and op-program in the latest 64-bit multithreaded cannon format
./cannon/bin/cannon load-elf --type multithreaded64-3 --path op-program/bin/op-program-client64.elf --out op-program/bin/prestate-mt64.bin.gz --meta op-program/bin/meta-mt64.json
./cannon/bin/cannon run --proof-at '=0' --stop-at '=1' --input op-program/bin/prestate-mt64.bin.gz --meta op-program/bin/meta-mt64.json --proof-fmt 'op-program/bin/%d-mt64.json' --output ""
Expand Down
9 changes: 0 additions & 9 deletions cannon/Dockerfile.diff
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,11 @@ ARG GIT_DATE
ARG TARGETOS TARGETARCH

# TODO(#15591): Update to test cannon-multithreaded64-4 when new VM stabilizes
FROM --platform=$BUILDPLATFORM us-docker.pkg.dev/oplabs-tools-artifacts/images/cannon:v1.1.0-alpha.4 AS cannon-v2
FROM --platform=$BUILDPLATFORM us-docker.pkg.dev/oplabs-tools-artifacts/images/cannon:v1.4.0 AS cannon-multithreaded64-3

FROM --platform=$BUILDPLATFORM builder AS cannon-verify
COPY --from=cannon-v2 /usr/local/bin/cannon /usr/local/bin/cannon-v2
COPY --from=cannon-multithreaded64-3 /usr/local/bin/cannon /usr/local/bin/cannon-multithreaded64-3

# Check cannon-v2
# verify the latest singlethreaded VM behavior against cannon-v2
RUN cd cannon && make diff-singlethreaded-2-cannon -e OTHER_CANNON=/usr/local/bin/cannon-v2
RUN --mount=type=cache,target=/root/.cache/go-build cd cannon && \
make diff-singlethreaded-2-cannon -e OTHER_CANNON=/usr/local/bin/cannon-v2 \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE

# Check cannon-multithreaded64-3
# verify the latest multithreaded VM behavior against multithreaded64-3
RUN cd cannon && make diff-multithreaded64-3-cannon -e OTHER_CANNON=/usr/local/bin/cannon-multithreaded64-3
Expand Down
66 changes: 19 additions & 47 deletions cannon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,17 @@ endif
# The MIPS64 r2 opcodes not supported by cannon. This list does not include coprocess-specific and trap opcodes.
UNSUPPORTED_OPCODES := (dclo|dclz|madd|maddu|seb|seh|wsbh|dsbh|dshd|ins|dins|dinsm|dinsu|ext|dext|dextu|dextm|rotr|drotr|drotr32|rotrv|drotrv|break|sdbbp|pref)

CANNON32_FUZZTIME := 10s
CANNON64_FUZZTIME := 20s

cannon32-impl:
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build --tags=cannon32 -v $(LDFLAGS) -o ./bin/cannon32-impl .

cannon64-impl:
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build --tags=cannon64 -v $(LDFLAGS) -o ./bin/cannon64-impl .
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/cannon64-impl .

# Note: This target is used by ./scripts/build-legacy-cannons.sh
# It should build the individual versions of cannons and copy them into place in hte multicannon/embeds directory
# Ideally, preserve backwards compatibility with this behaviour but if it needs to change, build-legacy-cannons.sh will
# need to be updated to account for different behaviours in different versions.
# Each embed is suffixed with the latest `StateVersion` number corresponding to the target VM and architecture.
cannon-embeds: cannon32-impl cannon64-impl
# 32-bit singlethreaded vm
@cp bin/cannon32-impl ./multicannon/embeds/cannon-2
# 32-bit multithreaded vm
@cp bin/cannon32-impl ./multicannon/embeds/cannon-5
cannon-embeds: cannon64-impl
# 64-bit multithreaded vm
@cp bin/cannon64-impl ./multicannon/embeds/cannon-6
@cp bin/cannon64-impl ./multicannon/embeds/cannon-7
Expand Down Expand Up @@ -67,25 +59,16 @@ sanitize-program:
contract:
cd ../packages/contracts-bedrock && forge build

test: elf contract test64
test: elf contract
go test -v ./...

test64: elf contract
go test -tags=cannon64 -run '(TestEVM.*64|TestHelloEVM|TestClaimEVM)' ./mipsevm/tests

diff-%-cannon: cannon elf-go-122
# Load an elf file to create a prestate, and check that both cannon versions generate the same prestate
@VM=$*; \
echo "Running diff for VM type $${VM}"; \
if echo "$$VM" | grep -q '^multithreaded64'; then \
echo "Loading 64-bit program"; \
ELF_SUFFIX="64.elf"; \
else \
echo "Loading 32-bit program"; \
ELF_SUFFIX="elf"; \
fi; \
$$OTHER_CANNON load-elf --type $$VM --path ./testdata/go-1-22/bin/hello.$${ELF_SUFFIX} --out ./bin/prestate-other.bin.gz --meta ""; \
./bin/cannon load-elf --type $$VM --path ./testdata/go-1-22/bin/hello.$${ELF_SUFFIX} --out ./bin/prestate.bin.gz --meta "";
$$OTHER_CANNON load-elf --type $$VM --path ./testdata/go-1-22/bin/hello.64.elf --out ./bin/prestate-other.bin.gz --meta ""; \
./bin/cannon load-elf --type $$VM --path ./testdata/go-1-22/bin/hello.64.elf --out ./bin/prestate.bin.gz --meta "";
@cmp ./bin/prestate-other.bin.gz ./bin/prestate.bin.gz;
@if [ $$? -eq 0 ]; then \
echo "Generated identical prestates"; \
Expand All @@ -99,9 +82,9 @@ diff-%-cannon: cannon elf-go-122
./bin/cannon run --proof-at '=0' --stop-at '=100000000' --input=./bin/prestate.bin.gz --output ./bin/out.bin.gz --meta ""
@cmp ./bin/out-other.bin.gz ./bin/out.bin.gz
@if [ $$? -eq 0 ]; then \
echo "Generated identical states"; \
echo "Generated identical post-states"; \
else \
echo "Generated different prestates"; \
echo "Generated different post-states"; \
exit 1; \
fi

Expand All @@ -110,32 +93,21 @@ cannon-stf-verify:

fuzz:
printf "%s\n" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON32_FUZZTIME) -fuzz=FuzzStateSyscallBrk ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON32_FUZZTIME) -fuzz=FuzzStateSyscallMmap ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON32_FUZZTIME) -fuzz=FuzzStateSyscallExitGroup ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON32_FUZZTIME) -fuzz=FuzzStateSyscallFcntl ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON32_FUZZTIME) -fuzz=FuzzStateHintRead ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 20s -fuzz=FuzzStatePreimageRead ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON32_FUZZTIME) -fuzz=FuzzStateHintWrite ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 20s -fuzz=FuzzStatePreimageWrite ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON32_FUZZTIME) -fuzz=FuzzStateSyscallCloneST ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON32_FUZZTIME) -fuzz=FuzzStateSyscallCloneMT ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateConsistencyMulOp ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateConsistencyMultOp ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateConsistencyMultuOp ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) --tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateSyscallBrk ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) --tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateSyscallMmap ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) --tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateSyscallExitGroup ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) --tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateSyscallFcntl ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) --tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateHintRead ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) --tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStatePreimageRead ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) --tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateHintWrite ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) --tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStatePreimageWrite ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) --tags=cannon64 -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateSyscallCloneMT ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateConsistencyMulOp ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateConsistencyMultOp ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateConsistencyMultuOp ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateSyscallBrk ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateSyscallMmap ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateSyscallExitGroup ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateSyscallFcntl ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateHintRead ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStatePreimageRead ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateHintWrite ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStatePreimageWrite ./mipsevm/tests" \
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime $(CANNON64_FUZZTIME) -fuzz=FuzzStateSyscallCloneMT ./mipsevm/tests" \
| parallel -j 8 {}

.PHONY: \
cannon32-impl \
cannon64-impl \
cannon-embeds \
cannon \
Expand Down
2 changes: 1 addition & 1 deletion cannon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ make cannon
## Contracts

The Cannon contracts:
- `MIPS.sol`: A MIPS emulator implementation, to run a single instruction onchain, with merkleized VM memory.
- `MIPS64.sol`: A MIPS emulator implementation, to run a single instruction onchain, with merkleized VM memory.
- `PreimageOracle.sol`: implements the pre-image oracle ABI, to support the instruction execution pre-image requests.

The smart-contracts are integrated into the Optimism monorepo contracts:
Expand Down
14 changes: 1 addition & 13 deletions cannon/cmd/load_elf.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/ethereum-optimism/optimism/cannon/mipsevm"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/multithreaded"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/program"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/singlethreaded"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/versions"
openum "github.com/ethereum-optimism/optimism/op-service/enum"
"github.com/ethereum-optimism/optimism/op-service/ioutil"
Expand Down Expand Up @@ -60,18 +59,7 @@ func LoadELF(ctx *cli.Context) error {
if err != nil {
return err
}
if versions.IsSupportedSingleThreaded(ver) {
createInitialState = func(f *elf.File) (mipsevm.FPVMState, error) {
return program.LoadELF(f, singlethreaded.CreateInitialState)
}
patcher = func(state mipsevm.FPVMState) error {
err := program.PatchGoGC(elfProgram, state)
if err != nil {
return err
}
return program.PatchStack(state)
}
} else if versions.IsSupportedMultiThreaded(ver) || versions.IsSupportedMultiThreaded64(ver) {
if versions.IsSupportedMultiThreaded64(ver) {
createInitialState = func(f *elf.File) (mipsevm.FPVMState, error) {
return program.LoadELF(f, multithreaded.CreateInitialState)
}
Expand Down
Loading