EspressoSystems / espresso-sequencer

100 stars 69 forks source link

foundry optimzer setting #1982

Open alxiong opened 2 months ago

alxiong commented 2 months ago

Currently, contract compilation is too slow and hurts dev experience.

We should remove these from default profile to speed things up

https://github.com/EspressoSystems/espresso-sequencer/blob/50e0368f3efd7485cbfecf687c066a46a4b3f1fc/foundry.toml#L12-L14

I believe the reason we set via-ir = true to work around "stack too deep" problem, but there are many other ways to reduce local variables and stack usage.

additionally, we should probably have a profile for deployments that has higher optimizer run?

sveitser commented 2 months ago

Yes the via-ir was turned on for avoiding a "stack too deep" error.

alxiong commented 2 months ago

do we want to work on it before mainnet? @philippecamacho @alysiahuggins

philippecamacho commented 2 months ago

Should not we reaudit some of the contracts if we do that?

On Fri, Sep 6, 2024, 23:42 Alex Xiong @.***> wrote:

do we want to work on it before mainnet? @philippecamacho https://github.com/philippecamacho @alysiahuggins https://github.com/alysiahuggins

— Reply to this email directly, view it on GitHub https://github.com/EspressoSystems/espresso-sequencer/issues/1982#issuecomment-2335025418, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABW7QPLCX44CUYXBNWEM5NDZVJY3DAVCNFSM6AAAAABNVWHLPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZVGAZDKNBRHA . You are receiving this because you were mentioned.Message ID: @.***>

alxiong commented 2 months ago

Let me clarify. I simply suggest that maybe we should set "optimizer=x" for production profile for better gas. Not necessarily changing any code, so won't be affected by audit timeline

philippecamacho commented 2 months ago

Let me clarify. I simply suggest that maybe we should set "optimizer=x" for production profile for better gas. Not necessarily changing any code, so won't be affected by audit timeline

I see, then in this case looks like a no-brainer.