Skip to content

Implement scenario-based fuzzing with state prefixes - #4513

Draft
dnkolegov-ar wants to merge 13 commits into
fuzzingfrom
denis/scenario-based-fuzzing
Draft

Implement scenario-based fuzzing with state prefixes#4513
dnkolegov-ar wants to merge 13 commits into
fuzzingfrom
denis/scenario-based-fuzzing

Conversation

@dnkolegov-ar

Copy link
Copy Markdown
Collaborator

The marshal standard tests in consensus/src/marshal/standard/mod.rs encode hand-crafted event sequences (propose, notarize, finalize, report, restart) that drive marshal into interesting semantic states (missing candidate, pending
backfill, open subscription, divergent same-height certificates, pending floor anchor). They can't be reused for fuzzing: they run on StandardHarness with real BLS crypto, whereas fuzzing needs the fast SimplexCertificateMock, and
consensus/src/* must not be modified.

This module reproduces chosen prefixes of those tests as deterministic scripts, stops at an interesting semantic point, then hands the cluster to a fuzzing phase (N4F1C3 adversarial or N4F0C4 honest) and checks safety, liveness, and per-scenario oracles.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 16, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
commonware-mcp d017c60 Aug 19 2026, 04:56 PM

@dnkolegov-ar
dnkolegov-ar marked this pull request as draft August 16, 2026 05:41
@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown

Benchmark results

Regressions: 0.

✅ `qmdb::merkleize/v=any::unordered::fixed::mmr k=10000 ch=false s=true cc=true` (2/2 gates passed)
Field Value
Package commonware-storage
Benchmark target qmdb_gungraun
Variant qmdb::merkleize/v=any::unordered::fixed::mmr k=10000 ch=false s=true cc=true
Filter *::bench_merkleize::any_unordered_fixed_mmr
Baseline suite commonware-storage
Gates EstimatedCycles should decrease; tolerance 10.00%; blob_reads should decrease; tolerance 10.00%
Cargo flags --features test-traits
Metric Baseline Current Delta Gate
Ir 13,146,560 13,185,617 +0.30% -
L1hits 16,829,245 16,859,535 +0.18% -
LLhits 90,653 93,577 +3.23% -
RamHits 10,889 10,919 +0.28% -
TotalRW 16,930,787 16,964,031 +0.20% -
EstimatedCycles 17,663,625 17,709,585 +0.26% EstimatedCycles should decrease; tolerance 10.00%
blob_reads 158 158 +0.00% blob_reads should decrease; tolerance 10.00%
✅ `qmdb::merkleize/v=current::ordered::fixed::mmb chunk=256 k=10000 ch=false s=true cc=true` (2/2 gates passed)
Field Value
Package commonware-storage
Benchmark target qmdb_gungraun
Variant qmdb::merkleize/v=current::ordered::fixed::mmb chunk=256 k=10000 ch=false s=true cc=true
Filter *::bench_merkleize::current_ordered_fixed_mmb_chunk_256
Baseline suite commonware-storage
Gates EstimatedCycles should decrease; tolerance 10.00%; blob_reads should decrease; tolerance 10.00%
Cargo flags --features test-traits
Metric Baseline Current Delta Gate
Ir 15,460,423 15,500,932 +0.26% -
L1hits 20,275,049 20,370,794 +0.47% -
LLhits 139,655 139,845 +0.14% -
RamHits 14,618 13,576 -7.13% -
TotalRW 20,429,322 20,524,215 +0.46% -
EstimatedCycles 21,484,954 21,545,179 +0.28% EstimatedCycles should decrease; tolerance 10.00%
blob_reads 235 235 +0.00% blob_reads should decrease; tolerance 10.00%

Baseline commit(s): 6e39079bd101

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7caf292. Configure here.

//! - **Simplex layer (3/4/5)** — [`start_simplex_disrupter`]: the real
//! [`Disrupter`] with `LiveScope` semantic mutation (mutate the proposal, then
//! re-sign), scheduled on the live window above the attack view.
//! - **Dissemination layer (2 + 1)** — [`start_dissemination_disrupter`]: as the

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Non-ASCII in new comments

Low Severity

New module docs and comments use non-ASCII punctuation (, ). Project style requires ASCII equivalents in // and /// comments (for example - or ->).

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by learned rule: Avoid non-ASCII characters in code comments

Reviewed by Cursor Bugbot for commit 7caf292. Configure here.

Comment thread consensus/fuzz/src/scenarios/runner.rs Outdated
height_0.get(),
height_1.get(),
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Floor order oracle gap

Medium Severity

check_floor_started_order allows a contiguous genesis-rooted chain through heights below the floor. For a floor-started node, that means deliveries in (0, floor_height) pass even though set_floor is supposed to prune below the floor, so the PendingFloorAnchor safety oracle can miss a real prune/dispatch bug.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7caf292. Configure here.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 17, 2026

Copy link
Copy Markdown

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

Latest commit: d017c60
Status: ✅  Deploy successful!
Preview URL: https://a43bc4e4.monorepo-eu0.pages.dev
Branch Preview URL: https://denis-scenario-based-fuzzing.monorepo-eu0.pages.dev

View logs

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (fuzzing@627099d). Learn more about missing BASE report.

@@            Coverage Diff             @@
##             fuzzing    #4513   +/-   ##
==========================================
  Coverage           ?   95.46%           
==========================================
  Files              ?      606           
  Lines              ?   273298           
  Branches           ?     6576           
==========================================
  Hits               ?   260915           
  Misses             ?    10201           
  Partials           ?     2182           

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 627099d...d017c60. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant