1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-03-13 19:37:35 +01:00
Commit graph

183 commits

Author SHA1 Message Date
sstone
fda8baa6ab Merge branch 'master' into android 2019-01-11 14:49:05 +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
dpad85
389fb0559b
Back to development mode 2018-12-20 17:37:17 +01:00
dpad85
f91c043281
Release v0.2-android-beta14 2018-12-20 17:36:25 +01:00
dpad85
5a28fb7a1b
Back to development mode 2018-12-18 19:04:37 +01:00
dpad85
ea73ae2295
Release v0.2-android-beta13 2018-12-14 14:14:37 +01:00
pm47
e91ab8199d
Merge branch 'master' into android 2018-11-23 14:03:11 +01:00
Pierre-Marie Padiou
dae5cc718a
Update Android branch (#746)
* Fixed regression in rebroadcast  (#713)

Fixed regression caused by 2c1811d: we now don't force sending a
channel_update at the same time with channel_announcement.
This greatly simplifies the rebroadcast logic, and is what caused the
integration test to fail.

Added proper test on Peer, testing the actor, not only static methods.

* Routing sync fixes (#712)

* Router: reset sync state on reconnection

When we're reconnected to a peer we will start a new sync process and should reset our sync
state with that peer.

* Ignore 'origin htlc not found' in CLOSING (#708)

If we don't have the origin, it means that we already have forwarded the fulfill so that's not a big deal.

This can happen if they send a signature containing the fulfill, then fail the channel before we have time to sign it.

* Fix handling of born again channels (#717)

* Fix handling of born again channels

When we receive a recent update for a channel that we had marked as stale we
must send a query to the underlying transport, not the origin of the update (which
would send the query back to the router)

* Replace `update_fee` in commitments (#709)

This is a simple optimisation, we don't have to keep all `update_fee`, just the last one.

cf BOLT 2:
> An update_fee message is sent by the node which is paying the Bitcoin fee. Like any update, it's first committed to the receiver's commitment transaction and then (once acknowledged) committed to the sender's. Unlike an HTLC, update_fee is never closed but simply replaced.

* Tests: use bitcoind 0.16.3 (#715)

Bitcoind 0.16.0 is no longer available

* Make `publishTransaction` idempotent (#711)

Bitcoin core returns an error `missing inputs (code: -25)` if the tx that we want to publish has already been published and its output have been spent. When we receive this error, we try to get the tx, in order to know if it is in the blockchain, or if its inputs were spent by another tx.

Note: If the outputs of the tx were still unspent, bitcoin core would return "transaction already in block chain (code: -27)" and this is already handled.

* Improved eclair-cli (#718)

This fixes #695, and also adds the channel point in the default channel output.

```bash
$ ./eclair-cli channel 00fd4d56d94af93765561bb6cb081f519b9627d3f455eba3215a7846a1af0e46
{
  "nodeId": "0232e20e7b68b9b673fb25f48322b151a93186bffe4550045040673797ceca43cf",
  "shortChannelId": "845230006070001",
  "channelId": "00fd4d56d94af93765561bb6cb081f519b9627d3f455eba3215a7846a1af0e46",
  "state": "NORMAL",
  "balanceSat": 9858759,
  "capacitySat": 10000000,
  "channelPoint": "470eafa146785a21a3eb55f4d327969b511f08cbb61b566537f94ad9564dfd00:1"
}
```

* Handle update relay fee in OFFLINE state (#719)

Previously it was only possible to update relay fee in NORMAL state,
which is not very convenient because most of the time there are always
some channels in OFFLINE state.

This works like the NORMAL case, except that the new `channel_update`
won't be broadcast immediately. It will be sent out next time the
channel goes back to NORMAL, in the same `channel_update` that sets the
`enable` flag to true.

Also added a default handler that properly rejects the
CMD_UPDATE_RELAY_FEE command in all other states.

* Fixed regression caused by 7a4f175 (#722)

When updating relay fee in state OFFLINE, the new channel_update must
have the disabled flag on.

This caused tests to be flaky, added necessary checks to always make
them fail in case that kind of regression happens again.

* Logging: use a rolling file appender (#721)

* Logging: use a rolling file appender

Use one file per day, keep 90 days of logs with a total maximum size
capped at 5 Gb

* Router: log routing broadcast in debug level only

* set version to 0.2-beta6

* set version back to 0.2-SNAPSHOT

* Simplify bitcoind version check (#731)

Bitcoind returns version as MMmmrr (major, minor, revision), use an int representation
and compare it to our minimum version target.

* Update scalatest and remove junit runner (#728)

* updated to scalatest 3.0.5

* use scalatest runner instead of junit

Output is far more readable, and makes console (incl. travis) reports
actually usable.

Turned off test logs as error reporting is enough to figure out what
happens.

The only downside is that we can't use junit's categories to group
tests, like we did for docker related tests. We	could use nested suites,
but that seems to be overkill so I just removed the categories. Users
will only have the possibility to either skip/run all tests.

* update scala-maven-plugin to 3.4.2

NB: This requires maven 3.5.4, which means that we currently need to
manually install maven on travis.

Also updated Docker java version to 8u181 (8u171 for compiling).

* Add instructions for Bitcoin Core 0.17.0 [ci skip] (#732)

* Add instructions for Bitcoin Core 0.17.0 [ci skip]

Bitcoin Core 0.17.0 deprecates the `signrawtransaction` RPC call, which will be removed in version 0.18.0, you need to enable this call if you want your eclair node to use a 0.1.70 node.

* README: add an example of how to use the new bitcoin.conf sections [ci skip]

* Only persist trimmed htlcs (#724)

We persist htlc data in order to be able to claim htlc outputs in
case a revoked tx is published by our counterparty, so only htlcs
above remote's `dust_limit` matter.

Removed the TODO because we need data to be indexed by commit number so
it is ok to write the same htlc data for every commitment it is included
in.

* set version to 0.2-beta7

* set version to 0.2-SNAPSHOT

* Add `htlcMaximumMsat` field to `ChannelUpdate` message (#738)

* Add `htlcMaximumMsat` field to `ChannelUpdate` message

* added compatibility test with c-lightning

* Fix encoding of FinalIncorrectHtlcAmount error message (#740)

* set version to 0.2-beta8

* set version to 0.2-SNAPSHOT

* Always add 1 block to the `finalCltvExpiry` (#742)

This fixes #651.

* ignore IntegrationSpec (no server on android)

* back to SNAPSHOT

* use proper [gs]etNullableLong method for Sqlite
2018-10-25 17:50:48 +02: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
sstone
4e0702a923
set version to 0.2-SNAPSHOT 2018-10-20 21:38:16 +02:00
sstone
52821b8664
set version to 0.2-beta8 2018-10-20 21:34:34 +02:00
sstone
b0305b0551
set version to 0.2-SNAPSHOT 2018-10-15 17:00:40 +02:00
sstone
c564f51d24
set version to 0.2-beta7 2018-10-15 16:48:13 +02:00
Pierre-Marie Padiou
892770b1ed
Update scalatest and remove junit runner (#728)
* updated to scalatest 3.0.5

* use scalatest runner instead of junit

Output is far more readable, and makes console (incl. travis) reports
actually usable.

Turned off test logs as error reporting is enough to figure out what
happens.

The only downside is that we can't use junit's categories to group
tests, like we did for docker related tests. We	could use nested suites,
but that seems to be overkill so I just removed the categories. Users
will only have the possibility to either skip/run all tests.

* update scala-maven-plugin to 3.4.2

NB: This requires maven 3.5.4, which means that we currently need to
manually install maven on travis.

Also updated Docker java version to 8u181 (8u171 for compiling).
2018-10-11 19:01:41 +02:00
sstone
997aceea82
set version back to 0.2-SNAPSHOT 2018-09-26 14:05:57 +02:00
sstone
3fc5da0a7b
set version to 0.2-beta6 2018-09-26 14:04:38 +02:00
dpad85
2379807f2e
Release v0.2-android-beta12 2018-09-20 13:03:12 +02:00
sstone
dba02f8265 set version to 0.2-android-beta12-sync-updates 2018-09-18 14:54:20 +02:00
sstone
990dbfac3e
set version to 0.2-android-beta12-SNAPSHOT 2018-09-18 12:15:15 +02:00
dpad85
a5a08a42a0
Release v0.2-android-beta11 2018-09-12 14:01:00 +02:00
Dominique
7017e76ad1
Set versions to 0.2-android-beta10 2018-08-15 16:52:53 +02:00
Dominique
818ef7fe1d
set version to 0.2-android-beta9 2018-07-18 20:58:53 +02:00
Dominique
3575fe7998
set version to 0.2-android-beta8 2018-07-16 12:12:49 +02:00
sstone
50d52b48ed
set version to 0.2-android-beta7 2018-06-21 13:31:51 +02:00
sstone
cd6524e25b
set version to 0.2-SNAPSHOT 2018-06-20 09:45:09 +02:00
sstone
8aa51f4e02
set version to 0.2-beta5 2018-06-20 09:21:05 +02:00
sstone
f3a5024c0d set version to 0.2-android-beta6 2018-06-11 16:24:39 +02:00
sstone
684004fef3 set version to 0.2-android-SNAPSHOT 2018-06-11 12:08:37 +02:00
sstone
8c4ecebf2d set version to 0.2-android-beta5 2018-06-05 17:55:28 +02:00
sstone
bf26272b86 Set version to 0.2-android-beta4 2018-05-31 10:25:12 +02:00
sstone
a85ba9ceef
set version to 0.2-SNAPSHOT 2018-05-30 19:15:06 +02:00
sstone
e6fe077582
set version to 0.2-beta4 2018-05-30 19:11:44 +02:00
pm47
644b4a2a98
back to SNAPSHOT 2018-05-18 15:53:02 +02:00
pm47
1dd8aa5aab
set version to 0.2-beta3 2018-05-18 15:14:52 +02:00
sstone
5eb381a0f8 set version to 0.2-android-beta3 2018-05-04 17:57:22 +02:00
sstone
c275482c2c Merge branch 'wip-routing-sync' into android 2018-05-04 17:56:03 +02:00
Fabrice Drouin
2d0564b9f8
Update bitcoin-lib to 0.9.17 (#582)
* use bitcoin-lib 0.9.17

* use Long values in BIP32 key path
2018-05-03 14:53:59 +02:00
dpad85
9277308b2b
set version to 0.2-android-beta2 2018-04-11 17:28:36 +02:00
pm47
b5437c9bad
back to SNAPSHOT 2018-04-04 13:52:24 +02:00
pm47
7598615263
set version to 0.2-beta2 2018-04-04 13:40:03 +02:00
pm47
0b1d28f2d9
set version to 0.2-android-beta1 2018-04-04 13:22:51 +02:00
pm47
e946c1a466
Merge branch 'master' into wip-android 2018-03-29 17:09:18 +02:00
pm47
b2178ade30
back to SNAPSHOT 2018-03-28 21:27:55 +02:00
pm47
c39ce692f8
setting version to 0.2-beta1 2018-03-28 20:46:40 +02:00
Fabrice Drouin
58049a07b7
use bitcoin-lib 0.16 (#519) 2018-03-28 20:41:38 +02:00
Pierre-Marie Padiou
242f69fd6f
Add support for mainnet (#513)
* add support for mainnet final pubkeyscript

* electrum: add addresses of electrumx servers on mainnet

* electrum: use chain hash to compute addresses and HD key paths

* store db files in a subdirectory of datadir

* add a 'catchall' around deserialization

* use chain-specific key derivation paths for channel keys

* fixed intermittently failing test (we were comparing timestamps...)

* parameters:
- set default `router-broadcast-interval` to 60s
- set default `mindepth-blocks` to 3 blocks
- removed deprecated setting `router-validate-interval`
- reduce fees: block target 1->2
- reduce `MIN_CLTV_EXPIRY` from 9 to 7
Default value in BOLT11 was indeed 9 blocks, but the absolute minimum
value computed in BOLT2 is 7 blocks.
- remove unused `default-feerate-per-kb`
- set default `max-htlc-value-in-flight-msat`=10mBTC
- set default `max-to-local-delay-blocks` to 2000 blocks

* Update README with instructions for mainnet

* Upgrade to bitcoin-lib 0.9.15 (#516)

* use fees from provider, not default ones
2018-03-28 20:21:19 +02:00
Pierre-Marie Padiou
e44e6b4431
Updated akka/http/json dependencies (#512) 2018-03-26 17:36:33 +02:00
pm47
e5509ed417
merge from master 2018-03-26 12:05:03 +02:00
Pierre-Marie Padiou
d38f227b42
Added copyright notice to all files (#497)
* added copyright notice to all files

* updated date in LICENSE
2018-03-21 16:29:42 +01:00
dpad85
36b0b223b0 Back to snapshot 2018-03-20 16:06:01 +01:00