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

81 Commits

Author SHA1 Message Date
rorp
e383d81de8
Add listreceivedpayments RPC call (#2607)
Add a new RPC to list payments received by the node.
2023-04-04 19:44:45 +02:00
Thomas HUET
df0e7121ef
Add offer manager (#2566)
Because offers are a very generic mechanism, handling them can require interacting with an inventory system (do we actually have the quantity that the payer is requesting) or other such systems which do not have their place inside eclair. For this reason offer handlers must be implemented as plugins that communicate with the offer manager.
On startup, the offer handlers must register their offers with the offer manager, the offer manager will then forward the invoice requests and blinded payments to the relevant offer handler for approval.
2023-03-27 18:37:14 +02:00
Richard Myers
732eb31681
Add limit for incoming connections from peers without channels (#2601) 2023-03-24 14:05:10 +01:00
Richard Myers
ddcb978ead
Add support for plugins that intercept open channel messages (#2552) 2023-02-17 08:56:51 +01:00
Thomas HUET
d4c32f99dd
Add support for paying offers (#2479)
Add a new actor paying an offer: sends an invoice request, wait for the invoice, retries if needed, pay the invoice
2023-02-16 18:57:43 +01:00
Bastien Teinturier
b21085ddd6
Add ChannelOpened event (#2567)
* Add ChannelOpened event

Emit an event when a channel is opened and ready to process payments.
This event is distinct from the `ChannelCreated` event which is sent
earlier, once we think a funding transaction has been successfully created
(but cannot guarantee when we're not the initiator).

* Add event to websocket

This is a breaking change, but it should be ok since the previous event
wasn't reliable: it was emitted at a time where we couldn't guarantee
that the channel would really confirm.
2023-01-16 16:46:13 +01:00
Bastien Teinturier
6486449404
Add GetNode router API (#2568)
Add a new API to return information about a specific node: its announcement,
number of active channels and total capacity.
2023-01-16 15:13:09 +01:00
Bastien Teinturier
530b3c206f
Unlock utxos at startup (#2278)
We remove utxos locks that were previously set, otherwise we may have
utxos that stay locked indefinitely. This may happen if we started funding
a channel and restarted before completing the funding flow: the channel
will be safely forgotten but the corresponding utxos stay locked.

The only drawback that this may have is if we have funded and signed a
funding transaction but didn't publish it and we accidentally double-spend
it after a restart. This shouldn't be an issue because:

- locks are automatically removed when the transaction is published anyway
- funding transactions are republished at startup if they aren't in the
  blockchain or in the mempool
- funding transactions detect when they are double-spent and abort
  the channel creation
- the only case where double-spending a funding transaction causes  a loss
  of funds is when we accept a 0-conf channel and our peer double-spends it,
  but we should never accept 0-conf channels from peers we don't trust

We provide three strategies when locked utxos are detected: stop eclair,
unlock the utxos automatically, or ignore them.
2023-01-02 13:27:43 +01:00
Bastien Teinturier
5b19e58601
Improve payinvoice API response (#2525)
When sending an outgoing multi-part payment, we forward the preimage back
to the sender as soon as we receive the first `update_fulfill_htlc`.
This is particularly useful when relaying trampoline payments, to be able
to propagate the fulfill upstream as early as possible.

However this meant that callers of the HTTP API would receive this
preimage event instead of the final payment result, which was quite bad.
We now disable this first event when used with the `--blocking` argument,
which ensures that the API always returns the payment result.

Fixes #2389
2022-12-21 09:16:34 +01:00
Bastien Teinturier
bf087698cc
Update dependencies (#2537)
And move kamon-prometheus to eclair-node/eclair-front.
2022-12-20 16:55:31 +01:00
Bastien Teinturier
04517f8215
Update title of v0.8.0 release notes (#2531) 2022-12-16 10:53:50 +01:00
Bastien Teinturier
ca831df241
Add a payment recipient abstraction (#2480)
We were previously directly creating onion payloads inside the various
payment state machines and manipulating tlv fields. This was a layering
violation that was somewhat ok because in most cases we only needed to
create the onion payload for the recipient at the beginning of the payment
flow and didn't need to modify it, except for a small change in the MPP
case.

This forced us to handle trampoline onions directly in the payment
initiator and will not work for blinded payments, where we can only build
the onion payload for the recipient after we've chosen the routes and how
to split the amount.

We clean this up by introducing payment recipients that abstract away the
creation of onion payloads. This makes it much easier to integrate blinded
payments. It also allows us to clean up the way we do trampoline payments
and potentially support splitting across multiple trampoline routes (not
included in this PR as this change isn't immediately needed).

It also lets us simplify the MultiPartPaymentLifecycle FSM, by moving the
logic of computing how much remains to be sent and what fee can be used
to the route calculation component.
2022-12-16 10:44:34 +01:00
rorp
2a7649de40
Add pagination on Audit API (#2487)
Fixes #2451
2022-12-09 08:44:47 +01:00
Bastien Teinturier
cd9ca57562
Back to Dev (#2515)
After the v0.8.0 release.
2022-12-01 15:18:59 +01:00
Bastien Teinturier
00774717f6
Eclair v0.8.0 release (#2470) 2022-12-01 14:52:59 +01:00
Bastien Teinturier
a230395f5f
Test change address type generation (#2513)
Starting with bitcoind 23.0, a new `changetype` parameter was introduced.
If not specified, bitcoind will generate a change output with a type that
matches the main output to make it harder for chain analysis to detect
which output is the change.

The issue is that lightning requires segwit utxos: if an on-chain payment
is sent to a non-segwit address, we still want our change output to use
segwit, otherwise we won't be able to use it. We thus must set
`addresstype` and `changetype` in `bitcoin.conf` to ensure we never
generate legacy change addresses.
2022-11-30 15:44:40 +01:00
Bastien Teinturier
7dbaa41f39
Update to bitcoind 23.x (#2466)
This release of bitcoind contains several bug fixes that let us simplify
our fee bumping logic:

- fixed a bug where bitcoind dropped non-wallet signatures
- added an option to fund transactions containing non-wallet inputs

It also has support for Taproot, which we want in eclair.
2022-11-14 13:47:48 +01:00
rorp
8f1af2851d
Add pagination on listInvoices (#2474)
Add support for count/skip arguments to the `listInvoices` API.
Fixes #2450
2022-11-14 09:56:10 +01:00
Bastien Teinturier
090680403a
Support scid_alias and zero_conf for all commitment types (#2404)
We previously only supported `scid_alias` and `zero_conf` when used in
combination with `anchors_zero_fee_htlc_tx`, but we have no way of
advertising that to our peers, which leads to confusing failures when
opening channels.

Some nodes that don't have good access to a utxo pool may not migrate to
anchor outputs, but may still want to use `scid_alias` (and potentially
`zero_conf` as well).

Fixes #2394
2022-11-04 19:19:45 +01:00
Bastien Teinturier
a735ba86b6
Dual funding RBF support (#2275)
Add support for bumping the fees of a dual funding transaction.
We spawn a transient dedicated actor: if the RBF attempt fails, or if we
are disconnected before completing the protocol, we should forget it.

Add more tests for scenarios where an unconfirmed channel is force-closed,
where the funding transaction that confirms may not be the last one.
2022-08-22 14:37:48 +02:00
Richard Myers
323aeec09c
Add support for the signet test network (#2387) 2022-08-19 11:15:05 +02:00
Richard Myers
bb6148e31c
Support DNS hostnames in node announcements (#2234)
It is now possible to specify a DNS host name as one of your
`server.public-ips` addresses.

DNS host names will not be resolved until eclair attempts to
connect to the peer.

See https://github.com/lightning/bolts/pull/911
2022-08-16 09:01:47 +02:00
Goutam Verma
276340d1b3
Add host metrics grafana dashboard (#2334)
Add a grafana dashboard to monitor host metrics
(CPU, memory, network usage, etc).
2022-07-01 17:32:46 +02:00
Bastien Teinturier
3b97e446aa
Allow disabling no-htlc commitment fee-bump (#2246)
When a channel force-close without any pending htlcs, funds are not at
risk. We want to eventually get our main output back, but if we are not
in a rush we can save on fees by never spending the anchors.

This is disabled by default as there is a potential risk: if the commit
tx doesn't confirm and the feerate rises, the commit tx may eventually be
below the network's min-relay-fee and won't confirm (at least until package
relay is available).
2022-07-01 16:04:41 +02:00
Bastien Teinturier
2790b2ff6c
Activate 0-conf based on per-peer feature override (#2329)
We restrict 0-conf activation on a per-peer basis. When 0-conf is activated
by both peers, we use it even if it wasn't part of the `channel_type`.
2022-07-01 15:13:57 +02:00
Bastien Teinturier
a1f7c1e74f
Return local channel alias in payment failures (#2323)
We now use either our local alias or the real scid in the channel update
that we store internally. When we send that channel update directly to
our peer, we override it to use the remote alias when it makes sense.
2022-07-01 15:13:26 +02:00
Bastien Teinturier
6011c867cf
Additive per-node feature override (#2328)
The `override-init-features` field in `eclair.conf` was not previously
applied on top of the `features` field, so node operators were usually
copy-pasting their `features` overrides in every `override-init-features`.

The overrides are now applied on top of the base `features` configuration,
which makes it easier and more intuitive to configure per-node features.
2022-07-01 14:33:14 +02:00
Goutam Verma
6b2e415ecb
Expose scraping endpoint for prometheus metrics (#2321)
Allow eclair to expose a metrics scraping endpoint for Prometheus
for users who don't want to rely on Kamon's hosted infrastructure. 

Co-authored-by: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
2022-06-16 17:52:57 +02:00
Pierre-Marie Padiou
e5f5cd152e
Add support for zero-conf and scid-alias (#2224)
This implements lightning/bolts#910.

Co-authored-by: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
2022-06-15 13:09:54 +02:00
rorp
47c5b95eaa
Drop support for Tor v2 hidden services (#2296)
Tor v2 addresses have been officially deprecated by the
Tor team and removed from the lightning specification in
https://github.com/lightning/bolts/pull/940
2022-06-06 10:03:44 +02:00
Fabrice Drouin
787c51acc2
Add a "stop" API method (#2233)
* Add a "stop" API method

This API call was added for certain uses cases where killing the process was impractical but internally it just calls `sys.exit()`.
Eclair is designed to shutdown cleanly when its process is killed and this is still the recommended way of stopping it.
2022-04-13 09:48:12 +02:00
Richard Myers
6f31ed2dc9
Add release notes for new min-funding settings and invoice purger (#2210) 2022-03-29 12:12:13 +02:00
Richard Myers
9358e5e1f5
Add channelbalances API call (#2196)
The `channelbalances` API call retrieves information about the balances of all local channels, not just those with usable outgoing balances that are enabled for sending.

This change also adds the `isEnabled` attribute to the json results for both the new `channelbalances` and old `usablebalances` API calls.
2022-03-29 11:10:42 +02:00
Thomas HUET
8f2c93c1ab
Add delayed fees to release notes (#2204)
Add release notes for #2201
2022-03-11 10:22:27 +01:00
Richard Myers
daddee1912
fixup! Convert wiki pages in to files in the docs directory and general docs file cleanups (#2165) (#2167)
- Fixup for #2165, Usage.md should link to ./API.md and not the deprecated wiki
2022-02-07 14:21:08 +01:00
Thomas HUET
9401592382
Typed features (#2164)
Give different types to init features / node announcement features / invoice features.

We now accept more invoices (we would previously reject invoices if they required a feature that we don't support but that we know is irrelevant for invoices).
2022-02-07 09:51:38 +01:00
Richard Myers
553727cb22
Convert wiki pages in to files in the docs directory and general docs file cleanups (#2165)
Created new files for pages that were in the wiki, but not already in the docs directory. Also made following fixes to  README.md and existing files in the docs directory:

* update bolt links to avoid redirect
* link to logging guide from logging section (README.md)
* fixed typo in Backup section and capitalization of Bitcoin Core (README.md)
* Alice does not need trampoline feature enabled (TrampolinePayments.md)
* link to 2021 edition of Trampoline PR (TrampolinePayments.md)
* fixed API examples and removed quotes from password (API.md)
* use --nodeIds for sendtoroute examples (TrampolinePayments.md and MultipartPayments.md)
* update CLI example 3 to use jq (Usage.md)
* fix typo in docs/FAQ.md
* updated Guide.md to point to all pages that are guides
2022-02-06 20:28:50 +01:00
Bastien Teinturier
44510698f7
Back to Dev (#2159) 2022-02-01 10:42:29 +01:00
Bastien Teinturier
a804905c0b
Eclair v0.7.0 release (#2158) 2022-02-01 08:34:50 +01:00
Pierre-Marie Padiou
0333e11c79
Database migration Sqlite->Postgres (#2156)
Add a migration tool and a step-by-step guide for users who want to switch from Sqlite to Postgres.
2022-01-31 12:49:39 +01:00
Pierre-Marie Padiou
57c2cc5df9
Type ChannelFlags instead of using a raw Byte (#2148)
This has the same kind of impact as the typing of `Features`. In particular we can now explicitly set the values in `eclair.conf`:
`eclair.channel.channel-flags.announce-channel=true`. I took the opportunity to move this channel-related config key in its own config section, with the goal that we move the other fields in a follow-up PR.

It also has the nice side effect of providing a pretty json formatting out of the box:
```json
"channelFlags": {
  "announceChannel": true
}
```

The `open` method of the API has been updated: `channelFlags` has been replaced by a new `announceChannel` parameter.
2022-01-25 18:35:32 +01:00
Fabrice Drouin
8758d50df2
Update cluster documentation [ci skip] (#2122)
Update cluster documentation
2022-01-24 18:04:25 +01:00
Pierre-Marie Padiou
c180ca2ef1
Postgres: add safety checks at startup (#2140)
When using postgres, at startup we optionnally run a few basic safety
checks, e.g. the number of local channels, how long since the last local
channel update, etc. The goal is to make sure that we are connected to
the correct database instance.
2022-01-21 14:45:16 +01:00
Bastien Teinturier
e2b1b26919
Activate anchor outputs (#2134)
This feature is now ready to be widely deployed.
The transaction format has been tested for a long time
(between Phoenix iOS and our node) and automatic
fee-bumping has been implemented in #2113.
2022-01-19 13:30:55 +01:00
Bastien Teinturier
546ca23984
Activate onion messages (#2133)
* Fix supervisor for MessageRelay actors
* Use optional replyTo instead of replyTo.NoSender
* Activate onion messages
2022-01-17 16:48:50 +01:00
Bastien Teinturier
6e88532d18
Add support for option_payment_metadata (#2063)
* Filter init, node and invoice features

We should explicitly filter features based on where they can be included
(`init`, `node_announcement` or `invoice`) as specified in Bolt 9.

* Add support for sending `payment_metadata`

Whenever we find a payment metadata field in an invoice, we send it in
the onion payload for the final recipient.

* Include `payment_metadata` in all invoices

We include a payment metadata in every invoice we generate. This lets us
see whether our payers support it or not, which is important data to have
before we make it mandatory and use it for storage-less invoices.

See https://github.com/lightning/bolts/pull/912 for reference.
2022-01-10 15:55:43 +01:00
Thomas HUET
7421098c44
Process replies to onion messages (#2117)
Add a postman that is in charge of sending messages and listens to incoming replies and delivers them to the right actor
2022-01-05 16:37:52 +01:00
Bastien Teinturier
62cc073d67
Remove network stats computation (#2094)
We introduced a task to regularly compute network statistics (mostly about
channel parameters such as expiry and fees).

The goal was to use this information in the MPP split algorithm to decide
whether to split a payment or not.

But we haven't used it, and I'm not sure anymore that it's useful at all.

If node operators are interested in network statistics, an ad-hoc
on-the-fly computation would make more sense.
2021-12-09 11:58:04 +01:00
Thomas HUET
a470d41a95
Write received onion messages to the websocket (#2091) 2021-12-09 10:56:05 +01:00
Thomas HUET
9792c725c7
Rename feeThresholdSat to maxFeeFlatSat (#2079) 2021-11-29 17:51:39 +01:00