Skip to content

Commit 3861996

Browse files
committed
adding some instrumentation
1 parent df5e785 commit 3861996

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/tasks/env.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use signet_constants::SignetSystemConstants;
1414
use signet_sim::{HostEnv, RollupEnv};
1515
use tokio::{sync::watch, task::JoinHandle};
1616
use tokio_stream::StreamExt;
17-
use tracing::{Instrument, Span, debug, info_span};
17+
use tracing::{Instrument, Span, info_span, instrument};
1818
use trevm::revm::{
1919
context::BlockEnv,
2020
context_interface::block::BlobExcessGasAndPrice,
@@ -64,7 +64,6 @@ impl Environment {
6464

6565
/// Create a new [`AlloyDB`] for this environment using the given provider.
6666
pub fn alloy_db<N: Network, P: Provider<N>>(&self, provider: P) -> AlloyDB<N, P> {
67-
debug!(?self.prev_header.number, "Creating AlloyDB for block number");
6867
AlloyDB::new(provider, self.prev_header.number.into())
6968
}
7069
}
@@ -139,6 +138,7 @@ impl SimEnv {
139138
/// # Panics
140139
///
141140
/// This function will panic if not called within a Tokio runtime.
141+
#[instrument(skip(self, provider), fields(rollup_block_number = %self.prev_rollup_block_number()))]
142142
pub fn rollup_db(&self, provider: RuProvider) -> RollupAlloyDatabaseProvider {
143143
WrapDatabaseAsync::new(self.rollup.alloy_db(provider)).expect("in tokio runtime")
144144
}
@@ -148,6 +148,7 @@ impl SimEnv {
148148
/// # Panics
149149
///
150150
/// This function will panic if not called within a Tokio runtime.
151+
#[instrument(skip(self, provider), fields(host_block_number = %self.prev_host_block_number()))]
151152
pub fn host_db(&self, provider: HostProvider) -> HostAlloyDatabaseProvider {
152153
WrapDatabaseAsync::new(self.host.alloy_db(provider)).expect("in tokio runtime")
153154
}
@@ -213,6 +214,7 @@ impl EnvTask {
213214
}
214215

215216
/// Construct a [`BlockEnv`] for the next host block from the previous host header.
217+
#[instrument(skip(self, previous), fields(previous_number = %previous.number))]
216218
fn construct_host_env(&self, previous: Header) -> Environment {
217219
let env = BlockEnv {
218220
number: U256::from(previous.number + 1),
@@ -234,6 +236,7 @@ impl EnvTask {
234236
}
235237

236238
/// Construct a [`BlockEnv`] for the next rollup block from the previous block header.
239+
#[instrument(skip(self, previous), fields(previous_number = %previous.number))]
237240
fn construct_rollup_env(&self, previous: Header) -> Environment {
238241
let env = BlockEnv {
239242
number: U256::from(previous.number + 1),

src/tasks/submit/flashbots.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use alloy::{
1414
use eyre::OptionExt;
1515
use init4_bin_base::{deps::metrics::counter, utils::signer::LocalOrAws};
1616
use tokio::{sync::mpsc, task::JoinHandle};
17-
use tracing::{Instrument, debug, debug_span};
17+
use tracing::{Instrument, debug, debug_span, instrument};
1818

1919
/// Handles preparation and submission of simulated rollup blocks to the
2020
/// Flashbots relay as MEV bundles.
@@ -98,6 +98,7 @@ impl FlashbotsTask {
9898
///
9999
/// Creates a `SubmitPrep` instance to build the transaction, then fills
100100
/// and signs it using the host provider.
101+
#[instrument(skip(self), fields(sim_result_block_number = ?sim_result.block, sim_result_host_block_number = %sim_result.host_block_number()))]
101102
async fn prepare_signed_transaction(
102103
&self,
103104
sim_result: &SimResult,

0 commit comments

Comments
 (0)