Allow clearing storage and address warmness
Forge (IIUC) executes all the tests in a single transaction. As of now it don't think that it's possible to create a precise gas benchmark in Forge if there's storage or a call involved. If a test requires a storage initialization, the initialization makes the slot warm, which makes its usage lower than if it was in a separate transaction. Also if any contract is deployed, its address is automatically becoming warm, again lowering the gas usage when calling it. The EVM could expose a cheatcode to clear the warmness states allowing the benchmarks to be as expensive as when running in a separate transaction.
Probably a duplicate of https://github.com/foundry-rs/foundry/issues/2429
Closing this as a duplicate of the linked issue + https://github.com/foundry-rs/foundry/issues/1340. This is something that would need to be handled upstream in foundry as opposed to here in forge-std 🙂