@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,6 +1,165 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { aggregate3ValueAbi } from "../../types/index.js";
|
|
2
|
+
import { formatNativeBalance, scaleBigIntByPercent } from "../../utils/index.js";
|
|
3
|
+
import Redis from "ioredis";
|
|
4
|
+
import { BaseError, InsufficientFundsError, encodeFunctionData, erc20Abi } from "viem";
|
|
5
|
+
import { Addresses as TempoAddresses } from "viem/tempo";
|
|
6
|
+
let redisClient = null;
|
|
7
|
+
// Selects which wallets to refill given the utility balance. Wallets with
|
|
8
|
+
// the largest deficit are prioritized and refills that no longer fit are
|
|
9
|
+
// skipped so the utility wallet funds as many wallets as it can afford.
|
|
10
|
+
const planRefills = ({ balances, minBalance, utilityBalance }) => {
|
|
11
|
+
// Top up wallets below minBalance to 120% of minBalance
|
|
12
|
+
const candidates = balances
|
|
13
|
+
.filter(({ balance }) => balance < minBalance)
|
|
14
|
+
.sort((a, b) => (a.balance < b.balance ? -1 : 1))
|
|
15
|
+
.map(({ address, balance }) => ({
|
|
16
|
+
address,
|
|
17
|
+
refillAmount: scaleBigIntByPercent(minBalance, 120n) - balance
|
|
18
|
+
}));
|
|
19
|
+
const refills = [];
|
|
20
|
+
let total = 0n;
|
|
21
|
+
for (const candidate of candidates) {
|
|
22
|
+
if (total + candidate.refillAmount <= utilityBalance) {
|
|
23
|
+
refills.push(candidate);
|
|
24
|
+
total += candidate.refillAmount;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
refills,
|
|
29
|
+
insufficientBalance: refills.length < candidates.length
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
let isMulticall3Deployed = null;
|
|
33
|
+
// Batching is only possible for native transfers (Multicall3 would be
|
|
34
|
+
// msg.sender for ERC20 transfers) and when Multicall3 is deployed.
|
|
35
|
+
const canBatchRefills = async (config) => {
|
|
36
|
+
if (config.chainType === "tempo") {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
if (isMulticall3Deployed === null) {
|
|
40
|
+
try {
|
|
41
|
+
const code = await config.publicClient.getCode({
|
|
42
|
+
address: config.multicall3Address
|
|
43
|
+
});
|
|
44
|
+
isMulticall3Deployed = !!code && code !== "0x";
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Leave as null so the check is retried next time.
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return isMulticall3Deployed;
|
|
52
|
+
};
|
|
53
|
+
// Returns the wallet balance using ERC20 balanceOf for Tempo,
|
|
54
|
+
// native getBalance otherwise.
|
|
55
|
+
const getWalletBalance = async ({ config, address }) => {
|
|
56
|
+
if (config.chainType === "tempo") {
|
|
57
|
+
return await config.publicClient.readContract({
|
|
58
|
+
address: TempoAddresses.pathUsd,
|
|
59
|
+
abi: erc20Abi,
|
|
60
|
+
functionName: "balanceOf",
|
|
61
|
+
args: [address]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return await config.publicClient.getBalance({ address });
|
|
65
|
+
};
|
|
66
|
+
// Transfers funds to a wallet. Uses ERC20 transfer for Tempo,
|
|
67
|
+
// native value transfer otherwise.
|
|
68
|
+
const transferBalance = async ({ config, from, to, amount, maxFeePerGas, maxPriorityFeePerGas }) => {
|
|
69
|
+
if (config.chainType === "tempo") {
|
|
70
|
+
const data = encodeFunctionData({
|
|
71
|
+
abi: erc20Abi,
|
|
72
|
+
functionName: "transfer",
|
|
73
|
+
args: [to, amount]
|
|
74
|
+
});
|
|
75
|
+
return await config.walletClients.public.sendTransaction({
|
|
76
|
+
account: from,
|
|
77
|
+
to: TempoAddresses.pathUsd,
|
|
78
|
+
data,
|
|
79
|
+
maxFeePerGas,
|
|
80
|
+
maxPriorityFeePerGas
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return config.legacyTransactions
|
|
84
|
+
? await config.walletClients.public.sendTransaction({
|
|
85
|
+
account: from,
|
|
86
|
+
to,
|
|
87
|
+
value: amount,
|
|
88
|
+
gasPrice: maxFeePerGas
|
|
89
|
+
})
|
|
90
|
+
: await config.walletClients.public.sendTransaction({
|
|
91
|
+
account: from,
|
|
92
|
+
to,
|
|
93
|
+
value: amount,
|
|
94
|
+
maxFeePerGas,
|
|
95
|
+
maxPriorityFeePerGas
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
// Refills a single wallet with a direct transfer from the utility account.
|
|
99
|
+
const sendRefillTransaction = async ({ config, utilityAccount, refill, maxFeePerGas, maxPriorityFeePerGas, logger }) => {
|
|
100
|
+
const txHash = await transferBalance({
|
|
101
|
+
config,
|
|
102
|
+
from: utilityAccount,
|
|
103
|
+
to: refill.address,
|
|
104
|
+
amount: refill.refillAmount,
|
|
105
|
+
maxFeePerGas,
|
|
106
|
+
maxPriorityFeePerGas
|
|
107
|
+
});
|
|
108
|
+
await config.publicClient.waitForTransactionReceipt({
|
|
109
|
+
hash: txHash
|
|
110
|
+
});
|
|
111
|
+
logger.info({
|
|
112
|
+
txHash,
|
|
113
|
+
executorAddress: refill.address,
|
|
114
|
+
refillAmount: refill.refillAmount
|
|
115
|
+
}, "refilled wallet");
|
|
116
|
+
};
|
|
117
|
+
// Refills all wallets in a single transaction through Multicall3.
|
|
118
|
+
const sendBatchRefillTransaction = async ({ config, utilityAccount, refills, maxFeePerGas, maxPriorityFeePerGas, logger }) => {
|
|
119
|
+
// Create calldata
|
|
120
|
+
const calls = refills.map(({ address, refillAmount }) => ({
|
|
121
|
+
target: address,
|
|
122
|
+
allowFailure: false,
|
|
123
|
+
value: refillAmount,
|
|
124
|
+
callData: "0x"
|
|
125
|
+
}));
|
|
126
|
+
const totalValue = refills.reduce((sum, { refillAmount }) => sum + refillAmount, 0n);
|
|
127
|
+
const data = encodeFunctionData({
|
|
128
|
+
abi: aggregate3ValueAbi,
|
|
129
|
+
functionName: "aggregate3Value",
|
|
130
|
+
args: [calls]
|
|
131
|
+
});
|
|
132
|
+
const txHash = config.legacyTransactions
|
|
133
|
+
? await config.walletClients.public.sendTransaction({
|
|
134
|
+
account: utilityAccount,
|
|
135
|
+
to: config.multicall3Address,
|
|
136
|
+
data,
|
|
137
|
+
value: totalValue,
|
|
138
|
+
gasPrice: maxFeePerGas
|
|
139
|
+
})
|
|
140
|
+
: await config.walletClients.public.sendTransaction({
|
|
141
|
+
account: utilityAccount,
|
|
142
|
+
to: config.multicall3Address,
|
|
143
|
+
data,
|
|
144
|
+
value: totalValue,
|
|
145
|
+
maxFeePerGas,
|
|
146
|
+
maxPriorityFeePerGas
|
|
147
|
+
});
|
|
148
|
+
await config.publicClient.waitForTransactionReceipt({
|
|
149
|
+
hash: txHash
|
|
150
|
+
});
|
|
151
|
+
logger.info({
|
|
152
|
+
txHash,
|
|
153
|
+
executorAddresses: refills.map(({ address }) => address),
|
|
154
|
+
totalRefillAmount: totalValue
|
|
155
|
+
}, "refilled wallets through multicall3");
|
|
156
|
+
};
|
|
157
|
+
const isInsufficientFundsError = (e) => {
|
|
158
|
+
if (e instanceof BaseError) {
|
|
159
|
+
return !!e.walk((err) => err instanceof InsufficientFundsError);
|
|
160
|
+
}
|
|
161
|
+
return false;
|
|
162
|
+
};
|
|
4
163
|
export const validateAndRefillWallets = async ({ metrics, config, senderManager, gasPriceManager }) => {
|
|
5
164
|
const logger = config.getLogger({ module: "validate-and-refill-wallets" }, { level: config.logLevel });
|
|
6
165
|
const minBalance = config.minExecutorBalance;
|
|
@@ -8,104 +167,128 @@ export const validateAndRefillWallets = async ({ metrics, config, senderManager,
|
|
|
8
167
|
if (!(minBalance && utilityAccount)) {
|
|
9
168
|
return;
|
|
10
169
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
170
|
+
// With horizontal scaling, a Redis SET NX lock ensures only one instance
|
|
171
|
+
// refills per interval. Non-winners remove their wallet gauge samples so
|
|
172
|
+
// only the latest winner exposes values.
|
|
173
|
+
if (config.enableHorizontalScaling && config.redisEndpoint) {
|
|
174
|
+
if (!redisClient) {
|
|
175
|
+
redisClient = new Redis(config.redisEndpoint);
|
|
176
|
+
}
|
|
177
|
+
const acquired = await redisClient
|
|
178
|
+
.set(`${config.redisKeyPrefix}:${config.chainId}:wallet-refill-lock`, "1", "EX", Math.floor(config.executorRefillInterval / 2), "NX")
|
|
179
|
+
.catch((err) => {
|
|
180
|
+
logger.warn({ err }, "Redis lock check failed, proceeding with update");
|
|
181
|
+
return "OK";
|
|
19
182
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
183
|
+
if (acquired !== "OK") {
|
|
184
|
+
metrics.utilityWalletBalance.remove();
|
|
185
|
+
metrics.utilityWalletInsufficientBalance.remove();
|
|
186
|
+
metrics.utilityWalletMissingBalance.remove();
|
|
187
|
+
metrics.executorWalletsBalances.reset();
|
|
188
|
+
return;
|
|
26
189
|
}
|
|
190
|
+
}
|
|
191
|
+
const allWallets = senderManager.getAllWallets();
|
|
192
|
+
// Fetch gasPrice once and bump by 200% to account for fluctuations
|
|
193
|
+
const gasPrice = await gasPriceManager.tryGetNetworkGasPrice({
|
|
194
|
+
forExecutor: true
|
|
27
195
|
});
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
196
|
+
const maxFeePerGas = scaleBigIntByPercent(gasPrice.maxFeePerGas, 200n);
|
|
197
|
+
const maxPriorityFeePerGas = scaleBigIntByPercent(gasPrice.maxPriorityFeePerGas, 200n);
|
|
198
|
+
const balances = await Promise.all(allWallets.map(async (wallet) => ({
|
|
199
|
+
address: wallet.address,
|
|
200
|
+
balance: await getWalletBalance({
|
|
201
|
+
config,
|
|
202
|
+
address: wallet.address
|
|
203
|
+
})
|
|
204
|
+
})));
|
|
205
|
+
// Only send refills that fit within the utility wallet balance so a
|
|
206
|
+
// shortfall degrades to a partial refill instead of a failed batch.
|
|
207
|
+
const utilityBalance = await getWalletBalance({
|
|
208
|
+
config,
|
|
209
|
+
address: utilityAccount.address
|
|
210
|
+
});
|
|
211
|
+
const { refills, insufficientBalance } = planRefills({
|
|
212
|
+
balances,
|
|
213
|
+
minBalance,
|
|
214
|
+
utilityBalance
|
|
215
|
+
});
|
|
216
|
+
if (insufficientBalance) {
|
|
217
|
+
logger.warn({
|
|
218
|
+
utilityBalance,
|
|
219
|
+
shortfallCount: balances.filter(({ balance }) => balance < minBalance).length,
|
|
220
|
+
fundedCount: refills.length
|
|
221
|
+
}, "utility balance insufficient for full refill, sending partial refill");
|
|
41
222
|
}
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
let maxFeePerGas;
|
|
45
|
-
let maxPriorityFeePerGas;
|
|
223
|
+
let hitInsufficientFundsError = false;
|
|
224
|
+
if (refills.length > 0 && (await canBatchRefills(config))) {
|
|
46
225
|
try {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
226
|
+
await sendBatchRefillTransaction({
|
|
227
|
+
config,
|
|
228
|
+
utilityAccount,
|
|
229
|
+
refills,
|
|
230
|
+
maxFeePerGas,
|
|
231
|
+
maxPriorityFeePerGas,
|
|
232
|
+
logger
|
|
233
|
+
});
|
|
50
234
|
}
|
|
51
235
|
catch (e) {
|
|
52
|
-
|
|
53
|
-
|
|
236
|
+
if (isInsufficientFundsError(e)) {
|
|
237
|
+
hitInsufficientFundsError = true;
|
|
238
|
+
logger.warn({ executors: refills.map(({ address }) => address) }, "insufficient utility funds");
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
logger.error({ err: e }, "failed to batch refill wallets");
|
|
242
|
+
}
|
|
54
243
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
for (const refill of refills) {
|
|
247
|
+
try {
|
|
248
|
+
await sendRefillTransaction({
|
|
249
|
+
config,
|
|
250
|
+
utilityAccount,
|
|
251
|
+
refill,
|
|
252
|
+
maxFeePerGas,
|
|
253
|
+
maxPriorityFeePerGas,
|
|
254
|
+
logger
|
|
62
255
|
});
|
|
63
256
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
wallet: config.walletClient
|
|
257
|
+
catch (e) {
|
|
258
|
+
if (isInsufficientFundsError(e)) {
|
|
259
|
+
hitInsufficientFundsError = true;
|
|
260
|
+
logger.warn({ executor: refill.address }, "insufficient utility funds");
|
|
261
|
+
break;
|
|
70
262
|
}
|
|
71
|
-
|
|
72
|
-
const tx = await callEngine.write.execute([instructions], {
|
|
73
|
-
account: utilityAccount,
|
|
74
|
-
value: totalBalanceMissing,
|
|
75
|
-
maxFeePerGas: maxFeePerGas * 2n,
|
|
76
|
-
maxPriorityFeePerGas: maxPriorityFeePerGas * 2n
|
|
77
|
-
});
|
|
78
|
-
await config.publicClient.waitForTransactionReceipt({ hash: tx });
|
|
79
|
-
for (const [address, missingBalance] of Object.entries(balancesMissing)) {
|
|
80
|
-
logger.info({ tx, executor: address, missingBalance }, "refilled wallet");
|
|
263
|
+
logger.error({ err: e }, "failed to refill wallet");
|
|
81
264
|
}
|
|
82
265
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
maxPriorityFeePerGas: config.legacyTransactions
|
|
94
|
-
? undefined
|
|
95
|
-
: maxPriorityFeePerGas,
|
|
96
|
-
gasPrice: config.legacyTransactions
|
|
97
|
-
? maxFeePerGas
|
|
98
|
-
: undefined
|
|
99
|
-
});
|
|
100
|
-
await config.publicClient.waitForTransactionReceipt({
|
|
101
|
-
hash: tx
|
|
102
|
-
});
|
|
103
|
-
logger.info({ tx, executor: address, missingBalance }, "refilled wallet");
|
|
104
|
-
}
|
|
266
|
+
}
|
|
267
|
+
let remainingMissing = 0n;
|
|
268
|
+
for (const wallet of allWallets) {
|
|
269
|
+
const balance = await getWalletBalance({
|
|
270
|
+
config,
|
|
271
|
+
address: wallet.address
|
|
272
|
+
});
|
|
273
|
+
metrics.executorWalletsBalances.set({ wallet: wallet.address }, formatNativeBalance({ value: balance, config }));
|
|
274
|
+
if (balance < minBalance) {
|
|
275
|
+
remainingMissing += minBalance - balance;
|
|
105
276
|
}
|
|
106
277
|
}
|
|
107
|
-
|
|
278
|
+
if (remainingMissing === 0n) {
|
|
108
279
|
logger.info("no wallets need to be refilled");
|
|
280
|
+
metrics.utilityWalletMissingBalance.set(0);
|
|
109
281
|
}
|
|
282
|
+
else {
|
|
283
|
+
metrics.utilityWalletMissingBalance.set(formatNativeBalance({ value: remainingMissing, config }));
|
|
284
|
+
}
|
|
285
|
+
// Set when the utility wallet could not cover this refill pass, either
|
|
286
|
+
// detected upfront during planning or by the transaction failing.
|
|
287
|
+
metrics.utilityWalletInsufficientBalance.set(insufficientBalance || hitInsufficientFundsError ? 1 : 0);
|
|
288
|
+
const remainingUtilityBalance = await getWalletBalance({
|
|
289
|
+
config,
|
|
290
|
+
address: utilityAccount.address
|
|
291
|
+
});
|
|
292
|
+
metrics.utilityWalletBalance.set(formatNativeBalance({ value: remainingUtilityBalance, config }));
|
|
110
293
|
};
|
|
111
294
|
//# sourceMappingURL=validateAndRefill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateAndRefill.js","sourceRoot":"","sources":["../../../executor/senderManager/validateAndRefill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"validateAndRefill.js","sourceRoot":"","sources":["../../../executor/senderManager/validateAndRefill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAGH,SAAS,EAET,sBAAsB,EACtB,kBAAkB,EAClB,QAAQ,EACX,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,YAAY,CAAA;AAKxD,IAAI,WAAW,GAAiB,IAAI,CAAA;AAYpC,0EAA0E;AAC1E,yEAAyE;AACzE,wEAAwE;AACxE,MAAM,WAAW,GAAG,CAAC,EACjB,QAAQ,EACR,UAAU,EACV,cAAc,EAKjB,EAAc,EAAE;IACb,wDAAwD;IACxD,MAAM,UAAU,GAAa,QAAQ;SAChC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,GAAG,UAAU,CAAC;SAC7C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAChD,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5B,OAAO;QACP,YAAY,EAAE,oBAAoB,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,OAAO;KACjE,CAAC,CAAC,CAAA;IAEP,MAAM,OAAO,GAAa,E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AAO,EAAE,MAAM,CAAC,OAAO;SAC1B,CAAC,CAAA;QAEF,OAAO,CAAC,uBAAuB,CAAC,GAAG,CAC/B,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,EAC1B,mBAAmB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAClD,CAAA;QAED,IAAI,OAAO,GAAG,UAAU,EAAE,CAAC;YACvB,gBAAgB,IAAI,UAAU,GAAG,OAAO,CAAA;QAC5C,CAAC;IACL,CAAC;IAED,IAAI,gBAAgB,KAAK,EAAE,EAAE,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAA;QAC7C,OAAO,CAAC,2BAA2B,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC9C,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,2BAA2B,CAAC,GAAG,CACnC,mBAAmB,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC,CAC3D,CAAA;IACL,CAAC;IAED,uEAAuE;IACvE,kEAAkE;IAClE,OAAO,CAAC,gCAAgC,CAAC,GAAG,CACxC,mBAAmB,IAAI,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC3D,CAAA;IAED,MAAM,uBAAuB,GAAG,MAAM,gBAAgB,CAAC;QACnD,MAAM;QACN,OAAO,EAAE,cAAc,CAAC,OAAO;KAClC,CAAC,CAAA;IACF,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAC5B,mBAAmB,CAAC,EAAE,KAAK,EAAE,uBAAuB,EAAE,MAAM,EAAE,CAAC,CAClE,CAAA;AACL,CAAC,CAAA"}
|
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[];
|
|
@@ -24,7 +29,7 @@ export declare const encodeHandleOpsCalldata: ({ userOps, beneficiary }: {
|
|
|
24
29
|
userOps: UserOperation[];
|
|
25
30
|
beneficiary: Address;
|
|
26
31
|
}) => Hex;
|
|
27
|
-
export declare const
|
|
32
|
+
export declare const getAuthorizationListFromUserOps: (userOps: UserOperation[]) => SignedAuthorizationList | undefined;
|
|
28
33
|
export declare function flushStuckTransaction({ config, wallet, gasPrice, logger }: {
|
|
29
34
|
config: AltoConfig;
|
|
30
35
|
wallet: Account;
|
package/esm/executor/utils.js
CHANGED
|
@@ -1,11 +1,42 @@
|
|
|
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 { skipLocalGasCalculations, 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 (skipLocalGasCalculations) {
|
|
11
|
+
const authorizationList = getAuthorizationListFromUserOps(userOps);
|
|
12
|
+
gasLimit = await publicClient.estimateGas({
|
|
13
|
+
to: entryPoint,
|
|
14
|
+
account: executorAddress,
|
|
15
|
+
data: encodeHandleOpsCalldata({
|
|
16
|
+
userOps: userOps,
|
|
17
|
+
beneficiary: executorAddress
|
|
18
|
+
}),
|
|
19
|
+
authorizationList
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const aa95GasFloor = calculateAA95GasFloor({
|
|
24
|
+
userOps: userOps,
|
|
25
|
+
beneficiary: executorAddress
|
|
26
|
+
});
|
|
27
|
+
const eip7702UserOpCount = userOps.filter((userOp) => userOp.eip7702Auth).length;
|
|
28
|
+
const eip7702Overhead = BigInt(eip7702UserOpCount) * 40000n;
|
|
29
|
+
gasLimit = aa95GasFloor + eip7702Overhead;
|
|
30
|
+
}
|
|
31
|
+
return scaleBigIntByPercent(gasLimit, config.executorGasMultiplier);
|
|
32
|
+
};
|
|
5
33
|
export const isTransactionUnderpricedError = (e) => {
|
|
6
|
-
const transactionUnderPriceError = e.walk((e) =>
|
|
7
|
-
?.toLowerCase()
|
|
8
|
-
|
|
34
|
+
const transactionUnderPriceError = e.walk((e) => {
|
|
35
|
+
const message = e?.message?.toLowerCase();
|
|
36
|
+
return (message?.includes("replacement transaction underpriced") || // Geth error message
|
|
37
|
+
message?.includes("could not replace existing tx") // Erigon error message
|
|
38
|
+
);
|
|
39
|
+
});
|
|
9
40
|
return transactionUnderPriceError !== null;
|
|
10
41
|
};
|
|
11
42
|
// V7 source: https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.7/contracts/core/EntryPoint.sol
|
|
@@ -61,10 +92,10 @@ export const packUserOps = (userOps) => {
|
|
|
61
92
|
if (userOps.length === 0) {
|
|
62
93
|
return [];
|
|
63
94
|
}
|
|
64
|
-
const
|
|
65
|
-
const packedUserOps =
|
|
95
|
+
const is06 = isVersion06(userOps[0]);
|
|
96
|
+
const packedUserOps = is06
|
|
66
97
|
? userOps
|
|
67
|
-
: userOps.map((
|
|
98
|
+
: userOps.map((userOp) => toPackedUserOp(userOp));
|
|
68
99
|
return packedUserOps;
|
|
69
100
|
};
|
|
70
101
|
export const encodeHandleOpsCalldata = ({ userOps, beneficiary }) => {
|
|
@@ -76,28 +107,29 @@ export const encodeHandleOpsCalldata = ({ userOps, beneficiary }) => {
|
|
|
76
107
|
args: [packedUserOps, beneficiary]
|
|
77
108
|
});
|
|
78
109
|
};
|
|
79
|
-
export const
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
: eip7702Auth
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
110
|
+
export const getAuthorizationListFromUserOps = (userOps) => {
|
|
111
|
+
const authMap = new Map();
|
|
112
|
+
// Deduplicate EIP-7702 auths if userOp.sender has multiple same eip7702Auth fields.
|
|
113
|
+
for (const userOp of userOps) {
|
|
114
|
+
const { eip7702Auth, sender } = userOp;
|
|
115
|
+
if (eip7702Auth && !authMap.has(sender)) {
|
|
116
|
+
authMap.set(sender, {
|
|
117
|
+
address: getEip7702AuthAddress(eip7702Auth),
|
|
118
|
+
chainId: eip7702Auth.chainId,
|
|
119
|
+
nonce: eip7702Auth.nonce,
|
|
120
|
+
r: eip7702Auth.r,
|
|
121
|
+
s: eip7702Auth.s,
|
|
122
|
+
v: eip7702Auth.v,
|
|
123
|
+
yParity: eip7702Auth.yParity
|
|
124
|
+
});
|
|
93
125
|
}
|
|
94
|
-
|
|
95
|
-
|
|
126
|
+
}
|
|
127
|
+
const authList = Array.from(authMap.values());
|
|
96
128
|
return authList.length > 0 ? authList : undefined;
|
|
97
129
|
};
|
|
98
130
|
export async function flushStuckTransaction({ config, wallet, gasPrice, logger }) {
|
|
99
131
|
const publicClient = config.publicClient;
|
|
100
|
-
const walletClient = config.
|
|
132
|
+
const walletClient = config.walletClients.public;
|
|
101
133
|
const latestNonce = await publicClient.getTransactionCount({
|
|
102
134
|
address: wallet.address,
|
|
103
135
|
blockTag: "latest"
|
|
@@ -128,9 +160,9 @@ export async function flushStuckTransaction({ config, wallet, gasPrice, logger }
|
|
|
128
160
|
});
|
|
129
161
|
logger.debug({ txHash, nonce: nonceToFlush, wallet: wallet.address }, "flushed stuck transaction");
|
|
130
162
|
}
|
|
131
|
-
catch (
|
|
132
|
-
sentry.captureException(
|
|
133
|
-
logger.warn({
|
|
163
|
+
catch (err) {
|
|
164
|
+
sentry.captureException(err);
|
|
165
|
+
logger.warn({ err }, "error flushing stuck transaction");
|
|
134
166
|
}
|
|
135
167
|
}
|
|
136
168
|
}
|
|
@@ -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;AACpB,OAAO,EAEH,WAAW,EACX,WAAW,EACX,cAAc,EACjB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../executor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAKnB,MAAM,aAAa,CAAA;AACpB,OAAO,EAEH,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,cAAc,EACjB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,EAMH,kBAAkB,EAClB,OAAO,EACV,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EA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;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
|