fix(continuous): da budget and reverted bundle eviction#536
Open
julio4 wants to merge 2 commits into
Open
Conversation
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.
akundaz
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.