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

Etherscan traces are only resolved for first instance of test run #7558

Closed
2 tasks done
zerosnacks opened this issue Apr 4, 2024 · 0 comments · Fixed by #7675
Closed
2 tasks done

Etherscan traces are only resolved for first instance of test run #7558

zerosnacks opened this issue Apr 4, 2024 · 0 comments · Fixed by #7675
Assignees
Labels
T-bug Type: bug

Comments

@zerosnacks
Copy link
Member

zerosnacks commented Apr 4, 2024

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

No response

What command(s) is the bug in?

forge test

Operating System

macOS (Intel)

Describe the bug

It appears that Etherscan traces are only applied once, on the first trace rather than across all.

Given the same test function ran twice:

[PASS] testForkGetPriceA() (gas: 27345)
Logs:
  Price A: 335172810074

Traces:
  [27345] ForkingTest::testForkGetPriceA()
    ├─ [15735] EACAggregatorProxy::latestRoundData() [staticcall]
    │   ├─ [7502] AccessControlledOffchainAggregator::latestRoundData() [staticcall]
    │   │   └─ ← [Return] 14720 [1.472e4], 335172810074 [3.351e11], 1712226143 [1.712e9], 1712226143 [1.712e9], 14720 [1.472e4]
    │   └─ ← [Return] 110680464442257324416 [1.106e20], 335172810074 [3.351e11], 1712226143 [1.712e9], 1712226143 [1.712e9], 110680464442257324416 [1.106e20]
    ├─ [0] console::log("Price A: %d", 335172810074 [3.351e11]) [staticcall]
    │   └─ ← [Stop] 
    └─ ← [Stop] 

[PASS] testForkGetPriceB() (gas: 27367)
Logs:
  Price B: 335172810074

Traces:
  [27367] ForkingTest::testForkGetPriceB()
    ├─ [15735] 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419::latestRoundData() [staticcall]
    │   ├─ [7502] 0xE62B71cf983019BFf55bC83B48601ce8419650CC::latestRoundData() [staticcall]
    │   │   └─ ← [Return] 14720 [1.472e4], 335172810074 [3.351e11], 1712226143 [1.712e9], 1712226143 [1.712e9], 14720 [1.472e4]
    │   └─ ← [Return] 110680464442257324416 [1.106e20], 335172810074 [3.351e11], 1712226143 [1.712e9], 1712226143 [1.712e9], 110680464442257324416 [1.106e20]
    ├─ [0] console::log("Price B: %d", 335172810074 [3.351e11]) [staticcall]
    │   └─ ← [Stop] 
    └─ ← [Stop] 

Notice it resolves 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 to EACAggregatorProxy and 0xE62B71cf983019BFf55bC83B48601ce8419650CC to AccessControlledOffchainAggregator for the first test A but not for the second test B. The internals of the function are the exact same.

Minimal repro: https://github.com/zerosnacks/foundry-repro-7558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant