Commit Graph

102 Commits

Author SHA1 Message Date
Matt Corallo
cc5fea84e6 Update version numbers to rc1, from alpha1 2023-07-17 20:07:30 +00:00
Matt Corallo
23e9fc79fd Bump versions to LDK 116-alpha1 and invoice 24.0-alpha1 2023-06-23 19:43:26 +00:00
Wilmer Paulino
4f9bcb9958
Check difficulty transition against Target instead of Work
`rust-bitcoin v0.30.0` made some changes in this area that no longer
allow us to work with the previously exposed `U256` type. While `Work`
and `Target` (they're inverses of each other) essentially represent the
same concept, it makes more sense from their API's perspective to only
expose difficulty transitions and adjustments on `Target`s.
2023-05-10 11:39:46 -07:00
Arik Sosman
6cb9919f0c
Move keysinterface.rs to a directory-level module called sign. 2023-05-02 21:48:08 -07:00
Matt Corallo
fb424009e3 Bump crate versions to 0.0.115/invoice 0.23 2023-04-24 22:40:17 +00:00
Matt Corallo
9a50e301cb Avoid connection-per-RPC-call again by caching connections
In general, only one request will be in flight at a time in
`lightning-block-sync`. Ideally we'd only have one connection, but
without using the `futures` mutex type.

Here we solve this narrowly for the one-request-at-a-time case by
caching the connection and takeing the connection out of the cache
while we work on it.
2023-03-30 22:28:26 +00:00
Matt Corallo
6b55df93fb Drop futures dependency from lightning-block-sync
Some how I'd understood that `futures` had reasonable MSRV
guarantees (e.g. at least Debian stable), but apparently that isn't
actually the case, as they bumped it to upgrade to syn (with
apparently no actual features or bugfixes added as a result?) with
no minor version bump or any available alternative (unlike Tokio,
which does LTS releases).

Luckily its relatively easy to just drop the `futures` dependency -
it means a new connection for each request, which is annoying, but
certainly not the end of the world, and its easier than trying to
deal with pinning `futures`.

See https://github.com/rust-lang/futures-rs/pull/2733
2023-03-30 18:56:27 +00:00
Matt Corallo
b701a6c516 Drop serde dependency from lightning-block-sync
`serde` doesn't bother with MSRVs, so its expected to break
frequently. Yesterday, the `derive` feature had its MSRV broken in
a patch version without care.

Luckily its trivial for us to remove the `serde` dependency in
`lightning-block-sync`, using only `serde_json` for the JSON
deserialization part. It even ends up net-negative on LoC.
2023-03-20 16:31:22 +00:00
Elias Rohrer
73306a3503
Pin tokio to 1.26 on windows to fix CI 2023-03-12 14:12:21 +01:00
Matt Corallo
ccac926671
Merge pull request #2049 from douglaz/run-clippy-fix
Run clippy fix
2023-03-06 21:28:38 +00:00
Allan Douglas R. de Oliveira
57017dfc0b Run clippy --fix and cleanup code 2023-03-06 19:26:48 +00:00
Matt Corallo
a361be3544 Update crate versions to 0.0.114/invoice 0.22 2023-03-04 00:06:46 +00:00
Jeffrey Czyz
8408b8d0e4
Add more documentation about BlockSourceError
Some BlockSource implementations provide more error details. Document
this in case users want to examine it further.
2023-03-03 14:23:17 -06:00
John Cantrell
a7af24bf3c Surface bitcoind rpc error code
Users of the RpcClient had no way to access the error code
returned by bitcoind's rpc.  We embed a new RpcError struct
as the inner error for the returned io::Error. Users can access
both the code and the message using this inner struct.
2023-02-28 14:03:28 -05:00
Matt Corallo
358d980e64 Always set _test_utils when building lightning for some tests
This ensures that we hit additional assertions which are intended
to always be run in tests.
2023-01-17 23:47:45 +00:00
Arik Sosman
72183bd932
Split up generic parameters that used to comprise KeysInterface. 2023-01-12 16:10:35 -08:00
Arik Sosman
5824e226ca
Remove KeysInterface trait. 2023-01-12 09:18:08 -08:00
Valentine Wallace
2e06efe2ff
Parameterize ChannelManager by a Router trait
This will be used in upcoming work to fetch routes on-the-fly for payment
retries, which will no longer be the responsibility of InvoicePayer.
2023-01-03 15:34:14 -05:00
Matt Corallo
f96ac1d341 Bump crate versions to 0.0.113/invoice 0.21 2022-12-15 22:15:55 +00:00
Arik Sosman
1c8a06cf61
Remove generic Signer parameter where it can be inferred from KeysInterface 2022-11-09 16:15:11 -08:00
valentinewallace
2e343e78ca
Merge pull request #1797 from arik-so/2022-10-channel-manager-deparameterization
Deparametrize `ChannelManager` to infer `Signer` from its `KeysInterface`.
2022-10-26 13:32:09 -04:00
Arik Sosman
22c367b13b
Deparametrize ChannelManager to infer Signer from its KeysInterface. 2022-10-25 10:02:28 -07:00
Matt Corallo
35154a15c3 Bump crate versions to 0.0.112/invoice 0.20 2022-10-24 18:53:58 +00:00
Jeffrey Czyz
ee17faff90
Merge pull request #1777 from lexe-tech/max/best-block-header-best-block
Add `.to_best_block()` method to `ValidatedBlockHeader`
2022-10-19 08:46:07 -05:00
Max Fang
a9f8b6e052 Add ValidatedBlockHeader::to_best_block 2022-10-18 14:47:52 -07:00
Gabriel Comte
aa916bb594
Derive Eq for all structs that derive PartialEq 2022-10-14 13:24:02 +02:00
Elias Rohrer
0038a3f7de
Add futures CI check
This adds testing of the `futures` feature to CI. In order to avoid
introducing a dependency on `std`, we switch to using the `futures-util`
crate directly enabling only a subset of features. To this end, we also
switch to using the `select_biased!` macro, which is equivalent to
`select!` except that it doesn't choose ready futures pseudo-randomly
at runtime.
2022-10-10 14:47:18 -04:00
Matt Corallo
a922830ebb
Merge pull request #1706 from jkczyz/2022-09-filtered-blocks
Support filtered blocks in `lightning-block-sync`
2022-09-13 19:50:34 +00:00
Jeffrey Czyz
c1938e8c9f
Support filtered blocks in lightning-block-sync
Expand the BlockSource trait to allow filtered blocks now that
chain::Listen supports them (d629a7edb7).
This makes it possible to use BIP 157/158 compact block filters with
lightning-block-sync.
2022-09-13 12:47:31 -05:00
Matt Corallo
f5473d5051 Bump versions to lightning* 0.0.111 and lightning-invoice 0.19 2022-09-12 22:34:27 +00:00
Matt Corallo
b414c0641b
Merge pull request #1658 from lightning-signer/2022-08-bitcoin-0-29
Update bitcoin crate to 0.29.0
2022-08-12 23:51:06 +00:00
Devrandom
7e05623bef Update bitcoin crate to 0.29.0 2022-08-11 00:21:26 +02:00
Valentine Wallace
c242003dd3
Fix CI to error on doc links to private items
Somehow we weren't doing this.
2022-08-07 13:49:12 -04:00
Matt Corallo
e10dfe4fd0 Bump crate versions to 0.0.110/invoice 0.18 2022-07-26 22:01:09 +00:00
Duncan Dean
e256b3498e
Reuse BlockHash from validate_pow()
The `validate_pow()` method now returns the BlockHash since rust-bitcoin
v0.26.2 thanks to jkczyz's PR (rust-bitcoin/rust-bitcoin/pull/572).
2022-07-22 11:45:06 +02:00
Matt Corallo
156cc77753 Bump crate versions to 0.0.109/invoice 0.17 2022-07-01 16:05:33 +00:00
Matt Corallo
deac430f17 Update crate versions to 0.0.108/invoice 0.16 2022-06-10 14:53:23 +00:00
Jeffrey Czyz
b2e635f619
Bump crate versions to 0.0.107/invoice 0.15 2022-06-08 18:16:48 -05:00
Devrandom
28d33ff9e0 bitcoin crate 0.28.1 2022-05-05 18:04:42 +02:00
Matt Corallo
d629a7edb7 Expand chain::Listen trivially to accept filtered block data
The `chain::Listen` interface provides a block-connection-based
alternative to the `chain::Confirm` interface, which supports
providing transaction data at a time separate from the block
connection time.

For users who are downloading the full headers tree (e.g. from a
node over the Bitcoin P2P protocol) but who are not downloading
full blocks (e.g. because they're using BIP 157/158 filtering)
there is no API that matches exactly their event stream -
`chain::Listen` requries full blocks for each block,
`chain::Confirm` requires breaking each connection event into two
calls.

Given its incredibly trivial to take a `TransactionData` in
addition to a `Block` in `chain::Listen` we do so here, adding a
default-implementation `block_connected` which simply creates the
`TransactionData`, which ultimately all of the `chain::Listen`
implementations currently do anyway.

Closes #1128.
2022-04-26 19:14:19 +00:00
Jeffrey Czyz
b902cc7c49
Remove unnecessary lifetime bound 2022-04-15 11:41:34 -05:00
Jeffrey Czyz
8967d20b29
Remove mut in lightning-block-sync tests 2022-04-15 11:41:33 -05:00
Jeffrey Czyz
b10217590b
Allow &dyn BlockSource in lightning-block-sync
Update lightning-block-sync's init and poll modules to support &dyn
BlockSource such that the BlockSource can be determined at runtime.
2022-04-15 11:38:48 -05:00
Jeffrey Czyz
3cdbbf56e4
Immutable BlockSource interface
Querying a BlockSource is a logically immutable operation. Use non-mut
references in its interface to reflect this, which allows for users to
hold multiple references if desired.
2022-04-03 20:59:11 -05:00
Jeffrey Czyz
de8bb8d261
Bump crate versions to 0.0.106/invoice 0.14 2022-04-03 08:05:08 -05:00
Matt Corallo
84a08dbf8a Make lightning-block-sync's init module slightly more generic
Users who want to use lightning-block-sync's init module would
be reasonable in wanting to use it in a multithreaded environment,
however because it takes a list of listeners as dyn chain::Listen
without any Send or Sync bound they fail in doing so.

Here we make the type bounds on `chain::Listen` generic across
`chain::Listen + ?Sized`, which the existing bound of `&dyn
chain::Listen` satisfies. Thus, this is strictly less restrictive
and allows for the use of `&dyn chain::Listen + Send + Sync`.
2022-03-09 18:20:43 +00:00
Matt Corallo
def0628332 Bump crate versions to 0.0.105/invoice 0.13 2022-03-01 00:43:24 +00:00
Jeffrey Czyz
62b1e01ad9
Generate docs with features for docs.rs
Enable generating docs using --all-features or --features="std" where
applicable. Additionally, use doc_auto_cfg to tag items requiring a
feature.

https://doc.rust-lang.org/nightly/rustdoc/unstable-features.html#doc_auto_cfg-automatically-generate-doccfg

This requires building with nightly, which is what is used by docs.rs.

https://docs.rs/about/builds

To test locally, use:

RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc ...
2022-02-18 15:38:31 -06:00
Jeffrey Czyz
6fb6994101
Fix cargo doc warning in lightning-block-sync 2022-02-18 15:34:07 -06:00
Matt Corallo
aca5b6934a Restrict tokio to 1.14 as a dev-dependency
This maintains our MSRV for simple `cargo test` runs, but doesn't
restrict users to any specific 1.X tokio version.
2022-02-17 17:47:13 +00:00