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

Duplicate transaction sent in FastSingleTxSender and RetryTxSender #917

Open
JakkuSakura opened this issue Feb 27, 2024 · 2 comments
Open

Comments

@JakkuSakura
Copy link

FastSingleTxSender should send the transaction only once.

class FastSingleTxSender {
	async sendRawTransaction(
		rawTransaction: Buffer | Uint8Array,
		opts: ConfirmOptions
	): Promise<TxSigAndSlot> {
		let txid: TransactionSignature;
		try {
			txid = await this.connection.sendRawTransaction(rawTransaction, opts);
			this.sendToAdditionalConnections(rawTransaction, opts);
		} catch (e) {
			console.error(e);
			throw e;
		}

		this.connection.sendRawTransaction(rawTransaction, opts).catch((e) => {
			console.error(e);
		});
		this.sendToAdditionalConnections(rawTransaction, opts);
...
}

In RetryTxSender, there is no handling for This transaction has already been processed error, so it happens every time

SendTransactionError: failed to send transaction: Transaction simulation failed: This transaction has already been processed
    at Connection.sendEncodedTransaction (drift/js/node_modules/.pnpm/@[email protected]/node_modules/@solana/web3.js/src/connection.ts:5921:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Connection.sendRawTransaction (drift/js/node_modules/.pnpm/@[email protected]/node_modules/@solana/web3.js/src/connection.ts:5880:20) {
  logs: []
}
@crispheaney
Copy link
Member

do you have a custom blockhashRefreshInterval set? i've noticed that happening when blockhash isn't updated frequently enough, we could increase the default

@JakkuSakura
Copy link
Author

Hi, I noticed that if I use a RPC other than helium, it will happen. If I use helium, it's working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@crispheaney @JakkuSakura and others