EYBlockchain / nightfall_3

a mono-repo containing an optimistic version of nightfall
Creative Commons Zero v1.0 Universal
260 stars 57 forks source link

Enable yul ir pipeline #1406

Closed fullkomnun closed 1 year ago

fullkomnun commented 1 year ago

What does this implement/fix? Explain your changes.

Enables Yul ir pipeline and tries to tweak the optimizer config for best outcome (see #1405 )

Does this close any currently open issues?

Possibly #1405 and #1394 (gets State.sol deployment size away from danger zone from 23.758KiB to 19.920KiB)

What commands can I run to test the change?

all unit and e2e tests locally or in ci

Any other comments?

Current Config Solc: 0.8.17 Optimizer : enabled Runs: 1 for truffle, 200 for hardhat Yul ir pipeline: disabled

compilation time - 10.5 seconds (on my macbook pro M1 pro)

contract sizes:

 ·----------------------------|--------------|----------------·
 |  Contract Name             ·  Size (KiB)  ·  Change (KiB)  │
 ·····························|··············|·················
 |  Structures                ·       0.062  ·                │
 ·····························|··············|·················
 |  console                   ·       0.084  ·                │
 ·····························|··············|·················
 |  Pairing                   ·       0.084  ·                │
 ·····························|··············|·················
 |  AddressUpgradeable        ·       0.084  ·                │
 ·····························|··············|·················
 |  Address                   ·       0.084  ·                │
 ·····························|··············|·················
 |  Counters                  ·       0.084  ·                │
 ·····························|··············|·················
 |  Strings                   ·       0.084  ·                │
 ·····························|··············|·················
 |  SafeERC20Upgradeable      ·       0.084  ·                │
 ·····························|··············|·················
 |  SanctionsListMock         ·       0.213  ·                │
 ·····························|··············|·················
 |  Migrations                ·       0.248  ·                │
 ·····························|··············|·················
 |  Ownable                   ·       0.687  ·                │
 ·····························|··············|·················
 |  MerkleTree_StatelessMock  ·       1.114  ·                │
 ·····························|··············|·················
 |  MerkleTree_Stateless      ·       1.523  ·                │
 ·····························|··············|·················
 |  Key_Registry              ·       2.063  ·                │
 ·····························|··············|·················
 |  ERC20Mock                 ·       2.121  ·                │
 ·····························|··············|·················
 |  ERC20                     ·       2.121  ·                │
 ·····························|··············|·················
 |  Config                    ·       2.775  ·                │
 ·····························|··············|·················
 |  DERParser                 ·       2.868  ·                │
 ·····························|··············|·················
 |  ChallengesUtil            ·       2.891  ·                │
 ·····························|··············|·················
 |  Utils                     ·       3.087  ·                │
 ·····························|··············|·················
 |  SimpleMultiSig            ·       3.407  ·                │
 ·····························|··············|·················
 |  ERC721                    ·       4.261  ·                │
 ·····························|··············|·················
 |  ERC1155                   ·       4.873  ·                │
 ·····························|··············|·················
 |  ERC1155Mock               ·       4.996  ·                │
 ·····························|··············|·················
 |  ERC721Mock                ·       5.514  ·                │
 ·····························|··············|·················
 |  Verifier                  ·       5.645  ·                │
 ·····························|··············|·················
 |  Proposers                 ·       9.526  ·                │
 ·····························|··············|·················
 |  Poseidon                  ·      10.058  ·                │
 ·····························|··············|·················
 |  Shield                    ·      16.376  ·                │
 ·····························|··············|·················
 |  X509                      ·      17.116  ·                │
 ·····························|··············|·················
 |  Challenges                ·      17.136  ·                │
 ·····························|··············|·················
 |  State                     ·      23.758  ·                │
 ·----------------------------|--------------|----------------·

gas profile:

 ·-----------------------------------------------------|---------------------------|-------------|-----------------------------·
|                Solc version: 0.8.17                 ·  Optimizer enabled: true  ·  Runs: 200  ·  Block limit: 30000000 gas  │
······················································|···························|·············|······························
|  Methods                                                                                                                    │
·················|····································|·············|·············|·············|···············|··············
|  Contract      ·  Method                            ·  Min        ·  Max        ·  Avg        ·  # calls      ·  usd (avg)  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  challengeCommitment               ·     230041  ·     230050  ·     230046  ·            4  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  challengeHistoricRootBlockNumber  ·          -  ·          -  ·     212201  ·            2  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  challengeLeafCountCorrect         ·          -  ·          -  ·     227920  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  challengeNewFrontierCorrect       ·          -  ·          -  ·     290920  ·            2  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  challengeNewRootCorrect           ·          -  ·          -  ·    1721933  ·            2  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  challengeNullifier                ·          -  ·          -  ·     230075  ·            2  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  commitToChallenge                 ·      52934  ·      52946  ·      52943  ·           22  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  initialize                        ·          -  ·          -  ·      68266  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  setBootProposer                   ·          -  ·          -  ·      54508  ·            2  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  setFeeL2TokenAddress              ·          -  ·          -  ·      53486  ·           54  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  setMaxProposers                   ·      35930  ·      36041  ·      36004  ·            3  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  setRestriction                    ·      75892  ·      76612  ·      75982  ·            8  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Challenges    ·  setStateContract                  ·      39540  ·      39563  ·      39544  ·          140  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  ERC1155Mock   ·  safeTransferFrom                  ·          -  ·          -  ·      65796  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  ERC1155Mock   ·  setApprovalForAll                 ·          -  ·          -  ·      46222  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  ERC20Mock     ·  approve                           ·          -  ·          -  ·      46200  ·            5  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  ERC20Mock     ·  transfer                          ·          -  ·          -  ·      51551  ·            4  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  ERC721Mock    ·  approve                           ·          -  ·          -  ·      48731  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  ERC721Mock    ·  awardItem                         ·          -  ·          -  ·     114922  ·            2  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Key_Registry  ·  registerVerificationKey           ·      37954  ·      57866  ·      51225  ·          255  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Proposers     ·  deRegisterProposer                ·          -  ·          -  ·     129032  ·            3  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Proposers     ·  registerProposer                  ·     383925  ·    1415225  ·     469867  ·           24  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Proposers     ·  updateProposer                    ·      73164  ·      91076  ·      82120  ·            2  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Proposers     ·  withdrawStake                     ·          -  ·          -  ·      90500  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Shield        ·  advanceWithdrawal                 ·          -  ·          -  ·     133062  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Shield        ·  finaliseWithdrawal                ·     136295  ·     162342  ·     149416  ·            4  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Shield        ·  requestBlockPayment               ·          -  ·          -  ·     142085  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Shield        ·  setAdvanceWithdrawalFee           ·          -  ·          -  ·     102937  ·            4  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Shield        ·  submitTransaction                 ·      77020  ·     147414  ·     130649  ·           11  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  addPendingWithdrawal              ·          -  ·          -  ·      53945  ·            2  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  changeCurrentProposer             ·      91997  ·     472584  ·     143452  ·          553  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  popBlockData                      ·          -  ·          -  ·      41488  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  proposeBlock                      ·     157835  ·     174285  ·     164572  ·           59  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  removeProposer                    ·     108313  ·     154300  ·     131307  ·            2  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  rewardChallenger                  ·          -  ·          -  ·      82824  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  setBlockStakeWithdrawn            ·          -  ·          -  ·      36475  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  setCurrentProposer                ·      62266  ·     161877  ·     159613  ·           44  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  setNumProposers                   ·      33246  ·    1205640  ·     105346  ·          153  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  setProposer                       ·     149833  ·     149881  ·     149878  ·          166  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  setProposerStartBlock             ·      31163  ·      53075  ·      31269  ·          553  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  setStakeAccount                   ·      54118  ·      54166  ·      54139  ·          163  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  updateProposer                    ·          -  ·          -  ·      42741  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  updateStakeAccountTime            ·          -  ·          -  ·      53723  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  State         ·  withdraw                          ·          -  ·          -  ·      42620  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  X509          ·  addCertificatePolicies            ·      73800  ·     113174  ·      94401  ·            3  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  X509          ·  addExtendedKeyUsage               ·      73820  ·     135756  ·     101950  ·            3  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  X509          ·  enableWhitelisting                ·      24006  ·      34122  ·      34027  ·          122  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  X509          ·  setTrustedPublicKey               ·          -  ·          -  ·     273341  ·            1  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  X509          ·  validateCertificate               ·     897162  ·    1145111  ·    1016162  ·            4  ·          -  │
·················|····································|·············|·············|·············|···············|··············
|  Deployments                                        ·                                         ·  % of limit   ·             │
······················································|·············|·············|·············|···············|··············
|  Challenges                                         ·    3841909  ·    3841945  ·    3841945  ·       12.8 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  ChallengesUtil                                     ·          -  ·          -  ·     692210  ·        2.3 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  ERC1155Mock                                        ·          -  ·          -  ·    1383839  ·        4.6 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  ERC20Mock                                          ·          -  ·          -  ·     626717  ·        2.1 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  ERC721Mock                                         ·          -  ·          -  ·    1324797  ·        4.4 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  MerkleTree_Stateless                               ·     390101  ·     390125  ·     390113  ·        1.3 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  MerkleTree_StatelessMock                           ·          -  ·          -  ·     299601  ·          1 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  Poseidon                                           ·          -  ·          -  ·    2279058  ·        7.6 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  Proposers                                          ·          -  ·          -  ·    2158358  ·        7.2 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  SanctionsListMock                                  ·          -  ·          -  ·     124946  ·        0.4 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  Shield                                             ·          -  ·          -  ·    3673583  ·       12.2 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  State                                              ·          -  ·          -  ·    5307692  ·       17.7 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  Utils                                              ·          -  ·          -  ·     735776  ·        2.5 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  Verifier                                           ·          -  ·          -  ·    1301953  ·        4.3 %  ·          -  │
······················································|·············|·············|·············|···············|··············
|  X509                                               ·          -  ·          -  ·    3838277  ·       12.8 %  ·          -  │
·-----------------------------------------------------|-------------|-------------|-------------|---------------|-------------·

'proposeBlock' - benchmarks:

  Gas test
    Deposits
Creating a block with 45 deposits
Block proposal gas used was 504374, gas used per transaction was 10964.652173913044
Deposit L1 average gas used was 127884.69565217392
      ✓ should be a reasonable gas cost
Transactions still in the mempool: 1
Block proposal gas used was 134673, gas used per transaction was 2927.6739130434785
There are no transactions in the mempool
    Transfers
Creating a block with 32 transfers
Block proposal gas used was 421155, gas used per transaction was 12762.272727272728
Transfer L1 average gas used, if on-chain, was 80906.90909090909
      ✓ should be a reasonable gas cost
Transactions still in the mempool: 1
Block proposal gas used was 135889, gas used per transaction was 4117.848484848485
There are no transactions in the mempool
    Withdraws
Creating a block with 33 withdraws
Block proposal gas used was 361223, gas used per transaction was 10624.20588235294
Withdraw L1 average gas used, if on-chain, was 78595.76470588235
      ✓ should be a reasonable gas cost
Transactions still in the mempool: 1
Block proposal gas used was 133595, gas used per transaction was 3929.264705882353
There are no transactions in the mempool
    Finalise withdraws
The gas used for finalise withdraw, back to L1, was 145272
      ✓ should withdraw from L2, checking for L1 balance (only with time-jump client)

Experimental Config Solc: 0.8.17 Optimizer : enabled Runs: 10000 Yul ir pipeline: enabled custom optimizer config all inline assembly blocks marked as "memory-safe"

compilation time - 43 seconds (on my macbook pro M1 pro)

contract sizes:

 ·----------------------------|--------------|----------------·
 |  Contract Name             ·  Size (KiB)  ·  Change (KiB)  │
 ·····························|··············|·················
 |  console                   ·       0.057  ·        -0.027  │
 ·····························|··············|·················
 |  Pairing                   ·       0.057  ·        -0.027  │
 ·····························|··············|·················
 |  Structures                ·       0.057  ·        -0.005  │
 ·····························|··············|·················
 |  AddressUpgradeable        ·       0.057  ·        -0.027  │
 ·····························|··············|·················
 |  Address                   ·       0.057  ·        -0.027  │
 ·····························|··············|·················
 |  Strings                   ·       0.057  ·        -0.027  │
 ·····························|··············|·················
 |  Counters                  ·       0.057  ·        -0.027  │
 ·····························|··············|·················
 |  SafeERC20Upgradeable      ·       0.057  ·        -0.027  │
 ·····························|··············|·················
 |  SanctionsListMock         ·       0.230  ·        +0.018  │
 ·····························|··············|·················
 |  Migrations                ·       0.347  ·        +0.099  │
 ·····························|··············|·················
 |  Ownable                   ·       0.820  ·        +0.134  │
 ·····························|··············|·················
 |  MerkleTree_StatelessMock  ·       1.039  ·        -0.075  │
 ·····························|··············|·················
 |  MerkleTree_Stateless      ·       1.523  ·                │
 ·····························|··············|·················
 |  Key_Registry              ·       1.905  ·        -0.157  │
 ·····························|··············|·················
 |  Config                    ·       2.700  ·        -0.075  │
 ·····························|··············|·················
 |  Utils                     ·       2.763  ·        -0.324  │
 ·····························|··············|·················
 |  ERC20Mock                 ·       2.770  ·        +0.648  │
 ·····························|··············|·················
 |  ERC20                     ·       2.770  ·        +0.648  │
 ·····························|··············|·················
 |  ChallengesUtil            ·       2.854  ·        -0.037  │
 ·····························|··············|·················
 |  DERParser                 ·       3.105  ·        +0.237  │
 ·····························|··············|·················
 |  SimpleMultiSig            ·       3.566  ·        +0.159  │
 ·····························|··············|·················
 |  Verifier                  ·       4.153  ·        -1.491  │
 ·····························|··············|·················
 |  ERC721                    ·       4.544  ·        +0.283  │
 ·····························|··············|·················
 |  ERC1155                   ·       4.992  ·        +0.119  │
 ·····························|··············|·················
 |  ERC1155Mock               ·       5.181  ·        +0.185  │
 ·····························|··············|·················
 |  ERC721Mock                ·       5.694  ·        +0.181  │
 ·····························|··············|·················
 |  Poseidon                  ·       8.892  ·        -1.166  │
 ·····························|··············|·················
 |  Proposers                 ·       9.180  ·        -0.347  │
 ·····························|··············|·················
 |  X509                      ·      16.245  ·        -0.871  │
 ·····························|··············|·················
 |  Shield                    ·      16.357  ·        -0.019  │
 ·····························|··············|·················
 |  Challenges                ·      16.589  ·        -0.547  │
 ·····························|··············|·················
 |  State                     ·      19.920  ·        -3.838  │
 ·----------------------------|--------------|----------------·

gas profile:

·-----------------------------------------------------|---------------------------|---------------|-----------------------------·
|                Solc version: 0.8.17                 ·  Optimizer enabled: true  ·  Runs: 10000  ·  Block limit: 30000000 gas  │
······················································|···························|···············|······························
|  Methods                                                                                                                      │
·················|····································|·············|·············|···············|···············|··············
|  Contract      ·  Method                            ·  Min        ·  Max        ·  Avg          ·  # calls      ·  usd (avg)  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  challengeCommitment               ·     230896  ·     230907  ·       230902  ·            4  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  challengeHistoricRootBlockNumber  ·          -  ·          -  ·       213356  ·            2  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  challengeLeafCountCorrect         ·          -  ·          -  ·       227610  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  challengeNewFrontierCorrect       ·          -  ·          -  ·       272338  ·            2  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  challengeNewRootCorrect           ·          -  ·          -  ·      1051513  ·            2  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  challengeNullifier                ·          -  ·          -  ·       231470  ·            2  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  commitToChallenge                 ·      53264  ·      53276  ·        53273  ·           22  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  initialize                        ·          -  ·          -  ·        67465  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  setBootProposer                   ·          -  ·          -  ·        55595  ·            2  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  setFeeL2TokenAddress              ·          -  ·          -  ·        53971  ·           54  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  setMaxProposers                   ·      35914  ·      36139  ·        36064  ·            3  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  setRestriction                    ·      76342  ·      77062  ·        76432  ·            8  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Challenges    ·  setStateContract                  ·      39281  ·      39448  ·        39352  ·          140  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  ERC1155Mock   ·  safeTransferFrom                  ·          -  ·          -  ·        65845  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  ERC1155Mock   ·  setApprovalForAll                 ·          -  ·          -  ·        46031  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  ERC20Mock     ·  approve                           ·          -  ·          -  ·        45905  ·            5  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  ERC20Mock     ·  transfer                          ·          -  ·          -  ·        51239  ·            4  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  ERC721Mock    ·  approve                           ·          -  ·          -  ·        48547  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  ERC721Mock    ·  awardItem                         ·          -  ·          -  ·       114465  ·            2  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Key_Registry  ·  registerVerificationKey           ·      37762  ·      57674  ·        51033  ·          255  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Proposers     ·  deRegisterProposer                ·          -  ·          -  ·       128341  ·            3  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Proposers     ·  registerProposer                  ·     389280  ·    1426453  ·       475711  ·           24  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Proposers     ·  updateProposer                    ·      73887  ·      92906  ·        83397  ·            2  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Proposers     ·  withdrawStake                     ·          -  ·          -  ·        93073  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Shield        ·  advanceWithdrawal                 ·          -  ·          -  ·       134186  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Shield        ·  finaliseWithdrawal                ·     137320  ·     163254  ·       150252  ·            4  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Shield        ·  requestBlockPayment               ·          -  ·          -  ·       145987  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Shield        ·  setAdvanceWithdrawalFee           ·          -  ·          -  ·       103963  ·            4  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Shield        ·  submitTransaction                 ·      77384  ·     147617  ·       130873  ·           11  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  addPendingWithdrawal              ·          -  ·          -  ·        54704  ·            2  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  changeCurrentProposer             ·      92354  ·     496424  ·       143058  ·          553  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  popBlockData                      ·          -  ·          -  ·        41645  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  proposeBlock                      ·     158400  ·     174952  ·       165182  ·           59  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  removeProposer                    ·     107973  ·     153628  ·       130801  ·            2  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  rewardChallenger                  ·          -  ·          -  ·        83440  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  setBlockStakeWithdrawn            ·          -  ·          -  ·        37667  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  setCurrentProposer                ·      63483  ·     163108  ·       160844  ·           44  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  setNumProposers                   ·      34213  ·    1212828  ·       106599  ·          153  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  setProposer                       ·     149635  ·     149683  ·       149680  ·          166  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  setProposerStartBlock             ·      31921  ·      53833  ·        32027  ·          553  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  setStakeAccount                   ·      55246  ·      55294  ·        55267  ·          163  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  updateProposer                    ·          -  ·          -  ·        43452  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  updateStakeAccountTime            ·          -  ·          -  ·        53479  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  State         ·  withdraw                          ·          -  ·          -  ·        42832  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  X509          ·  addCertificatePolicies            ·      74128  ·     113500  ·        94728  ·            3  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  X509          ·  addExtendedKeyUsage               ·      74148  ·     136080  ·       102276  ·            3  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  X509          ·  enableWhitelisting                ·      24060  ·      34176  ·        34081  ·          122  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  X509          ·  setTrustedPublicKey               ·          -  ·          -  ·       273188  ·            1  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  X509          ·  validateCertificate               ·     932815  ·    1199664  ·      1058673  ·            4  ·          -  │
·················|····································|·············|·············|···············|···············|··············
|  Deployments                                        ·                                           ·  % of limit   ·             │
······················································|·············|·············|···············|···············|··············
|  Challenges                                         ·    3707110  ·    3707122  ·      3707122  ·       12.4 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  ChallengesUtil                                     ·          -  ·          -  ·       680177  ·        2.3 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  ERC1155Mock                                        ·          -  ·          -  ·      1409608  ·        4.7 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  ERC20Mock                                          ·          -  ·          -  ·       768378  ·        2.6 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  ERC721Mock                                         ·          -  ·          -  ·      1362380  ·        4.5 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  MerkleTree_Stateless                               ·     387382  ·     387418  ·       387400  ·        1.3 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  MerkleTree_StatelessMock                           ·          -  ·          -  ·       282287  ·        0.9 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  Poseidon                                           ·          -  ·          -  ·      2021675  ·        6.7 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  Proposers                                          ·          -  ·          -  ·      2070542  ·        6.9 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  SanctionsListMock                                  ·          -  ·          -  ·       128869  ·        0.4 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  Shield                                             ·          -  ·          -  ·      3649165  ·       12.2 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  State                                              ·          -  ·          -  ·      4447726  ·       14.8 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  Utils                                              ·          -  ·          -  ·       662420  ·        2.2 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  Verifier                                           ·          -  ·          -  ·       969628  ·        3.2 %  ·          -  │
······················································|·············|·············|···············|···············|··············
|  X509                                               ·          -  ·          -  ·      3621905  ·       12.1 %  ·          -  │
·-----------------------------------------------------|-------------|-------------|---------------|---------------|-------------·

'proposeBlock' - benchmarks:

  Gas test
    Deposits
Creating a block with 45 deposits
Block proposal gas used was 503393, gas used per transaction was 10943.326086956522
Deposit L1 average gas used was 126952.13043478261
      ✓ should be a reasonable gas cost
Transactions still in the mempool: 1
Block proposal gas used was 134084, gas used per transaction was 2914.8695652173915
There are no transactions in the mempool
    Transfers
Creating a block with 32 transfers
Block proposal gas used was 420152, gas used per transaction was 12731.878787878788
Transfer L1 average gas used, if on-chain, was 80364.36363636363
      ✓ should be a reasonable gas cost
Transactions still in the mempool: 1
Block proposal gas used was 135324, gas used per transaction was 4100.727272727273
There are no transactions in the mempool
    Withdraws
Creating a block with 33 withdraws
Block proposal gas used was 360547, gas used per transaction was 10604.323529411764
Withdraw L1 average gas used, if on-chain, was 78057.88235294117
      ✓ should be a reasonable gas cost
Transactions still in the mempool: 1
Block proposal gas used was 132970, gas used per transaction was 3910.8823529411766
There are no transactions in the mempool
    Finalise withdraws
The gas used for finalise withdraw, back to L1, was 143445
      ✓ should withdraw from L2, checking for L1 balance (only with time-jump client)
Westlad commented 1 year ago

Closing due to inactivity.