Skip to content

fix(continuous): da budget and reverted bundle eviction#536

Open
julio4 wants to merge 2 commits into
mainfrom
fix/continuous-da-budget-and-bundle-eviction
Open

fix(continuous): da budget and reverted bundle eviction#536
julio4 wants to merge 2 commits into
mainfrom
fix/continuous-da-budget-and-bundle-eviction

Conversation

@julio4

@julio4 julio4 commented Jun 12, 2026

Copy link
Copy Markdown
Member

No description provided.

julio4 added 2 commits June 12, 2026 12:31
In continuous-build mode, `build_empty_flashblock_candidate` was reading
the DA budget directly from `fb_state` (un-reduced values) when computing
the next flashblock's DA window via `next_after_seal`. However,
`reserve_builder_tx_budget` had already reduced `target_da_for_batch` /
`target_da_footprint_for_batch` in-place in `build_continuous_flashblock`
before the empty candidate is built, to reserve DA headroom for
bottom-of-block builder txs. The legacy per-trigger path
(`build_next_flashblock`) correctly passes the reduced locals to
`next_after_seal`. When an empty candidate wins an interval (quiet pool),
the next flashblock's DA budget was therefore inflated by the full
builder-tx reservation, compounding across consecutive empty-wins.

Fix: pass the two already-reduced locals into `build_empty_flashblock_candidate`
as explicit parameters and use them in the `next_after_seal` call, matching
the legacy path exactly.
In the continuous candidate loop, reverted revert-protected bundle txs
were never removed from the pool. This caused them to be re-fetched and
re-simulated on every candidate of every subsequent block until pool
expiry, and `reverted_bundle_tx_hashes` grew monotonically across cloned
`ExecutionInfo`s since it was never drained.

Mirror the legacy path (`build_next_flashblock`): after
`best_txs.mark_committed` / `drop(best_txs)`, drain
`sim_info.reverted_bundle_tx_hashes` and call
`self.pool().remove_transactions(hashes)`. Removal is correct even if the
candidate is subsequently discarded — once a revert-protected tx reverts
against the current block state, eviction is always the right call.

Add integration tests:
- `continuous_reverted_bundle_tx_evicted_from_pool`: sends a reverting
  revert-protected bundle in continuous mode and asserts the tx is
  absent from the built block and receives a Discarded pool event.
- `smoke_continuous_empty_pool_all_flashblocks_in_order`: no-tx smoke
  exercising the empty-candidate-wins path (Fix A) end-to-end.
@julio4 julio4 changed the title Fix(continuous): da budget and reverted bundle eviction fix(continuous): da budget and reverted bundle eviction Jun 12, 2026
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