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

awaitTxStatusChange hides rollbacks as Unknown #110

Open
Saizan opened this issue Jun 3, 2022 · 1 comment
Open

awaitTxStatusChange hides rollbacks as Unknown #110

Saizan opened this issue Jun 3, 2022 · 1 comment
Assignees

Comments

@Saizan
Copy link

Saizan commented Jun 3, 2022

awaitTxStatusChange currently only returns Unknown or Committed.

In case of a rollback then we only ever get Unknown, which e.g. makes awaitTxConfirmed keep looping as if we were still waiting for the tx to show up at all.

As we discussed before, we should have awaitTxStatusChange actually return the current status of the transaction, rather than include the 8 block wait for confirmation.

Utilities built on top of this primitive can then implement an appropriate way to deal with rollbacks when they see TentativelyConfirmed followed by Unknown

@mikekeke mikekeke self-assigned this Jun 20, 2022
@mikekeke
Copy link
Collaborator

mikekeke commented Jun 22, 2022

awaitTxStatusChange was reworked in #122, changes are listed it PR.

It will now return TentativelyConfirmed as soon as Tx willlive mempool and get propagated to chain, but it will still return Unknown if Tx was discarded from the mempool. So awaitTxConfirmed can still loop forever and there is no protection from that as far as I can see besides some custom off-chain logic.

New node release (1.35) will introduce mempool queries, but It fills like on top of that TxStatus need one more variant like Discarded or something to be able to manage discarding from the mempool in off-chain Contract code.

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

2 participants