Plutonomicon / cardano-transaction-lib

A Purescript library for building smart contract transactions on Cardano
https://plutonomicon.github.io/cardano-transaction-lib/
MIT License
93 stars 50 forks source link

Fix error recovery mode for SubmitTx #398

Closed klntsky closed 2 years ago

klntsky commented 2 years ago

As part of #233 we implemented a simple approach to error recovery with the use of reconnecting-websocket. However, there's one special endpoint for which simple replaying is not going to work. We need to check if a transaction has been sent before resubmitting it (otherwise UTXOs may be consumed by TX and we'll get an error when trying to send it for the second time).

How to address this problem: maintain request queue as a list of transactions instead of a list of String payloads. Before retrying, use https://ogmios.dev/mini-protocols/local-tx-monitor/ to see if a transaction is in local node mempool.

klntsky commented 2 years ago

The reason why we are delaying this: the chance to observe the error is low.