Skip to content

Commit bcb40aa

Browse files
committed
Fix builder tx cumulative da
1 parent e335539 commit bcb40aa

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

crates/op-rbuilder/src/builders/builder_tx.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ pub trait BuilderTransactions<ExtraCtx: Debug + Default = (), Extra: Debug + Def
235235
// Add gas used by the transaction to cumulative gas used, before creating the receipt
236236
let gas_used = result.gas_used();
237237
info.cumulative_gas_used += gas_used;
238+
info.cumulative_da_bytes_used += builder_tx.da_size;
238239

239240
let ctx = ReceiptBuilderCtx {
240241
tx: builder_tx.signed_tx.inner(),

crates/op-rbuilder/src/builders/flashblocks/payload.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@ where
298298

299299
// We log only every 100th block to reduce usage
300300
let span = if cfg!(feature = "telemetry")
301-
&& config.parent_header.number % self.config.sampling_ratio == 0
301+
&& config
302+
.parent_header
303+
.number
304+
.is_multiple_of(self.config.sampling_ratio)
302305
{
303306
span!(Level::INFO, "build_payload")
304307
} else {
@@ -362,7 +365,6 @@ where
362365
// We subtract gas limit and da limit for builder transaction from the whole limit
363366
let builder_tx_gas = builder_txs.iter().fold(0, |acc, tx| acc + tx.gas_used);
364367
let builder_tx_da_size: u64 = builder_txs.iter().fold(0, |acc, tx| acc + tx.da_size);
365-
info.cumulative_da_bytes_used += builder_tx_da_size;
366368

367369
let (payload, fb_payload) = build_block(
368370
&mut state,
@@ -639,7 +641,6 @@ where
639641

640642
let builder_tx_gas = builder_txs.iter().fold(0, |acc, tx| acc + tx.gas_used);
641643
let builder_tx_da_size: u64 = builder_txs.iter().fold(0, |acc, tx| acc + tx.da_size);
642-
info.cumulative_da_bytes_used += builder_tx_da_size;
643644
target_gas_for_batch = target_gas_for_batch.saturating_sub(builder_tx_gas);
644645

645646
// saturating sub just in case, we will log an error if da_limit too small for builder_tx_da_size

crates/op-rbuilder/src/builders/standard/payload.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ impl<Txs: PayloadTxsBounds> OpBuilder<'_, Txs> {
375375
}
376376
// Save some space in the block_da_limit for builder tx
377377
let builder_tx_da_size = builder_txs.iter().fold(0, |acc, tx| acc + tx.da_size);
378-
info.cumulative_da_bytes_used += builder_tx_da_size;
379378
let block_da_limit = ctx
380379
.da_config
381380
.max_da_block_size()

0 commit comments

Comments
 (0)