foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.33k stars 1.76k forks source link

New OOG test error on latest nightly #9369

Closed gte620v closed 1 day ago

gte620v commented 1 day ago

Component

Forge

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

What version of Foundry are you on?

forge 0.2.0 (c13d42e 2024-11-19T00:22:29.791725000Z)

What command(s) is the bug in?

forge test

Operating System

macOS (Apple Silicon)

Describe the bug

I have a set of smart contracts that have a fork test in forge. The tests have been developed over the course of the last 4 months and have worked on the lastest updates of forge during that time (each push to GH tests against the latest foundryup).

but nightly-c13d42e850da353c0856a8b0d4123e13cc40045d and newer breaks the test suite.

I get all kinds of "failed inner call" errors on eth transfers. eg:

    │   ├─ [0] recipient::fallback{value: 27035795856561}()
    │   │   └─ ← [PrecompileError] EvmError: PrecompileError
    │   └─ ← [Revert] FailedInnerCall()
    └─ ← [Revert] FailedInnerCall()

or

    │   ├─ [0] recipient::fallback{value: 889774626928868021}()
    │   │   └─ ← [PrecompileOOG] EvmError: PrecompileOOG
    │   └─ ← [Revert] EvmError: Revert
    └─ ← [Revert] EvmError: Revert

recipient in this case is address public recipient = address(10);. that should be an eoa that doesn't need a receive function (and didn't on earlier versions of foundry).

if i run the same tests on forge version at or before nightly-e649e62f125244a3ef116be25dfdc81a2afbaf2a, then all is well and the same tests pass.

grandizzy commented 1 day ago

@gte620v we upgraded default evm version to cancun ,so address(10) is a precompile now. You should change that address or set evm_version to Paris to have same behaviour

grandizzy commented 1 day ago

@gte620v please reopen if still an issue after changing as per above comment. Thank you

gte620v commented 1 day ago

yep; fixed it. thanks!