Skip to content

Conversation

@algorandskiy
Copy link
Contributor

@algorandskiy algorandskiy commented Nov 19, 2025

Summary

Route AV, PP, VB messages to pubsub via TaggedMessageValidatorHandler. It is quite similar to TxHandler implementation except the following:

  1. A single PP message can produce 2 responses (vote and tail proposal [see player.handleMessageEvent.defer])
  2. Agreement might want to re-transmit a message that was previously sent over the network
  3. These (1) and (2) forced to change message ID to default (peerID + seqNo) in order to handle synchronously (syncCh) a single PP response and then use a regular net.Relay / net.Ignore for the second response from agreement state machine. Also peerID + seqNo message ID solves re-transmission issue (all messages have new ID so that propagated).

What is missing: votes compression

Test Plan

  1. Modified TestNodeHybridOrP2PTopology to check both P2P and Hybrid networks advance
  2. TODO: extend agreement/fuzzer/networkFacade_test.go
  3. TODO: performance testing

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 41.00719% with 82 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.67%. Comparing base (6ee2e7c) to head (e02da18).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
agreement/gossip/network.go 9.80% 44 Missing and 2 partials ⚠️
network/metrics.go 33.33% 16 Missing ⚠️
network/p2p/pubsub.go 0.00% 11 Missing ⚠️
network/p2pNetwork.go 82.69% 6 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6501      +/-   ##
==========================================
- Coverage   47.87%   47.67%   -0.20%     
==========================================
  Files         662      655       -7     
  Lines       87934    87983      +49     
==========================================
- Hits        42095    41947     -148     
- Misses      43076    43253     +177     
- Partials     2763     2783      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces consensus traffic routing via PubSub by adding support for agreement votes, proposal payloads, and vote bundles to the P2P gossip network. The implementation extends the existing transaction-focused PubSub infrastructure to handle consensus messages.

Key changes:

  • Added three new PubSub topics (AV, PP, VB) for consensus messages alongside the existing TX topic
  • Implemented validator handlers for synchronous message validation with forwarding policy support
  • Disabled vote compression tests for P2P transport pending future implementation

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
network/p2p/pubsub.go Defined new topic names and updated PubSub configuration to support consensus message topics
network/p2pNetwork.go Added consensus topic handling loop and extended validator to support multiple message types
network/metrics.go Added metrics tracking for the new consensus message topics
network/p2pNetwork_test.go Updated tests to use validator handlers and added topic subscription checks
network/msgCompressor_test.go Disabled P2P vote compression tests temporarily
agreement/gossip/network.go Implemented synchronous validation handlers with forwarding policy support
agreement/gossip/network_test.go Added validator handler registration methods to test network
agreement/fuzzer/networkFacade_test.go Added stub validator handler methods for fuzzer facade
agreement/abstractions.go Added Ignore method to Network interface
agreement/actions.go Implemented Ignore action handling
agreement/proposalManager.go Fixed typo in comment (delievered → delivered)
agreement/service_test.go Added stub Ignore method to test endpoint
network/mesh_test.go Updated mock P2P service to properly handle subscriptions and closures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@algorandskiy algorandskiy marked this pull request as ready for review December 12, 2025 20:01
@algorandskiy algorandskiy requested a review from gmalouf December 12, 2025 20:02
@algorandskiy algorandskiy changed the title WIP: consensus traffic via pubsub network: consensus traffic via pubsub Dec 12, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant