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 #2659: [TierTwo] Fix and improve several synchronization problems
6f79df3 [Refactor] Add ReloadMapSeen function to reload "seen" votes (random-zebra) d60a105 test: add coverage for the incremental budget sync flow. (furszy) 34e9c23 Budget incremental sync: do not clear seen maps when relay status is reset. (furszy) fa2ab10 [Refactor] Budget: check mn-enabled/vote-time before adding to mapSeen (random-zebra) 51e85ff Budget: limit orphan votes maps to 10k entries max. (furszy) d04f5be [Refactor] Simplify CBudgetManager::CheckOrphanVotes() (random-zebra) 62ae606 Budget: Decouple the all-in-one `Budget::Sync()` into two functions: (1) single items sync requests and (2) full budget sync requests. (furszy) 62e9f5e tiertwo sync: fix orphans votes maps linking single prop/bud hash to a single vote, discarding the previous stored item every time that a new orphan arrives. Blocking any follow-up reception of the orphan votes that were discarded, prohibiting its connection forever. (furszy) 32196b1 test: add coverage for single proposal sync based on an orphan proposal vote reception and single finalization sync based on an orphan finalization vote. (furszy) 4864739 budget: generalize budget full sync items relay. (furszy) 31e40a4 Budget sync: Remove useless extra item sync p2p msgs roundtrip (no need to broadcast an inv if the peer is asking for the item directly..) and stop walking through the two maps (budgets and proposals), locking their mutexes, when the peer is requesting a single proposal/budfin. (furszy) 5f596b8 Tiertwo: do not block peers if they requested a single proposal or single budget finalization. (furszy) ae28000 masternodesync: connect the not-connected ProcessSyncStatusMsg. (furszy) 2c3b0e8 masternodesync: fix extra `RequestedMNAttempt` increment in the sporks flow. (furszy) 7020310 masternodesync: decrease mnw sync threshold to 4 peers. (furszy) 7349750 masternodesync: reset last budget item time before start syncing it. (furszy) fd7d569 masternodesync: re-format peer version check. (furszy) Pull request description: A never ending story, more improvements and corrections for the tier two initial synchronization. This time, the following points are tackled: 1) Fix a bad workflow that causes the budget data initial synchronization to be skipped. if we received for example a proposal +50 seconds ago, while we are synchronizing another asset, then once the budget sync starts, it will look like the sync is finished when it's not. Not waiting to receive any budget data, declaring the sync completed. 2) Decrease `mnw` sync threshold to 4 peers to "minimize" the insane amount of network flood and initial tier two sync delay. MNW initial sync is mostly for historical reasons, getting +20k items per peer (+120k items total for the previous threshold of 6) is a high amount of duplicated data relayed over the wire. 80k is still very high but.. it's something that we have to live with until v6.0 (which removes entirely the need of `mnw` messages..). 3) Fix extra sync attempt for the mnlist asset badly incremented in the sporks sync flow. 4) Connect the not-connected `ProcessSyncStatusMsg` (ex `masternodesync.ProcessMessage()`). Thus why the tier two sync stats counters are always in 0, this function was being skipped. 5) The node, after triggering the internal budget data relay process (relaying budget data to every known peer), is invalidly blocking every remote peer, for an hour, for follow-up budget sync requests. 6) The orphans votes maps are linking a single prop/bud parent hash to a single vote, discarding the previous stored item every time that a new orphan arrives. Blocking any follow-up reception of the orphan votes that were discarded, prohibiting its connection. (edge case scenario: splitting risk) 7) Added test coverage for: 1) Single proposal sync based on an orphan proposal vote reception. 2) Single budget finalization sync based on an orphan finalization vote reception. 3) Orphan proposal votes and orphan budget fin votes connection when parent is received. 8) Removed unneeded extra items network sync roundtrip: No need to trigger an inv-based sync when the peer sent us a single proposal sync request. And stop walking through the budgets and proposals maps, locking their mutexes, on every single peer unique proposal/bud_fin item request. 9) Generalized the budget full sync items relay process. Let's aim to include this work on the coming v5.4.0. ACKs for top commit: random-zebra: ACK 6f79df3 Fuzzbawls: ACK 6f79df3 Tree-SHA512: d9225fe587becb378f50374c2805825e2636520f9abcb3697ee1ccedb1182636499006320043ef2c736a45ffc7891499044b4a06c2d30f7da142922442a27e4e
- Loading branch information
Showing
10 changed files
with
413 additions
and
212 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.