fuzz: remove macros from chanmon_consistency#4571
Draft
joostjager wants to merge 3 commits intolightningdevkit:mainfrom
Draft
fuzz: remove macros from chanmon_consistency#4571joostjager wants to merge 3 commits intolightningdevkit:mainfrom
joostjager wants to merge 3 commits intolightningdevkit:mainfrom
Conversation
Move shared fuzz logic into the root fuzz crate and generate fake-hashes and real-hashes runner crates. Keep `chanmon_consistency_target` on the real-hashes side, remove the fuzz-local Cargo config, and update scripts, CI, coverage, and docs to use explicit flags for each runner. Generate the hash-mode compile checks in the wrapper bins without a synthetic Cargo feature, while keeping the wrapper template close to its original shape. AI tools were used in preparing this commit.
Store real payment preimages in `chanmon_consistency` and use them when claiming funds, so the real-hashes runner does not treat `payment_hash` bytes as a stand-in preimage. AI tools were used in preparing this commit.
Move chanmon_consistency.rs state and orchestration into Harness, HarnessNode, EventQueues, PaymentTracker, and PeerLink. This pushes reload, sync, monitor completion, splice, queue handling, restart, and settle-all behavior onto owned methods instead of local macros, closures, and parameter-heavy helper plumbing. Keep do_test focused on opcode dispatch while preserving the existing harness behavior.
|
👋 Hi! I see this is a draft PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes the macro-heavy structure from
chanmon_consistency.rsand rewrites it as explicit Rust code.The main reason is compile time. The macros in this harness slow builds down enough that it becomes very noticeable during iteration. In follow-up force-close fuzzing work, the
chanmon_consistencybuild time increased to around 5 minutes on my machine. That is too expensive for a fuzz target that needs frequent rebuilds.The macros also make the file harder to read and reason about. Replacing them with normal types and methods should make the harness easier to maintain while also reducing the macro expansion cost.
Builds on #4565