Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
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
645 changes: 87 additions & 558 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.2.13"
version = "0.2.14"
edition = "2024"
rust-version = "1.88"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -161,17 +161,14 @@ alloy-trie = { version = "0.9.1" }

alloy-hardforks = "0.4.4"

# rollup-boost
rollup-boost = { git = "https://github.com/flashbots/rollup-boost", tag = "v0.7.11" }

# optimism
alloy-op-evm = { version = "0.23.0", default-features = false }
alloy-op-hardforks = "0.4.4"
op-alloy-rpc-types = { version = "0.22.0", default-features = false }
op-alloy-rpc-types-engine = { version = "0.22.0", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.22.0", default-features = false }
op-alloy-network = { version = "0.22.0", default-features = false }
op-alloy-consensus = { version = "0.22.0", default-features = false }
op-alloy-rpc-types = { version = "0.22.4", default-features = false }
op-alloy-rpc-types-engine = { version = "0.22.4", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.22.4", default-features = false }
op-alloy-network = { version = "0.22.4", default-features = false }
op-alloy-consensus = { version = "0.22.4", default-features = false }
op-alloy-flz = { version = "0.13.1", default-features = false }

async-trait = { version = "0.1.83" }
Expand Down
4 changes: 1 addition & 3 deletions crates/op-rbuilder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,12 @@ rand = "0.9.0"
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json"] }
shellexpand = "3.1"
serde_yaml = { version = "0.9" }
moka = "0.12"
moka = { version = "0.12", features = ["future"] }
http = "1.0"
sha3 = "0.10"
reqwest = "0.12.23"
k256 = "0.13.4"

rollup-boost.workspace = true

nanoid = { version = "0.4", optional = true }
reth-ipc = { workspace = true, optional = true }
tar = { version = "0.4", optional = true }
Expand Down
31 changes: 30 additions & 1 deletion crates/op-rbuilder/src/args/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub struct FlashblocksArgs {
/// building time before calculating number of fbs.
#[arg(
long = "flashblocks.leeway-time",
default_value = "75",
default_value = "0",
env = "FLASHBLOCK_LEEWAY_TIME"
)]
pub flashblocks_leeway_time: u64,
Expand Down Expand Up @@ -183,6 +183,35 @@ pub struct FlashblocksArgs {
)]
pub flashblocks_number_contract_use_permit: bool,

/// Build flashblock at the end of the flashblock interval
#[arg(
long = "flashblocks.build-at-interval-end",
env = "FLASHBLOCK_BUILD_AT_INTERVAL_END",
default_value = "false"
)]
pub flashblocks_build_at_interval_end: bool,

/// Offset in milliseconds for when to send flashblocks.
/// Positive values send late, negative values send early.
/// Example: -20 sends 20ms early, 20 sends 20ms late.
#[arg(
long = "flashblocks.send-offset-ms",
env = "FLASHBLOCK_SEND_OFFSET_MS",
default_value = "0",
allow_hyphen_values = true
)]
pub flashblocks_send_offset_ms: i64,

/// Time in milliseconds to build the last flashblock early before the end of the slot
/// This serves as a buffer time to account for the last flashblock being delayed
/// at the end of the slot due to processing the final block
#[arg(
long = "flashblocks.end-buffer-ms",
env = "FLASHBLOCK_END_BUFFER_MS",
default_value = "0"
)]
pub flashblocks_end_buffer_ms: u64,

/// Flashblocks p2p configuration
#[command(flatten)]
pub p2p: FlashblocksP2pArgs,
Expand Down
37 changes: 26 additions & 11 deletions crates/op-rbuilder/src/builders/flashblocks/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,21 @@ pub struct FlashblocksConfig {
/// The address of the flashblocks number contract.
///
/// If set a builder tx will be added to the start of every flashblock instead of the regular builder tx.
pub flashblocks_number_contract_address: Option<Address>,
pub number_contract_address: Option<Address>,

/// whether to use permit signatures for the contract calls
pub flashblocks_number_contract_use_permit: bool,
pub number_contract_use_permit: bool,

/// Build flashblock at the end of the flashblock interval
pub build_at_interval_end: bool,

/// Offset in milliseconds for when to send flashblocks.
/// Positive values send late, negative values send early.
pub send_offset_ms: i64,

/// Time in milliseconds to build the last flashblock early before the end of the slot.
/// This serves as a buffer time to account for the last flashblock being delayed.
pub end_buffer_ms: u64,

/// Whether to enable the p2p node for flashblocks
pub p2p_enabled: bool,
Expand All @@ -63,11 +74,14 @@ impl Default for FlashblocksConfig {
Self {
ws_addr: SocketAddr::new(Ipv4Addr::UNSPECIFIED.into(), 1111),
interval: Duration::from_millis(250),
leeway_time: Duration::from_millis(50),
leeway_time: Duration::from_millis(0),
fixed: false,
disable_state_root: false,
flashblocks_number_contract_address: None,
flashblocks_number_contract_use_permit: false,
number_contract_address: None,
number_contract_use_permit: false,
build_at_interval_end: false,
send_offset_ms: 0,
end_buffer_ms: 0,
p2p_enabled: false,
p2p_port: 9009,
p2p_private_key_file: None,
Expand All @@ -94,20 +108,21 @@ impl TryFrom<OpRbuilderArgs> for FlashblocksConfig {

let disable_state_root = args.flashblocks.flashblocks_disable_state_root;

let flashblocks_number_contract_address =
args.flashblocks.flashblocks_number_contract_address;
let number_contract_address = args.flashblocks.flashblocks_number_contract_address;

let flashblocks_number_contract_use_permit =
args.flashblocks.flashblocks_number_contract_use_permit;
let number_contract_use_permit = args.flashblocks.flashblocks_number_contract_use_permit;

Ok(Self {
ws_addr,
interval,
leeway_time,
fixed,
disable_state_root,
flashblocks_number_contract_address,
flashblocks_number_contract_use_permit,
number_contract_address,
number_contract_use_permit,
build_at_interval_end: args.flashblocks.flashblocks_build_at_interval_end,
send_offset_ms: args.flashblocks.flashblocks_send_offset_ms,
end_buffer_ms: args.flashblocks.flashblocks_end_buffer_ms,
p2p_enabled: args.flashblocks.p2p.p2p_enabled,
p2p_port: args.flashblocks.p2p.p2p_port,
p2p_private_key_file: args.flashblocks.p2p.p2p_private_key_file,
Expand Down
Loading
Loading