Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge develop #48

Merged
merged 61 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f370113
test: fix superchain erc20 invariants (#11688)
agusduha Aug 30, 2024
814c9de
feat: add createX preinstall (#29) (#11618)
agusduha Aug 30, 2024
3e68cf0
Update contracts publish job to use env vars rather than contexts (#1…
mslipper Aug 30, 2024
18f6453
op-program: Prune L1 blocks after advancing origin (#11530)
ajsutton Aug 31, 2024
96ecb2e
npmrc: delete (#11699)
tynes Aug 31, 2024
c198a89
Increase executor size on contract publisher (#11701)
mslipper Aug 31, 2024
8ab4d3d
feat(op-program): Use `PebbleDB` for `DiskKV` (#11705)
clabby Sep 2, 2024
4c211fa
Revert "feat(op-program): Use `PebbleDB` for `DiskKV` (#11705)" (#11707)
ajsutton Sep 2, 2024
9452aa6
op-service/txmgr: multiple fixes / improvements (#11614)
Sep 2, 2024
42085ce
chore(op-service): Remove `reth` receipts source (#11706)
clabby Sep 2, 2024
375b976
fix: op-challenger move.go cli command wasn't cancellable (#11716)
samlaf Sep 3, 2024
957e13d
feat: add ERC-5202 Blueprint library with initial tests (#11700)
mds1 Sep 3, 2024
5b907dc
chore: Fix lint error (#11714)
ajsutton Sep 3, 2024
669a0fb
maint: no kontrol summaries in PRs (#11725)
smartcontracts Sep 3, 2024
337749f
feat: check interface differences in CI (#11677)
smartcontracts Sep 4, 2024
72eff5f
add comment to SingularBatch.Timestamp (#11720)
zhiqiangxu Sep 4, 2024
e80d23b
op-program: Use PebbleDB for DiskKV (Reapply with fixes) (#11709)
ajsutton Sep 4, 2024
5a1a18d
fix: SuperchainWETH fuzz flake with bad sender (#11728)
smartcontracts Sep 4, 2024
f8b421b
Fix copy-paste typo (#11731)
geoknee Sep 4, 2024
e0f6e1e
maint: add interfaces for legacy contracts (#11625)
smartcontracts Sep 4, 2024
2f10fb7
Slim down contracts-bedrock package (#11723)
mslipper Sep 4, 2024
1f0d8a8
fix: properly check all interfaces (#11734)
smartcontracts Sep 4, 2024
31f408b
feat: update interface validation script to check semver (#11740)
smartcontracts Sep 4, 2024
3410109
challenger: Introduce StateConverter to abstract loading VM states (#…
ajsutton Sep 4, 2024
f63cba6
fix: flake tests (#11742)
0xDiscotech Sep 4, 2024
2272a5d
repo: bump foundry (#11746)
tynes Sep 4, 2024
3f7a8ad
Revert "challenger: Introduce StateConverter to abstract loading VM s…
clabby Sep 4, 2024
c2d0911
cannon: Run expensive tests in parallel (#11739)
Inphi Sep 5, 2024
224c5fd
op-node: sequencer should clear inconsistent asyncGossip buffer on se…
protolambda Sep 5, 2024
df4d723
Reapply "challenger: Introduce StateConverter to abstract loading VM …
ajsutton Sep 5, 2024
ec06858
contracts-bedrock: Add OPSM file I/O for superchain deployments (#11750)
mslipper Sep 5, 2024
51150d8
maint: update solidity vscode extension (#11751)
smartcontracts Sep 5, 2024
91c7ed0
op-conductor: adds raft log snapshot configs (#11745)
zhwrd Sep 5, 2024
ffd9ed4
fix: initialization tests (#11674)
smartcontracts Sep 5, 2024
e7e5229
Update VERSIONING.md (#11761)
mds1 Sep 5, 2024
f85f189
Fix contracts-bedrock-docker-publish build (#11755)
mslipper Sep 5, 2024
ac19f2f
op-node: op-node interop block verification (devnet-1 scope) (#11611)
protolambda Sep 5, 2024
67ba188
cannon: Support binary serialisation for snapshots (#11718)
ajsutton Sep 6, 2024
31444eb
op-node: sanity-check the forkchoice updates (#11780)
protolambda Sep 6, 2024
247b399
Use local logger in data source (#11756)
joshklop Sep 6, 2024
85c79a5
fix: small typo fixes to DeploySuperchain.s.sol. (#11758)
blmalone Sep 6, 2024
873a4ea
cannon: Port audit fixes (#11697)
mbaxter Sep 6, 2024
ccf9d3e
ci: pull cached artifacts for contracts tests (#11771)
smartcontracts Sep 6, 2024
afcc51a
test: more blueprint tests (#11782)
mds1 Sep 6, 2024
49a4e9f
op-chain-ops: prep / utils for interop genesis work (#11790)
protolambda Sep 6, 2024
8733626
Add Maintenance Trigger for Cascading Updates (#11619)
axelKingsley Sep 6, 2024
4562b60
Update and cleanup CODEOWNERS with expert teams (#11786)
sebastianst Sep 6, 2024
75c7326
Catch 'header not found' string in L2BlockRefByLabel (#11759)
emhane Sep 6, 2024
f954cbb
ci: speed up CI by up to 50% (#11794)
smartcontracts Sep 6, 2024
1824499
dependabot(gomod): bump github.com/prometheus/client_golang (#11764)
dependabot[bot] Sep 6, 2024
52336b4
fix(challenger): `asterisc-kona` trace type (#11789)
clabby Sep 7, 2024
fb735d6
dependabot(gomod): bump golang.org/x/crypto from 0.26.0 to 0.27.0 (#1…
dependabot[bot] Sep 7, 2024
747c9e7
Add Admin RPC for Adding New Chain Monitors (#11792)
axelKingsley Sep 7, 2024
4fbe14f
semgrep: try to fix CI timeout (#11798)
protolambda Sep 7, 2024
9170e93
maint: move existing interfaces to folders (#11749)
smartcontracts Sep 8, 2024
40750a5
op-challenger: Support binary and JSON snapshots (#11754)
ajsutton Sep 8, 2024
c27aead
Remove hardcoded entrypoint (#11801)
mslipper Sep 9, 2024
e0f8589
Allow cheatcodes on DeploySuperchain.s.sol (#11802)
mslipper Sep 9, 2024
c05f5ad
op-program: Add recent op-program versions to reproducibility check (…
ajsutton Sep 9, 2024
29dc095
Merge branch 'develop' into chore/merge-develop
0xDiscotech Sep 9, 2024
9055e3e
fix: conflicts and broken imports
0xDiscotech Sep 9, 2024
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
407 changes: 248 additions & 159 deletions .circleci/config.yml

Large diffs are not rendered by default.

62 changes: 27 additions & 35 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,43 +1,35 @@
# Packages
/packages/contracts-bedrock @ethereum-optimism/contract-reviewers
/packages/sdk @ethereum-optimism/devxpod
# Monorepo - default to go-reviewers
* @ethereum-optimism/go-reviewers

# OP Stack general
/bedrock-devnet @ethereum-optimism/go-reviewers @ethereum-optimism/op-stack
/op-alt-da @ethereum-optimism/go-reviewers @ethereum-optimism/op-stack
/op-batcher @ethereum-optimism/go-reviewers @ethereum-optimism/op-stack
/op-chain-ops @ethereum-optimism/go-reviewers @ethereum-optimism/op-stack
/op-e2e @ethereum-optimism/go-reviewers @ethereum-optimism/op-stack
/op-node @ethereum-optimism/go-reviewers @ethereum-optimism/op-stack
/op-proposer @ethereum-optimism/go-reviewers @ethereum-optimism/op-stack
/op-wheel @ethereum-optimism/go-reviewers @ethereum-optimism/op-stack
/ops-bedrock @ethereum-optimism/go-reviewers @ethereum-optimism/op-stack

# Expert areas
/op-node/rollup @ethereum-optimism/go-reviewers @ethereum-optimism/consensus

/op-supervisor @ethereum-optimism/go-reviewers @ethereum-optimism/interop

# Bedrock codebases
/bedrock-devnet @ethereum-optimism/go-reviewers
/cannon @ethereum-optimism/go-reviewers
/op-batcher @ethereum-optimism/go-reviewers
/op-bootnode @ethereum-optimism/go-reviewers
/op-chain-ops @ethereum-optimism/go-reviewers
/op-challenger @ethereum-optimism/go-reviewers
/op-dispute-mon @ethereum-optimism/go-reviewers
/op-e2e @ethereum-optimism/go-reviewers
/op-node @ethereum-optimism/go-reviewers
/op-node/rollup @protolambda @ajsutton
/op-alt-da @ethereum-optimism/go-reviewers
/op-preimage @ethereum-optimism/go-reviewers
/op-program @ethereum-optimism/go-reviewers
/op-proposer @ethereum-optimism/go-reviewers
/op-service @ethereum-optimism/go-reviewers
/op-supervisor @ethereum-optimism/go-reviewers
/op-wheel @ethereum-optimism/go-reviewers
/ops-bedrock @ethereum-optimism/go-reviewers
/op-conductor @0x00101010 @zhwrd @mslipper
/op-conductor @ethereum-optimism/go-reviewers @ethereum-optimism/op-conductor

/cannon @ethereum-optimism/go-reviewers @ethereum-optimism/proofs
/op-dispute-mon @ethereum-optimism/go-reviewers @ethereum-optimism/proofs
/op-challenger @ethereum-optimism/go-reviewers @ethereum-optimism/proofs
/op-preimage @ethereum-optimism/go-reviewers @ethereum-optimism/proofs
/op-program @ethereum-optimism/go-reviewers @ethereum-optimism/proofs

# Ops
/.circleci @ethereum-optimism/monorepo-ops-reviewers
/.github @ethereum-optimism/monorepo-ops-reviewers
/ops @ethereum-optimism/monorepo-ops-reviewers
/docker-bake.hcl @ethereum-optimism/monorepo-ops-reviewers

# Misc
/proxyd @ethereum-optimism/infra-reviewers
/infra @ethereum-optimism/infra-reviewers
/specs @ethereum-optimism/contract-reviewers @ethereum-optimism/go-reviewers

# Don't add owners if only package.json is updated
/packages/*/package.json
/*/package.json

# JavaScript Releases
/packages/*/CHANGELOG.md @ethereum-optimism/release-managers
/*/CHANGELOG.md @ethereum-optimism/release-managers
# Contracts
/packages/contracts-bedrock @ethereum-optimism/contract-reviewers
4 changes: 0 additions & 4 deletions .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"recommendations": [
"editorconfig.editorconfig",
"juanblanco.solidity",
"nomicfoundation.hardhat-solidity",
"golang.go"
]
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ cannon-prestate: op-program cannon ## Generates prestate using cannon and op-pro
.PHONY: cannon-prestate

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

Expand Down
5 changes: 3 additions & 2 deletions cannon/cmd/load_elf.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/ethereum-optimism/optimism/cannon/mipsevm"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/multithreaded"
"github.com/ethereum-optimism/optimism/cannon/serialize"
"github.com/urfave/cli/v2"

"github.com/ethereum-optimism/optimism/cannon/mipsevm/program"
Expand Down Expand Up @@ -51,14 +52,14 @@ func LoadELF(ctx *cli.Context) error {
return program.LoadELF(f, singlethreaded.CreateInitialState)
}
writeState = func(path string, state mipsevm.FPVMState) error {
return jsonutil.WriteJSON[*singlethreaded.State](path, state.(*singlethreaded.State), OutFilePerm)
return serialize.Write[*singlethreaded.State](path, state.(*singlethreaded.State), OutFilePerm)
}
} else if vmType == mtVMType {
createInitialState = func(f *elf.File) (mipsevm.FPVMState, error) {
return program.LoadELF(f, multithreaded.CreateInitialState)
}
writeState = func(path string, state mipsevm.FPVMState) error {
return jsonutil.WriteJSON[*multithreaded.State](path, state.(*multithreaded.State), OutFilePerm)
return serialize.Write[*multithreaded.State](path, state.(*multithreaded.State), OutFilePerm)
}
} else {
return fmt.Errorf("invalid VM type: %q", vmType)
Expand Down
27 changes: 24 additions & 3 deletions cannon/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"time"

"github.com/ethereum-optimism/optimism/cannon/mipsevm/multithreaded"
"github.com/ethereum-optimism/optimism/cannon/serialize"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log"
Expand Down Expand Up @@ -217,9 +218,29 @@ func (p *ProcessPreimageOracle) Close() error {
if p.cmd == nil {
return nil
}

tryWait := func(dur time.Duration) (bool, error) {
ctx, cancel := context.WithTimeout(context.Background(), dur)
defer cancel()
select {
case <-ctx.Done():
return false, nil
case err := <-p.waitErr:
return true, err
}
}
// Give the pre-image server time to exit cleanly before killing it.
time.Sleep(time.Second * 1)
if exited, err := tryWait(1 * time.Second); exited {
return err
}
// Politely ask the process to exit and give it some more time
_ = p.cmd.Process.Signal(os.Interrupt)
if exited, err := tryWait(30 * time.Second); exited {
return err
}

// Force the process to exit
_ = p.cmd.Process.Signal(os.Kill)
return <-p.waitErr
}

Expand Down Expand Up @@ -434,7 +455,7 @@ func Run(ctx *cli.Context) error {
}

if snapshotAt(state) {
if err := jsonutil.WriteJSON(fmt.Sprintf(snapshotFmt, step), state, OutFilePerm); err != nil {
if err := serialize.Write(fmt.Sprintf(snapshotFmt, step), state, OutFilePerm); err != nil {
return fmt.Errorf("failed to write state snapshot: %w", err)
}
}
Expand Down Expand Up @@ -491,7 +512,7 @@ func Run(ctx *cli.Context) error {
vm.Traceback()
}

if err := jsonutil.WriteJSON(ctx.Path(RunOutputFlag.Name), state, OutFilePerm); err != nil {
if err := serialize.Write(ctx.Path(RunOutputFlag.Name), state, OutFilePerm); err != nil {
return fmt.Errorf("failed to write state output: %w", err)
}
if debugInfoFile := ctx.Path(RunDebugInfoFlag.Name); debugInfoFile != "" {
Expand Down
6 changes: 3 additions & 3 deletions cannon/cmd/witness.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (

"github.com/ethereum-optimism/optimism/cannon/mipsevm"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/multithreaded"
"github.com/ethereum-optimism/optimism/cannon/serialize"
"github.com/urfave/cli/v2"

"github.com/ethereum-optimism/optimism/cannon/mipsevm/singlethreaded"
"github.com/ethereum-optimism/optimism/op-service/jsonutil"
)

var (
Expand All @@ -33,12 +33,12 @@ func Witness(ctx *cli.Context) error {
if vmType, err := vmTypeFromString(ctx); err != nil {
return err
} else if vmType == cannonVMType {
state, err = jsonutil.LoadJSON[singlethreaded.State](input)
state, err = serialize.Load[singlethreaded.State](input)
if err != nil {
return fmt.Errorf("invalid input state (%v): %w", input, err)
}
} else if vmType == mtVMType {
state, err = jsonutil.LoadJSON[multithreaded.State](input)
state, err = serialize.Load[multithreaded.State](input)
if err != nil {
return fmt.Errorf("invalid input state (%v): %w", input, err)
}
Expand Down
3 changes: 3 additions & 0 deletions cannon/mipsevm/iface.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package mipsevm

import (
"github.com/ethereum-optimism/optimism/cannon/serialize"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"

"github.com/ethereum-optimism/optimism/cannon/mipsevm/memory"
)

type FPVMState interface {
serialize.Serializable

GetMemory() *memory.Memory

// GetHeap returns the current memory address at the top of the heap
Expand Down
42 changes: 42 additions & 0 deletions cannon/mipsevm/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,48 @@ func (m *Memory) SetMemoryRange(addr uint32, r io.Reader) error {
}
}

// Serialize writes the memory in a simple binary format which can be read again using Deserialize
// The format is a simple concatenation of fields, with prefixed item count for repeating items and using big endian
// encoding for numbers.
//
// len(PageCount) uint32
// For each page (order is arbitrary):
//
// page index uint32
// page Data [PageSize]byte
func (m *Memory) Serialize(out io.Writer) error {
if err := binary.Write(out, binary.BigEndian, uint32(m.PageCount())); err != nil {
return err
}
for pageIndex, page := range m.pages {
if err := binary.Write(out, binary.BigEndian, pageIndex); err != nil {
return err
}
if _, err := out.Write(page.Data[:]); err != nil {
return err
}
}
return nil
}

func (m *Memory) Deserialize(in io.Reader) error {
var pageCount uint32
if err := binary.Read(in, binary.BigEndian, &pageCount); err != nil {
return err
}
for i := uint32(0); i < pageCount; i++ {
var pageIndex uint32
if err := binary.Read(in, binary.BigEndian, &pageIndex); err != nil {
return err
}
page := m.AllocPage(pageIndex)
if _, err := io.ReadFull(in, page.Data[:]); err != nil {
return err
}
}
return nil
}

type memReader struct {
m *Memory
addr uint32
Expand Down
4 changes: 2 additions & 2 deletions cannon/mipsevm/multithreaded/instrumented.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package multithreaded
import (
"io"

"github.com/ethereum-optimism/optimism/cannon/serialize"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log"

"github.com/ethereum-optimism/optimism/cannon/mipsevm"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/exec"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/program"
"github.com/ethereum-optimism/optimism/op-service/jsonutil"
)

type InstrumentedState struct {
Expand Down Expand Up @@ -41,7 +41,7 @@ func NewInstrumentedState(state *State, po mipsevm.PreimageOracle, stdOut, stdEr
}

func NewInstrumentedStateFromFile(stateFile string, po mipsevm.PreimageOracle, stdOut, stdErr io.Writer, log log.Logger) (*InstrumentedState, error) {
state, err := jsonutil.LoadJSON[State](stateFile)
state, err := serialize.Load[State](stateFile)
if err != nil {
return nil, err
}
Expand Down
Loading