Skip to content

Conversation

@aalavandhan
Copy link
Member

@aalavandhan aalavandhan commented May 9, 2023

Gas numbers before

·-------------------------------------------------------|---------------------------|-------------|-----------------------------·
|                 Solc version: 0.8.19                  ·  Optimizer enabled: true  ·  Runs: 200  ·  Block limit: 30000000 gas  │
························································|···························|·············|······························
|  Methods                                              ·              122 gwei/gas               ·       1847.70 usd/eth       │
·····················|··································|·············|·············|·············|···············|··············
|  Contract          ·  Method                          ·  Min        ·  Max        ·  Avg        ·  # calls      ·  usd (avg)  │
·····················|··································|·············|·············|·············|···············|··············
|  BondIssuer        ·  init                            ·          -  ·          -  ·     207959  ·          101  ·      46.88  │
·····················|··································|·············|·············|·············|···············|··············
|  BondIssuer        ·  transferOwnership               ·          -  ·          -  ·      36044  ·           10  ·       8.13  │
·····················|··································|·············|·············|·············|···············|··············
|  ERC20Upgradeable  ·  approve                         ·      29170  ·      48965  ·      47097  ·         1732  ·      10.62  │
·····················|··································|·············|·············|·············|···············|··············
|  ERC20Upgradeable  ·  transfer                        ·      37205  ·      67105  ·      59226  ·          211  ·      13.35  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  deposit                         ·     272554  ·     388016  ·     317474  ·          713  ·      71.56  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  pause                           ·          -  ·          -  ·      54154  ·            7  ·      12.21  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  redeem                          ·     103670  ·    1796283  ·     242656  ·           59  ·      54.70  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  transferERC20                   ·          -  ·          -  ·      67771  ·            1  ·      15.28  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  unpause                         ·          -  ·          -  ·      32276  ·            3  ·       7.28  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  updateState                     ·      63599  ·    1818972  ·     899919  ·          888  ·     202.86  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  updateTolerableTrancheMaturity  ·          -  ·          -  ·      42647  ·          101  ·       9.61  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  deploy                          ·     784791  ·    2014040  ·    1095471  ·          162  ·     246.94  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  deposit                         ·     120509  ·     286950  ·     273069  ·          788  ·      61.56  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  init                            ·     209868  ·     221974  ·     219892  ·          122  ·      49.57  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  recover                         ·     115361  ·     331052  ·     176129  ·           10  ·      39.70  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  recover                         ·      35286  ·    2977841  ·     301979  ·           48  ·      68.07  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  recoverAndRedeploy              ·          -  ·          -  ·     915881  ·           10  ·     206.46  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  updateMinDeploymentAmt          ·          -  ·          -  ·      53225  ·            3  ·      12.00  │
·····················|··································|·············|·············|·············|···············|··············
|  Deployments                                          ·                                         ·  % of limit   ·             │
························································|·············|·············|·············|···············|··············
|  BondIssuer                                           ·          -  ·          -  ·     946310  ·        3.2 %  ·     213.32  │
························································|·············|·············|·············|···············|··············
|  PerpetualTranche                                     ·          -  ·          -  ·    4025338  ·       13.4 %  ·     907.39  │
························································|·············|·············|·············|···············|··············
|  RolloverVault                                        ·          -  ·          -  ·    3913079  ·         13 %  ·     882.08  │
·-------------------------------------------------------|-------------|-------------|-------------|---------------|-------------·

After

·-------------------------------------------------------|---------------------------|-------------|-----------------------------·
|                 Solc version: 0.8.19                  ·  Optimizer enabled: true  ·  Runs: 200  ·  Block limit: 30000000 gas  │
························································|···························|·············|······························
|  Methods                                              ·              123 gwei/gas               ·       1849.59 usd/eth       │
·····················|··································|·············|·············|·············|···············|··············
|  Contract          ·  Method                          ·  Min        ·  Max        ·  Avg        ·  # calls      ·  usd (avg)  │
·····················|··································|·············|·············|·············|···············|··············
|  BondIssuer        ·  init                            ·          -  ·          -  ·     207959  ·          101  ·      47.31  │
·····················|··································|·············|·············|·············|···············|··············
|  BondIssuer        ·  transferOwnership               ·          -  ·          -  ·      36044  ·           10  ·       8.20  │
·····················|··································|·············|·············|·············|···············|··············
|  ERC20Upgradeable  ·  approve                         ·      29170  ·      48965  ·      47097  ·         1732  ·      10.71  │
·····················|··································|·············|·············|·············|···············|··············
|  ERC20Upgradeable  ·  transfer                        ·      37205  ·      67105  ·      59226  ·          211  ·      13.47  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  deposit                         ·     272554  ·     388016  ·     317476  ·          713  ·      72.23  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  pause                           ·          -  ·          -  ·      54154  ·            7  ·      12.32  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  redeem                          ·     103670  ·    1796283  ·     242656  ·           59  ·      55.20  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  transferERC20                   ·          -  ·          -  ·      67771  ·            1  ·      15.42  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  unpause                         ·          -  ·          -  ·      32276  ·            3  ·       7.34  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  updateState                     ·      63599  ·    1818972  ·     899919  ·          888  ·     204.73  │
·····················|··································|·············|·············|·············|···············|··············
|  PerpetualTranche  ·  updateTolerableTrancheMaturity  ·          -  ·          -  ·      42647  ·          101  ·       9.70  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  deploy                          ·     784791  ·    2014040  ·    1074968  ·          157  ·     244.55  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  deposit                         ·     120509  ·     286950  ·     273069  ·          788  ·      62.12  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  init                            ·     209880  ·     221974  ·     219892  ·          122  ·      50.03  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  recover                         ·     115295  ·     307527  ·     157797  ·            9  ·      35.90  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  recover                         ·      35286  ·    2418256  ·     263391  ·           48  ·      59.92  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  recoverAndRedeploy              ·          -  ·          -  ·     885534  ·           10  ·     201.46  │
·····················|··································|·············|·············|·············|···············|··············
|  RolloverVault     ·  updateMinDeploymentAmt          ·          -  ·          -  ·      53225  ·            3  ·      12.11  │
·····················|··································|·············|·············|·············|···············|··············
|  Deployments                                          ·                                         ·  % of limit   ·             │
························································|·············|·············|·············|···············|··············
|  BondIssuer                                           ·          -  ·          -  ·     946310  ·        3.2 %  ·     215.29  │
························································|·············|·············|·············|···············|··············
|  PerpetualTranche                                     ·          -  ·          -  ·    4025338  ·       13.4 %  ·     915.76  │
························································|·············|·············|·············|···············|··············
|  RolloverVault                                        ·          -  ·          -  ·    4003702  ·       13.3 %  ·     910.84  │
·-------------------------------------------------------|-------------|-------------|-------------|---------------|-------------·


@aalavandhan aalavandhan requested review from brandoniles and nms-7 May 9, 2023 17:37
@aalavandhan aalavandhan force-pushed the recovery-optimization branch from f4dbe84 to 867b463 Compare May 9, 2023 17:58
@aalavandhan aalavandhan force-pushed the recovery-optimization branch from 867b463 to 2a5bf23 Compare May 9, 2023 18:28
@nms-7 nms-7 self-requested a review May 9, 2023 18:37
Copy link
Contributor

@nms-7 nms-7 left a comment

Choose a reason for hiding this comment

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

should we remove the syncAndRemoves from the first loop to save them til then end (that way always removing from end of list)

@aalavandhan aalavandhan force-pushed the recovery-optimization branch from 63f633e to cc14754 Compare May 9, 2023 19:07
Copy link
Member

@brandoniles brandoniles left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from int-audit-fixes to main May 9, 2023 20:15
@aalavandhan aalavandhan force-pushed the recovery-optimization branch from cc14754 to 0fc1aa6 Compare May 9, 2023 20:16
@aalavandhan aalavandhan merged commit 0c79751 into main May 9, 2023
@aalavandhan aalavandhan deleted the recovery-optimization branch May 9, 2023 20:16
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.

4 participants