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

feat(driver): standalone driver context #77

Merged
merged 9 commits into from
Sep 8, 2024
Merged

Conversation

merklefruit
Copy link
Collaborator

Overview

Introduces a StandaloneDriver implementation that uses an L1 rpc url to fetch block updates.

Meta

@merklefruit merklefruit added C-enhancement New feature or request A-rollup Area: rollup crate labels Sep 2, 2024
@merklefruit merklefruit self-assigned this Sep 2, 2024
Copy link
Collaborator

@refcell refcell left a comment

Choose a reason for hiding this comment

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

Overall great work

Comment on lines 69 to 73
/// When the L1 undergoes a reorg, we need to reset the cursor to the fork block.
/// This is the last L1 block for which we have a corresponding L2 block in the cache.
///
/// Returns the (L2 block info, L1 origin block info) tuple for the new cursor state.
pub fn reset(&mut self, fork_block: u64) -> (BlockInfo, BlockInfo) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The issue here is still that technically L2 blocks are broken up into channels and frames that can overlap. The current batcher policy is posting frames sequentially but it can be that frames from L2 block #5 are posted to L1 before any frames from L2 block #4.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If I'm understanding this right, the way this reset works is it's trying to get the (L1 origin, L2 block) pair prior to the reorg and then start derivation for the next l2 blocks from there.

@merklefruit merklefruit force-pushed the nico/feat/l1-listener branch from 15221cd to b5386e3 Compare September 3, 2024 18:17
Copy link
Collaborator

@refcell refcell left a comment

Choose a reason for hiding this comment

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

I think it's ok to start with this for now and improve it incrementally.

@merklefruit merklefruit force-pushed the nico/feat/l1-listener branch from b5386e3 to b92ccc5 Compare September 5, 2024 20:35
merklefruit added a commit that referenced this pull request Sep 8, 2024
This PR introduces a first iteration of the pipeline `step`
functionality.

The pipeline will try to advance as long as there are new derived
payloads,
and then it will wait for a new L1 notification before trying again.

- closes #71 (first iteration, anyway)

Stack:

- #77 
  - #85 
    - 👉 #86
This PR fixes all dependency-related compile errors, mainly due to
changes to location of types in different crates.
It also pins `op-alloy`, `kona` and `superchain` deps allow us to work
on a stable trunk until the type migration is done.

Also removed `ssz_rs` in favor of `ethereum_ssz`, as with the new alloy
version we can't access it from `private::`.

- closes #83 

Stack:

- #77 
  - 👉 #85 
    - #86
@merklefruit merklefruit marked this pull request as ready for review September 8, 2024 17:24
@merklefruit merklefruit merged commit 9ccbc38 into main Sep 8, 2024
11 checks passed
@merklefruit merklefruit deleted the nico/feat/l1-listener branch September 8, 2024 17:36
merklefruit added a commit that referenced this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rollup Area: rollup crate C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(rollup): Standalone Driver Context
2 participants