Skip to content

[opML] Off-chain Components#2

Merged
shyam-patel-kira merged 15 commits intozenbitETH:developfrom
shyam-patel-kira:opML/off-chain
May 20, 2025
Merged

[opML] Off-chain Components#2
shyam-patel-kira merged 15 commits intozenbitETH:developfrom
shyam-patel-kira:opML/off-chain

Conversation

@shyam-patel-kira
Copy link
Member

@shyam-patel-kira shyam-patel-kira commented May 18, 2025

  • Design MultiPhaseEngine
    • Phase coordination logic
    • State management
  • Implement Phase1Verifier
    • Lightweight verification logic
    • Failure detection mechanisms

@shyam-patel-kira shyam-patel-kira self-assigned this May 18, 2025
@shyam-patel-kira shyam-patel-kira added the enhancement New feature or request label May 18, 2025
@shyam-patel-kira shyam-patel-kira moved this to In progress in OP Stack Research May 18, 2025
Copy link
Member

@HabacucMX HabacucMX left a comment

Choose a reason for hiding this comment

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

Does MultiPhaseResolver.sol and PhaseSelector have changes from the previous PR?

@HabacucMX
Copy link
Member

HabacucMX commented May 20, 2025

Summary for the Development Report:

[Feature/opML] Off-chain Components

Closed Issues / Pull Request

Zenbit/OPcity:

Zenbit/Optimism:

Files changed on Zenbit/Optimism

  1. [op-challenger/game/fault/types/position.go](https://github.com/zenbitETH/optimism/pull/2/files#diff-f57b7285cf271035289fc51f2ee786e6fcd4339fb05b09f303925e9ce6b309f4)

    position.go makes the parent method publicly accessible by renaming it to Parent and updates all usages accordingly.

  2. [op-challenger/game/multiphase/engine.go](https://github.com/zenbitETH/optimism/pull/2/files#diff-87032126350a750537167bda2c0f17fc14f7bbe236cd484fd54228de0f0aa548)

    engine.go introduces a new, extensible game engine for managing multiphase dispute resolution workflows, with hooks for smart contract interactions.

  3. [op-challenger/game/multiphase/lazy_loading_manager.go](https://github.com/zenbitETH/optimism/pull/2/files#diff-d5c38fa47a0f9db420b1e55fe748f3a55a3bf873476426f550540f3ceedbcfa3)

    lazy_loading_manager.go enables efficient, thread-safe, and memory-conscious loading of state data needed for game dispute resolution, using a combination of caching and lazy loading from onchain resources. It is designed to optimize memory and performance during dispute resolution by:

    • Reducing redundant state fetches from the blockchain.
    • Managing memory usage with a capped, LRU-evicted in-memory cache.
    • Providing statistics for monitoring cache efficiency.
  4. [op-challenger/game/multiphase/phase1_verifier.go](https://github.com/zenbitETH/optimism/pull/2/files#diff-28717613a06af3e094c2d0982f5ca3e22b1e270cc28a4c61b9ce3cad96a83df8)

    phase1_verifier.go implements a scalable, efficient method to find and verify state discrepancies over large segments by:

    • Bisecting the segment recursively (divide-and-conquer search).
    • Using a lazy-loading cache to speed up state retrieval.
    • Falling back to local state computation (with Cannon VM) when needed.
    • Isolating the segment needing more detailed (phase 2) verification.

    This approach speeds up dispute resolution in optimistic rollup games, minimizing onchain computation and network calls.

  5. [op-challenger/game/multiphase/phase2_verifier.go](https://github.com/zenbitETH/optimism/pull/2/files#diff-dbd2acdb024b519ac7db440d1cc179e884fa457eff0a8d06a10439f96c3eccd1)

    phase2_verifier.go provides the logic to:

    • Precisely pinpoint the faulty instruction in a disputed state segment.
    • Verify the validity of each transition using deterministic VM execution.
    • Generate cryptographic witness data for use in protocol-level dispute resolution.

    This is a crucial component for secure, efficient, and transparent optimistic rollup fault proofs and dispute games.

  6. [op-challenger/game/multiphase/phase_selector.go](https://github.com/zenbitETH/optimism/pull/2/files#diff-9533d5b317a2d81f986b6acad73a5157045223449d69c14970c95599cb1e0768)

phase_selector.go provides the automated logic for deciding which phase of verification to use during Optimism dispute resolution. It does so by:

  • Checking onchain game outcomes for the relevant state segment.
  • Opting for fast, segment-based checking if a finalized game supports the state root.
  • Otherwise, requiring slower, fine-grained instruction verification.

This helps optimize the dispute process by avoiding unnecessary detailed checks when recent onchain results can be reused.

@shyam-patel-kira shyam-patel-kira merged commit aeb9c42 into zenbitETH:develop May 20, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in OP Stack Research May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants