Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion crates/op-rbuilder/src/builders/standard/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ where
args: BuildArguments<OpPayloadBuilderAttributes<OpTransactionSigned>, OpBuiltPayload>,
best: impl FnOnce(BestTransactionsAttributes) -> Txs + Send + Sync + 'a,
) -> Result<BuildOutcome<OpBuiltPayload>, PayloadBuilderError> {
let block_build_start_time = Instant::now();

let BuildArguments {
mut cached_reads,
config,
Expand Down Expand Up @@ -254,6 +256,7 @@ where

let state_provider = self.client.state_by_block_hash(ctx.parent().hash())?;
let state = StateProviderDatabase::new(state_provider);
let metrics = ctx.metrics.clone();

if ctx.attributes().no_tx_pool {
let db = State::builder()
Expand All @@ -269,7 +272,13 @@ where
.build();
builder.build(db, ctx)
}
.map(|out| out.with_cached_reads(cached_reads))
.map(|out| {
metrics
.total_block_built_duration
.record(block_build_start_time.elapsed());

out.with_cached_reads(cached_reads)
})
}
}

Expand Down
Loading