Skip to main content

payload_budget_decision

Function payload_budget_decision 

Source
pub(crate) fn payload_budget_decision(
    elapsed: Duration,
    idle_elapsed: Duration,
    multiplier: u64,
    marshal_persist: MarshalPersistEstimator,
    block_size_bytes: usize,
    validation_latency: Option<ValidationLatencyEstimate>,
    current_workload: ValidationLatencyWorkload,
) -> PayloadBudgetDecision
Expand description

Builds the shared proposer/validator budget decision for the current payload.

elapsed is wall-clock time spent in the builder so far. idle_elapsed is the proposer-only time spent waiting for more transactions, which is not replayed by validators and therefore counts once. validation_latency is an estimate of validator-side replay work from previously validated proposals. If no latency estimate is usable for the current workload, the validator reserve falls back to predicted_builder_work, which is the replayable proposer work projected from this build. current_workload describes the block currently being assembled.

The budget is not split into fixed leader/validator buckets. Instead, we charge proposer idle once, projected builder work once, learned validator work once capped at the conservative builder-work projection, and marshal persistence once for each side.