This repository was archived by the owner on Jan 22, 2025. It is now read-only.
shrinks size of Packet.Meta#22224
Merged
behzadnouri merged 3 commits intosolana-labs:masterfrom Jan 4, 2022
Merged
Conversation
solana-labs@507367e updated window-service to send shreds (as opposed to packets) to retransmit-stage and so seed and slot fields in Packet.Meta are unused: https://github.com/solana-labs/solana/blob/d6ec103be/sdk/src/packet.rs#L27-L28
Instead of a separate bool type for each flag, all the flags can be encoded in a type-safe bitflags encoded in a single u8: https://github.com/solana-labs/solana/blob/d6ec103be/sdk/src/packet.rs#L19-L31
03ad268 to
5545d0e
Compare
Codecov Report
@@ Coverage Diff @@
## master #22224 +/- ##
=======================================
Coverage 81.0% 81.0%
=======================================
Files 523 523
Lines 146497 146484 -13
=======================================
+ Hits 118741 118748 +7
+ Misses 27756 27736 -20 |
jstarry
approved these changes
Jan 3, 2022
mergify Bot
added a commit
that referenced
this pull request
Jan 4, 2022
* removes seed and slot fields from Packet.Meta 507367e updated window-service to send shreds (as opposed to packets) to retransmit-stage and so seed and slot fields in Packet.Meta are unused: https://github.com/solana-labs/solana/blob/d6ec103be/sdk/src/packet.rs#L27-L28 (cherry picked from commit aa9f7ed) * uses std::net::IpAddr type for Packet.Meta.addr (cherry picked from commit 73a7741) # Conflicts: # streamer/src/streamer.rs * adds bitflags to Packet.Meta Instead of a separate bool type for each flag, all the flags can be encoded in a type-safe bitflags encoded in a single u8: https://github.com/solana-labs/solana/blob/d6ec103be/sdk/src/packet.rs#L19-L31 (cherry picked from commit 01a096a) # Conflicts: # sdk/Cargo.toml * removes backport merge conflicts Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Closed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
Tons of packets are continuously on the fly. Some are garbage collected by the recycler and stay in memory; and some are pinned to cuda. So it is necessary to keep their memory footprint small.
507367e6aupdated window-service to send shreds (as opposed to packets) to retransmit-stage and so seed and slot fields in Packet.Meta are unused and can be removed:https://github.com/solana-labs/solana/blob/d6ec103be/sdk/src/packet.rs#L27-L28
boolfor each flag, all the flags can be encoded in a type-safebitflagsand encoded in a singleu8:https://github.com/solana-labs/solana/blob/d6ec103be/sdk/src/packet.rs#L19-L31
Summary of Changes
Packet.Meta.{seed,slot}.Meta.addrfield type tostd::net::IpAddr.v6field so becomes redundant and is dropped.bitflagsinstead of separate bool type for each flag.#[repr(C)]but to my knowledge this is not used in any of the bindings. So I guess the changes should not cause compatibility issues.