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

perf: optimize trace decoding by making identity fetching non-blocking #3236

Open
mattsse opened this issue Sep 16, 2022 · 2 comments
Open
Labels
A-internals Area: internals A-tracing Area: tracing C-forge Command: forge T-perf Type: performance

Comments

@mattsse
Copy link
Member

mattsse commented Sep 16, 2022

Component

Forge

Describe the feature you would like

Ref #3006

Decoding traces for better output can make use of etherscan or sig.eth.samczsun.com

both require API requests, the tracing decoding is currently blocking, which means we have code that looks like:

RuntimeOrHandle::new().block_on(fut)

we could solve this by making everything async or use a background task with channels instead

since there's only 1 identifier for the entire suit, the latter makes sense, this way we still keep the non async test interface but can use async decoding

Additional context

No response

@mattsse mattsse added the T-feature Type: feature label Sep 16, 2022
@gakonst
Copy link
Member

gakonst commented Sep 16, 2022

agree

@rkrasiuk rkrasiuk added C-forge Command: forge A-tracing Area: tracing labels Sep 17, 2022
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@zerosnacks zerosnacks added the A-internals Area: internals label Aug 2, 2024
@zerosnacks zerosnacks changed the title Optimize trace decoding perf: optimize trace decoding by making identity fetching non-blocking Aug 2, 2024
@zerosnacks zerosnacks added T-perf Type: performance and removed T-feature Type: feature labels Aug 2, 2024
@zerosnacks
Copy link
Member

Correct me if I'm wrong but I think this is still the case though the code has been updated since:

let fetched_identities = foundry_common::block_on(
fetcher
.map(|(address, metadata)| {
let label = metadata.contract_name.clone();
let abi = metadata.abi().ok().map(Cow::Owned);
self.contracts.insert(address, metadata);
AddressIdentity {
address,
label: Some(label.clone()),
contract: Some(label),
abi,
artifact_id: None,
}
})
.collect::<Vec<AddressIdentity<'_>>>(),
);

Leaving it open but low priority as this is only really an issue on an initial run, after that the identifiers are loaded from cache.

@zerosnacks zerosnacks removed this from the v1.0.0 milestone Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-internals Area: internals A-tracing Area: tracing C-forge Command: forge T-perf Type: performance
Projects
Status: Todo
Development

No branches or pull requests

4 participants