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

1198 commits

Author SHA1 Message Date
pm47
2f43e3bff9 Merge branch 'master' into wip-android 2018-02-16 19:24:22 +01:00
pm47
1b247ae613 back to SNAPSHOT 2018-02-16 18:10:35 +01:00
pm47
0beca13b23 set version to 0.2-alpha10 2018-02-16 17:28:01 +01:00
Pierre-Marie Padiou
82803cab1d
Ignore 'tx already in block chain' errors when publishing a tx (#441)
And set more reasonable log levels in `ZmqWatcher`.
2018-02-16 17:22:03 +01:00
Pierre-Marie Padiou
57e4f54d3e
Improved queuing of initial_routing_sync requests (#440)
We now use a queue instead of relying on a scheduler that re-send the request.

Also, better management of dead connection, they get cleaned up and removed from the queue.
2018-02-16 17:01:39 +01:00
Pierre-Marie Padiou
b91e90783f
Replaced LoggingFSM -> FSM (#439)
And changed akka default log level from `DEBUG` to `INFO`.
2018-02-16 16:51:10 +01:00
Pierre-Marie Padiou
1aea66457a
Explicitely ack all relayed messages (#390)
In order to gracefully handle cases when the counterparty goes online while we are in
the middle of processing payments, we need to explicitely ack all
`fulfill`/`fail`/`fail_malformed` messages.

We previously only acked `fulfill` messages.

Also, we now fail timed out htlcs at the right time, which is:
- for dust htlcs, when the commitment tx reaches `min_depth`
- for non-dust htlcs, when the htlc-timeout or claim-htlc-timeout tx
  reaches `min_depth`

Moved preimage extraction to `Helper` file.

This fixes #376, #377 and #378.
2018-02-16 16:42:08 +01:00
Pierre-Marie Padiou
f3b746643d
Use TCP pull mode (#422)
We now use [akka tcp pull mode](https://doc.akka.io/docs/akka/2.5.3/scala/io-tcp.html#read-back-pressure-with-pull-mode) for both incoming and outgoing connections.

In combination with setting a relatively low value for `akka.io.tcp.max-received-message-size`, this results in less RAM consumption, in particular when validating a whole routing table.

Also improved the router:
- Removed the grouping of `channel_announcement` because batching is done lower in the stack, in the bitcoin json-rpc client. Channels are now validated as they arrive.
- Keep track of all origin peers for every announcement (instead of the first one), in order not to send back the same announcements to peers.
- Better choice of data structures, which increases constant time operation (but don't completely eliminate less efficient access)
- Reworked management of private/not-yet-announced channels
2018-02-16 15:49:34 +01:00
n1bor
17acf77a65 Persisted channel capacity an added fees and capacity to Channel GUI (#416)
* (gui) added channel fees (base and proportional) and capacity to the list 
of channels in network

* (gui) fixed issues with gui being updated from wrong threads

* channel capacity is now saved in network DB along with the tx id when
a channel is discovered. `ChannelDiscovered` now contains the capacity.

A compatibility check for the network DB is added in startup. This check is
separated from the node DB check because a network DB check failure is
less severe and the network DB file can be safely removed with no impact
on the node.
2018-02-12 17:28:21 +01:00
Dominique
0416784f08 TCPException message error should be defined (#401)
* TCPException sets a message when extending RuntimeException

If no message was set for the exception, a 'null' message was displayed to
the user when TCPException is thrown. Instead, we now display the exception class name.

This fixes #399.
2018-02-12 15:33:29 +01:00
Pierre-Marie Padiou
468bb5ebfb
Don't send duplicate INPUT_RECONNECTED to channels (#430) 2018-02-12 15:05:34 +01:00
Pierre-Marie Padiou
32d634c7f7
Batch requests to bitcoind json-rpc api (#429)
* added a batching client for bitcoind jsonrpc api

* convert json-rpc errors to exceptions in batching client
2018-02-07 16:58:11 +01:00
Pierre-Marie Padiou
b75962a57f
Store channel funding txid with announcements db (#421)
* store channel funding txid in network db

* directly load announcements from disk without re-validating them all

* use dedicated sqlite file for network announcements db

* re-send `ChannelDiscovered` and `NodeDiscovered` on startup

Also removed unused `ChannelDiscovered`.`capacity` field.

This should fix #415.
2018-02-06 18:18:47 +01:00
Benoît Verret
95a48be266 (gui) Invalidate ports below 0 and above 65535 (#412)
Removed regex validation from the open channel controller, using parser instead for error management. URI with ports below 0 and above 65535 are rejected.

Replaced "url" by "uri" in GUI
2018-02-06 10:29:38 +01:00
Dominique
6719c2d8f1
Added an optional seed to Setup (#424)
If this seed is not provided, it is generated and stored in a seed.dat file.
The electrum watcher uses this seed for its key.
2018-02-01 22:04:51 +01:00
practicalswift
7a6fa8a619 Fix typos (#417) 2018-01-29 18:42:07 +01:00
Dimitris Tsapakidis
e55e1e0dab Added quotes to eclair.bitcoind.zmq parameter value in README.md (#394)
The sample value for eclair.bitcoind.zmq requires quotes to comply with HOCON specifications.
2018-01-29 18:41:40 +01:00
Dimitris Tsapakidis
d5b0afb9e0 Clarify that Eclair uses Bitcoin Core as bitcoin wallet. (#395) 2018-01-29 18:40:24 +01:00
pm47
56ef710f06 back to SNAPSHOT 2018-01-23 19:11:06 +01:00
pm47
951bcc4750 set version to 0.2-alpha9 2018-01-23 15:29:21 +01:00
Dominique
af7d7b164a Various GUI Improvements (#396)
* (gui) Added funding tx id to channel panel

fixes #335

* (gui) close channel button hidden when CLOSING or CLOSED

fixes #332

* (gui) User can define a preferred display unit

On startup FxApp reads the configuration from `eclair.conf` and sets
a unit to which all the amounts in the UI must be converted.

This unit is a CoinUnit object. Only `sat`, `mbtc` and `btc` are accepted.
`msat` is not accepted because it's an internal accounting unit which
should be invisible to the user. Default unit is `btc`

The gui does not expose any ui feature to update this unit at runtime.

* (gui) Notification message wraps and can now be copied

Notification message should be readable especially when an error occurs.
The message can be copied for easier issue reporting.

* Payment attempts is limited to 1

* (gui) consistent order in status bar contextual actions

* (gui) fixed unit parsing

* (gui) added menu shortcuts

fixes #347

* Revert "Payment attempts is limited to 1"

This reverts commit 1f4168aacb.

* (gui) BtcAmount are convertible to raw big decimal without loss

Fix issue where the decimal part of a BtcAmount could be lost.
Millisatoshi is now accepted as a user preferred unit.

* Set a minimum htlc amount of 1 mSat by default

By default, the node configuration should be permissive and accept low
value payments. It is up to the node admin to set up a restrictive
configuration if he needs it.

* (gui) port in node uri is optional

* (gui) added reactive errors in open channel window

* (gui) format max pr amount to user preferred unit

* (gui) Payment Request QR should be uppercased

see #375

* (gui) added a conf for the gui module

* Added eclair.gui.unit option in README
2018-01-23 15:25:53 +01:00
Pierre-Marie Padiou
c86163cc81
Always check maxAttempts counter when receiving unparseable errors (#391)
We previously only checked this counter when receiving parseable failures
(of type `ErrorPacket`).

This would lead to infinite payment loop in certain cases.

This fixes #355.
2018-01-22 19:05:01 +01:00
Chris Stewart
827f9eee02 Fix 'filename too long' compilation error on encrypted file systems (#385)
This fixes #379.
2018-01-22 17:59:47 +01:00
Anton Kumaigorodski
f1191bf325 Make payment request expiry configurable (#341)
* Make payment request expiry configurable

* Add payment request expiry to test constants

* Remove outdated unpaid requests from LocalPaymentHandler

* Add max allowed number of pending requests

* Update request pruning code in LocalPaymentHandler, replace def with lazy val in PaymentRequest

* Make payment handler return an error when we are over `max-pending-payment-requests`
2018-01-22 16:55:58 +01:00
Dominique
aa90f94304
Include payment preimage in PaymentSent event (#374)
Payment preimage is important for the sender of the payment as it proves
that he actually paid the request. It must then be available from the
`PaymentSent` event.

(gui) Payment preimage column is added to the 'payments sent' table in Activity tab
2018-01-22 16:10:17 +01:00
Benoît Verret
eb03b8ddfe (minor) Fix a comment (#386) 2018-01-21 11:47:48 +01:00
Benoît Verret
1db673a631 Add getinfo to API help (#383) 2018-01-21 11:41:06 +01:00
Benoît Verret
c1f6102515 Make eclair-cli executable (#382) 2018-01-20 23:37:21 +01:00
Kevin Kelbie
35011d3eca Updated username and password in readme (#371)
Set the same rpc user/password in the example bitcoin core config than the default ones used by eclair.
2018-01-18 15:25:12 +01:00
Benoît Verret
d56ad99200 Indicate that wallet mode is needed before exiting (#368) 2018-01-16 16:34:09 +01:00
Benoît Verret
2804e8a919 Remove api.user (#370)
It is not verified in the code.
2018-01-15 21:21:54 +01:00
pm47
e28ac3990e Merge branch 'master' into wip-android 2018-01-15 16:51:08 +01:00
Dominique
6142d92cc1
Handle ipv6 addresses (#367)
* NodeURI can now handle ipv6 addresses

The address field in `NodeURI` is now a `HostAndPort` object. The reasoning is that `InetSocketAddress` is a network object and should not be directly used in an utility object. Using `HostAndPort` makes for a more readable and less bug prone code.

This especially helps with the parsing of ipv6 addresses which is more complex than ipv4. It also avoids a early lookup when the `NodeURI` object is created.

Deserialization to `NodeURI` now defaults to port 9735 if the port could not be found in the string.

fixes #343
fixes #346
2018-01-11 20:32:29 +01:00
Pierre-Marie Padiou
a1d69af597
Fixed eclair-cli (#354)
* reworked eclair-cli

* API is disabled by default, disabled CORS and require basic auth password

* better error handling

* Fixed latest version in README

* Increased connection timeout to 15s in electrum client test

* Rgb in NodeAnnouncement is now a Color object

Makes the color field more practical to handle and enable finer
serialization with a more readable code.

allnodes command in api now exports a list with node announcements.

* Added api call to list all the channels updates

This call can also filter the channels for a given nodeId

This fixes #344.
2018-01-11 19:23:17 +01:00
Pierre-Marie Padiou
a00fd96ca6
Fix memory leak and reduce overall memory usage (#365)
* added logs

* more efficient logging

* added huge bitcoin jsonrpc queue

* only publish/watch txes if needed when restarting in `CLOSING` state

* limit number of parallel routing state dump

* added a supervision strategy to authenticator hierarchy

* only forward Rebroadcast to connected peers

* rework management of `origins` in router

* explicitely close sqlite prepared statements

* fixed pruning logic

* send instead of forward announcement to router

* store txes that have reached `mindepth` in `CLOSING` state

* add a minimum 10s delay between two reconnection attempts

otherwise, this would frequently cause 2 successful parallel connections

* don't trigger a `NewBlock` event when receiving a new `WatchConfirmed`

Instead, just check this particular watch

* TransportHandler: fix typo when logging received data that has a bad prefix

* better handling of connection errors

* kill WriteAckSender when connection dies, don't send connection errors when auto connecting

* streamlined io actors

* handle parallel connections in peer

This fixes #357.
2018-01-11 13:09:16 +01:00
Fabrice Drouin
065de8bb5c Fix encoding of failure messages (#366)
* Fix encoding of failure messages (fixes #363)
When a failure message includes a channel update field, this field must be encoded as:
[ len | channel update] and we did not include the len field.

* add `ExpiryTooFar` failure message
2018-01-11 12:08:46 +01:00
Benoît Verret
0781eb7a40 Specify that Bitcoin Core must have wallet enabled (#361) 2018-01-08 23:21:53 +01:00
dpad85
42715abda0 Back to SNAPSHOT 2018-01-05 11:54:31 +01:00
pm47
74faad53e8 back to SNAPSHOT 2017-12-23 19:26:54 +01:00
pm47
8edb2a478c set version to 0.2-alpha8 2017-12-23 18:37:00 +01:00
Pierre-Marie Padiou
0ef43bb3b8
Update README.md 2017-12-23 18:32:13 +01:00
fresheneesz
38add65895 Adding link to https://explorer.acinq.co in README (#331) 2017-12-23 18:30:29 +01:00
pm47
6874dd6a50 set version to 0.2-android-alpha12 2017-12-23 00:21:07 +01:00
pm47
78559d4298 Merge branch 'master' into wip-android 2017-12-22 23:34:10 +01:00
Pierre-Marie Padiou
a3bdf52a2f
Improve logs (#320)
* always print `shortChannelId` in hex

* fixed logs in `ThrottleForwarder`

* logs the `paymentHash` when relaying an htlc

* don't print all channel data when restoring a channel

* added logs to relayer

* reduced log level in Peer

* cleaned up switchboard logs

* fixed `id`/`channelId` mixup in relayer logs

* slight changes in log levels

* do not log as warning when tx generation is simply skipped

* streamlined relayer logs

* improved router logs

* don't display errors when witness can't be parsed

* don't log connection errors as warnings

* reduce amount of logs in case of local known error

* removed reconnection message to deadletter

* try a cleaner way of displaying channel errors

* put some reconnection-related logs from info to debug

* peer: ignore `Rebroadcast` messages in `INITIALIZING`

* less verbose exception logging in channel

* display friendlier close type

* reduced default log level to INFO
2017-12-22 23:32:34 +01:00
pm47
aa5e7abf4a fixed textui 2017-12-22 23:28:21 +01:00
Dominique
8197747913
[gui] Various gui fixes (#327)
Fixes #318, #317, #306

* README should recommend TESTNET

* (gui) ui can parse lightning: and lightning:// schemes

* (gui) Relaxed decimal amount regex: accepts no leading int

* (gui) Added a node info modal displaying node URI as QR code

* (gui) Logging throwable when gui can not start
2017-12-22 23:26:29 +01:00
pm47
a31eb7fcf1 Merge branch 'master' into wip-android 2017-12-22 23:19:13 +01:00
pm47
1e17a7df66 ignore test on node_announcement 2017-12-22 23:07:17 +01:00
Pierre-Marie Padiou
fe5416d2df Reworked peer management (#316)
* reworked peer management

- connection and channel opening are now separated, simplified
  `switchboard`

- use a single authenticator for both incoming and outgoing connections

- `peers` api call now returns current state and channel count

* fixed last commit

* fixed last merge

* added inetsocketaddress serializer
2017-12-22 23:06:35 +01:00