Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Display hardcoded and ledger block height in compare_rep_weights #2845

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions nano/nano_node/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,11 @@ int main (int argc, char * const * argv)
nano::inactive_node inactive_node (data_path, node_flags);
auto node = inactive_node.node;

auto const hardcoded = node->get_bootstrap_weights ().second;
auto const bootstrap_weights = node->get_bootstrap_weights ();
auto const & hardcoded = bootstrap_weights.second;
auto const hardcoded_height = bootstrap_weights.first;
auto const ledger_unfiltered = node->ledger.cache.rep_weights.get_rep_amounts ();
auto const ledger_height = node->ledger.cache.block_count.load ();

auto get_total = [](decltype (hardcoded) const & reps) -> nano::uint128_union {
return std::accumulate (reps.begin (), reps.end (), nano::uint128_t{ 0 }, [](auto sum, auto const & rep) { return sum + rep.second; });
Expand Down Expand Up @@ -255,9 +258,11 @@ int main (int argc, char * const * argv)
return boost::str (boost::format ("representative %1% hardcoded --- ledger %2%") % rep.first.to_account () % nano::uint128_union (rep.second).format_balance (nano::Mxrb_ratio, 0, true));
};

std::cout << boost::str (boost::format ("hardcoded weight %1% Mnano\nledger weight %2% Mnano\nmismatched\n\tsamples %3%\n\ttotal %4% Mnano\n\tmean %5% Mnano\n\tsigma %6% Mnano\n")
std::cout << boost::str (boost::format ("hardcoded weight %1% Mnano at %2% blocks\nledger weight %3% Mnano at %4% blocks\nmismatched\n\tsamples %5%\n\ttotal %6% Mnano\n\tmean %7% Mnano\n\tsigma %8% Mnano\n")
% total_hardcoded.format_balance (nano::Mxrb_ratio, 0, true)
% hardcoded_height
% total_ledger.format_balance (nano::Mxrb_ratio, 0, true)
% ledger_height
% mismatched.size ()
% mismatch_total.format_balance (nano::Mxrb_ratio, 0, true)
% mismatch_mean.format_balance (nano::Mxrb_ratio, 0, true)
Expand Down