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(rollup): handle exex notifications #32

Closed
merklefruit opened this issue Aug 25, 2024 · 2 comments · Fixed by #57
Closed

feat(rollup): handle exex notifications #32

merklefruit opened this issue Aug 25, 2024 · 2 comments · Fixed by #57
Labels
A-hera Area: OP Stack Rollup node binary C-enhancement New feature or request

Comments

@merklefruit
Copy link
Collaborator

After initializing the pipeline, the main loop will involve taking incoming Chain notifications from the Driver and:

  • handling both the committed and reverted cases
  • updating the providers with the newly committed chain and blobs
  • sending the FinishedHeight notification to the Driver

here is a reference implementation:

async fn handle_exex_notification(
        &mut self,
        notification: ExExNotification,
        pipeline: &mut RollupPipeline,
    ) -> Result<()> {
        if let Some(reverted_chain) = notification.reverted_chain() {
            self.chain_provider.commit(reverted_chain.clone());
            let l1_block_info = info_from_header(&reverted_chain.tip().block);

            // handle the reverted chain...
        }

        if let Some(committed_chain) = notification.committed_chain() {
            let tip_number = committed_chain.tip().number;
            self.chain_provider.commit(committed_chain);

            if let Err(err) = self.ctx.events.send(ExExEvent::FinishedHeight(tip_number)) {
                bail!("Critical: Failed to send ExEx event: {:?}", err);
            }
        }

        Ok(())
    }
@shekhirin shekhirin added C-enhancement New feature or request A-hera Area: OP Stack Rollup node binary labels Aug 25, 2024
@GrapeBaBa
Copy link
Contributor

@merklefruit Could I try this one?

@merklefruit
Copy link
Collaborator Author

@merklefruit Could I try this one?

Hey, sorry I had already started a draft PR of this in #57, but forgot to tag it here. My bad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-hera Area: OP Stack Rollup node binary C-enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants