1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-03-14 11:58:19 +01:00
Commit graph

2060 commits

Author SHA1 Message Date
dpad85
aa24a8e90e
Back to development 2020-03-05 11:38:33 +01:00
dpad85
bd76fd1b26
Release v0.3.8-android-phoenix 2020-02-19 16:08:41 +01:00
pm47
05e251ff3a
pay-to-open: pass fee rates on the wire
This way Phoenix knows what fee settings to use when aggregating
requests.
2020-02-19 16:06:57 +01:00
dpad85
50ba4c8306
Merge branch 'android' into android-phoenix 2020-02-18 17:04:54 +01:00
dpad85
edc0f6f3c0
Merge branch 'master' into android 2020-02-18 17:02:55 +01:00
Bastien Teinturier
1e12f6d105
Allow receiving non-standard payments (#1326) 2020-02-18 17:02:20 +01:00
Bastien Teinturier
4579462dfc
SendToRoute with routing hints (#1325)
SendToRoute previously didn't accept invoice routing hints.
This was a limitation when paying a wallet invoice.
Invoice hints are now correctly taken into account.
2020-02-18 10:52:43 +01:00
pm47
2743a5fe67
make pay-to-open work with non-trampoline AMP
We now accept incoming AMP payments that are paid by a combination of
htlcs and pay-to-open requests. All pay-to-open requests are combined in
a single request.

More symmetry would have been nice between legacy/trampoline (e.g. for
the `SendPayToOpen.origin` field) but it didn't seem possible.

Also added an expiry timestamp to prevent race conditions at the UI
level.
2020-02-17 17:46:04 +01:00
Bastien Teinturier
7490bf3222
Fix random trampoline test failure (#1318)
Writing the PaymentRelayed event to the DB is not atomic.
Each part is written independently of the others (one row per part).
This is fine as nothing relies on this event being written atomically.
However tests were expecting that and we would observe rare
test failures on travis.
2020-02-14 18:24:54 +01:00
pm47
8cd40b2cd0
Merge branch 'android' into android-phoenix 2020-02-13 18:39:32 +01:00
pm47
fc07f2dede
Merge branch 'master' into android 2020-02-13 17:02:39 +01:00
pm47
b530a9ea52
fixed failing api test 2020-02-13 14:28:57 +01:00
Anton Kumaigorodski
8afc00d02f
Re-send ChannelUpdate to private channels (#1317)
When coming back online, re-send private channels' `channel_update`.
This makes sure it gets rebroadcast regularly in case it was missed.
Since it's a private channel, it won't spam the network.
2020-02-12 10:18:00 +01:00
sstone
6ecf1084e1
Merge branch 'master' into android 2020-02-11 17:33:40 +01:00
Fabrice Drouin
b73030018c
Electrum: add support for socks5 proxies (#1315)
We use the socks5 proxy that is defined in the configuration and is typically used to connect to LN nodes running as TOR hidden services.
This should allow users to connect to Electrum servers that are running behind TOR.
2020-02-11 16:57:28 +01:00
Bastien Teinturier
bd05eb140e
Node relayer faster fulfill (#1306)
* Refactor payment errors

When sending payments, it makes it easier for a wallet to display
the correct localized error message to users.

* Faster Trampoline payments fulfill

We were previously waiting for the whole downstream payment
to be settled (all individual HTLCs).

We can do better and fulfill upstream as soon as we get the preimage
(which only needs one downstream fulfill).
2020-02-10 13:52:57 +01:00
Pierre-Marie Padiou
8ff7f4b03e
Payment request: ignore fields with invalid length (#1308)
* Ignore fields with invalid length

As per the spec:
> A reader:
>   * MUST skip over unknown fields, OR an f field with unknown version, OR p, h, s or n fields that do NOT have data_lengths of 52, 52, 52 or 53, respectively.

* Add more Bolt 11 tests

See https://github.com/lightningnetwork/lightning-rfc/pull/699
and https://github.com/lightningnetwork/lightning-rfc/pull/736

Co-authored-by: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
2020-02-10 13:37:23 +01:00
n1bor
13f5b0339a Fix networkstats API call (#1309)
Use the correct type in `networkstats` API.
2020-02-10 10:32:29 +01:00
Pierre-Marie Padiou
41f466c30e
Better logging for transport handler (#1303)
We currently rely on `require`, which is convenient, but doesn't allow
fine-grained exception control.

Also, in case of errors, logging is done at the supervisor level, where
we lose the remote `node_id`.

Instead, we type some crypto-related errors and log them in the
`TransportHandler`, which already has the correct MDC.
2020-02-07 14:56:38 +01:00
Bastien Teinturier
8bf94afae8
Fix AuditDb flaky test (#1304)
The DB ordering is not deterministic.
For multi-part payments, the first timestamp is taken.
This can vary depending on which record is listed first.
Using the same timestamp avoids a failed assertion.
2020-02-07 14:33:18 +01:00
dpad85
a74dd6c08f
Merge branch 'android' into android-phoenix 2020-02-05 16:47:16 +01:00
dpad85
74c4706a08
Merge branch 'master' into android 2020-02-04 18:46:54 +01:00
dpad85
c5e3336cf9
Back to development 2020-02-04 11:02:28 +01:00
Pierre-Marie Padiou
b36c5ad583
Notify change in balance when updating network fee (#1301)
Instead of emitting this event when we send a signature, we emit it when
our `availableBalanceForSend` actually changes. This happens:
- when we send a new `update_*`;
- when we receive a `commit_sig`, which may acknowledge one or several
`update_*` sent by our peer.

We choose to only emit this event in `NORMAL` state, because its goal is
to give information about what payments we can make, which can only
happen in that state.

NB: other events `ChannelSignatureSent` and `ChannelSignatureReceived` give
a different type of information, and are sent in all states where
signatures are exchanges, not only in `NORMAL`.

The field `localBalance` has been removed because it was ambiguous, and so is
the balance tracking in the database, which wasn't very useful.

Co-Authored-By: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
2020-02-03 17:58:30 +01:00
dpad85
fa90ab3787
Release 0.3.7-android-phoenix 2020-02-03 15:10:33 +01:00
Fabrice Drouin
2a0d6ecf11
Electrum: allow watcher to watch for mempool transactions (#1298)
* Electrum: allow watcher to watch for mempool transactions

Watcher now handles WatchConfirmed watches where min depth
is set to 0: the watch event will be sent when the tx enters the
mempool of the bitcoin node our Electrum server is connected to.

For 0-conf channel, use scids with a height of 0 and a tx index
generated from the first 16 bytes of the funding txid. This gives us
unique ids that can still be identified as 0-conf channel.

(cherry picked from commit 1734861930)

NB: this commit removes the phoenix special case for zero-confs channels
2020-02-03 15:00:53 +01:00
Fabrice Drouin
1734861930
Electrum: allow watcher to watch for mempool transactions (#1298)
* Electrum: allow watcher to watch for mempool transactions

Watcher now handles WatchConfirmed watches where min depth 
is set to 0: the watch event will be sent when the tx enters the 
mempool of the bitcoin node our Electrum server is connected to.

For 0-conf channel, use scids with a height of 0 and a tx index 
generated from the first 16 bytes of the funding txid. This gives us 
unique ids that can still be identified as 0-conf channel.
2020-02-03 14:43:58 +01:00
Fabrice Drouin
66e04265b3
Release 0.3.3 (#1300)
* Release 0.3.3

* Set version to 0.3.4-SNAPSHOT
2020-02-03 11:07:26 +01:00
Bastien Teinturier
212bc2ce12
Fix force-close next commit then fulfill (#1299)
Handle correctly the case where the remote peer force-closed,
and afterwards we received a preimage from downstream for
an HTLC in this channel.
2020-01-31 16:46:00 +01:00
Bastien Teinturier
48ad9b30e6
Trampoline/MPP API changes (#1297)
Let a sender manually split a payment and specify a trampoline route.

Fix two flaky tests where the order of payment parts could be
different, resulting in a failed equality test.

If we're relaying multiple HTLCs for the same payment_hash,
we need to list all of those.
The previous code only handled that when Trampoline was used.
2020-01-31 11:52:15 +01:00
araspitzu
78e6cdbec9
Support deterministic build of eclair-core artifact on ubuntu (#1295)
* Upgrade maven-jar-plugin and maven-source-plugin to version 3.2.0 to achieve deterministic builds
2020-01-30 15:27:02 +01:00
Bastien Teinturier
d6d60f063f
Fix ChannelUpdate rebroadcast (#1294)
Comparing with the router ActorRef simply didn't work.
The reason is probably because Peers receive the router's supervisor ref
which doesn't match what `self` is inside `Router`.

Checking that the origin was the router felt brittle anyway.
We're now correctly typing the gossip origin.
2020-01-30 15:17:01 +01:00
Bastien Teinturier
49f72f09ad
UpfrontShutdownScript field (#1290)
We don't implement the upfront_shutdown_script feature.
However we update our encoding to always specify it.
This allows extending OpenChannel/AcceptChannel with tlv streams.

There is one caveat: Phoenix shipped with a version that's incompatible.
So we use a workaround to identify unpatched Phoenix versions
and send them the old encoding.
2020-01-29 15:44:10 +01:00
Bastien Teinturier
8d80d13d5f
Clarify ChannelsDb htlc info method (#1291)
The old name (addOrUpdateHtlcInfo) was misleading.
This method only adds, and can even handle adding duplicate lines.

Closes #1233
2020-01-29 14:30:38 +01:00
Bastien Teinturier
453a7c66b1
Trampoline/MPP DB changes (#1287)
With MPP and Trampoline (and particularly the combination of the two),
we need to keep track of multiple amounts, recipients and fees.
There's a trampoline fee and a fee to reach the first trampoline node.
The trampoline nodes must appear in the route, but not as payment recipients.

Adding new fields to payment events and DB structs lets us distinguish those.

We also relax the spec requirement about feature graph dependencies.
The requirement to include `var_onion_optin` in invoice feature bits
was added after the first Phoenix release.
Phoenix users will thus have non spec-compliant invoices in their
payment history.
We accept invoices that don't set this field; this is a harmless
spec violation (as long as we set it in new invoices).
2020-01-29 14:21:41 +01:00
Candle
16456bbce0
Turn off SSL when custom Electrum server address is a hidden service (#1278)
This will let users connect to their own custom Electrum servers that are running behind TOR (once we add proper socks5 proxy support).
2020-01-29 11:16:09 +01:00
Bastien Teinturier
0a66d3f45f
Fix availableForSend/Receive (#1293)
There was a rounding issue with the availableForSend/Receive calculation.
Because CommitTx fee and Htlc fee were computed separately,
but each was individually rounded down to Satoshis, we could
end up with an off-by-one error.

This resulted in an incapacity to send/receive the maximum amount available.
We now allow computing fees in msat, which removes rounding issues.
2020-01-28 14:20:05 +01:00
Fabrice Drouin
d5cdd6ac9b
Channel queries: Encode empty arrays as UNCOMPRESSED (#1292)
c-lightning fails to decode empty arrays of scids or timestamps with an encoding type set to COMPRESSED_ZLIB.
The spec is not specific enough on whether this is valid or not, so we'll set the encoding type of empty arrays to UNCOMPRESSED.
2020-01-28 13:25:49 +01:00
dpad85
bf0b44bdc5
Back to development 2020-01-27 14:44:10 +01:00
dpad85
babac19d84
Back to development 2020-01-27 14:36:38 +01:00
dpad85
30359d1250
Release 0.3.6-android-phoenix
Merge branch 'android' into android-phoenix
2020-01-24 15:42:31 +01:00
dpad85
39a838f58d
Release v0.3.6-android 2020-01-24 11:56:08 +01:00
dpad85
6aae73ac2a
Release v0.3.6-android-RC2 2020-01-23 16:16:17 +01:00
Bastien Teinturier
8144269a14
Allow deactivating MPP (#1289)
When paying an invoice, we weren't properly checking our own features.
If the invoice supported MPP, we would use it all the time.

If MPP isn't enabled in our features, we now default to a legacy payment.

(cherry picked from commit 60359c68e8)
2020-01-23 16:01:53 +01:00
dpad85
185e9edfbe
Back to development version 2020-01-23 15:40:28 +01:00
Bastien Teinturier
60359c68e8 Allow deactivating MPP (#1289)
When paying an invoice, we weren't properly checking our own features.
If the invoice supported MPP, we would use it all the time.

If MPP isn't enabled in our features, we now default to a legacy payment.
2020-01-23 15:38:40 +01:00
dpad85
7df9b79819
Merge branch 'android' into android-phoenix
Release 0.3.6-android-phoenix-RC1
2020-01-23 11:28:56 +01:00
dpad85
c42251aa0d
Release 0.3.6-android RC1 2020-01-22 18:59:56 +01:00
Fabrice Drouin
67118c888d
Read fee provider timeout from config correctly (#1288)
(cherry picked from commit 5551242ef0)
2020-01-22 18:57:56 +01:00
Fabrice Drouin
e3f6f08631
Peer: use a minimum reconnection delay of 200 ms (#1285)
If our initial random deconnnection delay is 0 (unlikely but possible) then all "exponential backoff" reconnection delays will be 0 too, so we set a minimum value of 200 milliseconds.

(cherry picked from commit a0ae5ef13f)
2020-01-22 18:57:40 +01:00