Skip to content

Conversation

@JustXxx
Copy link
Owner

@JustXxx JustXxx commented Apr 16, 2024

No description provided.

axelKingsley and others added 30 commits November 20, 2025 22:57
* SystemConfig: Parse L1 Receipts Atomically Before Application

* Change Apply rules to all Valid ; PR Comments

* Add indicies back to error
- add install-contracts-dependencies step in contracts-bedrock-heavy-fuzz-nightly job
# Summary
This PR makes a number of actor-framework-level changes to allow
dependency injection and ultimately unit tests within all of the actors.
The actor that is used to demonstrate the updates is `SequencerActor`.
If this approach looks good, issues can be created to update other
actors and add test coverage.

This also starts to create client traits for different actor
functionality in an effort to remove channel dependencies at the
interface level. This will help streamline unit tests and allow the
interfaces to evolve more seamlessly.

## Key Changes
* Loosen `NodeActor` trait requirements (remove `build()` fn and
`builder` type)
* Remove `RollupNodeService` trait since it had one implementation and
logic split between trait and impl
* Create traits for _most_ `SequencerActor` dependencies
* This includes making facade client traits for actor-actor
communication, loosening the interface-level dependence on channels and
increasing unit testing ergonomics
* The remaining dependencies will be wrapped in traits as a follow-up PR
to this one to avoid further bulking this PR
* Make `SequencerActor` generic over dependency traits
* Inject concrete instances of dependencies into `SequencerActor`
* Separate logic in `SequencerActor` into helper functions for better
readability and self-documentation
* Pull metrics, admin api server, error, and builder utilities into
separate files to self-document and reduce size of main `SequencerActor`
file
---
Ref: #3025, #3021, #2623
* feat(op-deployer): forge verify

* fix(op-deployer): state.json verification

* fix(op-deployer): test and lint

* fix(op-deployer): add apply step with validation (disabled)

* fix(op-deployer): add detection for partial verification

* fix(op-deployer): update address

* fix(op-deployer): comments

* fix(op-deployer): test

* fix(op-deployer): make logging debug

* fix(op-deployer): comments

* fix(op-validator): add todo
Job kept being killed, probably due to hitting resource limits.
* feat(cgt): custom gas token

Signed-off-by: Hex <165055168+hexshire@users.noreply.github.com>
Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
Co-authored-by: Ashitaka <96790496+ashitakah@users.noreply.github.com>
Co-authored-by: AgusDuha <81362284+agusduha@users.noreply.github.com>

* feat: add gasPayingTokenName and gasPayingTokenSymbol on json config files

* fix: contracts semver

* fix: remove system config bool

* test: add OptimismPortal2CGT tests

* chore(cgt): set cgt flag l1block & fixes

* fix(linter): resolve goimports formatting issue

* feat: add separate l2 contracts for cgt (#530)

* feat: add L1BlockCGT

* feat: add L2ToL1MessagePasserCGT

* chore: remove test exclution in test validation

* test(cgt): fix failing tests (#529)

* test(cgt): fix failing tests

* test(cgt): fix portal version

* test(cgt): skip tests on forked mode

* fix: predeploys test cgt mismatch

* test(cgt): minor fixes

---------

Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>

* fix(cgt): revert weth

* cgt: feature flag integration

Updates the implementation to use the new feature flagging system

* config: make backwards compatible

Use the legacy config name so that less needs to change for legacy CGT
chains

* fix: build issue

Remove leftover merge conflict

* fix: better backwards compatibility

* build: fix

* lint: fix

* snapshots: update

* op-deployer: apply test with CGT

Add a specific test for CGT in the intent

* contracts-bedrock: fix versioning

* lint: fix

* deployer: remove standard values

* contracts: semver lock

* contracts-bedrock: fix semver + abis

* cgt: solidity test cleanup

* solidity: fmt

* tests: remove dead imports

* tests: fixup

* cgt: configurable liquidity amount

* feat: configurable native asset liquidity balance

Fix the build for this feature

* cleanup: merge L1Block logic so that we inherit

Keeps it simple because development on Jovian is happening and we will
inherit any Jovian modifications automatically

* snapshots: update

* cgt: inherit logic for L2ToL1MessagePasser

Generally simplifies the code

* semver-lock: update

* lint: fix

* lint: fixup

* interfaces: fix

* fixes: smol

* deploy-config: sane default

* lint: fix

* linting: fix

* lint: fix

* semgrep: fix

* lint: fix

* tests: fix

* tests: fix fuzz

* fix: custom gas token rebase (#17484)

* fix: import in OptimismPortal2CGT test and pre-pr

* fix(cgt): add missing native asset amount (#543)

* fix: upgrade contract  name

* feat: add nativeAssetLiquidityAmount to config json files

* fix: add correct nativeAssetLiquidityAmount in op-deployer

* fix: add correct nativeAssetLiquidityAmount in op-e2e and fix withCustomGasToken argument on op-devstack

* fix: restore OptimismPortal2CGT

* fix: all comments

* fix: comments

* fix: governace

* fix: remove aux

* fix: remove aux

* fix: deploy cgt

* fix: revert cgt deploy config

* fix: deploy config

* chore: run linter

* fix: remove unnecessary GetNativeAssetLiquidityAmount

---------

Co-authored-by: Ashitaka <ashitaka@defi.sucks>
Co-authored-by: agusduha <agusnduha@gmail.com>
Co-authored-by: hexshire <hex@wonderland.xyz>

* fix: l2 genesis pipeline (#554)

* fix: add nativeAssetLiquidityAmount in e2e apply test (#555)

* fix: failing test

---------

Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
Co-authored-by: Ashitaka <ashitaka@defi.sucks>
Co-authored-by: hexshire <hex@wonderland.xyz>
Co-authored-by: Hex <165055168+hexshire@users.noreply.github.com>

* fix: semver lock

* fix: CGT review fixes (#17534)

* fix: json default zero

* feat(cgt): add native asset liquidity amount test & omitempty on cgt struct

* test: check native asset liquidity amount is correctly configured

* feat: add omitempty to name and symbol on cgt intent struct

* fix: check value in cgt

* feat(cgt): add cgt dev feature

* feat: add cgt dev feature

* refactor: set custom gas token (#563)

* feat: add cgt devFeatures and remove useCustomGasToken from DeployOPChainInput

---------

Co-authored-by: Hex <165055168+hexshire@users.noreply.github.com>

* fix: ir informational

* fix: informational

* fix: legacy tag

* feat(cgt): add setNativeAssetLiquidityAmount & L2Genesis max amount check

* feat: add setNativeAssetLiquidityAmount & L2Genesis max amount check

* test: fix bound param in liquidity controller

* fix: remove unused import

* refactor: move max amount check inside setNativeAssetLiquidity

* refactor: make chainIntent.CustomGasToken a non-pointer (#574)

* refactor: make chainIntent.CustomGasToken a non-pointer

* test: fix custom gas token text (#576)

---------

Co-authored-by: Hex <165055168+hexshire@users.noreply.github.com>

* fix: undo tests

Co-authored-by: hexshire <hex@wonderland.xyz>

* fix: cgt portal (#577)

* fix: semver

* fix: cgt tests coverage (#582)

* fix: l2genesis expectRevert amount test

* test: improve l1block coverage

* test: improve l1blockcgt coverage

* test: add isCustomGasToken tests on SystemConfig

* test: improve L2ToL1MessagePasserCGT coverage

* test: improve L2ToL1MessagePasser coverage

* fix: naming pre-pr

* fix(cgt): change L2ToL1MessagePasser & OPContractsManager semver (#584)

* fix: change L2ToL1MessagePasser semver

* fix: change L2ToL1MessagePasser & OPContractsManager  semver

* fix: cgt feature tests (#585)

* fix: cgt feature tests

* fix: deposits with amount 0 when cgt enabled

* Revert "fix: deposits with amount 0 when cgt enabled"

This reverts commit 8bee464.

* fix: cgt portal (#587)

* fix: ci fixes (#588)

---------

Co-authored-by: Ashitaka <96790496+ashitakah@users.noreply.github.com>
Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
Co-authored-by: Hex <165055168+hexshire@users.noreply.github.com>
Co-authored-by: hexshire <hex@wonderland.xyz>

* fix: semver

* fix: opcm version

* fix: tests

* feat(op-acceptance-tests): add acceptance tests for native CGT across L1/L2 (#17451)

- Gate suite via L1Block.isCustomGasToken(); assert name/symbol non-empty
- L2: value transfer pays CGT token (typed amounts via op-service/eth)
- L2: XDM rejects callvalue; L2StandardBridge legacy withdraw reverts
- L1: Portal receive/deposit rejects ETH; introspect SystemConfig addr
- L1: assert SystemConfig.isCustomGasToken() is true

* fix: custom gas token rebase review comments (#17577)

* chore: use w3 library

* fix: msg error

* refactor(cgt): rename amount & add geq 0 check (#600)

* feat: add NativeAssetLiquidityAmount sign check

* refactor: rename NativeAssetLiquidityAmount to InitialLiquidity

* refactor(cgt): rename json nativeAssetLiquidityAmount to initialLiquidity (#601)

* refactor: rename json nativeAssetLiquidityAmount to initialLiquidity

* fix: only add initialLiquidity to cgt intent struct

---------

Co-authored-by: Hex <165055168+hexshire@users.noreply.github.com>
Co-authored-by: Ashitaka <96790496+ashitakah@users.noreply.github.com>
Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>

* fix: cgt review (#17612)

* refactor: replace enableCustomGasToken with cgt devfeature

* feat: remove fund in NativeAssetLiquidity (#605)

* fix(cgt): remove OptimismPortal2 test from exclusions (#606)

* fix: remove OptimismPortal2 test from exclusions

* fix: remove virtual and restore constructor in portal test

* refactor: use low level call to receive test

* refactor(cgt): migrate L1Block and L2ToL1MessagePasser cgt tests (#608)

* refactor: migrate L1Block cgt tests

* refactor: migrate L2ToL1MessagePasser cgt tests

* fix: comments (#607)

* fix: comments

* fix: custom error

* fix: errors and tests

* fix: errors and tests

* fix: cgt tests (#610)

* fix: comments

* fix: custom error

* fix: errors and tests

* fix: errors and tests

* fix: tests

* fix: tests

* fix: weth

* fix: cgt tests (#611)

* fix: comments

* fix: custom error

* fix: errors and tests

* fix: errors and tests

* fix: tests

* fix: tests

* fix: weth

* fix: remove types

* fix: coverage tests (#612)

* fix: separate setUp function tests (#613)

---------

Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
Co-authored-by: Ashitaka <96790496+ashitakah@users.noreply.github.com>

* test: custom gas token invariants (#17489)

* test(inv): setup and total sup inv

* test(inv): accounting invariants

* chore: doc

* fix: import in OptimismPortal2CGT test and pre-pr

* fix(cgt): add missing native asset amount (#543)

* fix: upgrade contract  name

* feat: add nativeAssetLiquidityAmount to config json files

* fix: add correct nativeAssetLiquidityAmount in op-deployer

* fix: add correct nativeAssetLiquidityAmount in op-e2e and fix withCustomGasToken argument on op-devstack

* fix: restore OptimismPortal2CGT

* fix: all comments

* fix: comments

* fix: governace

* fix: remove aux

* fix: remove aux

* fix: deploy cgt

* fix: revert cgt deploy config

* fix: deploy config

* chore: run linter

* fix: remove unnecessary GetNativeAssetLiquidityAmount

---------

Co-authored-by: Ashitaka <ashitaka@defi.sucks>
Co-authored-by: agusduha <agusnduha@gmail.com>
Co-authored-by: hexshire <hex@wonderland.xyz>

* fix: l2 genesis pipeline (#554)

* fix: add nativeAssetLiquidityAmount in e2e apply test (#555)

* fix: failing test

* chore: doc

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* chore: remove unused imports

* chore: fix semgrep

* chore: change error name

---------

Co-authored-by: drgorillamd <83670532+drgorillamd@users.noreply.github.com>
Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
Co-authored-by: Ashitaka <ashitaka@defi.sucks>
Co-authored-by: agusduha <agusnduha@gmail.com>
Co-authored-by: hexshire <hex@wonderland.xyz>
Co-authored-by: AgusDuha <81362284+agusduha@users.noreply.github.com>
Co-authored-by: Hex <165055168+hexshire@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* refactor: use skipIfDevFeatureDisabled for cgt predeploys test (#614) (#17621)

Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>

* fix: tests

* fix: auth minter helper & bound _mint in depositTransaction tests (#17642)

* refactor: auth minter helper tests (#618)

* fix: bound _mint correctly in depositTransaction test function (#619)

* chore: run pre-pr

* chore: address ci errors

* chore: fix go tests

* chore: run checks

* test(wip): fix failing tests

* chore: run pre-pr

* fix: cgt flag tests

* test: skip fee split invriant when CGT enabled

* test: fix l2 genesis override test (#673)

* feat: add ownable liquidity (#671)

* feat: add ownable liquidity

* feat: remove enable and add default liquidity

* feat: pre pr fixed

* fix: initializer

* fix: comments

* fix: comments

* fix: pre-pr

* fix: override

* fix: tests

* fix: cursor issues

* fix: cursor bug bot

* fix: cursor bot

* fix: remove override

* fix: comment

* feat: add checks

* fix: tests

* fix: nil in cgt config

---------

Co-authored-by: agusduha <agusnduha@gmail.com>

* fix: semver

* test: fix cgt fork tests (#676)

* test: fix cgt fork tests

* fix: remove dev flag in L1 tests

* fix: go linter (#679)

* fix: go linter

* fix: with custom gas token func

* test: fix go fuzz (#680)

* fix: cgt config jsons (#681)

* fix: zero owner and sepolia address (#685)

* feat: predeploys (#684)

* fix: predeploys

* fix: predeploys

* fix: L2 genesis

* test: fix cgt with revenue sharing tests (#691)

* fix: semver

* fix: cgt liquidity controller natspec (#694)

* fix: remove dev feature flag from opcm (#695)

* fix: remove dev feature flag from opcm

* fix: lint

---------

Signed-off-by: Hex <165055168+hexshire@users.noreply.github.com>
Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
Co-authored-by: Ashitaka <96790496+ashitakah@users.noreply.github.com>
Co-authored-by: AgusDuha <81362284+agusduha@users.noreply.github.com>
Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
Co-authored-by: Ashitaka <ashitaka@defi.sucks>
Co-authored-by: agusduha <agusnduha@gmail.com>
Co-authored-by: Stefano Charissis <stefano@oplabs.co>
Co-authored-by: Simon Something /DrGoNoGo <83670532+simon-something@users.noreply.github.com>
Co-authored-by: drgorillamd <83670532+drgorillamd@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* fix(scripts): skip validation for missing test artifacts

- add extractTestFileName() to extract test filename from artifact path
- add testFileExists() to check if test source file exists recursively in test directory
- skip validation in processFile() when test source file does not exist
- add TestExtractTestFileName test
- add TestTestFileExists test with subdirectory validation
- update TestProcessFile to create test source file and artifact structure
- add setupTestDir() helper function for test directory setup
- add createTestArtifact() helper function for artifact creation
- refactor test setup to use helper functions in 5 tests

* fix(script): skip validation for missing test contracts

- add testContractExistsInFile() to check if contract exists in test file
- skip validation in processFile() when test contract not found in source file
- add TestTestContractExistsInFile test
…oad correctly filters user transactions (op-rs/kona#3077)

## Description

This fixes payload derivation for holocene by ensuring that filtering
`OpPayloadAttributes` for deposit-only payloads correctly filters
non-deposit payloads. Adds a unit test
…p-rs/kona#3061)

## Description

The finalization test was flaking because we didn't get enough new
blocks finalized. This test ensures we are receiving at least one
finalized block within 4 mins.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ather (#18369)

* chore: Promote static cache pather

* chore: Add runtime version check
* feat: OPCMv2

* fix: bug in deploying dispute games

* fix: no more opcmv1 changes

* fix: bad interface

* fix: further clean diff

* fix: reduce diff

* fix: undo artifacts diffs

* fix: broken go structs

* fix: opcm output struct ordering

* fix: better tests

* fix: justfile path

* fix: lcov issue

* fix: pr review comments

* fix: pr comments

* fix: rebase tweaks

* fix: contract verification failure

* fix: last few ci issues
…dingClient (op-rs/kona#3087)

closes #3069

This also:
- Removes BlockBuildingClient from the output of EngineActor
construction in favor of BlockBuildingClient being constructed in
RollupNode
- Removes unnecessary waiting logic for unsafe head to update after
initial reset within SequencerActor
* Add DeployFeesDepositor script

* Refactor deploy script to remove Output struct

* forge fmt

* Make logResults() pure

* fix return value names

* remove unused import

* Apply suggestions from code review

Co-authored-by: Disco <131301107+0xDiscotech@users.noreply.github.com>

* Add missing natspec

* Add natspec to tests

---------

Co-authored-by: Disco <131301107+0xDiscotech@users.noreply.github.com>
…ile (#18370)

- update testContractExistsInFile() to match interfaces and libraries in addition to contracts
- add test cases for interface and library validation in TestTestContractExistsInFile
* op-deployer: activate jovian at genesis by default (#18342)

* op-deployer: activate jovian at genesis by default

* fix tests for jovian activation

* use inclusive instead of exclusive arg
* feat: add support for blockscout in VerifyOPCM

This commit adds support for blockscout in VerifyOPCM and defaults
to blockscout. Etherscan verification can still be used but
blockscout is simpler and more reliable on all networks.

* fix: formatting
…ntract (#18331)

* Use vm.prank(address,bool) for delegateCall, remove DelegateCaller contract

Remove imports of DelegateCaller

fmt

fix: by explicitly using delegatcall

was expecting foundry to override the CALL to a delegatcall for some
reason.

remove unused returndata vars

fix updatePrestate call testing

Fixes to ForkLive

Self review clean up

fix: handle empty EOA code in delegate call tests

Adds a prankDelegateCall() helper function to eliminate repetitive code pattern for handling Foundry's requirement that addresses have at least one byte of code to prank delegatecalls. This helper combines vm.etch() and vm.prank(_, true) into a single reusable function.

Create prankDelegateCall function

Restore DelegateCaller contract

Prevents merge conflicts with other inflight work

Clean up comments on prankDelegateCall

Delete DelegateCaller contract

* Fix outdated comment and etch restore

* fix unused imports

* Fix upgradeSuperchain call
…tract fields are well encoded (op-rs/kona#3078)

## Description

Currently the protocol assumes that all the deposit contract fields are
encoded using solidity's compiler. Those contracts are trusted by
default, but we may want to apply a more defensive programming approach
and ensure that all the fields are well formatted anyways.
and use it in the pectra acceptance tests.
…mConfig for upgrade (#18376)

* fix: semver updates

* fix: semver lock

* fix: semver lock again
…cannon_kona (#18374)

* op-acceptance: Add acceptance tests for withdrawals using cannon and cannon_kona game types

* op-acceptance: Add game types through OPCM instead of separate op-deployer script

* op-acceptance: Remove unused method
…18397)

- Add bake.yaml workflow using factory reusable multi-arch workflow
- Build all 16 OP Stack images (op-node, op-batcher, op-deployer, op-faucet, op-program, op-proposer, op-challenger, op-dispute-mon, op-conductor, da-server, op-supervisor, op-supernode, op-test-sequencer, cannon, op-dripper, op-interop-mon)
- Native ARM builds on ubuntu-24.04-arm for faster compilation
- Multi-arch manifest creation with SLSA Build Level 3 attestations
- Add compute-git-versions.sh script to replicate CircleCI GIT_VERSION logic
- Read KONA_VERSION from kona/version.json (single source of truth)
- Add Makefile target for compute-git-versions
- GitHub Actions cache support for faster builds
- BuildKit provenance (mode=max) + GitHub attestations for rich metadata

Signed-off-by: falcorocks <14293929+falcorocks@users.noreply.github.com>
…18396)

* refactor(test): rename test functions to use _succeeds suffix and add docs

- Rename all test functions from _works to _succeeds suffix
- Simplify test names by removing redundant 'check' and 'Against' words
- Add @notice documentation for each test function

* test(contracts): add fuzz tests for isDevFeatureEnabled function

- Add testFuzz_isDevFeatureEnabled_featureMatchesSelf_succeeds
- Add testFuzz_isDevFeatureEnabled_emptyFeatureAlwaysFalse_succeeds
- Add testFuzz_isDevFeatureEnabled_featureInSuperset_succeeds
- Add testFuzz_isDevFeatureEnabled_featureNotInDisjointBitmap_succeeds

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… games (#18393)

* op-challenger: Update list-games sub command to support optimistic zk games.

Starts to build out the OptimisticZK contract bindings and make challenger not require everything to look like a FaultDisputeGame.

* Fix variable name
tarunkhasnavis and others added 30 commits January 13, 2026 20:26
Co-authored-by: Tarun Khasnavis <tarunkhasnavis@Mac.lan>
* feat: remove-l200-support(#18620)

* refactor: remove L2OutputOracle support from op-proposer

Removes legacy L2OutputOracle (L2OO) proposal logic in favor of
exclusive DisputeGameFactory (DGF) support.

- Flattened logic in driver.go's loop and sendTransaction.
- Removed unused waitForL1Head and manual ABI packing functions.
- Updated driver_test.go to remove L2OO test vectors and update
  DGF mocks.
- Cleaned up config_test.go to remove legacy requirement checks.

This simplifies the proposer architecture as part of the transition
to the Fault Proof system.

Fixes #18620

* Update op-proposer/proposer/driver.go

Co-authored-by: Adrian Sutton <adrian@symphonious.net>

* fix: remove comment of unsupported addr

* feat: remove l200AddressFlag

* feat: remove l200Addressflag

---------

Co-authored-by: Adrian Sutton <adrian@symphonious.net>
…nsitions (op-rs/kona#3253)

Closes: #3248

This formalizes in a single place logic that was implied by a number of
booleans and logic in various parts of DerivationActor.

Note: if this state machine is implemented incorrectly, it will cause
kona-node to fail at runtime. That said, I can confirm that the
following tests have passed:
- `just test-e2e-sysgo node node/reorgs large-kona-sequencer` 
- `just test-e2e-sysgo node node/restart large-kona-sequencer`
- `just test-e2e-sysgo node node/common large-kona-sequencer`
- `just acceptance-tests kona-node op-reth`
Create docker compose recipe for locally running a `kona-node`
development branch.

Brings up Prometheus and Graphana instances.

Closes: #3200 
ref: #2963
* test: opcm2 deploy test (#782)

* test: add test cases for DeployOPChain

* chore: remove unused helper function in DeployOPChain

* test: add unit testing for opcm version on the makeDCI function

* test: add challenger check for address(0)

* chore: add natspec for DeployImplementations.s.sol functions

* test: move challenger = address(0) test to test_run_nullInput_reverts

* refactor: removes hard-coded init bond

* chore: add natspec and proper names for internal functions DeployOPChain

* test: checks for additional assertions for the DeployOPChain::runWithBytes

* test: use DEFAULT_INIT_BOND

* test: add natspec for DeployImplementations.t.sol

* refactor: remove one liner helper

* fix: add revert if v2 enabled but not deployed

* fix: add revert if v2 enabled but not deployed && add expect error msg test

* fix: add revert when opcmAddr is zero

---------

Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>

* chore: address semgrep (#791)

---------

Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
* feat: have check runner retry snapshots clean

Updates the check runner so that it can retry the snapshots task
if there's an issue with the non-clean builds. I've seen this
happen once, so this should resolve the issue.

* fix: avoid infinite loops

* fix: make valid semver depend on snapshots
git-subtree-dir: kona
git-subtree-mainline: e4b0603
git-subtree-split: 64c92b9
~Base branch: op-rs/kona#3242

~May conflict with op-rs/kona#3229,
op-rs/kona#3253

Implement the kona light CL([Design
doc](https://github.com/ethereum-optimism/design-docs/blob/main/protocol/kona-node-light-cl.md)):
- [DerivationActor - Target
Determination](https://github.com/ethereum-optimism/design-docs/blob/main/protocol/kona-node-light-cl.md#derivationactor---target-determination)
- [EngineActor - Fork Choice
Update](https://github.com/ethereum-optimism/design-docs/blob/main/protocol/kona-node-light-cl.md#engineactor---fork-choice-update)

```mermaid
flowchart TB

subgraph A ["Normal Mode (Derivation)"]
  direction TB

  subgraph A0 ["Rollup Node Service"]
    direction TB
    A_Derivation["DerivationActor<br/>(L1->L2 derivation)"]
    A_Engine["EngineActor"]
    A_UnsafeSrc["Unsafe Source<br/>(P2P gossip / Sequencer)"]
  end

  A_L1[(L1 RPC)]
  A_EL[(Execution Layer)]

  A_L1 -->|L1 info| A_Derivation
  A_UnsafeSrc -->|unsafe| A_Engine
  A_Derivation -->|"safe(attr)/finalized"| A_Engine
  A_Engine -->|engine API| A_EL
end

subgraph B ["Light CL Mode"]
  direction TB

  subgraph B0 ["Rollup Node Service"]
    direction TB
    B_DerivationX[["DerivationActor<br/>(NEW: Poll external syncStatus)"]]
    B_Engine["EngineActor"]
    B_UnsafeSrc["Unsafe Source<br/>(P2P gossip / Sequencer)"]
  end

  B_L1[(L1 RPC)]
  B_Ext[(External CL RPC<br/>optimism_syncStatus)]
  B_EL[(Execution Layer)]

  %% Connections
  B_Ext -->|safe/finalized/currentL1| B_DerivationX
  B_L1 -->|canonical L1 check| B_DerivationX
  B_DerivationX -->|"safe(blockInfo)/finalized (validated)"| B_Engine
  B_UnsafeSrc -->|unsafe| B_Engine

  %% Visual indicator for disabled actor
  B_Engine -->|engine API| B_EL
end
```

### Testing

#### Acceptance Tests

Running guidelines detailed at op-rs/kona#3199:

- [x] `TestFollowL2_Safe_Finalized_CurrentL1`
- [x] `TestFollowL2_WithoutCLP2P`
- [ ] `TestFollowL2_ReorgRecovery` (blocked by [kona: Check L2 reorg due
to L1
reorg](#18676))

Injecting CurrentL1 is blocked by [kona: Revise SyncStatus CurrentL1
Selection](#18673)

#### Local Sync Tests

Validated with syncing op-sepolia between kona-node light CL <> sync
tester, successfully finishing the initial EL sync and progress every
safety levels reaching each tip.

#### Devnet Tests

Commit
op-rs/kona@0b36fdd
is baked to
`us-docker.pkg.dev/oplabs-tools-artifacts/dev-images/kona-node:0b36fdd-light-cl`
and deployed at `changwan-0` devnet:
- As a verifier: `changwan-0-kona-geth-f-rpc-3`
[[grafana]](https://optimistic.grafana.net/d/nUSlc3d4k/bedrock-networks?orgId=1&refresh=30s&from=now-1h&to=now&timezone=browser&var-network=changwan-0&var-node=$__all&var-layer=$__all&var-safety=l2_finalized&var-cluster=$__all&var-konaNodes=changwan-0-kona-geth-f-rpc-3)
- As a sequencer: `changwan-0-kona-geth-f-sequencer-3`
[[grafana]](https://optimistic.grafana.net/d/nUSlc3d4k/bedrock-networks?orgId=1&refresh=30s&from=now-1h&to=now&timezone=browser&var-network=changwan-0&var-node=$__all&var-layer=$__all&var-safety=l2_finalized&var-cluster=$__all&var-konaNodes=changwan-0-kona-geth-f-sequencer-3)
    - As a standby | leader

Noticed all {unsafe, safe, finalized} head progression as a kona node
light CL.
New checks added have been disabled to avoid needing to change code with the upgrade.
We can decide which checks are useful and enable them individually with fixes.
The `L1BlockInfo___` structs contains overlapping fields. This branch
factors out the non-deprecated fields e.g. `L1BlockInfoBedrockBase` and
embeds this as a field in `L1BlockInfoBedrock`:

```
pub struct L1BlockInfoBedrock {
    #[serde(flatten)]
    base: L1BlockInfoBedrockBase,
    /// The fee overhead for L1 data. Deprecated in ecotone.
    pub l1_fee_overhead: U256,
    /// The fee scalar for L1 data. Deprecated in ecotone.
    pub l1_fee_scalar: U256,
}
```
The purpose is reuse (think OOP inheritance) instead of repetition. As a
side-effect this increases encapsulation.

It establishes a partial order and a chain of fully embedded structs:

L1BlockInfoBedrockBase < L1BlockInfoEcotoneBase < L1BlockInfoIsthmus <
L1BlockInfoJovian

Further

    L1BlockInfoBedrockBase < L1BlockInfoBedrock

and

    L1BlockInfoEcotoneBase < L1BlockInfoEcotone


This is deemed necessary to get around deprecated fields in
`L1BlockInfoBedrock` and `L1BlockInfoEcotone`.


To hide the implementation details, constructors have been added and
destructuring is discouraged.

There is no single way to do this in Rust, but this is one way. A
similar way is used
[`op-alloy`](https://github.com/alloy-rs/op-alloy/blob/main/crates/rpc-types/src/transaction.rs).
)

* op-challenger: call closeGame() for games with no bonds to claim

This fixes an issue where permissioned games don't update the AnchorStateRegistry
because the challenger has no bonds to claim. When chains switch from permissioned
to permissionless, the anchor state could be too old and can't be proven in time.

Changes:
- Add CloseGameTx() method to FaultDisputeGameContract interface and all implementations
- Older contract versions (080, 0180, 111, 131) return ErrCloseGameNotSupported
- Modify Claimer.claimBond() to call closeGame() when:
  - Game is finalized (not in progress)
  - No credit to claim
  - bondDistributionMode is UNDECIDED
- Add tests for the new closeGame() behavior

Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>

* op-challenger: address PR review comments

- Skip closeGame() when in selective claim resolution mode
- Add GetBondDistributionMode and CloseGameTx to OptimisticZKDisputeGameContract interface
- Add tests for GetBondDistributionMode and CloseGameTx in optimisticdisputegame_test.go
- Add tests for CloseGameTx in faultdisputegame_test.go including older versions returning ErrCloseGameNotSupported
- Pass SelectiveClaimResolution config to Claimer via service.go

Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>

* op-challenger: use NormalDistributionMode constant in test

Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>

* op-challenger: only attempt to close game once per ClaimBonds call

Refactored ClaimBonds to:
- Create contract once per game instead of once per claimant
- Track if any claimant had credit > 0 for a game
- Only call closeGame once per game if no claimant had credit

This avoids wasting resources checking bond distribution mode for every address.

Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>

* op-challenger: extract claimBonds method for single game processing

Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>

* op-challenger: keep closeGame in ClaimBonds, claimBonds only iterates addresses

Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com>
chore(kona): upstream op-rs/kona to the monorepo (attempt 2)
- Add edge case test for toRpcHexString(0)
- Add fuzz test for toRpcHexString prefix validation
- Convert search_olderThanEverything to fuzz test
- Convert search_newerThanEverything to fuzz test
- Convert getUnresolvedGames_betweenTimestamps to fuzz test

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…#18791)

* refactor(test): rename fuzz tests to follow testFuzz_ naming convention

* test(contracts): add version format validation for OptimismSuperchainERC20Factory

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…mentation (#18786)

* refactor: consolidate DummyCaller contracts into single generic implementation

Replaces 7 nearly-identical DummyCaller contracts with a single generic
implementation that uses a fallback() function to forward any call.

Changes:
- Add scripts/libraries/DummyCaller.sol with generic delegatecall forwarder
- Update UpgradeOPChain.s.sol to use generic DummyCaller
- Update UpgradeSuperchainConfig.s.sol to use generic DummyCaller
- Update AddGameType.s.sol to use generic DummyCaller
- Update InteropMigration.s.sol to use generic DummyCaller
- Remove redundant DummyCallerV1, DummyCallerV2, and DummyCaller contracts

The generic DummyCaller reads the target address from storage slot 0,
forwards calldata via delegatecall, reverts on failure, and returns on
success. This is functionally equivalent to the previous implementations
since all callers required success anyway.

Closes #18784

Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>

* fix: remove unused DummyCaller imports

Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>

* fix: use low-level calls and runtimeCode for DummyCaller

- Use type(DummyCaller).runtimeCode instead of creationCode for vm.etch()
- Use low-level calls in _upgrade() to avoid return type mismatches
- Get upgradeInput before vm.broadcast() to avoid staticcall errors

Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com>
* fix: do not use fallback artifacts on PRs branches other than develop

* Refactor get-target-branch into script

* fix: shellcheck error

* fix: simplify get-target-branch.sh to match original logic

Removed unnecessary error handling and conditional logic to keep the
script closer to the original CircleCI implementation for easier review.

* remove extra ci job calls
* refactor(dispute): replace V1 with V2 dispute games

Use git mv to rename V2 contracts to replace V1:
- src/dispute/v2/FaultDisputeGameV2.sol → src/dispute/FaultDisputeGame.sol
- src/dispute/v2/PermissionedDisputeGameV2.sol → src/dispute/PermissionedDisputeGame.sol
- interfaces/dispute/v2/IFaultDisputeGameV2.sol → interfaces/dispute/IFaultDisputeGame.sol
- interfaces/dispute/v2/IPermissionedDisputeGameV2.sol → interfaces/dispute/IPermissionedDisputeGame.sol

Renamed all V2 symbols to non-V2 names.
Updated all imports and references.

* chore: remove more v2 references

* chore: bump semvers

* chore: bump OptimisticZkGame version to 0.1.0

Bytecode changed due to metadata differences from V2 contract removal.

* chore: remove duplicate games from rename

* chore: remove V2 suffix from dispute game struct members and regenerate snapshots

- Rename faultDisputeGameV2Impl → faultDisputeGameImpl in Implementations struct
- Rename permissionedDisputeGameV2Impl → permissionedDisputeGameImpl
- Rename V2 functions: _registerPermissionedGameV2 → _registerPermissionedGame
- Update setNewPermissionedGameImplV2 → setNewPermissionedGameImpl
- Update setNewPermissionlessGameImplV2 → setNewPermissionlessGameImpl
- Fix stale comment in FaultDisputeGame.sol (240 → 244 bytes)
- Regenerate ABI snapshots with correct struct member names
- Update Go files in op-deployer and op-chain-ops

* chore: regenerate OPContractsManager Go bindings

* chore: bump semver

* chore: remove unused V1/V2 dispute game detection functions

Delete _isV1DisputeGameImplementation and _isV2DisputeGameImplementation
from VerifyOPCM.s.sol. Both functions were checking for the same names
after the V2 rename and were never actually used.

* chore: remove V2 dispute game skip from VerifyOPCM tests

V2 dispute games are no longer behind a feature flag, so remove the
skip logic that prevented them from being tested. Keep Super dispute
game skip as those are still in development.

* chore: remove V1 backwards compat from getAbsolutePrestate

OPCM updates are applied in order, so all dispute game implementations
now use CWIA args. Remove the V1 fallback path that read absolutePrestate
directly from the contract.

* chore: bump semver

* Revert "chore: remove V1 backwards compat from getAbsolutePrestate"

This reverts commit 97b98e0.

The V1 backwards compat is needed for the upgrade path when chains
still have V1 dispute games. The gameArgs won't be populated until
after the upgrade completes, so the fallback to call absolutePrestate()
directly on the contract is required.

* chore: semver update after revert commit

* test: use DEFAULT_DISPUTE_GAME_INIT_BOND in SuperFaultDisputeGame

Replace hardcoded 0.08 ether with constant for consistency.

* test: use DEFAULT_DISPUTE_GAME_INIT_BOND in DisputeGameFactory

Replace hardcoded 0.08 ether with constant for consistency.

* test: use DEFAULT_DISPUTE_GAME_INIT_BOND in FaultDisputeGame

Replace hardcoded 0.08 ether with constant for consistency.

* docs: restore OPCM V1/V2 notice in AddGameType

Restore natspec notice clarifying this script is for OPCM V1 only.
OPCM v2 support is provided through the UpgradeOPChain script.

* test: restore OPCM v2 skip for PDG getter checks

PDG getter checks don't apply to OPCM v2 since game args are
passed at creation time. Restore the conditional guard.
* Remove pre-Fulu restriction on blobs endpoint

this was causing some older tests to fail

* Use zeroed blob proof for sidecars

* Remove blobs_test.go from fakebeacon
)

* fix(ci/proofs): publish the prestates to the right gcloud folder

* fix(ci/proofs): fix ci pipeline job
…om-kona

chore(kona): pull last changes from kona
…le endpoint (#18750)

* op-node: Allow setting additional flobal Prometheus labels on Metrics

Change NewMetrics to accept prometheus.Labels and, when provided, wrap
the registry with those labels. Update the factory.With signature to
accept a prometheus.Registerer. Plumb the new NewMetrics signature
through call sites, add VIRTUAL_NODE_CHAIN_ID_LABEL in op-supernode and
pass the chain ID label for virtual node metrics

* Move supernode metrics into new metrics package

Add op-supernode/supernode/metrics with a Metrics type and StartServer
helper. Replace per-chain metrics router/service with a single metrics
server managed by Supernode. Remove setMetricsHandler from
ChainContainer and update tests. Add initMetricsServer to handle metrics
startup and shutdown, and minor TODO comment in op-node initialization.

* Revert "Move supernode metrics into new metrics package"

This reverts commit 0f23b94.

* Use AddHandler to multiplex metrics handlers

Rename setMetricsHandler to addMetricsHandler and adjust its signature
to accept only an http.Handler. Update NewChainContainer and call sites
accordingly. MetricsRouter now keeps a slice of handlers and invokes
each for metrics requests, removing per-chain path normalization.

* Use prometheus.Registerer for metrics

* Use Prometheus registries for metrics router

MetricsRouter now accepts prometheus.Gatherer instances and builds a
single promhttp.Handler that aggregates all registered gatherers.
ChainContainer and supernode updated to pass registries (AddRegistry)
instead of per-chain HTTP handlers.

* Use local registry for Prometheus HTTP handler

* Clarify MetricsRouter Gatherer documentation

Expand comment to explain that MetricsRouter serves multiple Prometheus
Gatherers from a single HTTP server and warn that Gatherers must not
collide (e.g. use unique names or a distinct global label)

* tweak

* Replace MetricsRouter with MetricsFanIn

* Key metrics registries by chain ID

Rename AddRegistry to AddMetricsRegistry and make it accept a chain key
so metrics registries are stored in a map and then aggregated into a
Gatherers slice. Update chain container and supernode to pass
chainID.String() when registering per-chain metrics.

* Rename AddMetricsRegistry to SetMetricsRegistry

Update metrics fan-in comment to mention the /metrics path. Add a unit
test to verify multiple registries are merged and served. Update
supernode to call the new method name.

* Document VIRTUAL_NODE_CHAIN_ID_LABEL constant

* Call handler outside lock in ServeHTTP
* op-e2e: Add interop program utilizing EIP-2935 action test

Introduces an action test that asserts EIP-2935 utilization inside the
interop fault proof program. This ensures that during consolidation, the
program is able to efficiently locate historical blocks via EIP-2935.

* reuse function
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.