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

Add design doc for smart batching feature #229

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jbearer
Copy link

@jbearer jbearer commented Mar 25, 2025

Description

Design document for a feature we call "smart batching", i.e. allowing the batch inbox to be a smart contract for customizable batching or sequencing logic.

Tests

No tests, design doc only.


### Resource Usage

The derivation pipeline already fetches transaction receipts in several places (e.g. attributes
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this may mean that L1 execution will have to happen in the proof system, to recreate the execution in the L1 inbox to create the receipt. We may be able to get around it by unwrapping the receipts from the receipts root in the header if we have a trusted L1 blockhash, but would want to check with @Inphi @ajsutton @clabby to understand the tradeoffs here

Copy link
Author

Choose a reason for hiding this comment

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

We may be able to get around it by unwrapping the receipts from the receipts root in the header if we have a trusted L1 blockhash

This was how I imagined it would work. Is there not already something like this in the proof system, since the derivation pipeline already depends on receipts (e.g. for attributes derivation)?

rollup-specific and opt-in.

### Single Point of Failure and Multi Client Considerations

Copy link
Contributor

Choose a reason for hiding this comment

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

op-node is a single point of failure. What is the worst case that can happen because of that? Changes to code that are a single source of failure mean that bugs introduced become consensus, unless there is an explicit runbook with social layer buy in around rolling back the chain in case of a bug

Copy link
Author

Choose a reason for hiding this comment

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

Added some brief discussion on this

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you!

address can be configured to the address of a contract, the contract cannot stop batches from being ingested by the derivation pipeline, because **the derivation pipeline does not check revert status of transactions**. Thus, even if the contract reverts, the reverting transactions can still end up included in an L1 block, and the derivation pipeline will still parse and execute their calldata or
blob data.

## Proposed Solution
Copy link
Contributor

@tynes tynes Mar 25, 2025

Choose a reason for hiding this comment

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

Right now its not possible to reconfigure the batch inbox and existing chains generally send to an address with no know private key. Any thoughts on how to handle this?

  • Enable ability to modify batch inbox address dynamically
  • Only allow new chains to use this feature?

Copy link
Author

Choose a reason for hiding this comment

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

Hmm so your saying it's not currently possible to do a chain upgrade to change the inbox address? If not we would definitely want to add this ability

Copy link
Contributor

Choose a reason for hiding this comment

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

It is not currently possible for a chain to change its batch inbox. It is hardcoded as part of the chains genesis config

Copy link
Author

Choose a reason for hiding this comment

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

Gotcha, I'll work on adding this, thanks

Copy link
Author

Choose a reason for hiding this comment

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

@tynes it looks like the inbox address is currently read from the system config contract, so we propose simply adding an owner-only function to set this address in the contract. Does that work? 2139117

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