-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rundler): add support for Rundler v0.3.0 #24
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,13 +12,6 @@ export type RundlerParameters = { | |||||
*/ | ||||||
binary?: string | ||||||
|
||||||
/** | ||||||
* The version of the entrypoint to use | ||||||
* | ||||||
* @default 0.6.0 | ||||||
*/ | ||||||
entryPointVersion?: '0.6.0' | '0.7.0' | ||||||
|
||||||
/** | ||||||
* Network to look up a hardcoded chain spec. | ||||||
* @default dev | ||||||
|
@@ -129,6 +122,31 @@ export type RundlerParameters = { | |||||
*/ | ||||||
mempoolConfigPath?: string | ||||||
|
||||||
/** | ||||||
* Disables entry point version v0.6. | ||||||
* @default false | ||||||
*/ | ||||||
disableEntryPointV0_6?: boolean | ||||||
|
||||||
/** | ||||||
* The number of builder accounts to use for entry point version v0.6. | ||||||
* | ||||||
* @default 1 | ||||||
*/ | ||||||
numBuildersV0_6?: number | ||||||
|
||||||
/** | ||||||
* Disables entry point version v0.7. | ||||||
* @default false | ||||||
*/ | ||||||
disableEntryPointV0_7?: boolean | ||||||
|
||||||
/** | ||||||
* The number of builder accounts to use for entry point version v0.7. | ||||||
* @default 1 | ||||||
*/ | ||||||
numBuildersV0_7?: number | ||||||
|
||||||
metrics?: { | ||||||
/** | ||||||
* Port to listen on for metrics requests. | ||||||
|
@@ -261,18 +279,20 @@ export type RundlerParameters = { | |||||
|
||||||
builder?: { | ||||||
/** | ||||||
* Private key to use for signing transactions. | ||||||
* Private keys to use for signing transactions. | ||||||
* If used with awsKmsKeyIds, then explicitly pass in `null` here. | ||||||
* | ||||||
* @default 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | ||||||
* @default ['0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80','0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d'] | ||||||
*/ | ||||||
privateKey?: string | ||||||
privateKeys?: string[] | ||||||
|
||||||
/** | ||||||
* AWS KMS key IDs to use for signing transactions (comma-separated). | ||||||
* Only required if privateKey is not provided. | ||||||
* AWS KMS key IDs to use for signing transactions. | ||||||
* Only required if privateKeys is not provided. | ||||||
* | ||||||
* @default null | ||||||
*/ | ||||||
awsKmsKeyIds?: string | ||||||
awsKmsKeyIds?: string[] | ||||||
|
||||||
/** | ||||||
* Redis URI to use for KMS leasing. | ||||||
|
@@ -304,9 +324,21 @@ export type RundlerParameters = { | |||||
/** | ||||||
* Choice of what sender type to use for transaction submission. | ||||||
* @default raw | ||||||
* options: raw, conditional, flashbots, polygon_bloxroute | ||||||
* options: raw, flashbots, polygon_bloxroute | ||||||
*/ | ||||||
sender?: 'raw' | 'flashbots' | 'polygonBloxroute' | ||||||
|
||||||
/** | ||||||
* Use the submit URL for transaction status checks. | ||||||
* @default false | ||||||
*/ | ||||||
use_submit_for_status?: boolean | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
These should automatically be converted to snake_case at runtime. |
||||||
|
||||||
/** | ||||||
* If the sender supports the 'dropped' status. Many senders do not support this status, and only support 'pending' or 'mined'. | ||||||
* @default false | ||||||
*/ | ||||||
sender?: 'raw' | 'conditional' | 'flashbots' | 'polygonBloxroute' | ||||||
dropped_status_unsupported?: boolean | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
/** | ||||||
* 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 +353,16 @@ export type RundlerParameters = { | |||||
replacementFeePercentIncrease?: number | ||||||
|
||||||
/** | ||||||
* Maximum number of fee increases to attempt. | ||||||
* Seven increases of 10% is roughly 2x the initial fees. | ||||||
* @default 7 | ||||||
* Maximum number of fee increases to attempt during a cancellation. | ||||||
* @default 15 | ||||||
*/ | ||||||
maxFeeIncreases?: number | ||||||
maxCancellationFeeIncreases?: number | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
/** | ||||||
* The maximum number of blocks to spend in a replacement underpriced state before issuing a transaction cancellation. | ||||||
* @default 20 | ||||||
*/ | ||||||
maxReplacementUnderpricedBlocks?: number | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
/** | ||||||
* Additional builders to send bundles to through the Flashbots relay RPC (comma-separated). | ||||||
|
@@ -392,11 +429,11 @@ export const rundler = defineInstance((parameters?: RundlerParameters) => { | |||||
...args, | ||||||
builder: { | ||||||
...args.builder, | ||||||
privateKey: | ||||||
args.builder?.privateKey ?? | ||||||
privateKeys: args.builder?.privateKeys ?? [ | ||||||
'0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', | ||||||
'0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', | ||||||
], | ||||||
}, | ||||||
entryPointVersion: undefined, | ||||||
maxVerificationGas: args.maxVerificationGas ?? 10000000, | ||||||
network: args.network ?? 'dev', | ||||||
nodeHttp: args.nodeHttp ?? 'http://localhost:8545', | ||||||
|
@@ -413,23 +450,13 @@ export const rundler = defineInstance((parameters?: RundlerParameters) => { | |||||
args.userOperationEventBlockDistance ?? 100, | ||||||
} satisfies RundlerParameters | ||||||
|
||||||
const entrypointArgs = (() => { | ||||||
if (args.entryPointVersion === '0.6.0') | ||||||
return ['--disable_entry_point_v0_7'] | ||||||
return ['--disable_entry_point_v0_6'] | ||||||
})() | ||||||
|
||||||
return await process.start( | ||||||
($) => | ||||||
$( | ||||||
binary, | ||||||
['node', ...toArgs(args_, { casing: 'snake' }), ...entrypointArgs], | ||||||
{ | ||||||
env: { | ||||||
RUST_LOG: 'debug', | ||||||
}, | ||||||
$(binary, ['node', ...toArgs(args_, { casing: 'snake' })], { | ||||||
env: { | ||||||
RUST_LOG: 'debug', | ||||||
}, | ||||||
), | ||||||
}), | ||||||
{ | ||||||
...options, | ||||||
resolver({ process, reject, resolve }) { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.