Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
e062e73
op-e2e: Enable Fjord / RIP-7212 Test (#10260)
danyalprout Apr 23, 2024
c651859
ci: Add daily job to check reproducibility of cannon prestate (#10244)
ajsutton Apr 23, 2024
da002ff
op-e2e: Avoid panics on conductor startup failure (#10247)
trianglesphere Apr 23, 2024
1667124
Fix tag script (#10261)
trianglesphere Apr 23, 2024
d4706da
op-e2e: Refactor for asterisc e2e (#10214)
pcw109550 Apr 23, 2024
9ca3362
contracts-bedrock: remove cannon deps on bindings (#10280)
tynes Apr 24, 2024
b2fb246
op-bindings: delete `more` files (#10272)
tynes Apr 24, 2024
4fb534a
`Position.TraceIndex`: panic when `maxDepth < p.depth` happens (#10007)
zhiqiangxu Apr 24, 2024
a8b6039
op-plamsa: use local bindings (#10286)
tynes Apr 24, 2024
c5bfb82
contracts-bedrock: remove bindings requirement (#10285)
tynes Apr 24, 2024
6b23176
`chain-mon` restructuring (#10246)
Ethnical Apr 24, 2024
c6fe5c9
da-server: Switch back to minio (#10281)
trianglesphere Apr 24, 2024
62a554d
remove duplicate imports (#10284)
AaronChen0 Apr 24, 2024
66a21a9
feat(ctb): Log preimage oracle calldata (#10278)
clabby Apr 24, 2024
29761a6
op-challenger: Support multiple prestates (#10282)
ajsutton Apr 24, 2024
b4df5c6
run-kontrol.sh: fix typo to not execute test with 10-element array (#…
JuanCoRo Apr 24, 2024
bd80e58
op-challenger: Read created game address from receipt (#10277)
ajsutton Apr 24, 2024
0310502
feat(ct): update max bond gas to 300m (#10275)
smartcontracts Apr 24, 2024
1f55159
op-challenger: Fix list-claims command (#10042)
Inphi Apr 24, 2024
12a72ab
Create Context-Aware Transient Storage Library (#10259)
0xfuturistic Apr 24, 2024
59d4fbb
op-chain-ops: delete dead code (#10298)
tynes Apr 24, 2024
b23d3f6
op-challenger: Rename `--l2-rpc` to `--l2-eth-rpc` and log warning fo…
ajsutton Apr 25, 2024
1ca1d81
op-challenger: Share providers across different game instances (#10305)
ajsutton Apr 25, 2024
9b63049
op-program: Add reproducibility check for op-program 0.3.0 (#10304)
ajsutton Apr 25, 2024
35f2989
op-bindings: remove bindgen (#10301)
tynes Apr 25, 2024
c5a2ec4
op-bindings: delete ast package (#10299)
tynes Apr 25, 2024
ba174f4
op-bindings: delete hardhat package (#10300)
tynes Apr 25, 2024
113e274
op-challenger, op-dispute-mon: Support both old and new versions of t…
ajsutton Apr 25, 2024
8447d16
op-challenger: Support multiple asterisc prestates (#10313)
pcw109550 Apr 26, 2024
8c19065
op-challenger: Share providers across different asterisc game instanc…
pcw109550 Apr 26, 2024
7e3e9af
op-challenger: fix a bug in TestMonitorGames (#10307)
AaronChen0 Apr 26, 2024
906a7a6
feat(ctb): `SystemConfig` updates for FPs (#10315)
clabby Apr 26, 2024
06ab613
dependabot(gomod): bump gorm.io/gorm from 1.25.9 to 1.25.10 (#10324)
dependabot[bot] Apr 26, 2024
83611e5
dependabot(gomod): bump github.com/minio/minio-go/v7 (#10323)
dependabot[bot] Apr 26, 2024
7e93729
fix: typo in the code comments (#10229)
threewebcode Apr 26, 2024
826a7bd
feat/CrossL2Inbox: create (#10296)
0xfuturistic Apr 27, 2024
54eb416
Add op-dispute-mon to images to build in golang-docker target (#10335)
ajsutton Apr 29, 2024
5b42ec9
make: fix build (#10327)
tynes Apr 29, 2024
fea5d82
op-bindings: more cleanup (#10328)
tynes Apr 29, 2024
98afa5b
op-bindings: delete more dead code (#10338)
tynes Apr 29, 2024
5a829ce
op-challenger: Apply game window to list-games (#10336)
ajsutton Apr 29, 2024
c5919e5
op-dispute-mon: Add option to ignore games (#10334)
ajsutton Apr 29, 2024
e156237
op-challenger: Include resolution status in list-claims output (#10333)
ajsutton Apr 29, 2024
43a70df
op-dispute-mon: Report valid and invalid claims and bonds by honest a…
ajsutton Apr 29, 2024
feb9b5f
add missing FaultDisputeGame interface (#10306)
raffaele-oplabs Apr 29, 2024
e5ee5e3
maint(ct): clean up periphery deploy script (#10276)
smartcontracts Apr 29, 2024
4886ab4
contracts-bedrock: small fix to cleanup L2 genesis (#10326)
tynes Apr 29, 2024
f72faa9
Update Silent Patch Policy Broken Link (#10329)
SanShi2023 Apr 29, 2024
a7ff230
[op-conductor] make safe check interval optional (#10321)
0x00101010 Apr 29, 2024
344d919
[op-conductor] make health check more robust (#10325)
0x00101010 Apr 29, 2024
aa1dc04
fpac: reserve spacer slot in OptimismPortal2 (#10279)
tynes Apr 30, 2024
acd8cf8
genesis: fix permit2 panic (#10332)
tynes Apr 30, 2024
472322e
feat/L2ToL2CrossDomainMessenger: create (#10297)
0xfuturistic Apr 30, 2024
fff6563
chore(op-service): reduce allocations (#10331)
hoank101 Apr 30, 2024
3f9de38
feat: Add extension event to `OptimismPortal2` (#10350)
clabby Apr 30, 2024
b952dc0
contracts-bedrock: deployer as msg.sender (#10343)
tynes Apr 30, 2024
794a333
ensure conductor services are closed (#10347)
danyalprout May 1, 2024
8fe7796
docs: fix typo in `initializeOptimismMintableERC20Factory()` notice (…
pegahcarter May 1, 2024
e87e5ef
op-service/eth: Optimize ssz decoding (#10362)
sebastianst May 1, 2024
d9685fc
Adds op-conductor to tag-tool (#10361)
zhwrd May 1, 2024
3204cb0
Adds op-conductor to actions tag-service.yaml (#10363)
zhwrd May 1, 2024
322bf55
contracts-bedrock: L1Block interop (#10344)
tynes May 1, 2024
55d8a35
ctb: Enable setting custom names in deploySafe() (#10364)
maurelian May 1, 2024
154f976
feat: Squash libraries in dispute contracts (#10351)
clabby May 1, 2024
2bb23ff
fix(op-dispute-mon): Remove Delays Calculator (#10372)
refcell May 2, 2024
23a628b
feat(op-dispute-mon): Log Lost Bond Amount (#10371)
refcell May 2, 2024
4fb32c1
contracts-bedrock: log the commit hash in deploy script (#10369)
tynes May 2, 2024
53f0080
chore(ctb): Fully remove `L2_OUTPUT_ORACLE_SLOT` (#10377)
mds1 May 2, 2024
fc662d4
deps: update go libp2p (#10378)
tynes May 2, 2024
e21d8fd
contracts-bedrock: small logging cleanup (#10370)
tynes May 2, 2024
a6074a7
feat: custom gas token (#10143)
tynes May 2, 2024
2838df8
geth: update to v1.13.15 (#10353)
axelKingsley May 2, 2024
2b1c99b
Revert "feat: custom gas token (#10143)" (#10384)
mds1 May 2, 2024
40421e8
contracts-bedrock: delete dead code (#10359)
tynes May 2, 2024
91a6fca
op-chain-ops: unwrap l1 and l2 allocs (#10387)
protolambda May 2, 2024
3c308f3
feat: annotate assembly as memory safe (#10386)
mds1 May 3, 2024
8a548ae
op-e2e: Fix flaky fault proof tests (#10389)
ajsutton May 3, 2024
0c7d8a9
Deploy Security Council Safe and Liveness Extensions (#10120)
maurelian May 3, 2024
080d5f6
op-chain-ops: allocs validation (#10388)
tynes May 3, 2024
f49f67d
ci: Move sdk-next-test to run on develop only (#10390)
ajsutton May 3, 2024
4be7223
feat(ctb): Promote FP contracts to first major version (#10382)
clabby May 3, 2024
8ed6612
cannon: Adjust initial heap (#10376)
Inphi May 3, 2024
a5e3473
op-dispute-mon: Add metric to report timestamp of last invalid propos…
ajsutton May 3, 2024
4c50873
ctb: Add deployDeputyGuardian (#10207)
maurelian May 3, 2024
3f198f3
op-chain-ops: Add unclaimed game credits script (#10367)
Inphi May 3, 2024
a6d4eed
dispute-mon: Set claim statuses that no longer have games back to 0 (…
ajsutton May 3, 2024
f4bd91c
Reapply "feat: custom gas token (#10143)" (#10384) (#10395)
tynes May 3, 2024
2541e99
contracts-bedrock: fix commit hash serialization (#10383)
tynes May 3, 2024
0f11f2a
op-program: Add v1.0.0 to set of reproducibility checks (#10403)
ajsutton May 5, 2024
c26ead2
chore: Remove the logs from `stderr` and `stdout`. (#10352)
Ethnical May 6, 2024
ec39042
deps: bump slither to 0.10.2 (#10411)
tynes May 6, 2024
b401f72
op-conductor: fixes proposer outputAtBlock rpc arg compatability (#10…
zhwrd May 6, 2024
59997de
build(deps): bump github.com/ethereum/go-ethereum in /proxyd (#10413)
dependabot[bot] May 6, 2024
6fc2b1e
call ec.Close() (#10412)
zhiqiangxu May 6, 2024
6620231
chore(ctb): Update sepolia devnet 0 deploy config (#10396)
clabby May 6, 2024
308299f
remove outOfData variable (#10405)
zhiqiangxu May 6, 2024
7534ac5
ci: `ci-builder:0.49.0` (#10414)
tynes May 6, 2024
29c7b44
op-chain-ops: delete memdb (#10404)
tynes May 6, 2024
c67c67a
Docker-targets v2 (#10346)
bitwiseguy May 6, 2024
15e8387
slither: bump ci versions (#10410)
tynes May 6, 2024
eba8187
fix(op-dispute-mon): Claim ID and Clock Logging (#10415)
refcell May 7, 2024
101ad1a
Dispute game compatible wd mon (#10375)
raffaele-oplabs May 7, 2024
66ec96b
only FundDevAccounts when DeployConfig.FundDevAccounts is true (#10432)
zhiqiangxu May 7, 2024
fc45866
contracts-bedrock: add useInterop flag (#10433)
0xfuturistic May 7, 2024
1812f16
fix(op-dispute-mon): Unresolved Claim Logging (#10394)
refcell May 7, 2024
4386680
op-node: Implement fjord RLP & Channel Bank Size limit Increases (#10…
trianglesphere May 7, 2024
57211c6
fix(op-dispute-mon): Improve Resolution Status Granularity (#10419)
refcell May 7, 2024
c0ab34f
cannon: remove final dep on bindings (#10408)
tynes May 7, 2024
89a3a5f
chore(ctb): Update sepolia deploy config (#10418)
clabby May 7, 2024
853842d
fix(op-dispute-mon): export forecast to keep exporting consistent (#1…
refcell May 7, 2024
1cfd38b
Challenger: Pull large preimage proposals from tx logs (#10416)
mbaxter May 7, 2024
97cc1f1
op-challenger: Make l2-eth-rpc and rollup-rpc required (#10445)
ajsutton May 8, 2024
c41bb73
op-challenger: Integrate challenging L2 block numbers (#10446)
ajsutton May 8, 2024
bd35e43
add to L2Genesis Interop contracts (CrossL2Inbox, L2ToL2CrossDomainMe…
0xfuturistic May 8, 2024
b9eb669
proxyd: remove unused error (#10444)
hteevoli May 8, 2024
80afbbd
contracts-bedrock: fix deposit gas limit (#10449)
tynes May 8, 2024
671d08b
feat(ctb): Extra monitoring events in `OptimismPortal2` (#10423)
clabby May 8, 2024
7e2bb8a
fix(op-challenger): use op challenger env var prefix (#10442)
refcell May 8, 2024
700a1db
feat(op-challenger): sort the games listing subcommand (#10454)
refcell May 8, 2024
8472363
feat(op-dispute-mon): Contract Creation Failure Metric (#10447)
refcell May 8, 2024
93e9d15
feat(ctb): Add new move type to FDG for OR counters (#10438)
clabby May 9, 2024
251af5e
contracts-bedrock: deprecate `finalizeDeposit` (#10459)
tynes May 9, 2024
1c33c39
feat(ctb): Expose `l2BlockNumberChallenger` (#10463)
clabby May 9, 2024
0ad08a3
op-dispute-mon: Enrich games in parallel (#10461)
ajsutton May 9, 2024
1dd35b7
op-challenger: Implement block number challenge calls in contract bin…
ajsutton May 9, 2024
4854ed9
custom-gas-token: add e2e test (#10440)
geoknee May 9, 2024
f2e06c3
op-dispute-mon: Fetch output root agreement in extract stage (#10464)
ajsutton May 9, 2024
a7b85e6
op-node: Start EL sync even when the genesis is finalized (#10457)
trianglesphere May 9, 2024
3249d81
dependabot(gomod): bump golang.org/x/crypto from 0.21.0 to 0.23.0 (#1…
dependabot[bot] May 9, 2024
8ba5166
op-challenger: Add a metric for number of l2 block numbers challenged…
ajsutton May 10, 2024
4dc6aa8
op-chain-ops: decouple from bindings (#10466)
tynes May 10, 2024
48393a6
Fix makefile fuzz targets on osx (#10476)
Inphi May 10, 2024
2d09010
op-dispute-mon: Ensure a zero value is set for sufficient/insufficien…
ajsutton May 10, 2024
9a22b09
op-challenger: Fix highest_acted_l1_block metric (#10485)
ajsutton May 10, 2024
bbe7d14
op-proposer: update test to use local bindings (#10473)
tynes May 10, 2024
58fe52b
op-service: decouple from `op-bindings` (#10491)
tynes May 10, 2024
03f6bd8
op-chain-ops: update bindings import (#10490)
tynes May 10, 2024
164b3d2
Update conf_depth.go (#10487)
pengwenhui888 May 10, 2024
351f660
cannon: fix a typo in fuzz test (#10488)
hteevoli May 10, 2024
6c6dc18
Test setup results of DeployOwnership script (#10397)
maurelian May 10, 2024
7daf06d
contracts-bedrock: portal opaque data test (#10443)
tynes May 10, 2024
6471017
Fjord: Implement max sequencer drift change to a constant (#10465)
sebastianst May 10, 2024
9ef5981
contracts-bedrock: weth predeploy version (#10441)
tynes May 10, 2024
0b4077e
perf: remove defer inside loop (#10497)
kien6034 May 10, 2024
1a20fd9
Plasma: Abstract CommitmentData to Interface (#10458)
axelKingsley May 10, 2024
bbc3786
op-challenger: Add resolve-claim subcommand. (#10504)
ajsutton May 11, 2024
bde6a96
feat(op-dispute-mon): L2BlockNumberChallenged Support (#10451)
refcell May 11, 2024
3508670
use iota properly (#10505)
zhiqiangxu May 12, 2024
043ee4d
op-service: predeploys package (#10494)
tynes May 13, 2024
45e1bd2
ctb: Fix compiler warnings (#10513)
maurelian May 13, 2024
2fadb4c
cannon: Fix inverted hint writing conditional check (#10514)
mbaxter May 13, 2024
2c63288
feat(ctb): Enforce maximum L2 gas limit (#10500)
clabby May 13, 2024
4901062
op-chain-ops: bindings decouple (#10493)
tynes May 13, 2024
625054c
cannon: Handle div by zero in MIPS.sol (#10468)
Inphi May 13, 2024
eb8fb14
ctb: Change Safe contract version to GnosisSafe v1.3.0 (#10515)
maurelian May 13, 2024
0ad342a
feat(ctb): Support `OptimismPortal2` in kontrol tests (#10429)
clabby May 13, 2024
af59d2b
ctb: Prevent calls to foundry's vm address (#10525)
maurelian May 13, 2024
ea52388
ci: forge build first (#10523)
mds1 May 13, 2024
4b8f6f4
Fjord: Add Brotli channel compression support (#10358)
cody-wang-cb May 13, 2024
92a78de
op-dispute-mon: Log an error when a DelayedWETH contract has insuffic…
ajsutton May 13, 2024
97a4ca8
op-challenger, op-dispute-mon: Fix chess clock calculations to match …
ajsutton May 13, 2024
cafad53
feat(ctb): Remove `setResourceConfig` (#10501)
clabby May 14, 2024
6e98522
check either DGFAddress or L2OOAddress was provided (#10528)
zhiqiangxu May 14, 2024
52abfb5
fjord: Fastlz GasPriceOracle (#10534)
danyalprout May 14, 2024
95d39a7
op-e2e: Delete unused helpers from pre-output root support (#10532)
ajsutton May 14, 2024
5e5d3f7
chore: fix function names in comment (#10535)
petercover May 14, 2024
78e1084
dispute-game: Sanity check disputed claim index (#10520)
Inphi May 14, 2024
c79248e
Fix ci version script when filtering tags (#10539)
bitwiseguy May 14, 2024
84c503d
op-challenger/op-dispute-mon: Support version 1.0.0 of fault dispute …
ajsutton May 14, 2024
db3871d
ctb: SafeTestTools improvements (#10537)
maurelian May 14, 2024
53c00e9
ctb: Move threshold check from LivenessModule constructor (#10516)
maurelian May 14, 2024
4cf7d7e
cannon: Make jsonutil error when loading json payload with extra data…
mbaxter May 14, 2024
b123e13
cannon: Remove unreachable code (#10526)
mbaxter May 15, 2024
cf0c3e2
Merge remote-tracking branch 'upstream/develop' into inomurko/pull_up…
InoMurko May 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
360 changes: 239 additions & 121 deletions .circleci/config.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Packages
/packages/chain-mon @ethereum-optimism/security-reviewers
/packages/chain-mon/src/balance-mon @ethereum-optimism/infra-reviewers
/packages/chain-mon/internal/balance-mon @ethereum-optimism/infra-reviewers
/packages/common-ts @ethereum-optimism/typescript-reviewers
/packages/contracts-bedrock @ethereum-optimism/contract-reviewers
/packages/core-utils @ethereum-optimism/legacy-reviewers
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/slither.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
slither-analyze:
runs-on: ubuntu-latest
container:
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.43.0
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.49.0
steps:
- uses: actions/checkout@v4

Expand All @@ -23,7 +23,7 @@ jobs:
run: rm packages/contracts-bedrock/package.json

- name: Run Slither
uses: crytic/slither-action@v0.3.2
uses: crytic/slither-action@v0.4.0
id: slither
with:
target: packages/contracts-bedrock
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tag-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ on:
- proxyd
- ufm-metamask
- op-contracts
- op-conductor
prerelease:
description: Increment major/minor/patch as prerelease?
required: false
Expand Down
40 changes: 38 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ lint-go:
.PHONY: lint-go

build-ts: submodules
if [ -n "$$NVM_DIR" ]; then \
if [ -f "$$NVM_DIR/nvm.sh" ]; then \
. $$NVM_DIR/nvm.sh && nvm use; \
fi
pnpm install:ci
Expand All @@ -38,7 +38,43 @@ golang-docker:
--progress plain \
--load \
-f docker-bake.hcl \
op-node op-batcher op-proposer op-challenger
op-node op-batcher op-proposer op-challenger op-dispute-mon
.PHONY: golang-docker

docker-builder-clean:
docker buildx rm buildx-build
.PHONY: docker-builder-clean

docker-builder:
docker buildx create \
--driver=docker-container --name=buildx-build --bootstrap --use
.PHONY: docker-builder

# add --print to dry-run
cross-op-node:
# We don't use a buildx builder here, and just load directly into regular docker, for convenience.
GIT_COMMIT=$$(git rev-parse HEAD) \
GIT_DATE=$$(git show -s --format='%ct') \
IMAGE_TAGS=$$(git rev-parse HEAD),latest \
PLATFORMS="linux/arm64" \
GIT_VERSION=$(shell tags=$$(git tag --points-at $(GITCOMMIT) | grep '^op-node/' | sed 's/op-node\///' | sort -V); \
preferred_tag=$$(echo "$$tags" | grep -v -- '-rc' | tail -n 1); \
if [ -z "$$preferred_tag" ]; then \
if [ -z "$$tags" ]; then \
echo "untagged"; \
else \
echo "$$tags" | tail -n 1; \
fi \
else \
echo $$preferred_tag; \
fi) \
docker buildx bake \
--progress plain \
--builder=buildx-build \
--load \
--no-cache \
-f docker-bake.hcl \
op-node
.PHONY: golang-docker

chain-mon-docker:
Expand Down
25 changes: 13 additions & 12 deletions bedrock-devnet/devnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,17 @@ def devnet_l1_allocs(paths):
init_devnet_l1_deploy_config(paths)

fqn = 'scripts/Deploy.s.sol:Deploy'
# Use foundry pre-funded account #1 for the deployer
run_command([
'forge', 'script', '--chain-id', '900', fqn, "--sig", "runWithStateDump()", "--private-key", "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
], env={}, cwd=paths.contracts_bedrock_dir)
# We need to set the sender here to an account we know the private key of,
# because the sender ends up being the owner of the ProxyAdmin SAFE
# (which we need to enable the Custom Gas Token feature).
'forge', 'script', fqn, "--sig", "runWithStateDump()", "--sender", "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
], env={
'DEPLOYMENT_OUTFILE': paths.l1_deployments_path,
'DEPLOY_CONFIG_PATH': paths.devnet_config_path,
}, cwd=paths.contracts_bedrock_dir)

forge_dump = read_json(paths.forge_l1_dump_path)
write_json(paths.allocs_l1_path, { "accounts": forge_dump })
os.remove(paths.forge_l1_dump_path)
shutil.move(src=paths.forge_l1_dump_path, dst=paths.allocs_l1_path)

shutil.copy(paths.l1_deployments_path, paths.addresses_json_path)

Expand All @@ -158,21 +161,19 @@ def devnet_l2_allocs(paths):
log.info('Generating L2 genesis allocs, with L1 addresses: '+paths.l1_deployments_path)

fqn = 'scripts/L2Genesis.s.sol:L2Genesis'
# Use foundry pre-funded account #1 for the deployer
run_command([
'forge', 'script', '--chain-id', '901', fqn, "--sig", "runWithAllUpgrades()", "--private-key", "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
'forge', 'script', fqn, "--sig", "runWithAllUpgrades()"
], env={
'CONTRACT_ADDRESSES_PATH': paths.l1_deployments_path,
'DEPLOY_CONFIG_PATH': paths.devnet_config_path,
}, cwd=paths.contracts_bedrock_dir)

# For the previous forks, and the latest fork (default, thus empty prefix),
# move the forge-dumps into place as .devnet allocs.
for suffix in ["-delta", ""]:
for suffix in ["-delta", "-ecotone", ""]:
input_path = pjoin(paths.contracts_bedrock_dir, f"state-dump-901{suffix}.json")
forge_dump = read_json(input_path)
output_path = pjoin(paths.devnet_dir, f'allocs-l2{suffix}.json')
write_json(output_path, { "accounts": forge_dump })
os.remove(input_path)
shutil.move(src=input_path, dst=output_path)
log.info("Generated L2 allocs: "+output_path)


Expand Down
25 changes: 15 additions & 10 deletions cannon/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
GITCOMMIT ?= $(shell git rev-parse HEAD)
GITDATE ?= $(shell git show -s --format='%ct')
VERSION := v0.0.0
VERSION ?= v0.0.0

LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-program/version.Version=$(VERSION)
LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-program/version.Meta=$(VERSION_META)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"

# Use the old Apple linker to workaround broken xcode - https://github.com/golang/go/issues/65169
ifeq ($(shell uname),Darwin)
FUZZLDFLAGS := -ldflags=-extldflags=-Wl,-ld_classic
endif

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

Expand All @@ -21,15 +26,15 @@ test: elf
go test -v ./...

fuzz:
go test -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateSyscallBrk ./mipsevm
go test -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateSyscallClone ./mipsevm
go test -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateSyscallMmap ./mipsevm
go test -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateSyscallExitGroup ./mipsevm
go test -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateSyscallFnctl ./mipsevm
go test -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateHintRead ./mipsevm
go test -run NOTAREALTEST -v -fuzztime 20s -fuzz=FuzzStatePreimageRead ./mipsevm
go test -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateHintWrite ./mipsevm
go test -run NOTAREALTEST -v -fuzztime 20s -fuzz=FuzzStatePreimageWrite ./mipsevm
go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateSyscallBrk ./mipsevm
go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateSyscallClone ./mipsevm
go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateSyscallMmap ./mipsevm
go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateSyscallExitGroup ./mipsevm
go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateSyscallFnctl ./mipsevm
go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateHintRead ./mipsevm
go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 20s -fuzz=FuzzStatePreimageRead ./mipsevm
go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzStateHintWrite ./mipsevm
go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 20s -fuzz=FuzzStatePreimageWrite ./mipsevm

.PHONY: \
cannon \
Expand Down
4 changes: 2 additions & 2 deletions cannon/example/claim/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ toolchain go1.21.1
require github.com/ethereum-optimism/optimism v0.0.0

require (
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/sys v0.20.0 // indirect
)

replace github.com/ethereum-optimism/optimism v0.0.0 => ../../..
8 changes: 4 additions & 4 deletions cannon/example/claim/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
46 changes: 22 additions & 24 deletions cannon/mipsevm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"fmt"
"math/big"

"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/consensus"
Expand All @@ -15,33 +17,29 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/params"

"github.com/ethereum-optimism/optimism/op-bindings/bindings"
)

// LoadContracts loads the Cannon contracts, from op-bindings package
func LoadContracts() (*Contracts, error) {
var mips, oracle Contract
mips.DeployedBytecode.Object = hexutil.MustDecode(bindings.MIPSDeployedBin)
oracle.DeployedBytecode.Object = hexutil.MustDecode(bindings.PreimageOracleDeployedBin)
return &Contracts{
MIPS: &mips,
Oracle: &oracle,
}, nil
}
// LoadArtifacts loads the Cannon contracts, from the contracts package.
func LoadArtifacts() (*Artifacts, error) {
mips, err := foundry.ReadArtifact("../../packages/contracts-bedrock/forge-artifacts/MIPS.sol/MIPS.json")
if err != nil {
return nil, fmt.Errorf("failed to load MIPS contract: %w", err)
}

type Contract struct {
DeployedBytecode struct {
Object hexutil.Bytes `json:"object"`
SourceMap string `json:"sourceMap"`
} `json:"deployedBytecode"`
oracle, err := foundry.ReadArtifact("../../packages/contracts-bedrock/forge-artifacts/PreimageOracle.sol/PreimageOracle.json")
if err != nil {
return nil, fmt.Errorf("failed to load Oracle contract: %w", err)
}

// ignore abi,bytecode,etc.
return &Artifacts{
MIPS: mips,
Oracle: oracle,
}, nil
}

type Contracts struct {
MIPS *Contract
Oracle *Contract
type Artifacts struct {
MIPS *foundry.Artifact
Oracle *foundry.Artifact
}

type Addresses struct {
Expand All @@ -51,7 +49,7 @@ type Addresses struct {
FeeRecipient common.Address
}

func NewEVMEnv(contracts *Contracts, addrs *Addresses) (*vm.EVM, *state.StateDB) {
func NewEVMEnv(artifacts *Artifacts, addrs *Addresses) (*vm.EVM, *state.StateDB) {
// Temporary hack until Cancun is activated on mainnet
cpy := *params.MainnetChainConfig
chainCfg := &cpy // don't modify the global chain config
Expand All @@ -72,11 +70,11 @@ func NewEVMEnv(contracts *Contracts, addrs *Addresses) (*vm.EVM, *state.StateDB)

env := vm.NewEVM(blockContext, vm.TxContext{}, state, chainCfg, vmCfg)
// pre-deploy the contracts
env.StateDB.SetCode(addrs.Oracle, contracts.Oracle.DeployedBytecode.Object)
env.StateDB.SetCode(addrs.Oracle, artifacts.Oracle.DeployedBytecode.Object)

var mipsCtorArgs [32]byte
copy(mipsCtorArgs[12:], addrs.Oracle[:])
mipsDeploy := append(hexutil.MustDecode(bindings.MIPSMetaData.Bin), mipsCtorArgs[:]...)
mipsDeploy := append(hexutil.MustDecode(artifacts.MIPS.Bytecode.Object.String()), mipsCtorArgs[:]...)
startingGas := uint64(30_000_000)
_, deployedMipsAddr, leftOverGas, err := env.Create(vm.AccountRef(addrs.Sender), mipsDeploy, startingGas, common.U2560)
if err != nil {
Expand Down
Loading