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

storage kept hot when should be cold #4900

Closed
2 tasks done
internetmoneydev opened this issue May 8, 2023 · 4 comments
Closed
2 tasks done

storage kept hot when should be cold #4900

internetmoneydev opened this issue May 8, 2023 · 4 comments
Labels
T-bug Type: bug

Comments

@internetmoneydev
Copy link

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (8adf428 2023-05-08T00:12:01.390438000Z)

What command(s) is the bug in?

No response

Operating System

macOS (Apple Silicon)

Describe the bug

SLOAD/SSTOREs are hot after their first load in the test. I would think that hitting a contract would be a signal to invalidate the storage cache (make all storage slots cold) since that would indicate a separate transaction. However, what happens is SLOAD/SSTOREs are kept hot over the course of a test, presumably because it is a single function. Is there a way to work around this, or is this a bug?

@internetmoneydev internetmoneydev added the T-bug Type: bug label May 8, 2023
@gakonst gakonst added this to Foundry May 8, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry May 8, 2023
@internetmoneydev
Copy link
Author

i have tried moving the block timestamp forward to see if that helps, but it does not seem to

@radeksvarz
Copy link

Hope to have the vm cheatcode for warming/cooling for proper simulations.

@mds1
Copy link
Collaborator

mds1 commented May 9, 2023

Right, slots are warm the whole time since each test is a single transaction. There is an issue for a vm.cool cheatcode here #1340

@zerosnacks
Copy link
Member

vm.cool has been added here: #5830

We also have the --isolate mode for improved gas accuracy to run a test in an isolated environment

@jenpaff jenpaff moved this from Todo to Completed in Foundry Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

No branches or pull requests

4 participants