Skip to content

Conversation

@mikekeke
Copy link
Collaborator

@mikekeke mikekeke commented Jun 17, 2022

This PR introduce changes in awaitTxStatusChange making it closer to what real PAB is doing - it waits until transaction status will change from Unknown to anything else with some nuances:

  • It queries chain-index to get transaction, if transaction not found status is considered to be Unknown and it will keep querying
  • If transaction found but error occurred during status check, status is considered to be Unknown and it will keep querying
  • Interval between requests to chain-index is configurable via PABConfig
  • It has timeout (in number of blocks) configurable via PABConfig. Timeout required for the case, when transaction is (silently) discarded from node mempool. In this case transaction will never show up on chain and awaiting can loop forever. After timeout is reached, status from the last check will be returned, it can be Unknown as well, so awaitTxConfirmed which is implemented via awaitTxStatusChange can still loop forever. Upcoming node release will introduce queries to mempool in Cardano.Api - maybe it could be a replacement for timeout.

mikekeke added 5 commits June 15, 2022 17:51
- added chain-index polling interval and timeout
- todo: config and tests
- tests added
- config spec added
- bugs fixed
- todo: docs, refactoring, testnet tests
- docs
- clenaup
- testnet tested
@mikekeke mikekeke marked this pull request as ready for review June 17, 2022 14:19
@mikekeke mikekeke requested a review from nazrhom June 17, 2022 14:32
| start + n <= tip'.block -> pure ()
_ -> go start
-- -- | Wait for n Blocks.
-- awaitNBlocks ::
Copy link
Collaborator Author

@mikekeke mikekeke Jun 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can probably be removed

netId
socket
where
-- This parameter needed only for the Byron era. Since the Byron
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found this explanation somewhere in latest node commits

@mikekeke mikekeke requested a review from nazrhom June 20, 2022 10:59
@mikekeke
Copy link
Collaborator Author

For some reason it breaks Plutip's tests with slot <-> time conversions. Under investigations.

@mikekeke mikekeke force-pushed the misha/await-status-change-rework branch from 4134755 to bcea30f Compare June 22, 2022 09:00
@mikekeke
Copy link
Collaborator Author

For some reason it breaks Plutip's tests with slot <-> time conversions

The problem was not caused directly by this rework, but fix committed here as well.

@mikekeke mikekeke merged commit d882ffb into master Jun 22, 2022
@mikekeke mikekeke deleted the misha/await-status-change-rework branch June 27, 2022 12:55
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

Successfully merging this pull request may close these issues.

4 participants