Conversation
d83dffd to
cbe4b7a
Compare
895a4a2 to
d45b137
Compare
| fb_payload.base = None; | ||
|
|
||
| let best_gas_used = best.as_ref().map_or(0, |b| b.gas_used); | ||
| let is_new_best = |
There was a problem hiding this comment.
why "better" is cumulative_gas_used instead of priority fee tips?
There was a problem hiding this comment.
my intuition is that the candidate know how to order to i.e. maximize prio fee; but the outer candidate loop only try to maximize filling blocks. But there may be cases where best candidate is selected when we had a better one in terms of fees
There was a problem hiding this comment.
what if a tx comes in with high fees during flashblock block building, txs with high gas usage would be prioritized over the high fee tx no? I think we should always use priority fee as the metric as a better block
d45b137 to
3435df5
Compare
|
|
||
| let metrics = Arc::new(OpRBuilderMetrics::default()); | ||
| let task_metrics = Arc::new(FlashblocksTaskMetrics::new()); | ||
| let pool_change_epoch = Arc::new(AtomicU64::new(0)); |
There was a problem hiding this comment.
What is the purpose of this pool change atomic?
|
did you push your changes correctly? don't see code changes for comments |
📝 Summary
Adds a continuous flashblock building mode (under
--flashblocks.continuous-buildflag) that pre-seals candidates between scheduler triggers, so the best block is ready for instant publish when the timer fires.Built on top of #438
How it works
cumulative_gas_used)pool_change_epochfrom a pool event listener)fb_cancelfires (scheduler trigger), the loop exits and returns the best candidateDetails
AddressGasLimiterwrapsArc<DashMap>, newsnapshot()/restore()methods deep-copy the token buckets so each candidate starts with the same gas budgetPendingandReplacedpool events, incrementing anAtomicU64epoch. The candidate loop skips rebuilds when the epoch hasn't changedState<DB>from(CacheState, TransitionState)+state_by_block_hashsinceStateisn'tSend.build_blockis designed to leavetransition_stateintact (saves/restores it internally)BestCandidatestruct: All best-candidate state (cache, transitions, info, committed txs, sealed payload) grouped in a single struct, all updates are structurally enforced to be in same locksteppublish_and_spawn_nextfunction: returnsFlashblockAction::Continue { fb_span, build_rx, build_start }orExitreserve_builder_tx_budgethelper: Shared between sequential and continuous paths, adjusts gas/DA/uncompressed limits for bottom-of-block builder txsnext_after_seal: Shared between sequential and continuous paths, encapsulates the DA/gas limit advancement for the next flashblockcontinuous_build_duration,candidate_staleness,continuous_candidates_evaluated,continuous_candidates_improved