Skip to content

Follow-ups to #660#992

Open
tankyleo wants to merge 8 commits into
lightningdevkit:mainfrom
tankyleo:2026-07-0fc-followups
Open

Follow-ups to #660#992
tankyleo wants to merge 8 commits into
lightningdevkit:mainfrom
tankyleo:2026-07-0fc-followups

Conversation

@tankyleo

Copy link
Copy Markdown
Contributor

No description provided.

@ldk-reviews-bot

ldk-reviews-bot commented Jul 17, 2026

Copy link
Copy Markdown

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tankyleo
tankyleo requested a review from tnull July 17, 2026 05:18
Comment thread src/tx_broadcaster.rs
use crate::Error;

const BCAST_PACKAGE_QUEUE_SIZE: usize = 50;
const BCAST_PACKAGE_QUEUE_SIZE: usize = 256;

@tankyleo tankyleo Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went back and forth with codex on this one, for now I lean against drawing transactions at random order: we do not do this now, but in the future we might want to make sure we broadcast parents before children no ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but in the future we might want to make sure we broadcast parents before children no ?

Well, in short, I'm not sure we could even begin to guarantee this? Broadcast is inherently fallible, we never know when the network connection could drop, when the backend won't accept anything into the mempool, and when it will just decide to drop any transaction again. So without mempool introspection I'd always lean on treating broadcast as an entirely opaque operation: we submit and retry, and only stop once we see what we expect confirmed in a block.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good added the random draw below

Comment thread src/chain/esplora.rs
}

fn esplora_submitpackage_error_implies_unsupported(e: &esplora_client::Error) -> bool {
matches!(e, esplora_client::Error::HttpResponse { status: 400 | 404, .. })

@tankyleo tankyleo Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We map 400 here to ChainSourceNotSupported because Bitcoin Core v26 returns a RPC error when submitting the dummy package, which maps to error code 400.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grrr, this is all very brittle. I can't wait to drop all of this logic again once we can just assume submitpackage is available if we have any chain source at all.

Comment thread src/lib.rs Outdated
})?;
});
if let Err(e) = startup_chain_check_res {
self.chain_source.stop();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it seems there are a bunch of (pre-existing) potential cases below where we'd error. To solve this once and for all, let's rename start to start_inner and add a new pub fn start that wraps that start_inner (probably also takes the running lock) and stops the chain source for any error returned.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread .github/workflows/0fc-integration.yml Outdated
- name: Test with 0FC enabled
run: |
RUSTFLAGS="--cfg no_download --cfg cycle_tests --cfg tokio_unstable --cfg zero_fee_commitment_tests" cargo test -- --test-threads=1
eclair-interop-test:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, any chance we could make this an interop test for 0fc channels, not a 0fc test that does interop? I.e., can this be (a cfg-gated) part of the regular eclair tests, where we already have the docker setup etc.?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

tankyleo added 7 commits July 17, 2026 17:22
In 2024749, we started taking one slot
in the package queue for each transaction broadcasted by the wallet upon
`WalletEvent::ChainTipChanged`, so we increase the number of slots
available in the queue.
This is particularly relevant for the electrum chain source; if we fail
to fetch feerates, or zero fee commitments validation fails, and we do
not stop the electrum chain source before returning an error, then the
user will hit a debug assertion on the next restart.
Require Electrum and Esplora zero-fee commitments validation to observe
the Bitcoin Core v29+ failure shape for the dummy TRUC package, instead
of accepting any structured submitpackage response.

Set the locktime field of the transaction to zero so that the test works
at any chain-height, which is particularly helpful when starting
ldk-node against test networks.

Map HTTP 400 errors returned to `ChainSourceNotSupported` as this error
code is returned by blockstream-electrs and mempool-electrs when running
against Bitcoin Core v26. We previously would map this error to a
general `ConnectionFailed` error, which is not correct for Bitcoin Core
v26.

Co-Authored-By: HAL 9000
Add a UniFFI wrapper so bindings can inspect channel type flags.

Update anchor accounting tests to use channel type features instead
of inferring zero-fee commitments from the commitment feerate.

Co-Authored-By: HAL 9000
@tankyleo
tankyleo force-pushed the 2026-07-0fc-followups branch from d30080b to edf8512 Compare July 17, 2026 17:24
@tankyleo
tankyleo force-pushed the 2026-07-0fc-followups branch from edf8512 to bda78cc Compare July 17, 2026 17:46
@tankyleo
tankyleo requested a review from tnull July 17, 2026 18:38
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.

3 participants