@@ -80,54 +80,6 @@ fn build_pipeline(
8080 cli_args : & BuilderArgs ,
8181 pool : & OrderPool < Flashblocks > ,
8282) -> 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 > ,
125- ) -> eyre:: Result < Pipeline < Flashblocks > > {
126- let socket_address = cli_args
127- . flashblocks_args
128- . ws_address ( )
129- . expect ( "WebSocket address must be set for Flashblocks" ) ;
130-
13183 // how often a flashblock is published
13284 let interval = cli_args. flashblocks_args . interval ;
13385
@@ -139,7 +91,7 @@ fn build_flashblocks_pipeline(
13991 // building and the payload job deadline that is given by the CL.
14092 let total_building_time = Minus ( leeway_time) ;
14193
142- let ws = Arc :: new ( WebSocketSink :: new ( socket_address ) ?) ;
94+ let ws = Arc :: new ( WebSocketSink :: new ( cli_args . flashblocks_args . ws_address ) ?) ;
14395
14496 let flashblock_building_pipeline_steps = (
14597 AppendOrders :: from_pool ( pool) . with_ok_on_limit ( ) ,
@@ -191,7 +143,9 @@ fn build_flashblocks_pipeline(
191143 . with_step ( BreakAfterMaxFlashblocks :: new ( flashblock_number) ) ,
192144 )
193145 . with_limits ( Scaled :: default ( ) . deadline ( total_building_time) ) ;
146+
194147 ws. watch_shutdown ( & pipeline) ;
148+ pool. attach_pipeline ( & pipeline) ;
195149
196150 Ok ( pipeline)
197151}
0 commit comments