-
Notifications
You must be signed in to change notification settings - Fork 302
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
pd: save work streaming compact blocks by avoiding needless deserialization #4008
Merged
Conversation
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
…ation This pulls a proto type out of the state and passes it to the RPC directly, rather than deserializing through a domain type (which involves another round of allocations and some crypto operations to parse field elements). This should help reduce load for RPC servers streaming compact blocks to clients. We could in principle go further and pull bytes directly out of the state and pass them directly to the client (avoiding the bytes>proto>bytes conversion) but that would be more work (I'm not sure exactly how or if Tonic supports that), and this is lower-hanging fruit.
conorsch
pushed a commit
that referenced
this pull request
Mar 13, 2024
…zation (#4008) ## Describe your changes This pulls a proto type out of the state and passes it to the RPC directly, rather than deserializing through a domain type (which involves another round of allocations and some crypto operations to parse field elements). This should help reduce load for RPC servers streaming compact blocks to clients. We could in principle go further and pull bytes directly out of the state and pass them directly to the client (avoiding the bytes>proto>bytes conversion) but that would be more work (I'm not sure exactly how or if Tonic supports that), and this is lower-hanging fruit. ## Issue ticket number and link No issue, just an observation after I looked at Grafana and took a few minutes to change ## Checklist before requesting a review - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: > This only changes the RPC implementation, not any consensus logic; it should be safe to cherry-pick and deploy on a release branch. (cherry picked from commit 3a9db32)
conorsch
pushed a commit
that referenced
this pull request
Mar 13, 2024
…zation (#4008) ## Describe your changes This pulls a proto type out of the state and passes it to the RPC directly, rather than deserializing through a domain type (which involves another round of allocations and some crypto operations to parse field elements). This should help reduce load for RPC servers streaming compact blocks to clients. We could in principle go further and pull bytes directly out of the state and pass them directly to the client (avoiding the bytes>proto>bytes conversion) but that would be more work (I'm not sure exactly how or if Tonic supports that), and this is lower-hanging fruit. ## Issue ticket number and link No issue, just an observation after I looked at Grafana and took a few minutes to change ## Checklist before requesting a review - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: > This only changes the RPC implementation, not any consensus logic; it should be safe to cherry-pick and deploy on a release branch. (cherry picked from commit 3a9db32)
conorsch
pushed a commit
that referenced
this pull request
Mar 13, 2024
…zation (#4008) ## Describe your changes This pulls a proto type out of the state and passes it to the RPC directly, rather than deserializing through a domain type (which involves another round of allocations and some crypto operations to parse field elements). This should help reduce load for RPC servers streaming compact blocks to clients. We could in principle go further and pull bytes directly out of the state and pass them directly to the client (avoiding the bytes>proto>bytes conversion) but that would be more work (I'm not sure exactly how or if Tonic supports that), and this is lower-hanging fruit. ## Issue ticket number and link No issue, just an observation after I looked at Grafana and took a few minutes to change ## Checklist before requesting a review - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: > This only changes the RPC implementation, not any consensus logic; it should be safe to cherry-pick and deploy on a release branch. (cherry picked from commit 3a9db32)
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.
Describe your changes
This pulls a proto type out of the state and passes it to the RPC directly, rather than deserializing through a domain type (which involves another round of allocations and some crypto operations to parse field elements). This should help reduce load for RPC servers streaming compact blocks to clients.
We could in principle go further and pull bytes directly out of the state and pass them directly to the client (avoiding the bytes>proto>bytes conversion) but that would be more work (I'm not sure exactly how or if Tonic supports that), and this is lower-hanging fruit.
Issue ticket number and link
No issue, just an observation after I looked at Grafana and took a few minutes to change
Checklist before requesting a review
If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: