6803 - adding code for updating pivot#6818
Conversation
|
I think it is too simplistic - related to the linked issue - we need to punish the peer in most cases, only if it is the only peer (or maybe 1 of a very small amount? - would need empirical testing) we want to take a different path. |
@LukaszRozmej , so is there a way to check if the number of peers == 1, and only then update the pivot? |
|
You would have to go through SyncPeerPool, check for capabilities ect. |
|
Hi @LukaszRozmej can we use the count of the _logResult to determine if the number of connected peers is 1 ? |
|
Not sure @dceleda what do you think? |
|
Hi @dceleda, could you confirm if we can use the length of the _resultLog array to determine the number of peers? the _resultLog is defined as folllows - private readonly LinkedList<(PeerInfo peer, AddRangeResult result)> _resultLog = new(); |
|
its also possible that the peer just drop the state as it was too old, so there could be case where the resultlog.count > 1, not to mention its almost always a rolling list so it should almost all the time be more than 1. Maybe just also check consecutive failure? As in, if there are no success for the past n request, then chances are, pivot need to be updated, not the peer need to be punished. |
Since resultlog count check won't work, can we check the value of peerLastFailures? If it's beyond or below a certain threshold, we can try to update the pivot. |
|
HI @LukaszRozmej/ @asdacap could you advise on the next steps for this one. |
Fixes #6803
Please choose one of the keywords above to refer to the issue this PR solves followed by the issue number (e.g. Fixes #000). If no issue number, remove the line. Also, remove everything marked optional that is not applicable. Remove this note after reading.
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs. Remove if not applicable.Requires explanation in Release Notes
If yes, fill in the details here. Remove if not applicable.
Remarks
Optional. Remove if not applicable.