netsync: Rework external request from peer.#3500
Merged
davecgh merged 1 commit intodecred:masterfrom Aug 29, 2025
Merged
Conversation
68a9760 to
a2d692d
Compare
jholdstock
reviewed
Aug 15, 2025
Member
jholdstock
left a comment
There was a problem hiding this comment.
Nice improvement! Is numRequested actually necessary? Cant you just use len(gdMsg.InvList)? Is there overhead associated with calling len?
Member
Author
|
I haven't tested it in a long time, so there might not be anymore, but there used to be extra overhead. I really just followed the same pattern used in the other paths that do the same thing. |
jholdstock
approved these changes
Aug 16, 2025
a2d692d to
408ac34
Compare
81bbfd1 to
67dfcd2
Compare
jrick
approved these changes
Aug 28, 2025
This reworks the logic that allows code external to the sync manager to request blocks, votes, and treasury spend transactions to both simplify and optimize it. The method now makes use of the same logic the sync manager itself uses when requesting data and no longer potentially returns an error. Of particular note is that it now uses the same much more efficient code path that the sync manager itself uses to determine if a transaction is needed as opposed to the rather expensive legacy utxo-based query approach. Finally, this also modifies the logic to potentially make more than one request if needed since it is technically more accurate and avoids any possibility of error even though the current request sizes are nowhere near the limits.
67dfcd2 to
95a36a3
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This requires #3499.
This reworks the logic that allows code external to the sync manager to request blocks, votes, and treasury spend transactions to both simplify and optimize it. The method now makes use of the same logic the sync manager itself uses when requesting data and no longer potentially returns an error.
Of particular note is that it now uses the same much more efficient code path that the sync manager itself uses to determine if a transaction is needed as opposed to the rather expensive legacy utxo-based query approach.
Finally, this also modifies the logic to potentially make more than one request if needed since it is technically more accurate and avoids any possibility of error even though the current request sizes are nowhere near the limits.