Skip to content

smite-ir: generate valid channel parameters in open_channel flows - #228

Merged
morehouse merged 2 commits into
lnfuzz:masterfrom
NishantBansal2003:bound-chan-params
Sep 11, 2026
Merged

smite-ir: generate valid channel parameters in open_channel flows#228
morehouse merged 2 commits into
lnfuzz:masterfrom
NishantBansal2003:bound-chan-params

Conversation

@NishantBansal2003

Copy link
Copy Markdown
Contributor

Closes: #224

@erickcestari erickcestari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we be very strict and only create valid funding/open_channel flows? Or still allow generators to create invalid cases?

cc @morehouse

@morehouse morehouse left a comment

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.

This is a big improvement. I did an experiment with 2k seeds generated from the OpenChannelGenerator. Here's the per-impl accept rates:

Revision LDK LND CLN Eclair
Before this PR (de64777) 0.00% 0.00% 0.00% 0.00%
Current PR (eb75402) 0.10% 0.00% 6.40% 0.25%

I expect this alone will have a measurable improvement in AUC on a 24h+ experiment, and we should do that experiment to make sure.

We may want to make some further improvements first though. Ignoring channel type and shutdown script (which still cause most rejections even with our explicit enumeration of variants), the remaining top rejection reasons for the channel parameters on the 2k experiment were:

97.98%  LDK dust_limit not in [354, 546]
95.12%  Eclair reserve > 5% of funding
92.62%  LND dust_limit not in [354, 1062]
80.27%  LND channel_reserve > funding/5
80.12%  LND max_in_flight < 5*htlc_minimum
51.80%  Eclair dust_limit not in [354, 5000]
26.29%  CLN htlc_minimum > capacity
25.03%  LDK htlc_minimum >= (funding - reserve) * 1000
24.94%  Eclair to_local and to_remote < reserve
24.94%  LDK push_msat > (funding - reserve) * 1000
23.70%  LDK SCID alias on announced channel
 4.40%  LND max_accepted_htlcs not in [5, 483]

Comment thread smite-ir/src/generators/open_channel.rs Outdated
Comment thread smite-ir/src/generators/open_channel.rs Outdated
Comment thread smite-ir/src/generators/open_channel.rs Outdated
Comment thread smite-ir/src/tests.rs Outdated
Comment thread smite-ir/src/tests.rs Outdated
Comment thread smite-ir/src/tests.rs Outdated
Comment thread smite-ir/src/tests.rs Outdated
Comment thread smite-ir/src/tests.rs Outdated
Comment thread smite-ir/src/generators/open_channel.rs Outdated
@morehouse

Copy link
Copy Markdown
Collaborator

Should we be very strict and only create valid funding/open_channel flows? Or still allow generators to create invalid cases?

I don't think we can get valid flows 100% of the time without overcomplicating the generator. But it would be good to get single-digit percentages of flows validating successfully, which I think should be possible by addressing some of the remaining blockers flagged above.

@NishantBansal2003

Copy link
Copy Markdown
Contributor Author

I expect this alone will have a measurable improvement in AUC on a 24h+ experiment, and we should do that experiment to make sure.

Updated the bounds. I'm currently running the experiment and will share the results shortly

@morehouse morehouse left a comment

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.

Code LGTM.

Updated 2k experiment results:

Revision LDK LND CLN Eclair
Before this PR (de64777) 0.00% 0.00% 0.00% 0.00%
Previous PR (eb75402) 0.10% 0.00% 6.40% 0.25%
Current PR (199dd8d) 8.10% 4.40% 9.95% 8.30%

@NishantBansal2003

Copy link
Copy Markdown
Contributor Author

Fuzzing Evaluation Report

Configuration A (Baseline): baseline (Commit: 8474544 (2026-09-04))
Configuration B (Experimental): experimental (Commit: 199dd8d (2026-09-05))

1. Summary Statistics

Target Duration (h) n (Baseline) n (Exp.) Median Cov. (Baseline) Median Cov. (Exp.) Adj. p-value (Cov.) Â12 (Cov.) Median AUC (Baseline) Median AUC (Exp.) Adj. p-value (AUC) Â12 (AUC) Union Cov. (Baseline) Union Cov. (Exp.) Execs/s (Baseline) Execs/s (Exp.)
ldk 24 5 5 17166 37581 0.015873 0.96 401693 850156 0.015873 1 36760 38118 15.06 13.05
lnd 24 5 5 26946 30011 0.015873 1 642933 717990 0.015873 1 27186 30281 3.67 3.36

A comprehensive version of this table including raw P-values and Interquartile Ranges (IQRs) is available in evaluation_metrics.csv.

2. Interpretation Guide

Use the generated matrix above to objectively evaluate the experimental configuration. For full methodology, see the Smite Fuzzing Evaluation Framework.

Key Metrics

  • Adj. p-value: Mann-Whitney U test corrected for multiple targets via Holm-Bonferroni. Controls false-positive rate to ≤ 5% across all targets.
  • Â12: Probability that a random B trial outperforms a random A trial. 0.5 = no difference; 0.7 = B wins 70% of pairings. Always read alongside the p-value.
  • IQR: Spread of the middle 50% of trials. A much larger IQR in B suggests a few outlier runs may be inflating the median.
  • AUC: Coverage speed — how much was discovered and how early. Useful when final coverage is similar between configurations.
  • Union Coverage: Union of all trial bitmaps; the coverage ceiling for a multi-core deployment. Descriptive only, cannot be statistically tested.
  • Execs/s: A large drop in B without a coverage gain means the new feature is too expensive.

Reading the Results

Adj. p Â12 Conclusion
< 0.05 > 0.5 Meaningful improvement. Check IQRs are comparable, then merge.
< 0.05 ~0.5 Significant but negligible. Check if worth the added complexity.
> 0.05 > 0.6 Promising but underpowered. Re-run with more trials (e.g., 50).
> 0.05 ~0.5 No effect. Try an advanced snapshot or ground-truth evaluation.
any < 0.5 B underperforms A. If significant, reject or redesign the feature.

Time-series caveat: If the IQR bands overlap for most of the campaign and only diverge near the end, treat the final-coverage result cautiously — late divergence may reflect noise rather than a sustained advantage.

3. Visualizations

Note: In the box plots below, the central box represents the Interquartile Range (IQR, the middle 50% of trials), demonstrating the consistency of the fuzzer's performance. The internal line represents the median.

Target: ldk

Median Coverage Over Time

ldk_time_series

Distribution Comparisons

Final Edge Coverage Area Under Curve (Speed)
ldk_boxplot ldk_auc_boxplot

Target: lnd

Median Coverage Over Time

lnd_time_series

Distribution Comparisons

Final Edge Coverage Area Under Curve (Speed)
lnd_boxplot lnd_auc_boxplot

@erickcestari erickcestari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

edit: Needs rebase.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>

@morehouse morehouse left a comment

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.

Wow, I just fell off my chair. Double the coverage looks good to me.

@morehouse
morehouse merged commit 5e66f3b into lnfuzz:master Sep 11, 2026
5 checks passed
@NishantBansal2003

Copy link
Copy Markdown
Contributor Author

CLN and Eclair are also on the way, I'll share their results as well in some time

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.

Bound channel parameters in generators

3 participants