Skip to content
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

Improvements to Jito executor output and error handling #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions transactions/jito-rpc-transaction-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ export class JitoTransactionExecutor implements TransactionExecutor {
const jitoFeeTx = new VersionedTransaction(jitTipTxFeeMessage);
jitoFeeTx.sign([payer]);

const jitoTxsignature = bs58.encode(jitoFeeTx.signatures[0]);

// Serialize the transactions once here
const serializedjitoFeeTx = bs58.encode(jitoFeeTx.serialize());
const serializedTransaction = bs58.encode(transaction.serialize());
Expand Down Expand Up @@ -101,7 +99,10 @@ export class JitoTransactionExecutor implements TransactionExecutor {
if (successfulResults.length > 0) {
logger.trace(`At least one successful response`);
logger.debug(`Confirming jito transaction...`);
return await this.confirm(jitoTxsignature, latestBlockhash);

const tokenTxSignature = bs58.encode(transaction.signatures[0]);

return await this.confirm(tokenTxSignature, latestBlockhash);
} else {
logger.debug(`No successful responses received for jito`);
}
Expand All @@ -111,7 +112,7 @@ export class JitoTransactionExecutor implements TransactionExecutor {
if (error instanceof AxiosError) {
logger.trace({ error: error.response?.data }, 'Failed to execute jito transaction');
}
logger.error('Error during transaction execution', error);
logger.error({ error: error }, 'Error during transaction execution');
return { confirmed: false };
}
}
Expand Down