-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed
hasTxIdsToAcknowledge
function. Fix test
`hasTxIdsToAcknowledge` is not used anywhere in the code so it is removed. `filterActivePeers` is improved by making its decision logic more closed to `pickTxsToDownload`. `filterActivePeers` test is fixed, since it doesn't hold under the new logic: `filterActivePeers` will not compute a decision for peers which have `requestedTxIdsInflight` and `makeDecisions` computes non-empty decisions for peers with no `requestedTxIdsInflight`. So: 1. "The set of active peers is a superset of peers for which a decision was made" this is not true since it is possible that a non active peer has a legitimate decision, but due to our race-condition protection condition we just don't generate it. 2. "The set of active peer which can acknowledge txids is a subset of peers for which a decision was made" this is removed since hasTxIdsToAcknowledge function is removed 3. "Decisions made from the results of `filterActivePeers` is the same as from the original set" this isn't true because of what I said above So I refactored the test to check that the number of filtered decisions is a subset of the total number of decisions, which I believe to be a more accurate test for the current logic
- Loading branch information
Showing
3 changed files
with
48 additions
and
73 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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