Skip to content

Commit 8c2d655

Browse files
committed
logs
1 parent bbf83ce commit 8c2d655

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

crates/sim/src/env.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use tokio::{
99
select,
1010
sync::{mpsc, watch},
1111
};
12-
use tracing::{instrument, trace, trace_span};
12+
use tracing::{debug, error, instrument, trace, trace_span};
1313
use trevm::{
1414
db::{cow::CacheOnWrite, TryCachingDb},
1515
helpers::Ctx,
@@ -285,17 +285,15 @@ where
285285
.unwrap_or_default();
286286
let score = beneficiary_balance.saturating_sub(initial_beneficiary_balance);
287287

288-
trace!(
289-
gas_used = gas_used,
290-
score = %score,
288+
debug!(
289+
gas_used,
290+
%score,
291291
reverted = !success,
292292
halted,
293293
halt_reason = ?if halted { halt_reason } else { None },
294294
revert_reason = if !success { reason } else { None },
295295
"Simulation complete"
296296
);
297-
298-
// Create the outcome
299297
Ok(SimOutcomeWithCache { identifier, score, cache, gas_used })
300298
}
301299
Err(e) => Err(SignetEthBundleError::from(e.into_error())),
@@ -318,15 +316,18 @@ where
318316
// Run the bundle
319317
let trevm = match driver.run_bundle(trevm) {
320318
Ok(result) => result,
321-
Err(e) => return Err(e.into_error()),
319+
Err(e) => {
320+
error!(?e, "run bundle returned an error");
321+
return Err(e.into_error());
322+
}
322323
};
323324

324325
// Build the SimOutcome
325326
let score = driver.beneficiary_balance_increase();
326327
let gas_used = driver.total_gas_used();
327328
let cache = trevm.into_db().into_cache();
328329

329-
trace!(
330+
debug!(
330331
gas_used = gas_used,
331332
score = %score,
332333
"Bundle simulation successful"
@@ -384,10 +385,10 @@ where
384385
let _ = c.blocking_send(candidate);
385386
return;
386387
}
387-
trace!(gas_used = candidate.gas_used, max_gas, "Gas limit exceeded");
388+
debug!(gas_used = candidate.gas_used, max_gas, "Gas limit exceeded");
388389
}
389390
Err(e) => {
390-
trace!(?identifier, ?e, "Simulation failed");
391+
debug!(?identifier, ?e, "Simulation failed");
391392
}
392393
};
393394
// fall through applies to all errors, occurs if

0 commit comments

Comments
 (0)