You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using transient storage for context setting. Just before the function ends, I expect there to be some context in transient storage that I can fetch. This behaviour is working perfectly when I test with "forge test".
However, when I check with forge test --gas-report, the transient storage is empty, as if it has been cleared or never written at all.
What is so different between these 2 modes of operation that would cause this?
Cheers
The text was updated successfully, but these errors were encountered:
since foundry-rs/foundry#7186--gas-report enables isolation by default. You can verify that by comparing forge test --isolate and forge test --gas-report outputs
since foundry-rs/foundry#7186--gas-report enables isolation by default. You can verify that by comparing forge test --isolate and forge test --gas-report outputs
Thanks, makes sense. So what's the best practice to test features that use transient storage?
zerosnacks
changed the title
forge test & forge test --gas-report differ in behaviour when using transient storage
docs: document best practices of measuring gas when using transient storage
Jul 16, 2024
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (c2e5297 2024-06-14T00:22:57.565836000Z)
What command(s) is the bug in?
forge test --gas-report
Operating System
macOS (Intel)
Describe the bug
I'm using transient storage for context setting. Just before the function ends, I expect there to be some context in transient storage that I can fetch. This behaviour is working perfectly when I test with "forge test".
However, when I check with forge test --gas-report, the transient storage is empty, as if it has been cleared or never written at all.
What is so different between these 2 modes of operation that would cause this?
Cheers
The text was updated successfully, but these errors were encountered: