Skip to content

Commit 7c06c20

Browse files
vbuilder69420claude
andcommitted
perf: skip AccessListInspector when blocklist is empty
When the blocklist is empty and no used_state_tracer is active, bypass the RBuilderEVMInspector entirely and run the EVM with NoOpInspector. The AccessListInspector calls step() on every EVM opcode to track which addresses are accessed, solely to check them against the blocklist. Profiling shows this inspector overhead consumes ~52% of total CPU time during block building (AccessListInspector::step + Inspector::step + inspect_instructions). With this change, block fill time at 100 TPS drops from 98.8ms p50 to 53.0ms p50 (-46%), blocks built increases by 33%, and transactions included per slot increases by 31%. When a blocklist IS configured, the original code path with full inspector runs unchanged. Benchmark (builder-lab, 100 TPS contender, 60s profiling window): | Metric | Before | After | Change | |---------------------|----------|----------|--------| | Block fill p50 | 98.8ms | 53.0ms | -46% | | Block fill p95 | 144.9ms | 96.9ms | -33% | | E2E latency p50 | 101ms | 55ms | -46% | | Blocks submitted | 226 | 308 | +36% | | Txs included | 15,972 | 20,871 | +31% | Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c66f845 commit 7c06c20

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

crates/rbuilder/src/building/order_commit.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,25 @@ where
11621162
Factory: EvmFactory,
11631163
{
11641164
let tx = tx_with_blobs.internal_tx_unsecure();
1165+
1166+
// Fast path: when blocklist is empty and no used_state_tracer, skip the inspector entirely.
1167+
// The AccessListInspector calls step() on every EVM opcode which is ~50% of CPU time.
1168+
if blocklist.is_empty() && used_state_tracer.is_none() {
1169+
let mut evm = evm_factory.create_evm(db, evm_env);
1170+
let res = match evm.transact(tx) {
1171+
Ok(res) => res,
1172+
Err(err) => match err {
1173+
EVMError::Transaction(tx_err) => {
1174+
return Ok(Err(TransactionErr::InvalidTransaction(tx_err)))
1175+
}
1176+
EVMError::Database(_) | EVMError::Header(_) | EVMError::Custom(_) => {
1177+
return Err(err.into())
1178+
}
1179+
},
1180+
};
1181+
return Ok(Ok(res));
1182+
}
1183+
11651184
let mut rbuilder_inspector = RBuilderEVMInspector::new(tx, used_state_tracer);
11661185

11671186
let mut evm = evm_factory.create_evm_with_inspector(db, evm_env, &mut rbuilder_inspector);

0 commit comments

Comments
 (0)