Skip to content

Feat/lite mode#4

Closed
karlfloersch wants to merge 8 commits intodevelopfrom
feat/lite-mode
Closed

Feat/lite mode#4
karlfloersch wants to merge 8 commits intodevelopfrom
feat/lite-mode

Conversation

@karlfloersch
Copy link
Copy Markdown
Owner

@karlfloersch karlfloersch commented Sep 30, 2025

Note

Introduces an experimental lite-mode that sources L2 safe/finalized heads from an external RPC, with new flags, engine guards, driver wiring, and a poller to advance labels and commit missing blocks.

  • Lite Mode (experimental)
    • Adds external RPC sourcing for safe/finalized heads via op-node/litemode/ poller (single-step advancement, common-ancestor check, commit missing blocks via payload envelopes, FCU updates).
    • Skips local finalizer when enabled; logs head-setting changes; ensures FCU through TryUpdateEngine.
  • Flags & Config
    • New CLI flags: --lite-mode-rpc, --lite-mode-poll-interval; env support in devstack (OP_NODE_LITE_MODE_RPC).
    • Threads config through service.go, driver.Config, and config.Config; enforces exclusion with interop/indexing.
  • Engine/Driver Wiring
    • EngineController: liteModeEnabled gate; safe/finality promotion paths inert when enabled; added info logs on Set*Head.
    • driver.NewDriver: wires lite-mode, skips finalizer, starts poller.
    • node/node.go: guard Finalizer.OnL1Finalized when nil.
  • Docs & Tests
    • Adds design and usage docs (LITE_MODE_RPC.md, litemode/DESIGN.md).
    • Unit tests for litemode progression/commit; acceptance test verbosity tweak.

Written by Cursor Bugbot for commit a0c3dd2. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

// best-effort refresh of local anchor hash if available
if lr, err := c.l2.L2BlockRefByHash(ctx, anchor.Hash); err == nil {
anchor = lr
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Anchor State Inconsistency After Decrement

In stepFinalizedOne and stepSafeOne, after anchor.Number is decremented, the L2BlockRefByHash lookup uses the old anchor.Hash. This hash belongs to the previous block number, not the decremented one, which can lead to an inconsistent anchor state.

Additional Locations (1)

Fix in Cursor Fix in Web

// Start poller after driver start
go func() {
_ = poller.Start(driverCtx)
}()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Lite Mode Poller Errors Ignored, Goroutine Leak

The lite mode poller's startup error is ignored, which can lead to silent failures where the feature appears enabled but doesn't function. Additionally, the poller runs in a goroutine that isn't properly shut down, causing a goroutine leak.

Fix in Cursor Fix in Web

karlfloersch pushed a commit that referenced this pull request Mar 5, 2026
…thereum-optimism#19272)

* contracts: implement audit code fixes and add tests

Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and
migrate functions (#17). Include msg.sender in deploy salt to prevent
cross-caller CREATE2 collisions (#17). Add duplicate instruction key
detection in upgrade validation (#9). Validate startingRespectedGameType
against enabled game configs (#10). Add code-existence check in
loadBytes (#18). Add setUp guard to VerifyOPCM.runSingle (#4). Remove
unused _findChar function (#5). Pass real AddressManager in migrator
proxy deploy args (#11). Add tests covering all audit fix behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* contracts: regenerate semver-lock.json for OPContractsManagerV2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* contracts: bump OPContractsManagerV2 version to 7.0.10

Semver-diff requires a patch version bump when bytecode changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants