-
Notifications
You must be signed in to change notification settings - Fork 86
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
Optimize Compiler Settings #448
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -31,6 +31,18 @@ const customNetwork = CUSTOM_NODE_URL | |||||
} | ||||||
: {} | ||||||
|
||||||
const compilerSettings = { | ||||||
version: '0.8.26', | ||||||
settings: { | ||||||
optimizer: { | ||||||
enabled: true, | ||||||
runs: 10_000_000, | ||||||
}, | ||||||
viaIR: true, | ||||||
evmVersion: 'paris', | ||||||
}, | ||||||
} | ||||||
|
||||||
const config: HardhatUserConfig = { | ||||||
paths: { | ||||||
artifacts: 'build/artifacts', | ||||||
|
@@ -54,19 +66,19 @@ const config: HardhatUserConfig = { | |||||
...customNetwork, | ||||||
}, | ||||||
solidity: { | ||||||
compilers: [ | ||||||
{ | ||||||
version: '0.8.24', | ||||||
compilers: [compilerSettings], | ||||||
overrides: { | ||||||
// FCL library does not optimize well via IR. In order to take advantage of the IR optimizer | ||||||
// in the rest of the project without causing significant regressions to the FCL verifier, we | ||||||
// add a compiler setting override for that specific contract. | ||||||
'contracts/verifiers/FCLP256Verifier.sol': { | ||||||
...compilerSettings, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did this on purpose to future proof in case new fields were added. Agree it isn't strictly necessary here, but wanted to future proof just in case. Also it feels to convey intent a bit more IMO: we want exactly |
||||||
settings: { | ||||||
optimizer: { | ||||||
enabled: true, | ||||||
runs: 10_000_000, | ||||||
}, | ||||||
...compilerSettings.settings, | ||||||
viaIR: false, | ||||||
evmVersion: 'paris', | ||||||
}, | ||||||
}, | ||||||
], | ||||||
}, | ||||||
}, | ||||||
namedAccounts: { | ||||||
deployer: 0, | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paris is pre-push0, right? maybe we don't need this either?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do, so we are BNB compatible.
Also, note that
hardhat
currently defaults toparis
anyway (at least it did when I experimented with switching this setting off), so this is more to explicitly document the EVM version that is being targetted.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like BNB already has push0? https://forum.bnbchain.org/t/bnb-chain-roadmap-mainnet/936
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super recent! It wasn't the case 4 days ago: hats-finance#19 (comment)
Then
s/BNB/Linea/g
: I think the point remains the same thatPUSH0
isn't generally well supported across L2s:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, the forum post says it was implemented in
Kepler: 2024/01/23
hardfork