@pimlico/alto 0.0.0-main.20240607T104359 → 0.0.0-staging.20240606T095015
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/lib/cli/config/bundler.js +73 -76
- package/lib/cli/config/bundler.js.map +1 -1
- package/lib/cli/config/index.js +2 -18
- package/lib/cli/config/index.js.map +1 -1
- package/lib/cli/config/options.js +10 -13
- package/lib/cli/config/options.js.map +1 -1
- package/lib/cli/customTransport.js +7 -11
- package/lib/cli/customTransport.js.map +1 -1
- package/lib/cli/handler.js +24 -28
- package/lib/cli/handler.js.map +1 -1
- package/lib/cli/index.d.ts +0 -1
- package/lib/cli/index.js +2 -19
- package/lib/cli/index.js.map +1 -1
- package/lib/cli/instrumentation.js +20 -22
- package/lib/cli/instrumentation.js.map +1 -1
- package/lib/cli/setupServer.js +17 -21
- package/lib/cli/setupServer.js.map +1 -1
- package/lib/cli/util.js +1 -5
- package/lib/cli/util.js.map +1 -1
- package/lib/executor/executor.js +56 -90
- package/lib/executor/executor.js.map +1 -1
- package/lib/executor/executorManager.js +7 -12
- package/lib/executor/executorManager.js.map +1 -1
- package/lib/executor/index.js +4 -20
- package/lib/executor/index.js.map +1 -1
- package/lib/executor/senderManager.js +8 -12
- package/lib/executor/senderManager.js.map +1 -1
- package/lib/executor/test/utils.js +22 -28
- package/lib/executor/test/utils.js.map +1 -1
- package/lib/executor/utils.js +32 -64
- package/lib/executor/utils.js.map +1 -1
- package/lib/index.d.ts +5 -1
- package/lib/index.js +91 -3
- package/lib/index.js.map +1 -1
- package/lib/mempool/index.js +4 -20
- package/lib/mempool/index.js.map +1 -1
- package/lib/mempool/mempool.js +55 -59
- package/lib/mempool/mempool.js.map +1 -1
- package/lib/mempool/monitoring.js +1 -5
- package/lib/mempool/monitoring.js.map +1 -1
- package/lib/mempool/nullMempool.js +1 -5
- package/lib/mempool/nullMempool.js.map +1 -1
- package/lib/mempool/reputationManager.js +44 -49
- package/lib/mempool/reputationManager.js.map +1 -1
- package/lib/mempool/store.js +1 -5
- package/lib/mempool/store.js.map +1 -1
- package/lib/rpc/EntryPointSimulationsV07.js +44 -50
- package/lib/rpc/EntryPointSimulationsV07.js.map +1 -1
- package/lib/rpc/ExecuteSimulator.js +2 -5
- package/lib/rpc/ExecuteSimulator.js.map +1 -1
- package/lib/rpc/gasEstimation.js +62 -69
- package/lib/rpc/gasEstimation.js.map +1 -1
- package/lib/rpc/index.js +4 -20
- package/lib/rpc/index.js.map +1 -1
- package/lib/rpc/nonceQueuer.js +16 -20
- package/lib/rpc/nonceQueuer.js.map +1 -1
- package/lib/rpc/rpcHandler.js +76 -103
- package/lib/rpc/rpcHandler.js.map +1 -1
- package/lib/rpc/server.js +27 -58
- package/lib/rpc/server.js.map +1 -1
- package/lib/rpc/validation/BundlerCollectorTracerV06.js +1 -5
- package/lib/rpc/validation/BundlerCollectorTracerV06.js.map +1 -1
- package/lib/rpc/validation/BundlerCollectorTracerV07.js +1 -5
- package/lib/rpc/validation/BundlerCollectorTracerV07.js.map +1 -1
- package/lib/rpc/validation/SafeValidator.js +65 -69
- package/lib/rpc/validation/SafeValidator.js.map +1 -1
- package/lib/rpc/validation/TracerResultParserV06.js +26 -30
- package/lib/rpc/validation/TracerResultParserV06.js.map +1 -1
- package/lib/rpc/validation/TracerResultParserV07.js +29 -36
- package/lib/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/lib/rpc/validation/UnsafeValidator.js +46 -73
- package/lib/rpc/validation/UnsafeValidator.js.map +1 -1
- package/lib/rpc/validation/index.js +2 -18
- package/lib/rpc/validation/index.js.map +1 -1
- package/lib/rpc/validation/tracer.js +7 -37
- package/lib/rpc/validation/tracer.js.map +1 -1
- package/lib/types/contracts/BundleBulker.js +1 -4
- package/lib/types/contracts/BundleBulker.js.map +1 -1
- package/lib/types/contracts/CallEngine.js +1 -4
- package/lib/types/contracts/CallEngine.js.map +1 -1
- package/lib/types/contracts/CodeHashGetter.js +2 -5
- package/lib/types/contracts/CodeHashGetter.js.map +1 -1
- package/lib/types/contracts/EntryPoint.js +4 -7
- package/lib/types/contracts/EntryPoint.js.map +1 -1
- package/lib/types/contracts/EntryPointSimulations.js +3 -6
- package/lib/types/contracts/EntryPointSimulations.js.map +1 -1
- package/lib/types/contracts/IOpInflator.js +1 -4
- package/lib/types/contracts/IOpInflator.js.map +1 -1
- package/lib/types/contracts/IPaymaster.js +1 -4
- package/lib/types/contracts/IPaymaster.js.map +1 -1
- package/lib/types/contracts/Inflator.js +1 -4
- package/lib/types/contracts/Inflator.js.map +1 -1
- package/lib/types/contracts/PerOpInflator.js +1 -4
- package/lib/types/contracts/PerOpInflator.js.map +1 -1
- package/lib/types/contracts/PimlicoEntryPointSimulations.js +2 -5
- package/lib/types/contracts/PimlicoEntryPointSimulations.js.map +1 -1
- package/lib/types/contracts/SenderCreator.js +2 -5
- package/lib/types/contracts/SenderCreator.js.map +1 -1
- package/lib/types/contracts/SimpleAccountFactory.js +2 -5
- package/lib/types/contracts/SimpleAccountFactory.js.map +1 -1
- package/lib/types/contracts/TestOpcodesAccount.js +2 -5
- package/lib/types/contracts/TestOpcodesAccount.js.map +1 -1
- package/lib/types/contracts/TestOpcodesAccountFactory.js +2 -5
- package/lib/types/contracts/TestOpcodesAccountFactory.js.map +1 -1
- package/lib/types/contracts/TestStorageAccount.js +2 -5
- package/lib/types/contracts/TestStorageAccount.js.map +1 -1
- package/lib/types/contracts/index.js +16 -32
- package/lib/types/contracts/index.js.map +1 -1
- package/lib/types/gasPrice.js +14 -17
- package/lib/types/gasPrice.js.map +1 -1
- package/lib/types/index.js +10 -26
- package/lib/types/index.js.map +1 -1
- package/lib/types/interfaces.js +1 -2
- package/lib/types/mempool.d.ts +1 -2
- package/lib/types/mempool.js +5 -10
- package/lib/types/mempool.js.map +1 -1
- package/lib/types/schemas.js +254 -284
- package/lib/types/schemas.js.map +1 -1
- package/lib/types/test/validationTestErrors.js +2 -5
- package/lib/types/test/validationTestErrors.js.map +1 -1
- package/lib/types/utils.js +5 -9
- package/lib/types/utils.js.map +1 -1
- package/lib/types/validation.js +139 -142
- package/lib/types/validation.js.map +1 -1
- package/lib/utils/bigInt.js +2 -7
- package/lib/utils/bigInt.js.map +1 -1
- package/lib/utils/compressionHandler.js +7 -11
- package/lib/utils/compressionHandler.js.map +1 -1
- package/lib/utils/gasPriceManager.js +30 -57
- package/lib/utils/gasPriceManager.js.map +1 -1
- package/lib/utils/helpers.js +5 -10
- package/lib/utils/helpers.js.map +1 -1
- package/lib/utils/index.js +9 -25
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/logger.js +10 -19
- package/lib/utils/logger.js.map +1 -1
- package/lib/utils/metrics.js +20 -24
- package/lib/utils/metrics.js.map +1 -1
- package/lib/utils/rpc-reply.js +1 -3
- package/lib/utils/rpc-reply.js.map +1 -1
- package/lib/utils/test.js +36 -67
- package/lib/utils/test.js.map +1 -1
- package/lib/utils/userop.js +62 -107
- package/lib/utils/userop.js.map +1 -1
- package/lib/utils/validation.js +64 -99
- package/lib/utils/validation.js.map +1 -1
- package/package.json +68 -70
- package/esm/cli/alto.d.ts +0 -6
- package/esm/cli/alto.js +0 -92
- package/esm/cli/alto.js.map +0 -1
- package/esm/cli/config/bundler.d.ts +0 -391
- package/esm/cli/config/bundler.js +0 -132
- package/esm/cli/config/bundler.js.map +0 -1
- package/esm/cli/config/index.d.ts +0 -3
- package/esm/cli/config/index.js +0 -3
- package/esm/cli/config/index.js.map +0 -1
- package/esm/cli/config/options.d.ts +0 -11
- package/esm/cli/config/options.js +0 -336
- package/esm/cli/config/options.js.map +0 -1
- package/esm/cli/customTransport.d.ts +0 -14
- package/esm/cli/customTransport.js +0 -53
- package/esm/cli/customTransport.js.map +0 -1
- package/esm/cli/handler.d.ts +0 -3
- package/esm/cli/handler.js +0 -116
- package/esm/cli/handler.js.map +0 -1
- package/esm/cli/index.d.ts +0 -4
- package/esm/cli/index.js +0 -4
- package/esm/cli/index.js.map +0 -1
- package/esm/cli/instrumentation.d.ts +0 -2
- package/esm/cli/instrumentation.js +0 -39
- package/esm/cli/instrumentation.js.map +0 -1
- package/esm/cli/setupServer.d.ts +0 -17
- package/esm/cli/setupServer.js +0 -155
- package/esm/cli/setupServer.js.map +0 -1
- package/esm/cli/util.d.ts +0 -22
- package/esm/cli/util.js +0 -30
- package/esm/cli/util.js.map +0 -1
- package/esm/executor/executor.d.ts +0 -54
- package/esm/executor/executor.js +0 -643
- package/esm/executor/executor.js.map +0 -1
- package/esm/executor/executorManager.d.ts +0 -34
- package/esm/executor/executorManager.js +0 -402
- package/esm/executor/executorManager.js.map +0 -1
- package/esm/executor/index.d.ts +0 -5
- package/esm/executor/index.js +0 -5
- package/esm/executor/index.js.map +0 -1
- package/esm/executor/senderManager.d.ts +0 -17
- package/esm/executor/senderManager.js +0 -160
- package/esm/executor/senderManager.js.map +0 -1
- package/esm/executor/test/utils.d.ts +0 -13
- package/esm/executor/test/utils.js +0 -75
- package/esm/executor/test/utils.js.map +0 -1
- package/esm/executor/utils.d.ts +0 -32
- package/esm/executor/utils.js +0 -241
- package/esm/executor/utils.js.map +0 -1
- package/esm/index.d.ts +0 -2
- package/esm/index.js +0 -2
- package/esm/index.js.map +0 -1
- package/esm/mempool/index.d.ts +0 -5
- package/esm/mempool/index.js +0 -5
- package/esm/mempool/index.js.map +0 -1
- package/esm/mempool/mempool.d.ts +0 -64
- package/esm/mempool/mempool.js +0 -489
- package/esm/mempool/mempool.js.map +0 -1
- package/esm/mempool/monitoring.d.ts +0 -10
- package/esm/mempool/monitoring.js +0 -34
- package/esm/mempool/monitoring.js.map +0 -1
- package/esm/mempool/nullMempool.d.ts +0 -15
- package/esm/mempool/nullMempool.js +0 -36
- package/esm/mempool/nullMempool.js.map +0 -1
- package/esm/mempool/reputationManager.d.ts +0 -115
- package/esm/mempool/reputationManager.js +0 -397
- package/esm/mempool/reputationManager.js.map +0 -1
- package/esm/mempool/store.d.ts +0 -22
- package/esm/mempool/store.js +0 -123
- package/esm/mempool/store.js.map +0 -1
- package/esm/rpc/EntryPointSimulationsV07.d.ts +0 -58
- package/esm/rpc/EntryPointSimulationsV07.js +0 -407
- package/esm/rpc/EntryPointSimulationsV07.js.map +0 -1
- package/esm/rpc/ExecuteSimulator.d.ts +0 -37
- package/esm/rpc/ExecuteSimulator.js +0 -48
- package/esm/rpc/ExecuteSimulator.js.map +0 -1
- package/esm/rpc/gasEstimation.d.ts +0 -17
- package/esm/rpc/gasEstimation.js +0 -410
- package/esm/rpc/gasEstimation.js.map +0 -1
- package/esm/rpc/index.d.ts +0 -5
- package/esm/rpc/index.js +0 -5
- package/esm/rpc/index.js.map +0 -1
- package/esm/rpc/nonceQueuer.d.ts +0 -25
- package/esm/rpc/nonceQueuer.js +0 -135
- package/esm/rpc/nonceQueuer.js.map +0 -1
- package/esm/rpc/rpcHandler.d.ts +0 -64
- package/esm/rpc/rpcHandler.js +0 -727
- package/esm/rpc/rpcHandler.js.map +0 -1
- package/esm/rpc/server.d.ts +0 -31
- package/esm/rpc/server.js +0 -239
- package/esm/rpc/server.js.map +0 -1
- package/esm/rpc/validation/BundlerCollectorTracerV06.d.ts +0 -102
- package/esm/rpc/validation/BundlerCollectorTracerV06.js +0 -255
- package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +0 -1
- package/esm/rpc/validation/BundlerCollectorTracerV07.d.ts +0 -102
- package/esm/rpc/validation/BundlerCollectorTracerV07.js +0 -254
- package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +0 -1
- package/esm/rpc/validation/SafeValidator.d.ts +0 -35
- package/esm/rpc/validation/SafeValidator.js +0 -487
- package/esm/rpc/validation/SafeValidator.js.map +0 -1
- package/esm/rpc/validation/TracerResultParserV06.d.ts +0 -13
- package/esm/rpc/validation/TracerResultParserV06.js +0 -578
- package/esm/rpc/validation/TracerResultParserV06.js.map +0 -1
- package/esm/rpc/validation/TracerResultParserV07.d.ts +0 -33
- package/esm/rpc/validation/TracerResultParserV07.js +0 -557
- package/esm/rpc/validation/TracerResultParserV07.js.map +0 -1
- package/esm/rpc/validation/UnsafeValidator.d.ts +0 -63
- package/esm/rpc/validation/UnsafeValidator.js +0 -257
- package/esm/rpc/validation/UnsafeValidator.js.map +0 -1
- package/esm/rpc/validation/index.d.ts +0 -3
- package/esm/rpc/validation/index.js +0 -3
- package/esm/rpc/validation/index.js.map +0 -1
- package/esm/rpc/validation/tracer.d.ts +0 -122
- package/esm/rpc/validation/tracer.js +0 -82
- package/esm/rpc/validation/tracer.js.map +0 -1
- package/esm/types/contracts/BundleBulker.d.ts +0 -120
- package/esm/types/contracts/BundleBulker.js +0 -157
- package/esm/types/contracts/BundleBulker.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/types/contracts/CodeHashGetter.d.ts +0 -37
- package/esm/types/contracts/CodeHashGetter.js +0 -45
- package/esm/types/contracts/CodeHashGetter.js.map +0 -1
- package/esm/types/contracts/EntryPoint.d.ts +0 -1789
- package/esm/types/contracts/EntryPoint.js +0 -2304
- package/esm/types/contracts/EntryPoint.js.map +0 -1
- package/esm/types/contracts/EntryPointSimulations.d.ts +0 -153
- package/esm/types/contracts/EntryPointSimulations.js +0 -15
- package/esm/types/contracts/EntryPointSimulations.js.map +0 -1
- package/esm/types/contracts/IOpInflator.d.ts +0 -61
- package/esm/types/contracts/IOpInflator.js +0 -80
- package/esm/types/contracts/IOpInflator.js.map +0 -1
- package/esm/types/contracts/IPaymaster.d.ts +0 -3
- package/esm/types/contracts/IPaymaster.js +0 -117
- package/esm/types/contracts/IPaymaster.js.map +0 -1
- package/esm/types/contracts/Inflator.d.ts +0 -65
- package/esm/types/contracts/Inflator.js +0 -84
- package/esm/types/contracts/Inflator.js.map +0 -1
- package/esm/types/contracts/PerOpInflator.d.ts +0 -176
- package/esm/types/contracts/PerOpInflator.js +0 -229
- package/esm/types/contracts/PerOpInflator.js.map +0 -1
- package/esm/types/contracts/PimlicoEntryPointSimulations.d.ts +0 -23
- package/esm/types/contracts/PimlicoEntryPointSimulations.js +0 -33
- package/esm/types/contracts/PimlicoEntryPointSimulations.js.map +0 -1
- package/esm/types/contracts/SenderCreator.d.ts +0 -4
- package/esm/types/contracts/SenderCreator.js +0 -23
- package/esm/types/contracts/SenderCreator.js.map +0 -1
- package/esm/types/contracts/SimpleAccountFactory.d.ts +0 -57
- package/esm/types/contracts/SimpleAccountFactory.js +0 -76
- package/esm/types/contracts/SimpleAccountFactory.js.map +0 -1
- package/esm/types/contracts/TestOpcodesAccount.d.ts +0 -4
- package/esm/types/contracts/TestOpcodesAccount.js +0 -281
- package/esm/types/contracts/TestOpcodesAccount.js.map +0 -1
- package/esm/types/contracts/TestOpcodesAccountFactory.d.ts +0 -4
- package/esm/types/contracts/TestOpcodesAccountFactory.js +0 -23
- package/esm/types/contracts/TestOpcodesAccountFactory.js.map +0 -1
- package/esm/types/contracts/TestStorageAccount.d.ts +0 -4
- package/esm/types/contracts/TestStorageAccount.js +0 -313
- package/esm/types/contracts/TestStorageAccount.js.map +0 -1
- package/esm/types/contracts/index.d.ts +0 -17
- package/esm/types/contracts/index.js +0 -17
- package/esm/types/contracts/index.js.map +0 -1
- package/esm/types/gasPrice.d.ts +0 -110
- package/esm/types/gasPrice.js +0 -52
- package/esm/types/gasPrice.js.map +0 -1
- package/esm/types/index.d.ts +0 -11
- package/esm/types/index.js +0 -11
- package/esm/types/index.js.map +0 -1
- package/esm/types/interfaces.d.ts +0 -26
- package/esm/types/interfaces.js +0 -2
- package/esm/types/interfaces.js.map +0 -1
- package/esm/types/mempool.d.ts +0 -79
- package/esm/types/mempool.js +0 -16
- package/esm/types/mempool.js.map +0 -1
- package/esm/types/schemas.d.ts +0 -4791
- package/esm/types/schemas.js +0 -497
- package/esm/types/schemas.js.map +0 -1
- package/esm/types/test/validationTestErrors.d.ts +0 -3
- package/esm/types/test/validationTestErrors.js +0 -229
- package/esm/types/test/validationTestErrors.js.map +0 -1
- package/esm/types/utils.d.ts +0 -24
- package/esm/types/utils.js +0 -30
- package/esm/types/utils.js.map +0 -1
- package/esm/types/validation.d.ts +0 -14327
- package/esm/types/validation.js +0 -304
- package/esm/types/validation.js.map +0 -1
- package/esm/utils/bigInt.d.ts +0 -3
- package/esm/utils/bigInt.js +0 -9
- package/esm/utils/bigInt.js.map +0 -1
- package/esm/utils/compressionHandler.d.ts +0 -11
- package/esm/utils/compressionHandler.js +0 -39
- package/esm/utils/compressionHandler.js.map +0 -1
- package/esm/utils/gasPriceManager.d.ts +0 -34
- package/esm/utils/gasPriceManager.js +0 -338
- package/esm/utils/gasPriceManager.js.map +0 -1
- package/esm/utils/helpers.d.ts +0 -4
- package/esm/utils/helpers.js +0 -13
- package/esm/utils/helpers.js.map +0 -1
- package/esm/utils/index.d.ts +0 -11
- package/esm/utils/index.js +0 -10
- package/esm/utils/index.js.map +0 -1
- package/esm/utils/logger.d.ts +0 -6
- package/esm/utils/logger.js +0 -76
- package/esm/utils/logger.js.map +0 -1
- package/esm/utils/metrics.d.ts +0 -22
- package/esm/utils/metrics.js +0 -150
- package/esm/utils/metrics.js.map +0 -1
- package/esm/utils/rpc-reply.d.ts +0 -17
- package/esm/utils/rpc-reply.js +0 -41
- package/esm/utils/rpc-reply.js.map +0 -1
- package/esm/utils/test.d.ts +0 -17
- package/esm/utils/test.js +0 -130
- package/esm/utils/test.js.map +0 -1
- package/esm/utils/userop.d.ts +0 -49
- package/esm/utils/userop.js +0 -408
- package/esm/utils/userop.js.map +0 -1
- package/esm/utils/validation.d.ts +0 -65
- package/esm/utils/validation.js +0 -461
- package/esm/utils/validation.js.map +0 -1
- package/lib/cli/alto.d.ts +0 -6
- package/lib/cli/alto.js +0 -123
- package/lib/cli/alto.js.map +0 -1
|
@@ -1,41 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
|
|
11
|
-
const opentelemetry_instrumentation_fetch_node_1 = require("opentelemetry-instrumentation-fetch-node");
|
|
1
|
+
import { SpanKind } from "@opentelemetry/api";
|
|
2
|
+
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto";
|
|
3
|
+
import { FastifyInstrumentation } from "@opentelemetry/instrumentation-fastify";
|
|
4
|
+
import { HttpInstrumentation } from "@opentelemetry/instrumentation-http";
|
|
5
|
+
import { PinoInstrumentation } from "@opentelemetry/instrumentation-pino";
|
|
6
|
+
import { NodeSDK } from "@opentelemetry/sdk-node";
|
|
7
|
+
import { ParentBasedSampler, SamplingDecision } from "@opentelemetry/sdk-trace-base";
|
|
8
|
+
import { SemanticAttributes } from "@opentelemetry/semantic-conventions";
|
|
9
|
+
import { FetchInstrumentation } from "opentelemetry-instrumentation-fetch-node";
|
|
12
10
|
class CustomSampler {
|
|
13
11
|
shouldSample(_context, _traceId, _spanName, spanKind, attributes) {
|
|
14
12
|
const ignoredRoutes = ["/metrics", "/health"];
|
|
15
|
-
const httpTarget = attributes[
|
|
16
|
-
if (spanKind ===
|
|
13
|
+
const httpTarget = attributes[SemanticAttributes.HTTP_TARGET];
|
|
14
|
+
if (spanKind === SpanKind.SERVER &&
|
|
17
15
|
httpTarget &&
|
|
18
16
|
ignoredRoutes.includes(httpTarget.toString())) {
|
|
19
|
-
return { decision:
|
|
17
|
+
return { decision: SamplingDecision.NOT_RECORD };
|
|
20
18
|
}
|
|
21
19
|
// fallback
|
|
22
|
-
return { decision:
|
|
20
|
+
return { decision: SamplingDecision.RECORD_AND_SAMPLED };
|
|
23
21
|
}
|
|
24
22
|
toString() {
|
|
25
23
|
return "CustomSampler";
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
|
-
const sdk = new
|
|
29
|
-
traceExporter: new
|
|
26
|
+
const sdk = new NodeSDK({
|
|
27
|
+
traceExporter: new OTLPTraceExporter(),
|
|
30
28
|
instrumentations: [
|
|
31
|
-
new
|
|
29
|
+
new HttpInstrumentation({
|
|
32
30
|
requireParentforOutgoingSpans: true
|
|
33
31
|
}),
|
|
34
|
-
new
|
|
35
|
-
new
|
|
36
|
-
new
|
|
32
|
+
new FetchInstrumentation({}),
|
|
33
|
+
new FastifyInstrumentation(),
|
|
34
|
+
new PinoInstrumentation()
|
|
37
35
|
],
|
|
38
|
-
sampler: new
|
|
36
|
+
sampler: new ParentBasedSampler({ root: new CustomSampler() })
|
|
39
37
|
});
|
|
40
38
|
sdk.start();
|
|
41
39
|
//# sourceMappingURL=instrumentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../cli/instrumentation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../cli/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAA;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EACH,kBAAkB,EAElB,gBAAgB,EACnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AAE/E,MAAM,aAAa;IACf,YAAY,CACR,QAAiB,EACjB,QAAgB,EAChB,SAAiB,EACjB,QAAkB,EAClB,UAAsB;QAEtB,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;QAE7C,MAAM,UAAU,GAAG,UAAU,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAA;QAE7D,IACI,QAAQ,KAAK,QAAQ,CAAC,MAAM;YAC5B,UAAU;YACV,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAC/C,CAAC;YACC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,CAAC,UAAU,EAAE,CAAA;QACpD,CAAC;QACD,WAAW;QACX,OAAO,EAAE,QAAQ,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,CAAA;IAC5D,CAAC;IACD,QAAQ;QACJ,OAAO,eAAe,CAAA;IAC1B,CAAC;CACJ;AAED,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC;IACpB,aAAa,EAAE,IAAI,iBAAiB,EAAE;IACtC,gBAAgB,EAAE;QACd,IAAI,mBAAmB,CAAC;YACpB,6BAA6B,EAAE,IAAI;SACtC,CAAC;QACF,IAAI,oBAAoB,CAAC,EAAE,CAAC;QAC5B,IAAI,sBAAsB,EAAE;QAC5B,IAAI,mBAAmB,EAAE;KAC5B;IACD,OAAO,EAAE,IAAI,kBAAkB,CAAC,EAAE,IAAI,EAAE,IAAI,aAAa,EAAE,EAAE,CAAC;CACjE,CAAC,CAAA;AAEF,GAAG,CAAC,KAAK,EAAE,CAAA"}
|
package/lib/cli/setupServer.js
CHANGED
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const mempool_1 = require("../mempool/index.js");
|
|
6
|
-
const rpc_1 = require("../rpc/index.js");
|
|
7
|
-
const utils_1 = require("../utils/index.js");
|
|
1
|
+
import { Executor, ExecutorManager } from "../executor/index.js";
|
|
2
|
+
import { MemoryMempool, Monitor, NullReputationManager, ReputationManager } from "../mempool/index.js";
|
|
3
|
+
import { NonceQueuer, RpcHandler, SafeValidator, Server, UnsafeValidator } from "../rpc/index.js";
|
|
4
|
+
import { CompressionHandler } from "../utils/index.js";
|
|
8
5
|
const getReputationManager = ({ client, parsedArgs, logger }) => {
|
|
9
6
|
if (parsedArgs["safe-mode"]) {
|
|
10
|
-
return new
|
|
7
|
+
return new ReputationManager(client, parsedArgs.entrypoints, BigInt(parsedArgs["min-entity-stake"]), BigInt(parsedArgs["min-entity-unstake-delay"]), logger.child({ module: "reputation_manager" }, {
|
|
11
8
|
level: parsedArgs["reputation-manager-log-level"] ||
|
|
12
9
|
parsedArgs["log-level"]
|
|
13
10
|
}));
|
|
14
11
|
}
|
|
15
|
-
return new
|
|
12
|
+
return new NullReputationManager();
|
|
16
13
|
};
|
|
17
14
|
const getValidator = ({ client, parsedArgs, logger, senderManager, metrics, gasPriceManager }) => {
|
|
18
15
|
if (parsedArgs["safe-mode"]) {
|
|
19
|
-
return new
|
|
16
|
+
return new SafeValidator(client, senderManager, logger.child({ module: "rpc" }, {
|
|
20
17
|
level: parsedArgs["rpc-log-level"] || parsedArgs["log-level"]
|
|
21
18
|
}), metrics, gasPriceManager, parsedArgs["chain-type"], parsedArgs["entrypoint-simulation-contract"], parsedArgs["fixed-gas-limit-for-estimation"], parsedArgs.tenderly, parsedArgs["balance-override"]);
|
|
22
19
|
}
|
|
23
|
-
return new
|
|
20
|
+
return new UnsafeValidator(client, logger.child({ module: "rpc" }, { level: parsedArgs["rpc-log-level"] || parsedArgs["log-level"] }), metrics, gasPriceManager, parsedArgs["chain-type"], parsedArgs["entrypoint-simulation-contract"], parsedArgs["fixed-gas-limit-for-estimation"], parsedArgs.tenderly, parsedArgs["balance-override"], parsedArgs["expiration-check"]);
|
|
24
21
|
};
|
|
25
22
|
const getMonitor = () => {
|
|
26
|
-
return new
|
|
23
|
+
return new Monitor();
|
|
27
24
|
};
|
|
28
25
|
const getMempool = ({ monitor, reputationManager, validator, client, parsedArgs, logger, metrics }) => {
|
|
29
|
-
return new
|
|
26
|
+
return new MemoryMempool(monitor, reputationManager, validator, client, parsedArgs["safe-mode"], logger.child({ module: "mempool" }, {
|
|
30
27
|
level: parsedArgs["mempool-log-level"] || parsedArgs["log-level"]
|
|
31
28
|
}), metrics, parsedArgs["mempool-max-parallel-ops"], parsedArgs["mempool-max-queued-ops"], parsedArgs["enforce-unique-senders-per-bundle"]);
|
|
32
29
|
};
|
|
@@ -34,33 +31,33 @@ const getCompressionHandler = async ({ client, parsedArgs }) => {
|
|
|
34
31
|
let compressionHandler = null;
|
|
35
32
|
if (parsedArgs["bundle-bulker-address"] !== undefined &&
|
|
36
33
|
parsedArgs["per-op-inflator-address"] !== undefined) {
|
|
37
|
-
compressionHandler = await
|
|
34
|
+
compressionHandler = await CompressionHandler.createAsync(parsedArgs["bundle-bulker-address"], parsedArgs["per-op-inflator-address"], client);
|
|
38
35
|
}
|
|
39
36
|
return compressionHandler;
|
|
40
37
|
};
|
|
41
38
|
const getExecutor = ({ client, walletClient, senderManager, reputationManager, parsedArgs, logger, metrics, compressionHandler, gasPriceManager }) => {
|
|
42
|
-
return new
|
|
39
|
+
return new Executor(client, walletClient, senderManager, reputationManager, parsedArgs.entrypoints, logger.child({ module: "executor" }, {
|
|
43
40
|
level: parsedArgs["executor-log-level"] || parsedArgs["log-level"]
|
|
44
41
|
}), metrics, compressionHandler, gasPriceManager, !parsedArgs.tenderly, parsedArgs["legacy-transactions"], parsedArgs["fixed-gas-limit-for-estimation"], parsedArgs["local-gas-limit-calculation"]);
|
|
45
42
|
};
|
|
46
43
|
const getExecutorManager = ({ executor, mempool, monitor, reputationManager, client, parsedArgs, logger, metrics, gasPriceManager }) => {
|
|
47
|
-
return new
|
|
44
|
+
return new ExecutorManager(executor, parsedArgs.entrypoints, mempool, monitor, reputationManager, client, parsedArgs["polling-interval"], logger.child({ module: "executor" }, {
|
|
48
45
|
level: parsedArgs["executor-log-level"] || parsedArgs["log-level"]
|
|
49
46
|
}), metrics, parsedArgs["bundle-mode"], parsedArgs["max-bundle-wait"], parsedArgs["max-gas-per-bundle"], gasPriceManager);
|
|
50
47
|
};
|
|
51
48
|
const getNonceQueuer = ({ mempool, client, parsedArgs, logger }) => {
|
|
52
|
-
return new
|
|
49
|
+
return new NonceQueuer(mempool, client, logger.child({ module: "nonce_queuer" }, {
|
|
53
50
|
level: parsedArgs["nonce-queuer-log-level"] ||
|
|
54
51
|
parsedArgs["log-level"]
|
|
55
52
|
}));
|
|
56
53
|
};
|
|
57
54
|
const getRpcHandler = ({ client, validator, mempool, executor, monitor, nonceQueuer, executorManager, reputationManager, parsedArgs, logger, metrics, compressionHandler, gasPriceManager }) => {
|
|
58
|
-
return new
|
|
55
|
+
return new RpcHandler(parsedArgs.entrypoints, client, validator, mempool, executor, monitor, nonceQueuer, executorManager, reputationManager, parsedArgs.tenderly ?? false, parsedArgs["max-block-range"], logger.child({ module: "rpc" }, { level: parsedArgs["rpc-log-level"] || parsedArgs["log-level"] }), metrics, parsedArgs["enable-debug-endpoints"], compressionHandler, parsedArgs["legacy-transactions"], gasPriceManager, parsedArgs["gas-price-multipliers"], parsedArgs["chain-type"], parsedArgs["paymaster-gas-limit-multiplier"], parsedArgs["dangerous-skip-user-operation-validation"]);
|
|
59
56
|
};
|
|
60
57
|
const getServer = ({ rpcEndpoint, parsedArgs, logger, registry, metrics }) => {
|
|
61
|
-
return new
|
|
58
|
+
return new Server(rpcEndpoint, parsedArgs["api-version"], parsedArgs["default-api-version"], parsedArgs.port, parsedArgs.timeout, parsedArgs["websocket-max-payload-size"], parsedArgs.websocket, logger.child({ module: "rpc" }, { level: parsedArgs["rpc-log-level"] || parsedArgs["log-level"] }), registry, metrics);
|
|
62
59
|
};
|
|
63
|
-
const setupServer = async ({ client, walletClient, parsedArgs, logger, rootLogger, registry, metrics, senderManager, gasPriceManager }) => {
|
|
60
|
+
export const setupServer = async ({ client, walletClient, parsedArgs, logger, rootLogger, registry, metrics, senderManager, gasPriceManager }) => {
|
|
64
61
|
const validator = getValidator({
|
|
65
62
|
client,
|
|
66
63
|
logger,
|
|
@@ -155,5 +152,4 @@ const setupServer = async ({ client, walletClient, parsedArgs, logger, rootLogge
|
|
|
155
152
|
process.on("SIGINT", gracefulShutdown);
|
|
156
153
|
process.on("SIGTERM", gracefulShutdown);
|
|
157
154
|
};
|
|
158
|
-
exports.setupServer = setupServer;
|
|
159
155
|
//# sourceMappingURL=setupServer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupServer.js","sourceRoot":"","sources":["../../cli/setupServer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setupServer.js","sourceRoot":"","sources":["../../cli/setupServer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EACH,aAAa,EACb,OAAO,EACP,qBAAqB,EACrB,iBAAiB,EAEpB,MAAM,eAAe,CAAA;AACtB,OAAO,EACH,WAAW,EACX,UAAU,EACV,aAAa,EACb,MAAM,EACN,eAAe,EAClB,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAKhD,MAAM,oBAAoB,GAAG,CAAC,EAC1B,MAAM,EACN,UAAU,EACV,MAAM,EAKT,EAA8B,EAAE;IAC7B,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,iBAAiB,CACxB,MAAM,EACN,UAAU,CAAC,WAAW,EACtB,MAAM,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,EACtC,MAAM,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC,EAC9C,MAAM,CAAC,KAAK,CACR,EAAE,MAAM,EAAE,oBAAoB,EAAE,EAChC;YACI,KAAK,EACD,UAAU,CAAC,8BAA8B,CAAC;gBAC1C,UAAU,CAAC,WAAW,CAAC;SAC9B,CACJ,CACJ,CAAA;IACL,CAAC;IACD,OAAO,IAAI,qBAAqB,EAAE,CAAA;AACtC,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,EAClB,MAAM,EACN,UAAU,EACV,MAAM,EACN,aAAa,EACb,OAAO,EACP,eAAe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9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommandToYargs = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Register a CliCommand type to yargs. Recursively registers subcommands too.
|
|
6
3
|
* @param yargs
|
|
7
4
|
* @param cliCommand
|
|
8
5
|
*/
|
|
9
|
-
function registerCommandToYargs(
|
|
6
|
+
export function registerCommandToYargs(
|
|
10
7
|
// biome-ignore lint/suspicious/noExplicitAny: it's a generic type
|
|
11
8
|
yargs,
|
|
12
9
|
// biome-ignore lint/suspicious/noExplicitAny: it's a generic type
|
|
@@ -30,5 +27,4 @@ cliCommand) {
|
|
|
30
27
|
handler: cliCommand.handler || function emptyHandler() { }
|
|
31
28
|
});
|
|
32
29
|
}
|
|
33
|
-
exports.registerCommandToYargs = registerCommandToYargs;
|
|
34
30
|
//# sourceMappingURL=util.js.map
|
package/lib/cli/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../cli/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../cli/util.ts"],"names":[],"mappings":"AAuBA;;;;GAIG;AACH,MAAM,UAAU,sBAAsB;AAClC,kEAAkE;AAClE,KAAgB;AAChB,kEAAkE;AAClE,UAAgC;IAEhC,KAAK,CAAC,OAAO,CAAC;QACV,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,OAAO,EAAE,CAAC,YAAY,EAAE,EAAE;YACtB,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,IAAI,EAAE,CAAC,CAAA;YAC9C,KAAK,MAAM,UAAU,IAAI,UAAU,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC;gBACpD,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA;YACpD,CAAC;YACD,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;gBACtB,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;oBACxC,YAAY,CAAC,OAAO,CAChB,MAAM,OAAO,CAAC,OAAO,EAAE,EACvB,OAAO,CAAC,WAAW,CACtB,CAAA;gBACL,CAAC;YACL,CAAC;YACD,OAAO,KAAK,CAAA;QAChB,CAAC;QACD,gEAAgE;QAChE,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,SAAS,YAAY,KAAU,CAAC;KAClE,CAAC,CAAA;AACN,CAAC"}
|
package/lib/executor/executor.js
CHANGED
|
@@ -1,36 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Executor = exports.NullExecutor = void 0;
|
|
27
|
-
const types_1 = require("../types/index.js");
|
|
28
|
-
const utils_1 = require("../utils/index.js");
|
|
29
|
-
const sentry = __importStar(require("@sentry/node"));
|
|
30
|
-
const async_mutex_1 = require("async-mutex");
|
|
31
|
-
const viem_1 = require("viem");
|
|
32
|
-
const utils_2 = require("./utils.js");
|
|
33
|
-
class NullExecutor {
|
|
1
|
+
import { EntryPointV06Abi, EntryPointV07Abi, deriveUserOperation } from "../types/index.js";
|
|
2
|
+
import { getUserOperationHash, isVersion06, maxBigInt, parseViemError, toPackedUserOperation } from "../utils/index.js";
|
|
3
|
+
import * as sentry from "@sentry/node";
|
|
4
|
+
import { Mutex } from "async-mutex";
|
|
5
|
+
import { FeeCapTooLowError, InsufficientFundsError, IntrinsicGasTooLowError, NonceTooLowError, encodeFunctionData, getContract } from "viem";
|
|
6
|
+
import { createCompressedCalldata, filterOpsAndEstimateGas, flushStuckTransaction, simulatedOpsToResults } from "./utils.js";
|
|
7
|
+
export class NullExecutor {
|
|
34
8
|
bundle(_entryPoint, _ops) {
|
|
35
9
|
return Promise.resolve([]);
|
|
36
10
|
}
|
|
@@ -53,8 +27,7 @@ class NullExecutor {
|
|
|
53
27
|
return Promise.resolve();
|
|
54
28
|
}
|
|
55
29
|
}
|
|
56
|
-
|
|
57
|
-
class Executor {
|
|
30
|
+
export class Executor {
|
|
58
31
|
// private unWatch: WatchBlocksReturnType | undefined
|
|
59
32
|
publicClient;
|
|
60
33
|
walletClient;
|
|
@@ -84,7 +57,7 @@ class Executor {
|
|
|
84
57
|
this.compressionHandler = compressionHandler;
|
|
85
58
|
this.gasPriceManager = gasPriceManager;
|
|
86
59
|
this.entryPoints = entryPoints;
|
|
87
|
-
this.mutex = new
|
|
60
|
+
this.mutex = new Mutex();
|
|
88
61
|
}
|
|
89
62
|
getCompressionHandler() {
|
|
90
63
|
if (!this.compressionHandler) {
|
|
@@ -104,14 +77,14 @@ class Executor {
|
|
|
104
77
|
async replaceTransaction(transactionInfo) {
|
|
105
78
|
const newRequest = { ...transactionInfo.transactionRequest };
|
|
106
79
|
const gasPriceParameters = await this.gasPriceManager.getGasPrice();
|
|
107
|
-
newRequest.maxFeePerGas =
|
|
108
|
-
newRequest.maxPriorityFeePerGas =
|
|
80
|
+
newRequest.maxFeePerGas = maxBigInt(gasPriceParameters.maxFeePerGas, (newRequest.maxFeePerGas * 11n + 9n) / 10n);
|
|
81
|
+
newRequest.maxPriorityFeePerGas = maxBigInt(gasPriceParameters.maxPriorityFeePerGas, (newRequest.maxPriorityFeePerGas * 11n + 9n) / 10n);
|
|
109
82
|
newRequest.account = transactionInfo.executor;
|
|
110
83
|
const opsWithHashes = transactionInfo.userOperationInfos.map((opInfo) => {
|
|
111
|
-
const op =
|
|
84
|
+
const op = deriveUserOperation(opInfo.mempoolUserOperation);
|
|
112
85
|
return {
|
|
113
86
|
mempoolUserOperation: opInfo.mempoolUserOperation,
|
|
114
|
-
userOperationHash:
|
|
87
|
+
userOperationHash: getUserOperationHash(op, transactionInfo.entryPoint, this.walletClient.chain.id),
|
|
115
88
|
entryPoint: opInfo.entryPoint
|
|
116
89
|
};
|
|
117
90
|
});
|
|
@@ -119,17 +92,17 @@ class Executor {
|
|
|
119
92
|
if (transactionInfo.transactionType === "default") {
|
|
120
93
|
const [isUserOpVersion06, entryPoint] = opsWithHashes.reduce((acc, op) => {
|
|
121
94
|
if (acc[0] !==
|
|
122
|
-
|
|
95
|
+
isVersion06(op.mempoolUserOperation) ||
|
|
123
96
|
acc[1] !== op.entryPoint) {
|
|
124
97
|
throw new Error("All user operations must be of the same version");
|
|
125
98
|
}
|
|
126
99
|
return acc;
|
|
127
100
|
}, [
|
|
128
|
-
|
|
101
|
+
isVersion06(opsWithHashes[0].mempoolUserOperation),
|
|
129
102
|
opsWithHashes[0].entryPoint
|
|
130
103
|
]);
|
|
131
|
-
const ep =
|
|
132
|
-
abi: isUserOpVersion06 ?
|
|
104
|
+
const ep = getContract({
|
|
105
|
+
abi: isUserOpVersion06 ? EntryPointV06Abi : EntryPointV07Abi,
|
|
133
106
|
address: entryPoint,
|
|
134
107
|
client: {
|
|
135
108
|
public: this.publicClient,
|
|
@@ -150,7 +123,7 @@ class Executor {
|
|
|
150
123
|
type: "compressed"
|
|
151
124
|
};
|
|
152
125
|
}
|
|
153
|
-
const result = await
|
|
126
|
+
const result = await filterOpsAndEstimateGas(transactionInfo.entryPoint, callContext, transactionInfo.executor, opsWithHashes, newRequest.nonce, newRequest.maxFeePerGas, newRequest.maxPriorityFeePerGas, "latest", this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, this.logger);
|
|
154
127
|
const childLogger = this.logger.child({
|
|
155
128
|
transactionHash: transactionInfo.transactionHash,
|
|
156
129
|
executor: transactionInfo.executor.address
|
|
@@ -181,7 +154,7 @@ class Executor {
|
|
|
181
154
|
});
|
|
182
155
|
newRequest.gas = this.localGasLimitCalculation
|
|
183
156
|
? opsToBundle.reduce((acc, opInfo) => {
|
|
184
|
-
const userOperation =
|
|
157
|
+
const userOperation = deriveUserOperation(opInfo.mempoolUserOperation);
|
|
185
158
|
return (acc +
|
|
186
159
|
userOperation.preVerificationGas +
|
|
187
160
|
3n * userOperation.verificationGasLimit +
|
|
@@ -192,32 +165,32 @@ class Executor {
|
|
|
192
165
|
if (transactionInfo.transactionType === "default") {
|
|
193
166
|
const isUserOpVersion06 = opsWithHashes.reduce((acc, op) => {
|
|
194
167
|
if (acc !==
|
|
195
|
-
|
|
168
|
+
isVersion06(op.mempoolUserOperation)) {
|
|
196
169
|
throw new Error("All user operations must be of the same version");
|
|
197
170
|
}
|
|
198
171
|
return acc;
|
|
199
|
-
},
|
|
172
|
+
}, isVersion06(opsWithHashes[0].mempoolUserOperation));
|
|
200
173
|
newRequest.data = isUserOpVersion06
|
|
201
|
-
?
|
|
202
|
-
abi:
|
|
174
|
+
? encodeFunctionData({
|
|
175
|
+
abi: EntryPointV06Abi,
|
|
203
176
|
functionName: "handleOps",
|
|
204
177
|
args: [
|
|
205
178
|
opsToBundle.map((opInfo) => opInfo.mempoolUserOperation),
|
|
206
179
|
transactionInfo.executor.address
|
|
207
180
|
]
|
|
208
181
|
})
|
|
209
|
-
:
|
|
210
|
-
abi:
|
|
182
|
+
: encodeFunctionData({
|
|
183
|
+
abi: EntryPointV07Abi,
|
|
211
184
|
functionName: "handleOps",
|
|
212
185
|
args: [
|
|
213
|
-
opsToBundle.map((opInfo) =>
|
|
186
|
+
opsToBundle.map((opInfo) => toPackedUserOperation(opInfo.mempoolUserOperation)),
|
|
214
187
|
transactionInfo.executor.address
|
|
215
188
|
]
|
|
216
189
|
});
|
|
217
190
|
}
|
|
218
191
|
else if (transactionInfo.transactionType === "compressed") {
|
|
219
192
|
const compressedOps = opsToBundle.map((opInfo) => opInfo.mempoolUserOperation);
|
|
220
|
-
newRequest.data =
|
|
193
|
+
newRequest.data = createCompressedCalldata(compressedOps, this.getCompressionHandler().perOpInflatorId);
|
|
221
194
|
}
|
|
222
195
|
try {
|
|
223
196
|
childLogger.info({
|
|
@@ -264,22 +237,22 @@ class Executor {
|
|
|
264
237
|
};
|
|
265
238
|
}
|
|
266
239
|
catch (err) {
|
|
267
|
-
const e =
|
|
240
|
+
const e = parseViemError(err);
|
|
268
241
|
if (!e) {
|
|
269
242
|
sentry.captureException(err);
|
|
270
243
|
childLogger.error({ error: err }, "unknown error replacing transaction");
|
|
271
244
|
}
|
|
272
|
-
if (e instanceof
|
|
245
|
+
if (e instanceof NonceTooLowError) {
|
|
273
246
|
childLogger.trace({ error: e }, "nonce too low, potentially already included");
|
|
274
247
|
return { status: "potentially_already_included" };
|
|
275
248
|
}
|
|
276
|
-
if (e instanceof
|
|
249
|
+
if (e instanceof FeeCapTooLowError) {
|
|
277
250
|
childLogger.warn({ error: e }, "fee cap too low, not replacing");
|
|
278
251
|
}
|
|
279
|
-
if (e instanceof
|
|
252
|
+
if (e instanceof InsufficientFundsError) {
|
|
280
253
|
childLogger.warn({ error: e }, "insufficient funds, not replacing");
|
|
281
254
|
}
|
|
282
|
-
if (e instanceof
|
|
255
|
+
if (e instanceof IntrinsicGasTooLowError) {
|
|
283
256
|
childLogger.warn({ error: e }, "intrinsic gas too low, not replacing");
|
|
284
257
|
}
|
|
285
258
|
childLogger.warn({ error: e }, "error replacing transaction");
|
|
@@ -297,7 +270,7 @@ class Executor {
|
|
|
297
270
|
: Array.from(new Set(this.senderManager.wallets));
|
|
298
271
|
const promises = wallets.map(async (wallet) => {
|
|
299
272
|
for (const entryPoint of this.entryPoints) {
|
|
300
|
-
await
|
|
273
|
+
await flushStuckTransaction(this.publicClient, this.walletClient, wallet, gasPrice.maxFeePerGas * 5n, this.logger, entryPoint);
|
|
301
274
|
}
|
|
302
275
|
});
|
|
303
276
|
await Promise.all(promises);
|
|
@@ -307,18 +280,18 @@ class Executor {
|
|
|
307
280
|
const opsWithHashes = ops.map((op) => {
|
|
308
281
|
return {
|
|
309
282
|
mempoolUserOperation: op,
|
|
310
|
-
userOperationHash:
|
|
283
|
+
userOperationHash: getUserOperationHash(op, entryPoint, this.walletClient.chain.id)
|
|
311
284
|
};
|
|
312
285
|
});
|
|
313
286
|
const isUserOpVersion06 = opsWithHashes.reduce((acc, op) => {
|
|
314
287
|
if (acc !==
|
|
315
|
-
|
|
288
|
+
isVersion06(op.mempoolUserOperation)) {
|
|
316
289
|
throw new Error("All user operations must be of the same version");
|
|
317
290
|
}
|
|
318
291
|
return acc;
|
|
319
|
-
},
|
|
320
|
-
const ep =
|
|
321
|
-
abi: isUserOpVersion06 ?
|
|
292
|
+
}, isVersion06(opsWithHashes[0].mempoolUserOperation));
|
|
293
|
+
const ep = getContract({
|
|
294
|
+
abi: isUserOpVersion06 ? EntryPointV06Abi : EntryPointV07Abi,
|
|
322
295
|
address: entryPoint,
|
|
323
296
|
client: {
|
|
324
297
|
public: this.publicClient,
|
|
@@ -341,7 +314,7 @@ class Executor {
|
|
|
341
314
|
ep,
|
|
342
315
|
type: "default"
|
|
343
316
|
};
|
|
344
|
-
let { gasLimit, simulatedOps, resubmitAllOps } = await
|
|
317
|
+
let { gasLimit, simulatedOps, resubmitAllOps } = await filterOpsAndEstimateGas(entryPoint, callContext, wallet, opsWithHashes, nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, "pending", this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, childLogger);
|
|
345
318
|
gasLimit += 10000n;
|
|
346
319
|
if (resubmitAllOps) {
|
|
347
320
|
this.markWalletProcessed(wallet);
|
|
@@ -352,7 +325,7 @@ class Executor {
|
|
|
352
325
|
entryPoint,
|
|
353
326
|
userOpHash: owh.userOperationHash,
|
|
354
327
|
userOperation: owh.mempoolUserOperation,
|
|
355
|
-
reason:
|
|
328
|
+
reason: FeeCapTooLowError.name
|
|
356
329
|
}
|
|
357
330
|
};
|
|
358
331
|
return bundleResult;
|
|
@@ -367,7 +340,6 @@ class Executor {
|
|
|
367
340
|
error: {
|
|
368
341
|
entryPoint,
|
|
369
342
|
userOpHash: owh.userOperationHash,
|
|
370
|
-
userOperation: owh.mempoolUserOperation,
|
|
371
343
|
reason: "INTERNAL FAILURE"
|
|
372
344
|
}
|
|
373
345
|
};
|
|
@@ -382,7 +354,6 @@ class Executor {
|
|
|
382
354
|
error: {
|
|
383
355
|
entryPoint,
|
|
384
356
|
userOpHash: op.owh.userOperationHash,
|
|
385
|
-
userOperation: op.owh.mempoolUserOperation,
|
|
386
357
|
reason: op.reason
|
|
387
358
|
}
|
|
388
359
|
};
|
|
@@ -417,7 +388,7 @@ class Executor {
|
|
|
417
388
|
...gasOptions
|
|
418
389
|
})
|
|
419
390
|
: await ep.write.handleOps([
|
|
420
|
-
opsWithHashToBundle.map((owh) =>
|
|
391
|
+
opsWithHashToBundle.map((owh) => toPackedUserOperation(owh.mempoolUserOperation)),
|
|
421
392
|
wallet.address
|
|
422
393
|
], {
|
|
423
394
|
account: wallet,
|
|
@@ -427,8 +398,8 @@ class Executor {
|
|
|
427
398
|
});
|
|
428
399
|
}
|
|
429
400
|
catch (err) {
|
|
430
|
-
const e =
|
|
431
|
-
if (e instanceof
|
|
401
|
+
const e = parseViemError(err);
|
|
402
|
+
if (e instanceof InsufficientFundsError) {
|
|
432
403
|
childLogger.error({ error: e }, "insufficient funds, not submitting transaction");
|
|
433
404
|
this.markWalletProcessed(wallet);
|
|
434
405
|
return opsWithHashToBundle.map((owh) => {
|
|
@@ -438,7 +409,7 @@ class Executor {
|
|
|
438
409
|
entryPoint,
|
|
439
410
|
userOpHash: owh.userOperationHash,
|
|
440
411
|
userOperation: owh.mempoolUserOperation,
|
|
441
|
-
reason:
|
|
412
|
+
reason: InsufficientFundsError.name
|
|
442
413
|
}
|
|
443
414
|
};
|
|
444
415
|
});
|
|
@@ -452,7 +423,6 @@ class Executor {
|
|
|
452
423
|
error: {
|
|
453
424
|
entryPoint,
|
|
454
425
|
userOpHash: owh.userOperationHash,
|
|
455
|
-
userOperation: owh.mempoolUserOperation,
|
|
456
426
|
reason: "INTERNAL FAILURE"
|
|
457
427
|
}
|
|
458
428
|
};
|
|
@@ -477,7 +447,7 @@ class Executor {
|
|
|
477
447
|
account: wallet,
|
|
478
448
|
to: ep.address,
|
|
479
449
|
data: isUserOpVersion06
|
|
480
|
-
?
|
|
450
|
+
? encodeFunctionData({
|
|
481
451
|
abi: ep.abi,
|
|
482
452
|
functionName: "handleOps",
|
|
483
453
|
args: [
|
|
@@ -485,11 +455,11 @@ class Executor {
|
|
|
485
455
|
wallet.address
|
|
486
456
|
]
|
|
487
457
|
})
|
|
488
|
-
:
|
|
458
|
+
: encodeFunctionData({
|
|
489
459
|
abi: ep.abi,
|
|
490
460
|
functionName: "handleOps",
|
|
491
461
|
args: [
|
|
492
|
-
opsWithHashToBundle.map((owh) =>
|
|
462
|
+
opsWithHashToBundle.map((owh) => toPackedUserOperation(owh.mempoolUserOperation)),
|
|
493
463
|
wallet.address
|
|
494
464
|
]
|
|
495
465
|
}),
|
|
@@ -505,7 +475,7 @@ class Executor {
|
|
|
505
475
|
firstSubmitted: Date.now(),
|
|
506
476
|
timesPotentiallyIncluded: 0
|
|
507
477
|
};
|
|
508
|
-
const userOperationResults =
|
|
478
|
+
const userOperationResults = simulatedOpsToResults(simulatedOps, transactionInfo);
|
|
509
479
|
childLogger.info({
|
|
510
480
|
transactionRequest: {
|
|
511
481
|
...transactionInfo.transactionRequest,
|
|
@@ -537,10 +507,10 @@ class Executor {
|
|
|
537
507
|
perOpInflatorId: compressionHandler.perOpInflatorId,
|
|
538
508
|
type: "compressed"
|
|
539
509
|
};
|
|
540
|
-
let { gasLimit, simulatedOps, resubmitAllOps } = await
|
|
510
|
+
let { gasLimit, simulatedOps, resubmitAllOps } = await filterOpsAndEstimateGas(entryPoint, callContext, wallet, compressedOps.map((compressedOp) => {
|
|
541
511
|
return {
|
|
542
512
|
mempoolUserOperation: compressedOp,
|
|
543
|
-
userOperationHash:
|
|
513
|
+
userOperationHash: getUserOperationHash(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id)
|
|
544
514
|
};
|
|
545
515
|
}), nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, "pending", this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, childLogger);
|
|
546
516
|
gasLimit += 10000n;
|
|
@@ -551,9 +521,9 @@ class Executor {
|
|
|
551
521
|
status: "resubmit",
|
|
552
522
|
info: {
|
|
553
523
|
entryPoint,
|
|
554
|
-
userOpHash:
|
|
524
|
+
userOpHash: getUserOperationHash(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id),
|
|
555
525
|
userOperation: compressedOp,
|
|
556
|
-
reason:
|
|
526
|
+
reason: FeeCapTooLowError.name
|
|
557
527
|
}
|
|
558
528
|
};
|
|
559
529
|
});
|
|
@@ -566,8 +536,7 @@ class Executor {
|
|
|
566
536
|
status: "failure",
|
|
567
537
|
error: {
|
|
568
538
|
entryPoint,
|
|
569
|
-
userOpHash:
|
|
570
|
-
userOperation: compressedOp,
|
|
539
|
+
userOpHash: getUserOperationHash(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id),
|
|
571
540
|
reason: "INTERNAL FAILURE"
|
|
572
541
|
}
|
|
573
542
|
};
|
|
@@ -583,7 +552,6 @@ class Executor {
|
|
|
583
552
|
error: {
|
|
584
553
|
entryPoint,
|
|
585
554
|
userOpHash: simulatedOp.owh.userOperationHash,
|
|
586
|
-
userOperation: simulatedOp.owh.mempoolUserOperation,
|
|
587
555
|
reason: simulatedOp.reason
|
|
588
556
|
}
|
|
589
557
|
};
|
|
@@ -606,7 +574,7 @@ class Executor {
|
|
|
606
574
|
txHash = await this.walletClient.sendTransaction({
|
|
607
575
|
account: wallet,
|
|
608
576
|
to: compressionHandler.bundleBulkerAddress,
|
|
609
|
-
data:
|
|
577
|
+
data: createCompressedCalldata(compressedOps, compressionHandler.perOpInflatorId),
|
|
610
578
|
gas: gasLimit,
|
|
611
579
|
nonce: nonce,
|
|
612
580
|
...gasOptions
|
|
@@ -622,7 +590,6 @@ class Executor {
|
|
|
622
590
|
error: {
|
|
623
591
|
entryPoint,
|
|
624
592
|
userOpHash: op.userOperationHash,
|
|
625
|
-
userOperation: op.mempoolUserOperation,
|
|
626
593
|
reason: "INTERNAL FAILURE"
|
|
627
594
|
}
|
|
628
595
|
};
|
|
@@ -645,7 +612,7 @@ class Executor {
|
|
|
645
612
|
previousTransactionHashes: [],
|
|
646
613
|
transactionRequest: {
|
|
647
614
|
to: compressionHandler.bundleBulkerAddress,
|
|
648
|
-
data:
|
|
615
|
+
data: createCompressedCalldata(compressedOps, compressionHandler.perOpInflatorId),
|
|
649
616
|
gas: gasLimit,
|
|
650
617
|
account: wallet,
|
|
651
618
|
chain: this.walletClient.chain,
|
|
@@ -659,7 +626,7 @@ class Executor {
|
|
|
659
626
|
firstSubmitted: Date.now(),
|
|
660
627
|
timesPotentiallyIncluded: 0
|
|
661
628
|
};
|
|
662
|
-
const userOperationResults =
|
|
629
|
+
const userOperationResults = simulatedOpsToResults(simulatedOps, transactionInfo);
|
|
663
630
|
childLogger.info({
|
|
664
631
|
txHash,
|
|
665
632
|
opHashes: opsToBundle.map((owh) => owh.userOperationHash)
|
|
@@ -667,5 +634,4 @@ class Executor {
|
|
|
667
634
|
return userOperationResults;
|
|
668
635
|
}
|
|
669
636
|
}
|
|
670
|
-
exports.Executor = Executor;
|
|
671
637
|
//# sourceMappingURL=executor.js.map
|