-
Notifications
You must be signed in to change notification settings - Fork 793
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 filter for publish and confirm_ack messages #2539
Network filter for publish and confirm_ack messages #2539
Conversation
b83d40d
to
70a9fd7
Compare
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.
Looks good, and sanitizers happy
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.
Looks good after the fix for the stack referenc.
If a publish message is dropped when the block processor is full, should it be removed from the filter so that it can try to process it the next time it's seen? How would this impact bootstrapping the block if the publish message is dropped but the filter still contains the block? See this line. |
That's absolutely missing, thank you @Srayman . |
4c0e7bb
to
84af7de
Compare
d163eaf
to
8ba2d4e
Compare
…hey are deserialized. When they are unique, the digest is saved and passed around to network processing which may drop the messages if the block or vote processor is full. After processing, there are instances where digests have to be cleared from the filter to ensure the original message can be received again: - Cleaning up a long unchecked block erases that element from the publish filter. - Reaching max capacity of the inactive votes cache clears the oldest item from the cache and the confirm_ack filter. For this reason, inactive_votes_cache now stores the digests, and votes pulled from this cache for new elections are now erased. - Interactions between bootstrap frontier confirmation and inactive_votes_cache - An active election is dropped. The vote digest is now saved here as well. Special case if a vote came from inactive_votes_cache, must ensure the digest is passed along. Many tests were added to ensure proper clearing of the filter when blocks and votes are dropped. The blocks_filter has been removed due to redundancy. 16 extra bytes are used for each vote in an (inactive) vote stored in memory.
435d221
to
07328be
Compare
2ee598b
… happy for Rel builds
This reverts commit c56e0ce. Not necessary as the vote goes into inactive votes cache and can later be removed if necessary.
Moving with #2643 in V21, filtering votes is left for a future version. |
To-do test cases:
Adds duplicate detection of publish and confirm_ack messages before they are deserialized. When they are unique, the digest is saved and passed around to
network
which may drop the messages if the block or vote processor is full.After processing, there are instances where digests have to be cleared from the filter to ensure the original message can be received again:
The blocks_filter has been removed due to redundancy. 16 extra bytes are used for each hash in an (inactive) vote stored in memory.