-
Notifications
You must be signed in to change notification settings - Fork 7
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
Integrate zstd compression into chain exchange #842
base: main
Are you sure you want to change the base?
Conversation
The GPBFT message exchange over pubsub already uses zstd compression on top of CBOR encoded messages. The work here integrates the same style of compression for chain exchange messages, with additional unification of the encoding mechanism across the two. The work refactors the root level encoding implementation into a generic encoder decoder that both chain exchange and gpbft used. Tests and benchmarks are updated to reflect this. The benchmarking of partial gmessage encoding is also adjusted to fix a few redundant statements and bugs in testing. Fixes #819
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #842 +/- ##
==========================================
+ Coverage 67.39% 67.45% +0.06%
==========================================
Files 84 84
Lines 8915 8918 +3
==========================================
+ Hits 6008 6016 +8
+ Misses 2380 2376 -4
+ Partials 527 526 -1
|
Can we add a compression bomb test? I think we're fine, but it would be nice to have a test.
|
} | ||
|
||
func NewPubSubChainExchange(o ...Option) (*PubSubChainExchange, error) { | ||
opts, err := newOptions(o...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
zstd, err := encoding.NewZSTD[*Message]() |
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 we going with ZSTD by default?
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.
For chain exchange yes. For GPBFT it's configurable via manifest.
Happy to make it configurable for chain exchange too if you think it's worth doing.
Sure. Captured #843 |
The GPBFT message exchange over pubsub already uses zstd compression on top of CBOR encoded messages. The work here integrates the same style of compression for chain exchange messages, with additional unification of the encoding mechanism across the two.
The work refactors the root level encoding implementation into a generic encoder decoder that both chain exchange and gpbft used. Tests and benchmarks are updated to reflect this.
The benchmarking of partial gmessage encoding is also adjusted to fix a few redundant statements and bugs in testing.
Fixes #819