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

98 Commits

Author SHA1 Message Date
Pierre-Marie Padiou
ca51a2d168
Enable WAL mode on Sqlite (#1871)
[Write-Ahead Logging](https://sqlite.org/wal.html) is both much more performant in general, and more suited to our particular access patterns.

With a simple throughput performance test, it improves performance by a factor of 5-20x depending on the sync flag.

 version                                 | throughput
-------------------------------|-------------
mode=journal sync=normal (*)| 11 htlc/s
mode=journal sync=full| 7 htlc/s
mode=wal sync=normal| 248 htlc/s
mode=wal sync=full (**)| 62 htlc/s 

(*) previous setting
(**) new setting

I went with a conservative new setting of wal+full sync, which is both 5x more performant, and more secure than what we had before.

> In WAL mode when synchronous is NORMAL (1), the WAL file is synchronized before each checkpoint and the database file is synchronized after each completed checkpoint and the WAL file header is synchronized when a WAL file begins to be reused after a checkpoint, but no sync operations occur during most transactions. With synchronous=FULL in WAL mode, an additional sync operation of the WAL file happens after each transaction commit. The extra WAL sync following each transaction help ensure that transactions are durable across a power loss. Transactions are consistent with or without the extra syncs provided by synchronous=FULL. If durability is not a concern, then synchronous=NORMAL is normally all one needs in WAL mode.

Co-authored-by: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
2021-07-15 18:12:26 +02:00
Pierre-Marie Padiou
bd57d41ef3
Add a globalbalance api call (#1737)
It returns an overall balance, separating onchain, offchain, and
removing duplicates (e.g. mutual closes that haven't reached min depth
still have an associated channel, but they already appear in the
on-chain balance). We also take into account known preimages, even if
the htlc hasn't been formally resolved.

Metrics have also been added.

Co-authored-by: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
2021-07-08 13:57:49 +02:00
Bastien Teinturier
d4b25d565d
Udpate to Bitcoin Core 0.21.1 (#1841)
Update the default version of `bitcoind` to 0.21.1.
Deprecate support for version 0.18.1 and 0.19.1.
2021-06-09 14:20:00 +02:00
Bastien Teinturier
a658fa26f4
Set version to 0.6.1-SNAPSHOT (#1813) 2021-05-19 15:08:42 +02:00
Bastien Teinturier
f89b0925a7
Set version to 0.6.0 (#1812) 2021-05-19 11:54:44 +02:00
Bastien Teinturier
1fbede7618
Add TCP keep-alive on ZMQ socket (#1807)
One of ZMQ's drawbacks is that subscribers on an unreliable network may
silently disconnect from publishers in case of network failures.

In our case, we want to reconnect immediately when that happens, so we set
a tcp keep-alive to ensure this.

Fixes #1789
2021-05-17 15:32:25 +02:00
Bastien Teinturier
62dd3932ff
Use bouncycastle instead of spongycastle (#1772)
* Use bouncycastle instead of spongycastle
* Reformat a few files
* Remove wireshark dissector support

Fixes #1375
2021-04-22 11:39:45 +02:00
Bastien Teinturier
b25e5523e7
Remove Docker test dependency (#1753)
It was only used by Electrum which was removed in #1750
2021-04-02 12:27:40 +02:00
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
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
Anton Kumaigorodski
135ce6cc8b
Use maven plugin to include tests (#1557)
This results in eclair-core_2.13-<version>-tests.jar file and allows to easily reuse testing classes in other modules.
2020-10-12 10:41:52 +02:00
Pierre-Marie Padiou
d0011005a0
Migrate relayers to akka typed (#1525)
* introduce a new relay identifier

In a channel relay, it will be unique for all retries.

In a trampoline relay, it is equal to what previously was the parent
payment id.

* moved and cleaned up remaining relayer tests

Now all relay-related tests are in the `relayer` package.
2020-09-16 09:46:51 +02:00
Bastien Teinturier
b954defa28
Update to Bitcoin Core 0.20.1 (#1526)
The only impactful change is that by default on regtest and testnet
fallback fee (used when there is not enough historical data to correctly
estimate the feerate) is now set to 0, whereas it was set to 0.0002 btc
in previous versions.

We set it manually in tests `bitcoin.conf` to preserve the previous behavior.
2020-09-08 17:59:52 +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
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
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
araspitzu
22d476774d
Support bitcoin-0.19.1 (#1380)
* Support bitcoin-0.19.1

* Update supported versions of bitcoind in README
2020-04-27 16:10:45 +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
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
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
80a27cc566
Update netty dependency to 4.1.32 (#1160)
Also:
* explicitely set endpoint identification algorithm in strict mode
* force TLS protocols 1.2/1.3 in strict mode

Co-Authored-By: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
2019-10-03 15:01:10 +02:00
araspitzu
37cc5262b0
Use bitcoin 0.18.1 in the test (#1148)
* Use bitcoin 0.18.1 during test
2019-10-03 09:23:31 +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
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
araspitzu
cfaa5508eb
Increase Service and EclairImpl test coverage (#1004)
* /payinvoice: assert the override amount is being used in the invoice

* /updaterelayfee: assert the values passed through the API call are forwarder to EclairImpl

* 'receive' API: test for fallback address usage and parameters passing

* 'close' API: test for parameters handling

* 'networkFees': test for default parameters

* Add test dependency mockito-scala, rewrite a test using the mock framework

* Factor out query filter parsing in EclairImpl, Add test for networkFees/audit/allinvoice

* Move getDefaultTimestampFilters in companion object, group together EclairImpl-scoped classes
2019-05-20 14:22:09 +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
Fabrice Drouin
bed47de5e3
Live channel database backup (#951)
* Backup running channel database when needed

Every time our channel database needs to be persisted, we create a backup which is always
safe to copy even when the system is busy.

* Upgrade sqlite-jdbc to 3.27.2.1

* BackupHandler: use a specific bounded mailbox

BackupHandler is now private, users have to call BackupHandler.props() which always
specifies our custom bounded maibox.

* BackupHandler: use a specific threadpool with a single thread

* Add backup notification script

Once a new backup has been created, call an optional user defined script.
2019-04-19 22:35:12 +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
Fabrice Drouin
4aa7a1ca9f Upgrade to bitcoin 0.17.1 (#826)
Bitcoin Core 0.18 is about to enter RC cycle and should be release soon (initial target was April). It is not compatible with 0.16 (some of the RPC calls that we use have been removed. They're still available in 0.17 but tagged as deprecated). 

With this PR, eclair will be compatible with 0.17 and the upcoming 0.18, but not with 0.16 any more so it will be a breaking change for some of our users. Supporting the last 2 versions is the right option and we should be ready before 0.18 is actually released (its initial target was April).
2019-03-19 14:57:03 +01:00
Pierre-Marie Padiou
3db7b176d3
Update jeromq dependency (#852)
* jeromq 0.4.0->0.5.0
2019-02-21 16:02:39 +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
884812ade0
Reimplemented BOLT 11 with scodec (#856) 2019-02-11 19:45:56 +01:00
rorp
808bf14d20 Support for Tor onion services (#736)
This includes support for hosting onion services, and connecting to them, which are two separate things:
- Opening an onion service implie interacting with the tor daemon controller, which requires authentication. We support both `SAFECOOKIE` and `HASHEDPASSWORD` authentication mechanisms, with a default to `SAFECOOKIE`. We support v2 and v3 services, with a default to v3 as recommended by the tor project.
- Connecting to onion services requires tunnelling through tor's local SOCKS5 proxy.

Incoming and outgoing tor connections are thus separate matters that needs to be configured independently. A specific documentation has been added to guide users through these steps.

Big thanks to @rorp for doing the heavy lifting on all this!
2019-02-08 10:18:59 +01:00
Pierre-Marie Padiou
3aa5754490
Relay to channel with lowest possible balance (#784)
* relay to channel with lowest possible balance

Our current channel selection is very simplistic: we relay to the
channel with the largest balance. As time goes by, this leads to all
channels having the same balance.

A better strategy is to relay to the channel which has the smallest
balance but has enough to process the payment. This way we save larger
channels for larger payments, and also on average channels get depleted
one after the other.

* added tests...

...and found bugs!

Note that there is something fishy in BOLT 4, filed a PR:
https://github.com/lightningnetwork/lightning-rfc/pull/538

Also, first try of softwaremill's quicklens lib (in scope test for now)

* minor: fixed typo (h/t @btcontract)
2019-01-21 22:08:58 +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
araspitzu
255c280bd0 Routing: use custom implementation for the shortest path algorithm and the graph (#779)
* Consider htlc_minimum/maximum_msat when computing a route

* Compare shortChannelIds first as it is less costly than comparing the pubkeys

* Remove export to dot functionality

* Remove dependency jgraph

* Add optimized constructor to build the graph faster

* Use fibonacci heaps from jheaps.org

* Use Set instead of Seq for extraEdges, remove redundant publishing of channel updates

* Use Set for ignored edges
2018-12-20 16:52:42 +01:00
Pierre-Marie Padiou
ff588b578f
Use netty to connect to Electrum servers (#774)
* replaced akka.io by netty in electrum client and enabled ssl support

* updated docker-testkit to 0.9.8 so that electrum tests pass on windows

* use ssl port on testnet/mainnet

* removed experimental warning on electrum
2018-12-11 18:13:38 +01:00
Pierre-Marie Padiou
fa1b2e4c00
Switch sttp backend async-http-client -> okhttp (#764)
Okhttp works better on Android.
2018-11-23 11:58:23 +01:00