feat(tool): networkCapacity Tool Refactor + Production Defaults#2834
Open
AlfredoG87 wants to merge 3 commits into
Open
feat(tool): networkCapacity Tool Refactor + Production Defaults#2834AlfredoG87 wants to merge 3 commits into
AlfredoG87 wants to merge 3 commits into
Conversation
f1dec7b to
82a81e2
Compare
- Rewrite NetworkCapacityServer to use open() + PublishStreamRequestUnparsed, matching real BN StreamPublisherPlugin pattern (avoids full block deserialization) - Rewrite NetworkCapacityClient to two-phase streaming: Phase 1 pre-builds all request batches before opening gRPC (separates parse/batch overhead from network measurement); Phase 2 streams pre-built batches with tight metrics loop - Add grpcEncoding config field to HelidonWebClientConfig proto (supports "identity", "gzip", "zstd"); defaults to "identity" - Update clientDefaultConfig.json to CN production defaults (65535 initial window, 16384 max frame, priorKnowledge=false, grpcEncoding="identity") - Update serverDefaultConfig.json to BN production defaults (8MB window + frame, 8MB TCP socket buffers, writeQueueLength=8192, tcpNoDelay=true) Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
82a81e2 to
3ec62ec
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #2834 +/- ##
============================================
+ Coverage 81.52% 81.57% +0.05%
- Complexity 1525 1559 +34
============================================
Files 142 144 +2
Lines 7176 7410 +234
Branches 756 777 +21
============================================
+ Hits 5850 6045 +195
- Misses 1016 1042 +26
- Partials 310 323 +13 see 9 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Refactors the
networkCapacitytool to produce accurate CN→BN throughput measurements and adds gRPC compression support.Problem
The old tool had two measurement artifacts:
publishBlockStream()— fully deserializes everyBlockItem, which production BN never does.Changes
NetworkCapacityServer.java— replacedpublishBlockStream()withopen()+Pipelines.bidiStreaming()+PublishStreamRequestUnparsed, matchingStreamPublisherPluginexactly. Only header and proof bytes are parsed; all item bytes stay as rawBytes.NetworkCapacityClient.java— two-phase streaming: Phase 1 pre-builds all batches before opening gRPC; Phase 2 streams them with no parse work in the hot path. Waits for all ACKs before half-closing. SupportsgrpcEncoding:"identity","gzip","zstd".network_capacity_config.proto— addedgrpcEncodingfield toHelidonWebClientConfig.clientDefaultConfig.json— CN production defaults (Helidon HTTP/2 defaults,priorKnowledge: false,grpcEncoding: "identity").serverDefaultConfig.json— current BN production defaults (8 MB HTTP/2 window, 128 KB socket buffers). Updated to optimized values in companion PR.