Commit bf3929ef authored by Maurelian's avatar Maurelian Committed by Kelvin Fichter

chore(contracts): increase optimizer runs to 10,000

I observed a very small savings from increasing the optimizer runs,
and no noticable impact on compile time
parent 43910748
...@@ -61,7 +61,7 @@ const config: HardhatUserConfig = { ...@@ -61,7 +61,7 @@ const config: HardhatUserConfig = {
{ {
version: '0.8.8', version: '0.8.8',
settings: { settings: {
optimizer: { enabled: true, runs: 200 }, optimizer: { enabled: true, runs: 10_000 },
metadata: { metadata: {
bytecodeHash: 'none', bytecodeHash: 'none',
}, },
...@@ -75,7 +75,7 @@ const config: HardhatUserConfig = { ...@@ -75,7 +75,7 @@ const config: HardhatUserConfig = {
{ {
version: '0.5.17', // Required for WETH9 version: '0.5.17', // Required for WETH9
settings: { settings: {
optimizer: { enabled: true, runs: 200 }, optimizer: { enabled: true, runs: 10_000 },
outputSelection: { outputSelection: {
'*': { '*': {
'*': ['storageLayout'], '*': ['storageLayout'],
......
...@@ -163,7 +163,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => { ...@@ -163,7 +163,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
'Non-calldata overhead gas cost per transaction:', 'Non-calldata overhead gas cost per transaction:',
(gasUsed - fixedCalldataCost) / numTxs (gasUsed - fixedCalldataCost) / numTxs
) )
expectApprox(gasUsed, 1_605_796, { expectApprox(gasUsed, 1_604_975, {
upperPercentDeviation: 0, upperPercentDeviation: 0,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your // Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value! // contracts are too efficient, consider updating the target value!
...@@ -211,7 +211,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => { ...@@ -211,7 +211,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
'Non-calldata overhead gas cost per transaction:', 'Non-calldata overhead gas cost per transaction:',
(gasUsed - fixedCalldataCost) / numTxs (gasUsed - fixedCalldataCost) / numTxs
) )
expectApprox(gasUsed, 1_739_811, { expectApprox(gasUsed, 1_738_990, {
upperPercentDeviation: 0, upperPercentDeviation: 0,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your // Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value! // contracts are too efficient, consider updating the target value!
...@@ -297,7 +297,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => { ...@@ -297,7 +297,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
console.log('Benchmark complete.') console.log('Benchmark complete.')
console.log('Gas used:', gasUsed) console.log('Gas used:', gasUsed)
expectApprox(gasUsed, 217_615, { expectApprox(gasUsed, 217_218, {
upperPercentDeviation: 0, upperPercentDeviation: 0,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your // Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value! // contracts are too efficient, consider updating the target value!
...@@ -319,7 +319,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => { ...@@ -319,7 +319,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
console.log('Benchmark complete.') console.log('Benchmark complete.')
console.log('Gas used:', gasUsed) console.log('Gas used:', gasUsed)
expectApprox(gasUsed, 156_711, { expectApprox(gasUsed, 156_314, {
upperPercentDeviation: 0, upperPercentDeviation: 0,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your // Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value! // contracts are too efficient, consider updating the target value!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment