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

Don't timeout waiting for funding confirmation. #380

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

mojoX911
Copy link

This PR packages many small improvements along with a big one. Taker sends a new message to maker while its waiting for the funding confirmation. Upon receiving the maker restarts the timer.

This allows us to wait for variable confirmation time (which is hard to predict in testnet) without timing out the connections.

Some other auxiliary improves:

  • Improve some loging in taker and maker.
  • Raise a warning if the maker's swap liquidity is less than min_offer_size. It will not listen for a swap request unless enough balance is sent to the wallet.
  • Calculate funding tx feerate manually, don't need to make another rpc call for it.
  • add cargo test to precommit-hook.
  • Reduce connection timeout for maker to 15 mins. Because now we will only timeout for actual connection drops. Now Takers in average sends a message approx every minute.

plus a readme doc test fix.  remove an extra file
Check if the maker's available liquidity is less than min_swap_amount

Move the actual feerate calculation at tx building site. No need for
extra RPC call.
@mojoX911 mojoX911 requested review from KnowWhoami and Shourya742 and removed request for KnowWhoami January 15, 2025 13:23
@mojoX911 mojoX911 linked an issue Jan 15, 2025 that may be closed by this pull request
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 77.17391% with 21 lines in your changes missing coverage. Please review.

Project coverage is 70.66%. Comparing base (0a4a52d) to head (6d69d51).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/utill.rs 0.00% 11 Missing ⚠️
src/bin/taker.rs 0.00% 4 Missing ⚠️
src/taker/api.rs 93.93% 2 Missing ⚠️
src/maker/rpc/server.rs 0.00% 1 Missing ⚠️
src/maker/server.rs 95.65% 1 Missing ⚠️
src/wallet/api.rs 50.00% 1 Missing ⚠️
src/wallet/rpc.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #380      +/-   ##
==========================================
+ Coverage   70.58%   70.66%   +0.08%     
==========================================
  Files          34       34              
  Lines        4161     4214      +53     
==========================================
+ Hits         2937     2978      +41     
- Misses       1224     1236      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mojoX911 mojoX911 linked an issue Jan 15, 2025 that may be closed by this pull request
the spendable balance should only include descriptor + swap balance.

move the balance check clause at start of the swap to fail early.

use sats in the error values not btc, as it creates exponential notation
at display if the amount is very small.
Currently we are showing swap balance for both incoming and outgoing swapcoins.
Which causes double count. Same thing for contract utxo list and balances.

We should only care about incoming utxo and balance. Outgoing utxos are for other
parties and we cannot directly spend them. Unless there is a recovery and then
we redeem the outgoing via timelock, which adds back to the seed balance.

Thus we never need to display outgoing/hashlock utxos and their balances.
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.

[taker] Display waiting time for funding transaction. IO error reported on "fetch-offers"
1 participant