Skip to content
Merged
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
49 changes: 29 additions & 20 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,28 +147,37 @@ fn build_flashblocks_pipeline(
// in limits
let max_flashblocks = Arc::new(AtomicU64::new(0));

let flashblock_building_pipeline_steps = (
AppendOrders::from_pool(pool).with_ok_on_limit(),
OrderByPriorityFee::default(),
RemoveRevertedTransactions::default(),
BreakAfterDeadline,
)
.into_pipeline();

let flashblock_building_pipeline_steps =
if let Some(ref signer) = cli_args.builder_signer {
flashblock_building_pipeline_steps
.with_epilogue(BuilderEpilogue::with_signer(signer.clone().into()))
} else {
flashblock_building_pipeline_steps
};

let flashblock_building_pipeline = flashblock_building_pipeline_steps
.with_epilogue(PublishFlashblock::new(
&ws,
cli_args.flashblocks_args.calculate_state_root,
max_flashblocks.clone(),
))
.with_limits(FlashblockLimits::new(interval, max_flashblocks));

let block_building_pipeline = Pipeline::default()
.with_pipeline(Loop, flashblock_building_pipeline)
.with_step(BreakAfterDeadline);

let pipeline = Pipeline::<Flashblocks>::named("flashblocks")
.with_prologue(OptimismPrologue)
.with_pipeline(
Loop,
Pipeline::default()
.with_pipeline(
Loop,
(
AppendOrders::from_pool(pool).with_ok_on_limit(),
OrderByPriorityFee::default(),
RemoveRevertedTransactions::default(),
BreakAfterDeadline,
)
.with_epilogue(PublishFlashblock::new(
&ws,
cli_args.flashblocks_args.calculate_state_root,
max_flashblocks.clone(),
))
.with_limits(FlashblockLimits::new(interval, max_flashblocks)),
)
.with_step(BreakAfterDeadline),
)
.with_pipeline(Loop, block_building_pipeline)
.with_limits(Scaled::default().deadline(total_building_time));
ws.watch_shutdown(&pipeline);

Expand Down
Loading