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.31k stars 1.75k forks source link

feat(`forge-build`): display complete compilation configuration upon invoking `forge build` #6736

Open MerlinEgalite opened 10 months ago

MerlinEgalite commented 10 months ago

Component

Forge

Describe the feature you would like

For now, when compiling files only the solc version is logged, see the screenshot below.

Screenshot 2024-01-09 at 15 19 51

It would be nice to log as well:

This can be very helpful to avoid doing incorrect gas studies, incorrect deployments, etc.

Additional context

No response

mattsse commented 10 months ago

Why not raising a warning by default when a compiled contract exceeds the contract size limit

this is very noisy, hence this error code is ignored by default, you can, however, configure this in the config:

ignored_error_codes = [
    "license",
    "code-size",
    "init-code-size",
]

re you're other points, this is a reasonable request and I think it would be beneficial to log this before we invoke solc either always or if verbosity is a certain value. But I'm open to add support for this.

btw if you run with --build-info, you get the entire input/output for that run

MerlinEgalite commented 10 months ago

My bad for the contract size.

In our case it would have avoided some incorrect deployments and gas studies. Perhaps this is not a common problem but I'd consider the verbosity worth it.

mds1 commented 10 months ago

Regarding contract sizes, my recommended approach is to just check the sizes in CI with forge build --sizes which exits with an error if any src contracts are over the size limit