Skip to content

Commit 4933c58

Browse files
committed
remove the option for standard building
1 parent d6597c9 commit 4933c58

File tree

3 files changed

+6
-50
lines changed

3 files changed

+6
-50
lines changed

src/args.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,16 @@ pub struct FlashblocksArgs {
7878

7979
/// Enables flashblocks publishing on the specified WebSocket address.
8080
/// If no address is specified defaults to 0.0.0.0:10111.
81+
///
82+
/// TODO: Rename this flag
8183
#[arg(
8284
long = "flashblocks",
8385
name = "WS_ADDRESS",
8486
env = "FLASHBLOCKS_WS_ADDRESS",
8587
num_args = 0..=1,
8688
default_missing_value = "0.0.0.0:10111"
8789
)]
88-
enabled: Option<SocketAddr>,
90+
pub enabled: Option<SocketAddr>,
8991

9092
/// Should we calculate the state root for each flashblock
9193
#[arg(
@@ -107,11 +109,6 @@ impl Default for BuilderArgs {
107109
}
108110

109111
impl FlashblocksArgs {
110-
/// Returns true if flashblocks are enabled.
111-
pub fn enabled(&self) -> bool {
112-
self.enabled.is_some()
113-
}
114-
115112
/// Returns the WebSocket address for flashblocks publishing socket.
116113
pub fn ws_address(&self) -> Option<SocketAddr> {
117114
self.enabled

src/main.rs

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -79,49 +79,6 @@ fn main() {
7979
fn build_pipeline(
8080
cli_args: &BuilderArgs,
8181
pool: &OrderPool<Flashblocks>,
82-
) -> eyre::Result<Pipeline<Flashblocks>> {
83-
let pipeline = if cli_args.flashblocks_args.enabled() {
84-
build_flashblocks_pipeline(cli_args, pool)?
85-
} else {
86-
build_classic_pipeline(cli_args, pool)
87-
};
88-
pool.attach_pipeline(&pipeline);
89-
90-
Ok(pipeline)
91-
}
92-
93-
/// Classic block builder
94-
///
95-
/// Block building strategy that builds blocks using the classic approach by
96-
/// producing one block payload per CL payload job.
97-
fn build_classic_pipeline(
98-
cli_args: &BuilderArgs,
99-
pool: &OrderPool<Flashblocks>,
100-
) -> Pipeline<Flashblocks> {
101-
if cli_args.revert_protection {
102-
Pipeline::<Flashblocks>::named("classic")
103-
.with_prologue(OptimismPrologue)
104-
.with_pipeline(
105-
Loop,
106-
(
107-
AppendOrders::from_pool(pool),
108-
OrderByPriorityFee::default(),
109-
RemoveRevertedTransactions::default(),
110-
),
111-
)
112-
} else {
113-
Pipeline::<Flashblocks>::named("classic")
114-
.with_prologue(OptimismPrologue)
115-
.with_pipeline(
116-
Loop,
117-
(AppendOrders::from_pool(pool), OrderByPriorityFee::default()),
118-
)
119-
}
120-
}
121-
122-
fn build_flashblocks_pipeline(
123-
cli_args: &BuilderArgs,
124-
pool: &OrderPool<Flashblocks>,
12582
) -> eyre::Result<Pipeline<Flashblocks>> {
12683
let socket_address = cli_args
12784
.flashblocks_args
@@ -191,7 +148,9 @@ fn build_flashblocks_pipeline(
191148
.with_step(BreakAfterMaxFlashblocks::new(flashblock_number)),
192149
)
193150
.with_limits(Scaled::default().deadline(total_building_time));
151+
194152
ws.watch_shutdown(&pipeline);
153+
pool.attach_pipeline(&pipeline);
195154

196155
Ok(pipeline)
197156
}

src/tests/args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn test_leeway_time_with_flashblocks_enabled() {
7272
if let Commands::Node(node_command) = args.command {
7373
let flashblocks_args = &node_command.ext.flashblocks_args;
7474
assert_eq!(flashblocks_args.leeway_time, Duration::from_millis(150));
75-
assert!(flashblocks_args.enabled());
75+
assert!(flashblocks_args.enabled.is_some());
7676
assert_eq!(
7777
flashblocks_args.ws_address().unwrap().to_string(),
7878
"127.0.0.1:8080"

0 commit comments

Comments
 (0)