Skip to content

Clear pending Flashblocks on canonical catch-up and new metrics#65

Merged
danyalprout merged 1 commit intobase:mainfrom
DeluxeRaph:main
Aug 19, 2025
Merged

Clear pending Flashblocks on canonical catch-up and new metrics#65
danyalprout merged 1 commit intobase:mainfrom
DeluxeRaph:main

Conversation

@DeluxeRaph
Copy link
Copy Markdown
Contributor

Connects FlashblocksState to the canonical state stream so pending flashblocks are cleared when a canonical block with an equal or higher number is received. This uses a shared Arc<OnceCell<Arc<FlashblocksState>>> so both the ExEx listener and RPC module operate on the same state instance. Adds metrics to track pending snapshot height, flashblock index, and clear-on-catchup events.

Copy link
Copy Markdown
Collaborator

@danyalprout danyalprout left a comment

Choose a reason for hiding this comment

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

This looks great thanks, can we tweak the method name/signature. Regarding tests I wouldn't worry about it for now, we can handle that separately (I would like to make the state.rs stuff unit testable, but don't want to bloat this PR)

}
}

pub fn clear_on_canonical_catchup(&self, canonical_number: u64) {
Copy link
Copy Markdown
Collaborator

@danyalprout danyalprout Aug 14, 2025

Choose a reason for hiding this comment

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

Can we call this on_canonical_block_received and update the params to take the full block, this:

let flashblocks_enabled = flashblocks_rollup_args.flashblocks_enabled();
let op_node = OpNode::new(flashblocks_rollup_args.rollup_args.clone());

// Shared cell for a single FlashblocksState instance
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: redundant comment

.install_exex_if(flashblocks_enabled, "flashblocks-canon", {
let fb_cell = fb_cell.clone();
move |mut ctx| async move {
// Initialize or reuse the shared state (created with ctx.provider())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: redundant comment

@danyalprout
Copy link
Copy Markdown
Collaborator

I'm going to make these changes in a follow up PR

@danyalprout danyalprout merged commit 7266837 into base:main Aug 19, 2025
4 checks passed
danyalprout added a commit that referenced this pull request Aug 20, 2025
0xsimulacra pushed a commit to 0xsimulacra/base-node-reth that referenced this pull request Oct 1, 2025
Clear pending Flashblocks on canonical catch-up and new metrics
0xsimulacra pushed a commit to 0xsimulacra/base-node-reth that referenced this pull request Oct 1, 2025
danyalprout pushed a commit that referenced this pull request Feb 12, 2026
* spike

* move bundle logic inside

* support both

* better naming

* default kafka
refcell pushed a commit that referenced this pull request Feb 18, 2026
refcell pushed a commit that referenced this pull request Feb 18, 2026
mw2000 pushed a commit that referenced this pull request Mar 7, 2026
* zkl2oo contract cleanup

* rm storage header
mw2000 pushed a commit that referenced this pull request Mar 9, 2026
* zkl2oo contract cleanup

* rm storage header
mw2000 pushed a commit that referenced this pull request Mar 16, 2026
* zkl2oo contract cleanup

* rm storage header
haardikk21 pushed a commit that referenced this pull request Mar 17, 2026
* zkl2oo contract cleanup

* rm storage header
mw2000 pushed a commit that referenced this pull request Mar 19, 2026
* zkl2oo contract cleanup

* rm storage header
mw2000 pushed a commit that referenced this pull request Mar 23, 2026
* zkl2oo contract cleanup

* rm storage header
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