Skip to content

Commit 6220907

Browse files
committed
Merge commit '992ec8cc0dcb8437684cb3fc162b8be04f78170a' into blip18
2 parents 799e5fd + 992ec8c commit 6220907

File tree

294 files changed

+21420
-13970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+21420
-13970
lines changed

.github/workflows/latest-bitcoind.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ jobs:
4848
run: echo "fs.file-max = 1024000" | sudo tee -a /etc/sysctl.conf
4949

5050
- name: Run eclair tests
51-
run: BITCOIND_DIR=$GITHUB_WORKSPACE/bitcoin/build/src ./mvnw test
51+
run: BITCOIND_DIR=$GITHUB_WORKSPACE/bitcoin/build/bin ./mvnw test
5252
working-directory: ./eclair

.mvn/checksums/checksums-central.sha256

Lines changed: 1094 additions & 0 deletions
Large diffs are not rendered by default.

.mvn/maven.config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# trusted checksum source setup
2+
-Daether.trustedChecksumsSource.summaryFile=true
3+
-Daether.trustedChecksumsSource.summaryFile.basedir=${session.rootDirectory}/.mvn/checksums/
4+
# post processor: trusted checksums
5+
-Daether.artifactResolver.postProcessor.trustedChecksums=false
6+
-Daether.artifactResolver.postProcessor.trustedChecksums.checksumAlgorithms=SHA-256
7+
-Daether.artifactResolver.postProcessor.trustedChecksums.failIfMissing=true
8+
-Daether.artifactResolver.postProcessor.trustedChecksums.snapshots=false
9+
# Uncomment the following line to generate checksums
10+
# -Daether.artifactResolver.postProcessor.trustedChecksums.record=true

BUILD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ To re-create the trusted checksums file, run:
9595

9696
```shell
9797
$ rm ~/.m2/wrapper ~/.sbt -rf
98-
$ ./mvnw clean install scoverage:report -DskipTests -Daether.artifactResolver.postProcessor.trustedChecksums.record
98+
$ ./mvnw clean install -DskipTests -Daether.artifactResolver.postProcessor.trustedChecksums.record
9999
```

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,12 @@ eclair.chain = "regtest"
284284
eclair.bitcoind.rpcport=18443
285285
```
286286

287-
For signet, add `signet=1` in `bitcoin.conf` or start with `-signet`, and modify `eclair.conf`:
287+
For signet, add `signet=1` in `bitcoin.conf` or start with `-signet`, and modify `eclair.conf` as follows. The `signet-check-tx` config parameter should be the txid of a transaction that exists in your signet, "" to skip this check, or if not specified, the default signet txid value will be used.
288288

289289
```conf
290290
eclair.chain = "signet"
291291
eclair.bitcoind.rpcport=38332
292+
eclair.bitcoind.signet-check-tx=<txid of signet tx>
292293
```
293294

294295
You may also want to take advantage of the new configuration sections in `bitcoin.conf` to manage parameters that are network specific,

docs/FAQ.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FAQ
22

3-
## What does it mean for a channel to be "enabled" or "disabled" ?
3+
## What does it mean for a channel to be "enabled" or "disabled"?
44

55
A channel is disabled if a `channel_update` message has been broadcast for that channel with the `disable` bit set (see [BOLT 7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message)). It means that the channel still exists but cannot be used to route payments, until it has been re-enabled.
66

@@ -13,6 +13,16 @@ There are other cases when a channel becomes disabled, for example when its bala
1313

1414
Note that you can have multiple channels between the same nodes, and that some of them can be enabled while others are disabled (i.e. enable/disable is channel-specific, not node-specific).
1515

16-
## How should you stop an Eclair node ?
16+
## How do I make my closing transactions confirm faster?
17+
18+
When channels are unilaterally closed, there is a delay before which closing transactions can be published: you must wait for this delay before you can get your funds back.
19+
20+
Once published, transactions will be automatically RBF-ed by `eclair` based on your configuration values for the [`eclair.on-chain-fees` section](../eclair-core/src/main/resources/reference.conf).
21+
22+
Note that there is an upper bound on the feerate that will be used, configured by the `eclair.on-chain-fees.max-closing-feerate` parameter.
23+
If the current feerate is higher than this value, your transactions will not confirm.
24+
You should update `eclair.on-chain-fees.max-closing-feerate` in your `eclair.conf` and restart your node: your transactions will automatically be RBF-ed using the new feerate.
25+
26+
## How should you stop an Eclair node?
1727

1828
To stop your node you just need to kill its process, there is no API command to do this. The JVM handles the quit signal and notifies the node to perform clean-up. For example, there is a hook to cleanly free DB locks when using Postgres.

docs/release-notes/eclair-v0.13.0.md

Lines changed: 268 additions & 0 deletions
Large diffs are not rendered by default.

eclair-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>fr.acinq.eclair</groupId>
2323
<artifactId>eclair_2.13</artifactId>
24-
<version>0.12.0</version>
24+
<version>0.13.0</version>
2525
</parent>
2626

2727
<artifactId>eclair-core_2.13</artifactId>

eclair-core/src/main/resources/reference.conf

Lines changed: 52 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ eclair {
4242
final-pubkey-refresh-delay = 3 seconds
4343
// If true, eclair will poll bitcoind for 30 seconds at start-up before giving up.
4444
wait-for-bitcoind-up = true
45+
// The txid of a transaction that exists in your custom signet network or "" to skip this check.
46+
signet-check-tx = "ff1027486b628b2d160859205a3401fb2ee379b43527153b0b50a92c17ee7955" // coinbase of block #5000 of default signet
4547
}
4648

4749
node-alias = "eclair"
@@ -72,11 +74,12 @@ eclair {
7274
option_shutdown_anysegwit = optional
7375
option_dual_fund = optional
7476
option_quiesce = optional
77+
option_attribution_data = optional
7578
option_onion_messages = optional
7679
// This feature should only be enabled when acting as an LSP for mobile wallets.
7780
// When activating this feature, the peer-storage section should be customized to match desired SLAs.
7881
option_provide_storage = disabled
79-
option_channel_type = optional
82+
option_channel_type = mandatory
8083
option_scid_alias = optional
8184
option_payment_metadata = optional
8285
// By enabling option_zeroconf, you will be trusting your peer as fundee. You will lose funds if they double spend
@@ -133,7 +136,7 @@ eclair {
133136

134137
to-remote-delay-blocks = 720 // number of blocks that the other node's to-self outputs must be delayed (720 ~ 5 days)
135138
max-to-local-delay-blocks = 2016 // maximum number of blocks that we are ready to accept for our own delayed outputs (2016 ~ 2 weeks)
136-
min-depth-blocks = 6 // minimum number of confirmations for channel transactions, which we will additionally scale based on the amount at stake
139+
min-depth-blocks = 8 // minimum number of confirmations for channel transactions to be safe from reorgs
137140
expiry-delta-blocks = 144
138141
max-expiry-delta-blocks = 2016 // we won't forward HTLCs with timeouts greater than this delta
139142
// When we receive the preimage for an HTLC and want to fulfill it but the upstream peer stops responding, we want to
@@ -166,7 +169,7 @@ eclair {
166169
// (with the default behavior, it would "only" cause a local force-close of the channel).
167170
unhandled-exception-strategy = "local-close" // local-close or stop
168171

169-
revocation-timeout = 20 seconds // after sending a commit_sig, we will wait for at most that duration before disconnecting
172+
revocation-timeout = 60 seconds // after sending a commit_sig, we will wait for at most that duration before disconnecting
170173

171174
channel-open-limits {
172175
max-pending-channels-per-peer = 3 // maximum number of pending channels we will accept from a given peer
@@ -248,6 +251,18 @@ eclair {
248251
// Number of blocks before the incoming HTLC expires that an async payment must be triggered by the receiver
249252
cancel-safety-before-timeout-blocks = 144
250253
}
254+
255+
// We assign reputation to our peers to prioritize payments during congestion.
256+
// The reputation is computed as fees paid divided by what should have been paid if all payments were successful.
257+
peer-reputation {
258+
// Set this parameter to false to disable the reputation algorithm and simply relay the incoming endorsement
259+
// value, as described by https://github.com/lightning/blips/blob/master/blip-0004.md,
260+
enabled = true
261+
// Reputation decays with the following half life to emphasize recent behavior.
262+
half-life = 30 days
263+
// Payments that stay pending for longer than this get penalized.
264+
max-relay-duration = 5 minutes
265+
}
251266
}
252267

253268
on-chain-fees {
@@ -268,9 +283,17 @@ eclair {
268283
closing = medium
269284
}
270285

286+
// Maximum feerate that will be used when closing channels for outputs that aren't at risk (main balance and HTLC 3rd-stage transactions).
287+
// Using a low value here ensures that you won't be paying high fees when the mempool is congested and you're not in
288+
// a hurry to get your channel funds back.
289+
// If closing transactions don't confirm and you need to get the funds back quickly, you should increase this value
290+
// and restart your node: closing transactions will automatically be RBF-ed to match the current feerate.
291+
// This value is in satoshis per byte.
292+
max-closing-feerate = 10
293+
271294
feerate-tolerance {
272-
ratio-low = 0.5 // will allow remote fee rates as low as half our local feerate when not using anchor outputs
273-
ratio-high = 10.0 // will allow remote fee rates as high as 10 times our local feerate when not using anchor outputs
295+
ratio-low = 0.5 // will allow remote fee rates as low as half our local feerate (only enforced when not using anchor outputs)
296+
ratio-high = 10.0 // will allow remote fee rates as high as 10 times our local feerate (for all commitment formats)
274297
// when using anchor outputs, we only need to use a commitment feerate that allows the tx to propagate: we will use CPFP to speed up confirmation if needed.
275298
// the following value is the maximum feerate we'll use for our commit tx (in sat/byte)
276299
anchor-output-max-commit-feerate = 10
@@ -374,10 +397,10 @@ eclair {
374397
}
375398

376399
peer-connection {
377-
auth-timeout = 15 seconds // will disconnect if connection authentication doesn't happen within that timeframe
378-
init-timeout = 15 seconds // will disconnect if initialization doesn't happen within that timeframe
400+
auth-timeout = 30 seconds // will disconnect if connection authentication doesn't happen within that timeframe
401+
init-timeout = 30 seconds // will disconnect if initialization doesn't happen within that timeframe
379402
ping-interval = 30 seconds
380-
ping-timeout = 20 seconds // will disconnect if peer takes longer than that to respond
403+
ping-timeout = 60 seconds // will disconnect if peer takes longer than that to respond
381404
ping-disconnect = true // disconnect if no answer to our pings
382405
// When enabled, if we receive an incoming connection, we will echo the source IP address in our init message.
383406
// This should be disabled if your node is behind a load balancer that doesn't preserve source IP addresses.
@@ -404,6 +427,9 @@ eclair {
404427

405428
router {
406429
watch-spent-window = 60 minutes // at startup watches on public channels will be put back within that window to reduce herd effect; must be > 0s
430+
// when we detect that a remote channel has been spent on-chain, we wait for 72 blocks before removing it from the graph
431+
// if this was a splice instead of a close, we will be able to simply update the channel in our graph and keep its reputation
432+
channel-spent-splice-delay = 72
407433

408434
channel-exclude-duration = 60 seconds // when a temporary channel failure is returned, we exclude the channel from our payment routes for this duration
409435
broadcast-interval = 60 seconds // see BOLT #7
@@ -434,6 +460,11 @@ eclair {
434460
default {
435461
randomize-route-selection = true // when computing a route for a payment we randomize the final selection
436462

463+
mpp {
464+
min-amount-satoshis = 15000 // minimum amount sent via partial HTLCs
465+
max-parts = 5 // maximum number of HTLCs sent per payment: increasing this value will impact performance
466+
}
467+
437468
boundaries {
438469
max-route-length = 6 // max route length for the 'first pass', if none is found then a second pass is made with no limit
439470
max-cltv = 2016 // max acceptable cltv expiry for the payment (2016 ~ 2 weeks)
@@ -442,7 +473,14 @@ eclair {
442473
max-fee-proportional-percent = 3 // that's 3%
443474
}
444475

445-
use-ratios = true // if false, will use failure-cost
476+
hop-cost {
477+
// virtual fee for additional hops: how much you are willing to pay to get one less hop in the payment path
478+
fee-base-msat = 500
479+
fee-proportional-millionths = 200
480+
}
481+
482+
use-ratios = true // if true, will use `ratios`, if false, will use `failure-cost`, `locked-funds-risk`, `use-log-probability`, `use-past-relay-data`.
483+
446484
// channel 'weight' is computed with the following formula: (channelFee + hop-cost) * (ratio-base + cltvDelta * ratio-cltv + channelAge * ratio-channel-age + channelCapacity * ratio-channel-capacity)
447485
// the following parameters can be used to ask the router to use heuristics to find i.e: 'cltv-optimized' routes, **the sum of the four ratios must be 1**
448486
ratios {
@@ -452,17 +490,12 @@ eclair {
452490
channel-capacity = 0.55 // when computing the weight for a channel, consider its CAPACITY in this proportion
453491
}
454492

455-
hop-cost {
456-
// virtual fee for additional hops: how much you are willing to pay to get one less hop in the payment path
457-
fee-base-msat = 500
458-
fee-proportional-millionths = 200
459-
}
493+
// Everything below is ignored if use-ratio = true.
460494

461495
locked-funds-risk = 1e-8 // msat per msat locked per block. It should be your expected interest rate per block multiplied by the probability that something goes wrong and your funds stay locked.
462496
// 1e-8 corresponds to an interest rate of ~5% per year (1e-6 per block) and a probability of 1% that the channel will fail and our funds will be locked.
463497

464498
// virtual fee for failed payments: how much you are willing to pay to get one less failed payment attempt
465-
// ignored if use-ratio = true
466499
failure-cost {
467500
fee-base-msat = 2000
468501
fee-proportional-millionths = 500
@@ -473,10 +506,10 @@ eclair {
473506
// probability of success, however is penalizes less the paths with a low probability of success.
474507
use-log-probability = false
475508

476-
mpp {
477-
min-amount-satoshis = 15000 // minimum amount sent via partial HTLCs
478-
max-parts = 5 // maximum number of HTLCs sent per payment: increasing this value will impact performance
479-
}
509+
// When set to false, we assume that the balances of channels are uniformly distributed. That means the
510+
// probability that we can send an amount X through a channel of capacity C is 1 - X / C.
511+
// When set to true, past payments attempts will be used to compute a better estimate.
512+
use-past-relay-data = false
480513
}
481514

482515
// The path-finding algo uses one or more sets of parameters named experiments. Each experiment has a percentage

eclair-core/src/main/scala/fr/acinq/eclair/DBChecker.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ object DBChecker extends Logging {
3232
Try(nodeParams.db.channels.listLocalChannels()) match {
3333
case Success(channels) =>
3434
channels.foreach {
35-
case data: ChannelDataWithCommitments if !data.commitments.validateSeed(nodeParams.channelKeyManager) => throw InvalidChannelSeedException(data.channelId)
35+
case data: ChannelDataWithCommitments =>
36+
val channelKeys = nodeParams.channelKeyManager.channelKeys(data.channelParams.channelConfig, data.channelParams.localParams.fundingKeyPath)
37+
if (!data.commitments.validateSeed(channelKeys)) {
38+
throw InvalidChannelSeedException(data.channelId)
39+
}
3640
case _ => ()
3741
}
3842
channels

0 commit comments

Comments
 (0)