Skip to content
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f50174a
wire backurn bundle pool
dvush Feb 9, 2026
5fadf60
maintain pool stubs
dvush Feb 9, 2026
cb11535
separate per block pool and global pool
dvush Feb 10, 2026
2ea14d7
work
dvush Feb 10, 2026
299cac2
work
dvush Feb 10, 2026
7983fb2
better backrun commit
dvush Feb 11, 2026
45530c0
backrun metrics
dvush Feb 11, 2026
ea2611f
backrun bundles limits
dvush Feb 11, 2026
5d2d587
backrun tests
dvush Feb 12, 2026
f55763b
dynamic selection of backruns at a callsite
dvush Feb 12, 2026
77ef427
work
dvush Feb 12, 2026
32a80f0
add replacment uuid to backruns on API
dvush Feb 12, 2026
75e809c
logic for bundle replacements
dvush Feb 12, 2026
aadee97
backrun pool count metrics
dvush Feb 13, 2026
275247f
limit iteration in a hot path
dvush Feb 13, 2026
f55f9e7
precompute da size
dvush Feb 13, 2026
6f836e5
base fee estimation
dvush Feb 13, 2026
16b0c07
backrun processing time metric
dvush Feb 13, 2026
0420a7c
flashblock range
dvush Feb 13, 2026
8b5240b
improve payload pool handling
dvush Feb 13, 2026
468242f
aux tests
dvush Feb 13, 2026
3fec789
fmt
dvush Feb 13, 2026
c3a467e
lint
dvush Feb 13, 2026
dfb3521
backrun module docs
dvush Feb 13, 2026
c9cd292
+docs
dvush Feb 13, 2026
ad8703e
Merge remote-tracking branch 'origin/main' into backrun-bundles
dvush Feb 13, 2026
b3858aa
review tweaks
dvush Feb 13, 2026
31cb5eb
review fixes
dvush Feb 13, 2026
e836100
rename per_target -> per_transaction in args and some code
dvush Feb 19, 2026
0b08afc
remove useless pub from TransactionBuilder
dvush Feb 19, 2026
bc77741
separate pub into pub and pub(super) for backrun pool
dvush Feb 19, 2026
d343058
RPC -> Rpc
dvush Feb 19, 2026
ee8d4f9
use correct async_trait
dvush Feb 19, 2026
ba3fced
comment MaybeFlashblockIndex trait
dvush Feb 19, 2026
c2f6bdf
import BTreeSet
dvush Feb 19, 2026
a6cde52
block_number -> block_number_min, fix block range on rpc
dvush Feb 19, 2026
f38423f
const defaults in backrun args
dvush Feb 19, 2026
ff75e58
change iter in payload_pool
dvush Feb 19, 2026
561cd23
serde_with::skip_serializing_none
dvush Feb 19, 2026
b18b92e
use saturating_sub in rpc
dvush Feb 19, 2026
6971cc8
use const in test
dvush Feb 19, 2026
186915f
reject blob and deposit backrun transactions at RPC layer
dvush Feb 23, 2026
0a9ab0e
filter backruns by remaining block gas in get_backruns
dvush Feb 23, 2026
7e67c9e
move enabling backruns docs from mod.rs to args.rs
dvush Feb 23, 2026
12e34c2
rename bundle_count gauge and add counters for bundle adds/removals
dvush Feb 23, 2026
c8e1229
shorten backrun module log target to backrun_bundle
dvush Feb 23, 2026
99e804d
comments, rpc struct camel case
dvush Feb 24, 2026
9e348d4
simplify payload pool
dvush Feb 24, 2026
4a06dfc
more private structs
dvush Feb 24, 2026
9eec46d
Merge remote-tracking branch 'origin/main' into backrun-bundles
dvush Feb 24, 2026
0a5f30e
merge fixes
dvush Feb 24, 2026
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
6 changes: 4 additions & 2 deletions crates/op-rbuilder/src/args/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
//! clap [Args](clap::Args) for optimism rollup configuration

use crate::{
flashtestations::args::FlashtestationsArgs, gas_limiter::args::GasLimiterArgs,
tx_signer::Signer,
backrun_bundle::BackrunBundleArgs, flashtestations::args::FlashtestationsArgs,
gas_limiter::args::GasLimiterArgs, tx_signer::Signer,
};
use alloy_primitives::Address;
use anyhow::{Result, anyhow};
Expand Down Expand Up @@ -66,6 +66,8 @@ pub struct OpRbuilderArgs {
pub flashtestations: FlashtestationsArgs,
#[command(flatten)]
pub gas_limiter: GasLimiterArgs,
#[command(flatten)]
pub backrun_bundle: BackrunBundleArgs,
}

impl Default for OpRbuilderArgs {
Expand Down
57 changes: 57 additions & 0 deletions crates/op-rbuilder/src/backrun_bundle/args.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
use clap::Args;

const DEFAULT_BACKRUNS_ENABLED: bool = false;
const DEFAULT_MAX_CONSIDERED_PER_BLOCK: usize = 100;
const DEFAULT_MAX_LANDED_PER_BLOCK: usize = 100;
const DEFAULT_MAX_CONSIDERED_PER_TRANSACTION: usize = 10;
const DEFAULT_MAX_LANDED_PER_TRANSACTION: usize = 1;

#[derive(Debug, Clone, PartialEq, Eq, Args)]
pub struct BackrunBundleArgs {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too familiar with the performance considerations of evaluating backruns but will we always need caps on how many we consider or land? We could make these values optional and uncap them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backruns are inserted in the critical path of the builder so if you have too many backruns you will spend all you time trying them, its always good to have limits for that.

  • backruns_considered - this one is a strict cap on how many txs in the backrun path we try.
  • backruns_landed_per_transaction - this one is also important, we might cap it for product reasons and also for performance reasons since we skip trying more backruns for tx after the first successful one.
  • backruns_landed_per_block is kind of previous one but per block and I can see it be useful to balance backruns and mempool txs.

#[arg(long = "backruns.enabled", default_value_t = DEFAULT_BACKRUNS_ENABLED)]
pub backruns_enabled: bool,
#[arg(
long = "backruns.max_considered_backruns_per_block",
default_value_t = DEFAULT_MAX_CONSIDERED_PER_BLOCK
)]
pub max_considered_backruns_per_block: usize,
#[arg(long = "backruns.max_landed_backruns_per_block", default_value_t = DEFAULT_MAX_LANDED_PER_BLOCK)]
pub max_landed_backruns_per_block: usize,
#[arg(
long = "backruns.max_considered_backruns_per_transaction",
default_value_t = DEFAULT_MAX_CONSIDERED_PER_TRANSACTION
)]
pub max_considered_backruns_per_transaction: usize,
#[arg(
long = "backruns.max_landed_backruns_per_transaction",
default_value_t = DEFAULT_MAX_LANDED_PER_TRANSACTION
)]
pub max_landed_backruns_per_transaction: usize,
}

impl BackrunBundleArgs {
pub fn is_limit_reached(
&self,
block_backruns_considered: usize,
block_backruns_landed: usize,
tx_backruns_considered: usize,
tx_backruns_landed: usize,
) -> bool {
tx_backruns_considered >= self.max_considered_backruns_per_transaction
|| tx_backruns_landed >= self.max_landed_backruns_per_transaction
|| block_backruns_considered >= self.max_considered_backruns_per_block
|| block_backruns_landed >= self.max_landed_backruns_per_block
}
}

impl Default for BackrunBundleArgs {
fn default() -> Self {
Self {
backruns_enabled: DEFAULT_BACKRUNS_ENABLED,
max_considered_backruns_per_block: DEFAULT_MAX_CONSIDERED_PER_BLOCK,
max_landed_backruns_per_block: DEFAULT_MAX_LANDED_PER_BLOCK,
max_considered_backruns_per_transaction: DEFAULT_MAX_CONSIDERED_PER_TRANSACTION,
max_landed_backruns_per_transaction: DEFAULT_MAX_LANDED_PER_TRANSACTION,
}
}
}
Comment thread
dvush marked this conversation as resolved.
Loading
Loading