Skip to content

Commit

Permalink
feat: additional debug tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
prestwich committed May 3, 2024
1 parent a3b920e commit f3e49c6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ async fn main() -> eyre::Result<()> {
.signer(EthereumSigner::from(wallet))
.on_builtin(&config.rpc_url)
.await?;
tracing::debug!(rpc_url = config.rpc_url.as_ref(), "connected to provider");
let zenith = Zenith::new(config.zenith, provider.clone());

let build = tasks::block::BlockBuilder { wait_secs: 5 };
Expand All @@ -85,6 +86,7 @@ async fn main() -> eyre::Result<()> {
};

let (submit_channel, submit_jh) = submit.spawn();

let (build_channel, build_jh) = build.spawn(submit_channel);

let server = serve_builder_with_span(build_channel, ([0, 0, 0, 0], 6969), span);
Expand Down
22 changes: 20 additions & 2 deletions crates/builder/src/tasks/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use alloy_signer::Signer;
use alloy_sol_types::SolCall;
use alloy_transport::BoxTransport;
use tokio::{sync::mpsc, task::JoinHandle, try_join};
use tracing::instrument;
use zenith_types::SignRequest;

use crate::Zenith::{self, ZenithInstance};
Expand Down Expand Up @@ -184,15 +185,32 @@ where
Ok(())
}

#[instrument(skip(self, in_progress), err)]
async fn handle_inbound(&self, in_progress: &InProgressBlock) -> eyre::Result<()> {
let sig_request = self.construct_sig_request(in_progress).await?;

tracing::debug!(
sequence = %sig_request.sequence,
confirm_by = %sig_request.confirm_by,
"constructed signature request"
);

// If configured with a local signer, we use it. Otherwise, we ask
// quincey (politely)
let signature = if let Some(signer) = &self.config.local_sequencer_signer {
signer.sign_hash(&sig_request.signing_hash()).await?
let sig = signer.sign_hash(&sig_request.signing_hash()).await?;
tracing::debug!(
sig = hex::encode(sig.as_bytes()),
"acquied signature from local signer"
);
sig
} else {
self.sup_quincey(&sig_request).await?
let sig = self.sup_quincey(&sig_request).await?;
tracing::debug!(
sig = hex::encode(sig.as_bytes()),
"acquied signature from quincey"
);
sig
};

self.submit_transaction(sig_request, &signature, in_progress)
Expand Down

0 comments on commit f3e49c6

Please sign in to comment.