@pimlico/alto 0.0.18 → 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 -0
- package/contracts/ERC165.sol/ERC165.json +1 -0
- package/contracts/ERC20.sol/ERC20.json +1 -0
- package/contracts/Eip7702Support.sol/Eip7702Support.json +1 -0
- package/contracts/EntryPoint.sol/EntryPoint.json +1 -0
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride06.json +1 -0
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride07.json +1 -0
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride08.json +1 -0
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride09.json +1 -0
- package/contracts/EntryPointGasEstimationOverride.sol/EntryPointGasEstimationOverride06.json +1 -0
- package/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -0
- package/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -0
- package/contracts/EntryPointSimulations.sol/EntryPointSimulations09.json +1 -0
- package/contracts/Exec.sol/Exec.json +1 -0
- package/contracts/IAccount.sol/IAccount.json +1 -0
- package/contracts/IAccountExecute.sol/IAccountExecute.json +1 -0
- package/contracts/IAggregator.sol/IAggregator.json +1 -0
- package/contracts/IERC165.sol/IERC165.json +1 -0
- package/contracts/IERC5267.sol/IERC5267.json +1 -0
- package/contracts/IEntryPoint.sol/IEntryPoint.json +1 -0
- package/contracts/IEntryPointFilterOpsOverride.sol/IEntryPointFilterOpsOverride08.json +1 -0
- package/contracts/IEntryPointFilterOpsOverride.sol/IEntryPointFilterOpsOverride09.json +1 -0
- package/contracts/IEntryPointSimulations.sol/IEntryPointSimulations.json +1 -0
- package/contracts/INonceManager.sol/INonceManager.json +1 -0
- package/contracts/IPaymaster.sol/IPaymaster.json +1 -0
- package/contracts/ISenderCreator.sol/ISenderCreator.json +1 -0
- package/contracts/IStakeManager.sol/IStakeManager.json +1 -0
- package/contracts/LibBytes.sol/LibBytes.json +1 -0
- package/contracts/Math.sol/Math.json +1 -0
- package/contracts/MessageHashUtils.sol/MessageHashUtils.json +1 -0
- package/contracts/NonceManager.sol/NonceManager.json +1 -0
- package/contracts/Panic.sol/Panic.json +1 -0
- package/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -0
- package/contracts/ReentrancyGuard.sol/ReentrancyGuard.json +1 -0
- package/contracts/ReentrancyGuardTransient.sol/ReentrancyGuardTransient.json +1 -0
- package/contracts/SafeCast.sol/SafeCast.json +1 -0
- package/contracts/SenderCreator.sol/SenderCreator.json +1 -0
- package/contracts/ShortStrings.sol/ShortStrings.json +1 -0
- package/contracts/SignedMath.sol/SignedMath.json +1 -0
- package/contracts/SimulationOverrideHelper.sol/SimulationOverrideHelper.json +1 -0
- package/contracts/StakeManager.sol/StakeManager.json +1 -0
- package/contracts/StorageSlot.sol/StorageSlot.json +1 -0
- package/contracts/Strings.sol/Strings.json +1 -0
- package/contracts/TransientSlot.sol/TransientSlot.json +1 -0
- package/contracts/UserOperation.sol/UserOperationLib.json +1 -0
- package/contracts/UserOperationLib.sol/UserOperationLib.json +1 -0
- 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/8dbf8a4ad39019b5.json +1 -0
- package/contracts/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -0
- package/contracts/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -0
- package/contracts/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -0
- package/contracts/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -0
- 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 -0
- package/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -0
- package/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -0
- 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 -0
- 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 -0
- package/contracts/utils/StorageSlot.sol/StorageSlot.json +1 -0
- package/contracts/v09/EntryPoint.sol/EntryPoint.json +1 -0
- package/esm/cli/alto.js +16 -7
- package/esm/cli/alto.js.map +1 -1
- package/esm/cli/config/bundler.d.ts +690 -540
- package/esm/cli/config/bundler.js +101 -66
- package/esm/cli/config/bundler.js.map +1 -1
- package/esm/cli/config/options.d.ts +2 -1
- package/esm/cli/config/options.js +207 -59
- package/esm/cli/config/options.js.map +1 -1
- package/esm/cli/customTransport.d.ts +3 -3
- package/esm/cli/customTransport.js +4 -3
- package/esm/cli/customTransport.js.map +1 -1
- package/esm/cli/deploySimulationsContract.d.ts +5 -2
- package/esm/cli/deploySimulationsContract.js +108 -40
- package/esm/cli/deploySimulationsContract.js.map +1 -1
- package/esm/cli/handler.js +94 -22
- package/esm/cli/handler.js.map +1 -1
- package/esm/cli/instrumentation.js +7 -1
- package/esm/cli/instrumentation.js.map +1 -1
- package/esm/cli/parseArgs.js.map +1 -1
- package/esm/cli/setupServer.js +63 -63
- 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 -0
- package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride07.json +1 -0
- package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride08.json +1 -0
- package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride09.json +1 -0
- package/esm/contracts/EntryPointGasEstimationOverride.sol/EntryPointGasEstimationOverride06.json +1 -0
- package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -0
- package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -0
- package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations09.json +1 -0
- package/esm/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -0
- package/esm/createConfig.d.ts +12 -4
- package/esm/createConfig.js +2 -0
- package/esm/createConfig.js.map +1 -1
- package/esm/executor/bundleManager.d.ts +111 -0
- package/esm/executor/bundleManager.js +354 -0
- package/esm/executor/bundleManager.js.map +1 -0
- package/esm/executor/executor.d.ts +18 -23
- package/esm/executor/executor.js +183 -119
- package/esm/executor/executor.js.map +1 -1
- package/esm/executor/executorManager.d.ts +39 -88
- package/esm/executor/executorManager.js +325 -550
- package/esm/executor/executorManager.js.map +1 -1
- package/esm/executor/filterOpsAndEstimateGas.d.ts +39 -0
- package/esm/executor/filterOpsAndEstimateGas.js +280 -0
- package/esm/executor/filterOpsAndEstimateGas.js.map +1 -0
- package/esm/executor/getBundleStatus.d.ts +25 -0
- package/esm/executor/getBundleStatus.js +35 -0
- package/esm/executor/getBundleStatus.js.map +1 -0
- 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.d.ts +3 -3
- package/esm/executor/senderManager/createMemorySenderManager.js +14 -1
- package/esm/executor/senderManager/createMemorySenderManager.js.map +1 -1
- package/esm/executor/senderManager/createRedisSenderManager.d.ts +5 -4
- package/esm/executor/senderManager/createRedisSenderManager.js +4 -7
- package/esm/executor/senderManager/createRedisSenderManager.js.map +1 -1
- package/esm/executor/senderManager/flushOnStartUp.d.ts +3 -3
- package/esm/executor/senderManager/flushOnStartUp.js +4 -4
- package/esm/executor/senderManager/flushOnStartUp.js.map +1 -1
- package/esm/executor/senderManager/index.d.ts +4 -3
- package/esm/executor/senderManager/index.js +6 -2
- package/esm/executor/senderManager/index.js.map +1 -1
- package/esm/executor/senderManager/validateAndRefill.d.ts +4 -4
- package/esm/executor/senderManager/validateAndRefill.js +3 -3
- package/esm/executor/senderManager/validateAndRefill.js.map +1 -1
- package/esm/executor/utilityWalletMonitor.d.ts +5 -5
- package/esm/executor/utilityWalletMonitor.js +1 -1
- package/esm/executor/utilityWalletMonitor.js.map +1 -1
- package/esm/executor/utils.d.ts +14 -6
- package/esm/executor/utils.js +68 -37
- package/esm/executor/utils.js.map +1 -1
- package/esm/handlers/arbitrumGasPriceManager.d.ts +4 -3
- package/esm/handlers/arbitrumGasPriceManager.js +9 -5
- package/esm/handlers/arbitrumGasPriceManager.js.map +1 -1
- package/esm/handlers/eventManager.d.ts +19 -18
- package/esm/handlers/eventManager.js +81 -61
- package/esm/handlers/eventManager.js.map +1 -1
- package/esm/handlers/gasPriceManager.d.ts +12 -10
- package/esm/handlers/gasPriceManager.js +79 -125
- package/esm/handlers/gasPriceManager.js.map +1 -1
- package/esm/handlers/mantleGasPriceManager.d.ts +5 -5
- package/esm/handlers/mantleGasPriceManager.js +4 -4
- package/esm/handlers/mantleGasPriceManager.js.map +1 -1
- package/esm/handlers/optimismManager.d.ts +2 -2
- 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 +71 -33
- package/esm/mempool/mempool.js +231 -155
- package/esm/mempool/mempool.js.map +1 -1
- package/esm/mempool/reputationManager.d.ts +36 -36
- package/esm/mempool/reputationManager.js +93 -97
- 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.d.ts +2 -2
- package/esm/rpc/createMethodHandler.js.map +1 -1
- package/esm/rpc/estimation/gasEstimationHandler.d.ts +15 -16
- package/esm/rpc/estimation/gasEstimationHandler.js +24 -24
- package/esm/rpc/estimation/gasEstimationHandler.js.map +1 -1
- package/esm/rpc/estimation/gasEstimations06.d.ts +18 -0
- package/esm/rpc/estimation/gasEstimations06.js +45 -0
- package/esm/rpc/estimation/gasEstimations06.js.map +1 -0
- package/esm/rpc/estimation/gasEstimations07.d.ts +63 -0
- package/esm/rpc/estimation/gasEstimations07.js +384 -0
- package/esm/rpc/estimation/gasEstimations07.js.map +1 -0
- package/esm/rpc/estimation/preVerificationGasCalculator.d.ts +56 -0
- package/esm/rpc/estimation/preVerificationGasCalculator.js +467 -0
- package/esm/rpc/estimation/preVerificationGasCalculator.js.map +1 -0
- package/esm/rpc/estimation/types.d.ts +25 -111
- package/esm/rpc/estimation/types.js +5 -121
- package/esm/rpc/estimation/types.js.map +1 -1
- package/esm/rpc/estimation/utils.d.ts +69 -0
- package/esm/rpc/estimation/utils.js +240 -0
- package/esm/rpc/estimation/utils.js.map +1 -0
- package/{lib/rpc/methods/pimlico_sendUserOperationNow.d.ts → esm/rpc/methods/boost_sendUserOperation.d.ts} +299 -385
- package/esm/rpc/methods/boost_sendUserOperation.js +57 -0
- package/esm/rpc/methods/boost_sendUserOperation.js.map +1 -0
- package/esm/rpc/methods/debug_bundler_clearReputation.js +2 -2
- package/esm/rpc/methods/debug_bundler_clearReputation.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_clearState.js +2 -2
- 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_dumpMempool.js +1 -1
- package/esm/rpc/methods/debug_bundler_dumpMempool.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_dumpReputation.js +2 -2
- package/esm/rpc/methods/debug_bundler_dumpReputation.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_getStakeStatus.js +1 -2
- package/esm/rpc/methods/debug_bundler_getStakeStatus.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_sendBundleNow.js +10 -2
- package/esm/rpc/methods/debug_bundler_sendBundleNow.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_setBundlingMode.js +1 -1
- package/esm/rpc/methods/debug_bundler_setBundlingMode.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_setReputation.js +1 -1
- package/esm/rpc/methods/debug_bundler_setReputation.js.map +1 -1
- package/esm/rpc/methods/eth_chainId.js +1 -1
- package/esm/rpc/methods/eth_chainId.js.map +1 -1
- package/esm/rpc/methods/eth_estimateUserOperationGas.d.ts +910 -301
- package/esm/rpc/methods/eth_estimateUserOperationGas.js +228 -12
- 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 +8 -8
- 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 +10 -4
- package/esm/rpc/methods/eth_getUserOperationReceipt.js.map +1 -1
- package/esm/rpc/methods/eth_sendUserOperation.d.ts +319 -2
- package/esm/rpc/methods/eth_sendUserOperation.js +223 -20
- package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -1
- package/esm/rpc/methods/eth_supportedEntryPoints.js +1 -1
- package/esm/rpc/methods/eth_supportedEntryPoints.js.map +1 -1
- package/esm/rpc/methods/index.js +11 -6
- package/esm/rpc/methods/index.js.map +1 -1
- package/esm/rpc/methods/pimlico_getUserOperationGasPrice.js +1 -1
- package/esm/rpc/methods/pimlico_getUserOperationGasPrice.js.map +1 -1
- package/esm/rpc/methods/pimlico_getUserOperationStatus.d.ts +6 -6
- package/esm/rpc/methods/pimlico_getUserOperationStatus.js +3 -3
- 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 +27 -24
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js.map +1 -1
- package/{lib/rpc/methods/eth_estimateUserOperationGas.d.ts → esm/rpc/methods/pimlico_simulateAssetChange.d.ts} +891 -333
- package/esm/rpc/methods/pimlico_simulateAssetChange.js +113 -0
- package/esm/rpc/methods/pimlico_simulateAssetChange.js.map +1 -0
- package/esm/rpc/rpcHandler.d.ts +30 -54
- package/esm/rpc/rpcHandler.js +137 -315
- 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 +2 -2
- 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 +20 -22
- package/esm/rpc/validation/SafeValidator.js +87 -100
- package/esm/rpc/validation/SafeValidator.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV06.d.ts +3 -3
- package/esm/rpc/validation/TracerResultParserV06.js +19 -19
- package/esm/rpc/validation/TracerResultParserV06.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV07.d.ts +3 -3
- package/esm/rpc/validation/TracerResultParserV07.js +25 -25
- package/esm/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/esm/rpc/validation/UnsafeValidator.d.ts +32 -33
- package/esm/rpc/validation/UnsafeValidator.js +117 -101
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
- package/esm/rpc/validation/tracer.d.ts +1 -1
- package/esm/store/createMempoolStore.d.ts +3 -3
- package/esm/store/createMempoolStore.js +100 -113
- package/esm/store/createMempoolStore.js.map +1 -1
- package/esm/store/index.d.ts +4 -80
- 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/outstanding/memory.d.ts +29 -0
- 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 +1661 -0
- package/esm/types/contracts/{EntryPointSimulationsV7.js → PimlicoSimulations.js} +1104 -1788
- package/esm/types/contracts/PimlicoSimulations.js.map +1 -0
- package/esm/types/contracts/index.d.ts +1 -3
- package/esm/types/contracts/index.js +1 -3
- 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 +26 -26
- package/esm/types/mempool.d.ts +14 -28
- package/esm/types/mempool.js +1 -7
- package/esm/types/mempool.js.map +1 -1
- package/esm/types/schemas.d.ts +26347 -10767
- package/esm/types/schemas.js +202 -38
- 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 +9447 -8727
- package/esm/types/validation.js +123 -161
- package/esm/types/validation.js.map +1 -1
- package/esm/utils/asyncTimeout.d.ts +5 -0
- package/esm/utils/asyncTimeout.js +23 -0
- package/esm/utils/asyncTimeout.js.map +1 -0
- package/esm/utils/bigInt.d.ts +9 -0
- package/esm/utils/bigInt.js +19 -2
- package/esm/utils/bigInt.js.map +1 -1
- package/esm/utils/eip7702.d.ts +4 -3
- package/esm/utils/eip7702.js +16 -7
- package/esm/utils/eip7702.js.map +1 -1
- package/esm/utils/entryPointOverrides.d.ts +12 -0
- package/esm/utils/entryPointOverrides.js +71 -0
- package/esm/utils/entryPointOverrides.js.map +1 -0
- package/esm/utils/helpers.d.ts +5 -3
- package/esm/utils/helpers.js +36 -13
- package/esm/utils/helpers.js.map +1 -1
- package/esm/utils/index.d.ts +2 -2
- package/esm/utils/index.js +1 -1
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/metrics.d.ts +11 -9
- package/esm/utils/metrics.js +44 -25
- package/esm/utils/metrics.js.map +1 -1
- package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.d.ts +2 -2
- package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js +2 -2
- package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js.map +1 -1
- package/esm/utils/minMaxQueue/createRedisMinMaxQueue.d.ts +26 -4
- package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js +111 -71
- package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js.map +1 -1
- package/esm/utils/minMaxQueue/index.d.ts +3 -3
- 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.d.ts +4 -0
- package/esm/utils/toViemStateOverrides.js +44 -0
- package/esm/utils/toViemStateOverrides.js.map +1 -0
- package/esm/utils/userop.d.ts +89 -87
- package/esm/utils/userop.js +207 -439
- package/esm/utils/userop.js.map +1 -1
- package/package.json +12 -7
- package/esm/executor/fastlane.d.ts +0 -9
- package/esm/executor/fastlane.js +0 -37
- package/esm/executor/fastlane.js.map +0 -1
- package/esm/executor/filterOpsAndEStimateGas.d.ts +0 -29
- package/esm/executor/filterOpsAndEStimateGas.js +0 -198
- package/esm/executor/filterOpsAndEStimateGas.js.map +0 -1
- package/esm/mempool/monitoring.d.ts +0 -14
- package/esm/mempool/monitoring.js +0 -97
- package/esm/mempool/monitoring.js.map +0 -1
- package/esm/rpc/estimation/gasEstimationsV06.d.ts +0 -19
- package/esm/rpc/estimation/gasEstimationsV06.js +0 -144
- package/esm/rpc/estimation/gasEstimationsV06.js.map +0 -1
- package/esm/rpc/estimation/gasEstimationsV07.d.ts +0 -101
- package/esm/rpc/estimation/gasEstimationsV07.js +0 -721
- package/esm/rpc/estimation/gasEstimationsV07.js.map +0 -1
- package/esm/store/createMemoryOutstandingStore.d.ts +0 -28
- package/esm/store/createMemoryOutstandingStore.js +0 -231
- 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/EntryPointSimulationsV6.d.ts +0 -34
- package/esm/types/contracts/EntryPointSimulationsV6.js +0 -48
- package/esm/types/contracts/EntryPointSimulationsV6.js.map +0 -1
- package/esm/types/contracts/EntryPointSimulationsV7.d.ts +0 -2193
- package/esm/types/contracts/EntryPointSimulationsV7.js.map +0 -1
- package/esm/types/contracts/PimlicoEntryPointSimulations.d.ts +0 -26
- package/esm/types/contracts/PimlicoEntryPointSimulations.js +0 -38
- package/esm/types/contracts/PimlicoEntryPointSimulations.js.map +0 -1
- package/esm/utils/validation.d.ts +0 -76
- package/esm/utils/validation.js +0 -484
- package/esm/utils/validation.js.map +0 -1
- package/lib/cli/alto.d.ts +0 -7
- package/lib/cli/alto.js +0 -141
- package/lib/cli/alto.js.map +0 -1
- package/lib/cli/config/bundler.d.ts +0 -2836
- package/lib/cli/config/bundler.js +0 -222
- package/lib/cli/config/bundler.js.map +0 -1
- package/lib/cli/config/index.d.ts +0 -3
- package/lib/cli/config/index.js +0 -19
- package/lib/cli/config/index.js.map +0 -1
- package/lib/cli/config/options.d.ts +0 -13
- package/lib/cli/config/options.js +0 -553
- package/lib/cli/config/options.js.map +0 -1
- package/lib/cli/customTransport.d.ts +0 -14
- package/lib/cli/customTransport.js +0 -94
- package/lib/cli/customTransport.js.map +0 -1
- package/lib/cli/deploySimulationsContract.d.ts +0 -13
- package/lib/cli/deploySimulationsContract.js +0 -112
- package/lib/cli/deploySimulationsContract.js.map +0 -1
- package/lib/cli/handler.d.ts +0 -3
- package/lib/cli/handler.js +0 -157
- package/lib/cli/handler.js.map +0 -1
- package/lib/cli/index.d.ts +0 -4
- package/lib/cli/index.js +0 -20
- package/lib/cli/index.js.map +0 -1
- package/lib/cli/instrumentation.d.ts +0 -2
- package/lib/cli/instrumentation.js +0 -47
- package/lib/cli/instrumentation.js.map +0 -1
- package/lib/cli/parseArgs.d.ts +0 -8
- package/lib/cli/parseArgs.js +0 -25
- package/lib/cli/parseArgs.js.map +0 -1
- package/lib/cli/setupServer.d.ts +0 -13
- package/lib/cli/setupServer.js +0 -266
- package/lib/cli/setupServer.js.map +0 -1
- package/lib/cli/util.d.ts +0 -22
- package/lib/cli/util.js +0 -34
- package/lib/cli/util.js.map +0 -1
- package/lib/createConfig.d.ts +0 -16
- package/lib/createConfig.js +0 -13
- package/lib/createConfig.js.map +0 -1
- package/lib/executor/executor.d.ts +0 -65
- package/lib/executor/executor.js +0 -285
- package/lib/executor/executor.js.map +0 -1
- package/lib/executor/executorManager.d.ts +0 -107
- package/lib/executor/executorManager.js +0 -682
- package/lib/executor/executorManager.js.map +0 -1
- package/lib/executor/fastlane.d.ts +0 -9
- package/lib/executor/fastlane.js +0 -41
- package/lib/executor/fastlane.js.map +0 -1
- package/lib/executor/filterOpsAndEStimateGas.d.ts +0 -29
- package/lib/executor/filterOpsAndEStimateGas.js +0 -225
- package/lib/executor/filterOpsAndEStimateGas.js.map +0 -1
- package/lib/executor/index.d.ts +0 -5
- package/lib/executor/index.js +0 -21
- package/lib/executor/index.js.map +0 -1
- package/lib/executor/senderManager/createMemorySenderManager.d.ts +0 -8
- package/lib/executor/senderManager/createMemorySenderManager.js +0 -45
- package/lib/executor/senderManager/createMemorySenderManager.js.map +0 -1
- package/lib/executor/senderManager/createRedisSenderManager.d.ts +0 -8
- package/lib/executor/senderManager/createRedisSenderManager.js +0 -85
- package/lib/executor/senderManager/createRedisSenderManager.js.map +0 -1
- package/lib/executor/senderManager/flushOnStartUp.d.ts +0 -9
- package/lib/executor/senderManager/flushOnStartUp.js +0 -37
- package/lib/executor/senderManager/flushOnStartUp.js.map +0 -1
- package/lib/executor/senderManager/index.d.ts +0 -15
- package/lib/executor/senderManager/index.js +0 -25
- package/lib/executor/senderManager/index.js.map +0 -1
- package/lib/executor/senderManager/validateAndRefill.d.ts +0 -11
- package/lib/executor/senderManager/validateAndRefill.js +0 -115
- package/lib/executor/senderManager/validateAndRefill.js.map +0 -1
- package/lib/executor/utilityWalletMonitor.d.ts +0 -19
- package/lib/executor/utilityWalletMonitor.js +0 -42
- package/lib/executor/utilityWalletMonitor.js.map +0 -1
- package/lib/executor/utils.d.ts +0 -31
- package/lib/executor/utils.js +0 -170
- package/lib/executor/utils.js.map +0 -1
- package/lib/handlers/arbitrumGasPriceManager.d.ts +0 -14
- package/lib/handlers/arbitrumGasPriceManager.js +0 -39
- package/lib/handlers/arbitrumGasPriceManager.js.map +0 -1
- package/lib/handlers/eventManager.d.ts +0 -28
- package/lib/handlers/eventManager.js +0 -207
- package/lib/handlers/eventManager.js.map +0 -1
- package/lib/handlers/gasPriceManager.d.ts +0 -36
- package/lib/handlers/gasPriceManager.js +0 -423
- package/lib/handlers/gasPriceManager.js.map +0 -1
- package/lib/handlers/index.d.ts +0 -3
- package/lib/handlers/index.js +0 -19
- package/lib/handlers/index.js.map +0 -1
- package/lib/handlers/mantleGasPriceManager.d.ts +0 -23
- package/lib/handlers/mantleGasPriceManager.js +0 -44
- package/lib/handlers/mantleGasPriceManager.js.map +0 -1
- package/lib/handlers/optimismManager.d.ts +0 -10
- package/lib/handlers/optimismManager.js +0 -21
- package/lib/handlers/optimismManager.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -4
- package/lib/index.js.map +0 -1
- package/lib/mempool/index.d.ts +0 -4
- package/lib/mempool/index.js +0 -20
- package/lib/mempool/index.js.map +0 -1
- package/lib/mempool/mempool.d.ts +0 -191
- package/lib/mempool/mempool.js +0 -498
- package/lib/mempool/mempool.js.map +0 -1
- package/lib/mempool/monitoring.d.ts +0 -14
- package/lib/mempool/monitoring.js +0 -101
- package/lib/mempool/monitoring.js.map +0 -1
- package/lib/mempool/reputationManager.d.ts +0 -121
- package/lib/mempool/reputationManager.js +0 -472
- package/lib/mempool/reputationManager.js.map +0 -1
- package/lib/rpc/createMethodHandler.d.ts +0 -31
- package/lib/rpc/createMethodHandler.js +0 -34
- package/lib/rpc/createMethodHandler.js.map +0 -1
- package/lib/rpc/estimation/gasEstimationHandler.d.ts +0 -30
- package/lib/rpc/estimation/gasEstimationHandler.js +0 -50
- package/lib/rpc/estimation/gasEstimationHandler.js.map +0 -1
- package/lib/rpc/estimation/gasEstimationsV06.d.ts +0 -19
- package/lib/rpc/estimation/gasEstimationsV06.js +0 -148
- package/lib/rpc/estimation/gasEstimationsV06.js.map +0 -1
- package/lib/rpc/estimation/gasEstimationsV07.d.ts +0 -101
- package/lib/rpc/estimation/gasEstimationsV07.js +0 -727
- package/lib/rpc/estimation/gasEstimationsV07.js.map +0 -1
- package/lib/rpc/estimation/types.d.ts +0 -120
- package/lib/rpc/estimation/types.js +0 -125
- package/lib/rpc/estimation/types.js.map +0 -1
- package/lib/rpc/index.d.ts +0 -4
- package/lib/rpc/index.js +0 -20
- package/lib/rpc/index.js.map +0 -1
- package/lib/rpc/methods/debug_bundler_clearReputation.d.ts +0 -22
- package/lib/rpc/methods/debug_bundler_clearReputation.js +0 -15
- package/lib/rpc/methods/debug_bundler_clearReputation.js.map +0 -1
- package/lib/rpc/methods/debug_bundler_clearState.d.ts +0 -22
- package/lib/rpc/methods/debug_bundler_clearState.js +0 -16
- package/lib/rpc/methods/debug_bundler_clearState.js.map +0 -1
- package/lib/rpc/methods/debug_bundler_dumpMempool.d.ts +0 -973
- package/lib/rpc/methods/debug_bundler_dumpMempool.js +0 -16
- package/lib/rpc/methods/debug_bundler_dumpMempool.js.map +0 -1
- package/lib/rpc/methods/debug_bundler_dumpReputation.d.ts +0 -57
- package/lib/rpc/methods/debug_bundler_dumpReputation.js +0 -16
- package/lib/rpc/methods/debug_bundler_dumpReputation.js.map +0 -1
- package/lib/rpc/methods/debug_bundler_getStakeStatus.d.ts +0 -79
- package/lib/rpc/methods/debug_bundler_getStakeStatus.js +0 -25
- package/lib/rpc/methods/debug_bundler_getStakeStatus.js.map +0 -1
- package/lib/rpc/methods/debug_bundler_sendBundleNow.d.ts +0 -22
- package/lib/rpc/methods/debug_bundler_sendBundleNow.js +0 -15
- package/lib/rpc/methods/debug_bundler_sendBundleNow.js.map +0 -1
- package/lib/rpc/methods/debug_bundler_setBundlingMode.d.ts +0 -22
- package/lib/rpc/methods/debug_bundler_setBundlingMode.js +0 -16
- package/lib/rpc/methods/debug_bundler_setBundlingMode.js.map +0 -1
- package/lib/rpc/methods/debug_bundler_setReputation.d.ts +0 -46
- package/lib/rpc/methods/debug_bundler_setReputation.js +0 -16
- package/lib/rpc/methods/debug_bundler_setReputation.js.map +0 -1
- package/lib/rpc/methods/eth_chainId.d.ts +0 -22
- package/lib/rpc/methods/eth_chainId.js +0 -13
- package/lib/rpc/methods/eth_chainId.js.map +0 -1
- package/lib/rpc/methods/eth_estimateUserOperationGas.js +0 -26
- package/lib/rpc/methods/eth_estimateUserOperationGas.js.map +0 -1
- package/lib/rpc/methods/eth_getUserOperationByHash.d.ts +0 -1775
- package/lib/rpc/methods/eth_getUserOperationByHash.js +0 -101
- package/lib/rpc/methods/eth_getUserOperationByHash.js.map +0 -1
- package/lib/rpc/methods/eth_getUserOperationReceipt.d.ts +0 -412
- package/lib/rpc/methods/eth_getUserOperationReceipt.js +0 -14
- package/lib/rpc/methods/eth_getUserOperationReceipt.js.map +0 -1
- package/lib/rpc/methods/eth_sendUserOperation.d.ts +0 -878
- package/lib/rpc/methods/eth_sendUserOperation.js +0 -44
- package/lib/rpc/methods/eth_sendUserOperation.js.map +0 -1
- package/lib/rpc/methods/eth_supportedEntryPoints.d.ts +0 -22
- package/lib/rpc/methods/eth_supportedEntryPoints.js +0 -13
- package/lib/rpc/methods/eth_supportedEntryPoints.js.map +0 -1
- package/lib/rpc/methods/index.d.ts +0 -3
- package/lib/rpc/methods/index.js +0 -44
- package/lib/rpc/methods/index.js.map +0 -1
- package/lib/rpc/methods/pimlico_getUserOperationGasPrice.d.ts +0 -131
- package/lib/rpc/methods/pimlico_getUserOperationGasPrice.js +0 -33
- package/lib/rpc/methods/pimlico_getUserOperationGasPrice.js.map +0 -1
- package/lib/rpc/methods/pimlico_getUserOperationStatus.d.ts +0 -43
- package/lib/rpc/methods/pimlico_getUserOperationStatus.js +0 -14
- package/lib/rpc/methods/pimlico_getUserOperationStatus.js.map +0 -1
- package/lib/rpc/methods/pimlico_sendUserOperationNow.js +0 -53
- package/lib/rpc/methods/pimlico_sendUserOperationNow.js.map +0 -1
- package/lib/rpc/rpcHandler.d.ts +0 -75
- package/lib/rpc/rpcHandler.js +0 -408
- package/lib/rpc/rpcHandler.js.map +0 -1
- package/lib/rpc/server.d.ts +0 -26
- package/lib/rpc/server.js +0 -283
- package/lib/rpc/server.js.map +0 -1
- package/lib/rpc/validation/BundlerCollectorTracerV06.d.ts +0 -102
- package/lib/rpc/validation/BundlerCollectorTracerV06.js +0 -262
- package/lib/rpc/validation/BundlerCollectorTracerV06.js.map +0 -1
- package/lib/rpc/validation/BundlerCollectorTracerV07.d.ts +0 -102
- package/lib/rpc/validation/BundlerCollectorTracerV07.js +0 -261
- package/lib/rpc/validation/BundlerCollectorTracerV07.js.map +0 -1
- package/lib/rpc/validation/SafeValidator.d.ts +0 -52
- package/lib/rpc/validation/SafeValidator.js +0 -350
- package/lib/rpc/validation/SafeValidator.js.map +0 -1
- package/lib/rpc/validation/TracerResultParserV06.d.ts +0 -13
- package/lib/rpc/validation/TracerResultParserV06.js +0 -582
- package/lib/rpc/validation/TracerResultParserV06.js.map +0 -1
- package/lib/rpc/validation/TracerResultParserV07.d.ts +0 -33
- package/lib/rpc/validation/TracerResultParserV07.js +0 -599
- package/lib/rpc/validation/TracerResultParserV07.js.map +0 -1
- package/lib/rpc/validation/UnsafeValidator.d.ts +0 -98
- package/lib/rpc/validation/UnsafeValidator.js +0 -326
- package/lib/rpc/validation/UnsafeValidator.js.map +0 -1
- package/lib/rpc/validation/index.d.ts +0 -3
- package/lib/rpc/validation/index.js +0 -19
- package/lib/rpc/validation/index.js.map +0 -1
- package/lib/rpc/validation/tracer.d.ts +0 -125
- package/lib/rpc/validation/tracer.js +0 -112
- package/lib/rpc/validation/tracer.js.map +0 -1
- package/lib/store/createMemoryOutstandingStore.d.ts +0 -28
- package/lib/store/createMemoryOutstandingStore.js +0 -236
- package/lib/store/createMemoryOutstandingStore.js.map +0 -1
- package/lib/store/createMempoolStore.d.ts +0 -8
- package/lib/store/createMempoolStore.js +0 -199
- package/lib/store/createMempoolStore.js.map +0 -1
- package/lib/store/createRedisOutstandingStore.d.ts +0 -27
- package/lib/store/createRedisOutstandingStore.js +0 -349
- package/lib/store/createRedisOutstandingStore.js.map +0 -1
- package/lib/store/createRedisStore.d.ts +0 -9
- package/lib/store/createRedisStore.js +0 -138
- package/lib/store/createRedisStore.js.map +0 -1
- package/lib/store/createStore.d.ts +0 -6
- package/lib/store/createStore.js +0 -70
- package/lib/store/createStore.js.map +0 -1
- package/lib/store/index.d.ts +0 -81
- package/lib/store/index.js +0 -6
- package/lib/store/index.js.map +0 -1
- package/lib/types/contracts/ArbitrumL1FeeAbi.d.ts +0 -32
- package/lib/types/contracts/ArbitrumL1FeeAbi.js +0 -45
- package/lib/types/contracts/ArbitrumL1FeeAbi.js.map +0 -1
- package/lib/types/contracts/CallEngine.d.ts +0 -28
- package/lib/types/contracts/CallEngine.js +0 -40
- package/lib/types/contracts/CallEngine.js.map +0 -1
- package/lib/types/contracts/CodeHashGetter.d.ts +0 -37
- package/lib/types/contracts/CodeHashGetter.js +0 -48
- package/lib/types/contracts/CodeHashGetter.js.map +0 -1
- package/lib/types/contracts/EntryPoint.d.ts +0 -1789
- package/lib/types/contracts/EntryPoint.js +0 -2307
- package/lib/types/contracts/EntryPoint.js.map +0 -1
- package/lib/types/contracts/EntryPointSimulationsV6.d.ts +0 -34
- package/lib/types/contracts/EntryPointSimulationsV6.js +0 -51
- package/lib/types/contracts/EntryPointSimulationsV6.js.map +0 -1
- package/lib/types/contracts/EntryPointSimulationsV7.d.ts +0 -2193
- package/lib/types/contracts/EntryPointSimulationsV7.js +0 -2828
- package/lib/types/contracts/EntryPointSimulationsV7.js.map +0 -1
- package/lib/types/contracts/IAccountExecute.d.ts +0 -53
- package/lib/types/contracts/IAccountExecute.js +0 -71
- package/lib/types/contracts/IAccountExecute.js.map +0 -1
- package/lib/types/contracts/IPaymaster.d.ts +0 -3
- package/lib/types/contracts/IPaymaster.js +0 -120
- package/lib/types/contracts/IPaymaster.js.map +0 -1
- package/lib/types/contracts/MantleBvmGasPriceOracle.d.ts +0 -219
- package/lib/types/contracts/MantleBvmGasPriceOracle.js +0 -180
- package/lib/types/contracts/MantleBvmGasPriceOracle.js.map +0 -1
- package/lib/types/contracts/OpL1FeeAbi.d.ts +0 -114
- package/lib/types/contracts/OpL1FeeAbi.js +0 -77
- package/lib/types/contracts/OpL1FeeAbi.js.map +0 -1
- package/lib/types/contracts/PimlicoEntryPointSimulations.d.ts +0 -26
- package/lib/types/contracts/PimlicoEntryPointSimulations.js +0 -41
- package/lib/types/contracts/PimlicoEntryPointSimulations.js.map +0 -1
- package/lib/types/contracts/SenderCreator.d.ts +0 -4
- package/lib/types/contracts/SenderCreator.js +0 -26
- package/lib/types/contracts/SenderCreator.js.map +0 -1
- package/lib/types/contracts/SimpleAccountFactory.d.ts +0 -57
- package/lib/types/contracts/SimpleAccountFactory.js +0 -79
- package/lib/types/contracts/SimpleAccountFactory.js.map +0 -1
- package/lib/types/contracts/TestOpcodesAccount.d.ts +0 -4
- package/lib/types/contracts/TestOpcodesAccount.js +0 -284
- package/lib/types/contracts/TestOpcodesAccount.js.map +0 -1
- package/lib/types/contracts/TestOpcodesAccountFactory.d.ts +0 -4
- package/lib/types/contracts/TestOpcodesAccountFactory.js +0 -26
- package/lib/types/contracts/TestOpcodesAccountFactory.js.map +0 -1
- package/lib/types/contracts/TestStorageAccount.d.ts +0 -4
- package/lib/types/contracts/TestStorageAccount.js +0 -316
- package/lib/types/contracts/TestStorageAccount.js.map +0 -1
- package/lib/types/contracts/index.d.ts +0 -17
- package/lib/types/contracts/index.js +0 -33
- package/lib/types/contracts/index.js.map +0 -1
- package/lib/types/gasPrice.d.ts +0 -110
- package/lib/types/gasPrice.js +0 -55
- package/lib/types/gasPrice.js.map +0 -1
- package/lib/types/index.d.ts +0 -11
- package/lib/types/index.js +0 -27
- package/lib/types/index.js.map +0 -1
- package/lib/types/interfaces.d.ts +0 -59
- package/lib/types/interfaces.js +0 -3
- package/lib/types/interfaces.js.map +0 -1
- package/lib/types/mempool.d.ts +0 -60
- package/lib/types/mempool.js +0 -11
- package/lib/types/mempool.js.map +0 -1
- package/lib/types/schemas.d.ts +0 -20779
- package/lib/types/schemas.js +0 -638
- package/lib/types/schemas.js.map +0 -1
- package/lib/types/utils.d.ts +0 -25
- package/lib/types/utils.js +0 -35
- package/lib/types/utils.js.map +0 -1
- package/lib/types/validation.d.ts +0 -14327
- package/lib/types/validation.js +0 -312
- package/lib/types/validation.js.map +0 -1
- package/lib/utils/bigInt.d.ts +0 -4
- package/lib/utils/bigInt.js +0 -19
- package/lib/utils/bigInt.js.map +0 -1
- package/lib/utils/eip7702.d.ts +0 -4
- package/lib/utils/eip7702.js +0 -21
- package/lib/utils/eip7702.js.map +0 -1
- package/lib/utils/fastify-rpc-decorators.d.ts +0 -19
- package/lib/utils/fastify-rpc-decorators.js +0 -23
- package/lib/utils/fastify-rpc-decorators.js.map +0 -1
- package/lib/utils/helpers.d.ts +0 -15
- package/lib/utils/helpers.js +0 -59
- package/lib/utils/helpers.js.map +0 -1
- package/lib/utils/index.d.ts +0 -8
- package/lib/utils/index.js +0 -23
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/logger.d.ts +0 -6
- package/lib/utils/logger.js +0 -85
- package/lib/utils/logger.js.map +0 -1
- package/lib/utils/metrics.d.ts +0 -28
- package/lib/utils/metrics.js +0 -192
- package/lib/utils/metrics.js.map +0 -1
- package/lib/utils/minMaxQueue/createMemoryMinMaxQueue.d.ts +0 -6
- package/lib/utils/minMaxQueue/createMemoryMinMaxQueue.js +0 -57
- package/lib/utils/minMaxQueue/createMemoryMinMaxQueue.js.map +0 -1
- package/lib/utils/minMaxQueue/createRedisMinMaxQueue.d.ts +0 -7
- package/lib/utils/minMaxQueue/createRedisMinMaxQueue.js +0 -105
- package/lib/utils/minMaxQueue/createRedisMinMaxQueue.js.map +0 -1
- package/lib/utils/minMaxQueue/index.d.ts +0 -12
- package/lib/utils/minMaxQueue/index.js +0 -16
- package/lib/utils/minMaxQueue/index.js.map +0 -1
- package/lib/utils/rpc-reply.d.ts +0 -16
- package/lib/utils/rpc-reply.js +0 -41
- package/lib/utils/rpc-reply.js.map +0 -1
- package/lib/utils/userop.d.ts +0 -138
- package/lib/utils/userop.js +0 -620
- package/lib/utils/userop.js.map +0 -1
- package/lib/utils/validation.d.ts +0 -76
- package/lib/utils/validation.js +0 -500
- package/lib/utils/validation.js.map +0 -1
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { getNonceKeyAndSequence, isDeployment, isVersion07 } from "../../utils/userop.js";
|
|
2
|
+
const senderNonceSlot = (userOp) => {
|
|
3
|
+
const sender = userOp.sender;
|
|
4
|
+
const [nonceKey] = getNonceKeyAndSequence(userOp.nonce);
|
|
5
|
+
return `${sender}-${nonceKey}`;
|
|
6
|
+
};
|
|
7
|
+
export class MemoryOutstanding {
|
|
8
|
+
pendingOps = new Map();
|
|
9
|
+
hashLookup = new Map();
|
|
10
|
+
logger;
|
|
11
|
+
config;
|
|
12
|
+
priorityQueue = [];
|
|
13
|
+
constructor(config) {
|
|
14
|
+
// Setup args for getting userOpHash
|
|
15
|
+
this.config = config;
|
|
16
|
+
this.logger = config.getLogger({ module: "memory-outstanding-queue" }, {
|
|
17
|
+
level: config.logLevel
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
dump() {
|
|
21
|
+
return [...Array.from(this.pendingOps.values()).flat()];
|
|
22
|
+
}
|
|
23
|
+
// Adds userOp to queue and maintains sorting by gas price.
|
|
24
|
+
addToPriorityQueue(userOpInfo) {
|
|
25
|
+
this.priorityQueue.push(userOpInfo);
|
|
26
|
+
this.priorityQueue.sort((a, b) => {
|
|
27
|
+
const userOpA = a.userOp;
|
|
28
|
+
const userOpB = b.userOp;
|
|
29
|
+
return Number(userOpA.maxFeePerGas - userOpB.maxFeePerGas);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
validateQueuedLimit(userOp) {
|
|
33
|
+
const outstandingOps = this.dump();
|
|
34
|
+
const parallelUserOpsCount = outstandingOps.filter((userOpInfo) => {
|
|
35
|
+
const { userOp: mempoolUserOp } = userOpInfo;
|
|
36
|
+
return mempoolUserOp.sender === userOp.sender;
|
|
37
|
+
}).length;
|
|
38
|
+
if (parallelUserOpsCount > this.config.mempoolMaxQueuedOps) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
validateParallelLimit(userOp) {
|
|
44
|
+
const outstandingOps = this.dump();
|
|
45
|
+
const [nonceKey] = getNonceKeyAndSequence(userOp.nonce);
|
|
46
|
+
const queuedUserOpsCount = outstandingOps.filter((userOpInfo) => {
|
|
47
|
+
const { userOp: mempoolUserOp } = userOpInfo;
|
|
48
|
+
const [opNonceKey] = getNonceKeyAndSequence(mempoolUserOp.nonce);
|
|
49
|
+
return (mempoolUserOp.sender === userOp.sender &&
|
|
50
|
+
opNonceKey === nonceKey);
|
|
51
|
+
}).length;
|
|
52
|
+
if (queuedUserOpsCount > this.config.mempoolMaxParallelOps) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
async popConflicting(userOp) {
|
|
58
|
+
const outstandingOps = this.dump();
|
|
59
|
+
for (const existingUserOpInfo of outstandingOps) {
|
|
60
|
+
const { userOp: existingUserOp, userOpHash: existingUserOpHash } = existingUserOpInfo;
|
|
61
|
+
const isSameSender = existingUserOp.sender === userOp.sender;
|
|
62
|
+
// Check each conflict type.
|
|
63
|
+
const isConflictingNonce = isSameSender && existingUserOp.nonce === userOp.nonce;
|
|
64
|
+
const isConflictingEip7702Auth = isSameSender && userOp.eip7702Auth && existingUserOp.eip7702Auth;
|
|
65
|
+
const isConflictingDeployment = isSameSender &&
|
|
66
|
+
isDeployment(userOp) &&
|
|
67
|
+
isDeployment(existingUserOp);
|
|
68
|
+
if (isConflictingNonce) {
|
|
69
|
+
const removed = await this.remove([existingUserOpHash]);
|
|
70
|
+
if (removed.length > 0) {
|
|
71
|
+
return {
|
|
72
|
+
conflictReason: "conflicting_nonce",
|
|
73
|
+
userOpInfo: removed[0]
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (isConflictingEip7702Auth) {
|
|
78
|
+
const removed = await this.remove([existingUserOpHash]);
|
|
79
|
+
if (removed.length > 0) {
|
|
80
|
+
return {
|
|
81
|
+
conflictReason: "conflicting_7702_auth",
|
|
82
|
+
userOpInfo: removed[0]
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (isConflictingDeployment) {
|
|
87
|
+
const removed = await this.remove([existingUserOpHash]);
|
|
88
|
+
if (removed.length > 0) {
|
|
89
|
+
return {
|
|
90
|
+
conflictReason: "conflicting_deployment",
|
|
91
|
+
userOpInfo: removed[0]
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
async contains(userOpHash) {
|
|
99
|
+
return this.hashLookup.has(userOpHash);
|
|
100
|
+
}
|
|
101
|
+
pop(count) {
|
|
102
|
+
const results = [];
|
|
103
|
+
for (let i = 0; i < count; i++) {
|
|
104
|
+
const userOpInfo = this.priorityQueue.shift();
|
|
105
|
+
if (!userOpInfo) {
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
const pendingOpsSlot = senderNonceSlot(userOpInfo.userOp);
|
|
109
|
+
const backlogOps = this.pendingOps.get(pendingOpsSlot);
|
|
110
|
+
// This should never throw.
|
|
111
|
+
if (!backlogOps?.shift()) {
|
|
112
|
+
throw new Error("FATAL: No pending userOps for sender");
|
|
113
|
+
}
|
|
114
|
+
// Move next pending userOp into priorityQueue if exist.
|
|
115
|
+
if (backlogOps.length > 0) {
|
|
116
|
+
this.addToPriorityQueue(backlogOps[0]);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
// Cleanup if no more ops for this slot
|
|
120
|
+
this.pendingOps.delete(pendingOpsSlot);
|
|
121
|
+
}
|
|
122
|
+
// Remove from hash lookup
|
|
123
|
+
this.hashLookup.delete(userOpInfo.userOpHash);
|
|
124
|
+
results.push(userOpInfo);
|
|
125
|
+
}
|
|
126
|
+
return Promise.resolve(results);
|
|
127
|
+
}
|
|
128
|
+
async add(userOpInfos) {
|
|
129
|
+
if (userOpInfos.length === 0)
|
|
130
|
+
return;
|
|
131
|
+
for (const userOpInfo of userOpInfos) {
|
|
132
|
+
const { userOp, userOpHash } = userOpInfo;
|
|
133
|
+
const [nonceKey] = getNonceKeyAndSequence(userOp.nonce);
|
|
134
|
+
const pendingOpsSlot = senderNonceSlot(userOp);
|
|
135
|
+
const backlogOps = (() => {
|
|
136
|
+
if (this.pendingOps.has(pendingOpsSlot)) {
|
|
137
|
+
return this.pendingOps.get(pendingOpsSlot);
|
|
138
|
+
}
|
|
139
|
+
this.pendingOps.set(pendingOpsSlot, []);
|
|
140
|
+
return this.pendingOps.get(pendingOpsSlot);
|
|
141
|
+
})();
|
|
142
|
+
if (!backlogOps) {
|
|
143
|
+
throw new Error("FATAL: No pending operations found for userOpHash");
|
|
144
|
+
}
|
|
145
|
+
// Note: the userOpInfo is always added to backlogOps, because we are pushing to a reference
|
|
146
|
+
backlogOps.push(userOpInfo);
|
|
147
|
+
// Add to hash lookup for O(1) contains checks
|
|
148
|
+
this.hashLookup.set(userOpHash, userOpInfo);
|
|
149
|
+
// Sort backlogOps by nonce sequence
|
|
150
|
+
backlogOps.sort((a, b) => {
|
|
151
|
+
const [, aNonceSeq] = getNonceKeyAndSequence(a.userOp.nonce);
|
|
152
|
+
const [, bNonceSeq] = getNonceKeyAndSequence(b.userOp.nonce);
|
|
153
|
+
return Number(aNonceSeq - bNonceSeq);
|
|
154
|
+
});
|
|
155
|
+
const lowestUserOpHash = backlogOps[0].userOpHash;
|
|
156
|
+
// If lowest, remove any existing userOp with same sender and nonceKey and add current userOp to priorityQueue.
|
|
157
|
+
if (lowestUserOpHash === userOpHash) {
|
|
158
|
+
this.priorityQueue = this.priorityQueue.filter((userOpInfo) => {
|
|
159
|
+
const pendingUserOp = userOpInfo.userOp;
|
|
160
|
+
const isSameSender = pendingUserOp.sender === userOp.sender;
|
|
161
|
+
const isSameNonceKey = getNonceKeyAndSequence(pendingUserOp.nonce)[0] ===
|
|
162
|
+
nonceKey;
|
|
163
|
+
return !(isSameSender && isSameNonceKey);
|
|
164
|
+
});
|
|
165
|
+
this.addToPriorityQueue(userOpInfo);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
async getQueuedUserOps(userOp) {
|
|
170
|
+
const [nonceKey, nonceSequence] = getNonceKeyAndSequence(userOp.nonce);
|
|
171
|
+
const outstandingOps = this.dump();
|
|
172
|
+
const outstanding = outstandingOps.filter((userOpInfo) => {
|
|
173
|
+
const { userOp: mempoolUserOp } = userOpInfo;
|
|
174
|
+
const [mempoolNonceKey, mempoolNonceSequence] = getNonceKeyAndSequence(mempoolUserOp.nonce);
|
|
175
|
+
const isSameSender = mempoolUserOp.sender === userOp.sender;
|
|
176
|
+
const isSameNonceKey = mempoolNonceKey === nonceKey;
|
|
177
|
+
const isSameNonce = mempoolNonceSequence === nonceSequence;
|
|
178
|
+
// Skip the same userOp.
|
|
179
|
+
if (isSameSender && isSameNonceKey && isSameNonce) {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
// Include userOps from same sender with lower nonce.
|
|
183
|
+
if (isSameSender && isSameNonceKey) {
|
|
184
|
+
return mempoolNonceSequence < nonceSequence;
|
|
185
|
+
}
|
|
186
|
+
// For v0.7+, include ops with same paymaster (unless ignored).
|
|
187
|
+
if (isVersion07(userOp) && isVersion07(mempoolUserOp)) {
|
|
188
|
+
const hasSamePaymaster = userOp.paymaster !== null &&
|
|
189
|
+
mempoolUserOp.paymaster !== null &&
|
|
190
|
+
mempoolUserOp.paymaster === userOp.paymaster;
|
|
191
|
+
const isPaymasterIgnored = userOp.paymaster !== null &&
|
|
192
|
+
this.config.ignoredPaymasters.includes(userOp.paymaster);
|
|
193
|
+
return hasSamePaymaster && !isPaymasterIgnored;
|
|
194
|
+
}
|
|
195
|
+
return false;
|
|
196
|
+
});
|
|
197
|
+
return outstanding
|
|
198
|
+
.sort((a, b) => {
|
|
199
|
+
const aUserOp = a.userOp;
|
|
200
|
+
const bUserOp = b.userOp;
|
|
201
|
+
const [, aNonceValue] = getNonceKeyAndSequence(aUserOp.nonce);
|
|
202
|
+
const [, bNonceValue] = getNonceKeyAndSequence(bUserOp.nonce);
|
|
203
|
+
return Number(aNonceValue - bNonceValue);
|
|
204
|
+
})
|
|
205
|
+
.map((userOpInfo) => userOpInfo.userOp);
|
|
206
|
+
}
|
|
207
|
+
async remove(userOpHashes) {
|
|
208
|
+
if (userOpHashes.length === 0) {
|
|
209
|
+
return [];
|
|
210
|
+
}
|
|
211
|
+
const removedOps = [];
|
|
212
|
+
for (const userOpHash of userOpHashes) {
|
|
213
|
+
// Look up userOp in hash lookup first
|
|
214
|
+
const userOpInfo = this.hashLookup.get(userOpHash);
|
|
215
|
+
if (!userOpInfo) {
|
|
216
|
+
this.logger.info(`tried to remove non-existent user op from mempool: ${userOpHash}`);
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
const pendingOpsSlot = senderNonceSlot(userOpInfo.userOp);
|
|
220
|
+
// Find and remove from pending ops
|
|
221
|
+
const backlogOps = this.pendingOps.get(pendingOpsSlot);
|
|
222
|
+
if (!backlogOps) {
|
|
223
|
+
throw new Error(`FATAL: No pending operations found for userOpHash ${userOpHash}`);
|
|
224
|
+
}
|
|
225
|
+
const backlogIndex = backlogOps.findIndex((info) => info.userOpHash === userOpHash);
|
|
226
|
+
if (backlogIndex === -1) {
|
|
227
|
+
throw new Error(`FATAL: UserOp with hash ${userOpHash} not found in backlog`);
|
|
228
|
+
}
|
|
229
|
+
backlogOps.splice(backlogIndex, 1);
|
|
230
|
+
// Remove from priority queue if present
|
|
231
|
+
const priorityQueueIndex = this.priorityQueue.findIndex((info) => info.userOpHash === userOpHash);
|
|
232
|
+
if (priorityQueueIndex !== -1) {
|
|
233
|
+
this.priorityQueue.splice(priorityQueueIndex, 1);
|
|
234
|
+
}
|
|
235
|
+
// Remove from hash lookup
|
|
236
|
+
this.hashLookup.delete(userOpHash);
|
|
237
|
+
// If this was the first operation and there are more in the backlog,
|
|
238
|
+
// add the new first operation to the priority queue
|
|
239
|
+
if (backlogIndex === 0 && backlogOps.length > 0) {
|
|
240
|
+
this.addToPriorityQueue(backlogOps[0]);
|
|
241
|
+
}
|
|
242
|
+
// Clean up empty slot
|
|
243
|
+
if (backlogOps.length === 0) {
|
|
244
|
+
this.pendingOps.delete(pendingOpsSlot);
|
|
245
|
+
}
|
|
246
|
+
removedOps.push(userOpInfo);
|
|
247
|
+
}
|
|
248
|
+
return removedOps;
|
|
249
|
+
}
|
|
250
|
+
async dumpLocal() {
|
|
251
|
+
return this.dump();
|
|
252
|
+
}
|
|
253
|
+
async clear() {
|
|
254
|
+
this.priorityQueue = [];
|
|
255
|
+
this.pendingOps.clear();
|
|
256
|
+
this.hashLookup.clear();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
export const createMemoryOutstandingQueue = ({ config, logger }) => {
|
|
260
|
+
logger.info("Using memory for outstanding mempool");
|
|
261
|
+
return new MemoryOutstanding(config);
|
|
262
|
+
};
|
|
263
|
+
//# sourceMappingURL=memory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../store/outstanding/memory.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACd,MAAM,oBAAoB,CAAA;AAG3B,MAAM,eAAe,GAAG,CAAC,MAAqB,EAAE,EAAE;IAC9C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;IAC5B,MAAM,CAAC,QAAQ,CAAC,GAAG,sBAAsB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACvD,OAAO,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAA;AAClC,CAAC,CAAA;AAED,MAAM,OAAO,iBAAiB;IACT,UAAU,GAA8B,IAAI,GAAG,EAAE,CAAA;IACjD,UAAU,GAA+B,IAAI,GAAG,EAAE,CAAA;IAClD,MAAM,CAAQ;IACd,MAAM,CAAY;IAC3B,aAAa,GAAiB,EAAE,CAAA;IAExC,YAAY,MAAkB;QAC1B,oCAAoC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAC1B,EAAE,MAAM,EAAE,0BA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YAED,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAC/B,CAAC;QAED,OAAO,UAAU,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,SAAS;QACX,OAAO,IAAI,CAAC,IAAI,EAAE,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;QACvB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;QACvB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;IAC3B,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,EACzC,MAAM,EACN,MAAM,EAIT,EAAoB,EAAE;IACnB,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAA;IACnD,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAA;AACxC,CAAC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Address } from "../../types/index.js";
|
|
2
|
+
import type { Logger } from "pino";
|
|
3
|
+
import type { AltoConfig } from "../../createConfig.js";
|
|
4
|
+
import type { OutstandingStore } from "./types.js";
|
|
5
|
+
export declare const createRedisOutstandingQueue: ({ config, entryPoint, redisEndpoint, logger }: {
|
|
6
|
+
config: AltoConfig;
|
|
7
|
+
entryPoint: Address;
|
|
8
|
+
redisEndpoint: string;
|
|
9
|
+
logger: Logger;
|
|
10
|
+
}) => OutstandingStore;
|
|
11
|
+
//# sourceMappingURL=redis.d.ts.map
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { userOpInfoSchema } from "../../types/index.js";
|
|
2
|
+
import { getNonceKeyAndSequence, isDeployment } from "../../utils/index.js";
|
|
3
|
+
import { Redis } from "ioredis";
|
|
4
|
+
import { toHex } from "viem/utils";
|
|
5
|
+
const serialize = (userOpInfo) => {
|
|
6
|
+
return JSON.stringify(userOpInfo, (_, value) => typeof value === "bigint" ? toHex(value) : value);
|
|
7
|
+
};
|
|
8
|
+
const deserialize = (data) => {
|
|
9
|
+
const parsed = JSON.parse(data);
|
|
10
|
+
return userOpInfoSchema.parse(parsed);
|
|
11
|
+
};
|
|
12
|
+
class RedisOutstandingQueue {
|
|
13
|
+
redis;
|
|
14
|
+
senderNonceKeyPrefix; // sender + nonceKey -> userOpHash
|
|
15
|
+
readyQueue; // Queue of userOpHashes (sorted by composite of userOp.nonceSeq + userOp.maxFeePerGas)
|
|
16
|
+
userOpHashMap; // userOpHash -> boolean
|
|
17
|
+
deploymentHashMap; // sender -> deployment userOpHash
|
|
18
|
+
eip7702AuthHashMap; // sender -> eip7702Auth userOpHash
|
|
19
|
+
senderNonceQueueTtl; // TTL for sender nonce queues in seconds
|
|
20
|
+
constructor({ config, entryPoint, redisEndpoint, logger }) {
|
|
21
|
+
this.redis = new Redis(redisEndpoint, {});
|
|
22
|
+
// Initialize Redis key names
|
|
23
|
+
const redisPrefix = `${config.redisKeyPrefix}:${config.chainId}:${entryPoint}:outstanding`;
|
|
24
|
+
this.readyQueue = `${redisPrefix}:ready-queue`;
|
|
25
|
+
this.senderNonceKeyPrefix = `${redisPrefix}:sender`;
|
|
26
|
+
this.userOpHashMap = `${redisPrefix}:userop-hash`;
|
|
27
|
+
this.deploymentHashMap = `${redisPrefix}:deployment-senders`;
|
|
28
|
+
this.eip7702AuthHashMap = `${redisPrefix}:eip7702-auth-senders`;
|
|
29
|
+
// Calculate TTL for sender nonce queues (10 blocks worth of time)
|
|
30
|
+
this.senderNonceQueueTtl = config.blockTime * 10;
|
|
31
|
+
logger.info({
|
|
32
|
+
readyQueueKey: this.readyQueue
|
|
33
|
+
}, "Using redis for outstanding mempool.");
|
|
34
|
+
}
|
|
35
|
+
// Returns queue index for this sender + nonceKey.
|
|
36
|
+
getSenderNonceQueue(userOp) {
|
|
37
|
+
const [nonceKey] = getNonceKeyAndSequence(userOp.nonce);
|
|
38
|
+
return `${this.senderNonceKeyPrefix}:${userOp.sender}:${nonceKey}`;
|
|
39
|
+
}
|
|
40
|
+
// OutstandingStore methods
|
|
41
|
+
async contains(userOpHash) {
|
|
42
|
+
const exists = await this.redis.hexists(this.userOpHashMap, userOpHash);
|
|
43
|
+
return exists === 1;
|
|
44
|
+
}
|
|
45
|
+
async popConflicting(userOp) {
|
|
46
|
+
const { sender, nonce } = userOp;
|
|
47
|
+
const [nonceSeq] = getNonceKeyAndSequence(nonce);
|
|
48
|
+
const senderNonceQueue = this.getSenderNonceQueue(userOp);
|
|
49
|
+
const isDeploymentOp = isDeployment(userOp);
|
|
50
|
+
const hasEip7702Auth = !!userOp.eip7702Auth;
|
|
51
|
+
// Check all conflicts in a single round trip
|
|
52
|
+
const pipeline = this.redis.pipeline();
|
|
53
|
+
pipeline.zrangebyscore(senderNonceQueue, Number(nonceSeq), Number(nonceSeq));
|
|
54
|
+
pipeline.hget(this.deploymentHashMap, sender);
|
|
55
|
+
pipeline.hget(this.eip7702AuthHashMap, sender);
|
|
56
|
+
const results = await pipeline.exec();
|
|
57
|
+
if (!results)
|
|
58
|
+
return undefined;
|
|
59
|
+
const [nonceResult, deploymentResult, eip7702AuthResult] = results;
|
|
60
|
+
const conflictingNonceHashes = nonceResult?.[1] || [];
|
|
61
|
+
const existingDeploymentHash = deploymentResult?.[1];
|
|
62
|
+
const existingEip7702AuthHash = eip7702AuthResult?.[1];
|
|
63
|
+
// Check for conflicting nonce
|
|
64
|
+
if (conflictingNonceHashes.length > 0) {
|
|
65
|
+
const conflictingHash = conflictingNonceHashes[0];
|
|
66
|
+
const removedUserOps = await this.remove([conflictingHash]);
|
|
67
|
+
if (removedUserOps.length > 0) {
|
|
68
|
+
return {
|
|
69
|
+
conflictReason: "conflicting_nonce",
|
|
70
|
+
userOpInfo: removedUserOps[0]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Check for conflicting deployment
|
|
75
|
+
if (isDeploymentOp && existingDeploymentHash) {
|
|
76
|
+
const removedUserOps = await this.remove([existingDeploymentHash]);
|
|
77
|
+
if (removedUserOps.length > 0) {
|
|
78
|
+
return {
|
|
79
|
+
conflictReason: "conflicting_deployment",
|
|
80
|
+
userOpInfo: removedUserOps[0]
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Check for conflicting EIP-7702 auth
|
|
85
|
+
if (hasEip7702Auth && existingEip7702AuthHash) {
|
|
86
|
+
const removedUserOps = await this.remove([existingEip7702AuthHash]);
|
|
87
|
+
if (removedUserOps.length > 0) {
|
|
88
|
+
return {
|
|
89
|
+
conflictReason: "conflicting_7702_auth",
|
|
90
|
+
userOpInfo: removedUserOps[0]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
async add(userOpInfos) {
|
|
97
|
+
if (userOpInfos.length === 0)
|
|
98
|
+
return;
|
|
99
|
+
// Use pipeline for atomic operations
|
|
100
|
+
const pipeline = this.redis.pipeline();
|
|
101
|
+
for (const userOpInfo of userOpInfos) {
|
|
102
|
+
const { userOp } = userOpInfo;
|
|
103
|
+
const [, nonceSequence] = getNonceKeyAndSequence(userOp.nonce);
|
|
104
|
+
const userOpHash = userOpInfo.userOpHash;
|
|
105
|
+
// Create composite score: nonceSequence in upper 32 bits, maxFeePerGas in lower 32 bits.
|
|
106
|
+
const score = (nonceSequence << 32n) | (userOp.maxFeePerGas & 0xffffffffn);
|
|
107
|
+
// Serialize userOpInfo for storage.
|
|
108
|
+
const serializedUserOp = serialize(userOpInfo);
|
|
109
|
+
// Add to main ready queue.
|
|
110
|
+
pipeline.zadd(this.readyQueue, Number(score), userOpHash);
|
|
111
|
+
// Add to sender+nonceKey index for fast lookup.
|
|
112
|
+
const senderNonceQueue = this.getSenderNonceQueue(userOp);
|
|
113
|
+
pipeline.zadd(senderNonceQueue, Number(nonceSequence), userOpHash);
|
|
114
|
+
pipeline.expire(senderNonceQueue, this.senderNonceQueueTtl);
|
|
115
|
+
// Add to userOpHash map.
|
|
116
|
+
pipeline.hset(this.userOpHashMap, userOpHash, serializedUserOp);
|
|
117
|
+
// Add sender to deployment hash if this is a deployment.
|
|
118
|
+
if (isDeployment(userOp)) {
|
|
119
|
+
pipeline.hset(this.deploymentHashMap, userOp.sender, userOpHash);
|
|
120
|
+
}
|
|
121
|
+
// Add sender to eip7702Auth hash if this has eip7702Auth.
|
|
122
|
+
if (userOp.eip7702Auth) {
|
|
123
|
+
pipeline.hset(this.eip7702AuthHashMap, userOp.sender, userOpHash);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
await pipeline.exec();
|
|
127
|
+
}
|
|
128
|
+
// Removes userOps given their hashes and returns the userOpInfo objects.
|
|
129
|
+
async remove(userOpHashes) {
|
|
130
|
+
if (userOpHashes.length === 0)
|
|
131
|
+
return [];
|
|
132
|
+
// Get all serialized data in parallel.
|
|
133
|
+
const pipeline = this.redis.pipeline();
|
|
134
|
+
for (const hash of userOpHashes) {
|
|
135
|
+
pipeline.hget(this.userOpHashMap, hash);
|
|
136
|
+
}
|
|
137
|
+
const serializedResults = await pipeline.exec();
|
|
138
|
+
const removedUserOps = [];
|
|
139
|
+
const removalPipeline = this.redis.pipeline();
|
|
140
|
+
// Process each userOp that exists.
|
|
141
|
+
for (let i = 0; i < userOpHashes.length; i++) {
|
|
142
|
+
const serialized = serializedResults?.[i]?.[1];
|
|
143
|
+
if (!serialized)
|
|
144
|
+
continue;
|
|
145
|
+
const userOpHash = userOpHashes[i];
|
|
146
|
+
const userOpInfo = deserialize(serialized);
|
|
147
|
+
const { userOp } = userOpInfo;
|
|
148
|
+
const [, nonceSequence] = getNonceKeyAndSequence(userOp.nonce);
|
|
149
|
+
const senderNonceQueue = this.getSenderNonceQueue(userOp);
|
|
150
|
+
const isDeploymentOp = isDeployment(userOp);
|
|
151
|
+
// Remove from ready queue.
|
|
152
|
+
removalPipeline.zrem(this.readyQueue, userOpHash);
|
|
153
|
+
// Remove from sender nonceKey queue.
|
|
154
|
+
removalPipeline.zremrangebyscore(senderNonceQueue, Number(nonceSequence), Number(nonceSequence));
|
|
155
|
+
// Remove from hash lookup.
|
|
156
|
+
removalPipeline.hdel(this.userOpHashMap, userOpHash);
|
|
157
|
+
// Remove sender from deployment hash if this was a deployment.
|
|
158
|
+
if (isDeploymentOp) {
|
|
159
|
+
removalPipeline.hdel(this.deploymentHashMap, userOp.sender);
|
|
160
|
+
}
|
|
161
|
+
// Remove sender from eip7702Auth hash if this had eip7702Auth.
|
|
162
|
+
if (userOp.eip7702Auth) {
|
|
163
|
+
removalPipeline.hdel(this.eip7702AuthHashMap, userOp.sender);
|
|
164
|
+
}
|
|
165
|
+
removedUserOps.push(userOpInfo);
|
|
166
|
+
}
|
|
167
|
+
// Execute all removals.
|
|
168
|
+
await removalPipeline.exec();
|
|
169
|
+
return removedUserOps;
|
|
170
|
+
}
|
|
171
|
+
async pop(count) {
|
|
172
|
+
// Pop from ready queue
|
|
173
|
+
const results = await this.redis.zpopmax(this.readyQueue, count);
|
|
174
|
+
if (!results || results.length === 0) {
|
|
175
|
+
return [];
|
|
176
|
+
}
|
|
177
|
+
// Extract hashes from results (zpopmax returns [member, score, member, score, ...])
|
|
178
|
+
const userOpHashes = [];
|
|
179
|
+
for (let i = 0; i < results.length; i += 2) {
|
|
180
|
+
userOpHashes.push(results[i]);
|
|
181
|
+
}
|
|
182
|
+
// Remove all userOps in batch
|
|
183
|
+
return await this.remove(userOpHashes);
|
|
184
|
+
}
|
|
185
|
+
async getQueuedUserOps(userOp) {
|
|
186
|
+
const [, nonceSequence] = getNonceKeyAndSequence(userOp.nonce);
|
|
187
|
+
const senderNonceQueue = this.getSenderNonceQueue(userOp);
|
|
188
|
+
// Get all userOpHashes with nonce sequence lower than the input
|
|
189
|
+
// ZRANGEBYSCORE returns elements with scores between min and max
|
|
190
|
+
// We want scores from 0 to (nonceSequence - 1)
|
|
191
|
+
const userOpHashes = await this.redis.zrangebyscore(senderNonceQueue, 0, Number(nonceSequence) - 1);
|
|
192
|
+
if (userOpHashes.length === 0)
|
|
193
|
+
return [];
|
|
194
|
+
// Fetch serialized data for each hash
|
|
195
|
+
const pipeline = this.redis.pipeline();
|
|
196
|
+
for (const hash of userOpHashes) {
|
|
197
|
+
pipeline.hget(this.userOpHashMap, hash);
|
|
198
|
+
}
|
|
199
|
+
const results = await pipeline.exec();
|
|
200
|
+
// Deserialize and extract userOps
|
|
201
|
+
return (results || [])
|
|
202
|
+
.map((result) => result?.[1])
|
|
203
|
+
.filter((serialized) => serialized !== null)
|
|
204
|
+
.map((serialized) => deserialize(serialized).userOp);
|
|
205
|
+
}
|
|
206
|
+
// These methods aren't implemented
|
|
207
|
+
async dumpLocal() {
|
|
208
|
+
return []; // We can't dump from redis as the latency is too high
|
|
209
|
+
}
|
|
210
|
+
clear() {
|
|
211
|
+
throw new Error("Not implemented: clear");
|
|
212
|
+
}
|
|
213
|
+
// Skip limit checks when using Redis
|
|
214
|
+
validateQueuedLimit() {
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
validateParallelLimit() {
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
export const createRedisOutstandingQueue = ({ config, entryPoint, redisEndpoint, logger }) => {
|
|
222
|
+
return new RedisOutstandingQueue({
|
|
223
|
+
config,
|
|
224
|
+
entryPoint,
|
|
225
|
+
redisEndpoint,
|
|
226
|
+
logger
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
//# sourceMappingURL=redis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis.js","sourceRoot":"","sources":["../../../store/outstanding/redis.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,gBAAgB,EACnB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAIlC,MAAM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AAE,IAAI,CAAC,CAAA;QAC3C,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QAErC,kCAAkC;QAClC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;aACjB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAkB,CAAC;aAC7C,MAAM,CAAC,CAAC,UAAU,EAAwB,EAAE,CAAC,UAAU,KAAK,IAAI,CAAC;aACjE,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA;IAC5D,CAAC;IAED,mCAAmC;IACnC,KAAK,CAAC,SAAS;QACX,OAAO,EAAE,CAAA,CAAC,sDAAsD;IACpE,CAAC;IAED,KAAK;QACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;IAC7C,CAAC;IAED,qCAAqC;IACrC,mBAAmB;QACf,OAAO,IAAI,CAAA;IACf,CAAC;IAED,qBAAqB;QACjB,OAAO,IAAI,CAAA;IACf,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EACxC,MAAM,EACN,UAAU,EACV,aAAa,EACb,MAAM,EAMT,EAAoB,EAAE;IACnB,OAAO,IAAI,qBAAqB,CAAC;QAC7B,MAAM;QACN,UAAU;QACV,aAAa;QACb,MAAM;KACT,CAAC,CAAA;AACN,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { HexData32, UserOpInfo, UserOperation } from "../../types/index.js";
|
|
2
|
+
import type { ConflictType } from "../types.js";
|
|
3
|
+
export type ConflictingOutstandingType = {
|
|
4
|
+
conflictReason: ConflictType;
|
|
5
|
+
userOpInfo: UserOpInfo;
|
|
6
|
+
} | undefined;
|
|
7
|
+
export interface OutstandingStore {
|
|
8
|
+
contains(userOpHash: HexData32): Promise<boolean>;
|
|
9
|
+
pop(count: number): Promise<UserOpInfo[]>;
|
|
10
|
+
popConflicting(userOp: UserOperation): Promise<ConflictingOutstandingType>;
|
|
11
|
+
add(userOpInfos: UserOpInfo[]): Promise<void>;
|
|
12
|
+
remove(userOpHash: HexData32[]): Promise<UserOpInfo[]>;
|
|
13
|
+
getQueuedUserOps(userOp: UserOperation): Promise<UserOperation[]>;
|
|
14
|
+
dumpLocal(): Promise<UserOpInfo[]>;
|
|
15
|
+
clear(): Promise<void>;
|
|
16
|
+
validateQueuedLimit(userOp: UserOperation): boolean;
|
|
17
|
+
validateParallelLimit(userOp: UserOperation): boolean;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../store/outstanding/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { AltoConfig } from "../../createConfig.js";
|
|
3
|
+
import { type ProcessingStore } from "../index.js";
|
|
4
|
+
export declare function createProcessingStore({ config, entryPoint }: {
|
|
5
|
+
config: AltoConfig;
|
|
6
|
+
entryPoint: Address;
|
|
7
|
+
}): ProcessingStore;
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export * from "./memory.js";
|
|
10
|
+
export * from "./redis.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InMemoryProcessingStore, RedisProcessingStore } from "../index.js";
|
|
2
|
+
// Holds all userOps that have been removed from outstanding pool and are being processed.
|
|
3
|
+
// UserOps are are removed from this store when they have successfully landed onchain or when they are cancelled.
|
|
4
|
+
export function createProcessingStore({ config, entryPoint }) {
|
|
5
|
+
if (config.enableHorizontalScaling && config.redisEndpoint) {
|
|
6
|
+
return new RedisProcessingStore({
|
|
7
|
+
config,
|
|
8
|
+
entryPoint,
|
|
9
|
+
redisEndpoint: config.redisEndpoint
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return new InMemoryProcessingStore();
|
|
13
|
+
}
|
|
14
|
+
export * from "./types.js";
|
|
15
|
+
export * from "./memory.js";
|
|
16
|
+
export * from "./redis.js";
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../store/processing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,uBAAuB,EAEvB,oBAAoB,EACvB,MAAM,aAAa,CAAA;AAEpB,0FAA0F;AAC1F,iHAAiH;AACjH,MAAM,UAAU,qBAAqB,CAAC,EAClC,MAAM,EACN,UAAU,EAIb;IACG,IAAI,MAAM,CAAC,uBAAuB,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;QACzD,OAAO,IAAI,oBAAoB,CAAC;YAC5B,MAAM;YACN,UAAU;YACV,aAAa,EAAE,MAAM,CAAC,aAAa;SACtC,CAAC,CAAA;IACN,CAAC;IACD,OAAO,IAAI,uBAAuB,EAAE,CAAA;AACxC,CAAC;AAED,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { UserOpInfo, UserOperation } from "../../types/index.js";
|
|
2
|
+
import type { Hex } from "viem";
|
|
3
|
+
import type { ConflictType } from "../types.js";
|
|
4
|
+
import type { ProcessingStore } from "./types.js";
|
|
5
|
+
export declare class InMemoryProcessingStore implements ProcessingStore {
|
|
6
|
+
private readonly processingUserOpsSet;
|
|
7
|
+
private readonly processingSenderNonceSet;
|
|
8
|
+
private readonly processingDeploymentSet;
|
|
9
|
+
private readonly processingEip7702AuthSet;
|
|
10
|
+
private encodeSenderNonceId;
|
|
11
|
+
addProcessing(userOpInfo: UserOpInfo): Promise<void>;
|
|
12
|
+
removeProcessing(userOpInfo: UserOpInfo): Promise<void>;
|
|
13
|
+
isProcessing(userOpHash: Hex): Promise<boolean>;
|
|
14
|
+
wouldConflict(userOp: UserOperation): Promise<ConflictType | undefined>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=memory.d.ts.map
|