Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge anchor support from tnull #11

Merged
merged 57 commits into from
Mar 16, 2024
Merged

Conversation

rdmitr
Copy link
Collaborator

@rdmitr rdmitr commented Mar 14, 2024

No description provided.

tnull and others added 30 commits March 1, 2024 10:47
Our `stop_sender`/`stop_receiver` watch channel is used to signal to
background tasks that they need to stop as we're about to shut down.

Previously, we stored both sides in our `Node` object. However, when
restarting the node, this would lead to us cloning a stale
`stop_receiver`, i.e., one that still had the change signal set, messing
with our shutdown logic on restarts.

Here, we instead drop the stored receiver and just create all
receivers by `subscribe`ing to the sender where necessary, which fixes
the prior bug.
While we previously took care of persisting peer details when a channel
is opened and if the user signals to `connect` to have the connection
persisted, our background task would still only try to reconnect to
channel peers. Here, we fix this omission and add a regression test
ensuring we'll see the proper behavior going forward.
…connection

Reconnect all persisted peers on restart
.. unfortunately the `windows-sys` dependency recently seems to have
broken their doc builds on rustc 1.63.0. As tests and builds still work
without issue, we fix CI by just not building docs on
`windows-latest`/`1.63.0`
…-doc-build

Fix CI by not building docs Windows on 1.63.0
The fee as returned from `PaymentSent` event generated by LDK and is
  saved in `PaymentSuccessful` event.
.. which will tell Rust not to treat it as an integration test module.
.. we replace the simple `is_running` with a more verbose `status`
method returning a `NodeStatus` struct, giving more information on
syncing states etc.
…atus

Introduce `status` method allowing to query the `Node`'s status
…-for-msrv

Pin `reqwest` to fix MSRV builds in CI
.. switching to `dyn KVStore + Send + Sync`
... now that we don't have any generic to hide, we can just use the
`Node` type directly.
.. just a minor cleanup to further modularize the codebase. Also, we'll
be reusing these methods in `Event::ConnectionNeeded` soon.
tnull and others added 27 commits March 12, 2024 11:03
.. we should consider dropping `Deref` and instead just commiting to
store a `Arc<L>` everwhere, as it gets tedious to maintain.

However, this is barely scraping by and the least invasive change here.
.. which is a bit more readable and in-line what we do other places,
plus it allows us to drop the `futures` dependency.
... we check that we can successfully issue concurrent connection
attempts, which all succeed.
Previously, concurrent calls to
`do_connect_peer`/`connect_peer_if_necessary` could result in multiple
connections being opened, just to be closed as redundant shortly after.
Parallel connection attempt were therefore prone to fail.

Here, we introduce a `ConnectionManager` that implements a pub/sub
pattern: upon the initial call, the task responsible for polling the
connection future to completion registers that a connection is
in-flight. Any calls following will check this and register a `oneshot`
channel to be notified of the `Result`.
.. which declutters our top-level docs a bit.
.. as we changed quite a bit and moved required fields, we add a test
here that adds the old `PaymentDetails` as a test struct and ensures
we're able to parse them just fine
.. allowing to configure the per-channel emergency reserve as well as
some trusted peers for which we won't maintain any reserve.
When Anchor outputs need to be spent LDK will generate
`BumpTransactionEvent`s. Here, we add the corresponding event-handling
and PSBT-signing support.
.. because they will be the new default.

Note the upcoming CLN 24.02 release will make Anchors default, too, but
for now we have to set the `experimental-anchors` config option.
.. which we somehow so far ommitted exposing in the API.

We now introduce a `force` flag to `close_channel` and broadcast if the
counterparty is not trusted.
…merge-anchor-support-from-upstream

# Conflicts:
#	.github/workflows/rust.yml
#	bindings/ldk_node.udl
#	src/event.rs
#	src/lib.rs
#	src/payment_store.rs
#	tests/common/mod.rs
@rolznz rolznz merged commit d614f26 into main Mar 16, 2024
10 checks passed
@rdmitr rdmitr deleted the merge-anchor-support-from-upstream branch April 3, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants