Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[master] Exclude shard guards from PoW reputation #2469

Merged
merged 1 commit into from
Mar 11, 2021

Conversation

sunny-teo9000
Copy link

Description

To prevent shard guards from being affected by the reputation, priority is being set to the highest for SHARD_GUARD_TOL percent of nodes.

This will be further trimmed in the SortPoWSoln to fit the shard structure.

There will only be a maximum of SHARD_GUARD_TOL percent of shard guards in the shards.

Backward Compatibility

  • This is not a breaking change
  • This is a breaking change

Review Suggestion

Status

Implementation

  • ready for review

Integration Test (Core Team)

  • local machine test
  • small-scale cloud test

@github-actions github-actions bot changed the title Exclude shard guards from PoW reputation [master] Exclude shard guards from PoW reputation Mar 11, 2021
@github-actions github-actions bot added this to PRs in development in Core Mar 11, 2021
src/libDirectoryService/PoWProcessing.cpp Outdated Show resolved Hide resolved
src/libDirectoryService/PoWProcessing.cpp Outdated Show resolved Hide resolved
src/libDirectoryService/PoWProcessing.cpp Outdated Show resolved Hide resolved
src/libDirectoryService/PoWProcessing.cpp Outdated Show resolved Hide resolved
src/libDirectoryService/DSBlockPreProcessing.cpp Outdated Show resolved Hide resolved
Core automation moved this from PRs in development to PRs needing review Mar 11, 2021
// Iterate PoWs based on key ordering in the map
for (const auto& kv : m_allPoWs) {
const auto& pubKey = kv.first;
uint8_t priority = 0;
auto reputation = m_mapNodeReputation.find(pubKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

better if can move this line to line 592?

continue;
}
priority = maxPriority;
LOG_GENERAL(INFO, "Node=" << pubKey << "Reputation=(shard guard)");
listNodePriority.emplace_back(pubKey, priority);
Copy link
Contributor

Choose a reason for hiding this comment

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

may be just use max_priority when adding back.

continue;
}
priority = maxPriority;
LOG_GENERAL(INFO, "Node=" << pubKey << "Reputation=(shard guard)");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
LOG_GENERAL(INFO, "Node=" << pubKey << "Reputation=(shard guard)");
LOG_GENERAL(INFO, "Node=" << pubKey << " Reputation=(shard guard)");

Core automation moved this from PRs needing review to PRs approved - ready to merge! Mar 11, 2021
@ansnunez ansnunez merged commit f066029 into master Mar 11, 2021
Core automation moved this from PRs approved - ready to merge! to PRs done (merged) Mar 11, 2021
@ansnunez ansnunez deleted the fix/ExcludeShardGuardFromRep branch March 11, 2021 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Core
  
PRs done (merged)
Development

Successfully merging this pull request may close these issues.

None yet

3 participants