-
Notifications
You must be signed in to change notification settings - Fork 906
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
Compilation fails with solc 0.8.23 #735
Comments
Running with compiler version In the release note of
Based on the documentation, it seems we need to pass the path:
But that results in compiling issues with |
Might be worth, once resolving, adding a CI job that compiles with the latest compiler and optimisations so that we don’t regress on this. |
This PR: - Fix the benchmark CI job to prebent regressions like #735. It is fixed by removing the OR operator because if a benchmark failed, it only outputted a message but didn't return a non-zero exit code. - Also bumps the `0.8.x` compiler version to the latest one (0.8.24)
@mmv08 so any solution for this issue yet? |
not yet, we use compiler v0.7.6 and this issue is a low priority for us |
…ta emits SafeModuleTransaction event
Fixes: #735 and #773 ### Changes in PR - Add a hook function `_onAfterExecTransactionFromModule` that gets called after execution from module. - SafeL2 overrides this function to emit event `SafeModuleTransaction`. - Add test that checks if `execTransactionFromModuleReturnData` in SafeL2 emits `SafeModuleTransaction` event. #### Codesize increase by `33` bytes with compiler version 0.7.6 #### This PR: ``` Safe 21814 bytes (limit is 24576) SafeL2 22632 bytes (limit is 24576) ``` #### Main branch ``` Safe 21781 bytes (limit is 24576) SafeL2 22623 bytes (limit is 24576) ``` ### Impact on gas usage with `Safe` contract Changes in this PR add additional overhead of `49` gas #### This PR: ``` ·------------------------------------------------------------|----------------------------|-------------|------------------------------· | Solc version: 0.7.6 · Optimizer enabled: false · Runs: 200 · Block limit: 100000000 gas │ ·····························································|····························|·············|······························· | Methods │ ·····················|·······································|·············|··············|·············|···············|··············· | Contract · Method · Min · Max · Avg · # calls · usd (avg) │ ·····················|·······································|·············|··············|·············|···············|··············· | Safe · execTransactionFromModule · 51630 · 184223 · 127865 · 11 · - │ ·····················|·······································|·············|··············|·············|···············|··············· | Safe · execTransactionFromModuleReturnData · 52273 · 183979 · 107919 · 5 · - │ ``` #### Main branch ``` ·------------------------------------------------------------|----------------------------|-------------|------------------------------· | Solc version: 0.7.6 · Optimizer enabled: false · Runs: 200 · Block limit: 100000000 gas │ ·····························································|····························|·············|······························· | Methods │ ·····················|·······································|·············|··············|·············|···············|··············· | Safe · execTransactionFromModule · 51581 · 184186 · 127818 · 11 · - │ ·····················|·······································|·············|··············|·············|···············|··············· | Safe · execTransactionFromModuleReturnData · 52224 · 183930 · 107870 · 5 · - │ ``` Why this approach? - Clean code - Introduces a hook that allows contracts inheriting Safe to do additional post processing. **Alternatives considered** A. - Move the function `execTransactionFromModule(...)` from `ModuleManager` to `Safe` contract. 3521a4b - But this is not an ideal approach as `ModuleManager` does not implement `execTransactionFromModule`. - Pro: Minimal code changes, no impact on codesize B. - Create `_onExecTransactionFromModule` method that gets called by `execTransactionFromModule` - ~~Con: This approach still has repeating code~~ - Approach is similar to `A` with new function. Here, `_onExecTransactionFromModule` still calls its parent. - Pro: Increase in codesize by only `24` bytes Side note: Why event `SafeModuleTransaction` is not emitted by `execTransactionFromModuleReturnData` in `SafeL2`? Why `SafeL2` does not override `execTransactionFromModuleReturnData`. -> `execTransactionFromModuleReturnData` in `SafeL2` should also emit event. Might have been missed in the past. ~~Would be covered in a separate PR.~~. This PR fixes the issue. --------- Co-authored-by: Nicholas Rodrigues Lordello <n@lordello.net>
Fixes #775, #735 To have a broader context on overall changes in the code use this [diff](https://github.com/safe-global/safe-smart-account/compare/499b17ad..improvement-execTransaction-post-call-hook) ### Changes in PR: - Add a pre-hook function onBeforeExecTransaction - Refactor changes in #772, #774 - Add a pre-hook function onBeforeExecTransactionFromModule - Change function visibility of execTransaction from public to external ### Code size change Increase by 51 bytes in Safe with diff: https://github.com/safe-global/safe-smart-account/compare/499b17ad..improvement-execTransaction-post-call-hook: #### This PR ``` Safe 21832 bytes (limit is 24576) SafeL2 22612 bytes (limit is 24576) ``` #### [Commit](499b17a) (Prior to merging #772) ``` Safe 21781 bytes (limit is 24576) SafeL2 22623 bytes (limit is 24576) ``` ### Gas usage with Safe contract - Increase by 79 gas in execTransaction calls - Increase by 44 gas in execTransactionFromModule* calls #### This PR ``` ·------------------------------------------------------------|----------------------------|-------------|------------------------------· | Solc version: 0.7.6 · Optimizer enabled: false · Runs: 200 · Block limit: 100000000 gas │ ·····························································|····························|·············|······························· | Methods │ ·····················|·······································|·············|··············|·············|···············|··············· | Contract · Method · Min · Max · Avg · # calls · usd (avg) │ ·····················|·······································|·············|··············|·············|···············|··············· | Safe · execTransaction · 51999 · 3638489 · 133046 · 248 · - │ ·····················|·······································|·············|··············|·············|···············|··············· | Safe · execTransactionFromModule · 51625 · 184218 · 127860 · 11 · - │ ·····················|·······································|·············|··············|·············|···············|··············· | Safe · execTransactionFromModuleReturnData · 52268 · 183974 · 107914 · 5 · - │ ·····················|·······································|·············|··············|·············|···············|··············· ``` #### [Commit](499b17a) (Prior to merging #772) ``` ·------------------------------------------------------------|----------------------------|-------------|------------------------------· | Solc version: 0.7.6 · Optimizer enabled: false · Runs: 200 · Block limit: 100000000 gas │ ·····························································|····························|·············|······························· | Methods │ ·····················|·······································|·············|··············|·············|···············|··············· | Contract · Method · Min · Max · Avg · # calls · usd (avg) │ ·····················|·······································|·············|··············|·············|···············|··············· | Safe · execTransaction · 51920 · 3638410 · 132980 · 248 · - │ ·····················|·······································|·············|··············|·············|···············|··············· | Safe · execTransactionFromModule · 51581 · 184186 · 127818 · 11 · - │ ·····················|·······································|·············|··············|·············|···············|··············· | Safe · execTransactionFromModuleReturnData · 52224 · 183930 · 107870 · 5 · - │ ·····················|·······································|·············|··············|·············|···············|··············· ``` ### Alternatives considered A. Add a post call hook `onAfterExecTransaction` Cons: - If a transaction updates threshold of a Safe, then event emits new threshold rather than emitting the value prior to the update. I tried adding `additionalInfo` as a method parameter and building this value prior to the execution but compiler reports CompilerError: `Stack too deep, try removing local variables`. - Changes order of emitted events. --------- Co-authored-by: Nicholas Rodrigues Lordello <n@lordello.net>
This PR: - Fix the benchmark CI job to prebent regressions like safe-global/safe-smart-account#735. It is fixed by removing the OR operator because if a benchmark failed, it only outputted a message but didn't return a non-zero exit code. - Also bumps the `0.8.x` compiler version to the latest one (0.8.24)
This PR: - Fix the benchmark CI job to prebent regressions like safe-global/safe-smart-account#735. It is fixed by removing the OR operator because if a benchmark failed, it only outputted a message but didn't return a non-zero exit code. - Also bumps the `0.8.x` compiler version to the latest one (0.8.24)
Description
The project cannot be compiled with solc 0.8.23
Environment
Steps to reproduce
914d0f8fab0e8f73ef79581f6fbce86e34b049c3
(the latest one on the main branch at the moment of writing)npm i
cp .env.sample .env
SOLIDITY_VERSION='0.8.23'
npm run build
Additional context
The command output:
The text was updated successfully, but these errors were encountered: