-
Notifications
You must be signed in to change notification settings - Fork 4.7k
adds an optional encoding for serializing duplicate shreds #14362
Conversation
Codecov Report
@@ Coverage Diff @@
## master #14362 +/- ##
=========================================
- Coverage 80.3% 80.3% -0.1%
=========================================
Files 403 404 +1
Lines 101131 101219 +88
=========================================
+ Hits 81283 81346 +63
- Misses 19848 19873 +25 |
09be5db
to
3952f32
Compare
Encoded::Deflate(bytes) => Box::new(DeflateDecoder::new(&bytes[..])), | ||
Encoded::Gzip(bytes) => Box::new(GzDecoder::new(&bytes[..])), | ||
Encoded::Zlib(bytes) => Box::new(ZlibDecoder::new(&bytes[..])), | ||
Encoded::Zstd(bytes) => Box::new(zstd::stream::read::Decoder::new(&bytes[..])?), |
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.
Are these decoders hardened against zip-bomb-like behavior?
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.
I raised that question to the upstream package; and meanwhile, added a limit
here for number of bytes decoded.
a39eb29
to
9c4acc2
Compare
fd1c189
to
1d1b6f5
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This stale pull request has been automatically closed. Thank you for your contributions. |
Problem
The payload for
DuplicateShred
is larger than what can fit in one packet.Currently this is split up into multiple chunks, each with its own added
overhead, Plus the overhead when these are wrapped in gossip messages:
https://github.com/solana-labs/solana/blob/cb8ba739a/core/src/duplicate_shred.rs#L32-L36
Compressing the payload may reduce the number of chunks needed to send one
complete duplicate slot proof over gossip.
Summary of Changes
down gossip.