Skip to content

[consensus/marshal] Abstract over consensus engine#3253

Draft
clabby wants to merge 7 commits intocl/minimmitfrom
cl/marshal-minimmit
Draft

[consensus/marshal] Abstract over consensus engine#3253
clabby wants to merge 7 commits intocl/minimmitfrom
cl/marshal-minimmit

Conversation

@clabby
Copy link
Collaborator

@clabby clabby commented Feb 26, 2026

Overview

Note

Do not merge. Stacked on top of #2884

Abstracts marshal over consensus engine variants.

@clabby clabby self-assigned this Feb 26, 2026
@clabby clabby added this to Tracker Feb 26, 2026
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 26, 2026

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 beedef7 Mar 06 2026, 07:35 PM

@clabby clabby moved this to In Progress in Tracker Feb 26, 2026
@clabby clabby force-pushed the cl/marshal-minimmit branch from 83566aa to a338863 Compare February 26, 2026 16:09
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 26, 2026

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

Latest commit: beedef7
Status: ✅  Deploy successful!
Preview URL: https://3e35ac7d.monorepo-eu0.pages.dev
Branch Preview URL: https://cl-marshal-minimmit.monorepo-eu0.pages.dev

View logs

@clabby clabby force-pushed the cl/marshal-minimmit branch from a338863 to a7fe073 Compare February 28, 2026 18:21
@clabby clabby force-pushed the cl/minimmit branch 2 times, most recently from e7e4a5d to 19d42bb Compare March 2, 2026 15:40
@clabby clabby force-pushed the cl/marshal-minimmit branch from a7fe073 to 3d69781 Compare March 2, 2026 15:40
@clabby clabby force-pushed the cl/marshal-minimmit branch 3 times, most recently from 98e2327 to ee361c6 Compare March 2, 2026 19:32
@clabby clabby force-pushed the cl/marshal-minimmit branch from ee361c6 to e3a104d Compare March 2, 2026 19:32
@clabby clabby force-pushed the cl/marshal-minimmit branch from e3a104d to a8ebe9d Compare March 2, 2026 19:47
@clabby clabby force-pushed the cl/marshal-minimmit branch from a8ebe9d to f183337 Compare March 2, 2026 19:48
@clabby clabby force-pushed the cl/marshal-minimmit branch 2 times, most recently from fbb0dc2 to 88eaa68 Compare March 2, 2026 20:45
@clabby clabby force-pushed the cl/marshal-minimmit branch 2 times, most recently from 9f92d1a to b16d80e Compare March 2, 2026 22:23
@clabby clabby force-pushed the cl/marshal-minimmit branch from b16d80e to f03d1d2 Compare March 2, 2026 22:24
@clabby clabby force-pushed the cl/marshal-minimmit branch 2 times, most recently from e326c6b to 96f0d48 Compare March 3, 2026 01:40
@clabby clabby force-pushed the cl/marshal-minimmit branch 2 times, most recently from 30c6dd8 to 96550d9 Compare March 3, 2026 17:02
@clabby clabby force-pushed the cl/marshal-minimmit branch from 96550d9 to 556fb37 Compare March 3, 2026 17:16
@clabby clabby force-pushed the cl/marshal-minimmit branch 4 times, most recently from 4322390 to a091929 Compare March 3, 2026 23:42
@clabby clabby added the breaking-format This PR modifies codec and/or storage formats. label Mar 4, 2026
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 96.34146% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.78%. Comparing base (91b8d61) to head (a091929).

Files with missing lines Patch % Lines
consensus/src/marshal/core/consensus.rs 91.66% 8 Missing ⚠️
consensus/src/marshal/resolver/handler.rs 91.11% 4 Missing ⚠️
consensus/src/marshal/standard/inline.rs 20.00% 4 Missing ⚠️
consensus/src/marshal/standard/variant.rs 40.00% 3 Missing ⚠️
consensus/src/marshal/core/actor.rs 99.04% 1 Missing ⚠️
storage/src/archive/prunable/storage.rs 97.29% 1 Missing ⚠️
@@               Coverage Diff               @@
##           cl/minimmit    #3253      +/-   ##
===============================================
- Coverage        93.87%   93.78%   -0.09%     
===============================================
  Files              440      440              
  Lines           149871   147847    -2024     
===============================================
- Hits            140694   138663    -2031     
- Misses            9177     9184       +7     
Files with missing lines Coverage Δ
consensus/src/lib.rs 21.42% <100.00%> (+21.42%) ⬆️
consensus/src/marshal/coding/marshaled.rs 64.18% <100.00%> (ø)
consensus/src/marshal/coding/mod.rs 98.30% <100.00%> (ø)
consensus/src/marshal/coding/variant.rs 100.00% <ø> (ø)
consensus/src/marshal/core/cache.rs 97.34% <100.00%> (+1.59%) ⬆️
consensus/src/marshal/core/mailbox.rs 100.00% <100.00%> (ø)
consensus/src/marshal/core/variant.rs 100.00% <ø> (ø)
consensus/src/marshal/mod.rs 54.54% <ø> (ø)
consensus/src/marshal/standard/deferred.rs 91.45% <100.00%> (+0.09%) ⬆️
consensus/src/marshal/standard/mod.rs 99.70% <100.00%> (-0.01%) ⬇️
... and 12 more

... and 30 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91b8d61...a091929. 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.

["commonware_consensus::marshal::resolver::handler::tests::conformance::CodecConformance<Request<D>>"]
n_cases = 65536
hash = "481cd68f2e6452c0dda512c75d74ddd2e19ac6c9fb19c642c1a152a0d830c1b2"
hash = "a87609f8692a7d2208a327d37bdabc7329567b15a5745f3947760a7fd383cbe2"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was a bit torn about this, but after thinking about it a bit more, I believe this is safe to roll out incrementally. The resolver does not block peers on decode failure, and notarized block backfill is a secondary path in marshal. Finalized block backfill is unchanged.

While a network is rolling out their upgrades to this version, Notarized requests between mixed versions will fail and retry. The fetcher will eventually select a same version peer that can complete their request or cancel the request once a finalized block is processed at a higher view.

We could add in some more complex machinery that allows for nodes to understand the old Notarized(Round) request as well as the new Notarized(Round, Commitment) request temporarily, but it isn't necessary given that the penalty is slightly degraded notarized request availability for a temporary period of time.

Copy link
Contributor

Choose a reason for hiding this comment

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

The resolver does not block peers on decode failure

It does to my knowledge?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In main, it skips:

// Skip if there is a decoding error
let msg = match msg {
Ok(msg) => msg,
Err(err) => {
trace!(?err, ?peer, "decode failed");
continue;
}
};

(Note that we did not change the response payload, which would trigger a block. We just changed the key for the Notarized test type.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-format This PR modifies codec and/or storage formats.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants