@haven-fi/solauto-sdk 1.0.741 → 1.0.743
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/dist/services/transactions/manager/transactionsManager.d.ts +1 -0
- package/dist/services/transactions/manager/transactionsManager.d.ts.map +1 -1
- package/dist/services/transactions/manager/transactionsManager.js +39 -33
- package/dist/services/transactions/transactionUtils.d.ts.map +1 -1
- package/dist/services/transactions/transactionUtils.js +0 -1
- package/dist/utils/jitoUtils.d.ts.map +1 -1
- package/dist/utils/jitoUtils.js +1 -2
- package/dist/utils/solanaUtils.d.ts.map +1 -1
- package/dist/utils/solanaUtils.js +0 -4
- package/package.json +1 -1
- package/src/services/transactions/manager/transactionsManager.ts +133 -120
- package/src/services/transactions/transactionUtils.ts +0 -1
- package/src/utils/jitoUtils.ts +1 -2
- package/src/utils/solanaUtils.ts +0 -4
@@ -60,6 +60,7 @@ export declare class TransactionsManager<T extends TxHandler> {
|
|
60
60
|
send(items: TransactionItem[]): Promise<TransactionManagerStatuses>;
|
61
61
|
private shouldProceedToSend;
|
62
62
|
private getTrueAttemptNum;
|
63
|
+
private sendJitoBundle;
|
63
64
|
private processTransactionsAtomically;
|
64
65
|
private processTransactionSet;
|
65
66
|
private refreshItemSets;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../../../src/services/transactions/manager/transactionsManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAElB,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,aAAa,EAId,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAkB,MAAM,UAAU,CAAC;AAEzE,qBAAa,wBAAyB,SAAQ,KAAK;gBAC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AAC,UAAU,EAAE,OAAO,CAAC;IAC9B,SAAS,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;IACxC,SAAS,CAAC,QAAQ,EAAE,0BAA0B,CAAM;IACpD,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IACrC,SAAS,CAAC,eAAe,EAAE,MAAM,CAAC;IAClC,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC;IAE5C,kBAAkB,SAAmB;gBAEzB,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC;YAoB9B,uBAAuB;IA0CrC,OAAO,CAAC,YAAY;
|
1
|
+
{"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../../../src/services/transactions/manager/transactionsManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAElB,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,aAAa,EAId,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAkB,MAAM,UAAU,CAAC;AAEzE,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAED,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC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SAAmB;gBAEzB,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC;YAoB9B,uBAAuB;IA0CrC,OAAO,CAAC,YAAY;YA+BN,aAAa;IAoB3B,SAAS,CAAC,4BAA4B,CACpC,SAAS,EAAE,KAAK,GAAG,SAAS,EAC5B,UAAU,EAAE,MAAM;IAcpB,OAAO,CAAC,mBAAmB;IAkBd,IAAI,CACf,KAAK,EAAE,eAAe,EAAE,GACvB,OAAO,CAAC,0BAA0B,CAAC;IAiCtC,OAAO,CAAC,mBAAmB;IAuB3B,OAAO,CAAC,iBAAiB;YAWX,cAAc;YA8Gd,6BAA6B;YA6C7B,qBAAqB;YAwDrB,eAAe;cAkDb,eAAe,CAC7B,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,kBAAkB,CAAC,EAAE,kBAAkB,EACvC,SAAS,CAAC,EAAE,kBAAkB;CAgEjC"}
|
@@ -76,7 +76,7 @@ class TransactionsManager {
|
|
76
76
|
}
|
77
77
|
return transactionSets;
|
78
78
|
}
|
79
|
-
updateStatus(args) {
|
79
|
+
updateStatus(args, reset) {
|
80
80
|
if (!this.statuses.filter((x) => x.name === args.name)) {
|
81
81
|
this.statuses.push(args);
|
82
82
|
}
|
@@ -88,12 +88,14 @@ class TransactionsManager {
|
|
88
88
|
if (args.simulationSuccessful) {
|
89
89
|
this.statuses[idx].simulationSuccessful = args.simulationSuccessful;
|
90
90
|
}
|
91
|
-
// else if (status === TransactionStatus.Queued || status === TransactionStatus.Processing) {
|
92
|
-
// this.statuses[idx].simulationSuccessful = undefined;
|
93
|
-
// }
|
94
91
|
if (args.moreInfo) {
|
95
92
|
this.statuses[idx].moreInfo = args.moreInfo;
|
96
93
|
}
|
94
|
+
if (reset) {
|
95
|
+
this.statuses[idx].txSig = undefined;
|
96
|
+
this.statuses[idx].simulationSuccessful = undefined;
|
97
|
+
this.statuses[idx].moreInfo = undefined;
|
98
|
+
}
|
97
99
|
}
|
98
100
|
else {
|
99
101
|
this.statuses.push(args);
|
@@ -124,13 +126,13 @@ class TransactionsManager {
|
|
124
126
|
}
|
125
127
|
return this.priorityFeeSetting;
|
126
128
|
}
|
127
|
-
updateStatusForSets(itemSets, args, txSigs) {
|
129
|
+
updateStatusForSets(itemSets, args, txSigs, reset) {
|
128
130
|
itemSets.forEach((itemSet, i) => {
|
129
131
|
this.updateStatus({
|
130
132
|
name: itemSet.name(),
|
131
133
|
txSig: txSigs && txSigs.length > i ? txSigs[i] : undefined,
|
132
134
|
...args,
|
133
|
-
});
|
135
|
+
}, reset);
|
134
136
|
});
|
135
137
|
}
|
136
138
|
async send(items) {
|
@@ -185,30 +187,9 @@ class TransactionsManager {
|
|
185
187
|
?.length;
|
186
188
|
return attemptNum;
|
187
189
|
}
|
188
|
-
async
|
189
|
-
let attemptNum = 0;
|
190
|
+
async sendJitoBundle(itemSets, attemptNum) {
|
190
191
|
let transactions = [];
|
191
|
-
|
192
|
-
if (prevError &&
|
193
|
-
this.statuses.filter((x) => x.simulationSuccessful).length >
|
194
|
-
this.signableRetries) {
|
195
|
-
throw prevError;
|
196
|
-
}
|
197
|
-
attemptNum = Math.max(...itemSets.map((x) => this.getTrueAttemptNum(x?.name() ?? "")));
|
198
|
-
this.priorityFeeSetting = this.getUpdatedPriorityFeeSetting(prevError, attemptNum);
|
199
|
-
if (retryNum > 0) {
|
200
|
-
const refreshedSets = await this.refreshItemSets(itemSets, attemptNum, prevError);
|
201
|
-
if (!refreshedSets || !refreshedSets.length) {
|
202
|
-
return;
|
203
|
-
}
|
204
|
-
else {
|
205
|
-
itemSets = refreshedSets;
|
206
|
-
}
|
207
|
-
}
|
208
|
-
if (!this.shouldProceedToSend(itemSets, attemptNum)) {
|
209
|
-
return;
|
210
|
-
}
|
211
|
-
transactions = [];
|
192
|
+
try {
|
212
193
|
for (const set of itemSets) {
|
213
194
|
transactions.push(await set.getSingleTransaction());
|
214
195
|
}
|
@@ -223,7 +204,7 @@ class TransactionsManager {
|
|
223
204
|
this.updateStatusForSets(itemSets, {
|
224
205
|
status: TransactionStatus.Processing,
|
225
206
|
attemptNum,
|
226
|
-
});
|
207
|
+
}, undefined, true);
|
227
208
|
for (const itemSet of itemSets) {
|
228
209
|
await this.debugAccounts(itemSet, await itemSet.getSingleTransaction());
|
229
210
|
}
|
@@ -251,7 +232,8 @@ class TransactionsManager {
|
|
251
232
|
throw error ? error : new Error("Unknown error");
|
252
233
|
}
|
253
234
|
this.updateStatusForSets(itemSets, { status: TransactionStatus.Successful, attemptNum }, txSigs);
|
254
|
-
}
|
235
|
+
}
|
236
|
+
catch (e) {
|
255
237
|
this.txHandler.log("Capturing error info...");
|
256
238
|
const errorDetails = (0, transactionUtils_1.getErrorInfo)(this.txHandler.umi, transactions, e, itemSets.filter((x) => this.statuses.find((y) => x.name() === y.name && y.attemptNum === attemptNum)?.simulationSuccessful).length === itemSets.length, this.priorityFeeSetting);
|
257
239
|
const errorString = `${errorDetails.errorName ?? "Unknown error"}: ${errorDetails.errorInfo?.split("\n")[0] ?? "unknown"}`;
|
@@ -269,7 +251,31 @@ class TransactionsManager {
|
|
269
251
|
if (!errorDetails.canBeIgnored) {
|
270
252
|
throw new Error(errorInfo);
|
271
253
|
}
|
272
|
-
}
|
254
|
+
}
|
255
|
+
}
|
256
|
+
async processTransactionsAtomically(itemSets) {
|
257
|
+
await (0, utils_1.retryWithExponentialBackoff)(async (retryNum, prevError) => {
|
258
|
+
if (prevError &&
|
259
|
+
this.statuses.filter((x) => x.simulationSuccessful).length >
|
260
|
+
this.signableRetries) {
|
261
|
+
throw prevError;
|
262
|
+
}
|
263
|
+
const attemptNum = Math.max(...itemSets.map((x) => this.getTrueAttemptNum(x?.name() ?? "")));
|
264
|
+
this.priorityFeeSetting = this.getUpdatedPriorityFeeSetting(prevError, attemptNum);
|
265
|
+
if (retryNum > 0) {
|
266
|
+
const refreshedSets = await this.refreshItemSets(itemSets, attemptNum, prevError);
|
267
|
+
if (!refreshedSets || !refreshedSets.length) {
|
268
|
+
return;
|
269
|
+
}
|
270
|
+
else {
|
271
|
+
itemSets = refreshedSets;
|
272
|
+
}
|
273
|
+
}
|
274
|
+
if (!this.shouldProceedToSend(itemSets, attemptNum)) {
|
275
|
+
return;
|
276
|
+
}
|
277
|
+
await this.sendJitoBundle(itemSets, attemptNum);
|
278
|
+
}, this.totalRetries, this.retryDelay, this.errorsToThrow);
|
273
279
|
}
|
274
280
|
async processTransactionSet(itemSets, currentIndex) {
|
275
281
|
let itemSet = itemSets[currentIndex];
|
@@ -336,7 +342,7 @@ class TransactionsManager {
|
|
336
342
|
name,
|
337
343
|
status: TransactionStatus.Processing,
|
338
344
|
attemptNum,
|
339
|
-
});
|
345
|
+
}, true);
|
340
346
|
try {
|
341
347
|
const txSig = await (0, utils_1.sendSingleOptimizedTransaction)(this.txHandler.umi, this.txHandler.connection, tx, txRunType ?? this.txRunType, priorityFeeSetting, () => this.updateStatus({
|
342
348
|
name,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../../src/services/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAKxE,OAAO,EAIL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAiBlC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AA4BjE,OAAO,EACL,qBAAqB,EAErB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAyLrB,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAyF7B;AA+LD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA0BnD;AAED,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,oBAAoB,EACrC,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAuC5C;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,kBAAkB,EAAE,EACzB,KAAK,EAAE,KAAK,EACZ,oBAAoB,CAAC,EAAE,OAAO,EAC9B,kBAAkB,CAAC,EAAE,kBAAkB;;;;
|
1
|
+
{"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../../src/services/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAKxE,OAAO,EAIL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAiBlC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AA4BjE,OAAO,EACL,qBAAqB,EAErB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAyLrB,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAyF7B;AA+LD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA0BnD;AAED,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,oBAAoB,EACrC,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAuC5C;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,kBAAkB,EAAE,EACzB,KAAK,EAAE,KAAK,EACZ,oBAAoB,CAAC,EAAE,OAAO,EAC9B,kBAAkB,CAAC,EAAE,kBAAkB;;;;EAyHxC;AAED,wBAAgB,cAAc,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,8JAKrE"}
|
@@ -363,7 +363,6 @@ function getErrorInfo(umi, txs, error, simulationSuccessful, priorityFeeSetting)
|
|
363
363
|
else if (typeof error === "object" &&
|
364
364
|
error["InstructionError"]) {
|
365
365
|
const err = error["InstructionError"];
|
366
|
-
(0, utils_1.consoleLog)("err idx details", err[0], getComputeIxs(0), simulationSuccessful, usePriorityFee(priorityFeeSetting));
|
367
366
|
errIxIdx = err[0] - getComputeIxs(0);
|
368
367
|
errCode =
|
369
368
|
typeof err[1] === "object" && "Custom" in err[1]
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAIV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEH,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAgBlE,wBAAgB,mBAAmB,IAAI,SAAS,CAG/C;AAiGD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB;;;;IAkB/D;
|
1
|
+
{"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAIV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEH,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAgBlE,wBAAgB,mBAAmB,IAAI,SAAS,CAG/C;AAiGD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB;;;;IAkB/D;AAqHD,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EAAE,EACtB,YAAY,EAAE,kBAAkB,EAAE,EAClC,MAAM,CAAC,EAAE,kBAAkB,EAC3B,kBAAkB,GAAE,kBAA2C,EAC/D,cAAc,CAAC,EAAE,MAAM,IAAI,EAC3B,eAAe,CAAC,EAAE,eAAe,GAChC,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAyG/B"}
|
package/dist/utils/jitoUtils.js
CHANGED
@@ -134,7 +134,6 @@ async function pollBundleStatus(umi, bundleId, interval = 1000, timeout = 40000)
|
|
134
134
|
await new Promise((resolve) => setTimeout(resolve, interval));
|
135
135
|
const statuses = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => {
|
136
136
|
const resp = await getBundleStatus(umi, bundleId);
|
137
|
-
// TODO: remove me
|
138
137
|
if (resp?.value?.length > 0 && resp.value[0] === null) {
|
139
138
|
throw new Error("No confirmation status");
|
140
139
|
}
|
@@ -197,7 +196,7 @@ async function sendJitoBundledTransactions(umi, connection, userSigner, otherSig
|
|
197
196
|
let builtTxs = [];
|
198
197
|
let simulationResults;
|
199
198
|
if (txType !== "skip-simulation") {
|
200
|
-
builtTxs = await umiToVersionedTransactions(umi, latestBlockhash, userSigner, otherSigners, txs, false, undefined, Array(txs.length).map((_) => 1400000));
|
199
|
+
builtTxs = await umiToVersionedTransactions(umi, latestBlockhash, userSigner, otherSigners, txs, false, undefined, Array(txs.length).fill(null).map((_) => 1400000));
|
201
200
|
simulationResults = await simulateJitoBundle(umi, builtTxs);
|
202
201
|
}
|
203
202
|
const feeEstimates = (0, services_1.usePriorityFee)(priorityFeeSetting)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solanaUtils.d.ts","sourceRoot":"","sources":["../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,sBA2D1B;AAuBD,wBAAsB,6BAA6B,CACjD,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,WAAW,GAAE,MAAW,GACvB,OAAO,CAAC,GAAG,CAAC,CAKd;AAED,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,kBAAkB,EACtB,eAAe,EAAE,kBAAkB,EACnC,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAwC7B;AA+CD,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,kBAAkB,EACtB,MAAM,CAAC,EAAE,kBAAkB,EAC3B,eAAe,GAAE,kBAA2C,EAC5D,cAAc,CAAC,EAAE,MAAM,IAAI,EAC3B,eAAe,CAAC,EAAE,eAAe,GAChC,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAkEjC"}
|
@@ -111,20 +111,16 @@ function addTxOptimizations(umi, tx, computeUnitPrice, computeUnitLimit) {
|
|
111
111
|
const computeLimitIx = computeUnitLimit
|
112
112
|
? setComputeUnitLimitUmiIx(umi.identity, computeUnitLimit)
|
113
113
|
: (0, umi_1.transactionBuilder)();
|
114
|
-
(0, generalUtils_1.consoleLog)("Optimizations:", computeUnitPrice, computeUnitLimit);
|
115
114
|
const allOptimizations = tx.prepend(computePriceIx).prepend(computeLimitIx);
|
116
115
|
const withCuPrice = tx.prepend(computePriceIx);
|
117
116
|
const withCuLimit = tx.prepend(computeLimitIx);
|
118
117
|
if (allOptimizations.fitsInOneTransaction(umi)) {
|
119
|
-
(0, generalUtils_1.consoleLog)("Adding all tx optimizations");
|
120
118
|
return allOptimizations;
|
121
119
|
}
|
122
120
|
else if (withCuPrice.fitsInOneTransaction(umi)) {
|
123
|
-
(0, generalUtils_1.consoleLog)("Adding CU price optimization");
|
124
121
|
return withCuPrice;
|
125
122
|
}
|
126
123
|
else if (withCuLimit.fitsInOneTransaction(umi)) {
|
127
|
-
(0, generalUtils_1.consoleLog)("Adding CU limit optimization");
|
128
124
|
return withCuLimit;
|
129
125
|
}
|
130
126
|
else {
|
package/package.json
CHANGED
@@ -139,7 +139,7 @@ export class TransactionsManager<T extends TxHandler> {
|
|
139
139
|
return transactionSets;
|
140
140
|
}
|
141
141
|
|
142
|
-
private updateStatus(args: TransactionManagerStatus) {
|
142
|
+
private updateStatus(args: TransactionManagerStatus, reset?: boolean) {
|
143
143
|
if (!this.statuses.filter((x) => x.name === args.name)) {
|
144
144
|
this.statuses.push(args);
|
145
145
|
} else {
|
@@ -152,12 +152,14 @@ export class TransactionsManager<T extends TxHandler> {
|
|
152
152
|
if (args.simulationSuccessful) {
|
153
153
|
this.statuses[idx].simulationSuccessful = args.simulationSuccessful;
|
154
154
|
}
|
155
|
-
// else if (status === TransactionStatus.Queued || status === TransactionStatus.Processing) {
|
156
|
-
// this.statuses[idx].simulationSuccessful = undefined;
|
157
|
-
// }
|
158
155
|
if (args.moreInfo) {
|
159
156
|
this.statuses[idx].moreInfo = args.moreInfo;
|
160
157
|
}
|
158
|
+
if (reset) {
|
159
|
+
this.statuses[idx].txSig = undefined;
|
160
|
+
this.statuses[idx].simulationSuccessful = undefined;
|
161
|
+
this.statuses[idx].moreInfo = undefined;
|
162
|
+
}
|
161
163
|
} else {
|
162
164
|
this.statuses.push(args);
|
163
165
|
}
|
@@ -207,14 +209,18 @@ export class TransactionsManager<T extends TxHandler> {
|
|
207
209
|
private updateStatusForSets(
|
208
210
|
itemSets: TransactionSet[],
|
209
211
|
args: Omit<TransactionManagerStatus, "name">,
|
210
|
-
txSigs?: string[]
|
212
|
+
txSigs?: string[],
|
213
|
+
reset?: boolean
|
211
214
|
) {
|
212
215
|
itemSets.forEach((itemSet, i) => {
|
213
|
-
this.updateStatus(
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
216
|
+
this.updateStatus(
|
217
|
+
{
|
218
|
+
name: itemSet.name(),
|
219
|
+
txSig: txSigs && txSigs.length > i ? txSigs[i] : undefined,
|
220
|
+
...args,
|
221
|
+
},
|
222
|
+
reset
|
223
|
+
);
|
218
224
|
});
|
219
225
|
}
|
220
226
|
|
@@ -287,123 +293,82 @@ export class TransactionsManager<T extends TxHandler> {
|
|
287
293
|
return attemptNum;
|
288
294
|
}
|
289
295
|
|
290
|
-
private async
|
291
|
-
let attemptNum = 0;
|
296
|
+
private async sendJitoBundle(itemSets: TransactionSet[], attemptNum: number) {
|
292
297
|
let transactions: TransactionBuilder[] = [];
|
293
298
|
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
) {
|
301
|
-
throw prevError;
|
302
|
-
}
|
303
|
-
|
304
|
-
attemptNum = Math.max(
|
305
|
-
...itemSets.map((x) => this.getTrueAttemptNum(x?.name() ?? ""))
|
306
|
-
);
|
307
|
-
|
308
|
-
this.priorityFeeSetting = this.getUpdatedPriorityFeeSetting(
|
309
|
-
prevError,
|
310
|
-
attemptNum
|
311
|
-
);
|
312
|
-
|
313
|
-
if (retryNum > 0) {
|
314
|
-
const refreshedSets = await this.refreshItemSets(
|
315
|
-
itemSets,
|
316
|
-
attemptNum,
|
317
|
-
prevError
|
318
|
-
);
|
319
|
-
if (!refreshedSets || !refreshedSets.length) {
|
320
|
-
return;
|
321
|
-
} else {
|
322
|
-
itemSets = refreshedSets;
|
323
|
-
}
|
324
|
-
}
|
325
|
-
|
326
|
-
if (!this.shouldProceedToSend(itemSets, attemptNum)) {
|
327
|
-
return;
|
328
|
-
}
|
329
|
-
|
330
|
-
transactions = [];
|
331
|
-
for (const set of itemSets) {
|
332
|
-
transactions.push(await set.getSingleTransaction());
|
333
|
-
}
|
334
|
-
transactions = transactions.filter(
|
335
|
-
(x) => x.getInstructions().length > 0
|
336
|
-
);
|
337
|
-
if (transactions.length === 0) {
|
338
|
-
this.updateStatusForSets(itemSets, {
|
339
|
-
status: TransactionStatus.Skipped,
|
340
|
-
attemptNum,
|
341
|
-
});
|
342
|
-
return;
|
343
|
-
}
|
344
|
-
|
299
|
+
try {
|
300
|
+
for (const set of itemSets) {
|
301
|
+
transactions.push(await set.getSingleTransaction());
|
302
|
+
}
|
303
|
+
transactions = transactions.filter((x) => x.getInstructions().length > 0);
|
304
|
+
if (transactions.length === 0) {
|
345
305
|
this.updateStatusForSets(itemSets, {
|
346
|
-
status: TransactionStatus.
|
306
|
+
status: TransactionStatus.Skipped,
|
347
307
|
attemptNum,
|
348
308
|
});
|
349
|
-
|
350
|
-
|
351
|
-
itemSet,
|
352
|
-
await itemSet.getSingleTransaction()
|
353
|
-
);
|
354
|
-
}
|
309
|
+
return;
|
310
|
+
}
|
355
311
|
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
this.updateStatusForSets(itemSets, {
|
369
|
-
status: TransactionStatus.Processing,
|
370
|
-
attemptNum,
|
371
|
-
simulationSuccessful: true,
|
372
|
-
}),
|
373
|
-
this.abortController
|
374
|
-
);
|
375
|
-
} catch (e: any) {
|
376
|
-
error = e as Error;
|
377
|
-
}
|
312
|
+
this.updateStatusForSets(
|
313
|
+
itemSets,
|
314
|
+
{
|
315
|
+
status: TransactionStatus.Processing,
|
316
|
+
attemptNum,
|
317
|
+
},
|
318
|
+
undefined,
|
319
|
+
true
|
320
|
+
);
|
321
|
+
for (const itemSet of itemSets) {
|
322
|
+
await this.debugAccounts(itemSet, await itemSet.getSingleTransaction());
|
323
|
+
}
|
378
324
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
this.
|
386
|
-
|
387
|
-
|
388
|
-
|
325
|
+
let txSigs: string[] | undefined;
|
326
|
+
let error: Error | undefined;
|
327
|
+
try {
|
328
|
+
txSigs = await sendJitoBundledTransactions(
|
329
|
+
this.txHandler.umi,
|
330
|
+
this.txHandler.connection,
|
331
|
+
this.txHandler.signer,
|
332
|
+
this.txHandler.otherSigners,
|
333
|
+
transactions,
|
334
|
+
this.txRunType,
|
335
|
+
this.priorityFeeSetting,
|
336
|
+
() =>
|
337
|
+
this.updateStatusForSets(itemSets, {
|
338
|
+
status: TransactionStatus.Processing,
|
389
339
|
attemptNum,
|
390
|
-
|
391
|
-
},
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
340
|
+
simulationSuccessful: true,
|
341
|
+
}),
|
342
|
+
this.abortController
|
343
|
+
);
|
344
|
+
} catch (e: any) {
|
345
|
+
error = e as Error;
|
346
|
+
}
|
396
347
|
|
348
|
+
if (
|
349
|
+
error ||
|
350
|
+
(this.txRunType !== "only-simulate" &&
|
351
|
+
(!Boolean(txSigs) || txSigs?.length === 0) &&
|
352
|
+
!this.abortController?.signal.aborted)
|
353
|
+
) {
|
397
354
|
this.updateStatusForSets(
|
398
355
|
itemSets,
|
399
|
-
{
|
356
|
+
{
|
357
|
+
status: TransactionStatus.Failed,
|
358
|
+
attemptNum,
|
359
|
+
moreInfo: error?.message,
|
360
|
+
},
|
400
361
|
txSigs
|
401
362
|
);
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
this.
|
406
|
-
|
363
|
+
throw error ? error : new Error("Unknown error");
|
364
|
+
}
|
365
|
+
|
366
|
+
this.updateStatusForSets(
|
367
|
+
itemSets,
|
368
|
+
{ status: TransactionStatus.Successful, attemptNum },
|
369
|
+
txSigs
|
370
|
+
);
|
371
|
+
} catch (e: any) {
|
407
372
|
this.txHandler.log("Capturing error info...");
|
408
373
|
const errorDetails = getErrorInfo(
|
409
374
|
this.txHandler.umi,
|
@@ -435,7 +400,52 @@ export class TransactionsManager<T extends TxHandler> {
|
|
435
400
|
if (!errorDetails.canBeIgnored) {
|
436
401
|
throw new Error(errorInfo);
|
437
402
|
}
|
438
|
-
}
|
403
|
+
}
|
404
|
+
}
|
405
|
+
|
406
|
+
private async processTransactionsAtomically(itemSets: TransactionSet[]) {
|
407
|
+
await retryWithExponentialBackoff(
|
408
|
+
async (retryNum, prevError) => {
|
409
|
+
if (
|
410
|
+
prevError &&
|
411
|
+
this.statuses.filter((x) => x.simulationSuccessful).length >
|
412
|
+
this.signableRetries
|
413
|
+
) {
|
414
|
+
throw prevError;
|
415
|
+
}
|
416
|
+
|
417
|
+
const attemptNum = Math.max(
|
418
|
+
...itemSets.map((x) => this.getTrueAttemptNum(x?.name() ?? ""))
|
419
|
+
);
|
420
|
+
|
421
|
+
this.priorityFeeSetting = this.getUpdatedPriorityFeeSetting(
|
422
|
+
prevError,
|
423
|
+
attemptNum
|
424
|
+
);
|
425
|
+
|
426
|
+
if (retryNum > 0) {
|
427
|
+
const refreshedSets = await this.refreshItemSets(
|
428
|
+
itemSets,
|
429
|
+
attemptNum,
|
430
|
+
prevError
|
431
|
+
);
|
432
|
+
if (!refreshedSets || !refreshedSets.length) {
|
433
|
+
return;
|
434
|
+
} else {
|
435
|
+
itemSets = refreshedSets;
|
436
|
+
}
|
437
|
+
}
|
438
|
+
|
439
|
+
if (!this.shouldProceedToSend(itemSets, attemptNum)) {
|
440
|
+
return;
|
441
|
+
}
|
442
|
+
|
443
|
+
await this.sendJitoBundle(itemSets, attemptNum);
|
444
|
+
},
|
445
|
+
this.totalRetries,
|
446
|
+
this.retryDelay,
|
447
|
+
this.errorsToThrow
|
448
|
+
);
|
439
449
|
}
|
440
450
|
|
441
451
|
private async processTransactionSet(
|
@@ -551,11 +561,14 @@ export class TransactionsManager<T extends TxHandler> {
|
|
551
561
|
priorityFeeSetting?: PriorityFeeSetting,
|
552
562
|
txRunType?: TransactionRunType
|
553
563
|
) {
|
554
|
-
this.updateStatus(
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
564
|
+
this.updateStatus(
|
565
|
+
{
|
566
|
+
name,
|
567
|
+
status: TransactionStatus.Processing,
|
568
|
+
attemptNum,
|
569
|
+
},
|
570
|
+
true
|
571
|
+
);
|
559
572
|
try {
|
560
573
|
const txSig = await sendSingleOptimizedTransaction(
|
561
574
|
this.txHandler.umi,
|
@@ -645,7 +645,6 @@ export function getErrorInfo(
|
|
645
645
|
) {
|
646
646
|
const err = (error as any)["InstructionError"];
|
647
647
|
|
648
|
-
consoleLog("err idx details", err[0], getComputeIxs(0), simulationSuccessful, usePriorityFee(priorityFeeSetting));
|
649
648
|
errIxIdx = err[0] - getComputeIxs(0);
|
650
649
|
errCode =
|
651
650
|
typeof err[1] === "object" && "Custom" in err[1]
|
package/src/utils/jitoUtils.ts
CHANGED
@@ -211,7 +211,6 @@ async function pollBundleStatus(
|
|
211
211
|
const statuses = await retryWithExponentialBackoff(
|
212
212
|
async () => {
|
213
213
|
const resp = await getBundleStatus(umi, bundleId);
|
214
|
-
// TODO: remove me
|
215
214
|
if (resp?.value?.length > 0 && resp.value[0] === null) {
|
216
215
|
throw new Error("No confirmation status");
|
217
216
|
}
|
@@ -323,7 +322,7 @@ export async function sendJitoBundledTransactions(
|
|
323
322
|
txs,
|
324
323
|
false,
|
325
324
|
undefined,
|
326
|
-
Array(txs.length).map((_) => 1_400_000)
|
325
|
+
Array(txs.length).fill(null).map((_) => 1_400_000)
|
327
326
|
);
|
328
327
|
simulationResults = await simulateJitoBundle(umi, builtTxs);
|
329
328
|
}
|
package/src/utils/solanaUtils.ts
CHANGED
@@ -223,18 +223,14 @@ export function addTxOptimizations(
|
|
223
223
|
? setComputeUnitLimitUmiIx(umi.identity, computeUnitLimit)
|
224
224
|
: transactionBuilder();
|
225
225
|
|
226
|
-
consoleLog("Optimizations:", computeUnitPrice, computeUnitLimit);
|
227
226
|
const allOptimizations = tx.prepend(computePriceIx).prepend(computeLimitIx);
|
228
227
|
const withCuPrice = tx.prepend(computePriceIx);
|
229
228
|
const withCuLimit = tx.prepend(computeLimitIx);
|
230
229
|
if (allOptimizations.fitsInOneTransaction(umi)) {
|
231
|
-
consoleLog("Adding all tx optimizations");
|
232
230
|
return allOptimizations;
|
233
231
|
} else if (withCuPrice.fitsInOneTransaction(umi)) {
|
234
|
-
consoleLog("Adding CU price optimization");
|
235
232
|
return withCuPrice;
|
236
233
|
} else if (withCuLimit.fitsInOneTransaction(umi)) {
|
237
|
-
consoleLog("Adding CU limit optimization");
|
238
234
|
return withCuLimit;
|
239
235
|
} else {
|
240
236
|
return tx;
|