Skip to content
Merged
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
11 changes: 6 additions & 5 deletions crates/op-rbuilder/src/args/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,15 @@ pub struct FlashblocksArgs {
)]
pub flashblocks_block_time: u64,

/// Enabled dynamic flashblocks adjustment. This will allow account for late FCUs and produce
/// less flashblocks, while each flashblock would be bigger.
/// Builder would always thry to produce fixed number of flashblocks without regard to time of
/// FCU arrival.
/// In cases of late FCU it could lead to partially filled blocks.
#[arg(
long = "flashblocks.dynamic",
long = "flashblocks.fixed",
default_value = "false",
env = "FLASHBLOCK_DYNAMIC"
env = "FLASHBLOCK_FIXED"
)]
pub flashblocks_dynamic: bool,
pub flashblocks_fixed: bool,

/// Time by which blocks would be completed earlier in milliseconds.
///
Expand Down
18 changes: 12 additions & 6 deletions crates/op-rbuilder/src/builders/flashblocks/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ pub struct FlashblocksConfig {
pub interval: Duration,

/// How much time would be deducted from block build time to account for latencies in
/// milliseconds
/// milliseconds.
///
/// If dynamic_adjustment is false this value would be deducted from first flashblock and
/// it shouldn't be more than interval
///
/// If dynamic_adjustment is true this value would be deducted from first flashblock and
/// it shouldn't be more than interval
pub leeway_time: Duration,

/// Enables dynamic flashblocks number based on FCU arrival time
pub dynamic_adjustment: bool,
/// Disables dynamic flashblocks number adjustment based on FCU arrival time
pub fixed: bool,
}

impl Default for FlashblocksConfig {
Expand All @@ -30,7 +36,7 @@ impl Default for FlashblocksConfig {
ws_addr: SocketAddr::new(Ipv4Addr::UNSPECIFIED.into(), 1111),
interval: Duration::from_millis(250),
leeway_time: Duration::from_millis(50),
dynamic_adjustment: false,
fixed: false,
}
}
}
Expand All @@ -48,13 +54,13 @@ impl TryFrom<OpRbuilderArgs> for FlashblocksConfig {

let leeway_time = Duration::from_millis(args.flashblocks.flashblocks_leeway_time);

let dynamic_adjustment = args.flashblocks.flashblocks_dynamic;
let fixed = args.flashblocks.flashblocks_fixed;

Ok(Self {
ws_addr,
interval,
leeway_time,
dynamic_adjustment,
fixed,
})
}
}
Expand Down
Loading
Loading