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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
network: non-participating nodes request TX gossip only if ForceFetchTransactions: true #3918
network: non-participating nodes request TX gossip only if ForceFetchTransactions: true #3918
Changes from 18 commits
98a4650
643c519
b7442ce
e9f6d3f
bb32d57
64a250e
a486325
4a54c54
78fdf13
69ca188
a02b044
4f33b10
d09cfab
be6b13e
8284573
2050737
0fe106f
cbdb6e9
97b1d5c
1ea7803
a74255a
c2806d7
4a96326
df15614
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not pass in wn.messagesOfInterestEnc here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because wn.messagesOfInterestEnc should only be grabbed inside wn.messagesOfInterestMu.Lock().
Having it as an argument is really just an optimization for
postMessagesOfInterestThread()
which already holds the lock while doing a Cond.Wait().I could put a lock/get/unlock three lines in front of the two other calls to maybeSendMOI() but it's slightly fewer lines of code to do it inside that? (and still reasonable separation of concerns?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking deeper at OnNetworkAdvance, here it calls nodeInfo.IsParticipating() which contains a call to Ledger.Latest() (which takes a lock on blockQueue.mu.Lock()) and accountManager.HasLiveKeys() (which takes a lock on manager.mu.Lock()).
Before this PR, OnNetworkAdvance used to be very fast — just updating a timestamp. Now it could get stuck for a long time, I know that accountManager.DeleteOldKeys() (which also takes the manager.mu.Lock()) could take seconds in some cases.
Is it possible that OnNetworkAdvance could take too long, and what would be the impact if it did? Agreement synchronously waits for OnNetworkAdvance to finish at the end of every round, when calling the node's EnsureBlock/EnsureValidatedBlock methods. This means the performance of OnNetworkAdvance will delay the start of agreement beginning the next round.