Skip to content

Conversation

BrendanChou
Copy link
Collaborator

@BrendanChou BrendanChou commented May 21, 2025

Fixes #814

TODO

  • Add rebroadcasting
  • Add journaling
  • Data-structure cleanup after epoch changes
  • Peer Tip management
    • fast-forwarding
    • Tip might be invalid if nothing in pending (?)
  • Consider how to avoid running into the rate-limiter
  • Tests
  • Rustdoc

Future Work

@BrendanChou BrendanChou force-pushed the bc/814-aggregation branch 3 times, most recently from bcc3600 to 4321ffb Compare May 28, 2025 23:18
@BrendanChou BrendanChou force-pushed the bc/814-aggregation branch 3 times, most recently from 3e34e05 to 0bbdbea Compare June 10, 2025 20:31
@BrendanChou BrendanChou force-pushed the bc/814-aggregation branch 7 times, most recently from 83bc6d4 to 01039b6 Compare June 18, 2025 15:04
@patrick-ogrady
Copy link
Contributor

patrick-ogrady commented Jun 18, 2025

I think this one will realllllly benefit from #1002 ❤️

(sorry I thought this would go out as a review comment lol)

@@ -0,0 +1,1093 @@
//! Threshold signature aggregation for agreeing on externally-finalized hashes.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Recover threshold signatures over an externally synchronized stream of digests.

I suppose the "aggregation" here is really what we'd call recovery (and it would be aggregation in a multi-signature case). 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

...now second guessing the name aggregation lol

Copy link
Contributor

Choose a reason for hiding this comment

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

In other consensus crates, we combine types and wire. Curious if you feel it is better to separate (I've taken the position that anything in types may be serialized somewhere and sent over the wire so delineation doesn't add anything).

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 think it's better to keep them separate. Just easier to see the direct types that you are expected to send over the wire or not

@BrendanChou BrendanChou force-pushed the bc/814-aggregation branch 4 times, most recently from 77f9b4c to 29ba1c5 Compare July 1, 2025 14:56
@BrendanChou BrendanChou force-pushed the bc/814-aggregation branch from ecfa97e to a14e04d Compare July 2, 2025 21:44
@BrendanChou BrendanChou marked this pull request as ready for review July 2, 2025 23:43
Copy link
Contributor

@patrick-ogrady patrick-ogrady left a comment

Choose a reason for hiding this comment

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

Very close! Will take it from here and merge 🫡

// Refresh the epoch
debug!(current=self.epoch, new=epoch, "refresh epoch");
assert!(epoch >= self.epoch);
self.epoch = epoch;
Copy link
Contributor

Choose a reason for hiding this comment

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

Unlike ordered-broadcast, I suspect epoch will be rigidly associated with a range of indices.

We "should" be ok gathering signatures from the current epoch on any historical data (and need to for liveness) but just calling out as a point of discussion.

@patrick-ogrady patrick-ogrady merged commit b9858d2 into main Jul 13, 2025
30 checks passed
@patrick-ogrady patrick-ogrady deleted the bc/814-aggregation branch July 13, 2025 22:59
Copy link

codecov bot commented Jul 13, 2025

Codecov Report

Attention: Patch coverage is 91.55779% with 168 lines in your changes missing coverage. Please review.

Project coverage is 91.04%. Comparing base (ba2a872) to head (75ca86c).
Report is 38 commits behind head on main.

Files with missing lines Patch % Lines
consensus/src/aggregation/engine.rs 84.27% 64 Missing ⚠️
consensus/src/aggregation/mocks/application.rs 31.66% 41 Missing ⚠️
consensus/src/aggregation/mod.rs 96.62% 25 Missing ⚠️
consensus/src/aggregation/mocks/reporter.rs 81.66% 22 Missing ⚠️
consensus/src/aggregation/mocks/monitor.rs 68.96% 9 Missing ⚠️
consensus/src/aggregation/mocks/supervisor.rs 85.41% 7 Missing ⚠️
@@            Coverage Diff             @@
##             main     #974      +/-   ##
==========================================
- Coverage   91.39%   91.04%   -0.36%     
==========================================
  Files         218      245      +27     
  Lines       59455    59775     +320     
==========================================
+ Hits        54338    54420      +82     
- Misses       5117     5355     +238     
Files with missing lines Coverage Δ
consensus/src/aggregation/metrics.rs 100.00% <100.00%> (ø)
consensus/src/aggregation/safe_tip.rs 100.00% <100.00%> (ø)
consensus/src/aggregation/types.rs 100.00% <100.00%> (ø)
consensus/src/ordered_broadcast/engine.rs 88.06% <100.00%> (-1.60%) ⬇️
utils/src/lib.rs 100.00% <100.00%> (ø)
consensus/src/aggregation/mocks/supervisor.rs 85.41% <85.41%> (ø)
consensus/src/aggregation/mocks/monitor.rs 68.96% <68.96%> (ø)
consensus/src/aggregation/mocks/reporter.rs 81.66% <81.66%> (ø)
consensus/src/aggregation/mod.rs 96.62% <96.62%> (ø)
consensus/src/aggregation/mocks/application.rs 31.66% <31.66%> (ø)
... and 1 more

... and 188 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 ba2a872...75ca86c. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[consensus] Create consensus::aggregation dialect

3 participants