bloxbean / yaci

A Cardano Mini Protocols implementation in Java
MIT License
22 stars 3 forks source link

Local Tx submission breaks N2C connection #44

Open nemo83 opened 7 months ago

nemo83 commented 7 months ago

Hello,

I've been using Yaci to both listen mempool and submit tx via N2C protocol.

I've been using https://github.com/bloxbean/yaci/blob/main/helper/src/main/java/com/bloxbean/cardano/yaci/helper/LocalTxSubmissionClient.java#L78 to submit Tx, BUT, from time to time, it looks like the response of the tx submission does not get process immediately. It takes another tx submission to get the notification of the previously submitted tx creating a off by 1 callbacks.

This eventually causes the N2C connection to break and makes the mempool monitoring stops as well as stops accepting tx submission.

For testing purposes I've also used the same code BUT using ogmios or submit api to submit TXs, instead of N2C connections and in this case it never breaks, making me thinking that there is a possible issue in the way txs are submitted to local client, possibly the way responses for tx submission are processed.

Please let me know if you need more details!

nemo83 commented 7 months ago

Upon suggestions I've instantiated 2 N2C connections:

  1. one for mempool monitoring
  2. one for local n2c tx submission Mempool monitoring is now working no problem consistently over several hours, unfortunately the n2c connection used to submit tx seems to have eventually crashed. This is noticeable by the fact that the listener is not being called anymore and no outcome printed in logs.