Commit Graph

43 Commits

Author SHA1 Message Date
ThomasV b055eeace2 prune channels older than two weeks from database 2019-08-20 09:03:11 +02:00
ThomasV 522ce5bb9f verify channel updates in peer's TaskGroup 2019-08-20 09:03:11 +02:00
ThomasV 308dc6aa6b use a single queue for gossip messages, so that they are processed in the correct order 2019-08-20 09:03:11 +02:00
ThomasV e68f318b12 verify node and channel announcements before entering sql lock 2019-08-20 09:03:11 +02:00
SomberNight fbafc77f01 lnpeer query_short_channel_ids: BOLT-07 says ids must be sorted
this is why most remote peers were disconnecting upon receiving this msg
2019-08-20 09:03:11 +02:00
SomberNight afc5717cf0 lnpeer reply_channel_range: handle lnd 2019-08-20 09:03:11 +02:00
ThomasV 0e42fd9f17 parallelize short_channel_id requests 2019-08-20 09:03:11 +02:00
ThomasV 1011245c5e LNGossip: sync channel db using query_channel_range 2019-08-20 09:03:11 +02:00
SomberNight cc57da704b logging: adapt lightning branch to logging changes 2019-08-20 09:03:11 +02:00
ThomasV 730be17aba Use separate lightning nodes for gossip and channel operations. 2019-08-20 09:03:11 +02:00
ThomasV dac686b11d minor fix 2019-08-20 09:03:11 +02:00
ThomasV 796f199a5b follow-up prev commit 2019-08-20 09:03:11 +02:00
ThomasV a6469904ee fix verify_sig_for_channel_update: use raw message 2019-08-20 09:03:11 +02:00
ThomasV 407114d3cc lnpeer:
- disable option data_loss_protect
 - disable query_short_channel_ids
 - increase timeouts in pay
2019-08-20 09:03:11 +02:00
ThomasV f0ac81419c increase timeout in open_channel 2019-08-20 09:03:11 +02:00
ThomasV 5eab60621d lnpeer:
- send data_loss_protect fields with channel_reestablish
 - close connection if we receive an unknown channel_reestablish
 - log all exceptions that make us close a connection
 - formatting
2019-08-20 09:03:11 +02:00
ThomasV 93e8d4f953 channel_db: fix timestamp_range, reduce verbosity 2019-08-20 09:03:11 +02:00
ThomasV aa398993cf lnrouter fixes:
- use gossip_queries_req instead of initial_routing_sync
 - add connected nodes to recent peers only after successful init
 - derive timestamp used with gossip_timestamp_filter from channel_db
 - fix query_short_channel_ids:
     1. channel IDs must be sorted with zlib
     2. limit request to 100
     3. do not abuse this to request node_announcements; it is fine not to have all nodes.
 - fix get_recent_peers:
     1. do not set last_connected_date to 'now' if we never connected a node
     2. sql query was misconstructed and was returning only one peer
 - populate FALLBACK_NODE_LIST_MAINNET with nodes that have the requested flags
2019-08-20 09:03:11 +02:00
ThomasV f5eb369fb7 lnpeer: spawn wait_for(self.initialized) to kill the TaskGroup if it times out 2019-08-20 09:03:11 +02:00
ThomasV 023d4026b9 fix local_index in channel _shutdown 2019-08-20 09:03:11 +02:00
ThomasV 3abe30e9d8 basic watchtower synchronization 2019-08-20 09:03:11 +02:00
ThomasV c155293166 follow-up variable renaming 2019-08-20 09:03:11 +02:00
ThomasV 8d77a7ecd8 save timestamps in htlc log 2019-08-20 09:03:11 +02:00
ThomasV ecd9508233 follow-up previous commit 2019-08-20 09:03:11 +02:00
ThomasV a7d37b72db factorize channel opening code into chan.open_with_first_pcp 2019-08-20 09:03:11 +02:00
ThomasV c3f6351922 simplify points, remove side-effect in reestablish_channel 2019-08-20 09:03:11 +02:00
ThomasV b5fd27c64c fix local/remote confusion in reestablish_channel 2019-08-20 09:03:11 +02:00
Janus 95a2174789 sqlite in lnrouter: lnpeer: introduce _gossip_loop for gossip handling separated from message handling 2019-08-20 09:03:11 +02:00
Janus 945e1dc4ee sqlite in lnrouter: request missing channel_announcements and node_announcements 2019-08-20 09:03:11 +02:00
Janus dd7c4b3bab sqlite in lnrouter 2019-08-20 09:03:11 +02:00
ThomasV 3e443535a2 lnchannel: pass reference to lnworker 2019-08-20 09:03:11 +02:00
SomberNight ef7a59b4a9 lnchannel: save htlc preimages as soon as possible but horribly hacky
will properly clean this up...
2019-08-20 09:03:11 +02:00
SomberNight 021f5d570e lnpeer: check that remote only sends commit_sig if there are changes 2019-08-20 09:03:11 +02:00
Janus f618bb4a67 lnhtlc: handle settles like adds (asymmetrical across ctns) 2019-08-20 09:03:11 +02:00
SomberNight 3a2ab149b9 lnchannel: add_htlc and receive_htlc now take and return UpdateAddHtlc
also fix undefined vars in _maybe_forward_htlc and _maybe_fulfill_htlc
in lnpeer
2019-08-20 09:03:11 +02:00
ThomasV 62be0c481c lightning: Save invoices and preimages separately. Save preimages when forwarding 2019-08-20 09:03:11 +02:00
ThomasV e475617b75 lnpeer: distinguish local and remote pending updates 2019-08-20 09:03:11 +02:00
ThomasV 4228b926d4 lnpeer: send commitment after receiving updates 2019-08-20 09:03:11 +02:00
ThomasV 3d8e168a85 follow-up previous commit 2019-08-20 09:03:11 +02:00
ThomasV 6eba22b5a8 lnpeer: replace asyncio.sleep with events 2019-08-20 09:03:11 +02:00
ThomasV 86b33a5637 code refactoring: _maybe_fullfill_htlc, _maybe_forward_htlc 2019-08-20 09:03:11 +02:00
ThomasV a40207cbbb Refactor LNPeer in order to support HTLC forwarding:
1. Do not perform channel updates in coroutines, because they would get executed in random order.
 2. After applying channel updates, wait only for the relevant commitment (local or remote) and not for both, because local and remote might be out of sync (BOLT 2).
 3. When waiting for a commitment, wait until a given ctn has been reached, because a queue cannot be shared by several coroutines
2019-08-20 09:03:11 +02:00
ThomasV 3dce65dc73 Rename lnchan, lnchannel_verifier, lnbase
Auto-completions are a pain if files share a long prefix
2019-08-20 09:03:11 +02:00