Skip to content
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

Improve debug_traceBlock performance #11066

Open
mattsse opened this issue Sep 20, 2024 · 2 comments
Open

Improve debug_traceBlock performance #11066

mattsse opened this issue Sep 20, 2024 · 2 comments
Assignees
Labels
C-enhancement New feature or request C-perf A change motivated by improving speed, memory usage or disk footprint D-complex Quite challenging from either a design or technical perspective Ask for help! D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Sep 20, 2024

Describe the feature

currently, trace_block is a loop over transactions and that invoke trace_transaction:

while let Some((index, tx)) = transactions.next() {
let tx_hash = tx.hash;
let env = EnvWithHandlerCfg {
env: Env::boxed(
cfg.cfg_env.clone(),
block_env.clone(),
Call::evm_config(this.eth_api()).tx_env(&tx),
),
handler_cfg: cfg.handler_cfg,
};
let (result, state_changes) = this.trace_transaction(

note how this clones the opts:

opts.clone(),

this results in some overhead:

https://docs.rs/revm-inspectors/latest/revm_inspectors/tracing/struct.TracingInspector.html#method.geth_builder

TODO

  • this should be improved in such a way that the allows us to reuse the internals

this could perhaps be done with a helper type for block tracing that keeps the TracingInspector or similar

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled D-good-first-issue Nice and easy! A great choice to get started C-perf A change motivated by improving speed, memory usage or disk footprint D-complex Quite challenging from either a design or technical perspective Ask for help! and removed S-needs-triage This issue needs to be labelled labels Sep 20, 2024
@JosepBove
Copy link
Contributor

I can take this

@JosepBove
Copy link
Contributor

Ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request C-perf A change motivated by improving speed, memory usage or disk footprint D-complex Quite challenging from either a design or technical perspective Ask for help! D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Todo
Development

No branches or pull requests

2 participants