Closed L-as closed 1 year ago
It depends on behavior of Ogmios.
From this I can conclude that sending TXs one-by-one is technically supported by Ogmios. However, we also rely on utxo
call to get UTXOs during tx construction, and it's not clear whether mempool TXs are included in its output.
We also maintain a list of spent outputs to prevent double-spending attempts.
In the worst case (if Ogmios utxo
call is blind w.r.t. local mempool) I think we could use Ogmios Local Tx Monitor and consider utxos received from that.
I think I can check how utxo
call works soon.
I changed the issue given that you've confirmed that at the very least you have to do a roundtrip on the network to some server to do this, which wouldn't be great either.
It's not strictly required to call utxo
, one can use CTL as a thin wrapper around CSL. But if balancing is used, utxo
is called.
@klntsky Can you give an example of how to do this then?
Sorry for slow reply (I was ill). There's no example, but the idea is that you can construct a transaction by hand without using Contract
API, the same way you can do it with cardano-serialization-library
in pure JS.
With https://github.com/Plutonomicon/cardano-transaction-lib/pulls you can create multiple transactions at the same time. Not really in a DAG, but in a flat list, but at least without double spending.
However, it's not yet possible to submit them in one go.
@firefrorefiddle I think your link is incorrect
With https://github.com/Plutonomicon/cardano-transaction-lib/pulls you can create multiple transactions at the same time. Not really in a DAG, but in a flat list, but at least without double spending.
However, it's not yet possible to submit them in one go.
Transactions that depend on each other?
This is now possible with the mustUseAdditionalUtxos
balance constraint.
It should be possible to create a DAG of transactions locally, and submit them in one go, without doing any roundtrips to any server between the transactions. The lack of support of this can potentially decrease throughput by several orders of magnitude.
In the naive case where you wait for the first transaction to be accepted into the blockchain, you have to wait a very long time until you can submit the transactions that depend on that transaction. You can send the transactions in order without waiting, and in fact according to Duncan Coutts, the protocol is designed such that upstream nodes do in fact preserve the ordering of the transactions.
This is important, because the ledger is essentially a set of
TxOutRef
s, where each transaction is applied incrementally, meaning that such a DAG of dependent transactions can all be accepted into the same block.(snippet from e-mail between George Flerovsky and Duncan Coutts)
(edited)