Skip to content

POC: aggregate post-block sync acknowledgements - #983

Draft
randomblocker wants to merge 2 commits into
stabilisationfrom
poc/sync-aggregation
Draft

POC: aggregate post-block sync acknowledgements#983
randomblocker wants to merge 2 commits into
stabilisationfrom
poc/sync-aggregation

Conversation

@randomblocker

@randomblocker randomblocker commented Aug 18, 2026

Copy link
Copy Markdown

Summary

This is a deliberately non-production POC for reducing the quadratic post-block synchronization burst in the current PoRBFT path.

The stabilisation branch currently lets every block signer publish the block, then lets each non-signing recipient broadcast its sync status to every peer. This branch puts that behavior behind a disabled-by-default flag and tests a smaller path:

  • one deterministic committee publisher sends the confirmed block;
  • recipients return their existing syncData in the block response;
  • the publisher sends one bounded acknowledgement aggregate;
  • periodic fast-sync and peer anti-entropy remain available for missed updates.

It does not change transaction validation, block construction, voting, or finality.

Empirical result

The same isolated six-node topology was measured in legacy and aggregate modes over five complete blocks, excluding startup traffic. The topology used a four-member shard and two non-signing recipients at a 20-second cadence.

Mode Block deliveries Sender status Receiver status Aggregate Total calls/block
Legacy 8 24 12 0 44
Aggregate 2 0 0 5 7

That is an 84.1% reduction, exactly matching the source-derived model. All six nodes remained at the same height across both samples.

A recovery check stopped node 6 while the chain advanced, restarted it, and observed it automatically converge with node 1 at height 10 through the retained recovery path.

The guarded lightweight transport harness then ran five bursts each at 100, 250 and 500 virtual peers with simulated 20–300 ms latency, 5% transient failures and bounded retries:

Peers Legacy calls/block Aggregate calls/block Reduction Mean burst Peak RSS
100 10,384 195 98.1% 504 ms 70 MB
250 63,484 495 99.2% 528 ms 104 MB
500 251,984 995 99.6% 810 ms 149 MB

Every delivery was admitted after bounded retries. The 500-peer aggregate was 34.4 KB and total sender traffic was 18.1 MB per block. A real multi-host test is still required; the emulator proves transport-path scaling but does not reproduce hundreds of databases, consensus engines, OmniProtocol connections or WAN kernels.

Safety and review gates

BLOCK_SYNC_AGGREGATION_ENABLED defaults to false. The POC must not be enabled on a public network yet.

Before production use, maintainers must decide and implement:

  1. Per-recipient detached acknowledgement signatures, or a formally reviewed trust rule allowing a quorum block signer to relay liveness-only acknowledgements.
  2. A mixed-version activation protocol so legacy and aggregate nodes cannot diverge during rollout.

Receivers fail closed unless the aggregate is bounded, matches a locally verified block, comes from a signer of that block, and names only known identities committed to the block peerlist/signatures. Applying an aggregate changes sync hints only; it never authenticates a peer or marks one online.

Included tooling

  • feature-flagged protocol path and RPC handler;
  • bounded aggregate validation/admission helpers;
  • Prometheus counters separated by post-block source;
  • six-node, loopback-only, resource-bounded Docker topology;
  • reusable fixed-block measurement script;
  • modeled and convergence tests through 500 peers;
  • documented measurements and limitations.

Validation

  • 15/15 focused aggregation tests passed (1,235 assertions).
  • ESLint passed for all changed TypeScript implementation/test files.
  • Bun production bundle completed successfully.
  • Docker Compose configuration validated for the six-node topology.
  • Six-node legacy and aggregate A/B completed with zero height spread.
  • Offline-node recovery/convergence test passed.
  • Secret scan and git diff --check passed.

Some existing consensus tests mix Jest APIs with bun:test imports and cannot all execute under one runner; that pre-existing runner incompatibility is not changed by this POC.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: aaba5b05-ba62-4adf-900e-f36b0f435b2d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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