Skip to content
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

fix: improve _findCreatedPayload #346

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

brotherlymite
Copy link
Contributor

When validating already created payload, we loop through all payloadIds which increases the script time when creating payload, with this change we only check last 20 payload to validate if payload is created or not to reduce the payload creation script time.

Copy link
Contributor

Foundry report

forge 0.0.2 (2aa8fa7 2024-09-27T00:25:13.103811060Z)
Build log
Compiling 174 files with zksolc and solc 0.8.20
zksolc and solc 0.8.20 finished in 91.01s
Compiler run successful!
| Contract                               | Size (B) | Margin (B) |
|----------------------------------------|----------|------------|
| AaveArbEthERC20Bridge                  |   11,872 |    439,127 |
| AaveGovernanceV2                       |      224 |    450,775 |
| AaveOpEthERC20Bridge                   |   10,592 |    440,407 |
| AavePolEthERC20Bridge                  |   16,544 |    434,455 |
| AavePolEthPlasmaBridge                 |   13,408 |    437,591 |
| AaveSwapper                            |   19,488 |    431,511 |
| AaveV2Avalanche                        |      224 |    450,775 |
| AaveV2AvalancheAssets                  |      224 |    450,775 |
| AaveV2ConfigEngine                     |    8,992 |    442,007 |
| AaveV2Ethereum                         |      224 |    450,775 |
| AaveV2EthereumAMM                      |      224 |    450,775 |
| AaveV2EthereumAMMAssets                |      224 |    450,775 |
| AaveV2EthereumAssets                   |      224 |    450,775 |
| AaveV2Polygon                          |      224 |    450,775 |
| AaveV2PolygonAssets                    |      224 |    450,775 |
| AaveV3Arbitrum                         |      224 |    450,775 |
| AaveV3ArbitrumAssets                   |      224 |    450,775 |
| AaveV3ArbitrumEModes                   |      224 |    450,775 |
| AaveV3ArbitrumExternalLibraries        |      224 |    450,775 |
| AaveV3Avalanche                        |      224 |    450,775 |
| AaveV3AvalancheAssets                  |      224 |    450,775 |
| AaveV3AvalancheEModes                  |      224 |    450,775 |
| AaveV3AvalancheExternalLibraries       |      224 |    450,775 |
| AaveV3BNB                              |      224 |    450,775 |
| AaveV3BNBAssets                        |      224 |    450,775 |
| AaveV3BNBEModes                        |      224 |    450,775 |
| AaveV3BNBExternalLibraries             |      224 |    450,775 |
| AaveV3Base                             |      224 |    450,775 |
| AaveV3BaseAssets                       |      224 |    450,775 |
| AaveV3BaseEModes                       |      224 |    450,775 |
| AaveV3BaseExternalLibraries            |      224 |    450,775 |
| AaveV3Ethereum                         |      224 |    450,775 |
| AaveV3EthereumAssets                   |      224 |    450,775 |
| AaveV3EthereumEModes                   |      224 |    450,775 |
| AaveV3EthereumEtherFi                  |      224 |    450,775 |
| AaveV3EthereumEtherFiAssets            |      224 |    450,775 |
| AaveV3EthereumEtherFiEModes            |      224 |    450,775 |
| AaveV3EthereumEtherFiExternalLibraries |      224 |    450,775 |
| AaveV3EthereumExternalLibraries        |      224 |    450,775 |
| AaveV3EthereumLido                     |      224 |    450,775 |
| AaveV3EthereumLidoAssets               |      224 |    450,775 |
| AaveV3EthereumLidoEModes               |      224 |    450,775 |
| AaveV3EthereumLidoExternalLibraries    |      224 |    450,775 |
| AaveV3Gnosis                           |      224 |    450,775 |
| AaveV3GnosisAssets                     |      224 |    450,775 |
| AaveV3GnosisEModes                     |      224 |    450,775 |
| AaveV3GnosisExternalLibraries          |      224 |    450,775 |
| AaveV3Metis                            |      224 |    450,775 |
| AaveV3MetisAssets                      |      224 |    450,775 |
| AaveV3MetisEModes                      |      224 |    450,775 |
| AaveV3MetisExternalLibraries           |      224 |    450,775 |
| AaveV3Optimism                         |      224 |    450,775 |
| AaveV3OptimismAssets                   |      224 |    450,775 |
| AaveV3OptimismEModes                   |      224 |    450,775 |
| AaveV3OptimismExternalLibraries        |      224 |    450,775 |
| AaveV3Polygon                          |      224 |    450,775 |
| AaveV3PolygonAssets                    |      224 |    450,775 |
| AaveV3PolygonEModes                    |      224 |    450,775 |
| AaveV3PolygonExternalLibraries         |      224 |    450,775 |
| AaveV3PolygonZkEvm                     |      224 |    450,775 |
| AaveV3PolygonZkEvmAssets               |      224 |    450,775 |
| AaveV3PolygonZkEvmEModes               |      224 |    450,775 |
| AaveV3Scroll                           |      224 |    450,775 |
| AaveV3ScrollAssets                     |      224 |    450,775 |
| AaveV3ScrollEModes                     |      224 |    450,775 |
| AaveV3ScrollExternalLibraries          |      224 |    450,775 |
| AaveWstethWithdrawer                   |   19,744 |    431,255 |
| Address                                |      224 |    450,775 |
| CapsPlusRiskSteward                    |    9,632 |    441,367 |
| CapsPlusRiskStewardErrors              |    1,440 |    449,559 |
| ChainHelpers                           |      224 |    450,775 |
| ChainIds                               |      224 |    450,775 |
| ConfiguratorInputTypes                 |      224 |    450,775 |
| Create2Utils                           |      480 |    450,519 |
| Create2UtilsZkSync                     |      480 |    450,519 |
| DataTypes                              |      224 |    450,775 |
| DefaultReserveInterestRateStrategy     |   17,696 |    433,303 |
| DeployV2EngineAvaLib                   |      224 |    450,775 |
| DeployV2EngineEthAMMLib                |      224 |    450,775 |
| DeployV2EngineEthLib                   |      224 |    450,775 |
| DeployV2EnginePolLib                   |      224 |    450,775 |
| DeployV2RatesFactoryAvaLib             |      224 |    450,775 |
| DeployV2RatesFactoryEthAMMLib          |      224 |    450,775 |
| DeployV2RatesFactoryEthLib             |      224 |    450,775 |
| DeployV2RatesFactoryLib                |      224 |    450,775 |
| DeployV2RatesFactoryPolLib             |      224 |    450,775 |
| ERC1967Proxy                           |    5,088 |    445,911 |
| EngineFlags                            |      224 |    450,775 |
| Errors                                 |   14,176 |    436,823 |
| FreezingSteward                        |    3,872 |    447,127 |
| GovV3Helpers                           |   11,936 |    439,063 |
| GovV3StorageHelpers                    |      224 |    450,775 |
| GovernanceV3Arbitrum                   |      224 |    450,775 |
| GovernanceV3Avalanche                  |      224 |    450,775 |
| GovernanceV3BNB                        |      224 |    450,775 |
| GovernanceV3Base                       |      224 |    450,775 |
| GovernanceV3Ethereum                   |      224 |    450,775 |
| GovernanceV3Gnosis                     |      224 |    450,775 |
| GovernanceV3Metis                      |      224 |    450,775 |
| GovernanceV3Optimism                   |      224 |    450,775 |
| GovernanceV3Polygon                    |      224 |    450,775 |
| GovernanceV3PolygonZkEvm               |      224 |    450,775 |
| GovernanceV3Scroll                     |      224 |    450,775 |
| GovernanceV3ZkSync                     |      224 |    450,775 |
| IpfsUtils                              |      224 |    450,775 |
| MiscAvalanche                          |      224 |    450,775 |
| MiscEthereum                           |      224 |    450,775 |
| MiscPolygon                            |      224 |    450,775 |
| PayloadsControllerUtils                |      224 |    450,775 |
| PercentageMath                         |      224 |    450,775 |
| ProxyAdmin                             |    7,200 |    443,799 |
| ProxyHelpers                           |      224 |    450,775 |
| ReserveConfiguration                   |      480 |    450,519 |
| SafeERC20                              |      224 |    450,775 |
| SafeMath                               |      224 |    450,775 |
| StorageHelpers                         |      224 |    450,775 |
| StorageSlot                            |      224 |    450,775 |
| TestNetChainIds                        |      224 |    450,775 |
| TransparentProxyFactory                |    8,608 |    442,391 |
| TransparentUpgradeableProxy            |   13,536 |    437,463 |
| V2RateStrategyFactory                  |   22,496 |    428,503 |
| WadRayMath                             |      224 |    450,775 |
Test success 🌈

@brotherlymite brotherlymite merged commit 8a96ac9 into master Sep 27, 2024
2 of 3 checks passed
@brotherlymite brotherlymite deleted the fix/reduce-createpayload-time branch September 27, 2024 14:47
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.

2 participants