Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

web3.js confirmTransaction() must check the current status of a signature before subscribing for updates or throwing expiry errors #1107

Closed
steveluscher opened this issue Jun 14, 2022 · 13 comments
Assignees

Comments

@steveluscher
Copy link
Contributor

steveluscher commented Jun 14, 2022

Problem

If you call confirmTransaction for a signature that has already been processed, the signatureSubscribe subscription will never fire a notification. This will certainly mean that confirmTransaction() will throw an expiry error for a transaction that is, in actual fact, confirmed.

First reported here: https://twitter.com/CryptoLothar/status/1536530448976863232

Proposed Solution

  1. Before subscribing or honouring expiry signals, check the signature status using the getSignatureStatuses method.
  2. If the signature has not been confirmed and you have not received an expiry signal, subscribe for status updates.
  3. Race the expiry strategy and the confirmation strategy.
@steveluscher steveluscher changed the title confirmTransaction() must check the _current_ status of a signature before subscribing for updates or throwing expiry errors web3.js confirmTransaction() must check the current status of a signature before subscribing for updates or throwing expiry errors Jun 14, 2022
@steveluscher steveluscher self-assigned this Jun 14, 2022
@AndonMitev
Copy link

I can confirm i experience this issue s well

@Fahad-pnw
Copy link

has this been resolved or signature confirmation is only as reliable as the websocket's reliability?
so, we cannot be 100% dependent upon confirmation?

@steveluscher
Copy link
Contributor Author

Soon, @Fahad-pnw! I'm working up to a deadline this week, but after that I'll be back to fix things like this.

@devdomsos
Copy link

Can confirm this issue happens also to me.

TransactionExpiredBlockheightExceededError: Signature XYZ has expired: block height exceeded.

@Fahad-pnw
Copy link

@steveluscher was there an update to this?

@steveluscher
Copy link
Contributor Author

I still want to do this @Fahad-pnw. I don't think I'm going to get much done on web3.js at all until the Solana conference in Lisbon is over. :/

@abrzezinski94
Copy link
Contributor

Hi added pr for that issue solana-labs/solana#28290

@thelemurcodes
Copy link

Hi, I've been having this issue when calling 'createMint()' from spl-token. Sometimes it will return and sometimes I receive 'TransactionExpiredBlockheightExceededError: Signature XYZ has expired: block height exceeded'. I see ya'll are working on it, but I just wanted to notify.

@martincik
Copy link

Any update on this one?

@steveluscher
Copy link
Contributor Author

solana-labs/solana#28290 is basically ready to ship. Things I want to do before shipping it:

  1. Test it more
  2. Contact RPC operators and double check with them that adding one getSignatureStatuses call to every transaction confirmation is something that the clusters can absorb.

@steveluscher steveluscher transferred this issue from solana-labs/solana Feb 1, 2023
@Fahad-pnw
Copy link

thank you for working on this but has this been resolved yet?

@steveluscher
Copy link
Contributor Author

I believe so! We shipped #28290.

@github-actions
Copy link
Contributor

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants