Skip to content

Replace request aggregator with vote replier#5050

Merged
pwojcikdev merged 3 commits intonanocurrency:developfrom
pwojcikdev:vote-replier-3
Mar 26, 2026
Merged

Replace request aggregator with vote replier#5050
pwojcikdev merged 3 commits intonanocurrency:developfrom
pwojcikdev:vote-replier-3

Conversation

@pwojcikdev
Copy link
Copy Markdown
Contributor

Replaces the request_aggregator component with a simpler vote_replier that 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 via voting_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()) from vote_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.

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.
Copy link
Copy Markdown
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 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 into node startup/shutdown and message_processor.
  • Removed request_aggregator and stripped reply-related APIs/queues from vote_generator so 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.
@pwojcikdev pwojcikdev merged commit ff4f744 into nanocurrency:develop Mar 26, 2026
28 checks passed
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.

2 participants