Submarine swap
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.6k
- Forks
- 3.5k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 61
Description
Hi,
I'm testing normal_swap on mainnet at the moment, but facing some issues:
electrum normal_swap 0.0005 dryrun
{'txid': None, 'lightning_amount': '0.00048777', 'onchain_amount': '0.0005'}
electrum getbalance
{'confirmed': '0.68024406', 'lightning': '0.00893761594'}
electrum normal_swap 0.0005 0.00048777
# freezes for several minutes here
{'txid': None, 'lightning_amount': '0.00048777', 'onchain_amount': '0.0005'}
electrum normal_swap 0.0005 dryrun
{'txid': None, 'lightning_amount': '0.00048803', 'onchain_amount': '0.0005'}
electrum normal_swap dryrun 0.0005
{'txid': None, 'lightning_amount': '0.0005', 'onchain_amount': '0.00051202'}
electrum getbalance
{'confirmed': '0.68024406', 'lightning': '0.00893761594'}
electrum normal_swap 0.00051202 0.0005
# freezes for several minutes here
Out[36]: {'txid': None, 'lightning_amount': '0.0005', 'onchain_amount': '0.00051202'}
electrum getbalance
{'confirmed': '0.68024406', 'lightning': '0.00893761594'}
As you can see here, it doesn't work, original channel capacity is 0.001 BTC
Logs don't give much info as well:
90473.18 | I | submarine_swaps.SwapManager | requesting preimage hash for swap
90473.25 | I | lnworker.LNWallet.[default_wallet] | creating bolt11 invoice with routing_hints: [('r', [(b'\x03\xec\xefg[\xe4H\xb6\x15\xe6\x17d$\x07\x06s\xef\x82\x84\xe0\xfd\x19\xd8\xbe\x06*l\xb5\xb10\xa0\xa0\xd1', b'\x00\x15y\xa8W\xb5\x18^', 1000, 100, 144)])]
90473.26 | I | coinchooser.CoinChooserPrivacy | Total number of buckets: 5
90473.26 | I | coinchooser.CoinChooserPrivacy | Num candidates considered: 7. Winning penalty: 0.715322130710404
90473.26 | I | coinchooser.CoinChooserPrivacy | using 1 inputs
90473.26 | I | coinchooser.CoinChooserPrivacy | using buckets: ['xxx']
90473.27 | I | transaction | adding signature for xxx. spending utxo xxx:1
90473.31 | I | w/wallet.Standard_Wallet.[default_wallet] | set_up_to_date: False
90473.43 | I | storage.WalletStorage | saved /home/electrum/.electrum/wallets/default_wallet
90473.43 | I | w/wallet.Standard_Wallet.[default_wallet] | set_up_to_date: True
Am I doing something wrong? I did reverse swap the same way and it worked perfectly
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported mainnet behavior with the normal_swap commands and inspect the submarine_swaps.SwapManager flow. Start with the log entries for requesting the preimage hash and creating the BOLT11 invoice, then trace where the command stops responding. Done means the cause of the freeze is identified and the swap either completes or reports a useful failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- payments
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100