Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 9 additions & 3 deletions src/tasks/submit/flashbots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use alloy::{
use eyre::OptionExt;
use init4_bin_base::{deps::metrics::counter, utils::signer::LocalOrAws};
use tokio::{sync::mpsc, task::JoinHandle};
use tracing::{Instrument, debug, debug_span, error};
use tracing::{Instrument, debug, debug_span, error, instrument};

/// Handles preparation and submission of simulated rollup blocks to the
/// Flashbots relay as MEV bundles.
Expand Down Expand Up @@ -69,6 +69,7 @@ impl FlashbotsTask {
/// 2. Tracking the transaction hash for monitoring
/// 3. Encoding the transaction for bundle inclusion
/// 4. Constructing the complete bundle body
#[instrument(skip_all, level = "debug")]
async fn prepare_bundle(&self, sim_result: &SimResult) -> eyre::Result<MevSendBundle> {
// Prepare and sign the transaction
let block_tx = self.prepare_signed_transaction(sim_result).await?;
Expand All @@ -95,6 +96,7 @@ impl FlashbotsTask {
///
/// Creates a `SubmitPrep` instance to build the transaction, then fills
/// and signs it using the host provider.
#[instrument(skip_all, level = "debug")]
async fn prepare_signed_transaction(
&self,
sim_result: &SimResult,
Expand All @@ -107,7 +109,11 @@ impl FlashbotsTask {
);

let tx = prep.prep_transaction(sim_result.prev_host()).await?;
let sendable = self.host_provider().fill(tx.into_request()).await?;
let sendable = self
.host_provider()
.fill(tx.into_request())
.instrument(tracing::debug_span!("fill_tx").or_current())
.await?;

sendable.as_envelope().ok_or_eyre("failed to get envelope from filled tx").cloned()
}
Expand Down Expand Up @@ -159,7 +165,7 @@ impl FlashbotsTask {
break;
};

let span = sim_result.sim_env.clone_span();
let span = sim_result.clone_span();

// Don't submit empty blocks
if sim_result.block.is_empty() {
Expand Down
3 changes: 2 additions & 1 deletion src/tasks/submit/prep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use init4_bin_base::deps::metrics::counter;
use signet_sim::BuiltBlock;
use signet_types::{SignRequest, SignResponse};
use signet_zenith::Zenith;
use tracing::{Instrument, debug};
use tracing::{Instrument, debug, instrument};

/// Preparation logic for transactions issued to the host chain by the
/// [`SubmitTask`].
Expand Down Expand Up @@ -129,6 +129,7 @@ impl<'a> SubmitPrep<'a> {
}

/// Prepares a transaction for submission to the host chain.
#[instrument(skip_all, level = "debug")]
pub async fn prep_transaction(self, prev_host: &Header) -> eyre::Result<Bumpable> {
let req = self.new_tx_request().in_current_span().await?;
Ok(Bumpable::new(req, prev_host))
Expand Down