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

170 Commits

Author SHA1 Message Date
Bastien Teinturier
163700a232
Set version to 0.5.2-SNAPSHOT (#1714) 2021-03-03 15:29:26 +01:00
Bastien Teinturier
98bb7be70a
Set version to 0.5.1 (#1707) 2021-03-03 11:38:00 +01:00
Bastien Teinturier
923ca26fec
Set version to 0.5.1-SNAPSHOT (#1651) 2020-12-18 16:24:32 +01:00
Bastien Teinturier
35b070ee5d
Set version to 0.5.0 (#1649) 2020-12-18 15:23:36 +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
90bf08e62c
Update akka to 2.6.10 (#1568) 2020-10-15 16:26:46 +02:00
Bastien Teinturier
f9ff586cba
Release Eclair v0.4.2 (#1562)
* Set version to 0.4.2
* Set version to 0.4.3-SNAPSHOT
2020-10-13 15:14:40 +02:00
Pierre-Marie Padiou
eed82e262f
Update to scala 2.13.3 and akka 2.6.9 (#1532)
Need to add explicit dependency on akka-stream (see https://doc.akka.io/docs/akka-http/current/introduction.html#using-akka-http)
2020-09-18 15:27:45 +02:00
Pierre-Marie Padiou
2c437421d7
Show reminder of failed tests at the end (#1521)
From scalatest's doc [1]:

> This minimizes or eliminates the need to search and scroll backwards
to find out what tests failed or were canceled. For large test suites,
the actual failure message could have scrolled off the top of the
buffer, making it otherwise impossible to see what failed.

[1] https://www.scalatest.org/user_guide/using_the_runner
2020-08-20 12:08:52 +02:00
Pierre-Marie Padiou
aca7499df2
Use github action for scoverage (#1490)
And disable codecov in semaphore.
2020-07-21 13:05:51 +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
Dominique
8629d201a7
Skip executing some plugins when skipping tests (#1418)
* Skip some plugins when skipping tests

* Add instruction in BUILD.md to install eclair-core to repo

* Reorganize BUILD.md with subsections
2020-05-13 15:19:48 +02:00
Bastien Teinturier
3f127fbf06
Update kamon (#1411)
* Update Kamon libraries
* Ignore unused channel state changes post-restart
2020-05-06 15:58:08 +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
7eebca1ff1
Downgrade to scala 2.13.1 (#1394)
Latest scala version has a bug [1] that breaks build on windows.

[1] https://github.com/scala/bug/issues/11955
2020-04-27 15:22:18 +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
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
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
araspitzu
78e6cdbec9
Support deterministic build of eclair-core artifact on ubuntu (#1295)
* Upgrade maven-jar-plugin and maven-source-plugin to version 3.2.0 to achieve deterministic builds
2020-01-30 15:27:02 +01:00
Fabrice Drouin
3d42bd0c13
Dependencies: use bitcoin-lib 0.17 (#1277)
It exposes an API that we need if we want to implement lnurl
2020-01-15 11:10:27 +01:00
Fabrice Drouin
30a0e9935a
Payment Request: speed up node id computation (#1203)
* Payment Request: speed up node id computation

Use native secp256k1 pubkey recovery for faster node id computation
2019-11-14 10:04:51 +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
Pierre-Marie Padiou
8ee53bc97d
Drop support for Java 8 (#1135)
We already have Java 7 (for Android) and Java 11. Supporting Java 8
would require crossbuilding, which we are not doing (two recent PRs
broke the build on Java 8).
2019-09-16 11:04:10 +02:00
Pierre-Marie Padiou
8da509b5cd
Make tests run in parallel (#1112)
There are two level of parallelization:
- between test suites (a suite = a test file)
- within a suite (depends on tests suites, some rely on sequential execution of tests, some don't)
2019-09-11 13:40:46 +02:00
Pierre-Marie Padiou
2fbf46a344
Removed Globals class (#1127)
This is a prerequisite to parallelization of tests.
2019-09-11 10:55:43 +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
46e4873562
Add more numeric utilities to MilliSatoshi (#1103)
Add comparisons and postfix operators.
Update most of the codebase to leverage those.
2019-08-29 07:19:01 +00:00
araspitzu
4929febbd1
Typed amounts (#1088)
* Type all amounts used in eclair

* Add eclair.MilliSatoshi class

* Use bitcoin-lib 0.14

* Add specialized codecs for Satoshi/MilliSatoshi

* Rename 'toSatoshi' to 'truncateToSatoshi' to highlight it's a precision-losing conversion
2019-08-07 17:37:38 +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
Pierre-Marie Padiou
48cb8644fa
Added more memory for scoverage (#1050)
In order to fix the stack overflow errors related to scoverage.
2019-07-02 10:06:57 +02:00
Fabrice Drouin
31022ceca5
Use compact encoding for signatures (64 bytes) instead of DER (#1014)
* use 64B representation instead of DER for sigs

It is more compact, and as an added bonus it frees us from the
completely unrelated Bitcoin-specific `0x01` trailing sig hash.

Note that we already used the 64B representation for storage everywhere,
except in `ChannelCodecs.htlcTxAndSigsCodec`, which required a backward
compatibility codec. Added a nonreg test for this.

* Use updated secp256k1 JNI bindings

* Replace scalar with private key and point with public key

We now use the simplified/unified design proposed in bitcoin-lib where:
- there are no more specific types for scalar/point
- private and public keys are compressed unless explicitly requested

* Generate and use 32 bytes seeds (and not 33)

We used serialized random private keys which were represented a 33 bytes (with a 01 suffix).
Using random 32 bytes values is more consistent.
We must make sure that upgraded apps that already have a 33 bytes seed will still generate the same secrets, which is why LocalKeyManager still uses the 01 suffix when needed
2019-06-14 11:52:01 +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
araspitzu
604fd3170f
Add bot support for code coverage (codecov) (#982)
* Add scoverage-maven-plugin dependency

* Update travis build to generate a scoverage report

* Add custom codecov configuration to have nice PR comments

* Add badge for test coverage in readme
2019-05-09 11:42:38 +02:00
Fabrice Drouin
e2ff5c857b
Set version to 0.3-SNAPSHOT (#920)
We have enough major changes from the last release to justify switching to 0.3
2019-03-28 09:49:17 +01:00
araspitzu
06b2337ed9
Rework database initialization (#911)
* Initialize the database outside the node param constructor
* Do not create folders during StartupSpec
* Simplify syntax for instantiating test Databases
* Rework parameter passing to database initialization
* Force UTF-8 file encoding on all platform.
2019-03-25 18:04:30 +01:00
Fabrice Drouin
3b7afd92d4
Use bitcoin-lib 0.11 which embeds libsecp256k1 (#907)
* Use bitcoin-lib 0.11, which embeds libsecp256k1

* Unit tests: generate dummy sig from 32 random bytes

We now use a version of bitcoin-lib which embeds JNI bindings for libsecp256k1,
and it will only sign data that is 32 bytes long (in Bitcoin and LN you always
sign data hashes, not the actual data).

* Use maven 3.6.0 and a different mirror

* RoutingSyncSpec: don't create databases at init time

We called nodeParams which created a new in-memory sqlite database everytime we created "fake" routing info
2019-03-25 14:42:06 +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
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
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
Fabrice Drouin
34e51c19cc
Use OpenJDK 11 as default JDK (#846)
* Upgrade to JDK11

Eclair can be built and used on Oracle JDK 1.8 or OpenJDK 11.
JavaFX is now embedded in eclair-node-gui and does not need to be installed separately.

* Install: update java download links

OpenJDK 11 is now our recommendation. Tell users to download java from https://jdk.java.net/11

* README: Rewrite installation instructions
2019-02-21 15:11:44 +01:00
Pierre-Marie Padiou
e0e958320d
Using bitcoin-lib 0.9.19 (#861) 2019-02-12 16:15:32 +01:00
sstone
3f72b441d8
Set version to 0.2-SNAPSHOT 2019-01-18 20:15:04 +01:00
sstone
eb0e45a8b1
set version to 0.2-beta9 2019-01-18 19:01:59 +01:00
araspitzu
83b464cfcc Fix short_channel_id parsing and add RPC API test (#815)
* Correctly parse short channel id

* Add test for RPC APIs

* Put akka.http.version in parent project pom

Co-Authored-By: araspitzu <a.raspitzu@protonmail.com>
2019-01-11 14:59:33 +01:00
Fabrice Drouin
e082d89a3b
Electrum: download, verify and store headers (#776)
* Implement "GetHeaders" RPC call

* Add checkpoints and pow verification

* Don't resolve server address too soon

* Add testnet checkpoints

* Store headers in a sqlite wallet db

* Use 1.4 protocol

Request protocol version 1.4 (this is the default setting in Electrum wallet).
Retrieve and store all headers as binary blobs in bitcoin format.

* Insert headers in batch

* Optimize headers sync and persistence

We assume that there won't be a reorg of more that 2016 blocks (which
could be handled by publishing a new checkpoint) and persist our headers
except for the last 2016 we have received: when we restart, we will ask
our server for at least 2016 headers.

* Persists transactions

Transactions are persisted only when they've been verified (i.e. we've receive
a valid Merkle proof)

* Disable difficulty check on testnet and regtest

On testnet there can be difficulty adjustements even within a re-targeting window.

* Update checkpoints

* Use proper Ping message

`version` can not longer be sent as a ping as we did before.

* Don't ask for Merkle proofs for unconfirmed transactions

* Improve startup time

We now store a new checkpoint and headers up to that checkpoint as soon as our
best chain is 2016 + 500 blocks long

* Properly detect connection loss

* Update electrum mainnet servers list

Using the list from Electrum 3.3.2

* Don't open multiple connection to the same Electrum servers

We want to keep connection to 3 different servers, but when we have less than 3 different
addresses it's pointless to attempt to keep maintain 3 connections.
2019-01-11 14:08:46 +01:00
Pierre-Marie Padiou
2de7c6b07d
Use sttp lib instead of akka-http-client (#720)
Also updated json4s-jackson to 3.6.0
2018-10-25 16:45:27 +02:00