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

1437 commits

Author SHA1 Message Date
Andrea
8567979a85
Remove getInfo parameter from EclairApi, remove 'port' from GetInfoResponse 2019-03-22 11:30:44 +01:00
Andrea
709298998b
Remove MetaService in favor of a shorter syntax 2019-03-22 11:06:24 +01:00
Andrea
f07741cfbf
Renaming Service -> OldService, NewService -> Service 2019-03-22 10:17:35 +01:00
Andrea
bd02e8ccfe
Add comment to MetaService 2019-03-19 13:17:16 +01:00
Andrea
3e285d131b
Merge branch 'master' into api_revamp 2019-03-19 11:41:05 +01:00
Andrea
db15e2bb01
Revert "Merge remote-tracking branch 'origin/use-bitcoin-0.17.1' into api_revamp"
This reverts commit b52ba9c05e, reversing
changes made to 837ac03dd9.
2019-03-19 11:40:10 +01:00
Pierre-Marie Padiou
cc3395a5bb
Better logic for sending channel_updates (#888)
* don't spam with channel_updates at startup

Previous logic was very simple but naive:
- every time a channel_update changed we would send it out
- we would always make a new channel_update with the disabled flag set
at startup.

In case our node was simply restarted, this resulted in us re-sending a
channel_update with the disabled flag set, then a second one with the
disabled flag unset a few seconds later, for each public channel.

On top of that, this opened way to a bug: if reconnection is very fast,
then the two successive channel_update will have the same timestamp,
causing the router to not send the second one, which means that the
channel would be considered disabled by the network, and excluded from
payments.

The new logic is as follows:
- when we do NORMAL->NORMAL or NORMAL->OFFLINE or OFFLINE->NORMAL, we
send out the new channel_update if it has changed
- in all other case (e.g. WAIT_FOR_INIT_INTERNAL->OFFLINE) we do nothing

As a side effect, if we were connected to a peer, then we shut down
eclair, then the peer goes down, then we restart eclair: we will make a
new channel_update with the disabled flag set but we won't broadcast it.
If someone tries to make a payment to that node, we will return the
new channel_update with disabled flag set (and maybe the payer will then
broadcast that channel_update). So even in that corner case we are good.

* quick reconnection: bump channel_update timestamp

In case of a disconnection-reconnection, we first generate a
channel_update with disabled bit set, then after we reconnect we
generate a second channel_update with disabled bit not set.

If this happens very quickly, then both channel_updates will have the
same timestamp, and the second one will get ignored by the network.

A simple fix is to bump the second timestamp in this case.

* set channel_update refresh timer at reconnection

We only care about this timer when connected anyway. We also cancel it
when disconnecting.

This has several advantages:
- having a static task resulted in unnecessary refresh if the channel
got disconnected/reconnected in between 2 weeks
- better repartition of the channel_update refresh over time because at
startup all channels were generated at the same time causing all refresh
tasks to be synchronized
- less overhead for the scheduler (because we cancel refresh task for
offline channels (minor, but still)
2019-03-18 14:39:29 +01:00
Andrea
56f910cf5b
Formatting commands in eclair-cli 2019-03-18 10:03:08 +01:00
Andrea
961bf3c1dd
Remove custom rejections 2019-03-15 18:23:09 +01:00
Andrea
1e79bd18a7
Timeout response not a json 2019-03-15 18:22:21 +01:00
Andrea
6ab9e03be8
Formatting 2019-03-15 18:20:47 +01:00
Andrea
f2cea92dbc
Use minFinalCltvExpiry from the invoice when sending a payment 2019-03-15 18:20:16 +01:00
Andrea
2ebec3b053
Separate findRoute and send API to remove ambiguity (and improve error responses) 2019-03-15 18:09:25 +01:00
Andrea
9ecda96b4c
Remove default case for non matched routes 2019-03-15 17:47:54 +01:00
Andrea
6884725934
Rework getInfo parameter passing, update the mock for it 2019-03-15 17:09:11 +01:00
Andrea
e8069d5719
Fix usage of the deprecation config key (use-old-api) 2019-03-15 17:05:53 +01:00
Andrea
8268e70c35
Rename config key and make new API enabled by default 2019-03-15 14:25:27 +01:00
Andrea
1fe65f4231
Move out /help from EclairApi 2019-03-15 14:23:14 +01:00
Andrea
7b6c020fe1
Add ByteVector32 Serializer to JsonSupport scope 2019-03-15 14:17:45 +01:00
Andrea
72cf2e87b5
Re-enable output processing with JQ in eclair-cli 2019-03-15 14:04:21 +01:00
Andrea
8c3d7d843a
Fix ClassCastException when mapping the channels responses to ByteVector instead of ByteVector32 2019-03-15 13:56:07 +01:00
Fabrice Drouin
5519d0aa6a Minor fixes (dependencies, unit tests) (#901)
Use bitcoin-lib v0.10 which has finally been synced to maven central.
Fix transactions unit test (the check in the test was using the whole locktime and not
the last 24 bits).
2019-03-15 12:54:33 +01:00
Andrea
53ec015e02
Separate Service and EclairApiImpl 2019-03-15 12:27:33 +01:00
Andrea
ec10feb40a
Do not return Route(s) from the implementation of API methods, add test for /connect 2019-03-15 11:29:55 +01:00
Andrea
5ff5042f2d
Add mock file for /help 2019-03-14 18:35:05 +01:00
Andrea
b52ba9c05e
Merge remote-tracking branch 'origin/use-bitcoin-0.17.1' into api_revamp 2019-03-14 18:34:37 +01:00
Andrea
837ac03dd9
Accept shortChannelId in /close, finish porting the test from the previous APIs 2019-03-14 18:34:18 +01:00
Andrea
305219d929
Finish merging master 2019-03-14 16:19:19 +01:00
sstone
31ce0c688e
Fix transactions unit test
To reconstruct the tx commit number we need to take the lower 24 bits of the locktime field.
2019-03-14 16:04:29 +01:00
Fabrice Drouin
f662a6a787
Merge branch 'master' into use-bitcoin-0.17.1 2019-03-14 15:18:54 +01:00
Andrea
d08ebb67b7
Rebase with master 2019-03-14 15:05:13 +01:00
Andrea
3b2df4b6e2
Merge remote-tracking branch 'origin/master' into api_revamp 2019-03-14 15:01:16 +01:00
Pierre-Marie Padiou
b681cfca47
Replace BinaryData by scodec.bits.ByteVector (#896)
See https://github.com/ACINQ/bitcoin-lib/pull/31.

We still have to use `Array[Byte]` for low-level cryptographic primitives, and `akka.util.ByteBuffer` for tcp connections. In order to reduce unnecessary copies, we used `ByteVector.view(...)` as much as possible.

Took the opportunity to do a project-wide optimize imports. We might as well do it now since pretty much all files have been touched already.

NB: temporarily use bitcoin-lib 0.10.1-SNAPSHOT because maven central is very slow and we can't access the recently release 0.10 for now.
2019-03-14 12:43:28 +01:00
araspitzu
889e86a908
Move the param 'randomize' from RouteRequest to RouteParams (#895)
* Move the param 'randomize' from RouteRequest to RouteParams
2019-03-13 18:58:55 +01:00
Andrea
c9e573a4c2
Improve error handling via rejections 2019-03-13 18:50:50 +01:00
Andrea
cecb6bcdd8
Fix help command in eclair-cli 2019-03-13 18:18:42 +01:00
Andrea
1eedeb054a
[WIP] eclair-cli 2019-03-13 16:32:19 +01:00
Andrea
8ba0e0a3a8
Adjust eclair-cli for the new APIs, output the invoice for /receive endpoint 2019-03-13 15:53:17 +01:00
Andrea
3b20d1e490
[WIP] Update eclair-cli 2019-03-13 15:28:50 +01:00
Andrea
746a5daf9a
Remove Json4s generic unmarshaller from scope 2019-03-13 15:17:29 +01:00
Andrea
af9a9691bc
[WIP] fix eclair-cli to use the new APIs 2019-03-13 13:13:01 +01:00
Andrea
7908f5e58d
Use custom http headers in all API response 2019-03-13 10:32:17 +01:00
Andrea
066634f3a2
Use HTTP POST and formParams 2019-03-13 10:16:42 +01:00
Andrea
36da70e1dc
Add configuration to enable the new APIs 2019-03-12 18:11:31 +01:00
Andrea
514cc356b7
[WIP] port to new service reorg the exception handler to make it work for real! 2019-03-12 18:03:26 +01:00
Andrea
528f195c45
[WIP] port to new service the http-basic auth 2019-03-12 17:50:58 +01:00
Andrea
1e8c2339e2
[WIP] port to new service the websocket 2019-03-12 17:44:15 +01:00
Andrea
8aebef538e
[WIP] port to new service checkpayment/audit/networkfees/channelStats 2019-03-12 17:09:07 +01:00
Andrea
848563b87a
[WIP] port to new service receive/parseinvoice/findroute/send 2019-03-12 16:11:30 +01:00
Andrea
dd909bf5c7
[WIP] port to new service allupdates calls 2019-03-12 15:00:29 +01:00