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

feat: mintable with permit #11868

Merged
merged 9 commits into from
Sep 13, 2024
Merged

feat: mintable with permit #11868

merged 9 commits into from
Sep 13, 2024

Conversation

tynes
Copy link
Contributor

@tynes tynes commented Sep 12, 2024

Description

Adds permit support to the OptimismMintableERC20Token as well as
adding native support for permit2 by default.

Closes #11880

@tynes tynes requested a review from a team as a code owner September 12, 2024 03:09
Copy link
Contributor

semgrep-app bot commented Sep 12, 2024

Semgrep found 3 golang_fmt_errorf_no_params findings:

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.

Semgrep found 1 todos_require_linear finding:

Please create a GitHub ticket for this TODO.

Ignore this finding from todos_require_linear.

@tynes
Copy link
Contributor Author

tynes commented Sep 12, 2024

I kind of want to drop oz here in favor of solady. It would be a straight up scalability improvement

tynes and others added 7 commits September 12, 2024 12:32
Adds `permit` functionality to `OptimismMintableERC20` tokens
that are deployed by the `OptimismMintableERC20Factory`.
This commit max approves permit2 automatically for all holders of the
ERC20 bridge token. This enables all users on OP stack chains to skip an
approval step for actions on protocols utilizing permit2 e.g. Uniswap
@mds1
Copy link
Contributor

mds1 commented Sep 12, 2024

I kind of want to drop oz here in favor of solady. It would be a straight up scalability improvement

Discussed with @tynes and we decided to leave this out of scope for this PR. We want to merge this soon, and switching to solady should be done deliberately with some thought, because:

  • It changes the ABI by removing increaseAllowance and decreaseAllowance methods. We're ok with removing these methods, but want to make sure us and users have time to consider effects of this breaking change
  • We need to validate it's security by (1) making sure the solady ERC20 was in scope for its audit, and/or (2) finding a commit that's been widely used in production

Copy link
Contributor

@mds1 mds1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed synchronously with @tynes, this LGTM

@tynes tynes added this pull request to the merge queue Sep 13, 2024
Merged via the queue into develop with commit 9e1f077 Sep 13, 2024
60 checks passed
@tynes tynes deleted the feat/permit-token branch September 13, 2024 01:57
samlaf pushed a commit to samlaf/optimism that referenced this pull request Nov 10, 2024
* contracts-bedrock: add permit functionality to mintable erc20

Adds `permit` functionality to `OptimismMintableERC20` tokens
that are deployed by the `OptimismMintableERC20Factory`.

* feat: max approve permit2 in ERC20Mintable

This commit max approves permit2 automatically for all holders of the
ERC20 bridge token. This enables all users on OP stack chains to skip an
approval step for actions on protocols utilizing permit2 e.g. Uniswap

* fix: constants first

* semver-lock: update

* snapshots: fix

* contracts: add natspec

* semver-lock: update

* contracts-bedrock: fix nits

* snapshots: update

---------

Co-authored-by: Mark Toda <[email protected]>
claymega added a commit to megaeth-labs/optimism that referenced this pull request Nov 22, 2024
* feat: add ERC-5202 Blueprint library with initial tests (#11700)

https://eips.ethereum.org/EIPS/eip-5202

* chore: Fix lint error (#11714)

golangci-lint v1.60.2 seems to report a new error when performing a nil check and length != 0 on maps. We're not using this version in CI yet but fix the error to simplify the code and provide for a future upgrade.

* maint: no kontrol summaries in PRs (#11725)

Removes the need for kontrol summaries to be generated at PR time.
Summaries will now be generated during run-kontrol.sh instead.

* feat: check interface differences in CI (#11677)

Adds a new check script to contracts-bedrock that verifies that
interfaces being added to the repository accurately represent
the interface of the contract that the interface was generated
for.

* add comment to SingularBatch.Timestamp (#11720)

* op-program: Use PebbleDB for DiskKV (Reapply with fixes) (#11709)

* feat(op-program): Use `PebbleDB` for `DiskKV` (#11705)

* feat(op-program): Use `PebbleDB` for `DiskKV`

* close db

* fix `testFaultProofProgramScenario` tests

* switch to snappy compression

https://github.com/cockroachdb/pebble/issues/3434

* fix tempdir

* update compat release

* defer k/v until preimage server and hinter have both exited

* Only open preimage source when actually needing preimages.

Avoids concurrent access to the pebbledb.

* op-program: Handle interrupts in host

Ensures the preimage kv store is closed cleanly even when the process is sent an interrupt signal.
Enables non-blocking IO so that read calls return io.EOF when a file handle is closed rather than blocking forever.

* op-program: Restore file based kv store. Add pebble as an additional option.

* op-program: Add option to specify KV store format to use

* op-program: Switch pebble to perform sync writes.

* op-program: Rename disk kv to file kv

* op-program: Rename DBFormat to DataFormat for consistency.

---------

Co-authored-by: clabby <[email protected]>

* fix: SuperchainWETH fuzz flake with bad sender (#11728)

Fixes a number of places where SuperchainWETH fuzz tests can flake
as a result of using a sender address that is the ETHLiquidity or
SuperchainWETH contract.

* Fix copy-paste typo (#11731)

* maint: add interfaces for legacy contracts (#11625)

Adds interfaces for the contracts inside of /legacy. Interface is
not included for the LegacyMintableERC20 contract because that
interface has already been defined elsewhere.

* Slim down contracts-bedrock package (#11723)

* Slim down contracts-bedrock package

The contracts-bedrock package was over 2GB in size, mostly because it contained the Git repository. It also supported multiple platforms, which would lead to costly recompilation steps every time the image was used on a different platform (e.g., OSX).

The PR updates the Dockerfile to no longer ship the Git repo. It also updates the Debian base image to a more modern, slimmed down version. The new image is <1G in size.

* fix bakefile

* fix: properly check all interfaces (#11734)

Interfaces check script had a bug that would cause it to use the
wrong ABI when checking an interface. Each compiler artifact only
has a single ABI in it but this same ABI was being used for all
contract definitions found within that file. Since each separate
contract definition gets its own file anyway, this script now
properly verifies by finding the specific definition that matches
the filename.

* feat: update interface validation script to check semver (#11740)

Updates the interface validation script to verify that all
interface contracts are using Solidity ^0.8.0 exactly.

* challenger: Introduce StateConverter to abstract loading VM states (#11715)

* fix: flake tests (#11742)

* fix: add optimism mintable check on assume address helper

* fix: mock interfaces checks

* chore: remove unused import

---------

Co-authored-by: 0xng <[email protected]>

* repo: bump foundry (#11746)

Bumps foundry to the following commit: https://github.com/foundry-rs/foundry/commit/143abd6a768eeb52a5785240b763d72a56987b4a

Release: https://github.com/foundry-rs/foundry/releases/tag/nightly

This needs to be followed up with a rebuild of `ci-builder`

* Revert "challenger: Introduce StateConverter to abstract loading VM states (#…" (#11747)

This reverts commit 3410109155ae75915ff95dc0a1995ac0d3cac8b5.

* cannon: Run expensive tests in parallel (#11739)

* op-node: sequencer should clear inconsistent asyncGossip buffer on sequencer-start (#11724)

* op-node: sequencer should clear inconsistent asyncGossip buffer on sequencer-start

* op-node: test async-gossip clearing

* Update op-node/rollup/sequencing/sequencer.go

Co-authored-by: Adrian Sutton <[email protected]>

---------

Co-authored-by: Adrian Sutton <[email protected]>

* Reapply "challenger: Introduce StateConverter to abstract loading VM states" (#11752)

With fix to set a state converter when creating trace providers for test.

* contracts-bedrock: Add OPSM file I/O for superchain deployments (#11750)

* contracts-bedrock: Add OPSM file I/O for superchain deployments

* Update packages/contracts-bedrock/scripts/DeploySuperchain.s.sol

Co-authored-by: Matt Solomon <[email protected]>

* Update packages/contracts-bedrock/test/DeploySuperchain.t.sol

Co-authored-by: Matt Solomon <[email protected]>

* Address feedback from code review

* Linter

---------

Co-authored-by: Matt Solomon <[email protected]>

* maint: update solidity vscode extension (#11751)

* op-conductor: adds raft log snapshot configs (#11745)

* Refactors NewRaftConsensus param list into a config struct
* Adds configuration support for SnapshotInterval, SnapshotThreshold, TrailingLogs

* fix: initialization tests (#11674)

Fixes the initialization tests, existing tests were not properly
verifying that all of the initializable contracts were being
accounted for.

* Update VERSIONING.md (#11761)

* Fix contracts-bedrock-docker-publish build (#11755)

The build stage name was accidentally removed, which [broke](https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/63237/workflows/e6a2d738-132f-4e10-9da2-c265b364c771/jobs/2627291) the job.

* op-node: op-node interop block verification (devnet-1 scope) (#11611)

* op-node: experimental interop block verification

* op-node: supervisor RPC init

* op-e2e/actions: test interop safety checks

* op-e2e/op-node: test fixes

* op-node: update comments

* op-node: unit-test interop deriver, trigger cross-safe updates on driver step, to poll for supervisor safety changes

* op-node: add more comments, fix flag description

* op-e2e: fix rebase, add missing argument

* cannon: Support binary serialisation for snapshots (#11718)

* cannon: Add serialize utils for binary formats and automatic binary/json detection.

* cannon: Support reading and writing states as binary or JSON

* cannon: Generate mt prestate as gzipped binary.

Use different versions for singlethreaded and multithreaded states.

* cannon: Improve comments for serialization

* cannon: Review feedback

* cannon: Introduce reader and writer helpers to simplify code.

* op-node: sanity-check the forkchoice updates (#11780)

* Use local logger in data source (#11756)

There may be other places where a global logger is used, but this instance is particularly important because one message warns the user of a misconfiguration that otherwise manifests in a seemingly unrelated bug (rollbacks on unsafe block consolidation).

* fix: small typo fixes to DeploySuperchain.s.sol. (#11758)

* fix: small typo fixes to DeploySuperchain.s.sol.

* fix: semgrep Javadoc-style comments are not allowed.

* style: remove extra space

---------

Co-authored-by: Matt Solomon <[email protected]>

* cannon: Port audit fixes (#11697)

* cannon: Require boolean exited field to be encoded as 0 or 1

* cannon: Port mmap solidity tests for MTCannon

* cannon: Port srav solidity tests

* cannon: Run semver-lock, snapshot tasks

* cannon: Cut extra validation on thread.exited

* cannon: Run semver lock

* cannon: Update IMIPS2 interface

* ci: pull cached artifacts for contracts tests (#11771)

Contracts tests don't need to recompile if we can just use the
artifacts instead.

* test: more blueprint tests (#11782)

* test: more blueprint tests

* address PR feedback

* op-chain-ops: prep / utils for interop genesis work (#11790)

* Add Maintenance Trigger for Cascading Updates (#11619)

* Update and cleanup CODEOWNERS with expert teams (#11786)

* Catch 'header not found' string in L2BlockRefByLabel (#11759)

* ci: speed up CI by up to 50% (#11794)

Introduces a number of improvements to CI that significantly
reduce overal CI time by up to 50% of the previous time.

* dependabot(gomod): bump github.com/prometheus/client_golang (#11764)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.2 to 1.20.3.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.20.3/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.2...v1.20.3)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(challenger): `asterisc-kona` trace type (#11789)

* dependabot(gomod): bump golang.org/x/crypto from 0.26.0 to 0.27.0 (#11765)

* dependabot(gomod): bump golang.org/x/crypto from 0.26.0 to 0.27.0

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.26.0 to 0.27.0.
- [Commits](https://github.com/golang/crypto/compare/v0.26.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* deps: update

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mark Tyneway <[email protected]>

* Add Admin RPC for Adding New Chain Monitors (#11792)

* Add Admin RPC for Adding New Chain Monitors

* Update op-supervisor/supervisor/backend/db/db.go

---------

Co-authored-by: protolambda <[email protected]>

* semgrep: try to fix CI timeout (#11798)

* maint: move existing interfaces to folders (#11749)

Moves any existing interfaces that are not already inside of
their corresponding /interfaces folders into those folders.

* op-challenger: Support binary and JSON snapshots (#11754)

* op-challenger: Support loading json or binary cannon states.

* op-challenger: Use binary cannon snapshots

* op-challenger: Support downloading prestates in multiple formats.

* op-challenger: Verify newly downloaded snapshots.

* op-e2e: Update test to handle binary snapshots correctly.

* op-e2e: Remove unused parameter

* op-challenger: Add more varied data to the test cannon state.

* op-challenger: Add more varied data to the test cannon state.

* Remove hardcoded entrypoint (#11801)

Removes the `ENTRYPOINT` directive in the `contracts-bedrock` image. While convenient, using `ENTRYPOINT` makes building tooling on top of the image much harder since the entrypoint cannot be overridden without providing special flags to Docker. It is easier to use a dummy `CMD` instead that directs users to call specific tools when running the container. Functionally, this means users will run `docker run just <cmd>` instead of `docker run <cmd>` if they want to use the Justfile.

* Allow cheatcodes on DeploySuperchain.s.sol (#11802)

We need to add these calls otherwise calling `DeploySuperchain.s.sol` as a script with input/output files fails.

* op-program: Add recent op-program versions to reproducibility check (#11560)

* op-program: Add recent op-program versions to reproducibility check

* Add 1.3.1-rc.2

* ci: update contracts tests to split by file (#11797)

Contracts tests were being split by test name which meant that
Circle CI wouldn't be able to (eventually) be able to properly
split these files by timings. Updates the CI job to split by
file instead.

* fix `ReadPreimage` (#11805)

* avoid out of bound for TrackingPreimageOracleReader.ReadPreimage

* use p.GetPreimage

* op-program: Add a script to build cannon prestates for all tagged op-program releases. (#11559)

* op-dispute-mon: Identify unclaimed credits based on the withdrawal request timestamp (#11488)

* cannon: Fix path used when verifying a downloaded state (#11813)

* op-service: Make target destination when writing JSON/binary explicit (#11800)

Avoids being surprised by the special handling for - and empty string output paths.

* maint: add interface for L2OutputOracle (#11817)

First in a series of PRs adding interfaces for L2 contracts. Since
each of these changes involves touching a lot of other contracts
it seemed easier to split this up into several PRs for legibility.

* cannon: Autodetect VM type from state (#11803)

* cannon: Autodetect VM type from state in run command

* cannon: Autodetect VM type from state in witness command

* cannon: Remove vm type flag from run and witness

* cannon: Only peek the version byte

* cannon: Move all version handling to VersionedState, simplify a lot and forbid serializing multithreaded states to JSON

* cannon: Rename method

* op-challenger: Update cannon state parsing to use version detecting methods

* cannon: Move CreateVM to FPVMState for simplicity

Test read/write/create for VersionedState

* cannon: Readd detect_test

* cannon: Remove json names from multithreaded.State.

Multithreaded states always use binary serialization.

* cannon: Move vmtype to load_elf since it is no longer shared.

* cannon: Ensure metadata is available and sleepCheck used even if debug is disabled.

* op-challenger: Update canon state loading test to cover multiple state versions.

* op-challenger: Release agent resources once game is complete (#11820)

* Fix race condition in sequencer stopping logic (#11769)

* Fix race condition in sequencer stopping logic

* Add channel to signal that latestHead has been updated

* Fix test

* Store latest sealed separately, as latest gets cleared by engine.PayloadSuccessEvent

* Cleanup tests

* Add assertions on latest block ref variables

* Re-check if sequencer is active

* feat: Add nested directory data format for op-program kvstore (#11795)

* feat: Add nested directory data format for op-program kvstore

* Review feedback: Update error message

Co-authored-by: Adrian Sutton <[email protected]>

* op-program: Make directory preimage format the default.

---------

Co-authored-by: Adrian Sutton <[email protected]>
Co-authored-by: Adrian Sutton <[email protected]>

* Revert "op-program: Make directory preimage format the default." (#11823)

* Add broadcast API to Go forge scripts (#11826)

* Add broadcast API to Go forge scripts

Adds a hooks-based API to collect transactions broadcasted via `vm.broadcast(*)` in the Go-based Forge scripts. Users pass an `OnBroadcast` hook to the host, which will be called with a `Broadcast` struct with the following fields whenever a transaction needs to be emitted:

```go
type Broadcast struct {
	From     common.Address
	To       common.Address
	Calldata []byte
	Value    *big.Int
}
```

This API lets us layer on custom transaction management in the future which will be helpful for `op-deployer`.

As part of this PR, I changed the internal `callStack` data structure to contain pointers to `CallFrame`s rather than passing by value. I discovered a bug where the pranked sender was not being cleared in subsequent calls due to an ineffectual assignment error. I took a look at the implementation and there are many places where assignments to call frames within the stack happen after converting the value to a reference, so converting the stack to store pointers in the first place both simplified the code and eliminated a class of errors in the future. I updated the public API methods to return copies of the internal structs to prevent accidental mutation.

* Code review updates

* moar review updates

* fix bug with staticcall

* fix(op-batcher): initAltDA before initChannelConfig (#11816)

* fix(op-batcher): initAltDA before initChannelConfig

* chore(op-bastcher): fix comment

* op-node: read DACommitmentType from scr in LoadOPStackRollupConfig (#11830)

* op-node: read DACommitmentType from scr in LoadOPStackRollupConfig

* op-node: check for altda nil pointers before dereferencing

* op-node: leave altDA config nil if not existent in scr config

* OPSM: Begin implementing OP Stack Manager code and it's deployment (#11623)

* begin supporting specifying versions in OPSM

* add deploy logic

* deploy OPSM along with implementations

* scaffold opsm interface between scripts

* fixes

* mvp of DeployOPChain

* start working on an e2e opsm test, currently reverts

* fix tests

* test cleanup

* rename opsmSingleton to opsm

* chore: remove unused imports

* refactor: switch from 'new' to blueprints, 50% code size reduction

* fix semgrep

* feat: add OPSM interop tests

* test: add missing specs

* add DisputeGameFactory deployment

* chore: update snapshots

* fix opsm interop support

* chore: update snapshots

* Update packages/contracts-bedrock/test/DeployOPChain.t.sol

* fix: add L1StandardBridge setter and initialization

* chore: small clarification of deploy flow

* Update packages/contracts-bedrock/scripts/DeployImplementations.s.sol

Co-authored-by: Blaine Malone <[email protected]>

* chore: add todos

* fix: change bytes32 to string

* rename addrs to opChainAddrs for clarity

* test: fix assertion string numbering

* chore: update semver lock:

---------

Co-authored-by: Blaine Malone <[email protected]>

* op-chain-ops: fix Go forge script broadcast handling (#11832)

* fix: OptimismPortal fuzz flakes (#11818)

OptimismPortal fuzz tests were flaking because the base fee would
increase so much that there wouldn't be enough gas to burn for the
user to be able to buy the gas that they want. Introduces an
additional assumption that will prevent the elasticity multiplier
and max change denominator from being such that the maximum
change to the base fee won't cause us to run out of gas.

* cannon: Fix jalr stack tracking (#11831)

* ci: make semgrep-scan use a large docker image (#11834)

semgrep-scan kept failing with a medium docker image with 4g RAM.
Updating this image to large seems to fix the issue.

* maint: clarify interface fixes are manual (#11835)

* feat: ban deposits interop (#11712)

* interop: disable interop messages in force-deposits

Co-authored-by: Disco <[email protected]>

* interop: clean up config helpers

* op-node: fix/improve L1 info tx tests

* op-node: fix attributes test

* op-node: fix sequence-number usage in post-interop system deposit, fix tests

* op-contracts: L1Block interop: fix diff, remove duplicate test from renaming

* contracts: update metadata

* contracts: fix build warnings

* contracts: fix interface build

* script: ignore

* lint: fix

* test: .testdata directory

* tests: fix revert

---------

Co-authored-by: Disco <[email protected]>
Co-authored-by: protolambda <[email protected]>
Co-authored-by: Mark Tyneway <[email protected]>

* Improvements/bugfixes to Go forge scripts (#11838)

* Improvements/bugfixes to Go forge scripts

Adds some improvements to the Go forge scripts:

- Adds a `GasUsed` field to the `Broadcast` struct so that transaction broadcast utilities can use it for gas estimation. Gas estimation using the RPC will fail when sending transactions in parallel since the state can change significantly between calls.
- Fixes a bug in the `vm.broadcast` cheatcode where sender nonce were not increased for `vm.CALL`s. This led to a mismatch between the contract addresses generated by the Forge tooling, and what was actually being generated onchain.

* op-chain-ops: isolate broadcast functionality

* review updates

* wrap in broadcast check

* Add nonce tests

* Update op-chain-ops/script/script.go

Co-authored-by: protolambda <[email protected]>

* Fix test

* op-chain-ops: track broadcast nonce, add sanity checks

---------

Co-authored-by: protolambda <[email protected]>

* OPSM: remove structs from `DeploySuperchain` (#11833)

* refactor: remove structs from DeploySuperchainInput and DeploySuperchainOutput

* test: fix tests

* test: fix test

* chore: remove outdated struct references

* pr feedback

* chore: code comments

* maint: add more L1 interfaces (#11822)

Another PR adding contract interfaces. L1 contract interfaces are
way more involved than everything else so we're required to start
replacing the contracts with interfaces all over the place.

* ci: selectively build contracts (#11824)

Updates the contracts-bedrock-tests job to only build the specific
tests that are being tested as part of the test split for that
job. Also merges the other contracts-bedrock-build with
build-devnet-allocs since this is a bottleneck now. Overall impact
is that CI time is now 7-10 minutes.

* Add entrypoint to deploy against existing Superchain (#11791)

* Add entrypoint to deploy against existing Superchain

Creates a separate entrypoint in the deploy script to allow an L2 to be deployed against an existing set of Superchain contracts. The deployment assumes that the Superchain contracts have been deployed correctly. The L2 still gets its own ProxyAdmin, AddressManager, and Safe. The API is additive and backwards-compatible.

* Update packages/contracts-bedrock/scripts/deploy/Deploy.s.sol

Co-authored-by: Maurelian <[email protected]>

* remove redundant call

---------

Co-authored-by: Maurelian <[email protected]>

* test: fix test and variable naming conventions (#11845)

* feat: concurrent alt-da requests (#11698)

* feat: initial goroutine blob submission implementation

test(batcher): add e2e test for concurrent altda requests

doc: add explanation comment for FakeDAServer

chore: fix if condition in altda sendTransaction path

feat: add maxConcurrentDaRequests config flag + semaphore

refactor: batcher to use errgroup for da instead of separate semaphore/waitgroup

fix: nil pointer bug after using wrong function after rebase

fix: defn of maxConcurrentDaRequests=0

fix: TestBatcherConcurrentAltDARequests

chore: remove unneeded if statement around time.Sleep

refactor: use TryGo instead of Go to make logic local and easier to read

chore: clean up some comments in batcher

chore: make batcher shutdown cancel pending altda requests by using shutdownCtx instead of killCtx

* chore(batcher): make altda wg wait + log only when useAltDa is true

* refactor: batcher altda submission code into its own function

* test: refactor batcher e2e test to only count batcher txs

* chore: log errors from wait functions

* chore: refactor and minimize time that e2e batcher system tests can run

* chore: lower timeout duration in test

* fix(batcher): maxConcurentDARequests was not being initialized

* feat: run extra fuzz rounds for new fuzz tests (#11748)

Adds a new script that can run extra fuzz test iterations when
new fuzz tests are added. Can be used in CI or locally to make
sure that new fuzz tests aren't flaky.

* Release op-contracts/v1.6.0 (#11760)

* op-contracts/v1.6.0-rc.1 release (#11528)

* Fix deploy-config absolute prestate

* chore: update semver-lock

---------

Co-authored-by: smartcontracts <[email protected]>
Co-authored-by: Kelvin Fichter <[email protected]>

* proofs Add a proofs-tools docker image  (#11825)

* op-challenger: Add a "big" op-challenger docker image including asterisc and kona

* proofs-tools: Rename op-challenger-deps to proofs-tools and use tagged asterisc and kona sources.

* proofs-tools: Use more recent version of challenger for testing

* proofs-tools: Remove TODO

* proofs-tools: Only build for amd64 - kona doesn't support arm64.

* proofs-tools: Add README

* proofs-tools: Use challenger v1.1.0

* maint: add remaining L1 contract interfaces (#11848)

Adds interfaces for all remaining L1 contracts. L2 contracts are
next!

* feat: Run `op-program` in `op-e2e` action tests (#11846)

* feat: Run `op-program` in `op-e2e` action tests

* configurable forks

* golint / op-program test

* use correct endpoint

* fix: add IBeacon to interface check ignore (#11860)

IBeacon should've thrown an error but didn't, need to investigate
why that was the case. For now I've added it to the ignore list.

* proofs-tools: Fix circleci config to run hold job on proofs-tools release tags (#11856)

* maint: add comment to OptimismPortal2 proof submitters mapping (#11853)

Adds a comment to OptimismPortal2 that further explains the
proofSubmitters mapping.

* fix: add extra context to check interfaces script logs (#11861)

Updates the output of the check-interfaces script to be more clear
about cases when removing items from the EXCLUDE_CONTRACTS list is
acceptable and how to verify that an item is unnecessary.

* feat: Helper for dumping `fp-tests` fixtures in `op-program` action tests (#11855)

* feat: Helper for dumping `fp-tests` fixtures in `op-program` action tests

* adrian review

* proofs-tools: Update ci-docker-tag-op-stack-release.sh regex (#11862)

* chore: export process frames (#11864)

* chore: Cleanup proofs actions (#11858)

* chore: Cleanup proofs actions

* tidy

* lint

* adrian review

* move `RunFaultProofProgram` onto the `L2FaultProofEnv` type

* proofs-tools: Include openssl and certs (#11865)

* cannon: Fix GC emulation of Go programs (#11704)

* cannon: Fix GC emulation of Go programs

Improves Linux/MIPS32 emulation for Go programs that utilize the garbage
collector and goroutine scheduling.

This adds support for the following syscalls:

- getpid - used by the go scheduler
- clock_gettime - used by the go scheduler and for GC assists and to properly emulate
  time related operations such as `time.Sleep`.

Note on GC assists:

The Go GC relies on `clock_gettime` for GC "assists", whereby a mutator can perform a little bit
of GC without waiting for the scheduler to do so.
A monotonic clock (runtime.nanotime) is used to compute the current goroutine's compute budget.
By modeling a MIPS32 CPU that runs at some clock speed (ex: 10 MHz), we can provide a consistent
emulation of monotonic time needed by the Go runtime.
All other clock_gettime flags are handled as unimplemented syscalls.

* fix unsupported syscalls test

* fix some review comments

* address review comments

* update snapshots

* fuzz invalid memory proof

* reduce test runtime

* tweak realtime emulation

* reduce test runtime

* set a high timeout for heavy fuzz tests

* simplify fuzz

* fix heavy tests

* Fix the error usage in cannon (#11368)

* chore(op-program): Turn off `fsync` on pebble KV store (#11863)

* chore: Cleanup proofs actions

* tidy

* lint

* adrian review

* move `RunFaultProofProgram` onto the `L2FaultProofEnv` type

* chore(op-program): Turn off `fsync` on pebble KV store

* Add SendAsync to TxMgr (#11843)

* Add SendAsync to TxMgr

Adds a SendAsync method to TxMgr. I'd like to use this for `op-deployer`, which needs to send multiple transactions in parallel but with predictable nonces. `SendAsync` returns a channel that resolves with the result of each send, but synchronously increases the nonce and prepares the first send prior to returning.

* review updates + tests

* feat: introduce OptimismSuperchainERC20Factory (#11617)

* test: add L2 standard bridge interop unit tests (#13)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: unit tests fixes

* fix: super to legacy tests failing

* fix: mock and expect mint and burn

* fix: add generic factory interface (#14)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: add generic factory interface

* feat: modify OptimismMintableERC20Factory for convert (#17)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: add generic factory interface

* feat: modify OptimismMintableERC20Factory for convert

* fix: use only a public function for create3

* feat: rollback interop factory, modify legacy one

* fix: delete local token return variable

* fix: PR fixes

* feat: add superchain erc20 factory implementation (#23)

* feat: add superchain erc20 factory implementation

* fix: remove createX comments

* test: add superchain erc20 factory tests (#25)

* test: add superchain erc20 factory tests

* test: add erc20 asserts

* test: fix expect emit

* fix: remove comments

* feat: add constructor to superchain ERC20 beacon (#34)

* test: remove factory predeploy etch

----------

Co-authored-by: 0xng <[email protected]>
Co-authored-by: 0xParticle <[email protected]>
Co-authored-by: gotzenx <[email protected]>

* fix: set an arbitrary address for superchain erc20 impl

* fix: deploy a proxy for the beacon on genesis (#45)


---------

Co-authored-by: 0xng <[email protected]>

* fix: conflicts and imports

* fix: interfaces

* chore: add .testdata

* fix: adding back .testdata to gitignore

* fix: new conflicts from ci improvements

---------

Co-authored-by: 0xng <[email protected]>
Co-authored-by: 0xParticle <[email protected]>
Co-authored-by: gotzenx <[email protected]>
Co-authored-by: Disco <[email protected]>

* fix: do not delete test data directory (#11869)

Our "just clean" command was deleting the entirety of .testdata
which gets in several scripts now. We don't actually want to
delete the entirety of .testdata, we want to delete anything
inside of it (except for the gitkeep file).

* codeowners: move go-reviewers team at the end (#11877)

* txmgr: improve code sharing between Send and SendAsync (#11876)

* Revert "txmgr: improve code sharing between Send and SendAsync (#11876)" (#11883)

This reverts commit 87af6f0d033996b0cad2437f75fe8bc626a2b5d5.

* Add op-deployer proof-of-concept (#11804)

This PR adds a proof-of-concept for `op-deployer`, a CLI tool that allows declarative management of live OP Stack chains. This POC supports initializing the declarative chain config (called an "intent") and deploying the Superchain smart contracts using the OP Stack Manager.

An example intent for a Sepolia chain looks like this:

```toml
l1ChainID = 11155111
useFaultProofs = true
useAltDA = false
fundDevAccounts = true
contractArtifactsURL = "file:///Users/matthewslipper/dev/optimism/packages/contracts-bedrock/forge-artifacts"

[superchainRoles]
  proxyAdminOwner = "0xb9cdf788704088a4c0191d045c151fcbe2db14a4"
  protocolVersionsOwner = "0xb910764be39c84d572ff17713c615b5bfd7df650"
  guardian = "0x8c7e4a51acb17719d225bd17598b8a94b46c8767"
```

When deployed, it produces a state file that looks like this:

```json
{
  "version": 1,
  "appliedIntent": {
    "l1ChainID": 11155111,
    "superchainRoles": {
      "proxyAdminOwner": "0xb9cdf788704088a4c0191d045c151fcbe2db14a4",
      "protocolVersionsOwner": "0xb910764be39c84d572ff17713c615b5bfd7df650",
      "guardian": "0x8c7e4a51acb17719d225bd17598b8a94b46c8767"
    },
    "useFaultProofs": true,
    "useAltDA": false,
    "fundDevAccounts": true,
    "contractArtifactsURL": "file:///Users/matthewslipper/dev/optimism/packages/contracts-bedrock/forge-artifacts",
    "chains": null
  },
  "superchainDeployment": {
    "proxyAdminAddress": "0x54a6088c04a7782e69b5031579a1973a9e3c1a8c",
    "superchainConfigProxyAddress": "0xc969afc4799a9350f9f05b60748bc62f2829b03a",
    "superchainConfigImplAddress": "0x08426b74350e7cba5b52be4909c542d28b6b3962",
    "protocolVersionsProxyAddress": "0x212a023892803c7570eb317c77672c8391bf3dde",
    "protocolVersionsImplAddress": "0x2633ac74edb7ae1f1b5656e042285015f9ee477d"
  }
}
```

To use `op-deployer`, run `op-deployer init --dev --l1-chain-id <chain-id>`. This will initialize a deployment intent using the development keys in the repo. Then, run `op-deployer apply --l1-rpc-url <l1-rpc> --private-key <deployer-private-key>` to apply the deployment.

- The contracts deployment is performed by the local Go/Forge tooling.
- Upgrades of the contracts (i.e. modifying them after deploying the contracts afresh) is not currently supported. This will be supported in the future.
- The rest of the pipeline (i.e., deploying L2s and generating genesis files) is not included in this PR to keep it smaller and allow us to get buy-in on the fundamental concepts behind `op-deployer` before further implementation.

* fix(ci): skip files without modified functions (#11891)

Updates test-heavy-fuzz-modified-tests to skip any files that
don't have any modified fuzz tests.

* fix(ci): tweak heavy fuzz run parameters (#11894)

Tweaks various parameters for the heavy fuzz run tests to prevent
the test from taking too long. We can run a daily super heavy fuzz
run instead to catch any rare flakes.

* discard candidate when ahead (#11874)

* discard candidate when ahead

* also discard result.Unsafe for consistency

* remove unnecessary type convertion for FakeGenesis

* Revert "also discard result.Unsafe for consistency"

This reverts commit d2288d4a01bb4176fd1a3c6e1901646c7bb404c7.

* remove type cast

* codeowners: own op-e2e/actions/proofs by proofs team (#11895)

* maint: add interfaces for governance contracts (#11878)

Adds interfaces for the two governance contracts.

* maint: rename Safe folder to safe (#11882)

Renames the Safe folder (uppercase) to safe (lowercase) in line
with all other folders.

* opsm: remove remaining structs (#11854)

* refactor: remove structs from DeployImplementations

* refactor: remove structs from DeployOPChain

* test: fix tests

* Update packages/contracts-bedrock/test/DeployOPChain.t.sol

Co-authored-by: Blaine Malone <[email protected]>

* Update packages/contracts-bedrock/test/DeployOPChain.t.sol

Co-authored-by: Blaine Malone <[email protected]>

* test: add missing assertions

* fix: update fuzz test timeout

---------

Co-authored-by: Blaine Malone <[email protected]>
Co-authored-by: Kelvin Fichter <[email protected]>

* feat: Add channel timeout tests for `op-program` (#11885)

* feat: Add channel timeout tests for `op-program`

* typo

* assert error

* fix comment

* feat: Add garbage frame tests for `op-program` (#11896)

* feat: Add channel timeout tests for `op-program`

* typo

* assert error

* fix comment

* feat: Add garbage frame tests for `op-program`

* assert error

* fix comment

* feat: mintable with permit (#11868)

* contracts-bedrock: add permit functionality to mintable erc20

Adds `permit` functionality to `OptimismMintableERC20` tokens
that are deployed by the `OptimismMintableERC20Factory`.

* feat: max approve permit2 in ERC20Mintable

This commit max approves permit2 automatically for all holders of the
ERC20 bridge token. This enables all users on OP stack chains to skip an
approval step for actions on protocols utilizing permit2 e.g. Uniswap

* fix: constants first

* semver-lock: update

* snapshots: fix

* contracts: add natspec

* semver-lock: update

* contracts-bedrock: fix nits

* snapshots: update

---------

Co-authored-by: Mark Toda <[email protected]>

* add sequence window expiry test (#11897)

* fix: incorrect import in ManageDrippie.s.sol (#11898)

Fixes an incorrect import inside of ManageDrippie.s.sol. Seems to
work just fine when forge install is executed but not otherwise.

* op-e2e: Setup mt-cannon for tests (#11881)

* op-e2e: Use mt-cannon

Introduces a `USE_MT_CANNON` env to optionally enables MT-Cannon in
op-e2e integration tests

* a couple of fixes

* fix todo

* op-program: Inject prefetcher instead of setting code in config (#11902)

* op-program: Support injecting a Prefetcher creator rather than setting code on the Config object.

* op-program: Use an interface for the Prefetcher instead of requiring a concrete type.

* feat: `op-program` actor test API improvements (#11903)

* feat: `op-program` actor test API improvements

* lint

* sort fix

* rebase

* op-program: Record the kv format used. (#11900)

Automatically use the correct format if it has been recorded.

Change the default format to directory. Compatibility with op-challenger is preserved because it now uses the automatic format detection, defaulting to file if not specified (e.g for kona-host).

* feat: Scaffolding for DeployAuthSystemInput (#11889)

* feat: Scaffolding for DeployAuthSystemInput

* fix: Remove undefined import

* feat: Address feedback

* interop: interopgen v2 using OPSM (#11702)

* op-chain-ops/interopgen: OPSM powered interop genesis

* ci: make forge scripts available to op-e2e

* op-chain-ops: address interopgen review comments

* cannon: Handle preimage bounds checks consistently (#11911)

* cannon: Handle preimage bounds checks consistently

* cannon: Cleanup stray comment

* feat: Scaffolding for DeployAuthSystemInput (#11890)

* feat: Scaffolding for DeployAuthSystemInput

* feat: Scaffolding for DeployAuthSystem Output

* feat: Address feedback and remove comments

* Interop: SuperSystem for E2E Tests (#11850)

* op-e2e: interop test setup (work in progress)

* op-e2e: interop test setup

* organization and comment updates

* refactor creation code into WIP system2

* save secrets per L2

* Add SuperSystem Interface ; Add Users and Transactions

* Further Refactoring ; Fix Test

* Add Supervisor

* Add Supervisor Client

* Comment out Proposer

* Add AddL2RPC to Supervisor Client

* Fully link Supervisor and OP Node in E2E Test

* correct RPC call supervisor_checkBlock

* Make EOF acceptable for backend check

* final structure names

* Change unused functions to _ for linter

* fix import order

* Add Github Issue Numbers to TODOs

* tynes comments: add World Resource as configurable

---------

Co-authored-by: protolambda <[email protected]>

* feat: Front OPSM with Proxy and Initialize (#11875)

* fix: getting stack underflow error.

* feat: adding proxy infront of OPStackManager.

* fix: PR comments, we're landing on using the initialize function over setRelease.

* fix: rename function.

* fix: nit

* fix: infering proxy admin from superchain config.

* fix: ran command: just pre-pr-no-build

* fix: nits

* fix: using CommonBase in DeployImplementations.s.sol.

* op-chain-ops: pass superchain proxy admin address as input to deployments script

---------

Co-authored-by: Matt Solomon <[email protected]>
Co-authored-by: protolambda <[email protected]>

* fix: Additional DeployImplementations.s.sol tests (#11914)

* fix: Additional testing for inferring proxy admin from superchain config.

* Apply suggestions from code review

---------

Co-authored-by: Matt Solomon <[email protected]>

* Use the deterministic deployer when broadcasting with CREATE2 (#11915)

* op-e2e: Separate helpers for proofs action tests into a new package (#11920)

* op-e2e: Move action test helpers for proofs to a separate package.

* op-e2e: Use helpers package under proofs rather than a completely separate package tree for helpers.

* cannon: Implement thread-safe ll and sc operations (#11906)

* cannon: Extract RMW op handling from shared logic

* cannon: Add more test cases of LL/SC behavior

* cannon: Cut ll/sc-related logic from common mips code

* cannon: Setup mips helpers to return memory modification info

* cannon: Add new fields to track reserved memory

* cannon: Add a boolean field indicating whether an ll reservation is active

* cannon: Implement ll/sc for MTCannon

* cannon: Add modified sysRead tests for MTCannon

* cannon: Test store operations cleare memory reservations

* cannon: Update SysClockGettime to clear ll memory reservation

* cannon: Fix slither warning - initialize variable

* cannon: Bump MIP2.sol version

* cannon: Run semver, snapshot tasks

* cannon: Cut unused log msg

* cannon: Add new error to MIPS interfaces

* cannon: Cut stale TODO

* Add integration test for apply (#11910)

* Add integration test for apply

Adds an integration test for OP Deployer's `apply` method. This test uses Kurtosis to spin up an in-memory L1, deploy the contracts using OP Deployer, then asserts that there is code at all reported addresses.

* Review updates

* circleci: Enable mt-cannon in develop-fault-proofs (#11928)

* feat: add SuperchainERC20 baseline (#11675)

* feat: add superchain erc20 baseline (#37)

* feat: add superchain erc20 baseline

* feat: make superchain ERC20 simpler

* fix: small version fix and tests

* test: fix test name

* test: remove unused import

* feat: making baseline abstract

* fix: interfaces to comply with the new interface checker

* fix: import paths and empty line

* fix: lint line

---------

Co-authored-by: 0xng <[email protected]>
Co-authored-by: 0xng <[email protected]>

* feat(op-service): add SuperchainWETH and ETHLiquidity to predeploys/addresses.go (#11927)

* Port deployers, add end-to-end contract deployments (#11922)

This PR ports over the deployers in `interopgen` into `op-deployer`, and updates `op-deployer` to support end-to end contract deployments for both the Superchain and individual OP Chains.

This PR includes a couple of bugfixes for things I discovered along the way:

1. The script host is updated to bump the nonce of the address calling the CREATE2 deployer when broadcasting. This fixes a chain/simulation mismatch that blocked contracts from being deployed.
2. The DeployImplementations contract used a fixed CREATE2 salt, which caused problems on repeated deployments. I updated the contract to pull the nonce from the environment as we do elsewhere.

Builds on https://github.com/ethereum-optimism/optimism/pull/11910.

* cannon: Handle unaligned futex addresses (#11929)

* cannon: Update tests for futex unaligned memory behavior

* cannon: Align futex-related addresses when they are set

* cannon: Run lint and semver tasks

* cannon: Add wakeup traversal tests with unaligend addresses

* cannon: Don't panic if ThreadState.FutexAddr is unaligned

* cannon: Run semver lock task

* cannon: Cleanup stray whitespace

* Add Logging ; Fix Broken Maintenance Context (#11931)

* Add Logging ; Fix Broken Maintenance Context

* Remove unneeded timing ; use Testlogger

* feat(op-e2e): Expose `L1Replica` + `L2Engine` + `BlobsStore` endpoints (#11926)

* feat(op-e2e): Expose `L1Replica` + `L2Engine` + `BlobsStore` endpoints

* mutex

* deterministic blob indexing

* proto review

* lint

* op-node: handle crit error events, lift event-system out of driver (#11932)

* op-e2e: Fix compile error (#11933)

* op-e2e: Fix compile error

* ci: Make go-lint a dependency of bedrock-go-tests to prevent merging if it fails.

* op-e2e: Separate actions tests into different packages (#11921)

* op-e2e: Move most action tests into a package based on what they test

* op-e2e: Move batch_queue_test.go to derivation package

* op-e2e: Move eip4844_test.go to batcher package

* op-e2e: Move actions helper code to helpers package

* update makefile

* op-e2e: Fix typo

---------

Co-authored-by: clabby <[email protected]>

* feat(op-e2e): Kona FPP actions test adapter (#11936)

* feat(op-e2e): Kona FPP actions test adapter

* rebase

* lint

* review

* fix result check

* op-e2e: Organize e2e system tests in subdirs (#11939)

* op-e2e: organize system tests

* op-e2e: update CI make targets

* op-e2e: fix artifacts file paths

* op-e2e: Fix paths.

* op-e2e: Fix paths again

---------

Co-authored-by: Adrian Sutton <[email protected]>

* OPSM: miscellaneous fixes and improvements (#11935)

* chore: fix comment

* feat: add assertions

* fix: use method instead of new

* refactor: make salt into an input

* refactor: unify checkOutput function signatures

* chore: update snapshots

* test: fix testContractAuth

* test: fix checkOutput signatures

* fix: update go DeployImplementationsInput struct with salt

* pr feedback

* chore: semver lock

* Disable go patches for cannon MT (#11937)

* Disable go patches for cannon MT.

Fix the prestate file list for devnet to use the binary cannon MT prestates.

* Update Makefile

---------

Co-authored-by: Inphi <[email protected]>

* feat: Scaffolding for DeployAuthSystem Script (#11908)

* feat: Scaffolding for DeployAuthSystem Script

* feat: Remove redundant documentation

* Update DeployAuthSystem.s.sol

* op-batcher: Add String methods to txRef (#11904)

* feat: Rewrite FP contract distinctions as table (#11940)

* feat: Rewrite FP contract distinctions as table

* feat: clarify handling of non-MCP contracts

* feat: Update pending mcp statuses

* op-e2e: fix fuzz cgo build (#11941)

* maint: move WETH contract to correct folders (#11870)

Moves WETH98 over to the universal/ folder where it belongs and
brings DelayedWETH up to the top of the dispute folder since there
is no longer any need for a weth/ subfolder.

* dependabot(gomod): bump github.com/prometheus/client_golang (#11946)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.3 to 1.20.4.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.3...v1.20.4)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add L2 genesis generation support to `op-deployer` (#11938)

Adds support for generating L2 genesis files to `op-deployer. The L2 initialization config is generated by merging in overrides as specified in the intent into a default config with sane values. The outputted genesis file is stored in the stage as a GZIP-compressed, base64-encoded string.

* OPSM: DeployOPChain assertions (#11943)

* chore: add BaseDeployIO for the deploy input and output contracts

* test: add assertions to DeployOPChain

* chore: semver lock

* pr feedback

* feat: remove dgf impl from DeployOpChain and OPSM (#11942)

* fix: Remove `--l2-chain-id` default (#11951)

* feat: Add ASR proxy to OPStackManager (#11952)

* feat: Add ASR proxy to OPStackManager

* feat: Add AnchorStateRegistry blueprint

* ci: run slow Cannon test once per day (#11947)

Updates CI to run the (very) slow Cannon go-lint-and-test suite
once per day instead of running it on merge since it adds at least
5 minutes to CI.

* fix: move IERC20Solady into vendor folder (#11945)

An additional "dependency" folder was added in a recent PR, this
is the same purpose as the "vendor" folder so the interface added
in that PR can simply be moved to the "vendor" folder instead.

* ci: bump semgrep-scan to xlarge (#11948)

We're still having resource issues with a large image. Going to
bump this to xlarge to see if that will fix it.

* test: invariant tests for OptimismSuperchainERC20 (#11776)

* chore: configure medusa with basic supERC20 self-bridging (#19)

- used --foundry-compile-all to ensure the test contract under
  `test/properties` is compiled (otherwise it is not compiled and medusa
  crashes when it can't find it's compiled representation)
- set src,test,script to test/properties/medusa to not waste time
  compiling contracts that are not required for the medusa campaign
- used an atomic bridge, which doesnt allow for testing of several of
  the proposed invariants

fix: delete dead code
test: give the fuzzer a head start
docs: fix properties order
test: document & implement assertions 22, 23  and 24
fix: fixes from self-review
test: guide the fuzzer a little bit less
  previously: initial mint, bound on transfer amount: 146625 calls in 200s
  now: no initial mint, no bound on transfer amount: 176835 calls in 200s
  it doesn't seem to slow the fuzzer down
fix: fixes after lovely feedback by disco
docs: merge both documents and categorized properties by their milestone
fix: fixes from parti's review
fix: feedback from disco
fix: feedback from doc
refactor: separate state transitions from pure properties
docs: update tested properties
refactor: move all assertions into properties contract
fix: move function without assertions back into handler
test: only use assertion mode
fix: improve justfile recipie for medusa

* feat: halmos symbolic tests (#21)

* feat: introduce OptimismSuperchainERC20

* fix: contract fixes

* feat: add snapshots and semver

* test: add supports interface tests

* test: add invariant test

* feat: add parameters to the RelayERC20 event

* fix: typo

* fix: from param description

* fix: event signature and interface pragma

* feat: add initializer

* feat: use unstructured storage and OZ v5

* feat: update superchain erc20 interfaces

* fix: adapt storage to ERC7201

* test: add initializable OZ v5 test

* fix: invariant docs

* fix: ERC165 implementation

* test: improve superc20 invariant (#11)

* fix: gas snapshot

* chore: configure medusa with basic supERC20 self-bridging

- used --foundry-compile-all to ensure the test contract under
  `test/properties` is compiled (otherwise it is not compiled and medusa
  crashes when it can't find it's compiled representation)
- set src,test,script to test/properties/medusa to not waste time
  compiling contracts that are not required for the medusa campaign
- used an atomic bridge, which doesnt allow for testing of several of
  the proposed invariants

* fix: delete dead code

* test: give the fuzzer a head start

* feat: create suite for sybolic tests with halmos

* test: setup and 3 properties with symbolic tests

* chore: remove todo comment

* docs: fix properties order

* test: document & implement assertions 22, 23  and 24

* fix: fixes from self-review

* test: guide the fuzzer a little bit less

previously: initial mint, bound on transfer amount: 146625 calls in 200s
now: no initial mint, no bound on transfer amount: 176835 calls in 200s

it doesn't seem to slow the fuzzer down

* feat: add property for burn

* refactor: remove symbolic address on mint property

* refactor: order the tests based on the property id

* feat: checkpoint

* chore: set xdomain sender on failing test

* chore: enhance mocks

* Revert "Merge branch 'chore/setup-medusa' into feat/halmos-symbolic-tests"

This reverts commit 945d6b6ad265ea5e3790d7ac9c5bf4d6586eb533, reversing
changes made to 5dcb3a89252e9e8fa9b54ba9012e714f7cc96395.

* refactor: remove symbolic addresses to make all of the test work

* chore: remove console logs

* feat: add properties file

* chore: polish

* refactor: enhance test on property 7 using direct try catch (now works)

* fix: review comments

* refactor: add symbolic addresses on test functions

* feat: create halmos toml

* chore: polish test contract and mock

* chore: update property

* refactor: move symbolic folder into properties one

* feat: create advanced tests helper contract

* refactor: enhance tests using symbolic addresses instead of concrete ones

* chore: remove 0 property natspec

* feat: add halmos profile and just script

* chore: rename symbolic folder to halmos

* feat: add halmos commands to justfile

* chore: reorder assertions on one test

* refactor: complete test property seven

* chore: mark properties as completed

* chore: add halmos-cheatcodes dependency

* chore: rename advancedtest->halmosbase

* chore: minimize mocked messenger

* chore: delete empty halmos file

* chore: revert changes to medusa.json

* docs: update changes to PROPERTIES.md from base branch

* test: sendERC20 destination fix

* chore: natspec fixes

---------

Co-authored-by: agusduha <[email protected]>
Co-authored-by: 0xng <[email protected]>
Co-authored-by: teddy <[email protected]>

* test: remaining protocol properties (#26)

* test: cross-user fuzzed bridges + actor setup

* test: fuzz properties 8 and 9

* test: properties 7 and 25

* fix: implement doc's feedback

* test: superc20 tob properties (#27)

* chore: add crytic/properties dependency

* test: extend protocol properties so it also covers ToB erc20 properties

* chore: small linter fixes

* docs: update property list

* test: handlers for remaining superc20 state transitions

* fix: disable ToB properties we are not using and guide the fuzzer a bit more

* fix: disable another ToB property not implemented by solady

* chore: remove zero-initializations

* fix: feedback from disco

* chore: separate fuzz campaign tests in guided vs unguided

* test: dont revert on successful unguided relay

* test: add fuzzed calls to burn and mint

* docs: document the separation of fuzz test functions

* chore: move the properties file to its own directory

* chore: consistently use fuzz_ and property_ + camelcase

* chore: fix typo

* chore: camelcase for handlers as well

* fix: revert change that broke halmos campaign compile :D

* test: fuzz non atomic bridging (#31)

* test: changed mocked messenger ABI for message sending but kept assertions the same

* docs: add new properties 26&27

* test: queue cross-chain messages and test related properties

* test: relay random messages from queue and check associated invariants

* chore: rename bridge->senderc20 method for consistency with relayerc20

* test: not-yet-deployed supertokens can get funds sent to them

* chore: medusa runs forever by default

doable since it also handles SIGINTs gracefully

* chore: document the reason behind relay zero and send zero inconsistencies

* fix: feedback from doc

* fix: walk around possible medusa issue

I'm getting an 'unknown opcode 0x4e' in ProtocolAtomic constructor when
calling the MockL2ToL2CrossDomainMessenger for the first time

* test: unguided handler for sendERC20

* fix: feedback from disco

* chore: remove halmos testsuite

* chore: foundry migration (#40)

* chore: track assertion failures

this is so foundry's invariant contract can check that an assertion
returned false in the handler, while still allowing `fail_on_revert =
false` so we can still take full advantage of medusa's fuzzer & coverage
reports

* fix: explicitly skip duplicate supertoken deployments

* chore: remove duplicated PROPERTIES.md file

* chore: expose data to foundry's external invariant checker

* test: run medusa fuzzing campaign from within foundry

* fix: eagerly check for duplicate deployments

* fix: feedback from doc

* chore: shoehorn medusa campaign into foundry dir structure

* chore: remove PROPERTIES.md file

* chore: delete medusa config

* docs: limited support for subdirectories in test/invariant

* chore: rename contracts to be more sneaky about medusa

* docs: rewrite invariant docs in a way compliant with autogen scripts

* chore: fixes from rebase

* fix: cleanup superc20 invariants (#46)

* chore: revert modifications from medusa campaign

* docs: extra docs on why ForTest contract is required

* doc: add list of all supertoken properties

* chore: run forge fmt

* ci: allow for testfiles to be deleted

* fix: run doc autogen script after rebase

---------

Co-authored-by: Disco <[email protected]>
Co-authored-by: agusduha <[email protected]>
Co-authored-by: 0xng <[email protected]>

* ci: job to check contracts build warnings (#11962)

Adds a new compiler job to check for contract build warnings.
Other existing build jobs don't compile the entire set of contracts
and we do want to be able to check for warnings across the board.

* ci: simplify contract build job inputs (#11965)

Simplifies the inputs to contracts-bedrock-build so that it
takes a single skip_pattern command instead of allowing the user
to specify any build command.

* ci: clean up golang job definitions (#11967)

Cleans up a number of golang job definitions. One PR for now
just so I can see this all work.

* ci: fix config error in cannon tests (#11969)

Fixes a configuration error in the scheduled-cannon-full-tests
job.

* op-node: lazy-dial the supervisor RPC (#11970)

* ci: simplify contracts bedrock tests job (#11966)

Simplifies the contracts-bedrock-tests job so that it takes more
parameters but makes the test command unified. Also replaces the
complex script for checking for modified fuzz tests and simply
heavily fuzzes all tests within any test files that have changed.

* ci: misc cleanups and simplifications (#11968)

Cleanups in a few places, removing unused jobs, etc.

* correct the comment (#11971)

* update op-e2e setup (#11857)

* fix: multiple fuzz flakes (#11981)

Fixes a couple of fuzz flakes that were found when fuzzing
heavily.

* maint: add interfaces for L2 bridge/messaging contracts (#11859)

First PR for adding interfaces for L2 contracts. Adds interfaces
for all of the bridging and message passing contracts.

* chore(op-service): use `errors.New` to replace `fmt.Errorf` with no parameters (#11796)

* fix(ci): semgrep cli breaking change (#11985)

Semgrep CLI tool recently removed the --time option which caused
CI to suddenly break.

* ci: correct perms for tag-service.yml (#11961)

GITHUB_TOKEN no longer gets write access by default so it needs to
be provided with write access explicitly.

* Add inspection commands, fix deployer bugs (#11964)

Adds `op-deployer inspection *` commands to expose the generated genesis and rollup configs via the CLI or Golang libraries. Also fixes a bug in deployment - I accidentally deleted the code that set the deployer nonce, so live chain deployments were reverting.

* refactor: Rename OPSM to OPSMProxy for clarity (#11972)

* chore(rename): Rename opsm to opsmProxy

* fix: Go bindings updated for proxy.

* fix: linting

* fix: pr comment nits.

* feat(op-e2e): Open channel closed after sequence window expiry test (#11993)

* feat(op-e2e): Open channel closed after sequence window expiry test

Adds a test to the proof actions that proves a block at the safe head
after the batcher has opened a channel, allowed the sequence window to
expire, and then attempted to close their open channel after the fact.

* buffer frame

* include extra tx

* feat(op-e2e): Channel timeout late submission test (#11995)

* feat(op-e2e): Channel timeout late submission test

* remove finalization of l1 chain

* ci: separate invariant runs from fuzz runs (#11982)

Using 10k invariant runs would be ridiculously slow.

* ci: Restore ci-builder docker release and remove invalid op-challenger-big-docker-release (#11997)

* maint(ci): clean up release job (#11996)

Cleans up the release job by turning it into a matrix.

* maint(ci): clean up scheduled docker publish (#11999)

Same idea again, cleaning up the scheduled docker publish with the
same technique as the previous PR.

* OPSM: More assertions (#11994)

* refactor: rename var for clarity

* test: add more assertions from ChainAssertions, and some new ones

* chore: ensure unique, clear, consistent revert string IDs

also sorts methods alphabetically for clarity

* fix: var name after rebase

* style: forge fmt

* revert proxyAdmin -> superchainProxyAdmin name change for now

* Update packages/contracts-bedrock/scripts/DeployImplementations.s.sol

Co-authored-by: Maurelian <[email protected]>

* chore: small tweaks from pr feedback

---------

Co-authored-by: Maurelian <[email protected]>

* op-challenger: Support MT-Cannon in run-trace (#11934)

* op-challenger: Support MT-Cannon in run-trace

* ..

* fix multi_test.go

* annotate metrics with mt-cannon

* preserve prestate encoding; use separate dir for mt-cannon

* Update op-challenger/cmd/run_trace.go

Co-authored-by: Adrian Sutton <[email protected]>

---------

Co-authored-by: Adrian Sutton <[email protected]>

* feat: add remaining L2 interfaces (#11984)

One more PR for adding L2 interfaces.

* feat: clean up TODOs and add CI check (#12005)

* maint: clean up TODO tags

Cleans up existing TODO tags, particularly those that referenced
old Linear issues. Updates the todo-checker script to allow
<#issue> as well as <issue>.

* feat(ci): add todo-issues check to main CI

Updates the main CI workflow to run the todo-issues check. For
now this check will ignore any bare TODOs. We can update the
script later to reject bare TODOs.

* contracts: Add more MIPS2 tests (#12003)

* contracts: Add more MIPS2 tests

* remove unused var

* cannon: Clean up fuzz test todos (#12009)

* cannon: Add memory assertions to FuzzStatePreimageRead

* cannon: Rework hint write fuzz test to assert hint expectations

* cannon: Update FuzzStatePreimageWrite to assert on expected preimageKey

* cannon: Remove validation skipping logic from test util

* cannon: Cleanup - simplify code

* cannon: Cleanup - dedupe code

* cannon: Clean up program patching (#11944)

* cannon: Cut todo, reorganize syscalls

* cannon: Rename patchGo to patchGoGC, add comments, cut TODO

* cannon: Only allow gc patching for single-threaded Cannon

* cannon: Cut patch flag from load-elf command altogether

* feat(ci): check contract semver matches natspec (#11992)

Adds a new check to CI that verifies that the semver string
defined in the contract matches the string defined in natspec.

* maint(ct): link to external mermaid diagrams in specs (#12012)

Updates the contracts README to use the mermaid diagrams in specs
to avoid duplicated documentation.

* op-program: Reproducible MT-Cannon prestate (#12011)

* op-program: Reproducible MT-Cannon prestate

* fix mt-cannon proof gen

* cannon: Fix makefile phony target (#12014)

* maint(ci): remove autogenerated invariant docs (#11988)

Removes autogenerated invariant docs from the contracts package.
These autogenerated docs create confusion about where invariants
should be defined (the answer is in the specs) and no one actually
looks at them anyway. Just adds an additional step into CI for
minimal benefit.

* vm-runner: User-provided mt-cannon absolute prestate URL (#12016)

* vm-runner: User-provided mt-cannon absolute prestate URL

* placate semgrep

* maint: fix dispute interfaces (#12010)

Fixes the existing dispute interfaces and makes them match the
same style that we're using for all other interfaces.

* op-challenger: Use a wrapper to specify the vm type for metrics (#12020)

* op-challenger: Use a wrapper to specify the vm type for metrics

Decouples the vm type from the trace type to give the run-trace subcommand more flexibility, allowing it to report separate metrics for cannon and mt-cannon.

Also adjust the run-trace loggers to consistently use `mt-cannon` as the type.

* Use constant.

Co-authored-by: Inphi <[email protected]>

---------

Co-authored-by: Inphi <[email protected]>

* SuperSystem: Add Emitter Contract - Basic Message Passing (#11956)

* Add Emitter Contract

* Emitter Contract and Bindings

* AddL2RPC without Stopping

* Rename testdata folder to contracts

* update generate.sh

* update solidity and gen script

* Update kurtosis library. (#12025)

CI is automatically using the latest version which has broken things. Update to match as a temporary fix until we can install a fixed versio…
Troublor pushed a commit to megaeth-labs/optimism that referenced this pull request Nov 28, 2024
* feat(op-program): Use `PebbleDB` for `DiskKV` (#11705)

* feat(op-program): Use `PebbleDB` for `DiskKV`

* close db

* fix `testFaultProofProgramScenario` tests

* switch to snappy compression

https://github.com/cockroachdb/pebble/issues/3434

* fix tempdir

* update compat release

* defer k/v until preimage server and hinter have both exited

* Revert "feat(op-program): Use `PebbleDB` for `DiskKV` (#11705)" (#11707)

This reverts commit 8ab4d3d8e20f69464d9f5191c110b63f4d5a3df6.

* op-service/txmgr: multiple fixes / improvements (#11614)

* - make immediate nonce-too-low error abort send (since it could never succeed otherwise)

- make txmgr resubmit a transaction when fee bumping fails in case it has been dropped from the mempool

- only bump fees when they really should be bumped

- set txmgr overall default send timeout of 10 minutes. It was infinite, which led to permanently
  stuck transaction in combination with the other bugs fixed in this PR.

* Update op-service/txmgr/txmgr_test.go

---------

Co-authored-by: Sebastian Stammler <[email protected]>

* chore(op-service): Remove `reth` receipts source (#11706)

* fix: op-challenger move.go cli command wasn't cancellable (#11716)

* feat: add ERC-5202 Blueprint library with initial tests (#11700)

https://eips.ethereum.org/EIPS/eip-5202

* chore: Fix lint error (#11714)

golangci-lint v1.60.2 seems to report a new error when performing a nil check and length != 0 on maps. We're not using this version in CI yet but fix the error to simplify the code and provide for a future upgrade.

* maint: no kontrol summaries in PRs (#11725)

Removes the need for kontrol summaries to be generated at PR time.
Summaries will now be generated during run-kontrol.sh instead.

* feat: check interface differences in CI (#11677)

Adds a new check script to contracts-bedrock that verifies that
interfaces being added to the repository accurately represent
the interface of the contract that the interface was generated
for.

* add comment to SingularBatch.Timestamp (#11720)

* op-program: Use PebbleDB for DiskKV (Reapply with fixes) (#11709)

* feat(op-program): Use `PebbleDB` for `DiskKV` (#11705)

* feat(op-program): Use `PebbleDB` for `DiskKV`

* close db

* fix `testFaultProofProgramScenario` tests

* switch to snappy compression

https://github.com/cockroachdb/pebble/issues/3434

* fix tempdir

* update compat release

* defer k/v until preimage server and hinter have both exited

* Only open preimage source when actually needing preimages.

Avoids concurrent access to the pebbledb.

* op-program: Handle interrupts in host

Ensures the preimage kv store is closed cleanly even when the process is sent an interrupt signal.
Enables non-blocking IO so that read calls return io.EOF when a file handle is closed rather than blocking forever.

* op-program: Restore file based kv store. Add pebble as an additional option.

* op-program: Add option to specify KV store format to use

* op-program: Switch pebble to perform sync writes.

* op-program: Rename disk kv to file kv

* op-program: Rename DBFormat to DataFormat for consistency.

---------

Co-authored-by: clabby <[email protected]>

* fix: SuperchainWETH fuzz flake with bad sender (#11728)

Fixes a number of places where SuperchainWETH fuzz tests can flake
as a result of using a sender address that is the ETHLiquidity or
SuperchainWETH contract.

* Fix copy-paste typo (#11731)

* maint: add interfaces for legacy contracts (#11625)

Adds interfaces for the contracts inside of /legacy. Interface is
not included for the LegacyMintableERC20 contract because that
interface has already been defined elsewhere.

* Slim down contracts-bedrock package (#11723)

* Slim down contracts-bedrock package

The contracts-bedrock package was over 2GB in size, mostly because it contained the Git repository. It also supported multiple platforms, which would lead to costly recompilation steps every time the image was used on a different platform (e.g., OSX).

The PR updates the Dockerfile to no longer ship the Git repo. It also updates the Debian base image to a more modern, slimmed down version. The new image is <1G in size.

* fix bakefile

* fix: properly check all interfaces (#11734)

Interfaces check script had a bug that would cause it to use the
wrong ABI when checking an interface. Each compiler artifact only
has a single ABI in it but this same ABI was being used for all
contract definitions found within that file. Since each separate
contract definition gets its own file anyway, this script now
properly verifies by finding the specific definition that matches
the filename.

* feat: update interface validation script to check semver (#11740)

Updates the interface validation script to verify that all
interface contracts are using Solidity ^0.8.0 exactly.

* challenger: Introduce StateConverter to abstract loading VM states (#11715)

* fix: flake tests (#11742)

* fix: add optimism mintable check on assume address helper

* fix: mock interfaces checks

* chore: remove unused import

---------

Co-authored-by: 0xng <[email protected]>

* repo: bump foundry (#11746)

Bumps foundry to the following commit: https://github.com/foundry-rs/foundry/commit/143abd6a768eeb52a5785240b763d72a56987b4a

Release: https://github.com/foundry-rs/foundry/releases/tag/nightly

This needs to be followed up with a rebuild of `ci-builder`

* Revert "challenger: Introduce StateConverter to abstract loading VM states (#…" (#11747)

This reverts commit 3410109155ae75915ff95dc0a1995ac0d3cac8b5.

* cannon: Run expensive tests in parallel (#11739)

* op-node: sequencer should clear inconsistent asyncGossip buffer on sequencer-start (#11724)

* op-node: sequencer should clear inconsistent asyncGossip buffer on sequencer-start

* op-node: test async-gossip clearing

* Update op-node/rollup/sequencing/sequencer.go

Co-authored-by: Adrian Sutton <[email protected]>

---------

Co-authored-by: Adrian Sutton <[email protected]>

* Reapply "challenger: Introduce StateConverter to abstract loading VM states" (#11752)

With fix to set a state converter when creating trace providers for test.

* contracts-bedrock: Add OPSM file I/O for superchain deployments (#11750)

* contracts-bedrock: Add OPSM file I/O for superchain deployments

* Update packages/contracts-bedrock/scripts/DeploySuperchain.s.sol

Co-authored-by: Matt Solomon <[email protected]>

* Update packages/contracts-bedrock/test/DeploySuperchain.t.sol

Co-authored-by: Matt Solomon <[email protected]>

* Address feedback from code review

* Linter

---------

Co-authored-by: Matt Solomon <[email protected]>

* maint: update solidity vscode extension (#11751)

* op-conductor: adds raft log snapshot configs (#11745)

* Refactors NewRaftConsensus param list into a config struct
* Adds configuration support for SnapshotInterval, SnapshotThreshold, TrailingLogs

* fix: initialization tests (#11674)

Fixes the initialization tests, existing tests were not properly
verifying that all of the initializable contracts were being
accounted for.

* Update VERSIONING.md (#11761)

* Fix contracts-bedrock-docker-publish build (#11755)

The build stage name was accidentally removed, which [broke](https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/63237/workflows/e6a2d738-132f-4e10-9da2-c265b364c771/jobs/2627291) the job.

* op-node: op-node interop block verification (devnet-1 scope) (#11611)

* op-node: experimental interop block verification

* op-node: supervisor RPC init

* op-e2e/actions: test interop safety checks

* op-e2e/op-node: test fixes

* op-node: update comments

* op-node: unit-test interop deriver, trigger cross-safe updates on driver step, to poll for supervisor safety changes

* op-node: add more comments, fix flag description

* op-e2e: fix rebase, add missing argument

* cannon: Support binary serialisation for snapshots (#11718)

* cannon: Add serialize utils for binary formats and automatic binary/json detection.

* cannon: Support reading and writing states as binary or JSON

* cannon: Generate mt prestate as gzipped binary.

Use different versions for singlethreaded and multithreaded states.

* cannon: Improve comments for serialization

* cannon: Review feedback

* cannon: Introduce reader and writer helpers to simplify code.

* op-node: sanity-check the forkchoice updates (#11780)

* Use local logger in data source (#11756)

There may be other places where a global logger is used, but this instance is particularly important because one message warns the user of a misconfiguration that otherwise manifests in a seemingly unrelated bug (rollbacks on unsafe block consolidation).

* fix: small typo fixes to DeploySuperchain.s.sol. (#11758)

* fix: small typo fixes to DeploySuperchain.s.sol.

* fix: semgrep Javadoc-style comments are not allowed.

* style: remove extra space

---------

Co-authored-by: Matt Solomon <[email protected]>

* cannon: Port audit fixes (#11697)

* cannon: Require boolean exited field to be encoded as 0 or 1

* cannon: Port mmap solidity tests for MTCannon

* cannon: Port srav solidity tests

* cannon: Run semver-lock, snapshot tasks

* cannon: Cut extra validation on thread.exited

* cannon: Run semver lock

* cannon: Update IMIPS2 interface

* ci: pull cached artifacts for contracts tests (#11771)

Contracts tests don't need to recompile if we can just use the
artifacts instead.

* test: more blueprint tests (#11782)

* test: more blueprint tests

* address PR feedback

* op-chain-ops: prep / utils for interop genesis work (#11790)

* Add Maintenance Trigger for Cascading Updates (#11619)

* Update and cleanup CODEOWNERS with expert teams (#11786)

* Catch 'header not found' string in L2BlockRefByLabel (#11759)

* ci: speed up CI by up to 50% (#11794)

Introduces a number of improvements to CI that significantly
reduce overal CI time by up to 50% of the previous time.

* dependabot(gomod): bump github.com/prometheus/client_golang (#11764)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.2 to 1.20.3.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.20.3/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.2...v1.20.3)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(challenger): `asterisc-kona` trace type (#11789)

* dependabot(gomod): bump golang.org/x/crypto from 0.26.0 to 0.27.0 (#11765)

* dependabot(gomod): bump golang.org/x/crypto from 0.26.0 to 0.27.0

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.26.0 to 0.27.0.
- [Commits](https://github.com/golang/crypto/compare/v0.26.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* deps: update

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mark Tyneway <[email protected]>

* Add Admin RPC for Adding New Chain Monitors (#11792)

* Add Admin RPC for Adding New Chain Monitors

* Update op-supervisor/supervisor/backend/db/db.go

---------

Co-authored-by: protolambda <[email protected]>

* semgrep: try to fix CI timeout (#11798)

* maint: move existing interfaces to folders (#11749)

Moves any existing interfaces that are not already inside of
their corresponding /interfaces folders into those folders.

* op-challenger: Support binary and JSON snapshots (#11754)

* op-challenger: Support loading json or binary cannon states.

* op-challenger: Use binary cannon snapshots

* op-challenger: Support downloading prestates in multiple formats.

* op-challenger: Verify newly downloaded snapshots.

* op-e2e: Update test to handle binary snapshots correctly.

* op-e2e: Remove unused parameter

* op-challenger: Add more varied data to the test cannon state.

* op-challenger: Add more varied data to the test cannon state.

* Remove hardcoded entrypoint (#11801)

Removes the `ENTRYPOINT` directive in the `contracts-bedrock` image. While convenient, using `ENTRYPOINT` makes building tooling on top of the image much harder since the entrypoint cannot be overridden without providing special flags to Docker. It is easier to use a dummy `CMD` instead that directs users to call specific tools when running the container. Functionally, this means users will run `docker run just <cmd>` instead of `docker run <cmd>` if they want to use the Justfile.

* Allow cheatcodes on DeploySuperchain.s.sol (#11802)

We need to add these calls otherwise calling `DeploySuperchain.s.sol` as a script with input/output files fails.

* op-program: Add recent op-program versions to reproducibility check (#11560)

* op-program: Add recent op-program versions to reproducibility check

* Add 1.3.1-rc.2

* ci: update contracts tests to split by file (#11797)

Contracts tests were being split by test name which meant that
Circle CI wouldn't be able to (eventually) be able to properly
split these files by timings. Updates the CI job to split by
file instead.

* fix `ReadPreimage` (#11805)

* avoid out of bound for TrackingPreimageOracleReader.ReadPreimage

* use p.GetPreimage

* op-program: Add a script to build cannon prestates for all tagged op-program releases. (#11559)

* op-dispute-mon: Identify unclaimed credits based on the withdrawal request timestamp (#11488)

* cannon: Fix path used when verifying a downloaded state (#11813)

* op-service: Make target destination when writing JSON/binary explicit (#11800)

Avoids being surprised by the special handling for - and empty string output paths.

* maint: add interface for L2OutputOracle (#11817)

First in a series of PRs adding interfaces for L2 contracts. Since
each of these changes involves touching a lot of other contracts
it seemed easier to split this up into several PRs for legibility.

* cannon: Autodetect VM type from state (#11803)

* cannon: Autodetect VM type from state in run command

* cannon: Autodetect VM type from state in witness command

* cannon: Remove vm type flag from run and witness

* cannon: Only peek the version byte

* cannon: Move all version handling to VersionedState, simplify a lot and forbid serializing multithreaded states to JSON

* cannon: Rename method

* op-challenger: Update cannon state parsing to use version detecting methods

* cannon: Move CreateVM to FPVMState for simplicity

Test read/write/create for VersionedState

* cannon: Readd detect_test

* cannon: Remove json names from multithreaded.State.

Multithreaded states always use binary serialization.

* cannon: Move vmtype to load_elf since it is no longer shared.

* cannon: Ensure metadata is available and sleepCheck used even if debug is disabled.

* op-challenger: Update canon state loading test to cover multiple state versions.

* op-challenger: Release agent resources once game is complete (#11820)

* Fix race condition in sequencer stopping logic (#11769)

* Fix race condition in sequencer stopping logic

* Add channel to signal that latestHead has been updated

* Fix test

* Store latest sealed separately, as latest gets cleared by engine.PayloadSuccessEvent

* Cleanup tests

* Add assertions on latest block ref variables

* Re-check if sequencer is active

* feat: Add nested directory data format for op-program kvstore (#11795)

* feat: Add nested directory data format for op-program kvstore

* Review feedback: Update error message

Co-authored-by: Adrian Sutton <[email protected]>

* op-program: Make directory preimage format the default.

---------

Co-authored-by: Adrian Sutton <[email protected]>
Co-authored-by: Adrian Sutton <[email protected]>

* Revert "op-program: Make directory preimage format the default." (#11823)

* Add broadcast API to Go forge scripts (#11826)

* Add broadcast API to Go forge scripts

Adds a hooks-based API to collect transactions broadcasted via `vm.broadcast(*)` in the Go-based Forge scripts. Users pass an `OnBroadcast` hook to the host, which will be called with a `Broadcast` struct with the following fields whenever a transaction needs to be emitted:

```go
type Broadcast struct {
	From     common.Address
	To       common.Address
	Calldata []byte
	Value    *big.Int
}
```

This API lets us layer on custom transaction management in the future which will be helpful for `op-deployer`.

As part of this PR, I changed the internal `callStack` data structure to contain pointers to `CallFrame`s rather than passing by value. I discovered a bug where the pranked sender was not being cleared in subsequent calls due to an ineffectual assignment error. I took a look at the implementation and there are many places where assignments to call frames within the stack happen after converting the value to a reference, so converting the stack to store pointers in the first place both simplified the code and eliminated a class of errors in the future. I updated the public API methods to return copies of the internal structs to prevent accidental mutation.

* Code review updates

* moar review updates

* fix bug with staticcall

* fix(op-batcher): initAltDA before initChannelConfig (#11816)

* fix(op-batcher): initAltDA before initChannelConfig

* chore(op-bastcher): fix comment

* op-node: read DACommitmentType from scr in LoadOPStackRollupConfig (#11830)

* op-node: read DACommitmentType from scr in LoadOPStackRollupConfig

* op-node: check for altda nil pointers before dereferencing

* op-node: leave altDA config nil if not existent in scr config

* OPSM: Begin implementing OP Stack Manager code and it's deployment (#11623)

* begin supporting specifying versions in OPSM

* add deploy logic

* deploy OPSM along with implementations

* scaffold opsm interface between scripts

* fixes

* mvp of DeployOPChain

* start working on an e2e opsm test, currently reverts

* fix tests

* test cleanup

* rename opsmSingleton to opsm

* chore: remove unused imports

* refactor: switch from 'new' to blueprints, 50% code size reduction

* fix semgrep

* feat: add OPSM interop tests

* test: add missing specs

* add DisputeGameFactory deployment

* chore: update snapshots

* fix opsm interop support

* chore: update snapshots

* Update packages/contracts-bedrock/test/DeployOPChain.t.sol

* fix: add L1StandardBridge setter and initialization

* chore: small clarification of deploy flow

* Update packages/contracts-bedrock/scripts/DeployImplementations.s.sol

Co-authored-by: Blaine Malone <[email protected]>

* chore: add todos

* fix: change bytes32 to string

* rename addrs to opChainAddrs for clarity

* test: fix assertion string numbering

* chore: update semver lock:

---------

Co-authored-by: Blaine Malone <[email protected]>

* op-chain-ops: fix Go forge script broadcast handling (#11832)

* fix: OptimismPortal fuzz flakes (#11818)

OptimismPortal fuzz tests were flaking because the base fee would
increase so much that there wouldn't be enough gas to burn for the
user to be able to buy the gas that they want. Introduces an
additional assumption that will prevent the elasticity multiplier
and max change denominator from being such that the maximum
change to the base fee won't cause us to run out of gas.

* cannon: Fix jalr stack tracking (#11831)

* ci: make semgrep-scan use a large docker image (#11834)

semgrep-scan kept failing with a medium docker image with 4g RAM.
Updating this image to large seems to fix the issue.

* maint: clarify interface fixes are manual (#11835)

* feat: ban deposits interop (#11712)

* interop: disable interop messages in force-deposits

Co-authored-by: Disco <[email protected]>

* interop: clean up config helpers

* op-node: fix/improve L1 info tx tests

* op-node: fix attributes test

* op-node: fix sequence-number usage in post-interop system deposit, fix tests

* op-contracts: L1Block interop: fix diff, remove duplicate test from renaming

* contracts: update metadata

* contracts: fix build warnings

* contracts: fix interface build

* script: ignore

* lint: fix

* test: .testdata directory

* tests: fix revert

---------

Co-authored-by: Disco <[email protected]>
Co-authored-by: protolambda <[email protected]>
Co-authored-by: Mark Tyneway <[email protected]>

* Improvements/bugfixes to Go forge scripts (#11838)

* Improvements/bugfixes to Go forge scripts

Adds some improvements to the Go forge scripts:

- Adds a `GasUsed` field to the `Broadcast` struct so that transaction broadcast utilities can use it for gas estimation. Gas estimation using the RPC will fail when sending transactions in parallel since the state can change significantly between calls.
- Fixes a bug in the `vm.broadcast` cheatcode where sender nonce were not increased for `vm.CALL`s. This led to a mismatch between the contract addresses generated by the Forge tooling, and what was actually being generated onchain.

* op-chain-ops: isolate broadcast functionality

* review updates

* wrap in broadcast check

* Add nonce tests

* Update op-chain-ops/script/script.go

Co-authored-by: protolambda <[email protected]>

* Fix test

* op-chain-ops: track broadcast nonce, add sanity checks

---------

Co-authored-by: protolambda <[email protected]>

* OPSM: remove structs from `DeploySuperchain` (#11833)

* refactor: remove structs from DeploySuperchainInput and DeploySuperchainOutput

* test: fix tests

* test: fix test

* chore: remove outdated struct references

* pr feedback

* chore: code comments

* maint: add more L1 interfaces (#11822)

Another PR adding contract interfaces. L1 contract interfaces are
way more involved than everything else so we're required to start
replacing the contracts with interfaces all over the place.

* ci: selectively build contracts (#11824)

Updates the contracts-bedrock-tests job to only build the specific
tests that are being tested as part of the test split for that
job. Also merges the other contracts-bedrock-build with
build-devnet-allocs since this is a bottleneck now. Overall impact
is that CI time is now 7-10 minutes.

* Add entrypoint to deploy against existing Superchain (#11791)

* Add entrypoint to deploy against existing Superchain

Creates a separate entrypoint in the deploy script to allow an L2 to be deployed against an existing set of Superchain contracts. The deployment assumes that the Superchain contracts have been deployed correctly. The L2 still gets its own ProxyAdmin, AddressManager, and Safe. The API is additive and backwards-compatible.

* Update packages/contracts-bedrock/scripts/deploy/Deploy.s.sol

Co-authored-by: Maurelian <[email protected]>

* remove redundant call

---------

Co-authored-by: Maurelian <[email protected]>

* test: fix test and variable naming conventions (#11845)

* feat: concurrent alt-da requests (#11698)

* feat: initial goroutine blob submission implementation

test(batcher): add e2e test for concurrent altda requests

doc: add explanation comment for FakeDAServer

chore: fix if condition in altda sendTransaction path

feat: add maxConcurrentDaRequests config flag + semaphore

refactor: batcher to use errgroup for da instead of separate semaphore/waitgroup

fix: nil pointer bug after using wrong function after rebase

fix: defn of maxConcurrentDaRequests=0

fix: TestBatcherConcurrentAltDARequests

chore: remove unneeded if statement around time.Sleep

refactor: use TryGo instead of Go to make logic local and easier to read

chore: clean up some comments in batcher

chore: make batcher shutdown cancel pending altda requests by using shutdownCtx instead of killCtx

* chore(batcher): make altda wg wait + log only when useAltDa is true

* refactor: batcher altda submission code into its own function

* test: refactor batcher e2e test to only count batcher txs

* chore: log errors from wait functions

* chore: refactor and minimize time that e2e batcher system tests can run

* chore: lower timeout duration in test

* fix(batcher): maxConcurentDARequests was not being initialized

* feat: run extra fuzz rounds for new fuzz tests (#11748)

Adds a new script that can run extra fuzz test iterations when
new fuzz tests are added. Can be used in CI or locally to make
sure that new fuzz tests aren't flaky.

* Release op-contracts/v1.6.0 (#11760)

* op-contracts/v1.6.0-rc.1 release (#11528)

* Fix deploy-config absolute prestate

* chore: update semver-lock

---------

Co-authored-by: smartcontracts <[email protected]>
Co-authored-by: Kelvin Fichter <[email protected]>

* proofs Add a proofs-tools docker image  (#11825)

* op-challenger: Add a "big" op-challenger docker image including asterisc and kona

* proofs-tools: Rename op-challenger-deps to proofs-tools and use tagged asterisc and kona sources.

* proofs-tools: Use more recent version of challenger for testing

* proofs-tools: Remove TODO

* proofs-tools: Only build for amd64 - kona doesn't support arm64.

* proofs-tools: Add README

* proofs-tools: Use challenger v1.1.0

* maint: add remaining L1 contract interfaces (#11848)

Adds interfaces for all remaining L1 contracts. L2 contracts are
next!

* feat: Run `op-program` in `op-e2e` action tests (#11846)

* feat: Run `op-program` in `op-e2e` action tests

* configurable forks

* golint / op-program test

* use correct endpoint

* fix: add IBeacon to interface check ignore (#11860)

IBeacon should've thrown an error but didn't, need to investigate
why that was the case. For now I've added it to the ignore list.

* proofs-tools: Fix circleci config to run hold job on proofs-tools release tags (#11856)

* maint: add comment to OptimismPortal2 proof submitters mapping (#11853)

Adds a comment to OptimismPortal2 that further explains the
proofSubmitters mapping.

* fix: add extra context to check interfaces script logs (#11861)

Updates the output of the check-interfaces script to be more clear
about cases when removing items from the EXCLUDE_CONTRACTS list is
acceptable and how to verify that an item is unnecessary.

* feat: Helper for dumping `fp-tests` fixtures in `op-program` action tests (#11855)

* feat: Helper for dumping `fp-tests` fixtures in `op-program` action tests

* adrian review

* proofs-tools: Update ci-docker-tag-op-stack-release.sh regex (#11862)

* chore: export process frames (#11864)

* chore: Cleanup proofs actions (#11858)

* chore: Cleanup proofs actions

* tidy

* lint

* adrian review

* move `RunFaultProofProgram` onto the `L2FaultProofEnv` type

* proofs-tools: Include openssl and certs (#11865)

* cannon: Fix GC emulation of Go programs (#11704)

* cannon: Fix GC emulation of Go programs

Improves Linux/MIPS32 emulation for Go programs that utilize the garbage
collector and goroutine scheduling.

This adds support for the following syscalls:

- getpid - used by the go scheduler
- clock_gettime - used by the go scheduler and for GC assists and to properly emulate
  time related operations such as `time.Sleep`.

Note on GC assists:

The Go GC relies on `clock_gettime` for GC "assists", whereby a mutator can perform a little bit
of GC without waiting for the scheduler to do so.
A monotonic clock (runtime.nanotime) is used to compute the current goroutine's compute budget.
By modeling a MIPS32 CPU that runs at some clock speed (ex: 10 MHz), we can provide a consistent
emulation of monotonic time needed by the Go runtime.
All other clock_gettime flags are handled as unimplemented syscalls.

* fix unsupported syscalls test

* fix some review comments

* address review comments

* update snapshots

* fuzz invalid memory proof

* reduce test runtime

* tweak realtime emulation

* reduce test runtime

* set a high timeout for heavy fuzz tests

* simplify fuzz

* fix heavy tests

* Fix the error usage in cannon (#11368)

* chore(op-program): Turn off `fsync` on pebble KV store (#11863)

* chore: Cleanup proofs actions

* tidy

* lint

* adrian review

* move `RunFaultProofProgram` onto the `L2FaultProofEnv` type

* chore(op-program): Turn off `fsync` on pebble KV store

* Add SendAsync to TxMgr (#11843)

* Add SendAsync to TxMgr

Adds a SendAsync method to TxMgr. I'd like to use this for `op-deployer`, which needs to send multiple transactions in parallel but with predictable nonces. `SendAsync` returns a channel that resolves with the result of each send, but synchronously increases the nonce and prepares the first send prior to returning.

* review updates + tests

* feat: introduce OptimismSuperchainERC20Factory (#11617)

* test: add L2 standard bridge interop unit tests (#13)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: unit tests fixes

* fix: super to legacy tests failing

* fix: mock and expect mint and burn

* fix: add generic factory interface (#14)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: add generic factory interface

* feat: modify OptimismMintableERC20Factory for convert (#17)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: add generic factory interface

* feat: modify OptimismMintableERC20Factory for convert

* fix: use only a public function for create3

* feat: rollback interop factory, modify legacy one

* fix: delete local token return variable

* fix: PR fixes

* feat: add superchain erc20 factory implementation (#23)

* feat: add superchain erc20 factory implementation

* fix: remove createX comments

* test: add superchain erc20 factory tests (#25)

* test: add superchain erc20 factory tests

* test: add erc20 asserts

* test: fix expect emit

* fix: remove comments

* feat: add constructor to superchain ERC20 beacon (#34)

* test: remove factory predeploy etch

----------

Co-authored-by: 0xng <[email protected]>
Co-authored-by: 0xParticle <[email protected]>
Co-authored-by: gotzenx <[email protected]>

* fix: set an arbitrary address for superchain erc20 impl

* fix: deploy a proxy for the beacon on genesis (#45)


---------

Co-authored-by: 0xng <[email protected]>

* fix: conflicts and imports

* fix: interfaces

* chore: add .testdata

* fix: adding back .testdata to gitignore

* fix: new conflicts from ci improvements

---------

Co-authored-by: 0xng <[email protected]>
Co-authored-by: 0xParticle <[email protected]>
Co-authored-by: gotzenx <[email protected]>
Co-authored-by: Disco <[email protected]>

* fix: do not delete test data directory (#11869)

Our "just clean" command was deleting the entirety of .testdata
which gets in several scripts now. We don't actually want to
delete the entirety of .testdata, we want to delete anything
inside of it (except for the gitkeep file).

* codeowners: move go-reviewers team at the end (#11877)

* txmgr: improve code sharing between Send and SendAsync (#11876)

* Revert "txmgr: improve code sharing between Send and SendAsync (#11876)" (#11883)

This reverts commit 87af6f0d033996b0cad2437f75fe8bc626a2b5d5.

* Add op-deployer proof-of-concept (#11804)

This PR adds a proof-of-concept for `op-deployer`, a CLI tool that allows declarative management of live OP Stack chains. This POC supports initializing the declarative chain config (called an "intent") and deploying the Superchain smart contracts using the OP Stack Manager.

An example intent for a Sepolia chain looks like this:

```toml
l1ChainID = 11155111
useFaultProofs = true
useAltDA = false
fundDevAccounts = true
contractArtifactsURL = "file:///Users/matthewslipper/dev/optimism/packages/contracts-bedrock/forge-artifacts"

[superchainRoles]
  proxyAdminOwner = "0xb9cdf788704088a4c0191d045c151fcbe2db14a4"
  protocolVersionsOwner = "0xb910764be39c84d572ff17713c615b5bfd7df650"
  guardian = "0x8c7e4a51acb17719d225bd17598b8a94b46c8767"
```

When deployed, it produces a state file that looks like this:

```json
{
  "version": 1,
  "appliedIntent": {
    "l1ChainID": 11155111,
    "superchainRoles": {
      "proxyAdminOwner": "0xb9cdf788704088a4c0191d045c151fcbe2db14a4",
      "protocolVersionsOwner": "0xb910764be39c84d572ff17713c615b5bfd7df650",
      "guardian": "0x8c7e4a51acb17719d225bd17598b8a94b46c8767"
    },
    "useFaultProofs": true,
    "useAltDA": false,
    "fundDevAccounts": true,
    "contractArtifactsURL": "file:///Users/matthewslipper/dev/optimism/packages/contracts-bedrock/forge-artifacts",
    "chains": null
  },
  "superchainDeployment": {
    "proxyAdminAddress": "0x54a6088c04a7782e69b5031579a1973a9e3c1a8c",
    "superchainConfigProxyAddress": "0xc969afc4799a9350f9f05b60748bc62f2829b03a",
    "superchainConfigImplAddress": "0x08426b74350e7cba5b52be4909c542d28b6b3962",
    "protocolVersionsProxyAddress": "0x212a023892803c7570eb317c77672c8391bf3dde",
    "protocolVersionsImplAddress": "0x2633ac74edb7ae1f1b5656e042285015f9ee477d"
  }
}
```

To use `op-deployer`, run `op-deployer init --dev --l1-chain-id <chain-id>`. This will initialize a deployment intent using the development keys in the repo. Then, run `op-deployer apply --l1-rpc-url <l1-rpc> --private-key <deployer-private-key>` to apply the deployment.

- The contracts deployment is performed by the local Go/Forge tooling.
- Upgrades of the contracts (i.e. modifying them after deploying the contracts afresh) is not currently supported. This will be supported in the future.
- The rest of the pipeline (i.e., deploying L2s and generating genesis files) is not included in this PR to keep it smaller and allow us to get buy-in on the fundamental concepts behind `op-deployer` before further implementation.

* fix(ci): skip files without modified functions (#11891)

Updates test-heavy-fuzz-modified-tests to skip any files that
don't have any modified fuzz tests.

* fix(ci): tweak heavy fuzz run parameters (#11894)

Tweaks various parameters for the heavy fuzz run tests to prevent
the test from taking too long. We can run a daily super heavy fuzz
run instead to catch any rare flakes.

* discard candidate when ahead (#11874)

* discard candidate when ahead

* also discard result.Unsafe for consistency

* remove unnecessary type convertion for FakeGenesis

* Revert "also discard result.Unsafe for consistency"

This reverts commit d2288d4a01bb4176fd1a3c6e1901646c7bb404c7.

* remove type cast

* codeowners: own op-e2e/actions/proofs by proofs team (#11895)

* maint: add interfaces for governance contracts (#11878)

Adds interfaces for the two governance contracts.

* maint: rename Safe folder to safe (#11882)

Renames the Safe folder (uppercase) to safe (lowercase) in line
with all other folders.

* opsm: remove remaining structs (#11854)

* refactor: remove structs from DeployImplementations

* refactor: remove structs from DeployOPChain

* test: fix tests

* Update packages/contracts-bedrock/test/DeployOPChain.t.sol

Co-authored-by: Blaine Malone <[email protected]>

* Update packages/contracts-bedrock/test/DeployOPChain.t.sol

Co-authored-by: Blaine Malone <[email protected]>

* test: add missing assertions

* fix: update fuzz test timeout

---------

Co-authored-by: Blaine Malone <[email protected]>
Co-authored-by: Kelvin Fichter <[email protected]>

* feat: Add channel timeout tests for `op-program` (#11885)

* feat: Add channel timeout tests for `op-program`

* typo

* assert error

* fix comment

* feat: Add garbage frame tests for `op-program` (#11896)

* feat: Add channel timeout tests for `op-program`

* typo

* assert error

* fix comment

* feat: Add garbage frame tests for `op-program`

* assert error

* fix comment

* feat: mintable with permit (#11868)

* contracts-bedrock: add permit functionality to mintable erc20

Adds `permit` functionality to `OptimismMintableERC20` tokens
that are deployed by the `OptimismMintableERC20Factory`.

* feat: max approve permit2 in ERC20Mintable

This commit max approves permit2 automatically for all holders of the
ERC20 bridge token. This enables all users on OP stack chains to skip an
approval step for actions on protocols utilizing permit2 e.g. Uniswap

* fix: constants first

* semver-lock: update

* snapshots: fix

* contracts: add natspec

* semver-lock: update

* contracts-bedrock: fix nits

* snapshots: update

---------

Co-authored-by: Mark Toda <[email protected]>

* add sequence window expiry test (#11897)

* fix: incorrect import in ManageDrippie.s.sol (#11898)

Fixes an incorrect import inside of ManageDrippie.s.sol. Seems to
work just fine when forge install is executed but not otherwise.

* op-e2e: Setup mt-cannon for tests (#11881)

* op-e2e: Use mt-cannon

Introduces a `USE_MT_CANNON` env to optionally enables MT-Cannon in
op-e2e integration tests

* a couple of fixes

* fix todo

* op-program: Inject prefetcher instead of setting code in config (#11902)

* op-program: Support injecting a Prefetcher creator rather than setting code on the Config object.

* op-program: Use an interface for the Prefetcher instead of requiring a concrete type.

* feat: `op-program` actor test API improvements (#11903)

* feat: `op-program` actor test API improvements

* lint

* sort fix

* rebase

* op-program: Record the kv format used. (#11900)

Automatically use the correct format if it has been recorded.

Change the default format to directory. Compatibility with op-challenger is preserved because it now uses the automatic format detection, defaulting to file if not specified (e.g for kona-host).

* feat: Scaffolding for DeployAuthSystemInput (#11889)

* feat: Scaffolding for DeployAuthSystemInput

* fix: Remove undefined import

* feat: Address feedback

* interop: interopgen v2 using OPSM (#11702)

* op-chain-ops/interopgen: OPSM powered interop genesis

* ci: make forge scripts available to op-e2e

* op-chain-ops: address interopgen review comments

* cannon: Handle preimage bounds checks consistently (#11911)

* cannon: Handle preimage bounds checks consistently

* cannon: Cleanup stray comment

* feat: Scaffolding for DeployAuthSystemInput (#11890)

* feat: Scaffolding for DeployAuthSystemInput

* feat: Scaffolding for DeployAuthSystem Output

* feat: Address feedback and remove comments

* Interop: SuperSystem for E2E Tests (#11850)

* op-e2e: interop test setup (work in progress)

* op-e2e: interop test setup

* organization and comment updates

* refactor creation code into WIP system2

* save secrets per L2

* Add SuperSystem Interface ; Add Users and Transactions

* Further Refactoring ; Fix Test

* Add Supervisor

* Add Supervisor Client

* Comment out Proposer

* Add AddL2RPC to Supervisor Client

* Fully link Supervisor and OP Node in E2E Test

* correct RPC call supervisor_checkBlock

* Make EOF acceptable for backend check

* final structure names

* Change unused functions to _ for linter

* fix import order

* Add Github Issue Numbers to TODOs

* tynes comments: add World Resource as configurable

---------

Co-authored-by: protolambda <[email protected]>

* feat: Front OPSM with Proxy and Initialize (#11875)

* fix: getting stack underflow error.

* feat: adding proxy infront of OPStackManager.

* fix: PR comments, we're landing on using the initialize function over setRelease.

* fix: rename function.

* fix: nit

* fix: infering proxy admin from superchain config.

* fix: ran command: just pre-pr-no-build

* fix: nits

* fix: using CommonBase in DeployImplementations.s.sol.

* op-chain-ops: pass superchain proxy admin address as input to deployments script

---------

Co-authored-by: Matt Solomon <[email protected]>
Co-authored-by: protolambda <[email protected]>

* fix: Additional DeployImplementations.s.sol tests (#11914)

* fix: Additional testing for inferring proxy admin from superchain config.

* Apply suggestions from code review

---------

Co-authored-by: Matt Solomon <[email protected]>

* Use the deterministic deployer when broadcasting with CREATE2 (#11915)

* op-e2e: Separate helpers for proofs action tests into a new package (#11920)

* op-e2e: Move action test helpers for proofs to a separate package.

* op-e2e: Use helpers package under proofs rather than a completely separate package tree for helpers.

* cannon: Implement thread-safe ll and sc operations (#11906)

* cannon: Extract RMW op handling from shared logic

* cannon: Add more test cases of LL/SC behavior

* cannon: Cut ll/sc-related logic from common mips code

* cannon: Setup mips helpers to return memory modification info

* cannon: Add new fields to track reserved memory

* cannon: Add a boolean field indicating whether an ll reservation is active

* cannon: Implement ll/sc for MTCannon

* cannon: Add modified sysRead tests for MTCannon

* cannon: Test store operations cleare memory reservations

* cannon: Update SysClockGettime to clear ll memory reservation

* cannon: Fix slither warning - initialize variable

* cannon: Bump MIP2.sol version

* cannon: Run semver, snapshot tasks

* cannon: Cut unused log msg

* cannon: Add new error to MIPS interfaces

* cannon: Cut stale TODO

* Add integration test for apply (#11910)

* Add integration test for apply

Adds an integration test for OP Deployer's `apply` method. This test uses Kurtosis to spin up an in-memory L1, deploy the contracts using OP Deployer, then asserts that there is code at all reported addresses.

* Review updates

* circleci: Enable mt-cannon in develop-fault-proofs (#11928)

* feat: add SuperchainERC20 baseline (#11675)

* feat: add superchain erc20 baseline (#37)

* feat: add superchain erc20 baseline

* feat: make superchain ERC20 simpler

* fix: small version fix and tests

* test: fix test name

* test: remove unused import

* feat: making baseline abstract

* fix: interfaces to comply with the new interface checker

* fix: import paths and empty line

* fix: lint line

---------

Co-authored-by: 0xng <[email protected]>
Co-authored-by: 0xng <[email protected]>

* feat(op-service): add SuperchainWETH and ETHLiquidity to predeploys/addresses.go (#11927)

* Port deployers, add end-to-end contract deployments (#11922)

This PR ports over the deployers in `interopgen` into `op-deployer`, and updates `op-deployer` to support end-to end contract deployments for both the Superchain and individual OP Chains.

This PR includes a couple of bugfixes for things I discovered along the way:

1. The script host is updated to bump the nonce of the address calling the CREATE2 deployer when broadcasting. This fixes a chain/simulation mismatch that blocked contracts from being deployed.
2. The DeployImplementations contract used a fixed CREATE2 salt, which caused problems on repeated deployments. I updated the contract to pull the nonce from the environment as we do elsewhere.

Builds on https://github.com/ethereum-optimism/optimism/pull/11910.

* cannon: Handle unaligned futex addresses (#11929)

* cannon: Update tests for futex unaligned memory behavior

* cannon: Align futex-related addresses when they are set

* cannon: Run lint and semver tasks

* cannon: Add wakeup traversal tests with unaligend addresses

* cannon: Don't panic if ThreadState.FutexAddr is unaligned

* cannon: Run semver lock task

* cannon: Cleanup stray whitespace

* Add Logging ; Fix Broken Maintenance Context (#11931)

* Add Logging ; Fix Broken Maintenance Context

* Remove unneeded timing ; use Testlogger

* feat(op-e2e): Expose `L1Replica` + `L2Engine` + `BlobsStore` endpoints (#11926)

* feat(op-e2e): Expose `L1Replica` + `L2Engine` + `BlobsStore` endpoints

* mutex

* deterministic blob indexing

* proto review

* lint

* op-node: handle crit error events, lift event-system out of driver (#11932)

* op-e2e: Fix compile error (#11933)

* op-e2e: Fix compile error

* ci: Make go-lint a dependency of bedrock-go-tests to prevent merging if it fails.

* op-e2e: Separate actions tests into different packages (#11921)

* op-e2e: Move most action tests into a package based on what they test

* op-e2e: Move batch_queue_test.go to derivation package

* op-e2e: Move eip4844_test.go to batcher package

* op-e2e: Move actions helper code to helpers package

* update makefile

* op-e2e: Fix typo

---------

Co-authored-by: clabby <[email protected]>

* feat(op-e2e): Kona FPP actions test adapter (#11936)

* feat(op-e2e): Kona FPP actions test adapter

* rebase

* lint

* review

* fix result check

* op-e2e: Organize e2e system tests in subdirs (#11939)

* op-e2e: organize system tests

* op-e2e: update CI make targets

* op-e2e: fix artifacts file paths

* op-e2e: Fix paths.

* op-e2e: Fix paths again

---------

Co-authored-by: Adrian Sutton <[email protected]>

* OPSM: miscellaneous fixes and improvements (#11935)

* chore: fix comment

* feat: add assertions

* fix: use method instead of new

* refactor: make salt into an input

* refactor: unify checkOutput function signatures

* chore: update snapshots

* test: fix testContractAuth

* test: fix checkOutput signatures

* fix: update go DeployImplementationsInput struct with salt

* pr feedback

* chore: semver lock

* Disable go patches for cannon MT (#11937)

* Disable go patches for cannon MT.

Fix the prestate file list for devnet to use the binary cannon MT prestates.

* Update Makefile

---------

Co-authored-by: Inphi <[email protected]>

* feat: Scaffolding for DeployAuthSystem Script (#11908)

* feat: Scaffolding for DeployAuthSystem Script

* feat: Remove redundant documentation

* Update DeployAuthSystem.s.sol

* op-batcher: Add String methods to txRef (#11904)

* feat: Rewrite FP contract distinctions as table (#11940)

* feat: Rewrite FP contract distinctions as table

* feat: clarify handling of non-MCP contracts

* feat: Update pending mcp statuses

* op-e2e: fix fuzz cgo build (#11941)

* maint: move WETH contract to correct folders (#11870)

Moves WETH98 over to the universal/ folder where it belongs and
brings DelayedWETH up to the top of the dispute folder since there
is no longer any need for a weth/ subfolder.

* dependabot(gomod): bump github.com/prometheus/client_golang (#11946)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.3 to 1.20.4.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.3...v1.20.4)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add L2 genesis generation support to `op-deployer` (#11938)

Adds support for generating L2 genesis files to `op-deployer. The L2 initialization config is generated by merging in overrides as specified in the intent into a default config with sane values. The outputted genesis file is stored in the stage as a GZIP-compressed, base64-encoded string.

* OPSM: DeployOPChain assertions (#11943)

* chore: add BaseDeployIO for the deploy input and output contracts

* test: add assertions to DeployOPChain

* chore: semver lock

* pr feedback

* feat: remove dgf impl from DeployOpChain and OPSM (#11942)

* fix: Remove `--l2-chain-id` default (#11951)

* feat: Add ASR proxy to OPStackManager (#11952)

* feat: Add ASR proxy to OPStackManager

* feat: Add AnchorStateRegistry blueprint

* ci: run slow Cannon test once per day (#11947)

Updates CI to run the (very) slow Cannon go-lint-and-test suite
once per day instead of running it on merge since it adds at least
5 minutes to CI.

* fix: move IERC20Solady into vendor folder (#11945)

An additional "dependency" folder was added in a recent PR, this
is the same purpose as the "vendor" folder so the interface added
in that PR can simply be moved to the "vendor" folder instead.

* ci: bump semgrep-scan to xlarge (#11948)

We're still having resource issues with a large image. Going to
bump this to xlarge to see if that will fix it.

* test: invariant tests for OptimismSuperchainERC20 (#11776)

* chore: configure medusa with basic supERC20 self-bridging (#19)

- used --foundry-compile-all to ensure the test contract under
  `test/properties` is compiled (otherwise it is not compiled and medusa
  crashes when it can't find it's compiled representation)
- set src,test,script to test/properties/medusa to not waste time
  compiling contracts that are not required for the medusa campaign
- used an atomic bridge, which doesnt allow for testing of several of
  the proposed invariants

fix: delete dead code
test: give the fuzzer a head start
docs: fix properties order
test: document & implement assertions 22, 23  and 24
fix: fixes from self-review
test: guide the fuzzer a little bit less
  previously: initial mint, bound on transfer amount: 146625 calls in 200s
  now: no initial mint, no bound on transfer amount: 176835 calls in 200s
  it doesn't seem to slow the fuzzer down
fix: fixes after lovely feedback by disco
docs: merge both documents and categorized properties by their milestone
fix: fixes from parti's review
fix: feedback from disco
fix: feedback from doc
refactor: separate state transitions from pure properties
docs: update tested properties
refactor: move all assertions into properties contract
fix: move function without assertions back into handler
test: only use assertion mode
fix: improve justfile recipie for medusa

* feat: halmos symbolic tests (#21)

* feat: introduce OptimismSuperchainERC20

* fix: contract fixes

* feat: add snapshots and semver

* test: add supports interface tests

* test: add invariant test

* feat: add parameters to the RelayERC20 event

* fix: typo

* fix: from param description

* fix: event signature and interface pragma

* feat: add initializer

* feat: use unstructured storage and OZ v5

* feat: update superchain erc20 interfaces

* fix: adapt storage to ERC7201

* test: add initializable OZ v5 test

* fix: invariant docs

* fix: ERC165 implementation

* test: improve superc20 invariant (#11)

* fix: gas snapshot

* chore: configure medusa with basic supERC20 self-bridging

- used --foundry-compile-all to ensure the test contract under
  `test/properties` is compiled (otherwise it is not compiled and medusa
  crashes when it can't find it's compiled representation)
- set src,test,script to test/properties/medusa to not waste time
  compiling contracts that are not required for the medusa campaign
- used an atomic bridge, which doesnt allow for testing of several of
  the proposed invariants

* fix: delete dead code

* test: give the fuzzer a head start

* feat: create suite for sybolic tests with halmos

* test: setup and 3 properties with symbolic tests

* chore: remove todo comment

* docs: fix properties order

* test: document & implement assertions 22, 23  and 24

* fix: fixes from self-review

* test: guide the fuzzer a little bit less

previously: initial mint, bound on transfer amount: 146625 calls in 200s
now: no initial mint, no bound on transfer amount: 176835 calls in 200s

it doesn't seem to slow the fuzzer down

* feat: add property for burn

* refactor: remove symbolic address on mint property

* refactor: order the tests based on the property id

* feat: checkpoint

* chore: set xdomain sender on failing test

* chore: enhance mocks

* Revert "Merge branch 'chore/setup-medusa' into feat/halmos-symbolic-tests"

This reverts commit 945d6b6ad265ea5e3790d7ac9c5bf4d6586eb533, reversing
changes made to 5dcb3a89252e9e8fa9b54ba9012e714f7cc96395.

* refactor: remove symbolic addresses to make all of the test work

* chore: remove console logs

* feat: add properties file

* chore: polish

* refactor: enhance test on property 7 using direct try catch (now works)

* fix: review comments

* refactor: add symbolic addresses on test functions

* feat: create halmos toml

* chore: polish test contract and mock

* chore: update property

* refactor: move symbolic folder into properties one

* feat: create advanced tests helper contract

* refactor: enhance tests using symbolic addresses instead of concrete ones

* chore: remove 0 property natspec

* feat: add halmos profile and just script

* chore: rename symbolic folder to halmos

* feat: add halmos commands to justfile

* chore: reorder assertions on one test

* refactor: complete test property seven

* chore: mark properties as completed

* chore: add halmos-cheatcodes dependency

* chore: rename advancedtest->halmosbase

* chore: minimize mocked messenger

* chore: delete empty halmos file

* chore: revert changes to medusa.json

* docs: update changes to PROPERTIES.md from base branch

* test: sendERC20 destination fix

* chore: natspec fixes

---------

Co-authored-by: agusduha <[email protected]>
Co-authored-by: 0xng <[email protected]>
Co-authored-by: teddy <[email protected]>

* test: remaining protocol properties (#26)

* test: cross-user fuzzed bridges + actor setup

* test: fuzz properties 8 and 9

* test: properties 7 and 25

* fix: implement doc's feedback

* test: superc20 tob properties (#27)

* chore: add crytic/properties dependency

* test: extend protocol properties so it also covers ToB erc20 properties

* chore: small linter fixes

* docs: update property list

* test: handlers for remaining superc20 state transitions

* fix: disable ToB properties we are not using and guide the fuzzer a bit more

* fix: disable another ToB property not implemented by solady

* chore: remove zero-initializations

* fix: feedback from disco

* chore: separate fuzz campaign tests in guided vs unguided

* test: dont revert on successful unguided relay

* test: add fuzzed calls to burn and mint

* docs: document the separation of fuzz test functions

* chore: move the properties file to its own directory

* chore: consistently use fuzz_ and property_ + camelcase

* chore: fix typo

* chore: camelcase for handlers as well

* fix: revert change that broke halmos campaign compile :D

* test: fuzz non atomic bridging (#31)

* test: changed mocked messenger ABI for message sending but kept assertions the same

* docs: add new properties 26&27

* test: queue cross-chain messages and test related properties

* test: relay random messages from queue and check associated invariants

* chore: rename bridge->senderc20 method for consistency with relayerc20

* test: not-yet-deployed supertokens can get funds sent to them

* chore: medusa runs forever by default

doable since it also handles SIGINTs gracefully

* chore: document the reason behind relay zero and send zero inconsistencies

* fix: feedback from doc

* fix: walk around possible medusa issue

I'm getting an 'unknown opcode 0x4e' in ProtocolAtomic constructor when
calling the MockL2ToL2CrossDomainMessenger for the first time

* test: unguided handler for sendERC20

* fix: feedback from disco

* chore: remove halmos testsuite

* chore: foundry migration (#40)

* chore: track assertion failures

this is so foundry's invariant contract can check that an assertion
returned false in the handler, while still allowing `fail_on_revert =
false` so we can still take full advantage of medusa's fuzzer & coverage
reports

* fix: explicitly skip duplicate supertoken deployments

* chore: remove duplicated PROPERTIES.md file

* chore: expose data to foundry's external invariant checker

* test: run medusa fuzzing campaign from within foundry

* fix: eagerly check for duplicate deployments

* fix: feedback from doc

* chore: shoehorn medusa campaign into foundry dir structure

* chore: remove PROPERTIES.md file

* chore: delete medusa config

* docs: limited support for subdirectories in test/invariant

* chore: rename contracts to be more sneaky about medusa

* docs: rewrite invariant docs in a way compliant with autogen scripts

* chore: fixes from rebase

* fix: cleanup superc20 invariants (#46)

* chore: revert modifications from medusa campaign

* docs: extra docs on why ForTest contract is required

* doc: add list of all supertoken properties

* chore: run forge fmt

* ci: allow for testfiles to be deleted

* fix: run doc autogen script after rebase

---------

Co-authored-by: Disco <[email protected]>
Co-authored-by: agusduha <[email protected]>
Co-authored-by: 0xng <[email protected]>

* ci: job to check contracts build warnings (#11962)

Adds a new compiler job to check for contract build warnings.
Other existing build jobs don't compile the entire set of contracts
and we do want to be able to check for warnings across the board.

* ci: simplify contract build job inputs (#11965)

Simplifies the inputs to contracts-bedrock-build so that it
takes a single skip_pattern command instead of allowing the user
to specify any build command.

* ci: clean up golang job definitions (#11967)

Cleans up a number of golang job definitions. One PR for now
just so I can see this all work.

* ci: fix config error in cannon tests (#11969)

Fixes a configuration error in the scheduled-cannon-full-tests
job.

* op-node: lazy-dial the supervisor RPC (#11970)

* ci: simplify contracts bedrock tests job (#11966)

Simplifies the contracts-bedrock-tests job so that it takes more
parameters but makes the test command unified. Also replaces the
complex script for checking for modified fuzz tests and simply
heavily fuzzes all tests within any test files that have changed.

* ci: misc cleanups and simplifications (#11968)

Cleanups in a few places, removing unused jobs, etc.

* correct the comment (#11971)

* update op-e2e setup (#11857)

* fix: multiple fuzz flakes (#11981)

Fixes a couple of fuzz flakes that were found when fuzzing
heavily.

* maint: add interfaces for L2 bridge/messaging contracts (#11859)

First PR for adding interfaces for L2 contracts. Adds interfaces
for all of the bridging and message passing contracts.

* chore(op-service): use `errors.New` to replace `fmt.Errorf` with no parameters (#11796)

* fix(ci): semgrep cli breaking change (#11985)

Semgrep CLI tool recently removed the --time option which caused
CI to suddenly break.

* ci: correct perms for tag-service.yml (#11961)

GITHUB_TOKEN no longer gets write access by default so it needs to
be provided with write access explicitly.

* Add inspection commands, fix deployer bugs (#11964)

Adds `op-deployer inspection *` commands to expose the generated genesis and rollup configs via the CLI or Golang libraries. Also fixes a bug in deployment - I accidentally deleted the code that set the deployer nonce, so live chain deployments were reverting.

* refactor: Rename OPSM to OPSMProxy for clarity (#11972)

* chore(rename): Rename opsm to opsmProxy

* fix: Go bindings updated for proxy.

* fix: linting

* fix: pr comment nits.

* feat(op-e2e): Open channel closed after sequence window expiry test (#11993)

* feat(op-e2e): Open channel closed after sequence window expiry test

Adds a test to the proof actions that proves a block at the safe head
after the batcher has opened a channel, allowed the sequence window to
expire, and then attempted to close their open channel after the fact.

* buffer frame

* include extra tx

* feat(op-e2e): Channel timeout late submission test (#11995)

* feat(op-e2e): Channel timeout late submission test

* remove finalization of l1 chain

* ci: separate invariant runs from fuzz runs (#11982)

Using 10k invariant runs would be ridiculously slow.

* ci: Restore ci-builder docker release and remove invalid op-challenger-big-docker-release (#11997)

* maint(ci): clean up release job (#11996)

Cleans up the release job by turning it into a matrix.

* maint(ci): clean up scheduled docker publish (#11999)

Same idea again, cleaning up the scheduled docker publish with the
same technique as the previous PR.

* OPSM: More assertions (#11994)

* refactor: rename var for clarity

* test: add more assertions from ChainAssertions, and some new ones

* chore: ensure unique, clear, consistent revert string IDs

also sorts methods alphabetically for clarity

* fix: var name after rebase

* style: forge fmt

* revert proxyAdmin -> superchainProxyAdmin name change for now

* Update packages/contracts-bedrock/scripts/DeployImplementations.s.sol

Co-authored-by: Maurelian <[email protected]>

* chore: small tweaks from pr feedback

---------

Co-authored-by: Maurelian <[email protected]>

* op-challenger: Support MT-Cannon in run-trace (#11934)

* op-challenger: Support MT-Cannon in run-trace

* ..

* fix multi_test.go

* annotate metrics with mt-cannon

* preserve prestate encoding; use separate dir for mt-cannon

* Update op-challenger/cmd/run_trace.go

Co-authored-by: Adrian Sutton <[email protected]>

---------

Co-authored-by: Adrian Sutton <[email protected]>

* feat: add remaining L2 interfaces (#11984)

One more PR for adding L2 interfaces.

* feat: clean up TODOs and add CI check (#12005)

* maint: clean up TODO tags

Cleans up existing TODO tags, particularly those that referenced
old Linear issues. Updates the todo-checker script to allow
<#issue> as well as <issue>.

* feat(ci): add todo-issues check to main CI

Updates the main CI workflow to run the todo-issues check. For
now this check will ignore any bare TODOs. We can update the
script later to reject bare TODOs.

* contracts: Add more MIPS2 tests (#12003)

* contracts: Add more MIPS2 tests

* remove unused var

* cannon: Clean up fuzz test todos (#12009)

* cannon: Add memory assertions to FuzzStatePreimageRead

* cannon: Rework hint write fuzz test to assert hint expectations

* cannon: Update FuzzStatePreimageWrite to assert on expected preimageKey

* cannon: Remove validation skipping logic from test util

* cannon: Cleanup - simplify code

* cannon: Cleanup - dedupe code

* cannon: Clean up program patching (#11944)

* cannon: Cut todo, reorganize syscalls

* cannon: Rename patchGo to patchGoGC, add comments, cut TODO

* cannon: Only allow gc patching for single-threaded Cannon

* cannon: Cut patch flag from load-elf command altogether

* feat(ci): check contract semver matches natspec (#11992)

Adds a new check to CI that verifies that the semver string
defined in the contract matches the string defined in natspec.

* maint(ct): link to external mermaid diagrams in specs (#12012)

Updates the contracts README to use the mermaid diagrams in specs
to avoid duplicated documentation.

* op-program: Reproducible MT-Cannon prestate (#12011)

* op-program: Reproducible MT-Cannon prestate

* fix mt-cannon proof gen

* cannon: Fix makefile phony target (#12014)

* maint(ci): remove autogenerated invariant docs (#11988)

Removes autogenerated invariant docs from the contracts package.
These autogenerated docs create confusion about where invariants
should be defined (the answer is in the specs) and no one actually
looks at them anyway. Just adds an additional step into CI for
minimal benefit.

* vm-runner: User-prov…
Troublor pushed a commit to megaeth-labs/optimism that referenced this pull request Dec 6, 2024
* feat(op-program): Use `PebbleDB` for `DiskKV` (#11705)

* feat(op-program): Use `PebbleDB` for `DiskKV`

* close db

* fix `testFaultProofProgramScenario` tests

* switch to snappy compression

https://github.com/cockroachdb/pebble/issues/3434

* fix tempdir

* update compat release

* defer k/v until preimage server and hinter have both exited

* Revert "feat(op-program): Use `PebbleDB` for `DiskKV` (#11705)" (#11707)

This reverts commit 8ab4d3d8e20f69464d9f5191c110b63f4d5a3df6.

* op-service/txmgr: multiple fixes / improvements (#11614)

* - make immediate nonce-too-low error abort send (since it could never succeed otherwise)

- make txmgr resubmit a transaction when fee bumping fails in case it has been dropped from the mempool

- only bump fees when they really should be bumped

- set txmgr overall default send timeout of 10 minutes. It was infinite, which led to permanently
  stuck transaction in combination with the other bugs fixed in this PR.

* Update op-service/txmgr/txmgr_test.go

---------

Co-authored-by: Sebastian Stammler <[email protected]>

* chore(op-service): Remove `reth` receipts source (#11706)

* fix: op-challenger move.go cli command wasn't cancellable (#11716)

* feat: add ERC-5202 Blueprint library with initial tests (#11700)

https://eips.ethereum.org/EIPS/eip-5202

* chore: Fix lint error (#11714)

golangci-lint v1.60.2 seems to report a new error when performing a nil check and length != 0 on maps. We're not using this version in CI yet but fix the error to simplify the code and provide for a future upgrade.

* maint: no kontrol summaries in PRs (#11725)

Removes the need for kontrol summaries to be generated at PR time.
Summaries will now be generated during run-kontrol.sh instead.

* feat: check interface differences in CI (#11677)

Adds a new check script to contracts-bedrock that verifies that
interfaces being added to the repository accurately represent
the interface of the contract that the interface was generated
for.

* add comment to SingularBatch.Timestamp (#11720)

* op-program: Use PebbleDB for DiskKV (Reapply with fixes) (#11709)

* feat(op-program): Use `PebbleDB` for `DiskKV` (#11705)

* feat(op-program): Use `PebbleDB` for `DiskKV`

* close db

* fix `testFaultProofProgramScenario` tests

* switch to snappy compression

https://github.com/cockroachdb/pebble/issues/3434

* fix tempdir

* update compat release

* defer k/v until preimage server and hinter have both exited

* Only open preimage source when actually needing preimages.

Avoids concurrent access to the pebbledb.

* op-program: Handle interrupts in host

Ensures the preimage kv store is closed cleanly even when the process is sent an interrupt signal.
Enables non-blocking IO so that read calls return io.EOF when a file handle is closed rather than blocking forever.

* op-program: Restore file based kv store. Add pebble as an additional option.

* op-program: Add option to specify KV store format to use

* op-program: Switch pebble to perform sync writes.

* op-program: Rename disk kv to file kv

* op-program: Rename DBFormat to DataFormat for consistency.

---------

Co-authored-by: clabby <[email protected]>

* fix: SuperchainWETH fuzz flake with bad sender (#11728)

Fixes a number of places where SuperchainWETH fuzz tests can flake
as a result of using a sender address that is the ETHLiquidity or
SuperchainWETH contract.

* Fix copy-paste typo (#11731)

* maint: add interfaces for legacy contracts (#11625)

Adds interfaces for the contracts inside of /legacy. Interface is
not included for the LegacyMintableERC20 contract because that
interface has already been defined elsewhere.

* Slim down contracts-bedrock package (#11723)

* Slim down contracts-bedrock package

The contracts-bedrock package was over 2GB in size, mostly because it contained the Git repository. It also supported multiple platforms, which would lead to costly recompilation steps every time the image was used on a different platform (e.g., OSX).

The PR updates the Dockerfile to no longer ship the Git repo. It also updates the Debian base image to a more modern, slimmed down version. The new image is <1G in size.

* fix bakefile

* fix: properly check all interfaces (#11734)

Interfaces check script had a bug that would cause it to use the
wrong ABI when checking an interface. Each compiler artifact only
has a single ABI in it but this same ABI was being used for all
contract definitions found within that file. Since each separate
contract definition gets its own file anyway, this script now
properly verifies by finding the specific definition that matches
the filename.

* feat: update interface validation script to check semver (#11740)

Updates the interface validation script to verify that all
interface contracts are using Solidity ^0.8.0 exactly.

* challenger: Introduce StateConverter to abstract loading VM states (#11715)

* fix: flake tests (#11742)

* fix: add optimism mintable check on assume address helper

* fix: mock interfaces checks

* chore: remove unused import

---------

Co-authored-by: 0xng <[email protected]>

* repo: bump foundry (#11746)

Bumps foundry to the following commit: https://github.com/foundry-rs/foundry/commit/143abd6a768eeb52a5785240b763d72a56987b4a

Release: https://github.com/foundry-rs/foundry/releases/tag/nightly

This needs to be followed up with a rebuild of `ci-builder`

* Revert "challenger: Introduce StateConverter to abstract loading VM states (#…" (#11747)

This reverts commit 3410109155ae75915ff95dc0a1995ac0d3cac8b5.

* cannon: Run expensive tests in parallel (#11739)

* op-node: sequencer should clear inconsistent asyncGossip buffer on sequencer-start (#11724)

* op-node: sequencer should clear inconsistent asyncGossip buffer on sequencer-start

* op-node: test async-gossip clearing

* Update op-node/rollup/sequencing/sequencer.go

Co-authored-by: Adrian Sutton <[email protected]>

---------

Co-authored-by: Adrian Sutton <[email protected]>

* Reapply "challenger: Introduce StateConverter to abstract loading VM states" (#11752)

With fix to set a state converter when creating trace providers for test.

* contracts-bedrock: Add OPSM file I/O for superchain deployments (#11750)

* contracts-bedrock: Add OPSM file I/O for superchain deployments

* Update packages/contracts-bedrock/scripts/DeploySuperchain.s.sol

Co-authored-by: Matt Solomon <[email protected]>

* Update packages/contracts-bedrock/test/DeploySuperchain.t.sol

Co-authored-by: Matt Solomon <[email protected]>

* Address feedback from code review

* Linter

---------

Co-authored-by: Matt Solomon <[email protected]>

* maint: update solidity vscode extension (#11751)

* op-conductor: adds raft log snapshot configs (#11745)

* Refactors NewRaftConsensus param list into a config struct
* Adds configuration support for SnapshotInterval, SnapshotThreshold, TrailingLogs

* fix: initialization tests (#11674)

Fixes the initialization tests, existing tests were not properly
verifying that all of the initializable contracts were being
accounted for.

* Update VERSIONING.md (#11761)

* Fix contracts-bedrock-docker-publish build (#11755)

The build stage name was accidentally removed, which [broke](https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/63237/workflows/e6a2d738-132f-4e10-9da2-c265b364c771/jobs/2627291) the job.

* op-node: op-node interop block verification (devnet-1 scope) (#11611)

* op-node: experimental interop block verification

* op-node: supervisor RPC init

* op-e2e/actions: test interop safety checks

* op-e2e/op-node: test fixes

* op-node: update comments

* op-node: unit-test interop deriver, trigger cross-safe updates on driver step, to poll for supervisor safety changes

* op-node: add more comments, fix flag description

* op-e2e: fix rebase, add missing argument

* cannon: Support binary serialisation for snapshots (#11718)

* cannon: Add serialize utils for binary formats and automatic binary/json detection.

* cannon: Support reading and writing states as binary or JSON

* cannon: Generate mt prestate as gzipped binary.

Use different versions for singlethreaded and multithreaded states.

* cannon: Improve comments for serialization

* cannon: Review feedback

* cannon: Introduce reader and writer helpers to simplify code.

* op-node: sanity-check the forkchoice updates (#11780)

* Use local logger in data source (#11756)

There may be other places where a global logger is used, but this instance is particularly important because one message warns the user of a misconfiguration that otherwise manifests in a seemingly unrelated bug (rollbacks on unsafe block consolidation).

* fix: small typo fixes to DeploySuperchain.s.sol. (#11758)

* fix: small typo fixes to DeploySuperchain.s.sol.

* fix: semgrep Javadoc-style comments are not allowed.

* style: remove extra space

---------

Co-authored-by: Matt Solomon <[email protected]>

* cannon: Port audit fixes (#11697)

* cannon: Require boolean exited field to be encoded as 0 or 1

* cannon: Port mmap solidity tests for MTCannon

* cannon: Port srav solidity tests

* cannon: Run semver-lock, snapshot tasks

* cannon: Cut extra validation on thread.exited

* cannon: Run semver lock

* cannon: Update IMIPS2 interface

* ci: pull cached artifacts for contracts tests (#11771)

Contracts tests don't need to recompile if we can just use the
artifacts instead.

* test: more blueprint tests (#11782)

* test: more blueprint tests

* address PR feedback

* op-chain-ops: prep / utils for interop genesis work (#11790)

* Add Maintenance Trigger for Cascading Updates (#11619)

* Update and cleanup CODEOWNERS with expert teams (#11786)

* Catch 'header not found' string in L2BlockRefByLabel (#11759)

* ci: speed up CI by up to 50% (#11794)

Introduces a number of improvements to CI that significantly
reduce overal CI time by up to 50% of the previous time.

* dependabot(gomod): bump github.com/prometheus/client_golang (#11764)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.2 to 1.20.3.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.20.3/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.2...v1.20.3)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(challenger): `asterisc-kona` trace type (#11789)

* dependabot(gomod): bump golang.org/x/crypto from 0.26.0 to 0.27.0 (#11765)

* dependabot(gomod): bump golang.org/x/crypto from 0.26.0 to 0.27.0

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.26.0 to 0.27.0.
- [Commits](https://github.com/golang/crypto/compare/v0.26.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* deps: update

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mark Tyneway <[email protected]>

* Add Admin RPC for Adding New Chain Monitors (#11792)

* Add Admin RPC for Adding New Chain Monitors

* Update op-supervisor/supervisor/backend/db/db.go

---------

Co-authored-by: protolambda <[email protected]>

* semgrep: try to fix CI timeout (#11798)

* maint: move existing interfaces to folders (#11749)

Moves any existing interfaces that are not already inside of
their corresponding /interfaces folders into those folders.

* op-challenger: Support binary and JSON snapshots (#11754)

* op-challenger: Support loading json or binary cannon states.

* op-challenger: Use binary cannon snapshots

* op-challenger: Support downloading prestates in multiple formats.

* op-challenger: Verify newly downloaded snapshots.

* op-e2e: Update test to handle binary snapshots correctly.

* op-e2e: Remove unused parameter

* op-challenger: Add more varied data to the test cannon state.

* op-challenger: Add more varied data to the test cannon state.

* Remove hardcoded entrypoint (#11801)

Removes the `ENTRYPOINT` directive in the `contracts-bedrock` image. While convenient, using `ENTRYPOINT` makes building tooling on top of the image much harder since the entrypoint cannot be overridden without providing special flags to Docker. It is easier to use a dummy `CMD` instead that directs users to call specific tools when running the container. Functionally, this means users will run `docker run just <cmd>` instead of `docker run <cmd>` if they want to use the Justfile.

* Allow cheatcodes on DeploySuperchain.s.sol (#11802)

We need to add these calls otherwise calling `DeploySuperchain.s.sol` as a script with input/output files fails.

* op-program: Add recent op-program versions to reproducibility check (#11560)

* op-program: Add recent op-program versions to reproducibility check

* Add 1.3.1-rc.2

* ci: update contracts tests to split by file (#11797)

Contracts tests were being split by test name which meant that
Circle CI wouldn't be able to (eventually) be able to properly
split these files by timings. Updates the CI job to split by
file instead.

* fix `ReadPreimage` (#11805)

* avoid out of bound for TrackingPreimageOracleReader.ReadPreimage

* use p.GetPreimage

* op-program: Add a script to build cannon prestates for all tagged op-program releases. (#11559)

* op-dispute-mon: Identify unclaimed credits based on the withdrawal request timestamp (#11488)

* cannon: Fix path used when verifying a downloaded state (#11813)

* op-service: Make target destination when writing JSON/binary explicit (#11800)

Avoids being surprised by the special handling for - and empty string output paths.

* maint: add interface for L2OutputOracle (#11817)

First in a series of PRs adding interfaces for L2 contracts. Since
each of these changes involves touching a lot of other contracts
it seemed easier to split this up into several PRs for legibility.

* cannon: Autodetect VM type from state (#11803)

* cannon: Autodetect VM type from state in run command

* cannon: Autodetect VM type from state in witness command

* cannon: Remove vm type flag from run and witness

* cannon: Only peek the version byte

* cannon: Move all version handling to VersionedState, simplify a lot and forbid serializing multithreaded states to JSON

* cannon: Rename method

* op-challenger: Update cannon state parsing to use version detecting methods

* cannon: Move CreateVM to FPVMState for simplicity

Test read/write/create for VersionedState

* cannon: Readd detect_test

* cannon: Remove json names from multithreaded.State.

Multithreaded states always use binary serialization.

* cannon: Move vmtype to load_elf since it is no longer shared.

* cannon: Ensure metadata is available and sleepCheck used even if debug is disabled.

* op-challenger: Update canon state loading test to cover multiple state versions.

* op-challenger: Release agent resources once game is complete (#11820)

* Fix race condition in sequencer stopping logic (#11769)

* Fix race condition in sequencer stopping logic

* Add channel to signal that latestHead has been updated

* Fix test

* Store latest sealed separately, as latest gets cleared by engine.PayloadSuccessEvent

* Cleanup tests

* Add assertions on latest block ref variables

* Re-check if sequencer is active

* feat: Add nested directory data format for op-program kvstore (#11795)

* feat: Add nested directory data format for op-program kvstore

* Review feedback: Update error message

Co-authored-by: Adrian Sutton <[email protected]>

* op-program: Make directory preimage format the default.

---------

Co-authored-by: Adrian Sutton <[email protected]>
Co-authored-by: Adrian Sutton <[email protected]>

* Revert "op-program: Make directory preimage format the default." (#11823)

* Add broadcast API to Go forge scripts (#11826)

* Add broadcast API to Go forge scripts

Adds a hooks-based API to collect transactions broadcasted via `vm.broadcast(*)` in the Go-based Forge scripts. Users pass an `OnBroadcast` hook to the host, which will be called with a `Broadcast` struct with the following fields whenever a transaction needs to be emitted:

```go
type Broadcast struct {
	From     common.Address
	To       common.Address
	Calldata []byte
	Value    *big.Int
}
```

This API lets us layer on custom transaction management in the future which will be helpful for `op-deployer`.

As part of this PR, I changed the internal `callStack` data structure to contain pointers to `CallFrame`s rather than passing by value. I discovered a bug where the pranked sender was not being cleared in subsequent calls due to an ineffectual assignment error. I took a look at the implementation and there are many places where assignments to call frames within the stack happen after converting the value to a reference, so converting the stack to store pointers in the first place both simplified the code and eliminated a class of errors in the future. I updated the public API methods to return copies of the internal structs to prevent accidental mutation.

* Code review updates

* moar review updates

* fix bug with staticcall

* fix(op-batcher): initAltDA before initChannelConfig (#11816)

* fix(op-batcher): initAltDA before initChannelConfig

* chore(op-bastcher): fix comment

* op-node: read DACommitmentType from scr in LoadOPStackRollupConfig (#11830)

* op-node: read DACommitmentType from scr in LoadOPStackRollupConfig

* op-node: check for altda nil pointers before dereferencing

* op-node: leave altDA config nil if not existent in scr config

* OPSM: Begin implementing OP Stack Manager code and it's deployment (#11623)

* begin supporting specifying versions in OPSM

* add deploy logic

* deploy OPSM along with implementations

* scaffold opsm interface between scripts

* fixes

* mvp of DeployOPChain

* start working on an e2e opsm test, currently reverts

* fix tests

* test cleanup

* rename opsmSingleton to opsm

* chore: remove unused imports

* refactor: switch from 'new' to blueprints, 50% code size reduction

* fix semgrep

* feat: add OPSM interop tests

* test: add missing specs

* add DisputeGameFactory deployment

* chore: update snapshots

* fix opsm interop support

* chore: update snapshots

* Update packages/contracts-bedrock/test/DeployOPChain.t.sol

* fix: add L1StandardBridge setter and initialization

* chore: small clarification of deploy flow

* Update packages/contracts-bedrock/scripts/DeployImplementations.s.sol

Co-authored-by: Blaine Malone <[email protected]>

* chore: add todos

* fix: change bytes32 to string

* rename addrs to opChainAddrs for clarity

* test: fix assertion string numbering

* chore: update semver lock:

---------

Co-authored-by: Blaine Malone <[email protected]>

* op-chain-ops: fix Go forge script broadcast handling (#11832)

* fix: OptimismPortal fuzz flakes (#11818)

OptimismPortal fuzz tests were flaking because the base fee would
increase so much that there wouldn't be enough gas to burn for the
user to be able to buy the gas that they want. Introduces an
additional assumption that will prevent the elasticity multiplier
and max change denominator from being such that the maximum
change to the base fee won't cause us to run out of gas.

* cannon: Fix jalr stack tracking (#11831)

* ci: make semgrep-scan use a large docker image (#11834)

semgrep-scan kept failing with a medium docker image with 4g RAM.
Updating this image to large seems to fix the issue.

* maint: clarify interface fixes are manual (#11835)

* feat: ban deposits interop (#11712)

* interop: disable interop messages in force-deposits

Co-authored-by: Disco <[email protected]>

* interop: clean up config helpers

* op-node: fix/improve L1 info tx tests

* op-node: fix attributes test

* op-node: fix sequence-number usage in post-interop system deposit, fix tests

* op-contracts: L1Block interop: fix diff, remove duplicate test from renaming

* contracts: update metadata

* contracts: fix build warnings

* contracts: fix interface build

* script: ignore

* lint: fix

* test: .testdata directory

* tests: fix revert

---------

Co-authored-by: Disco <[email protected]>
Co-authored-by: protolambda <[email protected]>
Co-authored-by: Mark Tyneway <[email protected]>

* Improvements/bugfixes to Go forge scripts (#11838)

* Improvements/bugfixes to Go forge scripts

Adds some improvements to the Go forge scripts:

- Adds a `GasUsed` field to the `Broadcast` struct so that transaction broadcast utilities can use it for gas estimation. Gas estimation using the RPC will fail when sending transactions in parallel since the state can change significantly between calls.
- Fixes a bug in the `vm.broadcast` cheatcode where sender nonce were not increased for `vm.CALL`s. This led to a mismatch between the contract addresses generated by the Forge tooling, and what was actually being generated onchain.

* op-chain-ops: isolate broadcast functionality

* review updates

* wrap in broadcast check

* Add nonce tests

* Update op-chain-ops/script/script.go

Co-authored-by: protolambda <[email protected]>

* Fix test

* op-chain-ops: track broadcast nonce, add sanity checks

---------

Co-authored-by: protolambda <[email protected]>

* OPSM: remove structs from `DeploySuperchain` (#11833)

* refactor: remove structs from DeploySuperchainInput and DeploySuperchainOutput

* test: fix tests

* test: fix test

* chore: remove outdated struct references

* pr feedback

* chore: code comments

* maint: add more L1 interfaces (#11822)

Another PR adding contract interfaces. L1 contract interfaces are
way more involved than everything else so we're required to start
replacing the contracts with interfaces all over the place.

* ci: selectively build contracts (#11824)

Updates the contracts-bedrock-tests job to only build the specific
tests that are being tested as part of the test split for that
job. Also merges the other contracts-bedrock-build with
build-devnet-allocs since this is a bottleneck now. Overall impact
is that CI time is now 7-10 minutes.

* Add entrypoint to deploy against existing Superchain (#11791)

* Add entrypoint to deploy against existing Superchain

Creates a separate entrypoint in the deploy script to allow an L2 to be deployed against an existing set of Superchain contracts. The deployment assumes that the Superchain contracts have been deployed correctly. The L2 still gets its own ProxyAdmin, AddressManager, and Safe. The API is additive and backwards-compatible.

* Update packages/contracts-bedrock/scripts/deploy/Deploy.s.sol

Co-authored-by: Maurelian <[email protected]>

* remove redundant call

---------

Co-authored-by: Maurelian <[email protected]>

* test: fix test and variable naming conventions (#11845)

* feat: concurrent alt-da requests (#11698)

* feat: initial goroutine blob submission implementation

test(batcher): add e2e test for concurrent altda requests

doc: add explanation comment for FakeDAServer

chore: fix if condition in altda sendTransaction path

feat: add maxConcurrentDaRequests config flag + semaphore

refactor: batcher to use errgroup for da instead of separate semaphore/waitgroup

fix: nil pointer bug after using wrong function after rebase

fix: defn of maxConcurrentDaRequests=0

fix: TestBatcherConcurrentAltDARequests

chore: remove unneeded if statement around time.Sleep

refactor: use TryGo instead of Go to make logic local and easier to read

chore: clean up some comments in batcher

chore: make batcher shutdown cancel pending altda requests by using shutdownCtx instead of killCtx

* chore(batcher): make altda wg wait + log only when useAltDa is true

* refactor: batcher altda submission code into its own function

* test: refactor batcher e2e test to only count batcher txs

* chore: log errors from wait functions

* chore: refactor and minimize time that e2e batcher system tests can run

* chore: lower timeout duration in test

* fix(batcher): maxConcurentDARequests was not being initialized

* feat: run extra fuzz rounds for new fuzz tests (#11748)

Adds a new script that can run extra fuzz test iterations when
new fuzz tests are added. Can be used in CI or locally to make
sure that new fuzz tests aren't flaky.

* Release op-contracts/v1.6.0 (#11760)

* op-contracts/v1.6.0-rc.1 release (#11528)

* Fix deploy-config absolute prestate

* chore: update semver-lock

---------

Co-authored-by: smartcontracts <[email protected]>
Co-authored-by: Kelvin Fichter <[email protected]>

* proofs Add a proofs-tools docker image  (#11825)

* op-challenger: Add a "big" op-challenger docker image including asterisc and kona

* proofs-tools: Rename op-challenger-deps to proofs-tools and use tagged asterisc and kona sources.

* proofs-tools: Use more recent version of challenger for testing

* proofs-tools: Remove TODO

* proofs-tools: Only build for amd64 - kona doesn't support arm64.

* proofs-tools: Add README

* proofs-tools: Use challenger v1.1.0

* maint: add remaining L1 contract interfaces (#11848)

Adds interfaces for all remaining L1 contracts. L2 contracts are
next!

* feat: Run `op-program` in `op-e2e` action tests (#11846)

* feat: Run `op-program` in `op-e2e` action tests

* configurable forks

* golint / op-program test

* use correct endpoint

* fix: add IBeacon to interface check ignore (#11860)

IBeacon should've thrown an error but didn't, need to investigate
why that was the case. For now I've added it to the ignore list.

* proofs-tools: Fix circleci config to run hold job on proofs-tools release tags (#11856)

* maint: add comment to OptimismPortal2 proof submitters mapping (#11853)

Adds a comment to OptimismPortal2 that further explains the
proofSubmitters mapping.

* fix: add extra context to check interfaces script logs (#11861)

Updates the output of the check-interfaces script to be more clear
about cases when removing items from the EXCLUDE_CONTRACTS list is
acceptable and how to verify that an item is unnecessary.

* feat: Helper for dumping `fp-tests` fixtures in `op-program` action tests (#11855)

* feat: Helper for dumping `fp-tests` fixtures in `op-program` action tests

* adrian review

* proofs-tools: Update ci-docker-tag-op-stack-release.sh regex (#11862)

* chore: export process frames (#11864)

* chore: Cleanup proofs actions (#11858)

* chore: Cleanup proofs actions

* tidy

* lint

* adrian review

* move `RunFaultProofProgram` onto the `L2FaultProofEnv` type

* proofs-tools: Include openssl and certs (#11865)

* cannon: Fix GC emulation of Go programs (#11704)

* cannon: Fix GC emulation of Go programs

Improves Linux/MIPS32 emulation for Go programs that utilize the garbage
collector and goroutine scheduling.

This adds support for the following syscalls:

- getpid - used by the go scheduler
- clock_gettime - used by the go scheduler and for GC assists and to properly emulate
  time related operations such as `time.Sleep`.

Note on GC assists:

The Go GC relies on `clock_gettime` for GC "assists", whereby a mutator can perform a little bit
of GC without waiting for the scheduler to do so.
A monotonic clock (runtime.nanotime) is used to compute the current goroutine's compute budget.
By modeling a MIPS32 CPU that runs at some clock speed (ex: 10 MHz), we can provide a consistent
emulation of monotonic time needed by the Go runtime.
All other clock_gettime flags are handled as unimplemented syscalls.

* fix unsupported syscalls test

* fix some review comments

* address review comments

* update snapshots

* fuzz invalid memory proof

* reduce test runtime

* tweak realtime emulation

* reduce test runtime

* set a high timeout for heavy fuzz tests

* simplify fuzz

* fix heavy tests

* Fix the error usage in cannon (#11368)

* chore(op-program): Turn off `fsync` on pebble KV store (#11863)

* chore: Cleanup proofs actions

* tidy

* lint

* adrian review

* move `RunFaultProofProgram` onto the `L2FaultProofEnv` type

* chore(op-program): Turn off `fsync` on pebble KV store

* Add SendAsync to TxMgr (#11843)

* Add SendAsync to TxMgr

Adds a SendAsync method to TxMgr. I'd like to use this for `op-deployer`, which needs to send multiple transactions in parallel but with predictable nonces. `SendAsync` returns a channel that resolves with the result of each send, but synchronously increases the nonce and prepares the first send prior to returning.

* review updates + tests

* feat: introduce OptimismSuperchainERC20Factory (#11617)

* test: add L2 standard bridge interop unit tests (#13)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: unit tests fixes

* fix: super to legacy tests failing

* fix: mock and expect mint and burn

* fix: add generic factory interface (#14)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: add generic factory interface

* feat: modify OptimismMintableERC20Factory for convert (#17)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: add generic factory interface

* feat: modify OptimismMintableERC20Factory for convert

* fix: use only a public function for create3

* feat: rollback interop factory, modify legacy one

* fix: delete local token return variable

* fix: PR fixes

* feat: add superchain erc20 factory implementation (#23)

* feat: add superchain erc20 factory implementation

* fix: remove createX comments

* test: add superchain erc20 factory tests (#25)

* test: add superchain erc20 factory tests

* test: add erc20 asserts

* test: fix expect emit

* fix: remove comments

* feat: add constructor to superchain ERC20 beacon (#34)

* test: remove factory predeploy etch

----------

Co-authored-by: 0xng <[email protected]>
Co-authored-by: 0xParticle <[email protected]>
Co-authored-by: gotzenx <[email protected]>

* fix: set an arbitrary address for superchain erc20 impl

* fix: deploy a proxy for the beacon on genesis (#45)


---------

Co-authored-by: 0xng <[email protected]>

* fix: conflicts and imports

* fix: interfaces

* chore: add .testdata

* fix: adding back .testdata to gitignore

* fix: new conflicts from ci improvements

---------

Co-authored-by: 0xng <[email protected]>
Co-authored-by: 0xParticle <[email protected]>
Co-authored-by: gotzenx <[email protected]>
Co-authored-by: Disco <[email protected]>

* fix: do not delete test data directory (#11869)

Our "just clean" command was deleting the entirety of .testdata
which gets in several scripts now. We don't actually want to
delete the entirety of .testdata, we want to delete anything
inside of it (except for the gitkeep file).

* codeowners: move go-reviewers team at the end (#11877)

* txmgr: improve code sharing between Send and SendAsync (#11876)

* Revert "txmgr: improve code sharing between Send and SendAsync (#11876)" (#11883)

This reverts commit 87af6f0d033996b0cad2437f75fe8bc626a2b5d5.

* Add op-deployer proof-of-concept (#11804)

This PR adds a proof-of-concept for `op-deployer`, a CLI tool that allows declarative management of live OP Stack chains. This POC supports initializing the declarative chain config (called an "intent") and deploying the Superchain smart contracts using the OP Stack Manager.

An example intent for a Sepolia chain looks like this:

```toml
l1ChainID = 11155111
useFaultProofs = true
useAltDA = false
fundDevAccounts = true
contractArtifactsURL = "file:///Users/matthewslipper/dev/optimism/packages/contracts-bedrock/forge-artifacts"

[superchainRoles]
  proxyAdminOwner = "0xb9cdf788704088a4c0191d045c151fcbe2db14a4"
  protocolVersionsOwner = "0xb910764be39c84d572ff17713c615b5bfd7df650"
  guardian = "0x8c7e4a51acb17719d225bd17598b8a94b46c8767"
```

When deployed, it produces a state file that looks like this:

```json
{
  "version": 1,
  "appliedIntent": {
    "l1ChainID": 11155111,
    "superchainRoles": {
      "proxyAdminOwner": "0xb9cdf788704088a4c0191d045c151fcbe2db14a4",
      "protocolVersionsOwner": "0xb910764be39c84d572ff17713c615b5bfd7df650",
      "guardian": "0x8c7e4a51acb17719d225bd17598b8a94b46c8767"
    },
    "useFaultProofs": true,
    "useAltDA": false,
    "fundDevAccounts": true,
    "contractArtifactsURL": "file:///Users/matthewslipper/dev/optimism/packages/contracts-bedrock/forge-artifacts",
    "chains": null
  },
  "superchainDeployment": {
    "proxyAdminAddress": "0x54a6088c04a7782e69b5031579a1973a9e3c1a8c",
    "superchainConfigProxyAddress": "0xc969afc4799a9350f9f05b60748bc62f2829b03a",
    "superchainConfigImplAddress": "0x08426b74350e7cba5b52be4909c542d28b6b3962",
    "protocolVersionsProxyAddress": "0x212a023892803c7570eb317c77672c8391bf3dde",
    "protocolVersionsImplAddress": "0x2633ac74edb7ae1f1b5656e042285015f9ee477d"
  }
}
```

To use `op-deployer`, run `op-deployer init --dev --l1-chain-id <chain-id>`. This will initialize a deployment intent using the development keys in the repo. Then, run `op-deployer apply --l1-rpc-url <l1-rpc> --private-key <deployer-private-key>` to apply the deployment.

- The contracts deployment is performed by the local Go/Forge tooling.
- Upgrades of the contracts (i.e. modifying them after deploying the contracts afresh) is not currently supported. This will be supported in the future.
- The rest of the pipeline (i.e., deploying L2s and generating genesis files) is not included in this PR to keep it smaller and allow us to get buy-in on the fundamental concepts behind `op-deployer` before further implementation.

* fix(ci): skip files without modified functions (#11891)

Updates test-heavy-fuzz-modified-tests to skip any files that
don't have any modified fuzz tests.

* fix(ci): tweak heavy fuzz run parameters (#11894)

Tweaks various parameters for the heavy fuzz run tests to prevent
the test from taking too long. We can run a daily super heavy fuzz
run instead to catch any rare flakes.

* discard candidate when ahead (#11874)

* discard candidate when ahead

* also discard result.Unsafe for consistency

* remove unnecessary type convertion for FakeGenesis

* Revert "also discard result.Unsafe for consistency"

This reverts commit d2288d4a01bb4176fd1a3c6e1901646c7bb404c7.

* remove type cast

* codeowners: own op-e2e/actions/proofs by proofs team (#11895)

* maint: add interfaces for governance contracts (#11878)

Adds interfaces for the two governance contracts.

* maint: rename Safe folder to safe (#11882)

Renames the Safe folder (uppercase) to safe (lowercase) in line
with all other folders.

* opsm: remove remaining structs (#11854)

* refactor: remove structs from DeployImplementations

* refactor: remove structs from DeployOPChain

* test: fix tests

* Update packages/contracts-bedrock/test/DeployOPChain.t.sol

Co-authored-by: Blaine Malone <[email protected]>

* Update packages/contracts-bedrock/test/DeployOPChain.t.sol

Co-authored-by: Blaine Malone <[email protected]>

* test: add missing assertions

* fix: update fuzz test timeout

---------

Co-authored-by: Blaine Malone <[email protected]>
Co-authored-by: Kelvin Fichter <[email protected]>

* feat: Add channel timeout tests for `op-program` (#11885)

* feat: Add channel timeout tests for `op-program`

* typo

* assert error

* fix comment

* feat: Add garbage frame tests for `op-program` (#11896)

* feat: Add channel timeout tests for `op-program`

* typo

* assert error

* fix comment

* feat: Add garbage frame tests for `op-program`

* assert error

* fix comment

* feat: mintable with permit (#11868)

* contracts-bedrock: add permit functionality to mintable erc20

Adds `permit` functionality to `OptimismMintableERC20` tokens
that are deployed by the `OptimismMintableERC20Factory`.

* feat: max approve permit2 in ERC20Mintable

This commit max approves permit2 automatically for all holders of the
ERC20 bridge token. This enables all users on OP stack chains to skip an
approval step for actions on protocols utilizing permit2 e.g. Uniswap

* fix: constants first

* semver-lock: update

* snapshots: fix

* contracts: add natspec

* semver-lock: update

* contracts-bedrock: fix nits

* snapshots: update

---------

Co-authored-by: Mark Toda <[email protected]>

* add sequence window expiry test (#11897)

* fix: incorrect import in ManageDrippie.s.sol (#11898)

Fixes an incorrect import inside of ManageDrippie.s.sol. Seems to
work just fine when forge install is executed but not otherwise.

* op-e2e: Setup mt-cannon for tests (#11881)

* op-e2e: Use mt-cannon

Introduces a `USE_MT_CANNON` env to optionally enables MT-Cannon in
op-e2e integration tests

* a couple of fixes

* fix todo

* op-program: Inject prefetcher instead of setting code in config (#11902)

* op-program: Support injecting a Prefetcher creator rather than setting code on the Config object.

* op-program: Use an interface for the Prefetcher instead of requiring a concrete type.

* feat: `op-program` actor test API improvements (#11903)

* feat: `op-program` actor test API improvements

* lint

* sort fix

* rebase

* op-program: Record the kv format used. (#11900)

Automatically use the correct format if it has been recorded.

Change the default format to directory. Compatibility with op-challenger is preserved because it now uses the automatic format detection, defaulting to file if not specified (e.g for kona-host).

* feat: Scaffolding for DeployAuthSystemInput (#11889)

* feat: Scaffolding for DeployAuthSystemInput

* fix: Remove undefined import

* feat: Address feedback

* interop: interopgen v2 using OPSM (#11702)

* op-chain-ops/interopgen: OPSM powered interop genesis

* ci: make forge scripts available to op-e2e

* op-chain-ops: address interopgen review comments

* cannon: Handle preimage bounds checks consistently (#11911)

* cannon: Handle preimage bounds checks consistently

* cannon: Cleanup stray comment

* feat: Scaffolding for DeployAuthSystemInput (#11890)

* feat: Scaffolding for DeployAuthSystemInput

* feat: Scaffolding for DeployAuthSystem Output

* feat: Address feedback and remove comments

* Interop: SuperSystem for E2E Tests (#11850)

* op-e2e: interop test setup (work in progress)

* op-e2e: interop test setup

* organization and comment updates

* refactor creation code into WIP system2

* save secrets per L2

* Add SuperSystem Interface ; Add Users and Transactions

* Further Refactoring ; Fix Test

* Add Supervisor

* Add Supervisor Client

* Comment out Proposer

* Add AddL2RPC to Supervisor Client

* Fully link Supervisor and OP Node in E2E Test

* correct RPC call supervisor_checkBlock

* Make EOF acceptable for backend check

* final structure names

* Change unused functions to _ for linter

* fix import order

* Add Github Issue Numbers to TODOs

* tynes comments: add World Resource as configurable

---------

Co-authored-by: protolambda <[email protected]>

* feat: Front OPSM with Proxy and Initialize (#11875)

* fix: getting stack underflow error.

* feat: adding proxy infront of OPStackManager.

* fix: PR comments, we're landing on using the initialize function over setRelease.

* fix: rename function.

* fix: nit

* fix: infering proxy admin from superchain config.

* fix: ran command: just pre-pr-no-build

* fix: nits

* fix: using CommonBase in DeployImplementations.s.sol.

* op-chain-ops: pass superchain proxy admin address as input to deployments script

---------

Co-authored-by: Matt Solomon <[email protected]>
Co-authored-by: protolambda <[email protected]>

* fix: Additional DeployImplementations.s.sol tests (#11914)

* fix: Additional testing for inferring proxy admin from superchain config.

* Apply suggestions from code review

---------

Co-authored-by: Matt Solomon <[email protected]>

* Use the deterministic deployer when broadcasting with CREATE2 (#11915)

* op-e2e: Separate helpers for proofs action tests into a new package (#11920)

* op-e2e: Move action test helpers for proofs to a separate package.

* op-e2e: Use helpers package under proofs rather than a completely separate package tree for helpers.

* cannon: Implement thread-safe ll and sc operations (#11906)

* cannon: Extract RMW op handling from shared logic

* cannon: Add more test cases of LL/SC behavior

* cannon: Cut ll/sc-related logic from common mips code

* cannon: Setup mips helpers to return memory modification info

* cannon: Add new fields to track reserved memory

* cannon: Add a boolean field indicating whether an ll reservation is active

* cannon: Implement ll/sc for MTCannon

* cannon: Add modified sysRead tests for MTCannon

* cannon: Test store operations cleare memory reservations

* cannon: Update SysClockGettime to clear ll memory reservation

* cannon: Fix slither warning - initialize variable

* cannon: Bump MIP2.sol version

* cannon: Run semver, snapshot tasks

* cannon: Cut unused log msg

* cannon: Add new error to MIPS interfaces

* cannon: Cut stale TODO

* Add integration test for apply (#11910)

* Add integration test for apply

Adds an integration test for OP Deployer's `apply` method. This test uses Kurtosis to spin up an in-memory L1, deploy the contracts using OP Deployer, then asserts that there is code at all reported addresses.

* Review updates

* circleci: Enable mt-cannon in develop-fault-proofs (#11928)

* feat: add SuperchainERC20 baseline (#11675)

* feat: add superchain erc20 baseline (#37)

* feat: add superchain erc20 baseline

* feat: make superchain ERC20 simpler

* fix: small version fix and tests

* test: fix test name

* test: remove unused import

* feat: making baseline abstract

* fix: interfaces to comply with the new interface checker

* fix: import paths and empty line

* fix: lint line

---------

Co-authored-by: 0xng <[email protected]>
Co-authored-by: 0xng <[email protected]>

* feat(op-service): add SuperchainWETH and ETHLiquidity to predeploys/addresses.go (#11927)

* Port deployers, add end-to-end contract deployments (#11922)

This PR ports over the deployers in `interopgen` into `op-deployer`, and updates `op-deployer` to support end-to end contract deployments for both the Superchain and individual OP Chains.

This PR includes a couple of bugfixes for things I discovered along the way:

1. The script host is updated to bump the nonce of the address calling the CREATE2 deployer when broadcasting. This fixes a chain/simulation mismatch that blocked contracts from being deployed.
2. The DeployImplementations contract used a fixed CREATE2 salt, which caused problems on repeated deployments. I updated the contract to pull the nonce from the environment as we do elsewhere.

Builds on https://github.com/ethereum-optimism/optimism/pull/11910.

* cannon: Handle unaligned futex addresses (#11929)

* cannon: Update tests for futex unaligned memory behavior

* cannon: Align futex-related addresses when they are set

* cannon: Run lint and semver tasks

* cannon: Add wakeup traversal tests with unaligend addresses

* cannon: Don't panic if ThreadState.FutexAddr is unaligned

* cannon: Run semver lock task

* cannon: Cleanup stray whitespace

* Add Logging ; Fix Broken Maintenance Context (#11931)

* Add Logging ; Fix Broken Maintenance Context

* Remove unneeded timing ; use Testlogger

* feat(op-e2e): Expose `L1Replica` + `L2Engine` + `BlobsStore` endpoints (#11926)

* feat(op-e2e): Expose `L1Replica` + `L2Engine` + `BlobsStore` endpoints

* mutex

* deterministic blob indexing

* proto review

* lint

* op-node: handle crit error events, lift event-system out of driver (#11932)

* op-e2e: Fix compile error (#11933)

* op-e2e: Fix compile error

* ci: Make go-lint a dependency of bedrock-go-tests to prevent merging if it fails.

* op-e2e: Separate actions tests into different packages (#11921)

* op-e2e: Move most action tests into a package based on what they test

* op-e2e: Move batch_queue_test.go to derivation package

* op-e2e: Move eip4844_test.go to batcher package

* op-e2e: Move actions helper code to helpers package

* update makefile

* op-e2e: Fix typo

---------

Co-authored-by: clabby <[email protected]>

* feat(op-e2e): Kona FPP actions test adapter (#11936)

* feat(op-e2e): Kona FPP actions test adapter

* rebase

* lint

* review

* fix result check

* op-e2e: Organize e2e system tests in subdirs (#11939)

* op-e2e: organize system tests

* op-e2e: update CI make targets

* op-e2e: fix artifacts file paths

* op-e2e: Fix paths.

* op-e2e: Fix paths again

---------

Co-authored-by: Adrian Sutton <[email protected]>

* OPSM: miscellaneous fixes and improvements (#11935)

* chore: fix comment

* feat: add assertions

* fix: use method instead of new

* refactor: make salt into an input

* refactor: unify checkOutput function signatures

* chore: update snapshots

* test: fix testContractAuth

* test: fix checkOutput signatures

* fix: update go DeployImplementationsInput struct with salt

* pr feedback

* chore: semver lock

* Disable go patches for cannon MT (#11937)

* Disable go patches for cannon MT.

Fix the prestate file list for devnet to use the binary cannon MT prestates.

* Update Makefile

---------

Co-authored-by: Inphi <[email protected]>

* feat: Scaffolding for DeployAuthSystem Script (#11908)

* feat: Scaffolding for DeployAuthSystem Script

* feat: Remove redundant documentation

* Update DeployAuthSystem.s.sol

* op-batcher: Add String methods to txRef (#11904)

* feat: Rewrite FP contract distinctions as table (#11940)

* feat: Rewrite FP contract distinctions as table

* feat: clarify handling of non-MCP contracts

* feat: Update pending mcp statuses

* op-e2e: fix fuzz cgo build (#11941)

* maint: move WETH contract to correct folders (#11870)

Moves WETH98 over to the universal/ folder where it belongs and
brings DelayedWETH up to the top of the dispute folder since there
is no longer any need for a weth/ subfolder.

* dependabot(gomod): bump github.com/prometheus/client_golang (#11946)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.3 to 1.20.4.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.3...v1.20.4)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add L2 genesis generation support to `op-deployer` (#11938)

Adds support for generating L2 genesis files to `op-deployer. The L2 initialization config is generated by merging in overrides as specified in the intent into a default config with sane values. The outputted genesis file is stored in the stage as a GZIP-compressed, base64-encoded string.

* OPSM: DeployOPChain assertions (#11943)

* chore: add BaseDeployIO for the deploy input and output contracts

* test: add assertions to DeployOPChain

* chore: semver lock

* pr feedback

* feat: remove dgf impl from DeployOpChain and OPSM (#11942)

* fix: Remove `--l2-chain-id` default (#11951)

* feat: Add ASR proxy to OPStackManager (#11952)

* feat: Add ASR proxy to OPStackManager

* feat: Add AnchorStateRegistry blueprint

* ci: run slow Cannon test once per day (#11947)

Updates CI to run the (very) slow Cannon go-lint-and-test suite
once per day instead of running it on merge since it adds at least
5 minutes to CI.

* fix: move IERC20Solady into vendor folder (#11945)

An additional "dependency" folder was added in a recent PR, this
is the same purpose as the "vendor" folder so the interface added
in that PR can simply be moved to the "vendor" folder instead.

* ci: bump semgrep-scan to xlarge (#11948)

We're still having resource issues with a large image. Going to
bump this to xlarge to see if that will fix it.

* test: invariant tests for OptimismSuperchainERC20 (#11776)

* chore: configure medusa with basic supERC20 self-bridging (#19)

- used --foundry-compile-all to ensure the test contract under
  `test/properties` is compiled (otherwise it is not compiled and medusa
  crashes when it can't find it's compiled representation)
- set src,test,script to test/properties/medusa to not waste time
  compiling contracts that are not required for the medusa campaign
- used an atomic bridge, which doesnt allow for testing of several of
  the proposed invariants

fix: delete dead code
test: give the fuzzer a head start
docs: fix properties order
test: document & implement assertions 22, 23  and 24
fix: fixes from self-review
test: guide the fuzzer a little bit less
  previously: initial mint, bound on transfer amount: 146625 calls in 200s
  now: no initial mint, no bound on transfer amount: 176835 calls in 200s
  it doesn't seem to slow the fuzzer down
fix: fixes after lovely feedback by disco
docs: merge both documents and categorized properties by their milestone
fix: fixes from parti's review
fix: feedback from disco
fix: feedback from doc
refactor: separate state transitions from pure properties
docs: update tested properties
refactor: move all assertions into properties contract
fix: move function without assertions back into handler
test: only use assertion mode
fix: improve justfile recipie for medusa

* feat: halmos symbolic tests (#21)

* feat: introduce OptimismSuperchainERC20

* fix: contract fixes

* feat: add snapshots and semver

* test: add supports interface tests

* test: add invariant test

* feat: add parameters to the RelayERC20 event

* fix: typo

* fix: from param description

* fix: event signature and interface pragma

* feat: add initializer

* feat: use unstructured storage and OZ v5

* feat: update superchain erc20 interfaces

* fix: adapt storage to ERC7201

* test: add initializable OZ v5 test

* fix: invariant docs

* fix: ERC165 implementation

* test: improve superc20 invariant (#11)

* fix: gas snapshot

* chore: configure medusa with basic supERC20 self-bridging

- used --foundry-compile-all to ensure the test contract under
  `test/properties` is compiled (otherwise it is not compiled and medusa
  crashes when it can't find it's compiled representation)
- set src,test,script to test/properties/medusa to not waste time
  compiling contracts that are not required for the medusa campaign
- used an atomic bridge, which doesnt allow for testing of several of
  the proposed invariants

* fix: delete dead code

* test: give the fuzzer a head start

* feat: create suite for sybolic tests with halmos

* test: setup and 3 properties with symbolic tests

* chore: remove todo comment

* docs: fix properties order

* test: document & implement assertions 22, 23  and 24

* fix: fixes from self-review

* test: guide the fuzzer a little bit less

previously: initial mint, bound on transfer amount: 146625 calls in 200s
now: no initial mint, no bound on transfer amount: 176835 calls in 200s

it doesn't seem to slow the fuzzer down

* feat: add property for burn

* refactor: remove symbolic address on mint property

* refactor: order the tests based on the property id

* feat: checkpoint

* chore: set xdomain sender on failing test

* chore: enhance mocks

* Revert "Merge branch 'chore/setup-medusa' into feat/halmos-symbolic-tests"

This reverts commit 945d6b6ad265ea5e3790d7ac9c5bf4d6586eb533, reversing
changes made to 5dcb3a89252e9e8fa9b54ba9012e714f7cc96395.

* refactor: remove symbolic addresses to make all of the test work

* chore: remove console logs

* feat: add properties file

* chore: polish

* refactor: enhance test on property 7 using direct try catch (now works)

* fix: review comments

* refactor: add symbolic addresses on test functions

* feat: create halmos toml

* chore: polish test contract and mock

* chore: update property

* refactor: move symbolic folder into properties one

* feat: create advanced tests helper contract

* refactor: enhance tests using symbolic addresses instead of concrete ones

* chore: remove 0 property natspec

* feat: add halmos profile and just script

* chore: rename symbolic folder to halmos

* feat: add halmos commands to justfile

* chore: reorder assertions on one test

* refactor: complete test property seven

* chore: mark properties as completed

* chore: add halmos-cheatcodes dependency

* chore: rename advancedtest->halmosbase

* chore: minimize mocked messenger

* chore: delete empty halmos file

* chore: revert changes to medusa.json

* docs: update changes to PROPERTIES.md from base branch

* test: sendERC20 destination fix

* chore: natspec fixes

---------

Co-authored-by: agusduha <[email protected]>
Co-authored-by: 0xng <[email protected]>
Co-authored-by: teddy <[email protected]>

* test: remaining protocol properties (#26)

* test: cross-user fuzzed bridges + actor setup

* test: fuzz properties 8 and 9

* test: properties 7 and 25

* fix: implement doc's feedback

* test: superc20 tob properties (#27)

* chore: add crytic/properties dependency

* test: extend protocol properties so it also covers ToB erc20 properties

* chore: small linter fixes

* docs: update property list

* test: handlers for remaining superc20 state transitions

* fix: disable ToB properties we are not using and guide the fuzzer a bit more

* fix: disable another ToB property not implemented by solady

* chore: remove zero-initializations

* fix: feedback from disco

* chore: separate fuzz campaign tests in guided vs unguided

* test: dont revert on successful unguided relay

* test: add fuzzed calls to burn and mint

* docs: document the separation of fuzz test functions

* chore: move the properties file to its own directory

* chore: consistently use fuzz_ and property_ + camelcase

* chore: fix typo

* chore: camelcase for handlers as well

* fix: revert change that broke halmos campaign compile :D

* test: fuzz non atomic bridging (#31)

* test: changed mocked messenger ABI for message sending but kept assertions the same

* docs: add new properties 26&27

* test: queue cross-chain messages and test related properties

* test: relay random messages from queue and check associated invariants

* chore: rename bridge->senderc20 method for consistency with relayerc20

* test: not-yet-deployed supertokens can get funds sent to them

* chore: medusa runs forever by default

doable since it also handles SIGINTs gracefully

* chore: document the reason behind relay zero and send zero inconsistencies

* fix: feedback from doc

* fix: walk around possible medusa issue

I'm getting an 'unknown opcode 0x4e' in ProtocolAtomic constructor when
calling the MockL2ToL2CrossDomainMessenger for the first time

* test: unguided handler for sendERC20

* fix: feedback from disco

* chore: remove halmos testsuite

* chore: foundry migration (#40)

* chore: track assertion failures

this is so foundry's invariant contract can check that an assertion
returned false in the handler, while still allowing `fail_on_revert =
false` so we can still take full advantage of medusa's fuzzer & coverage
reports

* fix: explicitly skip duplicate supertoken deployments

* chore: remove duplicated PROPERTIES.md file

* chore: expose data to foundry's external invariant checker

* test: run medusa fuzzing campaign from within foundry

* fix: eagerly check for duplicate deployments

* fix: feedback from doc

* chore: shoehorn medusa campaign into foundry dir structure

* chore: remove PROPERTIES.md file

* chore: delete medusa config

* docs: limited support for subdirectories in test/invariant

* chore: rename contracts to be more sneaky about medusa

* docs: rewrite invariant docs in a way compliant with autogen scripts

* chore: fixes from rebase

* fix: cleanup superc20 invariants (#46)

* chore: revert modifications from medusa campaign

* docs: extra docs on why ForTest contract is required

* doc: add list of all supertoken properties

* chore: run forge fmt

* ci: allow for testfiles to be deleted

* fix: run doc autogen script after rebase

---------

Co-authored-by: Disco <[email protected]>
Co-authored-by: agusduha <[email protected]>
Co-authored-by: 0xng <[email protected]>

* ci: job to check contracts build warnings (#11962)

Adds a new compiler job to check for contract build warnings.
Other existing build jobs don't compile the entire set of contracts
and we do want to be able to check for warnings across the board.

* ci: simplify contract build job inputs (#11965)

Simplifies the inputs to contracts-bedrock-build so that it
takes a single skip_pattern command instead of allowing the user
to specify any build command.

* ci: clean up golang job definitions (#11967)

Cleans up a number of golang job definitions. One PR for now
just so I can see this all work.

* ci: fix config error in cannon tests (#11969)

Fixes a configuration error in the scheduled-cannon-full-tests
job.

* op-node: lazy-dial the supervisor RPC (#11970)

* ci: simplify contracts bedrock tests job (#11966)

Simplifies the contracts-bedrock-tests job so that it takes more
parameters but makes the test command unified. Also replaces the
complex script for checking for modified fuzz tests and simply
heavily fuzzes all tests within any test files that have changed.

* ci: misc cleanups and simplifications (#11968)

Cleanups in a few places, removing unused jobs, etc.

* correct the comment (#11971)

* update op-e2e setup (#11857)

* fix: multiple fuzz flakes (#11981)

Fixes a couple of fuzz flakes that were found when fuzzing
heavily.

* maint: add interfaces for L2 bridge/messaging contracts (#11859)

First PR for adding interfaces for L2 contracts. Adds interfaces
for all of the bridging and message passing contracts.

* chore(op-service): use `errors.New` to replace `fmt.Errorf` with no parameters (#11796)

* fix(ci): semgrep cli breaking change (#11985)

Semgrep CLI tool recently removed the --time option which caused
CI to suddenly break.

* ci: correct perms for tag-service.yml (#11961)

GITHUB_TOKEN no longer gets write access by default so it needs to
be provided with write access explicitly.

* Add inspection commands, fix deployer bugs (#11964)

Adds `op-deployer inspection *` commands to expose the generated genesis and rollup configs via the CLI or Golang libraries. Also fixes a bug in deployment - I accidentally deleted the code that set the deployer nonce, so live chain deployments were reverting.

* refactor: Rename OPSM to OPSMProxy for clarity (#11972)

* chore(rename): Rename opsm to opsmProxy

* fix: Go bindings updated for proxy.

* fix: linting

* fix: pr comment nits.

* feat(op-e2e): Open channel closed after sequence window expiry test (#11993)

* feat(op-e2e): Open channel closed after sequence window expiry test

Adds a test to the proof actions that proves a block at the safe head
after the batcher has opened a channel, allowed the sequence window to
expire, and then attempted to close their open channel after the fact.

* buffer frame

* include extra tx

* feat(op-e2e): Channel timeout late submission test (#11995)

* feat(op-e2e): Channel timeout late submission test

* remove finalization of l1 chain

* ci: separate invariant runs from fuzz runs (#11982)

Using 10k invariant runs would be ridiculously slow.

* ci: Restore ci-builder docker release and remove invalid op-challenger-big-docker-release (#11997)

* maint(ci): clean up release job (#11996)

Cleans up the release job by turning it into a matrix.

* maint(ci): clean up scheduled docker publish (#11999)

Same idea again, cleaning up the scheduled docker publish with the
same technique as the previous PR.

* OPSM: More assertions (#11994)

* refactor: rename var for clarity

* test: add more assertions from ChainAssertions, and some new ones

* chore: ensure unique, clear, consistent revert string IDs

also sorts methods alphabetically for clarity

* fix: var name after rebase

* style: forge fmt

* revert proxyAdmin -> superchainProxyAdmin name change for now

* Update packages/contracts-bedrock/scripts/DeployImplementations.s.sol

Co-authored-by: Maurelian <[email protected]>

* chore: small tweaks from pr feedback

---------

Co-authored-by: Maurelian <[email protected]>

* op-challenger: Support MT-Cannon in run-trace (#11934)

* op-challenger: Support MT-Cannon in run-trace

* ..

* fix multi_test.go

* annotate metrics with mt-cannon

* preserve prestate encoding; use separate dir for mt-cannon

* Update op-challenger/cmd/run_trace.go

Co-authored-by: Adrian Sutton <[email protected]>

---------

Co-authored-by: Adrian Sutton <[email protected]>

* feat: add remaining L2 interfaces (#11984)

One more PR for adding L2 interfaces.

* feat: clean up TODOs and add CI check (#12005)

* maint: clean up TODO tags

Cleans up existing TODO tags, particularly those that referenced
old Linear issues. Updates the todo-checker script to allow
<#issue> as well as <issue>.

* feat(ci): add todo-issues check to main CI

Updates the main CI workflow to run the todo-issues check. For
now this check will ignore any bare TODOs. We can update the
script later to reject bare TODOs.

* contracts: Add more MIPS2 tests (#12003)

* contracts: Add more MIPS2 tests

* remove unused var

* cannon: Clean up fuzz test todos (#12009)

* cannon: Add memory assertions to FuzzStatePreimageRead

* cannon: Rework hint write fuzz test to assert hint expectations

* cannon: Update FuzzStatePreimageWrite to assert on expected preimageKey

* cannon: Remove validation skipping logic from test util

* cannon: Cleanup - simplify code

* cannon: Cleanup - dedupe code

* cannon: Clean up program patching (#11944)

* cannon: Cut todo, reorganize syscalls

* cannon: Rename patchGo to patchGoGC, add comments, cut TODO

* cannon: Only allow gc patching for single-threaded Cannon

* cannon: Cut patch flag from load-elf command altogether

* feat(ci): check contract semver matches natspec (#11992)

Adds a new check to CI that verifies that the semver string
defined in the contract matches the string defined in natspec.

* maint(ct): link to external mermaid diagrams in specs (#12012)

Updates the contracts README to use the mermaid diagrams in specs
to avoid duplicated documentation.

* op-program: Reproducible MT-Cannon prestate (#12011)

* op-program: Reproducible MT-Cannon prestate

* fix mt-cannon proof gen

* cannon: Fix makefile phony target (#12014)

* maint(ci): remove autogenerated invariant docs (#11988)

Removes autogenerated invariant docs from the contracts package.
These autogenerated docs create confusion about where invariants
should be defined (the answer is in the specs) and no one actually
looks at them anyway. Just adds an additional step into CI for
minimal benefit.

* vm-runner: User-prov…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OptimismMintableERC20: Add permit support + native permit2 support
4 participants