Skip to content

Commit 4d4a7b3

Browse files
authored
Add logs for builder tx (#25)
* little fix * little fix
1 parent f4fd514 commit 4d4a7b3

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/main.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use {
1515
},
1616
reth_optimism_rpc::OpEthApiBuilder,
1717
std::sync::{Arc, atomic::AtomicU64},
18+
tracing::warn,
1819
};
1920

2021
mod args;
@@ -155,13 +156,15 @@ fn build_flashblocks_pipeline(
155156
)
156157
.into_pipeline();
157158

158-
let flashblock_building_pipeline_steps =
159-
if let Some(ref signer) = cli_args.builder_signer {
160-
flashblock_building_pipeline_steps
161-
.with_epilogue(BuilderEpilogue::with_signer(signer.clone().into()))
162-
} else {
163-
flashblock_building_pipeline_steps
164-
};
159+
let flashblock_building_pipeline_steps = if let Some(ref signer) =
160+
cli_args.builder_signer
161+
{
162+
flashblock_building_pipeline_steps
163+
.with_epilogue(BuilderEpilogue::with_signer(signer.clone().into()))
164+
} else {
165+
warn!("BUILDER_SECRET_KEY is not specified, skipping builder transactions");
166+
flashblock_building_pipeline_steps
167+
};
165168

166169
let flashblock_building_pipeline = flashblock_building_pipeline_steps
167170
.with_epilogue(PublishFlashblock::new(

src/publish.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use {
3636
accept_async,
3737
tungstenite::{Message, Utf8Bytes},
3838
},
39-
tracing::{debug, trace},
39+
tracing::{debug, error, trace},
4040
};
4141

4242
/// Flashblocks pipeline step for publishing flashblocks to external
@@ -91,7 +91,7 @@ impl PublishFlashblock {
9191

9292
impl Step<Flashblocks> for PublishFlashblock {
9393
async fn step(
94-
self: std::sync::Arc<Self>,
94+
self: Arc<Self>,
9595
payload: Checkpoint<Flashblocks>,
9696
ctx: StepContext<Flashblocks>,
9797
) -> ControlFlow<Flashblocks> {
@@ -100,7 +100,7 @@ impl Step<Flashblocks> for PublishFlashblock {
100100
if self.flashblock_number.load(Ordering::Relaxed)
101101
>= self.max_flashblocks.load(Ordering::Relaxed)
102102
{
103-
tracing::trace!("Stopping flashblocks production");
103+
trace!("Stopping flashblocks production");
104104
// We have reached maximum number of flashblocks, stop sending them
105105
return ControlFlow::Break(payload);
106106
}
@@ -116,7 +116,7 @@ impl Step<Flashblocks> for PublishFlashblock {
116116

117117
let sealed_block = payload.build_payload();
118118
if let Err(e) = sealed_block {
119-
tracing::error!("Failed to build sealed block: {:?}", e);
119+
error!("Failed to build sealed block: {:?}", e);
120120
return ControlFlow::Break(payload);
121121
}
122122
let sealed_block = sealed_block.expect("sealed block is ok");

0 commit comments

Comments
 (0)