What foundry profiles should we have? #42
Replies: 5 comments 8 replies
-
I do not fully understand your argument. Also, the quote from Cameel is out of context. Where did he say that? And did he say in response to what? Is your point that via IR would lead to a small reduction in bytecode size and/ or gas costs? If yes, can quantify this claim? I don't see how using via IR would slow down the development process locally. For that, we're using the |
Beta Was this translation helpful? Give feedback.
-
I did not understand why having the same profile structure offers a more optimized contract. Can you please elaborate more on this? As per the Solidity doc, the number of I am not completely sure whether we should enable We would still need two profiles at the minimum:
Other profiles:
|
Beta Was this translation helpful? Give feedback.
-
@andreivladbrg would love to hear your take in case you have changed your mind about it as well? |
Beta Was this translation helpful? Give feedback.
-
The quote from Cameel is from this post. The point I was trying to make with "performance" is that it takes way more time to compile the contracts with
My point is that the contract size would be smaller with
that is correct, but it would increase the complexity of the project when it is not needed:
test did on this commit: cbc378d
With
With
as you can see, there is 2.5 minutes difference between via_ir true/false
It was also a mistake on my part that I forgot the optimizer is already activated in the default profile. Setting ConclusionMy conclusion is that we don't need |
Beta Was this translation helpful? Give feedback.
-
Ok, since we all agreed on having the Thank you both for your kind comments. |
Beta Was this translation helpful? Give feedback.
-
In
v2-core
, the reasons behind the optimized profile structure is that we need to run contracts withvia_ir
- otherwise, the contracts would exceed the maximum contract size limit of approximately 24kb. Also because we faced issues with the "stack too deep" error.Lockup contracts compiled with the default profile
For the OE contract, it is still far from reaching the contract size limit:
OE contract compiled with the default profile
Benefits of having the same profile structure:
Cons:
My recommendation is to keep only the default profile for now and see how the development process go.
What do you say? @sablier-labs/solidity
Beta Was this translation helpful? Give feedback.
All reactions