@pimlico/alto 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contracts/EIP712.sol/EIP712.json +1 -1
- package/contracts/ERC165.sol/ERC165.json +1 -1
- package/contracts/ERC20.sol/ERC20.json +1 -1
- package/contracts/Eip7702Support.sol/Eip7702Support.json +1 -1
- package/contracts/EntryPoint.sol/EntryPoint.json +1 -1
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride06.json +1 -1
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride07.json +1 -1
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride08.json +1 -1
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride09.json +1 -0
- package/contracts/EntryPointGasEstimationOverride.sol/EntryPointGasEstimationOverride06.json +1 -1
- package/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -1
- package/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -1
- package/contracts/EntryPointSimulations.sol/EntryPointSimulations09.json +1 -0
- package/contracts/Exec.sol/Exec.json +1 -1
- package/contracts/IAccount.sol/IAccount.json +1 -1
- package/contracts/IAccountExecute.sol/IAccountExecute.json +1 -1
- package/contracts/IAggregator.sol/IAggregator.json +1 -1
- package/contracts/IERC165.sol/IERC165.json +1 -1
- package/contracts/IERC5267.sol/IERC5267.json +1 -1
- package/contracts/IEntryPoint.sol/IEntryPoint.json +1 -1
- package/contracts/IEntryPointFilterOpsOverride.sol/IEntryPointFilterOpsOverride08.json +1 -0
- package/contracts/IEntryPointFilterOpsOverride.sol/IEntryPointFilterOpsOverride09.json +1 -0
- package/contracts/IEntryPointSimulations.sol/IEntryPointSimulations.json +1 -1
- package/contracts/INonceManager.sol/INonceManager.json +1 -1
- package/contracts/IPaymaster.sol/IPaymaster.json +1 -1
- package/contracts/ISenderCreator.sol/ISenderCreator.json +1 -1
- package/contracts/IStakeManager.sol/IStakeManager.json +1 -1
- package/contracts/LibBytes.sol/LibBytes.json +1 -1
- package/contracts/Math.sol/Math.json +1 -1
- package/contracts/MessageHashUtils.sol/MessageHashUtils.json +1 -1
- package/contracts/NonceManager.sol/NonceManager.json +1 -1
- package/contracts/Panic.sol/Panic.json +1 -1
- package/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -1
- package/contracts/ReentrancyGuard.sol/ReentrancyGuard.json +1 -1
- package/contracts/ReentrancyGuardTransient.sol/ReentrancyGuardTransient.json +1 -1
- package/contracts/SafeCast.sol/SafeCast.json +1 -1
- package/contracts/SenderCreator.sol/SenderCreator.json +1 -1
- package/contracts/ShortStrings.sol/ShortStrings.json +1 -1
- package/contracts/SignedMath.sol/SignedMath.json +1 -1
- package/contracts/SimulationOverrideHelper.sol/SimulationOverrideHelper.json +1 -0
- package/contracts/StakeManager.sol/StakeManager.json +1 -1
- package/contracts/StorageSlot.sol/StorageSlot.json +1 -1
- package/contracts/Strings.sol/Strings.json +1 -1
- package/contracts/TransientSlot.sol/TransientSlot.json +1 -1
- package/contracts/UserOperation.sol/UserOperationLib.json +1 -1
- package/contracts/UserOperationLib.sol/UserOperationLib.json +1 -1
- package/contracts/account-abstraction-v9/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -0
- package/contracts/account-abstraction-v9/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -0
- package/contracts/account-abstraction-v9/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -0
- package/contracts/account-abstraction-v9/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -0
- package/contracts/build-info/{880955d5786bfdae.json → 031b289b93191224.json} +1 -1
- package/contracts/build-info/181f3522c3744403.json +1 -0
- package/contracts/build-info/a2db592afab5c9de.json +1 -0
- package/contracts/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -1
- package/contracts/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -1
- package/contracts/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -1
- package/contracts/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -1
- package/contracts/core/Eip7702Support.sol/Eip7702Support.json +1 -0
- package/contracts/core/NonceManager.sol/NonceManager.json +1 -0
- package/contracts/core/SenderCreator.sol/SenderCreator.json +1 -0
- package/contracts/core/StakeManager.sol/StakeManager.json +1 -0
- package/contracts/core/UserOperationLib.sol/UserOperationLib.json +1 -0
- package/contracts/interfaces/IAccount.sol/IAccount.json +1 -0
- package/contracts/interfaces/IAccountExecute.sol/IAccountExecute.json +1 -0
- package/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -1
- package/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -1
- package/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -1
- package/contracts/interfaces/IPaymaster.sol/IPaymaster.json +1 -0
- package/contracts/interfaces/ISenderCreator.sol/ISenderCreator.json +1 -0
- package/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -1
- package/contracts/overrides/Eip7702Support.sol/Eip7702Support.json +1 -0
- package/contracts/overrides/NonceManager.sol/NonceManager.json +1 -0
- package/contracts/overrides/SenderCreator.sol/SenderCreator.json +1 -0
- package/contracts/overrides/StakeManager.sol/StakeManager.json +1 -0
- package/contracts/overrides/UserOperationLib.sol/UserOperationLib.json +1 -0
- package/contracts/utils/Exec.sol/Exec.json +1 -1
- package/contracts/utils/StorageSlot.sol/StorageSlot.json +1 -0
- package/contracts/v09/EntryPoint.sol/EntryPoint.json +1 -0
- package/esm/cli/alto.js +17 -6
- package/esm/cli/alto.js.map +1 -1
- package/esm/cli/config/bundler.d.ts +459 -321
- package/esm/cli/config/bundler.js +125 -91
- package/esm/cli/config/bundler.js.map +1 -1
- package/esm/cli/config/options.d.ts +4 -1
- package/esm/cli/config/options.js +233 -106
- package/esm/cli/config/options.js.map +1 -1
- package/esm/cli/customTransport.d.ts +3 -3
- package/esm/cli/deploySimulationsContract.d.ts +1 -0
- package/esm/cli/deploySimulationsContract.js +41 -5
- package/esm/cli/deploySimulationsContract.js.map +1 -1
- package/esm/cli/handler.js +76 -80
- package/esm/cli/handler.js.map +1 -1
- package/esm/cli/multiRpcTransport.d.ts +7 -0
- package/esm/cli/multiRpcTransport.js +52 -0
- package/esm/cli/multiRpcTransport.js.map +1 -0
- package/esm/cli/setupServer.js +92 -70
- package/esm/cli/setupServer.js.map +1 -1
- package/esm/cli/shutDown.d.ts +20 -0
- package/esm/cli/shutDown.js +285 -0
- package/esm/cli/shutDown.js.map +1 -0
- package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride06.json +1 -1
- package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride07.json +1 -1
- package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride08.json +1 -1
- package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride09.json +1 -0
- package/esm/contracts/EntryPointGasEstimationOverride.sol/EntryPointGasEstimationOverride06.json +1 -1
- package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -1
- package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -1
- package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations09.json +1 -0
- package/esm/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -1
- package/esm/createConfig.d.ts +9 -2
- package/esm/createConfig.js.map +1 -1
- package/esm/executor/{userOpMonitor.d.ts → bundleManager.d.ts} +56 -37
- package/esm/executor/bundleManager.js +393 -0
- package/esm/executor/bundleManager.js.map +1 -0
- package/esm/executor/executor.d.ts +4 -3
- package/esm/executor/executor.js +47 -23
- package/esm/executor/executor.js.map +1 -1
- package/esm/executor/executorManager.d.ts +20 -15
- package/esm/executor/executorManager.js +248 -67
- package/esm/executor/executorManager.js.map +1 -1
- package/esm/executor/filterOpsAndEstimateGas.d.ts +17 -2
- package/esm/executor/filterOpsAndEstimateGas.js +100 -77
- package/esm/executor/filterOpsAndEstimateGas.js.map +1 -1
- package/esm/executor/getBundleStatus.d.ts +5 -1
- package/esm/executor/getBundleStatus.js.map +1 -1
- package/esm/executor/index.d.ts +1 -0
- package/esm/executor/index.js +1 -0
- package/esm/executor/index.js.map +1 -1
- package/esm/executor/senderManager/createMemorySenderManager.js +13 -0
- package/esm/executor/senderManager/createMemorySenderManager.js.map +1 -1
- package/esm/executor/senderManager/createRedisSenderManager.d.ts +2 -1
- package/esm/executor/senderManager/createRedisSenderManager.js +45 -26
- package/esm/executor/senderManager/createRedisSenderManager.js.map +1 -1
- package/esm/executor/senderManager/flushOnStartUp.js +7 -5
- package/esm/executor/senderManager/flushOnStartUp.js.map +1 -1
- package/esm/executor/senderManager/index.d.ts +1 -0
- package/esm/executor/senderManager/index.js +6 -2
- package/esm/executor/senderManager/index.js.map +1 -1
- package/esm/executor/senderManager/validateAndRefill.js +268 -85
- package/esm/executor/senderManager/validateAndRefill.js.map +1 -1
- package/esm/executor/utils.d.ts +8 -3
- package/esm/executor/utils.js +59 -27
- package/esm/executor/utils.js.map +1 -1
- package/esm/handlers/arbitrumGasPriceManager.d.ts +3 -2
- package/esm/handlers/arbitrumGasPriceManager.js +6 -2
- package/esm/handlers/arbitrumGasPriceManager.js.map +1 -1
- package/esm/handlers/citreaManager.d.ts +10 -0
- package/esm/handlers/citreaManager.js +17 -0
- package/esm/handlers/citreaManager.js.map +1 -0
- package/esm/handlers/eventManager.d.ts +9 -9
- package/esm/handlers/eventManager.js +59 -60
- package/esm/handlers/eventManager.js.map +1 -1
- package/esm/handlers/gasPriceManager.d.ts +17 -10
- package/esm/handlers/gasPriceManager.js +245 -99
- package/esm/handlers/gasPriceManager.js.map +1 -1
- package/esm/handlers/mantleGasPriceManager.d.ts +4 -4
- package/esm/handlers/mantleGasPriceManager.js +4 -4
- package/esm/handlers/mantleGasPriceManager.js.map +1 -1
- package/esm/handlers/optimismManager.d.ts +1 -1
- package/esm/handlers/optimismManager.js +1 -1
- package/esm/handlers/optimismManager.js.map +1 -1
- package/esm/mempool/index.d.ts +1 -1
- package/esm/mempool/index.js +1 -1
- package/esm/mempool/index.js.map +1 -1
- package/esm/mempool/mempool.d.ts +61 -22
- package/esm/mempool/mempool.js +223 -133
- package/esm/mempool/mempool.js.map +1 -1
- package/esm/mempool/reputationManager.d.ts +14 -14
- package/esm/mempool/reputationManager.js +36 -39
- package/esm/mempool/reputationManager.js.map +1 -1
- package/esm/mempool/statusManager.d.ts +20 -0
- package/esm/mempool/statusManager.js +143 -0
- package/esm/mempool/statusManager.js.map +1 -0
- package/esm/receiptCache/createMemoryReceiptCache.d.ts +3 -0
- package/esm/receiptCache/createMemoryReceiptCache.js +30 -0
- package/esm/receiptCache/createMemoryReceiptCache.js.map +1 -0
- package/esm/receiptCache/createRedisReceiptCache.d.ts +10 -0
- package/esm/receiptCache/createRedisReceiptCache.js +56 -0
- package/esm/receiptCache/createRedisReceiptCache.js.map +1 -0
- package/esm/receiptCache/index.d.ts +11 -0
- package/esm/receiptCache/index.js +21 -0
- package/esm/receiptCache/index.js.map +1 -0
- package/esm/rpc/createMethodHandler.js.map +1 -1
- package/esm/rpc/estimation/gasEstimationHandler.d.ts +2 -4
- package/esm/rpc/estimation/gasEstimationHandler.js.map +1 -1
- package/esm/rpc/estimation/gasEstimations06.d.ts +6 -7
- package/esm/rpc/estimation/gasEstimations06.js +1 -5
- package/esm/rpc/estimation/gasEstimations06.js.map +1 -1
- package/esm/rpc/estimation/gasEstimations07.d.ts +13 -41
- package/esm/rpc/estimation/gasEstimations07.js +27 -34
- package/esm/rpc/estimation/gasEstimations07.js.map +1 -1
- package/esm/{utils/preVerificationGasCalulator.d.ts → rpc/estimation/preVerificationGasCalculator.d.ts} +20 -6
- package/esm/{utils/preVerificationGasCalulator.js → rpc/estimation/preVerificationGasCalculator.js} +134 -48
- package/esm/rpc/estimation/preVerificationGasCalculator.js.map +1 -0
- package/esm/rpc/estimation/types.d.ts +4 -2
- package/esm/rpc/estimation/utils.d.ts +10 -8
- package/esm/rpc/estimation/utils.js +56 -53
- package/esm/rpc/estimation/utils.js.map +1 -1
- package/esm/rpc/methods/boost_sendUserOperation.d.ts +304 -0
- package/esm/rpc/methods/boost_sendUserOperation.js +1 -1
- package/esm/rpc/methods/boost_sendUserOperation.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_clearReputation.js +1 -1
- package/esm/rpc/methods/debug_bundler_clearReputation.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_clearState.js +1 -1
- package/esm/rpc/methods/debug_bundler_clearState.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_dumpMempool.d.ts +338 -0
- package/esm/rpc/methods/debug_bundler_dumpReputation.js +1 -1
- package/esm/rpc/methods/debug_bundler_dumpReputation.js.map +1 -1
- package/esm/rpc/methods/eth_estimateUserOperationGas.d.ts +622 -14
- package/esm/rpc/methods/eth_estimateUserOperationGas.js +61 -30
- package/esm/rpc/methods/eth_estimateUserOperationGas.js.map +1 -1
- package/esm/rpc/methods/eth_getUserOperationByHash.d.ts +621 -11
- package/esm/rpc/methods/eth_getUserOperationByHash.js.map +1 -1
- package/esm/rpc/methods/eth_getUserOperationReceipt.d.ts +34 -34
- package/esm/rpc/methods/eth_getUserOperationReceipt.js +1 -1
- package/esm/rpc/methods/eth_sendUserOperation.d.ts +307 -3
- package/esm/rpc/methods/eth_sendUserOperation.js +153 -48
- package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -1
- package/esm/rpc/methods/pimlico_getUserOperationStatus.js +1 -1
- package/esm/rpc/methods/pimlico_getUserOperationStatus.js.map +1 -1
- package/esm/rpc/methods/pimlico_sendUserOperationNow.d.ts +338 -34
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js +26 -29
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js.map +1 -1
- package/esm/rpc/methods/pimlico_simulateAssetChange.d.ts +620 -12
- package/esm/rpc/methods/pimlico_simulateAssetChange.js +14 -19
- package/esm/rpc/methods/pimlico_simulateAssetChange.js.map +1 -1
- package/esm/rpc/rpcHandler.d.ts +38 -26
- package/esm/rpc/rpcHandler.js +97 -44
- package/esm/rpc/rpcHandler.js.map +1 -1
- package/esm/rpc/server.d.ts +5 -5
- package/esm/rpc/server.js +15 -11
- package/esm/rpc/server.js.map +1 -1
- package/esm/rpc/validation/BundlerCollectorTracerV06.js +1 -1
- package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +1 -1
- package/esm/rpc/validation/BundlerCollectorTracerV07.js +1 -1
- package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +1 -1
- package/esm/rpc/validation/SafeValidator.d.ts +13 -14
- package/esm/rpc/validation/SafeValidator.js +24 -24
- package/esm/rpc/validation/SafeValidator.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV06.d.ts +2 -2
- package/esm/rpc/validation/TracerResultParserV06.js +11 -11
- package/esm/rpc/validation/TracerResultParserV06.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV07.d.ts +2 -2
- package/esm/rpc/validation/TracerResultParserV07.js +13 -13
- package/esm/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/esm/rpc/validation/UnsafeValidator.d.ts +18 -14
- package/esm/rpc/validation/UnsafeValidator.js +76 -41
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
- package/esm/store/createMempoolStore.d.ts +1 -1
- package/esm/store/createMempoolStore.js +79 -140
- package/esm/store/createMempoolStore.js.map +1 -1
- package/esm/store/index.d.ts +4 -75
- package/esm/store/index.js +4 -1
- package/esm/store/index.js.map +1 -1
- package/esm/store/outstanding/index.d.ts +13 -0
- package/esm/store/outstanding/index.js +16 -0
- package/esm/store/outstanding/index.js.map +1 -0
- package/esm/store/{createMemoryOutstandingStore.d.ts → outstanding/memory.d.ts} +14 -13
- package/esm/store/outstanding/memory.js +263 -0
- package/esm/store/outstanding/memory.js.map +1 -0
- package/esm/store/outstanding/redis.d.ts +11 -0
- package/esm/store/outstanding/redis.js +229 -0
- package/esm/store/outstanding/redis.js.map +1 -0
- package/esm/store/outstanding/types.d.ts +19 -0
- package/esm/store/outstanding/types.js +2 -0
- package/esm/store/outstanding/types.js.map +1 -0
- package/esm/store/processing/index.d.ts +11 -0
- package/esm/store/processing/index.js +17 -0
- package/esm/store/processing/index.js.map +1 -0
- package/esm/store/processing/memory.d.ts +19 -0
- package/esm/store/processing/memory.js +83 -0
- package/esm/store/processing/memory.js.map +1 -0
- package/esm/store/processing/redis.d.ts +26 -0
- package/esm/store/processing/redis.js +123 -0
- package/esm/store/processing/redis.js.map +1 -0
- package/esm/store/processing/types.d.ts +12 -0
- package/esm/store/processing/types.js +2 -0
- package/esm/store/processing/types.js.map +1 -0
- package/esm/store/types.d.ts +52 -0
- package/esm/store/types.js +2 -0
- package/esm/store/types.js.map +1 -0
- package/esm/types/contracts/Multicall3.d.ts +34 -0
- package/esm/types/contracts/Multicall3.js +31 -0
- package/esm/types/contracts/Multicall3.js.map +1 -0
- package/esm/types/contracts/PimlicoSimulations.d.ts +81 -0
- package/esm/types/contracts/PimlicoSimulations.js +105 -0
- package/esm/types/contracts/PimlicoSimulations.js.map +1 -1
- package/esm/types/contracts/index.d.ts +1 -1
- package/esm/types/contracts/index.js +1 -1
- package/esm/types/contracts/index.js.map +1 -1
- package/esm/types/gasPrice.js +0 -18
- package/esm/types/gasPrice.js.map +1 -1
- package/esm/types/interfaces.d.ts +15 -10
- package/esm/types/mempool.d.ts +3 -0
- package/esm/types/schemas.d.ts +13184 -4741
- package/esm/types/schemas.js +116 -27
- package/esm/types/schemas.js.map +1 -1
- package/esm/types/utils.d.ts +2 -5
- package/esm/types/utils.js +16 -18
- package/esm/types/utils.js.map +1 -1
- package/esm/types/validation.d.ts +7646 -6912
- package/esm/types/validation.js +122 -152
- package/esm/types/validation.js.map +1 -1
- package/esm/utils/eip7702.d.ts +2 -1
- package/esm/utils/eip7702.js +14 -8
- package/esm/utils/eip7702.js.map +1 -1
- package/esm/utils/entryPointOverrides.js +18 -4
- package/esm/utils/entryPointOverrides.js.map +1 -1
- package/esm/utils/helpers.d.ts +7 -1
- package/esm/utils/helpers.js +36 -11
- package/esm/utils/helpers.js.map +1 -1
- package/esm/utils/index.d.ts +0 -1
- package/esm/utils/index.js +0 -1
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/metrics.d.ts +4 -1
- package/esm/utils/metrics.js +34 -7
- package/esm/utils/metrics.js.map +1 -1
- package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js +8 -9
- package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js.map +1 -1
- package/esm/utils/minMaxQueue/createRedisMinMaxQueue.d.ts +24 -2
- package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js +85 -64
- package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js.map +1 -1
- package/esm/utils/minMaxQueue/index.d.ts +2 -2
- package/esm/utils/minMaxQueue/index.js +4 -3
- package/esm/utils/minMaxQueue/index.js.map +1 -1
- package/esm/utils/rpc-reply.d.ts +3 -3
- package/esm/utils/rpc-reply.js.map +1 -1
- package/esm/utils/toViemStateOverrides.js +7 -7
- package/esm/utils/toViemStateOverrides.js.map +1 -1
- package/esm/utils/userop.d.ts +110 -56
- package/esm/utils/userop.js +161 -249
- package/esm/utils/userop.js.map +1 -1
- package/package.json +4 -2
- package/contracts/build-info/7710b5a048396e70.json +0 -1
- package/esm/executor/userOpMonitor.js +0 -326
- package/esm/executor/userOpMonitor.js.map +0 -1
- package/esm/executor/utilityWalletMonitor.d.ts +0 -19
- package/esm/executor/utilityWalletMonitor.js +0 -38
- package/esm/executor/utilityWalletMonitor.js.map +0 -1
- package/esm/mempool/monitoring.d.ts +0 -15
- package/esm/mempool/monitoring.js +0 -118
- package/esm/mempool/monitoring.js.map +0 -1
- package/esm/store/createMemoryOutstandingStore.js +0 -240
- package/esm/store/createMemoryOutstandingStore.js.map +0 -1
- package/esm/store/createRedisOutstandingStore.d.ts +0 -27
- package/esm/store/createRedisOutstandingStore.js +0 -344
- package/esm/store/createRedisOutstandingStore.js.map +0 -1
- package/esm/store/createRedisStore.d.ts +0 -9
- package/esm/store/createRedisStore.js +0 -131
- package/esm/store/createRedisStore.js.map +0 -1
- package/esm/store/createStore.d.ts +0 -6
- package/esm/store/createStore.js +0 -66
- package/esm/store/createStore.js.map +0 -1
- package/esm/types/contracts/CallEngine.d.ts +0 -28
- package/esm/types/contracts/CallEngine.js +0 -37
- package/esm/types/contracts/CallEngine.js.map +0 -1
- package/esm/utils/preVerificationGasCalulator.js.map +0 -1
|
@@ -1,76 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getSerializedHandleOpsTx, scaleBigIntByPercent, toPackedUserOp } from "../utils/index.js";
|
|
1
|
+
import { scaleBigIntByPercent, toPackedUserOp } from "../utils/index.js";
|
|
3
2
|
import * as sentry from "@sentry/node";
|
|
4
|
-
import { decodeAbiParameters, decodeErrorResult, encodeFunctionData
|
|
3
|
+
import { decodeAbiParameters, decodeErrorResult, encodeFunctionData } from "viem";
|
|
5
4
|
import { entryPoint07Abi } from "viem/account-abstraction";
|
|
6
5
|
import { formatAbiItemWithArgs } from "viem/utils";
|
|
6
|
+
import { getArbitrumL1GasEstimate } from "../rpc/estimation/preVerificationGasCalculator.js";
|
|
7
7
|
import { pimlicoSimulationsAbi } from "../types/contracts/PimlicoSimulations.js";
|
|
8
8
|
import { getEip7702DelegationOverrides } from "../utils/eip7702.js";
|
|
9
9
|
import { getFilterOpsStateOverride } from "../utils/entryPointOverrides.js";
|
|
10
|
-
import {
|
|
10
|
+
import { getBundleGasLimit } from "./utils.js";
|
|
11
11
|
// Returns the chain specfic overhead that can't be calculated onchain.
|
|
12
12
|
const getChainSpecificOverhead = async ({ config, entryPoint, userOps }) => {
|
|
13
13
|
const { publicClient, chainType } = config;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
entryPoint,
|
|
20
|
-
chainId: publicClient.chain?.id ?? 10,
|
|
21
|
-
removeZeros: false
|
|
22
|
-
});
|
|
23
|
-
const arbGasPriceOracle = getContract({
|
|
24
|
-
abi: ArbitrumL1FeeAbi,
|
|
25
|
-
address: precompileAddress,
|
|
26
|
-
client: {
|
|
27
|
-
public: publicClient
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const { result } = await arbGasPriceOracle.simulate.gasEstimateL1Component([
|
|
31
|
-
entryPoint,
|
|
32
|
-
false,
|
|
33
|
-
serializedTx
|
|
34
|
-
]);
|
|
35
|
-
const [gasEstimateForL1, ,] = result;
|
|
36
|
-
return {
|
|
37
|
-
gasUsed: gasEstimateForL1,
|
|
38
|
-
// scaling by 10% as recommended by docs.
|
|
39
|
-
// https://github.com/OffchainLabs/nitro-contracts/blob/bdb8f8c68b2229fe9309fe9c03b37017abd1a2cd/src/node-interface/NodeInterface.sol#L105
|
|
40
|
-
gasLimit: scaleBigIntByPercent(gasEstimateForL1, 110n)
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
default:
|
|
44
|
-
return { gasUsed: 0n, gasLimit: 0n };
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const getBundleGasLimit = async ({ config, userOpBundle, entryPoint, executorAddress }) => {
|
|
48
|
-
const { rpcGasEstimate, publicClient } = config;
|
|
49
|
-
let gasLimit;
|
|
50
|
-
// On some chains we can't rely on local calculations and have to estimate the gasLimit from RPC
|
|
51
|
-
if (rpcGasEstimate) {
|
|
52
|
-
gasLimit = await publicClient.estimateGas({
|
|
53
|
-
to: entryPoint,
|
|
54
|
-
account: executorAddress,
|
|
55
|
-
data: encodeHandleOpsCalldata({
|
|
56
|
-
userOps: userOpBundle.map(({ userOp }) => userOp),
|
|
57
|
-
beneficiary: executorAddress
|
|
58
|
-
})
|
|
14
|
+
if (chainType === "arbitrum") {
|
|
15
|
+
const { gasForL1 } = await getArbitrumL1GasEstimate({
|
|
16
|
+
publicClient,
|
|
17
|
+
userOps,
|
|
18
|
+
entryPoint
|
|
59
19
|
});
|
|
20
|
+
return {
|
|
21
|
+
gasUsed: gasForL1,
|
|
22
|
+
// scaling by 10% as recommended by docs.
|
|
23
|
+
// https://github.com/OffchainLabs/nitro-contracts/blob/bdb8f8c68b2229fe9309fe9c03b37017abd1a2cd/src/node-interface/NodeInterface.sol#L105
|
|
24
|
+
gasLimit: scaleBigIntByPercent(gasForL1, 110n)
|
|
25
|
+
};
|
|
60
26
|
}
|
|
61
|
-
|
|
62
|
-
const aa95GasFloor = calculateAA95GasFloor({
|
|
63
|
-
userOps: userOpBundle.map(({ userOp }) => userOp),
|
|
64
|
-
beneficiary: executorAddress
|
|
65
|
-
});
|
|
66
|
-
const eip7702UserOpCount = userOpBundle.filter(({ userOp }) => userOp.eip7702Auth).length;
|
|
67
|
-
const eip7702Overhead = BigInt(eip7702UserOpCount) * 40000n;
|
|
68
|
-
// Add 5% safety margin to local estimates.
|
|
69
|
-
gasLimit = scaleBigIntByPercent(aa95GasFloor + eip7702Overhead, 105n);
|
|
70
|
-
}
|
|
71
|
-
return gasLimit;
|
|
27
|
+
return { gasUsed: 0n, gasLimit: 0n };
|
|
72
28
|
};
|
|
73
|
-
const getFilterOpsResult = async ({ config, userOpBundle, networkBaseFee, beneficiary }) => {
|
|
29
|
+
export const getFilterOpsResult = async ({ config, userOpBundle, networkBaseFee, beneficiary }) => {
|
|
74
30
|
const { publicClient, pimlicoSimulationContract, codeOverrideSupport, fixedGasLimitForEstimation } = config;
|
|
75
31
|
if (!pimlicoSimulationContract) {
|
|
76
32
|
throw new Error("pimlicoSimulationContract not set");
|
|
@@ -89,6 +45,18 @@ const getFilterOpsResult = async ({ config, userOpBundle, networkBaseFee, benefi
|
|
|
89
45
|
// Create promises for parallel execution
|
|
90
46
|
let data;
|
|
91
47
|
switch (version) {
|
|
48
|
+
case "0.9": {
|
|
49
|
+
data = encodeFunctionData({
|
|
50
|
+
abi: pimlicoSimulationsAbi,
|
|
51
|
+
functionName: "filterOps09",
|
|
52
|
+
args: [
|
|
53
|
+
userOps.map(({ userOp }) => toPackedUserOp(userOp)),
|
|
54
|
+
beneficiary,
|
|
55
|
+
entryPoint
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
92
60
|
case "0.8": {
|
|
93
61
|
data = encodeFunctionData({
|
|
94
62
|
abi: pimlicoSimulationsAbi,
|
|
@@ -126,8 +94,8 @@ const getFilterOpsResult = async ({ config, userOpBundle, networkBaseFee, benefi
|
|
|
126
94
|
}
|
|
127
95
|
}
|
|
128
96
|
const stateOverride = [
|
|
129
|
-
...(eip7702Override
|
|
130
|
-
...(simulationOverrides
|
|
97
|
+
...(eip7702Override ?? []),
|
|
98
|
+
...(simulationOverrides ?? [])
|
|
131
99
|
];
|
|
132
100
|
const callResult = await publicClient.call({
|
|
133
101
|
to: pimlicoSimulationContract,
|
|
@@ -159,14 +127,57 @@ const getFilterOpsResult = async ({ config, userOpBundle, networkBaseFee, benefi
|
|
|
159
127
|
], result);
|
|
160
128
|
return filterOpsResult[0];
|
|
161
129
|
};
|
|
130
|
+
const validateEip7702AuthNonces = async ({ userOps, publicClient }) => {
|
|
131
|
+
const eip7702UserOps = userOps.filter((userOpInfo) => userOpInfo.userOp.eip7702Auth !== null &&
|
|
132
|
+
userOpInfo.userOp.eip7702Auth !== undefined);
|
|
133
|
+
const nonEip7702UserOps = userOps.filter(({ userOp }) => !userOp.eip7702Auth);
|
|
134
|
+
const onchainNonces = await Promise.all(eip7702UserOps.map(({ userOp }) => publicClient.getTransactionCount({ address: userOp.sender })));
|
|
135
|
+
const rejectedUserOps = [];
|
|
136
|
+
const validEip7702UserOps = [];
|
|
137
|
+
for (let i = 0; i < eip7702UserOps.length; i++) {
|
|
138
|
+
const userOpInfo = eip7702UserOps[i];
|
|
139
|
+
const expectedNonce = onchainNonces[i];
|
|
140
|
+
const authNonce = userOpInfo.userOp.eip7702Auth.nonce;
|
|
141
|
+
if (authNonce === expectedNonce) {
|
|
142
|
+
validEip7702UserOps.push(userOpInfo);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
rejectedUserOps.push({
|
|
146
|
+
...userOpInfo,
|
|
147
|
+
reason: `EIP-7702 auth nonce mismatch: expected ${expectedNonce}, got ${authNonce}`
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
rejectedUserOps,
|
|
153
|
+
validUserOps: [...nonEip7702UserOps, ...validEip7702UserOps]
|
|
154
|
+
};
|
|
155
|
+
};
|
|
162
156
|
// Attempt to create a handleOps bundle + estimate bundling tx gas.
|
|
163
|
-
export async function filterOpsAndEstimateGas({ userOpBundle, config, logger, networkBaseFee }) {
|
|
164
|
-
const { utilityWalletAddress: beneficiary } = config;
|
|
157
|
+
export async function filterOpsAndEstimateGas({ checkEip7702AuthNonces, userOpBundle, config, logger, networkBaseFee }) {
|
|
158
|
+
const { utilityWalletAddress: beneficiary, publicClient } = config;
|
|
165
159
|
const { userOps, entryPoint } = userOpBundle;
|
|
166
160
|
try {
|
|
161
|
+
let rejectedByEip7702Nonce = [];
|
|
162
|
+
let validUserOps = userOps;
|
|
163
|
+
if (checkEip7702AuthNonces) {
|
|
164
|
+
const result = await validateEip7702AuthNonces({
|
|
165
|
+
userOps,
|
|
166
|
+
publicClient
|
|
167
|
+
});
|
|
168
|
+
// Update validUserOps after eip7702 nonce check.
|
|
169
|
+
validUserOps = result.validUserOps;
|
|
170
|
+
rejectedByEip7702Nonce = result.rejectedUserOps;
|
|
171
|
+
if (validUserOps.length === 0) {
|
|
172
|
+
return {
|
|
173
|
+
status: "all_ops_rejected",
|
|
174
|
+
rejectedUserOps: rejectedByEip7702Nonce
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
}
|
|
167
178
|
// Create promises for parallel execution
|
|
168
179
|
const filterOpsPromise = getFilterOpsResult({
|
|
169
|
-
userOpBundle,
|
|
180
|
+
userOpBundle: { ...userOpBundle, userOps: validUserOps },
|
|
170
181
|
config,
|
|
171
182
|
networkBaseFee,
|
|
172
183
|
beneficiary
|
|
@@ -175,7 +186,7 @@ export async function filterOpsAndEstimateGas({ userOpBundle, config, logger, ne
|
|
|
175
186
|
const chainSpecificOverheadPromise = getChainSpecificOverhead({
|
|
176
187
|
config,
|
|
177
188
|
entryPoint,
|
|
178
|
-
userOps:
|
|
189
|
+
userOps: validUserOps.map(({ userOp }) => userOp)
|
|
179
190
|
});
|
|
180
191
|
const results = await Promise.all([
|
|
181
192
|
filterOpsPromise,
|
|
@@ -185,16 +196,16 @@ export async function filterOpsAndEstimateGas({ userOpBundle, config, logger, ne
|
|
|
185
196
|
const offChainOverhead = results[1];
|
|
186
197
|
// Keep track of invalid and valid ops
|
|
187
198
|
const rejectedUserOpHashes = filterOpsResult.rejectedUserOps.map(({ userOpHash }) => userOpHash);
|
|
188
|
-
const userOpsToBundle =
|
|
189
|
-
const
|
|
190
|
-
const userOpInfo =
|
|
199
|
+
const userOpsToBundle = validUserOps.filter(({ userOpHash }) => !rejectedUserOpHashes.includes(userOpHash));
|
|
200
|
+
const rejectedBySimulation = filterOpsResult.rejectedUserOps.map(({ userOpHash, revertReason }) => {
|
|
201
|
+
const userOpInfo = validUserOps.find((op) => op.userOpHash === userOpHash);
|
|
191
202
|
if (!userOpInfo) {
|
|
192
203
|
logger.error(`UserOp with hash ${userOpHash} not found in bundle`);
|
|
193
204
|
sentry.captureException(`UserOp with hash ${userOpHash} not found in bundle`);
|
|
194
205
|
throw new Error(`UserOp with hash ${userOpHash} not found`);
|
|
195
206
|
}
|
|
196
207
|
// Try to decode the revert reason
|
|
197
|
-
let decodedReason
|
|
208
|
+
let decodedReason;
|
|
198
209
|
try {
|
|
199
210
|
const errorResult = decodeErrorResult({
|
|
200
211
|
abi: entryPoint07Abi,
|
|
@@ -208,7 +219,7 @@ export async function filterOpsAndEstimateGas({ userOpBundle, config, logger, ne
|
|
|
208
219
|
});
|
|
209
220
|
decodedReason = formattedError || revertReason;
|
|
210
221
|
}
|
|
211
|
-
catch
|
|
222
|
+
catch {
|
|
212
223
|
// If decoding fails, keep the raw hex
|
|
213
224
|
decodedReason = revertReason;
|
|
214
225
|
}
|
|
@@ -217,25 +228,37 @@ export async function filterOpsAndEstimateGas({ userOpBundle, config, logger, ne
|
|
|
217
228
|
reason: decodedReason
|
|
218
229
|
};
|
|
219
230
|
});
|
|
231
|
+
const allRejectedUserOps = [
|
|
232
|
+
...rejectedByEip7702Nonce,
|
|
233
|
+
...rejectedBySimulation
|
|
234
|
+
];
|
|
220
235
|
if (userOpsToBundle.length === 0) {
|
|
221
236
|
return {
|
|
222
237
|
status: "all_ops_rejected",
|
|
223
|
-
rejectedUserOps
|
|
238
|
+
rejectedUserOps: allRejectedUserOps
|
|
224
239
|
};
|
|
225
240
|
}
|
|
226
|
-
// find overhead that can't be calculated onchain
|
|
227
|
-
const bundleGasUsed = filterOpsResult.gasUsed + 21000n + offChainOverhead.gasUsed;
|
|
228
241
|
// Find gasLimit needed for this bundle
|
|
229
242
|
const bundleGasLimit = await getBundleGasLimit({
|
|
230
243
|
config,
|
|
231
|
-
|
|
244
|
+
userOps: userOpsToBundle.map(({ userOp }) => userOp),
|
|
232
245
|
entryPoint,
|
|
233
246
|
executorAddress: beneficiary
|
|
234
247
|
});
|
|
248
|
+
let bundleGasUsed;
|
|
249
|
+
if (config.chainType === "monad") {
|
|
250
|
+
// Monad uses the entire tx.gasLimit.
|
|
251
|
+
bundleGasUsed = bundleGasLimit;
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
// Find overhead that can't be calculated onchain.
|
|
255
|
+
bundleGasUsed =
|
|
256
|
+
filterOpsResult.gasUsed + 21000n + offChainOverhead.gasUsed;
|
|
257
|
+
}
|
|
235
258
|
return {
|
|
236
259
|
status: "success",
|
|
237
260
|
userOpsToBundle,
|
|
238
|
-
rejectedUserOps,
|
|
261
|
+
rejectedUserOps: allRejectedUserOps,
|
|
239
262
|
bundleGasUsed,
|
|
240
263
|
bundleGasLimit: bundleGasLimit + offChainOverhead.gasLimit,
|
|
241
264
|
totalBeneficiaryFees: filterOpsResult.balanceChange
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterOpsAndEstimateGas.js","sourceRoot":"","sources":["../../executor/filterOpsAndEstimateGas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filterOpsAndEstimateGas.js","sourceRoot":"","sources":["../../executor/filterOpsAndEstimateGas.ts"],"names":[],"mappings":"AAUA,OAAO,EAAe,oBAAoB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC/E,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,EAIH,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAElD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAA;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAoB3C,uEAAuE;AACvE,MAAM,wBAAwB,GAAG,KAAK,EAAE,EACpC,MAAM,EACN,UAAU,EACV,OAAO,EAC6D,EAAE,EAAE;IACxE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAE1C,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;QAC3B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,wBAAwB,CAAC;YAChD,YAAY;YACZ,OAAO;YACP,UAAU;SACb,CAAC,CAAA;QAEF,OAAO;YACH,OAAO,EAAE,QAAQ;YACjB,yCAAyC;YACzC,0IAA0I;YAC1I,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC;SACjD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uCAAuC;QACvC,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC;YAC3C,MAAM;YACN,OAAO,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC;YACpD,UAAU;YACV,eAAe,EAAE,WAAW;SAC/B,CAAC,CAAA;QAEF,IAAI,aAAqB,CAAA;QACzB,IAAI,MAAM,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC;YAC/B,qCAAqC;YACrC,aAAa,GAAG,cAAc,CAAA;QAClC,CAAC;aAAM,CAAC;YACJ,kDAAkD;YAClD,aAAa;gBACT,eAAe,CAAC,OAAO,GAAG,MAAO,GAAG,gBAAgB,CAAC,OAAO,CAAA;QACpE,CAAC;QAED,OAAO;YACH,MAAM,EAAE,SAAS;YACjB,eAAe;YACf,eAAe,EAAE,kBAAkB;YACnC,aAAa;YACb,cAAc,EAAE,cAAc,GAAG,gBAAgB,CAAC,QAAQ;YAC1D,oBAAoB,EAAE,eAAe,CAAC,aAAa;SACtD,CAAA;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,8CAA8C,CAAC,CAAA;QACrE,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAA;QAC5B,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC7C,GAAG,MAAM;YACT,MAAM,EAAE,4BAA4B;SACvC,CAAC,CAAC,CAAA;QACH,OAAO;YACH,MAAM,EAAE,iBAAiB;YACzB,eAAe;SAClB,CAAA;IACL,CAAC;AACL,CAAC"}
|
|
@@ -16,7 +16,11 @@ export type BundleReverted = {
|
|
|
16
16
|
export type BundleNotFound = {
|
|
17
17
|
status: "not_found";
|
|
18
18
|
};
|
|
19
|
-
export type
|
|
19
|
+
export type BundleInternalError = {
|
|
20
|
+
status: "internal_error";
|
|
21
|
+
error: string;
|
|
22
|
+
};
|
|
23
|
+
export type BundleStatus<status extends "included" | "reverted" | "not_found" | "internal_error" = "included" | "reverted" | "not_found" | "internal_error"> = (status extends "included" ? BundleIncluded : never) | (status extends "reverted" ? BundleReverted : never) | (status extends "not_found" ? BundleNotFound : never) | (status extends "internal_error" ? BundleInternalError : never);
|
|
20
24
|
export declare const getBundleStatus: ({ publicClient, submittedBundle }: {
|
|
21
25
|
submittedBundle: SubmittedBundleInfo;
|
|
22
26
|
publicClient: PublicClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBundleStatus.js","sourceRoot":"","sources":["../../executor/getBundleStatus.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"getBundleStatus.js","sourceRoot":"","sources":["../../executor/getBundleStatus.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAoCpD,iDAAiD;AACjD,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,EAClC,YAAY,EACZ,eAAe,EAKlB,EAAyB,EAAE;IACxB,MAAM,EACF,eAAe,EAAE,WAAW,EAC5B,yBAAyB,EAAE,cAAc,EACzC,MAAM,EACT,GAAG,eAAe,CAAA;IAEnB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAC9B,CAAC,WAAW,EAAE,GAAG,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAC1C,YAAY,CAAC,qBAAqB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CACtE,CACJ,CAAA;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,SAAS,CAAC,CAAA;IAE1E,kCAAkC;IAClC,IAAI,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;QAC1B,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAA;QACjD,MAAM,aAAa,GAAsC,EAAE,CAAA;QAE3D,KAAK,MAAM,EAAE,UAAU,EAAE,IAAI,OAAO,EAAE,CAAC;YACnC,aAAa,CAAC,UAAU,CAAC,GAAG,kBAAkB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QACxE,CAAC;QAED,OAAO;YACH,MAAM,EAAE,UAAU;YAClB,cAAc,EAAE,aAAa;YAC7B,eAAe;YACf,WAAW;SACd,CAAA;IACL,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,UAAU,CAAC,CAAA;IAE3E,8BAA8B;IAC9B,IAAI,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAA;QACjD,OAAO;YACH,MAAM,EAAE,UAAU;YAClB,WAAW;YACX,eAAe;SAClB,CAAA;IACL,CAAC;IAED,sEAAsE;IACtE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAA;AAClC,CAAC,CAAA"}
|
package/esm/executor/index.d.ts
CHANGED
package/esm/executor/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../executor/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../executor/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA"}
|
|
@@ -24,6 +24,19 @@ export const createMemorySenderManager = ({ config, metrics }) => {
|
|
|
24
24
|
metrics.walletsAvailable.set(availableWallets.length);
|
|
25
25
|
return wallet;
|
|
26
26
|
},
|
|
27
|
+
lockWallet: async (wallet) => {
|
|
28
|
+
logger.trace("waiting for semaphore ");
|
|
29
|
+
await semaphore.acquire();
|
|
30
|
+
const walletIndex = availableWallets.findIndex((w) => w.address === wallet.address);
|
|
31
|
+
if (walletIndex === -1) {
|
|
32
|
+
semaphore.release();
|
|
33
|
+
logger.error("wallet not found in available wallets or is already been used up");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
availableWallets.splice(walletIndex, 1);
|
|
37
|
+
logger.trace({ executor: wallet.address }, "locked wallet in sender manager");
|
|
38
|
+
metrics.walletsAvailable.set(availableWallets.length);
|
|
39
|
+
},
|
|
27
40
|
markWalletProcessed: async (wallet) => {
|
|
28
41
|
if (!availableWallets.some((w) => w.address === wallet.address)) {
|
|
29
42
|
availableWallets.push(wallet);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMemorySenderManager.js","sourceRoot":"","sources":["../../../executor/senderManager/createMemorySenderManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAsB,mBAAmB,EAAE,MAAM,GAAG,CAAA;AAG3D,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,EACtC,MAAM,EACN,OAAO,EACgC,EAAiB,EAAE;IAC1D,MAAM,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAA;IAC3C,MAAM,gBAAgB,GAAG,CAAC,GAAG,OAAO,CAAC,CAAA;IAErC,MAAM,SAAS,GAAc,IAAI,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACnE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAC3B,EAAE,MAAM,E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,CAAC,OAAO,EAAE,CAAA;gBACnB,MAAM,CAAC,KAAK,CACR,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,EAC5B,iCAAiC,CACpC,CAAA;YACL,CAAC;YAED,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;QACzD,CAAC;QACD,gBAAgB,EAAE,GAAG,EAAE;YACnB,oFAAoF;YACpF,OAAO,OAAO,CAAC,MAAM,CACjB,CAAC,MAAM,EAAE,EAAE,CACP,CAAC,gBAAgB,CAAC,IAAI,CAClB,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,KAAK,MAAM,CAAC,OAAO,CACtD,CACR,CAAA;QACL,CAAC;KACJ,CAAA;AACL,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"createMemorySenderManager.js","sourceRoot":"","sources":["../../../executor/senderManager/createMemorySenderManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAsB,mBAAmB,EAAE,MAAM,GAAG,CAAA;AAG3D,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,EACtC,MAAM,EACN,OAAO,EACgC,EAAiB,EAAE;IAC1D,MAAM,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAA;IAC3C,MAAM,gBAAgB,GAAG,CAAC,GAAG,OAAO,CAAC,CAAA;IAErC,MAAM,SAAS,GAAc,IAAI,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACnE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAC3B,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAC5B,EAAE,KAAK,EAAE,MAAM,CAAC,gBAAgB,IAAI,MAAM,CAAC,QAAQ,EAAE,CACxD,CAAA;IAED,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACxC,OAAO,CAA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,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;YAEvC,MAAM,CAAC,KAAK,CACR,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,EAC5B,iCAAiC,CACpC,CAAA;YAED,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;QACzD,CAAC;QACD,mBAAmB,EAAE,KAAK,EAAE,MAAe,EAAE,EAAE;YAC3C,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC9D,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC7B,SAAS,CAAC,OAAO,EAAE,CAAA;gBACnB,MAAM,CAAC,KAAK,CACR,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,EAC5B,iCAAiC,CACpC,CAAA;YACL,CAAC;YAED,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;QACzD,CAAC;QACD,gBAAgB,EAAE,GAAG,EAAE;YACnB,oFAAoF;YACpF,OAAO,OAAO,CAAC,MAAM,CACjB,CAAC,MAAM,EAAE,EAAE,CACP,CAAC,gBAAgB,CAAC,IAAI,CAClB,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,KAAK,MAAM,CAAC,OAAO,CACtD,CACR,CAAA;QACL,CAAC;KACJ,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Metrics } from "../../utils/index.js";
|
|
2
2
|
import type { AltoConfig } from "../../createConfig.js";
|
|
3
3
|
import type { SenderManager } from "../senderManager/index.js";
|
|
4
|
-
export declare const createRedisSenderManager: ({ config, metrics }: {
|
|
4
|
+
export declare const createRedisSenderManager: ({ config, metrics, redisEndpoint }: {
|
|
5
5
|
config: AltoConfig;
|
|
6
6
|
metrics: Metrics;
|
|
7
|
+
redisEndpoint: string;
|
|
7
8
|
}) => Promise<SenderManager>;
|
|
8
9
|
//# sourceMappingURL=createRedisSenderManager.d.ts.map
|
|
@@ -1,51 +1,70 @@
|
|
|
1
1
|
import Redis from "ioredis";
|
|
2
2
|
import { getAvailableWallets } from "./index.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
// Lua script for atomic wallet registration.
|
|
4
|
+
// Only adds wallets to the available pool if they haven't been registered before.
|
|
5
|
+
//
|
|
6
|
+
// params:
|
|
7
|
+
// KEYS[1] = available set redis key
|
|
8
|
+
// KEYS[2] = registered set redis key
|
|
9
|
+
// ARGV = wallet addresses
|
|
10
|
+
const ADD_WALLETS_SCRIPT = `
|
|
11
|
+
local availableKey = KEYS[1]
|
|
12
|
+
local registeredKey = KEYS[2]
|
|
13
|
+
local addedWallets = {}
|
|
14
|
+
|
|
15
|
+
for i, wallet in ipairs(ARGV) do
|
|
16
|
+
local isNew = redis.call('SADD', registeredKey, wallet)
|
|
17
|
+
if isNew == 1 then
|
|
18
|
+
redis.call('SADD', availableKey, wallet)
|
|
19
|
+
table.insert(addedWallets, wallet)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
return addedWallets
|
|
24
|
+
`;
|
|
25
|
+
// Uses two Redis Sets:
|
|
26
|
+
// - "available" set: wallets currently available for use (SPOP to acquire, SADD to release)
|
|
27
|
+
// - "registered" set: all wallets ever registered (prevents re-adding in-use wallets)
|
|
28
|
+
async function createRedisWalletPool({ redis, config, logger, entries }) {
|
|
29
|
+
const keyPrefix = `${config.redisKeyPrefix}:${config.chainId}:wallet-pool`;
|
|
30
|
+
const availableKey = `${keyPrefix}:available`;
|
|
31
|
+
const registeredKey = `${keyPrefix}:registered`;
|
|
32
|
+
// Register all wallets atomically in a single call
|
|
33
|
+
const addedWallets = (await redis.eval(ADD_WALLETS_SCRIPT, 2, // number of keys (availableKey, registeredKey)
|
|
34
|
+
availableKey, registeredKey, ...entries));
|
|
35
|
+
logger.info({ availableKey, registeredKey, addedWallets }, "Created redis wallet pool");
|
|
13
36
|
return {
|
|
14
|
-
|
|
15
|
-
pop: () => redis.
|
|
16
|
-
push: (entry) => redis.
|
|
37
|
+
size: () => redis.scard(availableKey),
|
|
38
|
+
pop: () => redis.spop(availableKey),
|
|
39
|
+
push: (entry) => redis.sadd(availableKey, entry)
|
|
17
40
|
};
|
|
18
41
|
}
|
|
19
42
|
const delay = async (delay) => {
|
|
20
43
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
21
44
|
};
|
|
22
|
-
export const createRedisSenderManager = async ({ config, metrics }) => {
|
|
23
|
-
if (!config.redisSenderManagerUrl) {
|
|
24
|
-
throw new Error("redisSenderManagerUrl is required");
|
|
25
|
-
}
|
|
45
|
+
export const createRedisSenderManager = async ({ config, metrics, redisEndpoint }) => {
|
|
26
46
|
const wallets = getAvailableWallets(config);
|
|
27
47
|
metrics.walletsTotal.set(wallets.length);
|
|
28
48
|
metrics.walletsAvailable.set(wallets.length);
|
|
29
49
|
const logger = config.getLogger({ module: "redis-sender-manager" }, {
|
|
30
50
|
level: config.executorLogLevel || config.logLevel
|
|
31
51
|
});
|
|
32
|
-
const redis = new Redis(
|
|
33
|
-
const
|
|
34
|
-
const redisQueue = await createRedisQueue({
|
|
52
|
+
const redis = new Redis(redisEndpoint);
|
|
53
|
+
const walletPool = await createRedisWalletPool({
|
|
35
54
|
redis,
|
|
36
|
-
|
|
55
|
+
config,
|
|
56
|
+
logger,
|
|
37
57
|
entries: wallets.map((w) => w.address)
|
|
38
58
|
});
|
|
39
59
|
// Track active wallets for this instance
|
|
40
60
|
const activeWallets = new Set();
|
|
41
|
-
logger.info(`Created redis sender manager with queueName: ${redisQueueName}`);
|
|
42
61
|
return {
|
|
43
62
|
getAllWallets: () => [...wallets],
|
|
44
63
|
getWallet: async () => {
|
|
45
64
|
logger.trace("waiting for wallet ");
|
|
46
65
|
let walletAddress = null;
|
|
47
66
|
while (!walletAddress) {
|
|
48
|
-
walletAddress = await
|
|
67
|
+
walletAddress = await walletPool.pop();
|
|
49
68
|
await delay(100);
|
|
50
69
|
}
|
|
51
70
|
const wallet = wallets.find((w) => w.address === walletAddress);
|
|
@@ -55,15 +74,15 @@ export const createRedisSenderManager = async ({ config, metrics }) => {
|
|
|
55
74
|
}
|
|
56
75
|
activeWallets.add(wallet);
|
|
57
76
|
logger.trace({ executor: wallet.address }, "got wallet from sender manager");
|
|
58
|
-
await
|
|
77
|
+
await walletPool.size().then((len) => {
|
|
59
78
|
metrics.walletsAvailable.set(len);
|
|
60
79
|
});
|
|
61
80
|
return wallet;
|
|
62
81
|
},
|
|
63
82
|
markWalletProcessed: async (wallet) => {
|
|
64
83
|
if (activeWallets.delete(wallet)) {
|
|
65
|
-
await
|
|
66
|
-
const len = await
|
|
84
|
+
await walletPool.push(wallet.address);
|
|
85
|
+
const len = await walletPool.size();
|
|
67
86
|
metrics.walletsAvailable.set(len);
|
|
68
87
|
}
|
|
69
88
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRedisSenderManager.js","sourceRoot":"","sources":["../../../executor/senderManager/createRedisSenderManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAA;AAIvC,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"createRedisSenderManager.js","sourceRoot":"","sources":["../../../executor/senderManager/createRedisSenderManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAA;AAIvC,6CAA6C;AAC7C,kFAAkF;AAClF,EAAE;AACF,UAAU;AACV,oCAAoC;AAC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C,CAAA;YACvC,CAAC;YAED,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAEzB,MAAM,CAAC,KAAK,CACR,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,EAC5B,gCAAgC,CACnC,CAAA;YAED,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;gBACjC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACrC,CAAC,CAAC,CAAA;YAEF,OAAO,MAAM,CAAA;QACjB,CAAC;QACD,mBAAmB,EAAE,KAAK,EAAE,MAAe,EAAE,EAAE;YAC3C,IAAI,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC/B,MAAM,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;gBACrC,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,IAAI,EAAE,CAAA;gBACnC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACrC,CAAC;iBAAM,CAAC;gBACJ,MAAM,CAAC,IAAI,CACP,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,EAC5B,4DAA4D,CAC/D,CAAA;YACL,CAAC;QACL,CAAC;QACD,gBAAgB,EAAE,GAAG,EAAE;YACnB,OAAO,CAAC,GAAG,aAAa,CAAC,CAAA;QAC7B,CAAC;KACJ,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -9,10 +9,12 @@ export const flushOnStartUp = async ({ senderManager, gasPriceManager, config })
|
|
|
9
9
|
const wallets = Array.from(allWallets);
|
|
10
10
|
let gasPrice;
|
|
11
11
|
try {
|
|
12
|
-
gasPrice = await gasPriceManager.tryGetNetworkGasPrice(
|
|
12
|
+
gasPrice = await gasPriceManager.tryGetNetworkGasPrice({
|
|
13
|
+
forExecutor: true
|
|
14
|
+
});
|
|
13
15
|
}
|
|
14
|
-
catch (
|
|
15
|
-
logger.error({
|
|
16
|
+
catch (err) {
|
|
17
|
+
logger.error({ err }, "error flushing stuck transaction");
|
|
16
18
|
return;
|
|
17
19
|
}
|
|
18
20
|
const promises = wallets.map(async (wallet) => {
|
|
@@ -24,8 +26,8 @@ export const flushOnStartUp = async ({ senderManager, gasPriceManager, config })
|
|
|
24
26
|
logger
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
|
-
catch (
|
|
28
|
-
logger.error({
|
|
29
|
+
catch (err) {
|
|
30
|
+
logger.error({ err }, "error flushing stuck transaction");
|
|
29
31
|
}
|
|
30
32
|
});
|
|
31
33
|
await Promise.all(promises);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flushOnStartUp.js","sourceRoot":"","sources":["../../../executor/senderManager/flushOnStartUp.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEhD,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,EACjC,aAAa,EACb,eAAe,EACf,MAAM,EAKT,EAAE,EAAE;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAC3B,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAC/B,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,CAC7B,CAAA;IAED,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,CAAA;IAEzD,MAAM,aAAa,GAAG,MAAM,CAAC,iBAAiB,CAAA;IAC9C,IAAI,aAAa,EAAE,CAAC;QAChB,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IACjC,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAEtC,IAAI,QAGH,CAAA;IAED,IAAI,CAAC;QACD,QAAQ,GAAG,MAAM,eAAe,CAAC,qBAAqB,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"flushOn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AE,EAAE,kCAAkC,CAAC,CAAA;QAC7D,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC/B,CAAC,CAAA"}
|
|
@@ -5,6 +5,7 @@ export declare const getAvailableWallets: (config: AltoConfig) => Account[];
|
|
|
5
5
|
export type SenderManager = {
|
|
6
6
|
getAllWallets: () => Account[];
|
|
7
7
|
getWallet: () => Promise<Account>;
|
|
8
|
+
lockWallet?: (wallet: Account) => Promise<void>;
|
|
8
9
|
markWalletProcessed: (wallet: Account) => Promise<void>;
|
|
9
10
|
getActiveWallets: () => Account[];
|
|
10
11
|
};
|
|
@@ -12,8 +12,12 @@ export const getAvailableWallets = (config) => {
|
|
|
12
12
|
return availableWallets;
|
|
13
13
|
};
|
|
14
14
|
export const getSenderManager = async ({ config, metrics }) => {
|
|
15
|
-
if (config.
|
|
16
|
-
return await createRedisSenderManager({
|
|
15
|
+
if (config.enableHorizontalScaling && config.redisEndpoint) {
|
|
16
|
+
return await createRedisSenderManager({
|
|
17
|
+
config,
|
|
18
|
+
metrics,
|
|
19
|
+
redisEndpoint: config.redisEndpoint
|
|
20
|
+
});
|
|
17
21
|
}
|
|
18
22
|
return createMemorySenderManager({ config, metrics });
|
|
19
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../executor/senderManager/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAErE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAkB,EAAE,EAAE;IACtD,IAAI,gBAAgB,GAAc,EAAE,CAAA;IAEpC,IACI,MAAM,CAAC,YAAY,KAAK,SAAS;QACjC,MAAM,CAAC,mBAAmB,CAAC,MAAM,GAAG,MAAM,CAAC,YAAY,EACzD,CAAC;QACC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