Commit Graph

146 Commits

Author SHA1 Message Date
Matt Corallo
c9de257498 Update versions to 0.0.124 and invoice 0.32 types 0.1 release 2024-09-03 18:18:52 +00:00
Matt Corallo
856c980594 Bump versions to rc1 2024-08-29 19:40:09 +00:00
Matt Corallo
cd0ca28945 Bump version numbers to 0.0.124-beta/invoice 0.32-beta 2024-08-20 00:29:12 +00:00
Elias Rohrer
f87eaccae8
rustfmt: Run on lightning-persister 2024-08-17 09:23:36 +02:00
Arik Sosman
176d2ad599
Upgrade rust-bitcoin to 0.32.2. 2024-08-16 10:31:45 -07:00
Duncan Dean
99aa6e27f6
Use native check-cfg lint in cargo beta
This uses the newly introduced conditional configuration checks that are
now configurable withint Cargo (beta).

This allows us to get rid of our custom python script that checks for
expected features and cfgs.

This does introduce a warning regarding the unknown lint in Cargo
versions prior to the current beta, but since these are not rustc errors,
they won't break any builds with the "-D warnings" RUSTFLAG.

Moving to this lint actually exposed the "strict" feature not being
present in the lightning-invoice crate, as our python script didnt
correctly parse the cfg_attr where it appeared.
2024-07-12 11:48:15 +02:00
Matthew Rheaume
808d814a76 Updated ClosureReason::HolderForceClosed with broadcasted txn. 2024-06-10 12:09:24 -07:00
Arik
993cd1e525
Merge pull request #2889 from Sharmalm/2840
Allow for user-specified error message during force close channel
2024-06-03 14:48:52 -07:00
Jiri Jakes
a8bd4c097f
Upgrade rust-bitcoin to 0.31 2024-05-30 18:35:29 +08:00
Gursharan Singh
c1125f00b3
Remove MonitorUpdateId from persist trait
MonitorUpdateId was an opaque abstraction for id's generated by
UpdateOrigin:Offchain and UpdateOrigin::ChainSync monitor updates.
It was mainly needed to map calls made to
ChainMonitor::channel_monitor_updated. We no longer track
UpdateOrigin::ChainSync MonitorUpdates and can directly use
ChannelMonitor::get_latest_update_id() for tracking
UpdateOrigin::Offchain monitor updates.
2024-04-26 20:28:55 -07:00
Gursharan Singh
7de602a38a
Stop tracking MonitorUpdates from ChainSync in pending_monitor_updates
We no longer need to track them since we no longer hold events for
pending MonitorUpdates resulting from ChainSync.
2024-04-26 16:06:44 -07:00
Lalitmohansharma1
d17e759d02 Allowing user-specified error message during force close channel
In this commit i added additional parameter `error_message` to
`force_close_sending_error`. This parameter will allow users to
configure error message and send to peers during the force closing
of channel.I have also updated the tests for this updated function.
2024-04-20 19:12:59 +05:30
Matt Corallo
49b375311b Bump crate versions to 0.0.123-beta/invoice 0.31-beta 2024-04-19 01:03:03 +00:00
Matt Corallo
ef2e739295 Remove a handful of redundant imports
... that newer rustc now warns about.
2024-04-05 09:05:56 +00:00
Duncan Dean
cf2c27800a
Remove Outpoint::to_channel_id method
To avoid confusion and for accuracy going forward, we remove this method
as it is inconsistent with channel IDs generated during V2 channel
establishment. If one wants to create a V1, funding outpoint-based
channel ID, then `ChannelId::v1_from_funding_outpoint` should be used
instead.

A large portion of the library has always made the assumption that having
the funding outpoint will always allow us to generate the channel ID.
This will not be the case anymore and we need to pass the channel ID along
where appropriate. All channels that could have been persisted up to this
point could only have used V1 establishment, so if some structures don't
store a channel ID for them they can safely fall back to the funding
outpoint-based version.
2024-01-30 12:30:26 +02:00
Matt Corallo
7b31b303c6 Bump versions to LDK 0.0.121/invoice 0.29 2024-01-22 22:32:30 +00:00
Matt Corallo
37017ec39f Bump crate versions to 0.0.120/invoice 0.28 2024-01-17 21:34:29 +00:00
Elias Rohrer
5933af1f2d
Drop unused windows imports in FilesystemStore tests 2023-12-18 08:53:28 +01:00
Matt Corallo
c6e4debee9 Bump versions to 0.0.119/lightning-invoice 0.27 2023-12-15 23:53:40 +00:00
Elias Rohrer
ddf2509227
Bump MSRV to rustc 1.63.0 and edition to 2021
.. which is a reasonable common ground, also supported by Debian stable.
2023-12-08 14:03:45 +01:00
Wilmer Paulino
ec928d55b4
Bump rust-bitcoin to v0.30.2 2023-11-22 15:58:01 -08:00
Matt Corallo
b664875c1b Bump crate versions to lightning 0.0.118, invoice 0.26 2023-10-23 23:41:11 +00:00
Matt Corallo
c74874604e Bump crate versions to 0.0.117/invoice 0.25 2023-10-03 23:00:48 +00:00
Matt Corallo
7036681728 Bump crate versions to 0.0.117-rc1/invoice 0.25-rc1 2023-09-29 23:39:18 +00:00
Elias Rohrer
a8fa5a1685
Merge pull request #2591 from TheBlueMatt/2023-09-2562-followups
Doc and comment followups to #2562
2023-09-29 19:08:36 +02:00
Matt Corallo
47e1148283 Update remaining references to primary/secondary namespaces
Update various variables, error strings, and the pending changelog
entry to refer to new namespace terminology.
2023-09-28 18:35:38 +00:00
Matt Corallo
94140b91d8 Bump versions to 0.0.117-alpha2/invoice 0.25.0-alpha2 2023-09-26 20:21:08 +00:00
Matt Corallo
4abc939aa0 Correct test comments missed in f254c56585 2023-09-26 16:37:19 +00:00
Matt Corallo
e01b51db67 Update crate version numbers to 0.0.117-alpha1/invoice 0.25-alpha1 2023-09-21 20:27:12 +00:00
Matt Corallo
f254c56585 Add an UnrecoverableError variant to ChannelMonitorUpdateStatus
While there is no great way to handle a true failure to persist a
`ChannelMonitorUpdate`, it is confusing for users for there to be
no error variant at all on an I/O operation.

Thus, here we re-add the error variant removed over the past
handful of commits, but rather than handle it in a truly unsafe
way, we simply panic, optimizing for maximum mutex poisoning to
ensure any future operations fail and return immediately.

In the future, we may consider changing the handling of this to
instead set some "disconnect all peers and fail all operations"
bool to give the user a better chance to shutdown in a semi-orderly
fashion, but there's only so much that can be done in lightning if
we truly cannot persist new updates.
2023-09-21 19:12:31 +00:00
Matt Corallo
23c5308bcb Drop the ChannelMonitorUpdateStatus::PermanentFailure variant
When a `ChannelMonitorUpdate` fails to apply, it generally means
we cannot reach our storage backend. This, in general, is a
critical issue, but is often only a transient issue.

Sadly, users see the failure variant and return it on any I/O
error, resulting in channel force-closures due to transient issues.

Users don't generally expect force-closes in most cases, and
luckily with async `ChannelMonitorUpdate`s supported we don't take
any risk by "delaying" the `ChannelMonitorUpdate` indefinitely.

Thus, here we drop the `PermanentFailure` variant entirely, making
all failures instead be "the update is in progress, but won't ever
complete", which is equivalent if we do not close the channel
automatically.
2023-09-21 19:04:05 +00:00
Elias Rohrer
9abe4bb23d
Have path_to_windows_str take reference to avoid clones 2023-09-08 09:40:45 +02:00
Elias Rohrer
7576c89adb
Add benchmarking for FilesystemStore
We re-add benchmarking for `FilesystemStore` now that we switched over
to it.
2023-09-07 22:49:22 +02:00
Elias Rohrer
413f9a7de6
Migrate FilesystemPersister tests to FilesystemStore 2023-09-07 22:49:22 +02:00
Elias Rohrer
cc1b505b30
Migrate to KVStore/FilesystemStore
Firstly, we switch our BP over to use `FilesystemStore`, which also gives us test
coverage and ensures the compatibility.

Then, we remove the superseded `KVStorePersister` trait and
the `FilesystemPersister` code.
2023-09-07 22:49:22 +02:00
Elias Rohrer
f22d1b6390
Add FilesystemStore
We upstream the `FilesystemStore` implementation, which is backwards
compatible with `lightning-persister::FilesystemPersister`.
2023-09-07 22:49:21 +02:00
Elias Rohrer
c18f43fb07
Add test_utils
We add a utility function needed by upcoming `KVStore` implementation
tests.
2023-09-07 22:49:21 +02:00
Elias Rohrer
931ea2667a
Update lightning-persister crate 2023-09-07 22:49:21 +02:00
Vladimir Fomene
7cfafc98ba
Add test coverage ChannelClosed event fields 2023-08-08 14:07:16 +03:00
Matt Corallo
983f2c1870 Bump crate versions to 0.0.116 release 2023-07-21 20:42:13 +00:00
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
Matt Corallo
bada71394e
Merge pull request #2235 from TheBlueMatt/2023-04-criterion
Replace std's unmaintained bench with criterion
2023-05-20 23:02:44 +00:00
Matt Corallo
1701b02124 Replace std's unmaintained bench with criterion
Rather than using the std benchmark framework (which isn't
maintained and is unlikely to get any further maintenance), we swap
for criterion, which at least gets us a variable number of test
runs so our benchmarks don't take forever.

We also fix the RGS benchmark to pass now that the file in use is
stale compared to today's date.
2023-05-11 06:11:49 +00:00
Wilmer Paulino
17a74fcfc7
Use helper to create dummy blocks
`rust-bitcoin v0.30.0` introduces concrete variants for data members of
block `Header`s. To avoid having to update these across every use, we
introduce new helpers to create dummy blocks and headers, such that the
update process is a bit more straight-forward.
2023-05-10 11:39:49 -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
a9534fe6b5
Merge pull request #2059 from wpaulino/broadcast-missing-anchors-event
Queue BackgroundEvent to force close channels upon ChannelManager::read
2023-03-29 21:54:58 +00:00
Wilmer Paulino
ca9ca75f08
Move events.rs into its own top-level module
This is largely motivated by some follow-up work for anchors that will
introduce an event handler for `BumpTransaction` events, which we can
now include in this new top-level `events` module.
2023-03-22 11:49:33 -07:00
Wilmer Paulino
5a90f014f2
Use CLOSED_CHANNEL_UPDATE_ID in force closing ChannelMonitorUpdates
Currently, all that is required to force close a channel is to broadcast
either of the available commitment transactions, but this changes with
anchor outputs – commitment transactions may need to have
additional fees attached in order to confirm in a timely manner. While
we may be able to just queue a new update using the channel's next
available update ID, this may result in a violation of the
`ChannelMonitor` API (each update ID must strictly increase by 1) if the
channel had updates that were persisted by its `ChannelMonitor`, but not
the `ChannelManager`. Therefore, we choose to re-purpose the existing
`CLOSED_CHANNEL_UPDATE_ID` update ID to also apply to
`ChannelMonitorUpdate`s that will force close their respective channel
by broadcasting the holder's latest commitment transaction.
2023-03-21 16:25:45 -07:00