Skip to content

Commit e42ba53

Browse files
committed
refactor: pull submit logic into builder_helper module
- pulls the submit logic into its own module to prepare for addition of a Flashbots module and corresponding submission destination
1 parent 97165bf commit e42ba53

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

bin/builder.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use builder::{
22
config::BuilderConfig,
33
service::serve_builder,
4-
tasks::{block::sim::Simulator, cache::CacheTasks, metrics::MetricsTask, submit::SubmitTask},
4+
tasks::{
5+
block::sim::Simulator, cache::CacheTasks, metrics::MetricsTask, submit::BuilderHelperTask,
6+
},
57
};
68
use init4_bin_base::{
79
deps::tracing::{info, info_span},
@@ -44,7 +46,7 @@ async fn main() -> eyre::Result<()> {
4446
let (tx_channel, metrics_jh) = metrics.spawn();
4547

4648
// Make a Tx submission task
47-
let submit = SubmitTask {
49+
let submit = BuilderHelperTask {
4850
zenith,
4951
quincey,
5052
config: config.clone(),
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mod submit;
2+
pub use submit::{BuilderHelperTask, ControlFlow};

src/tasks/submit/task.rs renamed to src/tasks/submit/builder_helper/submit.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ pub enum ControlFlow {
100100
Done,
101101
}
102102

103-
/// Submits sidecars in ethereum txns to mainnet ethereum
103+
/// Submits rollup blocks as blob sidecars in ethereum txns to
104+
/// mainnet ethereum by crafting a `BuilderHelper` contract call.
104105
#[derive(Debug)]
105-
pub struct SubmitTask {
106+
pub struct BuilderHelperTask {
106107
/// Zenith
107108
pub zenith: ZenithInstance,
108109
/// Quincey
@@ -115,7 +116,7 @@ pub struct SubmitTask {
115116
pub outbound_tx_channel: mpsc::UnboundedSender<TxHash>,
116117
}
117118

118-
impl SubmitTask {
119+
impl BuilderHelperTask {
119120
/// Get the provider from the zenith instance
120121
const fn provider(&self) -> &HostProvider {
121122
self.zenith.provider()

src/tasks/submit/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ pub use prep::{Bumpable, SubmitPrep};
44
mod sim_err;
55
pub use sim_err::{SimErrorResp, SimRevertKind};
66

7-
mod task;
8-
pub use task::{ControlFlow, SubmitTask};
7+
mod builder_helper;
8+
pub use builder_helper::{BuilderHelperTask, ControlFlow};

0 commit comments

Comments
 (0)