-
Notifications
You must be signed in to change notification settings - Fork 4
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
RED-196 check trie hashes for near node down check #236
base: dev
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let us know how these changes are properly tested.
let hashTrieReq: HashTrieReq = { | ||
radixList: ['0'], | ||
} | ||
let closestNodes = stateManager.getClosestNodes(hash, 5, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we know if these 5 nodes will cover the radix 0
?
|
||
if (nearNodeResponse == null) { | ||
/* prettier-ignore */ nestedCountersInstance.countEvent('p2p', 'isDownCheck-down-near-node-fail', 1) | ||
return 'down' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean "near node" is down or "target node" is down? If we cannot get response from near node, isn't that we report it as "lost" and try another near node?
} | ||
//compare the hashes from the near node and the target node | ||
for (let nodeHash of targetNodeResponse.nodeHashes) { | ||
if (nodeHashesMap.get(nodeHash.radix) !== nodeHash.hash) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the target node is up and responsive but has out of sync data? In that case, we should not mark it as down
as the node may repair the radix in next cycle.
if (config.p2p.useNearNodeForDownCheck) { | ||
//using the 'get_trie_hashes' route to check if the node is up. | ||
let obj = { counter: currentCycle, checker: Self.id, target: node.id, timestamp: shardusGetTime() } | ||
let hash = crypto.hash(obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this hash used instead of a radix covered by target node?
No description provided.