Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
8118fff
use CallContract to detect tx failure early if gasLimit is specified …
zhiqiangxu Nov 29, 2024
9f84a4e
fix mip2 test stack too deep error (#13138)
AmadiMichael Nov 29, 2024
b2f6628
make safecall test support forge coverage (#13147)
AmadiMichael Nov 30, 2024
4c0387b
feat: allow arguments to contracts test recipe (#13152)
smartcontracts Dec 2, 2024
b6c28d5
estimate gas correctly for blob tx in increaseGasPrice (#13116)
zhiqiangxu Dec 2, 2024
4ee839a
op-batcher: Fix test flake due to log (#13145)
mslipper Dec 2, 2024
d1a2198
Fix typos in `op-conductor/README.md` documentation (#13128)
sky-coderay Dec 2, 2024
cdae7f2
fix: stack too deep in PermissionedDisputeGame (#13141)
smartcontracts Dec 2, 2024
6e799a6
txmgr/Queue: add additional assertions to test to check for tx orderi…
geoknee Dec 2, 2024
8f31e60
SendDepositTx: make `applyL2Opts` nil-able (#13158)
zhiqiangxu Dec 2, 2024
1a1ab6e
op-e2e: Expose context in supersystem op-e2e (#13135)
mslipper Dec 2, 2024
a486dae
fix mips contracts stack too deep errors (#13137)
AmadiMichael Dec 2, 2024
4777cdf
chore: Bump `kona` in `proofs-tools` image (#13170)
clabby Dec 2, 2024
9345537
Sc/disable ci forge coverage (#13174)
AmadiMichael Dec 2, 2024
23a65e8
op-chain-ops: add readme (#13166)
protolambda Dec 2, 2024
ebd2cfd
op-e2e: update readme (#13165)
protolambda Dec 2, 2024
4b75520
op-node: update readme (#13164)
protolambda Dec 2, 2024
0c13f11
op-service: add readme (#13162)
protolambda Dec 2, 2024
e76c04d
op-wheel: add readme (#13161)
protolambda Dec 2, 2024
35c1ffd
op-proposer: add readme (#13160)
protolambda Dec 2, 2024
623609a
feat: make Cannon libraries verison agnostic (#13175)
smartcontracts Dec 2, 2024
a2b1a7e
feat: common core for contracts Go check scripts (#13134)
smartcontracts Dec 2, 2024
3f43f03
feat: introduce mise (#13156)
smartcontracts Dec 2, 2024
176c71a
remove dup log (#13149)
zhiqiangxu Dec 2, 2024
cbfb97e
fix: delayed weth addr in superchain inspect (#13159)
ashutoshvarma Dec 2, 2024
72ec8d3
ctb: Fix flake in TestExtractTestNames (#13177)
mslipper Dec 3, 2024
4de5c8c
op-signer, op-node: Integrate op-node with op-signer for block payloa…
mininny Dec 3, 2024
010c8a9
feat: remove unused _includeDump arg (#13099)
maurelian Dec 3, 2024
e1e5d06
Sc/remove todo justfile (#13179)
AmadiMichael Dec 3, 2024
3435fcc
enables and asserts that forge coverage compiles and runs successfull…
AmadiMichael Dec 3, 2024
f2eaaa8
feat: Remove thin wrapper _run() function overload (#13101)
maurelian Dec 3, 2024
e43ade1
maint: remove versions.json (#13184)
smartcontracts Dec 3, 2024
622fb35
op-batcher: Wait for queue to drain before shutdown (#13172)
mslipper Dec 3, 2024
a46cc61
op-deployer: fix nil dereference of SuperchainRoles (#13178)
bitwiseguy Dec 3, 2024
508ccbe
op-deployer/ctb: Add DeployOPCM script (#13187)
mslipper Dec 3, 2024
e101cd8
op-e2e: Recover gracefully from log-after-exit panics (#13190)
mslipper Dec 3, 2024
67dd693
chore(opc): Bump `asterisc` version (#13189)
clabby Dec 3, 2024
d0c4e37
op components migration to just (#13185)
sigma Dec 3, 2024
6be52fc
op-program: Add v1.4.0-rc.2 to list of op-program releases. (#13193)
ajsutton Dec 3, 2024
5d52959
chore(ops): Bump `kona` in `proofs-tools` (#13196)
clabby Dec 3, 2024
4ce84f1
maint: bump forge version (#13197)
smartcontracts Dec 3, 2024
c36de04
chore(ops): Support kona + asterisc in the op-challenger (#13198)
refcell Dec 4, 2024
56670a7
fix: workaround for foundry snapshot nuking bug (#13209)
smartcontracts Dec 4, 2024
7457c56
feat(op-challenger): Add `TraceTypeAsteriscKona` to default `--trace-…
clabby Dec 4, 2024
b002fea
maint: remove holocene upgrade folder (#13214)
smartcontracts Dec 4, 2024
2d86cab
feat: timeout fuzz tests after 10 minutes (#13207)
smartcontracts Dec 4, 2024
cd8bab4
e2e/actions: enhance holocene activation action test to cover executi…
geoknee Dec 4, 2024
c3e535c
ops: Remove contracts-bedrock Docker image (#13218)
mslipper Dec 4, 2024
ecdb788
maint: clean up some usage of vm.assume (#13216)
smartcontracts Dec 4, 2024
ec05937
feat: move interfaces to a new top-level folder (#13114)
smartcontracts Dec 4, 2024
21827a2
maint: update unused imports check to use new pattern (#13227)
smartcontracts Dec 4, 2024
da85e69
run forge coverage periodically (#13222)
AmadiMichael Dec 4, 2024
531e3d9
op-deployer: Block deploying tags to chains without OPCM (#13231)
mslipper Dec 4, 2024
33889f5
ci: Run contract checks and tests on self-hosted infra (#13219)
mslipper Dec 4, 2024
d68380f
fix (#13237)
AmadiMichael Dec 4, 2024
d45a046
op-e2e: Add timeouts to sequencer failover tests (#13224)
mslipper Dec 4, 2024
d164b6d
fix: bump kona-client version (#13242)
refcell Dec 4, 2024
260f36e
chore(op-deployer): Fork in asterisc + dispute game deployment jobs (…
clabby Dec 4, 2024
b5bc989
dependabot(gomod): bump golang.org/x/sync from 0.9.0 to 0.10.0 (#13233)
dependabot[bot] Dec 4, 2024
e471336
dependabot(gomod): bump github.com/kurtosis-tech/kurtosis/api/golang …
dependabot[bot] Dec 4, 2024
e253b19
maint: rewrite spacers check to use new framework (#13232)
smartcontracts Dec 4, 2024
a555626
fix: develop-forge-coverage ci job name (#13241)
smartcontracts Dec 4, 2024
d3fbc57
op-deployer: Update OPCM bootstrap command (#13238)
mslipper Dec 4, 2024
139dabe
ci: Remove Kurtosis-specific go job (#13249)
mslipper Dec 5, 2024
37d7bda
op-challenger: Use target platform for kona docker image. (#13251)
ajsutton Dec 5, 2024
a88f639
chore(op-deployer): Accept existing impl in `DelayedWETH` bootstrap t…
clabby Dec 5, 2024
94056b9
op-challenger, op-program: Require specific opt-in to use the custom …
ajsutton Dec 5, 2024
25972bd
chore: fix some problematic function names in comment (#13142)
mountcount Dec 5, 2024
564b0c1
NewChannelBuilder => newChannelBuilder, and move it into channel_buil…
zhiqiangxu Dec 5, 2024
0648499
fix: codecov config (#13244)
smartcontracts Dec 5, 2024
ee5c794
op-deployer: Clean up to use latest libs (#13257)
mslipper Dec 5, 2024
1eb223d
interop: parallelized receipt fetching (#13044)
axelKingsley Dec 5, 2024
9548d53
op-conductor: Fix hang in testing (#13266)
mslipper Dec 5, 2024
750ed20
op-dispute-mon: Support asterisc kona game types. (#13270)
ajsutton Dec 5, 2024
a8c8851
maint: remove unnecessary snapshots check script (#13248)
smartcontracts Dec 5, 2024
ce72380
op-conductor: Temporarily skip flaky test (#13276)
mslipper Dec 5, 2024
53b3af7
fix(op-challenger): Clarify `op-challenger create-game` flags (#13269)
clabby Dec 5, 2024
9dda729
Typo fix Update flags.mk (#13226)
mdqst Dec 6, 2024
d6fa448
increase the transaction throttling limit to allow >99% of transactio…
Dec 6, 2024
f17da35
feat(op-deployer): `Proxy` bootstrap command (#13213)
clabby Dec 6, 2024
ad868c5
ctb: Fix concurrent map writes error (#13278)
mslipper Dec 6, 2024
f9eaf1f
op-batcher: extract state pruning, block fetching and progress checki…
geoknee Dec 6, 2024
e5498be
fix loadBlocksIntoState (#13282)
zhiqiangxu Dec 6, 2024
cde5fd7
ci: Pin ethereum package version (#13286)
mslipper Dec 6, 2024
7c8d28d
ci: Remove go-mod-download (#13277)
mslipper Dec 6, 2024
0c9b1d5
fix possible panic in computeSyncActions (#13287)
geoknee Dec 6, 2024
1ac5a35
ci: revert cannon-stf-verify (#13289)
mslipper Dec 6, 2024
bb6f500
docs: Fix formatting issue in "Production Releases" Update README.md …
mdqst Dec 6, 2024
d949564
add `CheckAndDial` to avoid duplicate code (#13146)
zhiqiangxu Dec 6, 2024
354337c
txmgr: Disable default batcher tx send timeout (#13284)
sebastianst Dec 6, 2024
f21f95e
fix: have semver-lock build contracts by default (#13223)
smartcontracts Dec 6, 2024
f0461a1
ctb: remove unnecessary vm.assumes (#13264)
AmadiMichael Dec 6, 2024
17511a2
op-supervisor: readme (#12819)
protolambda Dec 6, 2024
403ae81
fix: Adding more global overrides to apply test. (#13297)
blmalone Dec 6, 2024
63140ba
op-deployer: Bootstrap superchain command (#13294)
mslipper Dec 6, 2024
e1dbb88
dependabot(gomod): bump github.com/holiman/uint256 from 1.3.1 to 1.3.…
dependabot[bot] Dec 6, 2024
b4b90ad
ctb: Reduce heavy fuzz runs in CI (#13296)
mslipper Dec 6, 2024
f6d5ff4
docs: Clarify directory reference Update README.md (#13293)
mdqst Dec 6, 2024
cf1ce68
feat: remove unused systemConfigs mapping from OPCM (#13295)
maurelian Dec 6, 2024
4317c09
refactor: single source of truth for `DerivationVersion` (#11901)
zhiqiangxu Dec 6, 2024
6de3799
ci: Reduce fuzz runs in basic CI (#13299)
mslipper Dec 6, 2024
a2e7d85
maint: bump forge version (#13301)
smartcontracts Dec 6, 2024
d6106dd
op-deployer: Support output files in bootstrap (#13302)
mslipper Dec 6, 2024
830fa2a
Revert "maint: bump forge version (#13301)" (#13304)
mslipper Dec 6, 2024
ad9e554
cannon: Forward evm options in testutil.ValidateEVM (#13221)
Inphi Dec 6, 2024
4c88138
Update op-conductor rpc api path (#12760)
Odysseasmakt Dec 6, 2024
2824b3b
[conductor] Fix test race condition (#13314)
0x00101010 Dec 8, 2024
53034d2
op-batcher: syncActions is aware of safe=unsafe edge case (#13292)
geoknee Dec 9, 2024
b613161
supervisor: L1 Processor (#13206)
axelKingsley Dec 9, 2024
a47441c
cannon: add `RegSP` constant (#13316)
zhiqiangxu Dec 9, 2024
8bef762
Merge branch 'develop' into fix/merge-conflict-lockbox-2
agusduha Dec 9, 2024
036b1d5
fix: pre pr and interfaces imports
agusduha Dec 9, 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
  •  
  •  
  •  
212 changes: 49 additions & 163 deletions .circleci/config.yml

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions .semgrep/rules/sol-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ rules:
pattern-regex: function\s+\w+\s*\(\s*([^)]*?\b\w+\s+(?!_)(?!memory\b)(?!calldata\b)(?!storage\b)(?!payable\b)\w+\s*(?=,|\)))
paths:
exclude:
- packages/contracts-bedrock/src/universal/interfaces/IOptimismMintableERC721.sol
- packages/contracts-bedrock/src/universal/interfaces/IWETH98.sol
- packages/contracts-bedrock/src/dispute/interfaces/IDelayedWETH.sol
- packages/contracts-bedrock/interfaces/universal/IOptimismMintableERC721.sol
- packages/contracts-bedrock/interfaces/universal/IWETH98.sol
- packages/contracts-bedrock/interfaces/dispute/IDelayedWETH.sol
- op-chain-ops/script/testdata/scripts/ScriptExample.s.sol
- packages/contracts-bedrock/test
- packages/contracts-bedrock/scripts/libraries/Solarray.sol
- packages/contracts-bedrock/scripts/interfaces/IGnosisSafe.sol
- packages/contracts-bedrock/src/universal/interfaces/IWETH.sol
- packages/contracts-bedrock/interfaces/universal/IWETH.sol
- packages/contracts-bedrock/src/universal/WETH98.sol
- packages/contracts-bedrock/src/L2/interfaces/ISuperchainWETH.sol
- packages/contracts-bedrock/interfaces/L2/ISuperchainWETH.sol
- packages/contracts-bedrock/src/L2/SuperchainWETH.sol
- packages/contracts-bedrock/src/governance/interfaces/IGovernanceToken.sol
- packages/contracts-bedrock/interfaces/governance/IGovernanceToken.sol
- packages/contracts-bedrock/src/governance/GovernanceToken.sol

- id: sol-style-return-arg-fmt
Expand All @@ -105,13 +105,13 @@ rules:
pattern-regex: returns\s*(\w+\s*)?\(\s*([^)]*?\b\w+\s+(?!memory\b)(?!calldata\b)(?!storage\b)(?!payable\b)\w+(?<!_)\s*(?=,|\)))
paths:
exclude:
- packages/contracts-bedrock/src/dispute/interfaces/IDelayedWETH.sol
- packages/contracts-bedrock/interfaces/dispute/IDelayedWETH.sol
- op-chain-ops/script/testdata/scripts/ScriptExample.s.sol
- packages/contracts-bedrock/test/safe-tools
- packages/contracts-bedrock/scripts/libraries/Solarray.sol
- packages/contracts-bedrock/scripts/interfaces/IGnosisSafe.sol
- packages/contracts-bedrock/src/dispute/interfaces/IPermissionedDisputeGame.sol
- packages/contracts-bedrock/src/dispute/interfaces/IFaultDisputeGame.sol
- packages/contracts-bedrock/interfaces/dispute/IPermissionedDisputeGame.sol
- packages/contracts-bedrock/interfaces/dispute/IFaultDisputeGame.sol

- id: sol-style-doc-comment
languages: [solidity]
Expand Down
73 changes: 32 additions & 41 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,63 +20,54 @@ Interactions within this repository are subject to a [Code of Conduct](https://g

## Development Quick Start

### Software Dependencies

| Dependency | Version | Version Check Command |
| ------------------------------------------------------------- | -------- | ------------------------ |
| [git](https://git-scm.com/) | `^2` | `git --version` |
| [go](https://go.dev/) | `^1.21` | `go version` |
| [node](https://nodejs.org/en/) | `^20` | `node --version` |
| [nvm](https://github.com/nvm-sh/nvm) | `^0.39` | `nvm --version` |
| [just](https://github.com/casey/just) | `^1.34.0`| `just --version` |
| [foundry](https://github.com/foundry-rs/foundry#installation) | `^0.2.0` | `forge --version` |
| [make](https://linux.die.net/man/1/make) | `^3` | `make --version` |
| [jq](https://github.com/jqlang/jq) | `^1.6` | `jq --version` |
| [direnv](https://direnv.net) | `^2` | `direnv --version` |
| [docker](https://docs.docker.com/get-docker/) | `^24` | `docker --version` |
| [docker compose](https://docs.docker.com/compose/install/) | `^2.23` | `docker compose version` |
### Setting Up

### Notes on Specific Dependencies
Clone the repository and open it:

#### `node`
```bash
git clone git@github.com:ethereum-optimism/optimism.git
cd optimism
```

Make sure to use the version of `node` specified within [`.nvmrc`](./.nvmrc).
You can use [`nvm`](https://github.com/nvm-sh/nvm) to manage multiple versions of Node.js on your machine and automatically switch to the correct version when you enter this repository.
### Software Dependencies

#### `foundry`
You will need to install a number of software dependencies to effectively contribute to the
Optimism Monorepo. We use [`mise`](https://mise.jdx.dev/) as a dependency manager for these tools.
Once properly installed, `mise` will provide the correct versions for each tool. `mise` does not
replace any other installations of these binaries and will only serve these binaries when you are
working inside of the `optimism` directory.

`foundry` is updated frequently and occasionally contains breaking changes.
This repository pins a specific version of `foundry` inside of [`versions.json`](./versions.json).
Use the command `just update-foundry` at the root of the monorepo to make sure that your version of `foundry` is the same as the one currently being used in CI.
#### Install `mise`

#### `direnv`
Install `mise` by following the instructions provided on the
[Getting Started page](https://mise.jdx.dev/getting-started.html#_1-install-mise-cli).

[`direnv`](https://direnv.net) is a tool used to load environment variables from [`.envrc`](./.envrc) into your shell so you don't have to manually export variables every time you want to use them.
`direnv` only has access to files that you explicitly allow it to see.
After [installing `direnv`](https://direnv.net/docs/installation.html), you will need to **make sure that [`direnv` is hooked into your shell](https://direnv.net/docs/hook.html)**.
Make sure you've followed [the guide on the `direnv` website](https://direnv.net/docs/hook.html), then **close your terminal and reopen it** so that the changes take effect (or `source` your config file if you know how to do that).
#### Trust the `mise.toml` file

#### `docker compose`
`mise` requires that you explicitly trust the `mise.toml` file which lists the dependencies that
this repository uses. After you've installed `mise` you'll be able to trust the file via:

[Docker Desktop](https://docs.docker.com/get-docker/) should come with `docker compose` installed by default.
You'll have to install the `compose` plugin if you're not using Docker Desktop or you're on linux.
```bash
mise trust mise.toml
```

### Setting Up
#### Install dependencies

Clone the repository and open it:
Use `mise` to install the correct versions for all of the required tools:

```bash
git clone git@github.com:ethereum-optimism/optimism.git
cd optimism
mise install
```

### Building the Monorepo
#### Installing updates

Make sure that you've installed all of the required [Software Dependencies](#software-dependencies) before you continue.
You will need [foundry](https://github.com/foundry-rs/foundry) to build the smart contracts found within this repository.
Refer to the note on [foundry as a dependency](#foundry) for instructions.
`mise` will notify you if any dependencies are outdated. Simply run `mise install` again to install
the latest versions of the dependencies if you receive these notifications.

### Building the Monorepo

Install dependencies and build all packages within the monorepo by running:
You must install all of the required [Software Dependencies](#software-dependencies) to build the
Optimism Monorepo. Once you've done so, run the following command to build:

```bash
make build
Expand All @@ -88,7 +79,7 @@ Use the above command to rebuild the monorepo.

### Running tests

Before running tests: **follow the above instructions to get everything built.**
Before running tests: **follow the above instructions to get everything built**.

#### Running unit tests (solidity)

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -248,5 +248,5 @@ update-op-geth: ## Updates the Geth version used in the project
.PHONY: update-op-geth

install-eth2-testnet-genesis:
go install -v github.com/protolambda/eth2-testnet-genesis@$(shell jq -r .eth2_testnet_genesis < versions.json)
go install -v github.com/protolambda/eth2-testnet-genesis@v$(shell yq '.tools."go:github.com/protolambda/eth2-testnet-genesis"' mise.toml)
.PHONY: install-eth2-testnet-genesis
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ For contract releases, refer to the GitHub release notes for a given release whi

Tags of the form `v<semver>`, such as `v1.1.4`, indicate releases of all Go code only, and **DO NOT** include smart contracts.
This naming scheme is required by Golang.
In the above list, this means these `v<semver` releases contain all `op-*` components and exclude all `contracts-*` components.
In the above list, this means these `v<semver>` releases contain all `op-*` components and exclude all `contracts-*` components.

`op-geth` embeds upstream geth’s version inside its own version as follows: `vMAJOR.GETH_MAJOR GETH_MINOR GETH_PATCH.PATCH`.
Basically, geth’s version is our minor version.
Expand Down
2 changes: 1 addition & 1 deletion bedrock-devnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

This is a utility for running a local Bedrock devnet. It is designed to replace the legacy Bash-based devnet runner as part of a progressive migration away from Bash automation.

The easiest way to invoke this script is to run `make devnet-up` from the root of this repository. Otherwise, to use this script run `python3 main.py --monorepo-dir=<path to the monorepo>`. You may need to set `PYTHONPATH` to this directory if you are invoking the script from somewhere other than `bedrock-devnet`.
The easiest way to invoke this script is to run `make devnet-up` from the root of this repository. Otherwise, to use this script run `python3 main.py --monorepo-dir=<path to the monorepo>`. You may need to set `PYTHONPATH` to this directory if you invoke the script from somewhere other than the `bedrock-devnet` directory.
15 changes: 8 additions & 7 deletions cannon/mipsevm/exec/mips_syscalls.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/ethereum-optimism/optimism/cannon/mipsevm/arch"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/memory"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/program"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/register"
)

type Word = arch.Word
Expand Down Expand Up @@ -99,12 +100,12 @@ const (
)

func GetSyscallArgs(registers *[32]Word) (syscallNum, a0, a1, a2, a3 Word) {
syscallNum = registers[RegSyscallNum] // v0
syscallNum = registers[register.RegSyscallNum] // v0

a0 = registers[RegSyscallParam1]
a1 = registers[RegSyscallParam2]
a2 = registers[RegSyscallParam3]
a3 = registers[RegSyscallParam4]
a0 = registers[register.RegSyscallParam1]
a1 = registers[register.RegSyscallParam2]
a2 = registers[register.RegSyscallParam3]
a3 = registers[register.RegSyscallParam4]

return syscallNum, a0, a1, a2, a3
}
Expand Down Expand Up @@ -281,8 +282,8 @@ func HandleSysFcntl(a0, a1 Word) (v0, v1 Word) {
}

func HandleSyscallUpdates(cpu *mipsevm.CpuScalars, registers *[32]Word, v0, v1 Word) {
registers[RegSyscallRet1] = v0
registers[RegSyscallErrno] = v1
registers[register.RegSyscallRet1] = v0
registers[register.RegSyscallErrno] = v1

cpu.PC = cpu.NextPC
cpu.NextPC = cpu.NextPC + 4
Expand Down
7 changes: 4 additions & 3 deletions cannon/mipsevm/multithreaded/mips.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/ethereum-optimism/optimism/cannon/mipsevm/arch"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/exec"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/program"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/register"
)

type Word = arch.Word
Expand Down Expand Up @@ -57,10 +58,10 @@ func (m *InstrumentedState) handleSyscall() error {
Registers: thread.Registers,
}

newThread.Registers[29] = a1
newThread.Registers[register.RegSP] = a1
// the child will perceive a 0 value as returned value instead, and no error
newThread.Registers[exec.RegSyscallRet1] = 0
newThread.Registers[exec.RegSyscallErrno] = 0
newThread.Registers[register.RegSyscallRet1] = 0
newThread.Registers[register.RegSyscallErrno] = 0
m.state.NextThreadId++

// Preempt this thread for the new one. But not before updating PCs
Expand Down
3 changes: 2 additions & 1 deletion cannon/mipsevm/program/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/cannon/mipsevm"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/arch"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/memory"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/register"
)

const WordSizeBytes = arch.WordSizeBytes
Expand Down Expand Up @@ -63,7 +64,7 @@ func PatchStack(st mipsevm.FPVMState) error {
if err := st.GetMemory().SetMemoryRange(sp-4*memory.PageSize, bytes.NewReader(make([]byte, 5*memory.PageSize))); err != nil {
return errors.New("failed to allocate page for stack content")
}
st.GetRegistersRef()[29] = sp
st.GetRegistersRef()[register.RegSP] = sp

storeMem := func(addr Word, v Word) {
var dat [WordSizeBytes]byte
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exec
package register

// FYI: https://en.wikibooks.org/wiki/MIPS_Assembly/Register_File
//
Expand All @@ -12,6 +12,8 @@ const (
RegA2 = 6
// 4th syscall argument; set to 0/1 for success/error
RegA3 = 7
// Stack pointer
RegSP = 29
)

// FYI: https://web.archive.org/web/20231223163047/https://www.linux-mips.org/wiki/Syscall
Expand Down
7 changes: 4 additions & 3 deletions cannon/mipsevm/tests/evm_multithreaded_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/ethereum-optimism/optimism/cannon/mipsevm/exec"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/multithreaded"
mttestutil "github.com/ethereum-optimism/optimism/cannon/mipsevm/multithreaded/testutil"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/register"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/testutil"
)

Expand Down Expand Up @@ -327,9 +328,9 @@ func TestEVM_SysClone_Successful(t *testing.T) {
expectedNewThread.PC = state.GetCpu().NextPC
expectedNewThread.NextPC = state.GetCpu().NextPC + 4
expectedNewThread.ThreadId = 1
expectedNewThread.Registers[2] = 0
expectedNewThread.Registers[7] = 0
expectedNewThread.Registers[29] = stackPtr
expectedNewThread.Registers[register.RegSyscallRet1] = 0
expectedNewThread.Registers[register.RegSyscallErrno] = 0
expectedNewThread.Registers[register.RegSP] = stackPtr

var err error
var stepWitness *mipsevm.StepWitness
Expand Down
7 changes: 4 additions & 3 deletions cannon/mipsevm/tests/fuzz_evm_multithreaded_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/ethereum-optimism/optimism/cannon/mipsevm/exec"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/multithreaded"
mttestutil "github.com/ethereum-optimism/optimism/cannon/mipsevm/multithreaded/testutil"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/register"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/testutil"
)

Expand Down Expand Up @@ -46,9 +47,9 @@ func FuzzStateSyscallCloneMT(f *testing.F) {
epxectedNewThread := expected.ExpectNewThread()
epxectedNewThread.PC = state.GetCpu().NextPC
epxectedNewThread.NextPC = state.GetCpu().NextPC + 4
epxectedNewThread.Registers[2] = 0
epxectedNewThread.Registers[7] = 0
epxectedNewThread.Registers[29] = stackPtr
epxectedNewThread.Registers[register.RegSyscallNum] = 0
epxectedNewThread.Registers[register.RegSyscallErrno] = 0
epxectedNewThread.Registers[register.RegSP] = stackPtr
expected.NextThreadId = nextThreadId + 1
expected.StepsSinceLastContextSwitch = 0
if state.TraverseRight {
Expand Down
2 changes: 1 addition & 1 deletion cannon/mipsevm/testutil/mips.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (v *EvmValidator) ValidateEVM(t *testing.T, stepWitness *mipsevm.StepWitnes

// ValidateEVM runs a single evm step and validates against an FPVM poststate
func ValidateEVM(t *testing.T, stepWitness *mipsevm.StepWitness, step uint64, goVm mipsevm.FPVM, hashFn mipsevm.HashFn, contracts *ContractMetadata, opts ...evmOption) {
validator := NewEvmValidator(t, hashFn, contracts)
validator := NewEvmValidator(t, hashFn, contracts, opts...)
validator.ValidateEVM(t, stepWitness, step, goVm)
}

Expand Down
17 changes: 11 additions & 6 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
codecov:
require_ci_to_pass: false

comment:
layout: "diff, flags, files"
behavior: default
Expand All @@ -12,8 +13,14 @@ ignore:
- "**/*.t.sol"
- "packages/contracts-bedrock/test/**/*.sol"
- "packages/contracts-bedrock/scripts/**/*.sol"
- "packages/contracts-bedrock/contracts/vendor/WETH9.sol"
- 'packages/contracts-bedrock/contracts/EAS/**/*.sol'
- "packages/contracts-bedrock/src/vendor/**/*.sol"
- "packages/contracts-bedrock/src/interfaces/**/*.sol"
# TODO: add coverage for MIPS64 back once tests are merged in
- "packages/contracts-bedrock/src/cannon/MIPS64.sol"
- "packages/contracts-bedrock/src/cannon/libraries/MIPS64Instructions.sol"
- "packages/contracts-bedrock/src/cannon/libraries/MIPS64State.sol"
- "packages/contracts-bedrock/src/cannon/libraries/MIPS64Syscalls.sol"

coverage:
status:
patch:
Expand All @@ -26,16 +33,14 @@ coverage:
project:
default:
informational: true

flag_management:
# Note: flags should have the same name as the circleci job in which they
# are uploaded.
individual_flags:
- name: contracts-bedrock-tests
- name: contracts-bedrock-coverage
paths:
- packages/contracts-bedrock/src
statuses:
- type: patch
target: 100%
- name: bedrock-go-tests
- name: contracts-tests
- name: sdk-tests
16 changes: 6 additions & 10 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ variable "REPOSITORY" {
default = "oplabs-tools-artifacts/images"
}

variable "KONA_VERSION" {
default = "kona-client-v0.1.0-beta.5"
}

variable "GIT_COMMIT" {
default = "dev"
}
Expand Down Expand Up @@ -119,6 +123,7 @@ target "op-challenger" {
GIT_COMMIT = "${GIT_COMMIT}"
GIT_DATE = "${GIT_DATE}"
OP_CHALLENGER_VERSION = "${OP_CHALLENGER_VERSION}"
KONA_VERSION="${KONA_VERSION}"
}
target = "op-challenger-target"
platforms = split(",", PLATFORMS)
Expand Down Expand Up @@ -207,7 +212,7 @@ target "proofs-tools" {
context = "."
args = {
CHALLENGER_VERSION="b46bffed42db3442d7484f089278d59f51503049"
KONA_VERSION="kona-client-v0.1.0-beta.1"
KONA_VERSION="${KONA_VERSION}"
}
target="proofs-tools"
platforms = split(",", PLATFORMS)
Expand Down Expand Up @@ -241,15 +246,6 @@ target "ci-builder-rust" {
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/ci-builder-rust:${tag}"]
}

target "contracts-bedrock" {
dockerfile = "./ops/docker/Dockerfile.packages"
context = "."
target = "contracts-bedrock"
# See comment in Dockerfile.packages for why we only build for linux/amd64.
platforms = ["linux/amd64"]
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/contracts-bedrock:${tag}"]
}

target "op-deployer" {
dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "."
Expand Down
Loading