Skip to content

Commit 41b9b41

Browse files
committed
chore: clean up tracing a bit
1 parent cb34bc8 commit 41b9b41

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

bin/builder.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ use signet_sim::SimCache;
1111
use signet_types::SlotCalculator;
1212
use std::sync::Arc;
1313
use tokio::select;
14+
use tracing::info_span;
1415

1516
// Note: Must be set to `multi_thread` to support async tasks.
1617
// See: https://docs.rs/tokio/latest/tokio/attr.main.html
1718
#[tokio::main(flavor = "multi_thread")]
1819
async fn main() -> eyre::Result<()> {
1920
let _guard = init4_bin_base::init4();
20-
let init_span_guard = tracing::info_span!("builder initialization");
21+
let init_span_guard = info_span!("builder initialization");
2122

2223
let config = BuilderConfig::load_from_env()?.clone();
2324
let constants = config.load_pecorino_constants();

src/tasks/bundler.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use signet_bundle::SignetEthBundle;
77
use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel};
88
use tokio::task::JoinHandle;
99
use tokio::time;
10-
use tracing::{Instrument, debug, trace};
10+
use tracing::{Instrument, debug, trace, warn};
1111

1212
pub use crate::config::BuilderConfig;
1313

@@ -60,7 +60,7 @@ impl BundlePoller {
6060
pub async fn check_bundle_cache(&mut self) -> eyre::Result<Vec<Bundle>> {
6161
let bundle_url: Url = Url::parse(&self.config.tx_pool_url)?.join("bundles")?;
6262
let Some(token) = self.token.read() else {
63-
tracing::warn!("No token available, skipping bundle fetch");
63+
warn!("No token available, skipping bundle fetch");
6464
return Ok(vec![]);
6565
};
6666

src/tasks/submit.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,15 @@ pub struct SubmitTask {
7373
}
7474

7575
impl SubmitTask {
76+
#[instrument(skip(self))]
7677
async fn sup_quincey(&self, sig_request: &SignRequest) -> eyre::Result<SignResponse> {
7778
tracing::info!(
7879
host_block_number = %sig_request.host_block_number,
7980
ru_chain_id = %sig_request.ru_chain_id,
8081
"pinging quincey for signature"
8182
);
8283

83-
let Some(token) = self.token.read() else {
84-
tracing::error!("no token available");
85-
return Err(eyre!("no token available"));
86-
};
84+
let Some(token) = self.token.read() else { bail!("no token available") };
8785

8886
let resp: reqwest::Response = self
8987
.client

0 commit comments

Comments
 (0)