Skip to content

Follow-ups to #330#366

Merged
tnull merged 8 commits into
lightningdevkit:mainfrom
tnull:2024-10-330-followups
Oct 8, 2024
Merged

Follow-ups to #330#366
tnull merged 8 commits into
lightningdevkit:mainfrom
tnull:2024-10-330-followups

Conversation

@tnull
Copy link
Copy Markdown
Collaborator

@tnull tnull commented Oct 7, 2024

This addresses minor comments and nits found in #330.

Since we're about to make considerable changes all over the codebase with #358 and follow-ups, we opted to land #330 and address the minor feedback here, avoiding an ongoing rebase saga.

(cc @enigbe)

@tnull tnull mentioned this pull request Oct 7, 2024
tnull added 6 commits October 7, 2024 15:00
…ases and addresses"

This reverts commit 4fd1cb8 as unit
tests need to be kept deterministic, i.e., opening announced channels is
a deliberate choice on a per test case basis.
We improve the docs a bit, highlight the requirements for node aliases,
and that we'll only ever allow announcing channels if they are properly
set.
We drop the previously-introduced
`ChannelAnnouncementStatus`/`ChannelAnnouncementBlocker` types. While
informative, they were a bit too much boilerplate. Instead we opt to
simply return a `bool` from `may_announce_channel`, and don't spawn the
node announcment task to begin with if we're not configured properly.
@tnull tnull force-pushed the 2024-10-330-followups branch from 828f77f to fd70203 Compare October 7, 2024 13:06
@tnull tnull requested a review from G8XSU October 7, 2024 13:07
@tnull tnull mentioned this pull request Oct 7, 2024
Comment thread src/lib.rs
Comment thread tests/common/mod.rs Outdated
tnull added 2 commits October 8, 2024 09:13
Previously, we always opened announced channels in tests, but it should
be a deliberate choice depending on the scenario we're trying to test
for.
.. as we generally want to ~discourage users from arbitrarily opening
announced channels. They really only should do so if they are willing
and able to run a proper 24/7 forwarding node. And node operators will
likely know what to look for in the API.
@tnull tnull force-pushed the 2024-10-330-followups branch from fd70203 to 85862f5 Compare October 8, 2024 07:13
@tnull
Copy link
Copy Markdown
Collaborator Author

tnull commented Oct 8, 2024

Now force-pushed with minor fixups:

> git diff-tree -U2 fd702031 85862f53
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index 05af5d67..f8a9eae7 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -400,8 +400,8 @@ pub(crate) fn premine_and_distribute_funds<E: ElectrumApi>(

 pub fn open_channel(
-       node_a: &TestNode, node_b: &TestNode, funding_amount_sat: u64, announce: bool,
+       node_a: &TestNode, node_b: &TestNode, funding_amount_sat: u64, should_announce: bool,
        electrsd: &ElectrsD,
 ) {
-       if announce {
+       if should_announce {
                node_a
                        .open_announced_channel(
@tnull tnull merged commit 58188b8 into lightningdevkit:main Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants