1
0
mirror of https://github.com/ACINQ/eclair.git synced 2025-01-19 05:33:59 +01:00
Commit Graph

593 Commits

Author SHA1 Message Date
Donovan
e6909cfcb5
Implement the KeySend feature, spontaneous payments (#1485)
Support for receiving and sending KeySend payment is added.

For an explanation of the KeySend feature see: https://github.com/ElementsProject/lightning/pull/3611
2020-07-21 16:30:03 +02:00
Bastien Teinturier
625e996ae0
Update MinFinalCltvExpiryDelta default value and activate wumbo (#1483)
* Activate wumbo by default

This is safe as `max-funding-satoshis` is set to 16777215 sats, which is
the non-wumbo limit.

If users want to increase the maximum channel size, they can update this
configuration value.

* Update default minFinalCltvExpiryDelta

See https://github.com/lightningnetwork/lightning-rfc/pull/785

* Set minFinalCltvExpiryDelta in invoices

Our default fulfill-safety-window is now greater than the spec's default
min-final-expiry-delta in invoices, so we need to explicitly tell payers
what value they must use.

Otherwise we may end up closing channels if a block is produced while we're
waiting for our peer to accept an UpdateFulfillHtlc.
2020-07-21 14:37:59 +02:00
Fabrice Drouin
ea57bb266c
Release 0.4.1 (#1481)
* Set version to 0.4.1

* Set version to 0.4.2-SNAPSHOT
2020-07-20 12:00:01 +02:00
rorp
b63c4aa5a4
Postgresql support (#1249)
Add beta support for PostgreSQL database backend.
2020-07-01 14:52:36 +02:00
Bastien Teinturier
7ec3ba829a
Fix channelstats (for real?) (#1470)
The channelstats API only returns results for the *outgoing* channels
used when relaying. We must also include the *incoming* channels, otherwise
it looks like they're inactive which doesn't reflect their real usage.

Fixes #1465
2020-06-30 17:11:04 +02:00
Bastien Teinturier
0563d6d6ce
Update allnodes API (#1468)
Rename to `nodes`.
Allow filtering for specific `nodeId`s.

Fixes #1460
2020-06-23 15:28:48 +02:00
Bastien Teinturier
676a45c19c
Add on-chain APIs (#1461)
* Add on-chain balance API: fixes #1457
* Add API to list wallet on-chain transactions: fixes  #1459
* Add API to send on-chain funds: fixes #1458
2020-06-19 18:02:39 +02:00
Bastien Teinturier
570fe57baa
Add friendly network name to GetInfo response (#1456)
This is friendlier to interpret than mapping this from the chain's genesis
block hash.
2020-06-19 16:07:08 +02:00
Bastien Teinturier
c04a4cef2a
Accept multiple channels for some API (#1440)
It's handy to update relay fees for multiple channels at once.
Closing and force-closing channels may also make sense to do in batch.

Closes #1432
2020-06-03 11:06:45 +02:00
araspitzu
029cafe297
Use human readable features in configuration (#1385)
* Parse human readable features from configuration, print features in human readable format.
2020-05-19 13:58:19 +02:00
Pierre-Marie Padiou
24b43e9a49
Use actor system as conf container (#1420)
This seems to be recommended practice:
https://doc.akka.io/docs/akka/current/general/actor-systems.html#configuration-container.

As a nice side effect, it allows putting akka-related config in eclair.conf.

Also, reorganize reference.conf/application.conf.
2020-05-18 17:12:21 +02:00
araspitzu
4e4c7c9366
Put shebang in first line of launcher scripts (#1423) 2020-05-18 16:00:03 +02:00
rorp
ff5362e4eb
Fix eclair-node.sh for OSX (#1424) 2020-05-15 08:51:22 +02:00
Bastien Teinturier
c4d0604b72
Payment lifecycle refactor (#1414)
* Extract faulty channels selection from PaymentLifecycle

Move the logic of figuring out which channels/nodes should be ignored
when retrying after a payment failure out of the PaymentLifecycle.

We can figure this out looking only at the `PaymentFailure` generated,
and the multi-part logic could leverage these helpers.

* Refactor RouteResponse

It was useless to return `ignoreNodes` and `ignoreChannels`, it's rather
the responsibility of the caller (PaymentLifecycle) to store and update
these sets.

Preparing for the MPP move inside the router, we introduce a Route class
and let RouteResponse return a collection of Routes.

This creates some ugliness in PaymentLifecycle because of the `routePrefix`,
but this is just temporary: the `routePrefix` "hack" will be removed soon.
2020-05-12 11:41:25 +02:00
Fabrice Drouin
273a3f0966
Release 0.4 (#1409)
* Release 0.4

* Set version to 0.4.1-SNAPSHOT
2020-05-05 14:55:09 +02:00
Pierre-Marie Padiou
19975d3d81
Update to scala 2.13 and akka 2.6 (incremental) (#1390)
This is almost a drop-in replacement. I had to relaxed compiler
parameters to allow deprecated features though.

Main changes:
- relaxed compiler parameters to minimize impact (e.g. allow
deprecated features)
- `scala.collection.JavaConverters` -> `scala.jdk.CollectionConverters`
- `MultiMap` -> `MultiDict`

Compilation is 25% faster on my machine, compiler is a bit more strict
(it found an "invalid comparison" bug).
2020-04-27 13:11:55 +02:00
Pierre-Marie Padiou
f4b56407b4
Prepare upgrade to scala 2.13 and akka 2.6 (#1389)
Do all the changes that will be required and are already possible to
minimize the diff:
- update dependencies
- `'something` -> `Symbol("something")`
- `BigDecimal.xValue()` -> `BigDecimal.xValue`
- `Map.filterKeys` -> `Map.filterKeys.toMap` (same for `Map.mapValues`)
- `def myMethod(...)` -> `def myMethod(...): Unit`
2020-04-24 15:31:25 +02:00
Pierre-Marie Padiou
9cb14ee08c
Add logback config for eclair-node tests (#1377)
Otherwise we use the default logback.xml file which writes to a rolling file in the user directory.
2020-04-15 11:53:33 +02:00
Pierre-Marie Padiou
a58678eb0b
Move router handlers to separate files (#1352)
Also, acknowledge all gossip with a `GossipDecision`.
2020-04-09 16:08:10 +02:00
Fabrice Drouin
d5951aa819
Release 0.3.4 (#1368)
* Release 0.3.4

* Set version to 0.3.5-SNAPSHOT
2020-04-06 13:41:17 +02:00
Pierre-Marie Padiou
4875d4c879
fixup! Use CLTV as tie-breaker for offered htlc output sorting (#790) (#1360)
* removed the `Direction` class

* improved the non-reg test for htlcs

- check actual content instead of only success and roundtrip
- use randomized data for all fields instead of all-zero
- check the remaining data, not only the decoded value (codecs are
chained so a regression here will cause the next codec to fail)

Co-Authored-By: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
2020-03-31 18:31:47 +02:00
araspitzu
65371cd03b
Add more information to GetInfoResponse (#1344)
Add version, color and features
2020-03-10 14:17:09 +01:00
Pierre-Marie Padiou
21daafe8ac
Update kanela-agent 1.0.1->1.0.5 (#1341)
NB: using `addJava "-javaagent:$lib_dir/kanela-agent-*.jar"` in scripts
to make them update proof doesn't work unfortunately.
2020-03-05 14:19:25 +01:00
araspitzu
f978cfb75d
Avoid illegal reflective operation during startup (#1313)
* Rework plugin loading:

 We now require the plugin to supply a manifest entry for the "Main-Class" attribute, this is used to load the plugin without doing illegal reflection operations. We also get rid of the dependency org.clapper.classutil
2020-02-28 18:29:54 +01:00
Bastien Teinturier
bb930cd8b0
Channel sends typed responses (#1321)
Instead of sending strings, channel now sends typed responses.
This is more future-proof when we want to add data to those responses.
2020-02-25 10:18:51 +01:00
araspitzu
a0286458c6
Rework packaging (#1307)
* Replace maven-capsule-plugin with maven-assembly-plugin in eclair-node and eclair-node-gui:
 The new packaging produces a zip file containing a launcher script and all the artifacts and dependencies in lib/.

* Add bash launcher scripts for eclair-node and eclair-node-gui, inspired by https://github.com/sbt/sbt-native-packager/blob/master/src/main/resources/com/typesafe/sbt/packager/archetypes/scripts/bash-template

* Add windows launcher scripts, inspired by https://github.com/sbt/sbt-native-packager/blob/master/src/main/resources/com/typesafe/sbt/packager/archetypes/scripts/bat-template

* Add option to start kanela agent with eclair-node launcher scripts

* Force unix file ending in launcher scripts

* Add eclair-cli in the bin folder of packaged eclair-node and eclair-node-gui
2020-02-24 15:42:26 +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
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
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
Bastien Teinturier
72338ab58d
Flat features (#1253)
Implement https://github.com/lightningnetwork/lightning-rfc/pull/666

Keep the global/local split in Commitments to avoid backwards incompatibility in the codec.
Remove allowMultiPart API field: we instead rely on the MPP feature being set in nodeParams.
That means MPP-enabled nodes need to update their reference.conf.

Rework features:

* Add types to allow cleaner dependency validation.
* Most of the time we don't care whether a feature is activated as optional or mandatory, which caused duplicate code. This is now handled more cleanly.
* It also paves the way to annotate features with the places they should be advertised (Init vs NodeAnn vs ChannelAnn vs invoice).
2020-01-09 13:47:43 +01:00
Bastien Teinturier
611f0cfebe
Relay Trampoline payments (#1220)
Start relaying trampoline payments with multi-part aggregation (disabled by default,
must be enabled with config).
Recovery after a restart is correctly handled, even if payments were being forwarded.
No DB schema update in this commit.

The trampoline UX will be somewhat bad because many improvements/polish are missing.
Some shortcuts were taken, a few hacks here and there need to be fixed, but nothing too scary.
Those improvements will be done in separate commits before the next release.
2019-12-18 14:34:52 +01:00
Pierre-Marie Padiou
38a3f07f83
Set akka.loglevel to DEBUG (#1235)
This allows us to only use logback.xml to control the log level.

From akka docs [1]:
> If you set the loglevel to a higher level than DEBUG, any DEBUG events
will be filtered out already at the source and will never reach the
logging backend, regardless of how the backend is configured.
> You can enable DEBUG level for akka.loglevel and control the actual
level in the SLF4J backend without any significant overhead, also for
production.

[1] https://doc.akka.io/docs/akka/current/logging.html
2019-12-06 13:57:45 +01:00
Pierre-Marie Padiou
167d65bc36
Added a 'category' in logs (#1227)
Also added paymentHash to MDC context
2019-12-04 14:17:56 +01:00
Pierre-Marie Padiou
0937af3a0b
Improved tracing of single/multi-part payments (#1218)
This includes a bit of refactoring in `MultiPartPaymentLifecycle`. Note
that we can't use the `onTermination` handler to finish the spans,
because it is asynchronous and may not be called after a long time.
That's why we use a dedicated `myStop` function.

In Kamon 2.0, by default spans are automatically generated for tracked
actors, which we don't want because we define our own spans. That's why
there is an additional configuration in `application.conf`.
2019-11-22 11:57:28 +01:00
n1bor
ff3aefa45e Add networkstats API call to allow display of network stats (#1221) 2019-11-22 09:58:08 +01:00
Bastien Teinturier
11003097cf
Refactor: move channel relaying to a ChannelRelayer actor. (#1215)
The relayer is the top-level orchestrator that forwards to a payment handler, channel relayer or (coming) node relayer.
2019-11-14 16:40:21 +01:00
Bastien Teinturier
ed022b00ea
Multi part payments (#1153)
Add support for multi-part payments (MPP).
We can now send and receive multi-part payments, with a somewhat basic splitting algorithm that will be refined based on real-world usage.
Compatibility with other implementations hasn't been tested yet as they don't have a branch ready.
This compatibility testing may reveal small details that need to be changed and may invalidate pending multi-part invoices.
2019-11-12 16:06:41 +01:00
araspitzu
e831c2a4ba
Add 'getnewaddress' API (#1190)
* Add 'getdnewaddress' API

* Restrict newaddress API usage to bitcoin core wallet
2019-11-04 14:54:02 +01:00
Fabrice Drouin
b9252cdf87
Release 0.3.2 (#1177)
Set version to 0.3.3-SNAPSHOT
2019-10-15 19:26:42 +02:00
Bastien Teinturier
7458383ecd
HTTP API: add type hints for payment status (#1150)
Cleans up the JSON payment status (easier to interpret for callers).
2019-10-01 10:16:29 +02:00
Bastien Teinturier
401c996a69
Payment lifecycle refactoring (#1130)
* Unify payment events (no more duplication between payment types and events)
* Factorize DB and eventStream interactions: this paves the way for sub-payments that shouldn't be stored in the DB nor emit events.
* Add more fields to the payments DB:
  * bolt 11 invoice for sent payment
  * external id (for app developers)
  * parent id (AMP)
  * target node id
  * fees
  * route (if success)
  * failures (if failed)
* Re-work the PaymentsDb interface
* Clarify use of seconds / milliseconds in DB interfaces -> milliseconds everywhere
* Run SQL migrations inside transactions
2019-09-20 14:29:36 +02:00
Pierre-Marie Padiou
ff0b4c81e6
Add monitoring with Kamon (disabled by default) (#1126)
For now:
- we only track some tasks (especially in the router, but not even
`node_announcement` and `channel_update`
- all db calls are monitored
- kamon is disabled by default
2019-09-06 14:37:26 +02:00
Bastien Teinturier
e73e672fbf
Reject expired invoices before payment flow starts (#1117) 2019-09-04 12:22:21 +00:00
araspitzu
74af0304bd
Move http APIs to subproject eclair-node (#1102)
* Move Service and FormParamExtractor to eclair-node

* Move dependency akka-http-json4s into eclair-node

* Move json serializers to eclair-node
2019-08-30 09:44:24 +02:00
Fabrice Drouin
bbe07c2c42
Set version to 0.3.2-SNAPSHOT (#1062) 2019-07-04 10:00:44 +02:00
Fabrice Drouin
6906ecb403
Set version to v0.3.1 (#1061) 2019-07-03 17:23:12 +02:00
Fabrice Drouin
847d0999c8
Release v0.3 (#994)
* gui: include javafx native libraries for windows, mac, linux

* Release v0.3

* Set version to 0.3.1-SNAPSHOT
2019-05-10 11:02:08 +02:00
Pierre-Marie Padiou
081dec15ae
Updated license header (#992) 2019-05-09 16:40:37 +02:00
Bastien Teinturier
03f4911e46 Wireshark dissector support (#981)
* Transport: add support for encryption key logging.
This is the format the wireshark lightning-dissector uses to be able to decrypt lightning messages.
2019-05-09 10:47:57 +02:00
araspitzu
1d486f4584
Do not print the stacktrace on stderr when there is an error at boot (#966)
* Do not print the stacktrace on stdout when there is an error at boot
2019-04-25 13:16:27 +02:00