Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add optimized-build profile #36

Merged
merged 1 commit into from
Jan 7, 2024

Conversation

jaypaik
Copy link
Collaborator

@jaypaik jaypaik commented Jan 5, 2024

Adding this profile so we can run faster local size checks (~10s on my machine) on IR builds.
More work on foundry.toml (and the README) to come later. This is to unblock us quickly.

Usage:

❯ FOUNDRY_PROFILE=optimized-build forge b --sizes
[⠊] Compiling...
[⠒] Compiling 73 files with 0.8.21
[⠑] Solc 0.8.21 finished in 9.91s
Compiler run successful!
| Contract                           | Size (kB) | Margin (kB) |
|------------------------------------|-----------|-------------|
| AccountStorageV1                   | 0.058     | 24.518      |
| Address                            | 0.058     | 24.518      |
| AssociatedLinkedListSetLib         | 0.058     | 24.518      |
| CastLib                            | 0.058     | 24.518      |
| CountableLinkedListSetLib          | 0.058     | 24.518      |
| Create2                            | 0.058     | 24.518      |
| ECDSA                              | 0.058     | 24.518      |
| ERC165Checker                      | 0.058     | 24.518      |
| ERC1967Proxy                       | 0.209     | 24.367      |
| FunctionReferenceLib               | 0.058     | 24.518      |
| KnownSelectors                     | 0.058     | 24.518      |
| LinkedListSetLib                   | 0.058     | 24.518      |
| Math                               | 0.058     | 24.518      |
| MultiOwnerMSCAFactory              | 5.264     | 19.312      |
| MultiOwnerPlugin                   | 8.419     | 16.157      |
| MultiOwnerTokenReceiverMSCAFactory | 5.467     | 19.109      |
| PluginStorageLib                   | 0.058     | 24.518      |
| SafeERC20                          | 0.058     | 24.518      |
| SessionKeyPermissionsPlugin        | 9.74      | 14.836      |
| SessionKeyPlugin                   | 7.306     | 17.27       |
| ShortStrings                       | 0.058     | 24.518      |
| SignatureChecker                   | 0.058     | 24.518      |
| SignedMath                         | 0.058     | 24.518      |
| StorageSlot                        | 0.058     | 24.518      |
| Strings                            | 0.058     | 24.518      |
| TokenReceiverPlugin                | 3.419     | 21.157      |
| UpgradeableModularAccount          | 24.338    | 0.238       |

@fangting-alchemy
Copy link
Collaborator

Looks good. Can we add usage instructions into readme?

Copy link
Contributor

@adam-alchemy adam-alchemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, saw the comment about adding the test harness later. I think it's good that this keeps the default profile as IR, too. Also it's probably worth adding the build with sizes command to the readme as Fangting mentioned.

@jaypaik jaypaik force-pushed the 01-04-chore_add_optimized-build_profile branch from faf134f to c40fca7 Compare January 7, 2024 19:53
@jaypaik jaypaik merged commit 5d0816a into audit-2023-11-20 Jan 7, 2024
3 checks passed
@jaypaik jaypaik deleted the 01-04-chore_add_optimized-build_profile branch January 7, 2024 20:17
jaypaik added a commit that referenced this pull request Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants