@@ -12,13 +12,6 @@ export type RundlerParameters = {
12
12
*/
13
13
binary ?: string
14
14
15
- /**
16
- * The version of the entrypoint to use
17
- *
18
- * @default 0.6.0
19
- */
20
- entryPointVersion ?: '0.6.0' | '0.7.0'
21
-
22
15
/**
23
16
* Network to look up a hardcoded chain spec.
24
17
* @default dev
@@ -30,6 +23,13 @@ export type RundlerParameters = {
30
23
*/
31
24
chainSpec ?: string
32
25
26
+ /**
27
+ * Allows overriding the chain id for a given chain spec
28
+ *
29
+ * @default unset
30
+ */
31
+ chainId ?: number | undefined
32
+
33
33
/**
34
34
* EVM Node HTTP URL to use.
35
35
*
@@ -90,7 +90,10 @@ export type RundlerParameters = {
90
90
* Possible values are base_fee_percent and priority_fee_increase_percent.
91
91
* @default priority_fee_increase_percent
92
92
*/
93
- priorityFeeModeKind ?: 'base_fee_percent' | 'priority_fee_increase_percent'
93
+ priorityFeeModeKind ?:
94
+ | 'base_fee_percent'
95
+ | 'priority_fee_increase_percent'
96
+ | undefined
94
97
95
98
/**
96
99
* Priority fee mode value.
@@ -129,6 +132,31 @@ export type RundlerParameters = {
129
132
*/
130
133
mempoolConfigPath ?: string
131
134
135
+ /**
136
+ * Disables entry point version v0.6.
137
+ * @default false
138
+ */
139
+ disableEntryPointV0_6 ?: boolean
140
+
141
+ /**
142
+ * The number of builder accounts to use for entry point version v0.6.
143
+ *
144
+ * @default 1
145
+ */
146
+ numBuildersV0_6 ?: number
147
+
148
+ /**
149
+ * Disables entry point version v0.7.
150
+ * @default false
151
+ */
152
+ disableEntryPointV0_7 ?: boolean
153
+
154
+ /**
155
+ * The number of builder accounts to use for entry point version v0.7.
156
+ * @default 1
157
+ */
158
+ numBuildersV0_7 ?: number
159
+
132
160
metrics ?: {
133
161
/**
134
162
* Port to listen on for metrics requests.
@@ -261,18 +289,20 @@ export type RundlerParameters = {
261
289
262
290
builder ?: {
263
291
/**
264
- * Private key to use for signing transactions.
292
+ * Private keys to use for signing transactions.
265
293
* If used with awsKmsKeyIds, then explicitly pass in `null` here.
266
294
*
267
- * @default 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
295
+ * @default [' 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80','0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d']
268
296
*/
269
- privateKey ?: string
297
+ privateKeys ?: string [ ]
270
298
271
299
/**
272
- * AWS KMS key IDs to use for signing transactions (comma-separated).
273
- * Only required if privateKey is not provided.
300
+ * AWS KMS key IDs to use for signing transactions.
301
+ * Only required if privateKeys is not provided.
302
+ *
303
+ * @default null
274
304
*/
275
- awsKmsKeyIds ?: string
305
+ awsKmsKeyIds ?: string [ ]
276
306
277
307
/**
278
308
* Redis URI to use for KMS leasing.
@@ -304,9 +334,21 @@ export type RundlerParameters = {
304
334
/**
305
335
* Choice of what sender type to use for transaction submission.
306
336
* @default raw
307
- * options: raw, conditional, flashbots, polygon_bloxroute
337
+ * options: raw, flashbots, polygon_bloxroute
338
+ */
339
+ sender ?: 'raw' | 'flashbots' | 'polygonBloxroute' | undefined
340
+
341
+ /**
342
+ * Use the submit URL for transaction status checks.
343
+ * @default false
344
+ */
345
+ useSubmitForStatus ?: boolean | undefined
346
+
347
+ /**
348
+ * If the sender supports the 'dropped' status. Many senders do not support this status, and only support 'pending' or 'mined'.
349
+ * @default false
308
350
*/
309
- sender ?: 'raw' | 'conditional' | 'flashbots' | 'polygonBloxroute'
351
+ droppedStatusUnsupported ?: boolean | undefined
310
352
311
353
/**
312
354
* After submitting a bundle transaction, the maximum number of blocks to wait for that transaction to mine before trying to resend with higher gas fees.
@@ -321,11 +363,16 @@ export type RundlerParameters = {
321
363
replacementFeePercentIncrease ?: number
322
364
323
365
/**
324
- * Maximum number of fee increases to attempt.
325
- * Seven increases of 10% is roughly 2x the initial fees.
326
- * @default 7
366
+ * Maximum number of fee increases to attempt during a cancellation.
367
+ * @default 15
327
368
*/
328
- maxFeeIncreases ?: number
369
+ maxCancellationFeeIncreases ?: number | undefined
370
+
371
+ /**
372
+ * The maximum number of blocks to spend in a replacement underpriced state before issuing a transaction cancellation.
373
+ * @default 20
374
+ */
375
+ maxReplacementUnderpricedBlocks ?: number | undefined
329
376
330
377
/**
331
378
* Additional builders to send bundles to through the Flashbots relay RPC (comma-separated).
@@ -353,6 +400,13 @@ export type RundlerParameters = {
353
400
*/
354
401
indexOffset ?: number
355
402
}
403
+
404
+ /**
405
+ * Log level for the Rundler binary.
406
+ *
407
+ * @default "debug"
408
+ */
409
+ logLevel ?: 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'off' | undefined
356
410
}
357
411
358
412
/**
@@ -370,8 +424,12 @@ export type RundlerParameters = {
370
424
* ```
371
425
*/
372
426
export const rundler = defineInstance ( ( parameters ?: RundlerParameters ) => {
373
- const { binary = 'rundler' , ...args } = ( parameters ??
374
- { } ) as RundlerParameters
427
+ const {
428
+ binary = 'rundler' ,
429
+ logLevel = 'debug' ,
430
+ chainId,
431
+ ...args
432
+ } = ( parameters ?? { } ) as RundlerParameters
375
433
376
434
const host = '127.0.0.1'
377
435
const name = 'rundler'
@@ -392,11 +450,11 @@ export const rundler = defineInstance((parameters?: RundlerParameters) => {
392
450
...args ,
393
451
builder : {
394
452
...args . builder ,
395
- privateKey :
396
- args . builder ?. privateKey ??
453
+ privateKeys : args . builder ?. privateKeys ?? [
397
454
'0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' ,
455
+ '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d' ,
456
+ ] ,
398
457
} ,
399
- entryPointVersion : undefined ,
400
458
maxVerificationGas : args . maxVerificationGas ?? 10000000 ,
401
459
network : args . network ?? 'dev' ,
402
460
nodeHttp : args . nodeHttp ?? 'http://localhost:8545' ,
@@ -413,23 +471,15 @@ export const rundler = defineInstance((parameters?: RundlerParameters) => {
413
471
args . userOperationEventBlockDistance ?? 100 ,
414
472
} satisfies RundlerParameters
415
473
416
- const entrypointArgs = ( ( ) => {
417
- if ( args . entryPointVersion === '0.6.0' )
418
- return [ '--disable_entry_point_v0_7' ]
419
- return [ '--disable_entry_point_v0_6' ]
420
- } ) ( )
421
-
422
474
return await process . start (
423
475
( $ ) =>
424
- $ (
425
- binary ,
426
- [ 'node' , ...toArgs ( args_ , { casing : 'snake' } ) , ...entrypointArgs ] ,
427
- {
428
- env : {
429
- RUST_LOG : 'debug' ,
430
- } ,
476
+ $ ( binary , [ 'node' , ...toArgs ( args_ , { casing : 'snake' } ) ] , {
477
+ env : {
478
+ RUST_LOG : logLevel ,
479
+ // CHAIN_* overrides for a chain spec can only be set via env vars
480
+ ...( chainId != null ? { CHAIN_ID : chainId . toString ( ) } : { } ) ,
431
481
} ,
432
- ) ,
482
+ } ) ,
433
483
{
434
484
...options ,
435
485
resolver ( { process, reject, resolve } ) {
0 commit comments