Skip deserializing gossip attestation messages by caching AttestationData - #5363
Merged
Conversation
Contributor
Performance Report✔️ no performance regression detected Full benchmark results
|
Member
Author
|
Skip deserializing attestation gossip messages turns out to be great, got better metrics than unstable (with same mesh peers, network i/o). Below is a feat2 mainnet metrics vs unstable mainnet metrics:
along with that:
|
twoeths
marked this pull request as ready for review
April 15, 2023 08:48
dapplion
approved these changes
Apr 17, 2023
dapplion
left a comment
Contributor
There was a problem hiding this comment.
Nice optimization! It's unfortunate that deserializing is slow, let's monitor the RAM usage on a prod deployment. Please address the TODO on another PR when possible
lodestar/packages/beacon-node/src/util/sszBytes.ts
Lines 166 to 169 in c6bca10
wemeetagain
approved these changes
Apr 17, 2023
Member
|
🎉 This PR is included in v1.8.0 🎉 |
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.








Motivation
beacon_attestationtopicaggregationBitscan be extracted from ssz bytessignaturecan also be extracted from ssz bytesNetworkProcessor.onPendingGossipsubMessage()to not push to the queue if unknown block root attestationsDescription
AttestationDatato seen cache, used forbeacon_attestationtopic onlygossipHandlerFnnow accept ssz bytes instead of ssz object. Forbeacon_attestationwe don't do the deserialization and delegate to thevalidateAttestationfunction to do that. For all other topics we deserialize to ssz objects and pass to validation functions (unchange)validateAttestation:aggregationBitsandsignaturefrom ssz bytes.part of #5352 #5353
Testing in progress on feat1, feat2