Replace request aggregator with vote replier#5050
Merged
pwojcikdev merged 3 commits intonanocurrency:developfrom Mar 26, 2026
Merged
Replace request aggregator with vote replier#5050pwojcikdev merged 3 commits intonanocurrency:developfrom
pwojcikdev merged 3 commits intonanocurrency:developfrom
Conversation
Add callback registration and typed future-based message observation for tests. Inline the trivial constructor and send implementation in the header to keep the helper self-contained.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the legacy request_aggregator + vote_generator reply path with a dedicated vote_replier component that directly services confirm_req by looking up blocks, applying voting_policy, signing final votes, and sending confirm_ack replies back to the requesting channel.
Changes:
- Added
nano::vote_replier(config + worker threads + fair-queued request handling) and integrated it intonodestartup/shutdown andmessage_processor. - Removed
request_aggregatorand stripped reply-related APIs/queues fromvote_generatorso it focuses on broadcasting. - Updated config (TOML), stats/logging/locks/thread-role enums, and replaced/added tests and test utilities accordingly.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| nano/node/vote_replier.hpp | Declares the new vote reply component and its config. |
| nano/node/vote_replier.cpp | Implements fair-queued processing, eligibility checks, final vote signing, and reply sending. |
| nano/node/vote_generator.hpp | Removes reply/generate request types and APIs. |
| nano/node/vote_generator.cpp | Removes reply handling from the generator run loop and container info. |
| nano/node/transport/test_channel.hpp | Refactors test channel to be header-only and adds typed observation helpers. |
| nano/node/transport/test_channel.cpp | Deletes the out-of-line implementation (now header-only). |
| nano/node/request_aggregator.hpp | Removes the old aggregator interface/config entirely. |
| nano/node/request_aggregator.cpp | Removes the old aggregator implementation entirely. |
| nano/node/nodeconfig.hpp | Replaces request_aggregator config with vote_replier config. |
| nano/node/nodeconfig.cpp | Switches TOML (de)serialization from request_aggregator to vote_replier. |
| nano/node/node.hpp | Replaces aggregator member with vote_replier. |
| nano/node/node.cpp | Constructs/starts/stops the new vote_replier and updates container_info wiring. |
| nano/node/message_processor.cpp | Routes inbound confirm_req handling to node.vote_replier. |
| nano/node/fwd.hpp | Adds forward declaration for vote_replier. |
| nano/node/CMakeLists.txt | Swaps request_aggregator sources for vote_replier sources. |
| nano/lib/thread_roles.hpp | Renames thread role enum entry to vote_replier. |
| nano/lib/thread_roles.cpp | Updates thread role string for vote_replier. |
| nano/lib/stats_enums.hpp | Removes request_aggregator-related stats and introduces vote_replier stats/details. |
| nano/lib/logging_enums.hpp | Replaces request_aggregator log type with vote_replier. |
| nano/lib/locks.hpp | Replaces request_aggregator mutex enum with vote_replier. |
| nano/lib/locks.cpp | Updates mutex identifier mapping accordingly. |
| nano/core_test/vote_replier.cpp | Adds targeted unit/integration tests for vote_replier behavior. |
| nano/core_test/toml.cpp | Updates TOML config tests for the new node.vote_replier section. |
| nano/core_test/request_aggregator.cpp | Removes old request_aggregator tests. |
| nano/core_test/node.cpp | Updates a few references from aggregator/request stats to vote_replier stats. |
| nano/core_test/CMakeLists.txt | Removes request_aggregator test and adds vote_replier test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Move confirm_req reply handling into a dedicated vote_replier component and remove the old request_aggregator path. Drop reply generation from vote_generator, rename the related node, config, stats, logging, mutex, and thread role hooks, and update the staged tests to use the new component.
Add `wallets::signer()` to expose representative iteration as a reusable signing callback. Use it in vote generation and vote replies, and add tests for empty, multi-representative, and below-threshold signer behavior.
217c959 to
9ddfa0b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the
request_aggregatorcomponent with a simplervote_replierthat handles confirmation request replies. The old aggregator routed them through the vote generator's reply path, which added unnecessary complexity. The new vote replier directly looks up blocks, checks vote eligibility viavoting_policy, signs final votes, and sends them back to the requesting channel on its own processing threads. This also removes the reply-related code (generate(),reply()) fromvote_generator, letting it focus solely on vote broadcasting. The vote replier always responds with final votes, simplifying the reply path by removing the normal/final distinction for replies.