1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-24 14:50:46 +01:00
Commit graph

1875 commits

Author SHA1 Message Date
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
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