Skip to content

EOA batch inbox#15

Open
QuentinI wants to merge 4 commits intoespresso-integrationfrom
ag/eoa-batch-inbox
Open

EOA batch inbox#15
QuentinI wants to merge 4 commits intoespresso-integrationfrom
ag/eoa-batch-inbox

Conversation

@QuentinI
Copy link

@QuentinI QuentinI commented Mar 2, 2026

Closes #<ISSUE_NUMBER>

This PR:

Companion to EspressoSystems/optimism-espresso-integration#357 - replaces derivation pipeline check for reverted transactions with a check for BatchAuthenticated event in 100-block lookback window.

This PR does not:

Change anything else

Key places to review:

crates/protocol/derive/src/sources/batch_auth.rs
crates/protocol/derive/src/sources/calldata.rs
crates/protocol/derive/src/sources/blobs.rs


@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the batch authentication process within the derivation pipeline. It moves away from solely relying on sender address verification to a more robust system that can leverage L1 event scanning for TEE batchers, while still providing a fallback for traditional batchers. This change is crucial for improving the security and flexibility of batch submission, particularly in contexts requiring fault proofs, by ensuring that batch authorization can be verified directly from L1 receipts.

Highlights

  • Event-Based Batch Authentication: Introduced a new event-based batch authentication mechanism for the derivation pipeline, allowing batchers to be authorized via BatchInfoAuthenticated events emitted on L1, enhancing compatibility with fault proof environments.
  • Flexible Batcher Authorization: Implemented support for two authorization paths: TEE batchers, which require a matching BatchInfoAuthenticated event, and fallback batchers, which are authorized via traditional sender address verification without needing an event.
  • LRU Cache Integration: Integrated an LRU cache to efficiently store and retrieve authenticated batch commitment hashes, improving performance by avoiding redundant L1 receipt scans within the lookback window.
  • Configuration Updates: Added new configuration fields (batch_authenticator_address and fallback_batcher_address) to RollupConfig to enable and control the new batch authentication system.
  • Derivation Source Modifications: Updated BlobSource and CalldataSource to incorporate the new batch authentication logic, replacing previous sender-only verification with the more flexible event-based or fallback sender-based checks.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Cargo.lock
    • Added 'lru 0.16.0' dependency.
  • crates/protocol/derive/Cargo.toml
    • Added 'lru' workspace dependency.
  • crates/protocol/derive/src/lib.rs
    • Exported 'BatchAuthConfig' from the 'sources' module.
  • crates/protocol/derive/src/sources/batch_auth.rs
    • Added new module for event-based batch authentication.
    • Implemented 'BatchAuthConfig' struct for configuration.
    • Defined 'batch_info_authenticated_topic' for event identification.
    • Provided functions to compute calldata and blob batch hashes.
    • Implemented 'collect_auth_events_from_receipts' to extract authenticated hashes from L1 receipts.
    • Added 'collect_authenticated_batches' to scan L1 blocks for events with LRU caching.
    • Included 'new_batch_auth_cache' for LRU cache initialization.
    • Implemented 'is_batch_authorized' to check batch authorization based on events or fallback sender.
  • crates/protocol/derive/src/sources/blobs.rs
    • Imported batch authentication utilities.
    • Modified 'BlobSource' struct to include 'batch_auth_config' and 'auth_cache'.
    • Updated 'BlobSource::new' constructor to accept 'batch_auth_config' and initialize 'auth_cache'.
    • Modified 'extract_blob_data' to use 'is_batch_authorized' for transaction filtering, incorporating event-based authentication.
    • Integrated 'collect_authenticated_batches' to fetch authenticated hashes before processing blob data.
    • Removed direct 'tx.recover_signer()' check for batcher address in favor of 'is_batch_authorized'.
  • crates/protocol/derive/src/sources/calldata.rs
    • Imported batch authentication utilities.
    • Modified 'CalldataSource' struct to include 'batch_auth_config' and 'auth_cache'.
    • Updated 'CalldataSource::new' constructor to accept 'batch_auth_config' and initialize 'auth_cache'.
    • Modified 'load_calldata' to integrate 'collect_authenticated_batches' and 'is_batch_authorized' for transaction filtering.
    • Removed previous receipt status checks and direct sender verification in favor of the new authorization logic.
    • Added new test cases for event-based batch authentication, including TEE path, unauthenticated batches, and fallback batcher scenarios.
  • crates/protocol/derive/src/sources/ethereum.rs
    • Imported 'BatchAuthConfig'.
    • Updated 'EthereumDataSource::new' and 'new_from_parts' constructors to pass 'batch_auth_config' to 'BlobSource' and 'CalldataSource'.
  • crates/protocol/derive/src/sources/mod.rs
    • Exported 'BatchAuthConfig' from the 'batch_auth' module.
  • crates/protocol/genesis/src/chain/config.rs
    • Updated 'ChainConfig::to_rollup_config' to initialize 'batch_authenticator_address' and 'fallback_batcher_address' as None.
  • crates/protocol/genesis/src/rollup.rs
    • Added 'batch_authenticator_address' field to 'RollupConfig' for L1 authenticator contract address.
    • Added 'fallback_batcher_address' field to 'RollupConfig' for non-TEE batcher authorization.
    • Implemented 'is_batch_auth_enabled' method to check if event-based batch authentication is configured.
  • flake.nix
    • Updated Darwin SDK dependencies from specific frameworks to a general 'apple-sdk'.
    • Commented out 'BINDGEN_EXTRA_CLANG_ARGS' for glibc include.
Activity
  • The pull request is currently a Work In Progress (WIP), indicating that further changes or refinements are expected.
  • The author has linked the PR to an issue, suggesting it addresses a specific task or bug.
  • The PR description outlines what this PR adds and what is explicitly out of scope, providing clear boundaries for reviewers.
  • Key areas for review are highlighted in the description, guiding reviewers to critical sections of the code.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new event-based batch authentication mechanism, which is a significant feature for supporting TEE batchers. The implementation adds a new batch_auth.rs module with the core logic and integrates it into the existing BlobSource and CalldataSource. The changes are well-structured. My review focuses on a potential correctness issue where failed transactions might be processed, and some opportunities for performance and code style improvements. I've also noted the removal of a test case that covered an important edge case.

@QuentinI QuentinI changed the title [WIP] EOA batch inbox EOA batch inbox Mar 2, 2026
QuentinI and others added 2 commits March 2, 2026 19:23
Co-authored-by: OpenCode <noreply@opencode.ai>
Replace runtime keccak256 call with a pre-computed const B256 via b256!(),
matching the established pattern used elsewhere in the repo (deposits.rs,
system/mod.rs, hardforks/, etc.).

Co-authored-by: OpenCode <noreply@opencode.ai>
@QuentinI QuentinI marked this pull request as ready for review March 3, 2026 14:03
Copy link
Member

@jjeangal jjeangal left a comment

Choose a reason for hiding this comment

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

Nothing alarming on my end, code looks clean and all tests are passing! As discussed, repeated logic with the OP code will eventually be avoided when OP stack transitions to reth.

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