1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-19 18:10:42 +01:00
Commit Graph

1909 Commits

Author SHA1 Message Date
Bastien Teinturier
083515086f
Update funding timeout fundee (#1692)
Our previous timeout was based on timestamps, mostly because blockCount
could be 0 on mobile using Electrum until a new block was received.
Now that we're diverging from the mobile wallet codebase, we can use block
heights instead which is more accurate.

See lightningnetwork/lightning-rfc#839
2021-02-19 14:16:30 +01:00
Bastien Teinturier
ab89851cdf
Relax single tx input requirements (#1677)
In some places of the codebase we relied on the fact that lightning transactions
had a single input. That was correct with the standard commitments format,
but will not be the case with anchor outputs: 2nd-stage txs (htlc-txs) and
3rd-stage txs (claim-htlc-txs) can be RBF-ed and have any number of inputs
and outputs.
2021-02-18 15:39:08 +01:00
Bastien Teinturier
9618a6a79c
Add a maximum fee threshold for anchor outputs (#1672)
With anchor outputs, the actual feerate for the commit tx can be decided
when broadcasting the tx by using CPFP on the anchor.

That means we don't need to constantly keep the channel feerate close to
what's happening on-chain. We just need a feerate that's good enough to get
the tx to propagate through the bitcoin network.

We set the upper threshold to 10 sat/byte, which is what lnd does as well.
We let the feerate be lower than that when possible, but do note that
depending on your configured `feerate-tolerance`, that means you can still
experience some force-close events because of feerate mismatch.

Fix anchor outputs closing fee requirements: when using anchor outputs,
the mutual close fee is allowed to be greater than the commit tx fee,
because we're targeting a specific confirmation window.

Fix fee mismatch without htlc: we allow disagreeing on fees while the channel
doesn't contain any htlc, because no funds can be at risk in that case.
But we used the latest signed fee when adding a new HTLC, whereas we must
also take into account the latest proposed (unsigned) fee.
2021-02-18 14:20:36 +01:00
Thomas Profelt
fdb57b43d3
Find route between nodes (#1695)
Added additional method to Eclair like findRoute but allowing for 2 nodeIds.
Also added a new endpoint to the http Api "findroutebetweennodes" which
takes sourceNode and targetNode as params.

Fixes #1068
2021-02-18 13:55:50 +01:00
Bastien Teinturier
3a94a80447
Reject unreasonable remote dust limit (#1694)
It makes no sense to use a dust limit that's much higher than what bitcoin
mandates, so we should not allow our peer to use invalid values.
2021-02-17 15:17:44 +01:00
Bastien Teinturier
82e5b5968d
Sort addresses in node announcement (#1693)
Addresses in node announcement should be sorted.
We accept node announcements that don't do this, but we should do it for
our own announcements.

See https://github.com/lightningnetwork/lightning-rfc/pull/842
2021-02-17 15:12:39 +01:00
Bastien Teinturier
2a359c6a56
Publish txs with min-relay-fee met (#1687)
When our mempool is full, its min-relay-fee may be constantly changing.
To ensure our txs can be published, we need to check the min-relay-fee when
we fund the transaction, and raise it if necessary.
2021-02-15 19:17:48 +01:00
Bastien Teinturier
36e8c056f1
Shutdown and UpdateFee should not be intertwined (#1661)
We were not correctly handling intertwined `update_fee` and `shutdown` 
and could end up stuck between shutdown and negotiating.
2021-02-15 18:33:31 +01:00
Bastien Teinturier
fdeb3ce7e1
Correctly set gossip sync_complete (#1668)
We are restoring the previous behavior of using the `sync_complete` field
to signal the end of a `channel_range_query` sync.

The first step is to correctly set that field, before we can read it and
interpret it to mark the end of sync.

See https://github.com/lightningnetwork/lightning-rfc/pull/826
2021-02-15 17:05:48 +01:00
Bastien Teinturier
72179de0a4
PaymentLifecycle handle disconnected peers (#1688)
When a peer is disconnected, the register will return a forward failure.
This can happen if the peer is connected when we start the payment FSM and
then disconnects before we send them an HTLC.
2021-02-12 18:42:46 +01:00
Bastien Teinturier
15c1837d84
Add tx signing metrics (#1659)
Monitor the rate at which we sign channel txs and the duration of the
signing operations.
2021-02-12 12:10:56 +01:00
Bastien Teinturier
5d3958dd03
Fix MPP path-finding edge case (#1685)
Obviously the route amount must be strictly positive.
We don't control htlcMinimumMsat (it is set by our peer) and for backwards
compatibility reasons we allow it to be 0 msat (even though it doesn't make
much sense), so we need to enrich our condition to detect empty channels.
2021-02-08 11:49:38 +01:00
Aris
63d972bdc6
Fix a few typos (#1684)
Fix a few typos in the documentation and variable names.
2021-02-08 11:20:23 +01:00
Bastien Teinturier
f241ef933b
Remove support for initial_routing_sync (#1683)
We keep the GetRoutingState API available in the router as it's useful to
query network information locally (or between actors), but we stop sending
that data to remote nodes.
2021-02-04 16:53:41 +01:00
Bastien Teinturier
49023625b2
Refactor channel test helpers (#1682)
It's useful to separate channel state test methods in a dedicated trait
instead of always bundling it with `FixtureTestSuite`.

In particular, it was previously impossible to use both `BitcoindService`
and `StateTestsHelperMethods` because `BitcoindService` doesn't work with
fixtures (it leverages `beforeAll` and `afterAll` instead because launching
one bitcoind instance per-test would be too expensive and useless).
2021-02-04 16:52:05 +01:00
Pierre-Marie Padiou
d05318832f
Truncate hex strings in front logs (#1679)
Front-end logs can produce a huge amount of logs, with significant
duplication. In order to reduce the log volume, we truncate `nodeId` and
`channelId` in the MDC to only keep the first 8 hexadecimal characters.

Also, override a few `toString` because some channel-queries-related
case classes produce huge strings.
2021-02-04 16:46:49 +01:00
Bastien Teinturier
ac054a2bb2
Only sync with channel peers (#1587)
This reduces the bandwidth used: it doesn't make sense to sync with every
node that connects to us.

We also better track sync requests, to reject unsolicited sync responses.

To ensure that nodes don't need to explicitly reconnect after creating
their first channel in order to get the routing table, we add a mechanism
to trigger a sync when the first channel is created.
2021-02-04 15:27:08 +01:00
Bastien Teinturier
0127ace408
Remote failure updating routing hint (#1675)
The routing hint we get in a Bolt 11 invoice may be obsolete when we attempt
the payment: one of the nodes in the route may have updated his relay fees.

Since this affects a private channel that is not kept in the routing graph,
we need to update the routing hints before injecting them in the router.
This was already done in `PaymentLifecycle` with automatic retries, but when
using MPP we retried in the `MultiPartPaymentLifecycle` instead of inside
the `PaymentLifecycle`, so we need to handle routing hints updates there.
2021-02-01 11:39:55 +01:00
Pierre-Marie Padiou
c75d91436d
Fix failing reconnection tests (#1678)
Some reconnection tests seem to be overly strict, it makes them flaky for
no good reason (or so it seems).
2021-02-01 10:58:03 +01:00
Bastien Teinturier
34e901db75
Clarify default relay fee change (#1673)
Clarify why we don't actively update channel relay fees when the default
values change in eclair.conf. It would override manual changes made via
the API which is bad.
2021-01-20 18:52:18 +01:00
Bastien Teinturier
54ca292209
Remove kamon tracing (#1662)
It's costly, we're not using it, and it's too invasive.
There's no reason to keep it at the moment.
2021-01-20 18:35:16 +01:00
Bastien Teinturier
81f15aabd9
Refactor and improve some channel tests (#1654)
* Add a few more tests around channel_reestablish scenarios.
* Enrich existing tests and refactor common parts.
2021-01-19 16:51:25 +01:00
Bastien Teinturier
9c4ab7d923
Fix HTLC fulfill race condition in integration spec (#1666)
We were extracting F's commit tx from its internal state right after receiving
the `PaymentSent` event. The issue is that this could happen before the fulfill
was completely signed on both sides, so the commit tx we obtained would still
contain the HTLC and would be different from the one F would publish when
closing.
2021-01-19 15:56:16 +01:00
Bastien Teinturier
d40b321d92
Blockchain watchdogs use unique actor name (#1667)
Actor names cannot conflict.

Even though blockchain watchdog actors stop themselves after fetching block
data, when blocks are found in a short interval, we may end up with multiple
actors of the same type simultaneously alive, so we need them to have
unique names.

The blockcount isn't sufficient to make their names unique because forks
can happen.

Fixes #1665
2021-01-19 15:50:15 +01:00
Bastien Teinturier
e369ba9a1e
More aggressively re-emit private channel updates (#1671)
We had a delay mechanism before re-enabling reconnected channels
to avoid creating frequent channel updates on flappy connections and flooding
the network with unnecessary gossip.

We don't need this protection for private channels since they're not gossiped
to the rest of the network. And in the case of private channels to mobile
wallets, we don't want to add any delay, otherwise the reconnected channel
will not be in the router's graph and we'll have issues routing payments to
that wallet (especially if they quickly disconnect, before our 10-seconds
delay).
2021-01-19 15:41:12 +01:00
Bastien Teinturier
b477d179ea
Update build instructions for front (#1658)
It seems like we need to compile eclair-core's tests for the front
(but we don't require running them).

Fixes #1657
2021-01-06 18:38:40 +01:00
Bastien Teinturier
629c2e69ca
Fix rare race conditions in integration tests (#1653)
When a channel goes to the CLOSED state, the actor will stop itself.

We were previously sending messages to the actor asking for its state,
which returns a failure when the actor is stopped. We can simply listen
to state events to safely get the same result.
2021-01-06 18:38:18 +01:00
Bastien Teinturier
7343283f9f
Add test for duplicate temporary channel id (#1660)
This scenario was correctly handled, but we were missing test coverage.
2021-01-06 18:37:29 +01:00
Anton Kumaigorodski
dd8975aebe
Make ChannelVersion methods public (#1656) 2020-12-29 15:40:40 +01:00
Anton Kumaigorodski
5f9d0d9108
Relax cltv-expiry-delta requirement when selecting a channel to relay (#1655)
We only need the `cltv-expiry-delta` offered to be greater than our
requirement instead of strictly equal.

Co-authored-by: t-bast <bastuc@hotmail.fr>
2020-12-29 14:21:51 +01:00
Pierre-Marie Padiou
b75f6c36e9
Fix duplicate commit id in awseb bundle (#1650) 2020-12-18 16:27:09 +01:00
Bastien Teinturier
923ca26fec
Set version to 0.5.1-SNAPSHOT (#1651) 2020-12-18 16:24:32 +01:00
Bastien Teinturier
35b070ee5d
Set version to 0.5.0 (#1649) 2020-12-18 15:23:36 +01:00
Pierre-Marie Padiou
d44ff85d38
(Minor) Improve logs (#1648)
We need to manually set the MDC in `onTermination` handler because the `StopEvent` isn't processed like a regular message by the actor.
2020-12-18 14:10:55 +01:00
Pierre-Marie Padiou
39d9bfbec5
Add cluster doc, and packaging improvements (#1646)
We now use a regular release zip, and use it in the awseb bundle.

The default logback configuration now logs to a file, like
`eclair-node`, and we use a dedicated logback configuration for AWS
beanstalk.

By default the front reads the node secret key from the node seed in
the standard `.eclair` directory.
2020-12-18 11:36:24 +01:00
Bastien Teinturier
5e6c28e8f8
ElectrumWatcher: fix for unconfirmed txs (#1647)
Electrum can return unconfirmed txs in an address' history. When that
happens, we should not try to fetch its confirmed position, it will
return an error.

We simply need to ignore these events and wait for the tx to confirm.
2020-12-18 11:35:17 +01:00
Pierre-Marie Padiou
370fe416c7
Measure the distribution of payments across nodes (#1644)
We put nodes in buckets in order to build a distribution and monitor
incoming/outgoing payment count/volume by node id.
2020-12-17 15:56:53 +01:00
Pierre-Marie Padiou
9425fd4beb
Make PluginParams a simple trait (#1643)
Otherwise we can't extend it in other projects.
2020-12-16 11:20:37 +01:00
Bastien Teinturier
413ee29dab
Fix htlc origin JSON serialization (#1641)
A recent refactoring to include a `replyTo` parameter made the JSON
serialization ugly and hard to work with.

Fixes #1611
2020-12-16 10:55:30 +01:00
Pierre-Marie Padiou
dae5eeedb3
Disable the distibuted pubsub extension by default (#1642)
It only needs to be enabled in cluster mode.
2020-12-16 10:51:25 +01:00
Bastien Teinturier
183bdde0c7
Activate static_remotekey by default (#1639)
We activate static_remotekey by default (optional).
This is necessary since lnd will start making it mandatory in their next
release.
2020-12-15 17:01:50 +01:00
Bastien Teinturier
30735b40f5
fixup! Settle HTLCs revoked commit (#1630) (#1638) 2020-12-15 13:05:05 +01:00
Bastien Teinturier
810323ca30
Settle HTLCs revoked commit (#1630)
When a revoked commitment is published, we didn't correctly settle pending
HTLCs, which could lead to upstream channel closure.

This would not cause a loss of funds (especially since we would gain
funds from the revoked channel) but it's a temporary liquidity loss that
we'd like to avoid.
2020-12-15 12:35:26 +01:00
Bastien Teinturier
95b34f270f
Fix duplicate implicit btc amount conversions (#1637)
Bitcoin-lib introduced conversions from `Long` to bitcoin amounts.
It clashed with the ones previously defined in eclair.

Fixes #1632
2020-12-15 11:32:21 +01:00
Pierre-Marie Padiou
bbbd229468
Accept remote's closing fee when we have nothing at stake (#1633)
If we have nothing at stake there is no need to negotiate and we accept
their fee right away.
2020-12-15 11:24:19 +01:00
Pierre-Marie Padiou
ade17ecb72
Use a local actorsystem by default (#1636) 2020-12-14 19:45:48 +01:00
Bastien Teinturier
df7789ed07
Add metrics to track utxos (#1609)
* Total utxos amount
* Number of utxos
* Split by status: unconfirmed, unsafe, safe and confirmed
* Disallow unconfirmed chains longer than 25
2020-12-14 18:16:55 +01:00
Bastien Teinturier
c7cc536b9d
Improve channel exceptions (#1585)
* Try -> Either in commitments
* Cleanup unused sender in tests
* Try -> Either in helpers
* ValidateParams should return an Either
2020-12-14 17:28:35 +01:00
Pierre-Marie Padiou
0ce993d6d9
fixup! Distribute connection-handling (#1566) (#1634) 2020-12-14 17:24:34 +01:00
Pierre-Marie Padiou
e8b47e14a7
Move fee provider configuration section (#1631)
* move and rename fee provider parameters

* set the min-feerate to 1 sat/byte

This only affects the value returned by fee providers, it is
overriden by the other bitcoin-core enforced minimum (currently 253
sat/kiloweight).
2020-12-14 17:11:08 +01:00