Skip to content

fuzz: model chanmon mempool mining#4657

Draft
joostjager wants to merge 1 commit into
lightningdevkit:mainfrom
joostjager:chanmon-mempool-mining
Draft

fuzz: model chanmon mempool mining#4657
joostjager wants to merge 1 commit into
lightningdevkit:mainfrom
joostjager:chanmon-mempool-mining

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

This prepares chanmon_consistency for force-close fuzzing by making its chain model closer to the environment LDK sees in normal operation.

Force-close scenarios depend heavily on transaction timing: claims may be broadcast, replaced, confirmed, followed by additional claims, and later become spendable only after more blocks. The previous harness mostly folded transaction confirmation into sync-style actions, which made it harder to express those flows accurately and made future force-close coverage depend on shortcuts in the test harness.

The updated model gives the harness an explicit mempool and block-mining path. Broadcast transactions can be relayed into the modeled mempool, mined into harness blocks, and then replayed to both monitors and managers through chain callbacks. The harness also tracks confirmed UTXOs and wallet change so later splice, anchor, and claim transactions have a realistic view of what can be spent.

This should make upcoming force-close fuzzing changes easier to review: first establish a more faithful chain environment, then add the force-close-specific scenarios and invariants on top of it.

Add a modeled mempool and wallet-backed transaction relay to the
chanmon consistency target. Broadcast transactions are admitted through
explicit relay steps, mined by block commands, and then replayed to the
monitor and manager through the harness chain state.

Track confirmed UTXOs so mempool admission can reject duplicate or
unknown inputs, model direct RBF conflicts, and keep wallet UTXOs in
sync with confirmed change outputs.
@ldk-reviews-bot
Copy link
Copy Markdown

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

@joostjager
Copy link
Copy Markdown
Contributor Author

@wpaulino FYI, this may intersect with the existing splice fuzzing failures you’re looking at.

This PR makes splice transaction mining in chanmon_consistency more realistic: negotiated splice transactions no longer get implicitly confirmed through the old sync-style path. Instead, broadcasts have to pass through the harness’s modeled mempool and are confirmed only when the fuzz input mines blocks.

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.

2 participants