-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(anvil): --disable-tracing
#7445
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this now needs to be propagated to
pub async fn with_genesis( |
and then eventually to the executor:
let executor = TransactionExecutor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we disable tracing we should skip the inspector entirely
let mut inspector = Inspector::default(); | ||
if !self.disable_tracing { | ||
inspector = inspector.with_tracing(); | ||
if self.enable_steps_tracing { | ||
inspector = inspector.with_steps_tracing(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can leave the setup as is, but if tracing is disabled we need to change this:
foundry_evm::utils::new_evm_with_inspector(&mut *self.db, env, &mut inspector);
to evm setup without inspector, which is always faster than with any inspector
match evm.transact_commit() { | ||
Ok(exec_result) => exec_result, | ||
Err(err) => { | ||
warn!(target: "backend", "[{:?}] failed to execute: {:?}", transaction.hash(), err); | ||
match err { | ||
EVMError::Database(err) => { | ||
return Some(TransactionExecutionOutcome::DatabaseError( | ||
transaction, | ||
err, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need the duplication here if we make the if else block return the result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue was building the evm
with different types, one with an inspector and one without.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need the duplication here if we make the if else block return the result?
@mattsse The if else block already returns the exec_result
.
let exec_result = if !self.disable_tracing { |
Would be great to get this updated / merged @yash-atreya when you have opportunity |
Motivation
Closes #7442
Solution
Add CLI arg
--disable-tracing
to disable all tx tracing in anvil. Default value isfalse
.