1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-19 09:54:02 +01:00
Commit Graph

1861 Commits

Author SHA1 Message Date
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
Pierre-Marie Padiou
0e5ec4dce9
Fix bug in enforceMinimumFeerate (#1629)
Using the `copy` method is risky because it's easy to forget newly added
fields. Also the test didn't make much sense.
2020-12-14 14:37:31 +01:00
Pierre-Marie Padiou
c13ae5e15f
Set min-fee-rate to 2 sat/byte (#1626)
We need to be above 253 sat/kw, but 3 sat/byte is overkill.
2020-12-11 17:10:55 +01:00
Pierre-Marie Padiou
08c21fa5e9
Distribute connection-handling on multiple machines using akka-cluster (#1566)
The goal is to offload the back from everything connection-related:
- incoming connections
- outgoing connections
- gossip queries + pings
- incoming gossip aggregation
- outgoing gossip dispatch (rebroadcast)

Co-authored-by: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
2020-12-08 18:41:51 +01:00
Pierre-Marie Padiou
4e567053ab
Remove old compatibility workaround for eclair mobile (#1625) 2020-12-08 17:28:26 +01:00
Bastien Teinturier
8d6af35086
Add router API for invoice routing hints (#1590)
The router can return local channels, with all necessary information to
build routing hints from these channels.

It's not eclair-core's responsibility to choose what channels to use in
routing hints: this is really a wallet strategy, so each wallet should
have its own heuristics to choose what channels to include (if any).
2020-12-08 15:31:58 +01:00
Bastien Teinturier
a4d184569b
Set initial relay fees during channel open (#1610)
It can be useful to override the default relay fees when opening channels
to specific nodes.

Note that these initial relay fees are not persisted in the DB. That means
that if your node reboots before the funding transaction confirms, the
channel will be opened with the default relay fees, not the overridden values.

Fixes #1507
2020-12-08 09:51:00 +01:00
Bastien Teinturier
040e6d08dc
Retrieve bitcoin's mempool-min-fee (#1608)
This commit contains several changes related to on-chain fees:

* Retrieve the minimum fee required to enter our mempool
* Add a metric to track this value
* Remove fallback fee providers when Bitcoin Core is used
* Add a metric to track feerate retrieval errors

For fallback fee providers that don't have any mempool information, we
default to the 1008 block target. It doesn't matter as these fee providers
will not be used anyway.
2020-12-07 19:38:01 +01:00
Pierre-Marie Padiou
3ebf601a55
Minor: Less spammy and better logs (#1618)
Less channels logs on restart, especially `channel_update` related logs that weren't very useful.
2020-12-07 15:45:39 +01:00
Bastien Teinturier
a2a980c7bd
Add channelId to websocket event (#1605)
Thanks to recent changes, the channelId is available in ChannelStateChanged.
We now propagate this information to websocket channel events.
2020-12-07 15:31:09 +01:00
Anton Kumaigorodski
8cfa3f5c1b
Set the same priority for all routing messages (#1624)
Otherwise `ReplyShortChannelIdsEnd` may overtake announcements.

There is an exception for `AnnouncementSignatures` which is more a channel message than a routing message.
2020-12-07 15:22:03 +01:00
Pierre-Marie Padiou
ce73ef3a1a
Allow overriding of Tor target (#1617)
This is useful to redirect incoming tor traffic to eclair-front.
2020-12-03 10:56:40 +01:00
Anton Kumaigorodski
ed61b577df
Improve CustomCommitmentsPlugin methods (#1613)
* Add node params and logger parameters to plugin htlc methods
* Refactor helper function to make it available for plugins
2020-12-02 17:58:05 +01:00
Pierre-Marie Padiou
848b433836
Ack htlc settlement commands after writing state (#1615)
There are two issues:
1. because we forward commands *before* writing to disk in
   `PendingRelayDb.safeSend` in order to reduce latency, there is a race
   where the channel can process and acknowledge the command before the
   db write. As a result, the command stays in the pending relay db and
   will be cleaned up by the post-restart-htlc-cleaner at next restart.
2. in the general case, the channel acknowledges commands *before* it
   writes its state to disk, which opens a window for losing the command
   if we stop eclair at that exact time.

In order to fix 2., we introduce a new `acking` transition method, which
will be called after `storing`. This method adds a delay before actually
acknowledging the commands, which should be more than enough to solve 1.

I'm not sure we need that additional delay, because now that we
acknowledge the commands *after* storing the state, the channel should
lose the race most of the time.
2020-12-01 10:53:41 +01:00
Bastien Teinturier
6330e76daf
[CI] Exclude tests that call external APIs (#1622)
These tests have been flaky because external APIs tend to be down or throttle
our calls. and we don't want our test suite to fail because of that.

In practice it's enough if developers run these tests locally once in a while.
2020-11-30 18:10:21 +01:00
Bastien Teinturier
8bfb9f08e7
Clean up bitcoinheaders error logs (#1606)
When we query future blocks that bitcoinheaders.net doesn't have, instead
of returning a DNS resolve error, it returns a DNS response without a
block header.

We want to avoid logging it as an error, so we check for this specific case.
2020-11-23 10:03:36 +01:00
Anton Kumaigorodski
6b32fd06cf
Allow plugins to force reconnect (#1594)
This can be useful to keep connections alive even when there are no channels.
2020-11-19 09:59:49 +01:00
Bastien Teinturier
06c95a7ad2
Clarify trampoline to legacy diagram (#1607)
It was implicitly doing an MPP between t2 and f, but that was misleading.
MPP is now explicitly drawn to prevent confusion.
2020-11-18 18:18:55 +01:00
Anton Kumaigorodski
407b330f04
Remove timedOutOutgoingHtlcs from AbstractCommitments (#1604) 2020-11-16 14:30:45 +01:00
Bastien Teinturier
54b589cb22
Improve MPP-send for direct channels (#1599)
When the recipient is a direct peer, we can use the accurate knowledge
of our local channels instead of hard-coded MPP parameters to choose
the number of routes and the minimum route amount.

This change makes it possible to easily send all local funds in one
payment when we're directly connected to the recipient.
2020-11-13 12:10:07 +01:00
Anton Kumaigorodski
c0e38841fc
Add a test to ensure NodeParams.nodeId always equals NodeParams.privateKey.publicKey (#1593) 2020-11-13 09:25:13 +01:00
Anton Kumaigorodski
e5db314741
Allow plugins to provide broken HTLCs after a restart (#1586)
Plugins can now implement custom commitment schemes, different from specified ones.
This requires extra care when restarting a node, as some HTLCs may be in a broken state
and need to be failed upstream.

Plugins must identify these HTLCs and implement the right trait to provide these HTLCs to
the PostRestartHtlcCleaner, which will watch them and fail/fulfill them accordingly.
2020-11-09 09:10:21 +01:00
Bastien Teinturier
c0d465c409
Fix NodeRelayer flaky test (#1588)
This test was randomly failing because of a race condition: we sometimes
sent the payment failure before the payment FSM asked for routes, so it
was ignored and the test could not progress.
2020-11-06 11:20:22 +01:00
Pierre-Marie Padiou
59449bfcfc
Increase docker timeouts for electrumx in tests (#1589) 2020-11-06 11:19:21 +01:00
Donovan
f32e75b006
Segregate the node seed from the channel seed (#1584)
* Segregate the node seed from the channel seed

- change getSeed signature
- change LocalKeyManager signature
- implement getSeeds to return both nodeSeed and channelSeed
- use separate seeds for node and channels
- update README
- create NodeKeyManager & ChannelKeyManager
- add migration tests
* add NodeParams.scala
* add Setup.scala
* remove KeyManager trait, add NodeKeyManager & ChannelKeyManager traits
* remove LocalKeyManager, add LocalNodeKeyManager & LocalChannelKeyManager
* remove LocalKeyManagerSpec, add LocalNodeKeyManagerSpec & LocalChannelKeyManagerSpec
* add Seeds class instead of ordering the seeds (fix by @t-bast)
* update usage of ChannelKeyManager class
* add signChannelAnnouncement method to each KeyManager
* fix seeds tests
* use snake_case for filename
* create crypto.keymanager package
* improve variables names
2020-11-05 11:33:50 +01:00
Bastien Teinturier
c556654093
Add blockchain watchdog (#1545)
Introduce a blockchain watchdog that fetches headers from multiple sources
in order to detect whether we're being eclipsed.

Use blockchainheaders.net, blockstream.info, blockcypher.com and mempool.space
as first sources of blockchain data. More blockchain sources can be be added
later.
2020-11-03 17:38:46 +01:00
Anton Kumaigorodski
366f9befdd
Add a case object to get router data (#1581) 2020-11-02 12:18:27 +01:00
Bastien Teinturier
1f90e5b80a
Add per-node feerate tolerance (#1575)
When we have a trusted relationship with some of our peers (business
relations, family members, our own mobile wallet, etc) it makes sense to
relax the feerate mismatch constraint.

This must be done per-node, to avoid leaving the gates open for attackers.
2020-10-23 09:31:34 +02:00
Bastien Teinturier
baa226964f
Rework features compatibility (#1576)
The `supportedMandatoryFeatures` set made less and less sense as we start
supporting more features and allowing users to turn features on and off
depending on the peers they connect to.
2020-10-23 09:30:38 +02:00
Anton Kumaigorodski
28f72e412b
Remote address in ConnectionInfo (#1579) 2020-10-22 11:57:14 +02:00
Bastien Teinturier
e74f345817
Clarify crossSign helper functions (#1578)
It's important in particular to highlight the case where an HTLC is
half-fulfilled or half-failed.
2020-10-22 11:20:08 +02:00
Bastien Teinturier
98508f3041
Fix empty replyTo in update_relay_fee (#1572)
Fixes #1570.
2020-10-20 11:01:26 +02:00
Pierre-Marie Padiou
ad17683b0f
(Minor) Fix Features.toString (#1573) 2020-10-19 17:28:21 +02:00
Anton Kumaigorodski
b0716aea88
Make Commitments a trait (#1542)
This allows easier implementation of Hosted Channels as a plugin.
2020-10-19 10:04:50 +02:00
Pierre-Marie Padiou
9c16bb75c2
Manual watching of peer-connection actor (#1567)
Instead of `Peer` watching `PeerConnection`, we have `PeerConnection`
notify `Peer` when it dies. Not relying on a watch allows for harder
security settings when enabling akka cluster.
2020-10-15 17:44:40 +02:00
Pierre-Marie Padiou
90bf08e62c
Update akka to 2.6.10 (#1568) 2020-10-15 16:26:46 +02:00
Bastien Teinturier
bffb7a3fe1
Fix race condition in integration test (#1564)
In the revoked commit tx case, both nodes are competing to claim the
HTLC outputs from the commit tx.

The test incorrectly assumed that node F would always win that race.
2020-10-15 16:23:33 +02:00
Bastien Teinturier
131b2e01c5
Add workaround for lnd sync issue (#1563)
When a channel gets confirmed while nodes are disconnected, recent lnd
nodes sometimes fail to send their channel_reestablish message and instead
send a funding_locked first (due to a race condition on their side).

When that happened, the channel stayed stuck in the SYNCING state.
To avoid that, we trigger a reconnection until the race condition is eventually
won by the channel_reestablish.
2020-10-14 13:22:37 +02:00
Bastien Teinturier
f9ff586cba
Release Eclair v0.4.2 (#1562)
* Set version to 0.4.2
* Set version to 0.4.3-SNAPSHOT
2020-10-13 15:14:40 +02:00
Donovan
3e3397cfb1
Fix Docker JAVA_OPTS expansion (#1561) 2020-10-13 11:44:34 +02:00
Donovan
4b55d3e71c
Fix typo in startup script (#1559) 2020-10-13 09:52:37 +02:00
Bastien Teinturier
3da76c08ae
Allow mandatory static-remotekey (#1558)
Since we optionally support static-remotekey, we should allow our peers
to make it mandatory if they wish.
2020-10-12 15:09:09 +02:00
Bastien Teinturier
a76db1c27b
Fix channel CMD_SIGN (#1556)
We're sending the type instead of sending an instantiated class...
Other commands were affected and are now fixed.
2020-10-12 10:42:48 +02:00
Anton Kumaigorodski
135ce6cc8b
Use maven plugin to include tests (#1557)
This results in eclair-core_2.13-<version>-tests.jar file and allows to easily reuse testing classes in other modules.
2020-10-12 10:41:52 +02:00
Bastien Teinturier
50363569c7
Fix forceclose API (#1555)
It was simply missing a sender ActorRef.
2020-10-09 18:29:16 +02:00
Pierre-Marie Padiou
eea1ba99b9
Add backward-compatibility tests on some database codecs (#1554)
* add backward compat tests on cmd codecs

* add backward compat test on feerate codec
2020-10-09 17:02:33 +02:00
Bastien Teinturier
b728520ad7
Prevent disabling var_onion_optin (#1552)
There is no good reason to completely disable `var_onion_optin` and it can
even be harmful: pending HTLCs after a restart may be lost if they used a
variable-length onion, causing a loss of funds and potential channel closes.
2020-10-09 16:50:38 +02:00
Pierre-Marie Padiou
ed61750436
Nits (#1553) 2020-10-09 11:30:14 +02:00
Pierre-Marie Padiou
20e0b4bc4d
Fix override-features implementation (#1549)
We were calling `nodeParams.features` from inside the channel, which is
problematic because we may have overridden those features for specific
peers. This is now fixed.
2020-10-08 17:59:01 +02:00