From dff79e0a8c8cde680e5c678267dd6a0daed00b47 Mon Sep 17 00:00:00 2001 From: MathisGD Date: Tue, 30 Apr 2024 14:49:09 +0200 Subject: [PATCH 1/5] chore: toml update --- foundry.toml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/foundry.toml b/foundry.toml index f331a69d..d7954116 100644 --- a/foundry.toml +++ b/foundry.toml @@ -8,6 +8,9 @@ fs_permissions = [ { access = "read", path = "./config/"} ] libs = ["lib"] +via-ir = true +optimizer_runs = 80000 + [profile.default.fuzz] runs = 16 @@ -17,17 +20,11 @@ runs = 16 ethereum = "https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}" tenderly = "https://rpc.tenderly.co/fork/${TENDERLY_FORK_ID}" + [profile.default.fmt] wrap_comments = true -[profile.build] -via-ir = true -test = "/dev/null" -script = "/dev/null" -optimizer_runs = 80000 - - [profile.test] via-ir = false From cab798f593681455da22c65fabfac24cc03dd360 Mon Sep 17 00:00:00 2001 From: MathisGD Date: Tue, 14 May 2024 14:34:10 +0200 Subject: [PATCH 2/5] chore: change opti runs --- README.md | 5 ++++- foundry.toml | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ed9343ba..0aa85f00 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,10 @@ User-end bundlers are provided in each chain-specific folder, instanciating all Install dependencies with `yarn`. -The first time running the tests with `yarn test:forge` will build Morpho Blue. +Run tests with `FOUNDRY_PROFILE=test forge t`. + +Note that the `EthereumBundlerV2` has been deployed with 80 000 optimizer runs. +To compile contracts with the same configuration, run `FOUNDRY_PROFILE=ethereumBundlerV2 forge b`. ## Audits diff --git a/foundry.toml b/foundry.toml index d7954116..fd4e8327 100644 --- a/foundry.toml +++ b/foundry.toml @@ -9,7 +9,7 @@ fs_permissions = [ ] libs = ["lib"] via-ir = true -optimizer_runs = 80000 +optimizer_runs = 999999 [profile.default.fuzz] @@ -29,4 +29,8 @@ wrap_comments = true via-ir = false +[profile.ethereumBundlerV2] +optimizer_runs = 80000 + + # See more config options https://github.com/foundry-rs/foundry/tree/master/crates/config From 605c653ab54f220cc824776e9832257f738a3b5d Mon Sep 17 00:00:00 2001 From: MathisGD Date: Tue, 14 May 2024 14:53:00 +0200 Subject: [PATCH 3/5] chore: readd build profile to avoid compiling everything --- foundry.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/foundry.toml b/foundry.toml index fd4e8327..87dfc186 100644 --- a/foundry.toml +++ b/foundry.toml @@ -29,6 +29,11 @@ wrap_comments = true via-ir = false +[profile.build] +test = "/dev/null" +script = "/dev/null" + + [profile.ethereumBundlerV2] optimizer_runs = 80000 From 2d3f29d9ad23658b391a54493e6b435bbc59c4fb Mon Sep 17 00:00:00 2001 From: MathisGD Date: Tue, 14 May 2024 15:03:28 +0200 Subject: [PATCH 4/5] chore: skip import files in CI size check --- .github/workflows/foundry.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/foundry.yml b/.github/workflows/foundry.yml index 323e30cb..60141493 100644 --- a/.github/workflows/foundry.yml +++ b/.github/workflows/foundry.yml @@ -32,7 +32,10 @@ jobs: - uses: ./.github/actions/install - name: Build contracts via IR & check sizes - run: yarn build:forge --force --sizes # don't use compilation cache + # don't use compilation cache + # skip import files, because we don't care if contracts are too big + run: yarn build:forge --force --sizes --skip Import + build-no-ir: name: Compilation (without IR) From da1484be4e3ffe888bbbccb179756c48a0bed0d1 Mon Sep 17 00:00:00 2001 From: MathisGD <74971347+MathisGD@users.noreply.github.com> Date: Tue, 14 May 2024 15:22:05 +0200 Subject: [PATCH 5/5] docs: Update README.md Signed-off-by: MathisGD <74971347+MathisGD@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0aa85f00..7887ea4e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ User-end bundlers are provided in each chain-specific folder, instanciating all Install dependencies with `yarn`. -Run tests with `FOUNDRY_PROFILE=test forge t`. +Run tests with `yarn test:forge`. Note that the `EthereumBundlerV2` has been deployed with 80 000 optimizer runs. To compile contracts with the same configuration, run `FOUNDRY_PROFILE=ethereumBundlerV2 forge b`.