forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #2749: [Budget] Use space and time efficient data structure to …
…check for already sent item sync requests d8e2c98 budget manager: use space and time efficient data structure for unknown item requests. (furszy) f3a7fea budget manager: use g_netfulfilledman instead of mAskedUsForBudgetSync to prevent spam. (furszy) Pull request description: In the arriving orphan vote process; the node, after trying to add the vote to the orphan map, tries to ask the proposal/budget to the peer that sent the vote, sending a single item sync request. The request, as the node can receive several votes going to the same proposal, is relayed only if the node haven't sent a sync request for the proposal already. As we are using a map to perform this membership test, the time complexity is O(log n). This PR improves it migrating the map to a bloom filter, which time complexity for membership test is O(1). The false-positive rate, even when it's negligible (i set the rate to 0.001), isn't really a worry here because, as wrote above, this is only use to test for sync proposal request existence, which is not ban cause. It's just used to not send extra unneeded requests. Plus, aside from that, cleaned the other `mAskedUsForBudgetSync` map, using the already existent net request manager flow. ACKs for top commit: random-zebra: ACK d8e2c98 Fuzzbawls: ACK d8e2c98 Tree-SHA512: 8cc2dc945f9182aaa553588b7f2e741b6388f70e550d2a99946476796ff1885a153ec9b8284ef299aff418f7e095bfa96e679caf02963597158d5974a8e77b1d
- Loading branch information
Showing
6 changed files
with
97 additions
and
63 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
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