|
18 | 18 | }, |
19 | 19 | reth_optimism_rpc::OpEthApiBuilder, |
20 | 20 | std::sync::Arc, |
21 | | - tracing::warn, |
22 | 21 | }; |
23 | 22 |
|
24 | 23 | mod args; |
@@ -96,54 +95,45 @@ fn build_pipeline( |
96 | 95 |
|
97 | 96 | let ws = Arc::new(WebSocketSink::new(cli_args.flashblocks_args.ws_address)?); |
98 | 97 |
|
99 | | - let flashblock_building_pipeline_steps = if cli_args.revert_protection { |
100 | | - ( |
101 | | - AppendOrders::from_pool(pool).with_ok_on_limit(), |
102 | | - OrderByPriorityFee::default(), |
103 | | - RemoveRevertedTransactions::default(), |
104 | | - BreakAfterDeadline, |
105 | | - ) |
106 | | - .into_pipeline() |
107 | | - } else { |
108 | | - ( |
109 | | - AppendOrders::from_pool(pool).with_ok_on_limit(), |
110 | | - OrderByPriorityFee::default(), |
111 | | - BreakAfterDeadline, |
112 | | - ) |
113 | | - .into_pipeline() |
114 | | - }; |
115 | | - |
116 | | - let flashblock_building_pipeline_steps = if let Some(ref signer) = |
117 | | - cli_args.builder_signer |
118 | | - { |
119 | | - flashblock_building_pipeline_steps.with_epilogue( |
120 | | - BuilderEpilogue::with_signer(signer.clone().into()) |
121 | | - .with_message(|block| format!("Block Number: {}", block.number())), |
122 | | - ) |
123 | | - } else { |
124 | | - warn!("BUILDER_SECRET_KEY is not specified, skipping builder transactions"); |
125 | | - flashblock_building_pipeline_steps |
126 | | - }; |
127 | | - |
128 | 98 | // Multiple steps need to access flashblock number state, so we need to |
129 | 99 | // initialize it outside |
130 | 100 | let flashblock_number = Arc::new(FlashblockNumber::new()); |
131 | 101 |
|
132 | | - let pipeline = Pipeline::<Flashblocks>::named("flashblocks") |
| 102 | + let pipeline = Pipeline::<Flashblocks>::named("top") |
133 | 103 | .with_step(OptimismPrologue) |
134 | | - .with_step(FlashtestationsPrologue::try_new( |
135 | | - cli_args.flashtestations.clone(), |
136 | | - cli_args.builder_signer.clone(), |
137 | | - )?) |
| 104 | + .with_step_if( |
| 105 | + cli_args.flashtestations.flashtestations_enabled |
| 106 | + && cli_args.builder_signer.is_some(), |
| 107 | + FlashtestationsPrologue::try_new( |
| 108 | + cli_args.flashtestations.clone(), |
| 109 | + cli_args.builder_signer.clone().unwrap(), |
| 110 | + )?, |
| 111 | + ) |
138 | 112 | .with_pipeline( |
139 | 113 | Loop, |
140 | | - Pipeline::default() |
| 114 | + Pipeline::named("n_flashblocks") |
141 | 115 | .with_pipeline( |
142 | 116 | Once, |
143 | | - Pipeline::default() |
| 117 | + Pipeline::named("single_flashblock") |
144 | 118 | .with_pipeline( |
145 | 119 | Loop, |
146 | | - flashblock_building_pipeline_steps |
| 120 | + Pipeline::named("flashblock_steps") |
| 121 | + .with_step(AppendOrders::from_pool(pool).with_ok_on_limit()) |
| 122 | + .with_step(OrderByPriorityFee::default()) |
| 123 | + .with_step_if( |
| 124 | + cli_args.revert_protection, |
| 125 | + RemoveRevertedTransactions::default(), |
| 126 | + ) |
| 127 | + .with_step(BreakAfterDeadline) |
| 128 | + .with_epilogue_if( |
| 129 | + cli_args.builder_signer.is_some(), |
| 130 | + BuilderEpilogue::with_signer( |
| 131 | + cli_args.builder_signer.clone().unwrap().clone().into(), |
| 132 | + ) |
| 133 | + .with_message(|block| { |
| 134 | + format!("Block Number: {}", block.number()) |
| 135 | + }), |
| 136 | + ) |
147 | 137 | .with_epilogue(PublishFlashblock::new( |
148 | 138 | ws.clone(), |
149 | 139 | flashblock_number.clone(), |
|
0 commit comments