Replace wallets periodic reps scan with dedicated thread#5009
Merged
pwojcikdev merged 3 commits intonanocurrency:developfrom Jan 25, 2026
Merged
Replace wallets periodic reps scan with dedicated thread#5009pwojcikdev merged 3 commits intonanocurrency:developfrom
wallets periodic reps scan with dedicated thread#5009pwojcikdev merged 3 commits intonanocurrency:developfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR moves the periodic wallet representative scan from the generic wallet worker pool to a dedicated named thread, and adds stats instrumentation for the scan loop.
Changes:
- Extend
nano::walletsto depend onnano::stats, add a dedicatedreps_threadandreps_condition, and implementrun_reps_scan()as a background loop instead ofongoing_compute_reps()scheduled on the worker pool. - Wire the new
statsdependency throughnano::node, and add a newwalletstats type plusloop_repsdetail for tracking scan iterations. - Update thread role enums/mappings to add
wallet_repsand move wallet-related roles to the newer section; update tests to constructwalletswithnode.stats.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
nano/node/wallet.hpp |
Adds nano::stats & dependency, declares run_reps_scan(), and introduces reps_condition and reps_thread for the dedicated reps scan thread. |
nano/node/wallet.cpp |
Includes stats, guards delayed work precaching with wallets.stopped, wires stats into wallets ctor, starts/join a wallet_reps thread in start()/stop(), and replaces ongoing_compute_reps() with the run_reps_scan() loop that calls compute_reps() and increments wallet/loop_reps. |
nano/node/node.cpp |
Updates wallets_impl construction to pass stats into the wallets constructor. |
nano/lib/thread_roles.hpp |
Reorganizes thread role enum entries, moving wallet-related roles near the bottom and adding a new wallet_reps role. |
nano/lib/thread_roles.cpp |
Updates get_string switch to match the new enum layout and adds the string mapping for wallet_reps. |
nano/lib/stats_enums.hpp |
Adds stat::type::wallet and stat::detail::loop_reps for wallet-related stats accounting. |
nano/core_test/wallets.cpp |
Adjusts the make_wallets helper to construct wallets with the new node.stats parameter, keeping tests aligned with the constructor signature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results for Commit 0d4fe82Pull Request 5009: Results Test Case Results
Last updated: 2026-01-25 14:18:47 UTC |
c5876cc to
a7c7f30
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.