From 7626e8a8cd88100f6cc3eaa233204e5fc6b921e1 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 22:40:15 +0000 Subject: [PATCH 1/5] Bumping sdk and jit dependencies to 2.53.0-beta.2 and 0.10.155 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ebc7dd52..2dee4506 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "lib/index.js", "license": "Apache-2.0", "dependencies": { - "@drift-labs/jit-proxy": "0.10.154", - "@drift-labs/sdk": "2.53.0-beta.1", + "@drift-labs/jit-proxy": "0.10.155", + "@drift-labs/sdk": "2.53.0-beta.2", "@opentelemetry/api": "^1.1.0", "@opentelemetry/auto-instrumentations-node": "^0.31.1", "@opentelemetry/exporter-prometheus": "^0.31.0", From d1dfea0885dc406d0a6f82301fb26f1e8893a4e9 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 26 Dec 2023 17:34:18 -0800 Subject: [PATCH 2/5] configurable txSenderType --- src/config.ts | 1 + src/index.ts | 34 ++++++++++++++++++++++------------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/config.ts b/src/config.ts index a5409c03..5ba4da19 100644 --- a/src/config.ts +++ b/src/config.ts @@ -85,6 +85,7 @@ export interface GlobalConfig { jitoBlockEngineUrl?: string; jitoAuthPrivateKey?: string; txRetryTimeoutMs?: number; + txSenderType?: 'fast' | 'retry'; } export interface Config { diff --git a/src/index.ts b/src/index.ts index e739c6b5..a46a1a0a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -149,6 +149,10 @@ program '--event-susbcriber', 'Explicitly intialize an eventSubscriber (RPC heavy' ) + .option( + '--tx-sender-type ', + 'Choose tx sender type, options are: fast, retry' + ) .parse(); const opts = program.opts(); @@ -263,18 +267,24 @@ const runBot = async () => { commitment: stateCommitment, disableRetryOnRateLimit: true, }); - // const txSender = new FastSingleTxSender({ - // connection: sendTxConnection, - // blockhashRefreshInterval: 10_000, - // wallet, - // opts, - // }); - const txSender = new RetryTxSender({ - connection: sendTxConnection, - wallet, - opts, - timeout: 3000, - }); + + const txSenderType = config.global.txSenderType || 'fast'; + let txSender; + if (txSenderType === 'retry') { + txSender = new RetryTxSender({ + connection: sendTxConnection, + wallet, + opts, + timeout: 3000, + }); + } else { + txSender = new FastSingleTxSender({ + connection: sendTxConnection, + blockhashRefreshInterval: 1000, + wallet, + opts, + }); + } /** * Creating and subscribing to the drift client From a4797a7125b19357c9d3c34ee584e45ef1850bdd Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 26 Dec 2023 17:36:05 -0800 Subject: [PATCH 3/5] Revert "configurable txSenderType" This reverts commit d1dfea0885dc406d0a6f82301fb26f1e8893a4e9. --- src/config.ts | 1 - src/index.ts | 34 ++++++++++++---------------------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/config.ts b/src/config.ts index 5ba4da19..a5409c03 100644 --- a/src/config.ts +++ b/src/config.ts @@ -85,7 +85,6 @@ export interface GlobalConfig { jitoBlockEngineUrl?: string; jitoAuthPrivateKey?: string; txRetryTimeoutMs?: number; - txSenderType?: 'fast' | 'retry'; } export interface Config { diff --git a/src/index.ts b/src/index.ts index a46a1a0a..e739c6b5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -149,10 +149,6 @@ program '--event-susbcriber', 'Explicitly intialize an eventSubscriber (RPC heavy' ) - .option( - '--tx-sender-type ', - 'Choose tx sender type, options are: fast, retry' - ) .parse(); const opts = program.opts(); @@ -267,24 +263,18 @@ const runBot = async () => { commitment: stateCommitment, disableRetryOnRateLimit: true, }); - - const txSenderType = config.global.txSenderType || 'fast'; - let txSender; - if (txSenderType === 'retry') { - txSender = new RetryTxSender({ - connection: sendTxConnection, - wallet, - opts, - timeout: 3000, - }); - } else { - txSender = new FastSingleTxSender({ - connection: sendTxConnection, - blockhashRefreshInterval: 1000, - wallet, - opts, - }); - } + // const txSender = new FastSingleTxSender({ + // connection: sendTxConnection, + // blockhashRefreshInterval: 10_000, + // wallet, + // opts, + // }); + const txSender = new RetryTxSender({ + connection: sendTxConnection, + wallet, + opts, + timeout: 3000, + }); /** * Creating and subscribing to the drift client From ce5540f52786cd12df19a6506f234076b8523215 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 26 Dec 2023 17:34:18 -0800 Subject: [PATCH 4/5] configurable txSenderType --- src/config.ts | 1 + src/index.ts | 34 ++++++++++++++++++++++------------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/config.ts b/src/config.ts index a5409c03..5ba4da19 100644 --- a/src/config.ts +++ b/src/config.ts @@ -85,6 +85,7 @@ export interface GlobalConfig { jitoBlockEngineUrl?: string; jitoAuthPrivateKey?: string; txRetryTimeoutMs?: number; + txSenderType?: 'fast' | 'retry'; } export interface Config { diff --git a/src/index.ts b/src/index.ts index e739c6b5..a46a1a0a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -149,6 +149,10 @@ program '--event-susbcriber', 'Explicitly intialize an eventSubscriber (RPC heavy' ) + .option( + '--tx-sender-type ', + 'Choose tx sender type, options are: fast, retry' + ) .parse(); const opts = program.opts(); @@ -263,18 +267,24 @@ const runBot = async () => { commitment: stateCommitment, disableRetryOnRateLimit: true, }); - // const txSender = new FastSingleTxSender({ - // connection: sendTxConnection, - // blockhashRefreshInterval: 10_000, - // wallet, - // opts, - // }); - const txSender = new RetryTxSender({ - connection: sendTxConnection, - wallet, - opts, - timeout: 3000, - }); + + const txSenderType = config.global.txSenderType || 'fast'; + let txSender; + if (txSenderType === 'retry') { + txSender = new RetryTxSender({ + connection: sendTxConnection, + wallet, + opts, + timeout: 3000, + }); + } else { + txSender = new FastSingleTxSender({ + connection: sendTxConnection, + blockhashRefreshInterval: 1000, + wallet, + opts, + }); + } /** * Creating and subscribing to the drift client From 9721f3ddbfc114296020fe182b585c38c74d29e6 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 26 Dec 2023 17:46:00 -0800 Subject: [PATCH 5/5] default to retry --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index a46a1a0a..01294773 100644 --- a/src/index.ts +++ b/src/index.ts @@ -268,7 +268,7 @@ const runBot = async () => { disableRetryOnRateLimit: true, }); - const txSenderType = config.global.txSenderType || 'fast'; + const txSenderType = config.global.txSenderType || 'retry'; let txSender; if (txSenderType === 'retry') { txSender = new RetryTxSender({