@pimlico/alto 0.0.19 → 0.0.20
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/338795fc743ca612.json +1 -0
- package/contracts/build-info/44a9648cfe32a468.json +1 -0
- package/contracts/build-info/{880955d5786bfdae.json → 8dbf8a4ad39019b5.json} +1 -1
- 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 +13 -6
- package/esm/cli/alto.js.map +1 -1
- package/esm/cli/config/bundler.d.ts +190 -148
- package/esm/cli/config/bundler.js +72 -83
- package/esm/cli/config/bundler.js.map +1 -1
- package/esm/cli/config/options.d.ts +2 -1
- package/esm/cli/config/options.js +105 -68
- 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 +48 -52
- package/esm/cli/handler.js.map +1 -1
- package/esm/cli/setupServer.js +46 -47
- package/esm/cli/setupServer.js.map +1 -1
- package/esm/cli/shutDown.d.ts +20 -0
- package/esm/cli/shutDown.js +260 -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} +38 -32
- package/esm/executor/{userOpMonitor.js → bundleManager.js} +127 -99
- package/esm/executor/bundleManager.js.map +1 -0
- package/esm/executor/executor.d.ts +4 -3
- package/esm/executor/executor.js +33 -20
- package/esm/executor/executor.js.map +1 -1
- package/esm/executor/executorManager.d.ts +17 -15
- package/esm/executor/executorManager.js +130 -55
- 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/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 +3 -6
- package/esm/executor/senderManager/createRedisSenderManager.js.map +1 -1
- package/esm/executor/senderManager/flushOnStartUp.js +4 -4
- 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 +2 -2
- package/esm/executor/senderManager/validateAndRefill.js.map +1 -1
- package/esm/executor/utilityWalletMonitor.d.ts +4 -4
- package/esm/executor/utilityWalletMonitor.js +1 -1
- package/esm/executor/utilityWalletMonitor.js.map +1 -1
- package/esm/executor/utils.d.ts +7 -2
- package/esm/executor/utils.js +57 -26
- 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/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 +8 -9
- package/esm/handlers/gasPriceManager.js +68 -80
- 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 +57 -22
- package/esm/mempool/mempool.js +180 -134
- 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} +95 -47
- 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 +54 -48
- package/esm/rpc/estimation/utils.js.map +1 -1
- package/esm/rpc/methods/boost_sendUserOperation.d.ts +304 -0
- 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 +50 -29
- 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 +26 -26
- package/esm/rpc/methods/eth_getUserOperationReceipt.js +1 -1
- package/esm/rpc/methods/eth_sendUserOperation.d.ts +305 -1
- package/esm/rpc/methods/eth_sendUserOperation.js +132 -36
- 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 +330 -26
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js +15 -27
- 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 +21 -22
- package/esm/rpc/rpcHandler.js +15 -17
- 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 +71 -40
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
- package/esm/store/createMempoolStore.d.ts +1 -1
- package/esm/store/createMempoolStore.js +63 -139
- 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 +16 -0
- package/esm/store/processing/memory.js +58 -0
- package/esm/store/processing/memory.js.map +1 -0
- package/esm/store/processing/redis.d.ts +23 -0
- package/esm/store/processing/redis.js +85 -0
- package/esm/store/processing/redis.js.map +1 -0
- package/esm/store/processing/types.d.ts +10 -0
- package/esm/store/processing/types.js +2 -0
- package/esm/store/processing/types.js.map +1 -0
- package/esm/store/types.d.ts +50 -0
- package/esm/store/types.js +2 -0
- package/esm/store/types.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/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 +13174 -4732
- package/esm/types/schemas.js +113 -25
- 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 +2 -1
- package/esm/utils/helpers.js +30 -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 +2 -1
- package/esm/utils/metrics.js +15 -8
- 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 +87 -55
- package/esm/utils/userop.js +138 -248
- 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.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/utils/preVerificationGasCalulator.js.map +0 -1
|
@@ -2,11 +2,11 @@ import type { Metrics } from "../utils/index.js";
|
|
|
2
2
|
import type { Address } from "abitype";
|
|
3
3
|
import type { AltoConfig } from "../createConfig.js";
|
|
4
4
|
export declare class UtilityWalletMonitor {
|
|
5
|
-
private config;
|
|
6
|
-
private utilityWalletAddress;
|
|
5
|
+
private readonly config;
|
|
6
|
+
private readonly utilityWalletAddress;
|
|
7
|
+
private readonly metrics;
|
|
8
|
+
private readonly logger;
|
|
7
9
|
private timer;
|
|
8
|
-
private metrics;
|
|
9
|
-
private logger;
|
|
10
10
|
constructor({ config, metrics, utilityWalletAddress }: {
|
|
11
11
|
config: AltoConfig;
|
|
12
12
|
metrics: Metrics;
|
|
@@ -2,9 +2,9 @@ import { formatEther } from "viem";
|
|
|
2
2
|
export class UtilityWalletMonitor {
|
|
3
3
|
config;
|
|
4
4
|
utilityWalletAddress;
|
|
5
|
-
timer;
|
|
6
5
|
metrics;
|
|
7
6
|
logger;
|
|
7
|
+
timer;
|
|
8
8
|
constructor({ config, metrics, utilityWalletAddress }) {
|
|
9
9
|
this.config = config;
|
|
10
10
|
this.utilityWalletAddress = utilityWalletAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilityWalletMonitor.js","sourceRoot":"","sources":["../../executor/utilityWalletMonitor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,WAAW,EAAE,MAAM,MAAM,CAAA;AAG5C,MAAM,OAAO,oBAAoB;
|
|
1
|
+
{"version":3,"file":"utilityWalletMonitor.js","sourceRoot":"","sources":["../../executor/utilityWalletMonitor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,WAAW,EAAE,MAAM,MAAM,CAAA;AAG5C,MAAM,OAAO,oBAAoB;IACZ,MAAM,CAAY;IAClB,oBAAoB,CAAK;IACzB,OAAO,CAAS;IAChB,MAAM,CAAQ;IACvB,KAAK,CAA0B;IAEvC,YAAY,EACR,MAAM,EACN,OAAO,EACP,oBAAoB,EAKvB;QACG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAA;QAChD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAC1B,EAAE,MAAM,EAAE,wBAAwB,EAAE,EACpC;YACI,KAAK,EAAE,MAAM,CAAC,QAAQ;SACzB,CACJ,CAAA;IACL,CAAC;IAEO,KAAK,CAAC,aAAa;QACvB,IAAI,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC;gBACtD,OAAO,EAAE,IAAI,CAAC,oBAAoB;aACrC,CAAC,CAAA;YAEF,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,GAAG,CACjC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAC1C,CAAA;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,KAAK,EACL,iDAAiD,CACpD,CAAA;QACL,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,KAAK;QACd,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;QAC3D,CAAC;QAED,MAAM,IAAI,CAAC,aAAa,EAAE,CAAA;QAE1B,IAAI,CAAC,KAAK,GAAG,WAAW,CACpB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAC7B,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAC3B,CAAA;IACrB,CAAC;IAEM,IAAI;QACP,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;CACJ"}
|
package/esm/executor/utils.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { type UserOpInfo, type UserOperation } from "../types/index.js";
|
|
2
2
|
import { type Logger } from "../utils/index.js";
|
|
3
|
-
import { type Account, type Address, type BaseError, type Hex } from "viem";
|
|
4
|
-
import type { SignedAuthorizationList } from "viem";
|
|
3
|
+
import { type Account, type Address, type BaseError, type Hex, type SignedAuthorizationList } from "viem";
|
|
5
4
|
import type { AltoConfig } from "../createConfig.js";
|
|
5
|
+
export declare const getBundleGasLimit: ({ config, userOps, entryPoint, executorAddress }: {
|
|
6
|
+
config: AltoConfig;
|
|
7
|
+
userOps: UserOperation[];
|
|
8
|
+
entryPoint: Address;
|
|
9
|
+
executorAddress: Address;
|
|
10
|
+
}) => Promise<bigint>;
|
|
6
11
|
export declare const isTransactionUnderpricedError: (e: BaseError) => boolean;
|
|
7
12
|
export declare function calculateAA95GasFloor({ userOps, beneficiary }: {
|
|
8
13
|
userOps: UserOperation[];
|
package/esm/executor/utils.js
CHANGED
|
@@ -1,11 +1,41 @@
|
|
|
1
1
|
import { EntryPointV06Abi, EntryPointV07Abi } from "../types/index.js";
|
|
2
|
-
import { isVersion06, isVersion07, toPackedUserOp } from "../utils/index.js";
|
|
2
|
+
import { isVersion06, isVersion07, scaleBigIntByPercent, toPackedUserOp } from "../utils/index.js";
|
|
3
3
|
import * as sentry from "@sentry/node";
|
|
4
4
|
import { encodeFunctionData, toBytes } from "viem";
|
|
5
|
+
import { getEip7702AuthAddress } from "../utils/eip7702.js";
|
|
6
|
+
export const getBundleGasLimit = async ({ config, userOps, entryPoint, executorAddress }) => {
|
|
7
|
+
const { rpcGasEstimate, publicClient } = config;
|
|
8
|
+
let gasLimit;
|
|
9
|
+
// On some chains we can't rely on local calculations and have to estimate the gasLimit from RPC
|
|
10
|
+
if (rpcGasEstimate) {
|
|
11
|
+
gasLimit = await publicClient.estimateGas({
|
|
12
|
+
to: entryPoint,
|
|
13
|
+
account: executorAddress,
|
|
14
|
+
data: encodeHandleOpsCalldata({
|
|
15
|
+
userOps: userOps,
|
|
16
|
+
beneficiary: executorAddress
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const aa95GasFloor = calculateAA95GasFloor({
|
|
22
|
+
userOps: userOps,
|
|
23
|
+
beneficiary: executorAddress
|
|
24
|
+
});
|
|
25
|
+
const eip7702UserOpCount = userOps.filter((userOp) => userOp.eip7702Auth).length;
|
|
26
|
+
const eip7702Overhead = BigInt(eip7702UserOpCount) * 40000n;
|
|
27
|
+
// Add 5% safety margin to local estimates.
|
|
28
|
+
gasLimit = scaleBigIntByPercent(aa95GasFloor + eip7702Overhead, 105n);
|
|
29
|
+
}
|
|
30
|
+
return gasLimit;
|
|
31
|
+
};
|
|
5
32
|
export const isTransactionUnderpricedError = (e) => {
|
|
6
|
-
const transactionUnderPriceError = e.walk((e) =>
|
|
7
|
-
?.toLowerCase()
|
|
8
|
-
|
|
33
|
+
const transactionUnderPriceError = e.walk((e) => {
|
|
34
|
+
const message = e?.message?.toLowerCase();
|
|
35
|
+
return (message?.includes("replacement transaction underpriced") || // Geth error message
|
|
36
|
+
message?.includes("could not replace existing tx") // Erigon error message
|
|
37
|
+
);
|
|
38
|
+
});
|
|
9
39
|
return transactionUnderPriceError !== null;
|
|
10
40
|
};
|
|
11
41
|
// V7 source: https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.7/contracts/core/EntryPoint.sol
|
|
@@ -61,10 +91,10 @@ export const packUserOps = (userOps) => {
|
|
|
61
91
|
if (userOps.length === 0) {
|
|
62
92
|
return [];
|
|
63
93
|
}
|
|
64
|
-
const
|
|
65
|
-
const packedUserOps =
|
|
94
|
+
const is06 = isVersion06(userOps[0]);
|
|
95
|
+
const packedUserOps = is06
|
|
66
96
|
? userOps
|
|
67
|
-
: userOps.map((
|
|
97
|
+
: userOps.map((userOp) => toPackedUserOp(userOp));
|
|
68
98
|
return packedUserOps;
|
|
69
99
|
};
|
|
70
100
|
export const encodeHandleOpsCalldata = ({ userOps, beneficiary }) => {
|
|
@@ -77,27 +107,28 @@ export const encodeHandleOpsCalldata = ({ userOps, beneficiary }) => {
|
|
|
77
107
|
});
|
|
78
108
|
};
|
|
79
109
|
export const getAuthorizationList = (userOpInfos) => {
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
: eip7702Auth
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
110
|
+
const authMap = new Map();
|
|
111
|
+
// Deduplicate EIP-7702 auths if userOp.sender has multiple same eip7702Auth fields.
|
|
112
|
+
for (const { userOp } of userOpInfos) {
|
|
113
|
+
const { eip7702Auth, sender } = userOp;
|
|
114
|
+
if (eip7702Auth && !authMap.has(sender)) {
|
|
115
|
+
authMap.set(sender, {
|
|
116
|
+
address: getEip7702AuthAddress(eip7702Auth),
|
|
117
|
+
chainId: eip7702Auth.chainId,
|
|
118
|
+
nonce: eip7702Auth.nonce,
|
|
119
|
+
r: eip7702Auth.r,
|
|
120
|
+
s: eip7702Auth.s,
|
|
121
|
+
v: eip7702Auth.v,
|
|
122
|
+
yParity: eip7702Auth.yParity
|
|
123
|
+
});
|
|
93
124
|
}
|
|
94
|
-
|
|
95
|
-
|
|
125
|
+
}
|
|
126
|
+
const authList = Array.from(authMap.values());
|
|
96
127
|
return authList.length > 0 ? authList : undefined;
|
|
97
128
|
};
|
|
98
129
|
export async function flushStuckTransaction({ config, wallet, gasPrice, logger }) {
|
|
99
130
|
const publicClient = config.publicClient;
|
|
100
|
-
const walletClient = config.
|
|
131
|
+
const walletClient = config.walletClients.public;
|
|
101
132
|
const latestNonce = await publicClient.getTransactionCount({
|
|
102
133
|
address: wallet.address,
|
|
103
134
|
blockTag: "latest"
|
|
@@ -128,9 +159,9 @@ export async function flushStuckTransaction({ config, wallet, gasPrice, logger }
|
|
|
128
159
|
});
|
|
129
160
|
logger.debug({ txHash, nonce: nonceToFlush, wallet: wallet.address }, "flushed stuck transaction");
|
|
130
161
|
}
|
|
131
|
-
catch (
|
|
132
|
-
sentry.captureException(
|
|
133
|
-
logger.warn({
|
|
162
|
+
catch (err) {
|
|
163
|
+
sentry.captureException(err);
|
|
164
|
+
logger.warn({ err }, "error flushing stuck transaction");
|
|
134
165
|
}
|
|
135
166
|
}
|
|
136
167
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../executor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAKnB,MAAM,aAAa,CAAA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,KAAK,YAAY,EAAE,CAAC;QAC/B,OAAM;IACV,CAAC;IAED,+BAA+B;IAC/B,IAAI,WAAW,GAAG,CAAC,KAAK,YAAY,EAAE,CAAC;QACnC,OAAM;IACV,CAAC;IAED,MAAM,CAAC,IAAI,CACP,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,EACrD,mCAAmC,CACtC,CAAA;IAED,KACI,IAAI,YAAY,GAAG,WAAW,EAC9B,YAAY,GAAG,YAAY,EAC3B,YAAY,EAAE,EAChB,CAAC;QACC,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,eAAe,CAAC;gBAC9C,OAAO,EAAE,MAAM;gBACf,EAAE,EAAE,MAAM,CAAC,OAAO;gBAClB,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,YAAY;gBACnB,YAAY,EAAE,QAAQ;gBACtB,oBAAoB,EAAE,QAAQ;aACjC,CAAC,CAAA;YAEF,MAAM,CAAC,KAAK,CACR,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,EACvD,2BAA2B,CAC9B,CAAA;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAA;YAC5B,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,kCAAkC,CAAC,CAAA;QAC5D,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AltoConfig } from "../createConfig.js";
|
|
2
2
|
export declare class ArbitrumManager {
|
|
3
|
-
private l1BaseFeeQueue;
|
|
4
|
-
private l2BaseFeeQueue;
|
|
3
|
+
private readonly l1BaseFeeQueue;
|
|
4
|
+
private readonly l2BaseFeeQueue;
|
|
5
5
|
constructor({ config }: {
|
|
6
6
|
config: AltoConfig;
|
|
7
7
|
});
|
|
@@ -9,6 +9,7 @@ export declare class ArbitrumManager {
|
|
|
9
9
|
saveL2BaseFee(baseFee: bigint): void;
|
|
10
10
|
getMinL1BaseFee(): Promise<bigint>;
|
|
11
11
|
getMaxL1BaseFee(): Promise<bigint>;
|
|
12
|
+
getMinL2BaseFee(): Promise<bigint>;
|
|
12
13
|
getMaxL2BaseFee(): Promise<bigint>;
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=arbitrumGasPriceManager.d.ts.map
|
|
@@ -5,11 +5,11 @@ export class ArbitrumManager {
|
|
|
5
5
|
l2BaseFeeQueue;
|
|
6
6
|
constructor({ config }) {
|
|
7
7
|
this.l1BaseFeeQueue = createMinMaxQueue({
|
|
8
|
-
|
|
8
|
+
queueName: "l1-base-fee-queue",
|
|
9
9
|
config
|
|
10
10
|
});
|
|
11
11
|
this.l2BaseFeeQueue = createMinMaxQueue({
|
|
12
|
-
|
|
12
|
+
queueName: "l2-base-fee-queue",
|
|
13
13
|
config
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -27,6 +27,10 @@ export class ArbitrumManager {
|
|
|
27
27
|
const maxL1BaseFee = await this.l1BaseFeeQueue.getMaxValue();
|
|
28
28
|
return maxL1BaseFee || maxUint128;
|
|
29
29
|
}
|
|
30
|
+
async getMinL2BaseFee() {
|
|
31
|
+
const minL2BaseFee = await this.l2BaseFeeQueue.getMinValue();
|
|
32
|
+
return minL2BaseFee || 1n;
|
|
33
|
+
}
|
|
30
34
|
async getMaxL2BaseFee() {
|
|
31
35
|
const maxL2BaseFee = await this.l2BaseFeeQueue.getMaxValue();
|
|
32
36
|
return maxL2BaseFee || maxUint128;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arbitrumGasPriceManager.js","sourceRoot":"","sources":["../../handlers/arbitrumGasPriceManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAEjC,OAAO,EAAoB,iBAAiB,EAAE,MAAM,sBAAsB,C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I,CAAC,cAAc,CAAC,WAAW,EAAE,CAAA;QAC5D,OAAO,YAAY,IAAI,UAAU,CAAA;IACrC,CAAC;CACJ"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import type { Metrics } from "../utils/index.js";
|
|
2
1
|
import type { Hex } from "viem";
|
|
3
2
|
import type { AltoConfig } from "../createConfig.js";
|
|
4
3
|
export declare class EventManager {
|
|
5
|
-
private chainId;
|
|
6
|
-
private logger;
|
|
7
|
-
private
|
|
8
|
-
private
|
|
9
|
-
|
|
4
|
+
private readonly chainId;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
private readonly redisEventManagerQueue?;
|
|
7
|
+
private readonly eventBuffer;
|
|
8
|
+
private flushTimer?;
|
|
9
|
+
constructor({ config }: {
|
|
10
10
|
config: AltoConfig;
|
|
11
|
-
metrics: Metrics;
|
|
12
11
|
});
|
|
12
|
+
private startFlushTimer;
|
|
13
|
+
private flushEvents;
|
|
13
14
|
emitExecutionRevertedOnChain(userOpHash: Hex, transactionHash: Hex, reason: Hex, blockNumber: bigint): void;
|
|
14
15
|
emitFailedOnChain(userOpHash: Hex, transactionHash: Hex, blockNumber: bigint): void;
|
|
15
16
|
emitFrontranOnChain(userOpHash: Hex, transactionHash: Hex, blockNumber: bigint): void;
|
|
@@ -23,7 +24,6 @@ export declare class EventManager {
|
|
|
23
24
|
}): void;
|
|
24
25
|
emitDropped(userOpHash: Hex, reason?: string, aaError?: string): void;
|
|
25
26
|
emitAddedToMempool(userOpHash: Hex): void;
|
|
26
|
-
private
|
|
27
|
-
private emitWithTimeout;
|
|
27
|
+
private queueEvent;
|
|
28
28
|
}
|
|
29
29
|
//# sourceMappingURL=eventManager.d.ts.map
|
|
@@ -1,32 +1,70 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { asyncCallWithTimeout } from "../utils/index.js";
|
|
2
2
|
import Queue from "bull";
|
|
3
3
|
import Redis from "ioredis";
|
|
4
|
-
import { AsyncTimeoutError, asyncCallWithTimeout } from "../utils/asyncTimeout.js";
|
|
5
4
|
export class EventManager {
|
|
6
5
|
chainId;
|
|
7
6
|
logger;
|
|
8
|
-
metrics;
|
|
9
7
|
redisEventManagerQueue;
|
|
10
|
-
|
|
8
|
+
eventBuffer = [];
|
|
9
|
+
flushTimer;
|
|
10
|
+
constructor({ config }) {
|
|
11
11
|
this.chainId = config.chainId;
|
|
12
|
+
const flushInterval = config.redisEventsQueueFlushInterval;
|
|
12
13
|
this.logger = config.getLogger({ module: "event_manager" }, {
|
|
13
14
|
level: config.logLevel
|
|
14
15
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.logger.info(`Using redis with queue name ${
|
|
18
|
-
const redis = new Redis(config.
|
|
19
|
-
this.redisEventManagerQueue = new Queue(
|
|
16
|
+
if (config.redisEventsQueueEndpoint && config.redisEventsQueueName) {
|
|
17
|
+
const queueName = config.redisEventsQueueName;
|
|
18
|
+
this.logger.info(`Using redis with queue name ${queueName} for userOp event queue (flush interval: ${flushInterval}ms)`);
|
|
19
|
+
const redis = new Redis(config.redisEventsQueueEndpoint);
|
|
20
|
+
this.redisEventManagerQueue = new Queue(queueName, {
|
|
20
21
|
createClient: () => {
|
|
21
22
|
return redis;
|
|
23
|
+
},
|
|
24
|
+
defaultJobOptions: {
|
|
25
|
+
attempts: 3,
|
|
26
|
+
backoff: {
|
|
27
|
+
type: "fixed",
|
|
28
|
+
delay: 30000
|
|
29
|
+
},
|
|
30
|
+
removeOnComplete: true,
|
|
31
|
+
removeOnFail: true
|
|
22
32
|
}
|
|
23
33
|
});
|
|
34
|
+
this.startFlushTimer(flushInterval);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
startFlushTimer(flushInterval) {
|
|
38
|
+
// Don't start flush timer if redis is not configured.
|
|
39
|
+
if (!this.redisEventManagerQueue) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.flushTimer = setInterval(() => {
|
|
43
|
+
this.flushEvents();
|
|
44
|
+
}, flushInterval);
|
|
45
|
+
// Allow process to exit even if interval is active.
|
|
46
|
+
if (this.flushTimer.unref) {
|
|
47
|
+
this.flushTimer.unref();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
flushEvents() {
|
|
51
|
+
if (!this.redisEventManagerQueue || this.eventBuffer.length === 0) {
|
|
24
52
|
return;
|
|
25
53
|
}
|
|
54
|
+
const eventsToFlush = this.eventBuffer.splice(0);
|
|
55
|
+
const eventCount = eventsToFlush.length;
|
|
56
|
+
// Fire and forget - don't block the timer
|
|
57
|
+
asyncCallWithTimeout(this.redisEventManagerQueue.addBulk(eventsToFlush.map((entry) => ({
|
|
58
|
+
data: entry,
|
|
59
|
+
opts: { removeOnFail: true, removeOnComplete: true }
|
|
60
|
+
}))), 500 // 500ms timeout
|
|
61
|
+
).catch((err) => {
|
|
62
|
+
this.logger.error({ err, eventCount }, "Failed to flush events to Redis");
|
|
63
|
+
});
|
|
26
64
|
}
|
|
27
65
|
// emits when the userOperation was mined onchain but reverted during the callphase
|
|
28
66
|
emitExecutionRevertedOnChain(userOpHash, transactionHash, reason, blockNumber) {
|
|
29
|
-
this.
|
|
67
|
+
this.queueEvent({
|
|
30
68
|
userOpHash,
|
|
31
69
|
event: {
|
|
32
70
|
eventType: "execution_reverted_onchain",
|
|
@@ -40,7 +78,7 @@ export class EventManager {
|
|
|
40
78
|
}
|
|
41
79
|
// emits when the userOperation was mined onchain but failed EntryPoint validation
|
|
42
80
|
emitFailedOnChain(userOpHash, transactionHash, blockNumber) {
|
|
43
|
-
this.
|
|
81
|
+
this.queueEvent({
|
|
44
82
|
userOpHash,
|
|
45
83
|
event: {
|
|
46
84
|
eventType: "failed_onchain",
|
|
@@ -53,7 +91,7 @@ export class EventManager {
|
|
|
53
91
|
}
|
|
54
92
|
// emits when the userOperation has been included onchain but bundled by a frontrunner
|
|
55
93
|
emitFrontranOnChain(userOpHash, transactionHash, blockNumber) {
|
|
56
|
-
this.
|
|
94
|
+
this.queueEvent({
|
|
57
95
|
userOpHash,
|
|
58
96
|
event: {
|
|
59
97
|
eventType: "frontran_onchain",
|
|
@@ -66,7 +104,7 @@ export class EventManager {
|
|
|
66
104
|
}
|
|
67
105
|
// emits when the userOperation is included onchain
|
|
68
106
|
emitIncludedOnChain(userOpHash, transactionHash, blockNumber) {
|
|
69
|
-
this.
|
|
107
|
+
this.queueEvent({
|
|
70
108
|
userOpHash,
|
|
71
109
|
event: {
|
|
72
110
|
eventType: "included_onchain",
|
|
@@ -79,7 +117,7 @@ export class EventManager {
|
|
|
79
117
|
}
|
|
80
118
|
// emits when the userOperation is placed in the nonce queue
|
|
81
119
|
emitQueued(userOpHash) {
|
|
82
|
-
this.
|
|
120
|
+
this.queueEvent({
|
|
83
121
|
userOpHash,
|
|
84
122
|
event: {
|
|
85
123
|
eventType: "queued"
|
|
@@ -88,7 +126,7 @@ export class EventManager {
|
|
|
88
126
|
}
|
|
89
127
|
// emits when the userOperation is first seen
|
|
90
128
|
emitReceived(userOpHash, timestamp) {
|
|
91
|
-
this.
|
|
129
|
+
this.queueEvent({
|
|
92
130
|
userOpHash,
|
|
93
131
|
event: {
|
|
94
132
|
eventType: "received"
|
|
@@ -98,7 +136,7 @@ export class EventManager {
|
|
|
98
136
|
}
|
|
99
137
|
// emits when the userOperation failed to get added to the mempool
|
|
100
138
|
emitFailedValidation(userOpHash, reason, aaError) {
|
|
101
|
-
this.
|
|
139
|
+
this.queueEvent({
|
|
102
140
|
userOpHash,
|
|
103
141
|
event: {
|
|
104
142
|
eventType: "failed_validation",
|
|
@@ -112,7 +150,7 @@ export class EventManager {
|
|
|
112
150
|
// emits when the userOperation has been submitted to the network
|
|
113
151
|
emitSubmitted({ userOpHashes, transactionHash }) {
|
|
114
152
|
for (const hash of userOpHashes) {
|
|
115
|
-
this.
|
|
153
|
+
this.queueEvent({
|
|
116
154
|
userOpHash: hash,
|
|
117
155
|
event: {
|
|
118
156
|
eventType: "submitted",
|
|
@@ -123,7 +161,7 @@ export class EventManager {
|
|
|
123
161
|
}
|
|
124
162
|
// emits when the userOperation was dropped from the internal mempool
|
|
125
163
|
emitDropped(userOpHash, reason, aaError) {
|
|
126
|
-
this.
|
|
164
|
+
this.queueEvent({
|
|
127
165
|
userOpHash,
|
|
128
166
|
event: {
|
|
129
167
|
eventType: "dropped",
|
|
@@ -136,14 +174,14 @@ export class EventManager {
|
|
|
136
174
|
}
|
|
137
175
|
// emits when the userOperation was added to the internal mempool
|
|
138
176
|
emitAddedToMempool(userOpHash) {
|
|
139
|
-
this.
|
|
177
|
+
this.queueEvent({
|
|
140
178
|
userOpHash,
|
|
141
179
|
event: {
|
|
142
180
|
eventType: "added_to_mempool"
|
|
143
181
|
}
|
|
144
182
|
});
|
|
145
183
|
}
|
|
146
|
-
|
|
184
|
+
queueEvent({ userOpHash, event, timestamp }) {
|
|
147
185
|
if (!this.redisEventManagerQueue) {
|
|
148
186
|
return;
|
|
149
187
|
}
|
|
@@ -153,46 +191,7 @@ export class EventManager {
|
|
|
153
191
|
chainId: this.chainId,
|
|
154
192
|
...event
|
|
155
193
|
};
|
|
156
|
-
this.
|
|
157
|
-
}
|
|
158
|
-
emitWithTimeout(entry, eventType) {
|
|
159
|
-
if (!this.redisEventManagerQueue) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
asyncCallWithTimeout(this.redisEventManagerQueue.add(entry, {
|
|
163
|
-
removeOnComplete: true,
|
|
164
|
-
removeOnFail: true
|
|
165
|
-
}), 500 // 500ms timeout
|
|
166
|
-
)
|
|
167
|
-
.then(() => {
|
|
168
|
-
this.metrics.emittedOpEvents
|
|
169
|
-
.labels({
|
|
170
|
-
event_type: eventType,
|
|
171
|
-
status: "success"
|
|
172
|
-
})
|
|
173
|
-
.inc();
|
|
174
|
-
})
|
|
175
|
-
.catch((err) => {
|
|
176
|
-
if (err instanceof AsyncTimeoutError) {
|
|
177
|
-
this.logger.warn({ userOpHash: entry.userOperationHash, eventType }, "Event emission timed out after 500ms");
|
|
178
|
-
this.metrics.emittedOpEvents
|
|
179
|
-
.labels({
|
|
180
|
-
event_type: eventType,
|
|
181
|
-
status: "timeout"
|
|
182
|
-
})
|
|
183
|
-
.inc();
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
this.logger.error({ err }, "Failed to send userOperation status event");
|
|
187
|
-
sentry.captureException(err);
|
|
188
|
-
this.metrics.emittedOpEvents
|
|
189
|
-
.labels({
|
|
190
|
-
event_type: eventType,
|
|
191
|
-
status: "failed"
|
|
192
|
-
})
|
|
193
|
-
.inc();
|
|
194
|
-
}
|
|
195
|
-
});
|
|
194
|
+
this.eventBuffer.push(entry);
|
|
196
195
|
}
|
|
197
196
|
}
|
|
198
197
|
//# sourceMappingURL=eventManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventManager.js","sourceRoot":"","sources":["../../handlers/eventManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eventManager.js","sourceRoot":"","sources":["../../handlers/eventManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,KAAkC,MAAM,MAAM,CAAA;AACrD,OAAO,KAAK,MAAM,SAAS,CAAA;AAW3B,MAAM,OAAO,YAAY;IACJ,OAAO,CAAQ;IACf,MAAM,CAAQ;IACd,sBAAsB,CAA0B;IAChD,WAAW,GAAmB,EAAE,CAAA;IACzC,UAAU,CAAiB;IAEnC,YAAY,EACR,MAAM,EAGT;QACG,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAC7B,MAAM,aAAa,GAAG,MAAM,CAAC,6BAA6B,CAAA;QAE1D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAC1B,EAAE,MAAM,EAAE,eAAe,EAAE,EAC3B;YACI,KAAK,EAAE,MAAM,CAAC,QAAQ;SACzB,CACJ,CAAA;QAED,IAAI,MAAM,CAAC,wBAAwB,IAAI,MAAM,CAAC,oBAAoB,EAAE,CAA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E,MAAe,EAAE,OAAgB;QAC1D,IAAI,CAAC,UAAU,CAAC;YACZ,UAAU;YACV,KAAK,EAAE;gBACH,SAAS,EAAE,SAAS;gBACpB,IAAI,EAAE;oBACF,MAAM;oBACN,OAAO;iBACV;aACJ;SACJ,CAAC,CAAA;IACN,CAAC;IAED,iEAAiE;IACjE,kBAAkB,CAAC,UAAe;QAC9B,IAAI,CAAC,UAAU,CAAC;YACZ,UAAU;YACV,KAAK,EAAE;gBACH,SAAS,EAAE,kBAAkB;aAChC;SACJ,CAAC,CAAA;IACN,CAAC;IAEO,UAAU,CAAC,EACf,UAAU,EACV,KAAK,EACL,SAAS,EAKZ;QACG,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC/B,OAAM;QACV,CAAC;QAED,MAAM,KAAK,GAAiB;YACxB,iBAAiB,EAAE,UAAU;YAC7B,cAAc,EAAE,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE;YACvC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,KAAK;SACX,CAAA;QAED,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAChC,CAAC;CACJ"}
|
|
@@ -5,23 +5,22 @@ import { MantleManager } from "./mantleGasPriceManager.js";
|
|
|
5
5
|
import { OptimismManager } from "./optimismManager.js";
|
|
6
6
|
export declare class GasPriceManager {
|
|
7
7
|
private readonly config;
|
|
8
|
-
private baseFeePerGasQueue;
|
|
9
|
-
private maxFeePerGasQueue;
|
|
10
|
-
private maxPriorityFeePerGasQueue;
|
|
11
|
-
private logger;
|
|
12
|
-
arbitrumManager: ArbitrumManager;
|
|
13
|
-
mantleManager: MantleManager;
|
|
14
|
-
optimismManager: OptimismManager;
|
|
8
|
+
private readonly baseFeePerGasQueue;
|
|
9
|
+
private readonly maxFeePerGasQueue;
|
|
10
|
+
private readonly maxPriorityFeePerGasQueue;
|
|
11
|
+
private readonly logger;
|
|
12
|
+
readonly arbitrumManager: ArbitrumManager;
|
|
13
|
+
readonly mantleManager: MantleManager;
|
|
14
|
+
readonly optimismManager: OptimismManager;
|
|
15
15
|
constructor(config: AltoConfig);
|
|
16
16
|
init(): Promise<void>;
|
|
17
|
-
private getDefaultGasFee;
|
|
18
17
|
private getPolygonGasPriceParameters;
|
|
19
18
|
private bumpTheGasPrice;
|
|
20
19
|
private getFallBackMaxPriorityFeePerGas;
|
|
21
20
|
private getLegacyTransactionGasPrice;
|
|
22
21
|
private estimateGasPrice;
|
|
23
22
|
private innerGetGasPrice;
|
|
24
|
-
private
|
|
23
|
+
private tryUpdateBaseFee;
|
|
25
24
|
getBaseFee(): Promise<bigint>;
|
|
26
25
|
private tryUpdateGasPrice;
|
|
27
26
|
getGasPrice(): Promise<GasPriceParameters>;
|