[loadgen] LoadGen without committer#70
Conversation
Signed-off-by: Liran Funaro <liran.funaro@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
Adds the ability to run the LoadGen client directly against an orderer without a committer sidecar, refactors envelope creation, and unifies delivery receiver logic.
- Extracted
CreateEnvelopefromSendWithEnvto allow envelope serialization without immediately sending. - Introduced a new
TestLoadGenForOnlyOrdererand corresponding CLI/template support for the “only orderer” mode. - Refactored sidecar and orderer delivery into a shared
runDeliveryReceiverhelper.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/broadcastdeliver/envelope_creator.go | Extracted CreateEnvelope method and updated SendWithEnv. |
| loadgen/client_test.go | Added TestLoadGenForOnlyOrderer. |
| loadgen/adapters/sidecar_receiver.go | Renamed receiver types/functions and refactored into runDeliveryReceiver. |
| loadgen/adapters/orderer.go | Switched to unified delivery receiver and introduced mapToBatch/sendBatch. |
| loadgen/adapters/config.go | Clarified SidecarEndpoint documentation. |
| integration/test/loadgen_test.go | Added integration scenario for “only orderer” mode. |
| integration/runner/runtime.go | Introduced LoadGenForOnlyOrderer flag and template switch. |
| cmd/config/templates/loadgen_client_orderer.yaml | Reduced default broadcast parallelism. |
| cmd/config/templates/loadgen_client_only_orderer.yaml | Added new template for only-orderer client. |
| cmd/config/create_config_file.go | Embedded the new only-orderer template. |
Comments suppressed due to low confidence (4)
loadgen/adapters/sidecar_receiver.go:36
- [nitpick] Minor grammar: change to
// runSidecarReceiver starts receiving blocks from the sidecar.for consistency.
// runSidecarReceiver start receiving blocks from the sidecar.
cmd/config/create_config_file.go:97
- [nitpick] The variable name
TemplateLoadGenOnlyOrdereromitsClientbut usestemplateLoadGenOnlyOrdererClientinternally; consider renaming for consistency.
TemplateLoadGenOnlyOrderer = templateLoadGenOnlyOrdererClient + templateLoadGenCommon
loadgen/adapters/sidecar_receiver.go:34
- [nitpick] The name
statusIdxis not descriptive; consider renaming to something liketxFilterMetadataIndexfor clarity.
const statusIdx = int(common.BlockMetadataIndex_TRANSACTIONS_FILTER)
loadgen/adapters/sidecar_receiver.go:147
- The function is returning
statusBatch(a slice) but its callers expect anerror; this signature mismatch will not compile or behave as intended.
return statusBatch
cendhu
left a comment
There was a problem hiding this comment.
LGTM. I have a few suggestions which can be addressed in separate PRs as they are out of scope for this one.
| txIDs := make([]string, len(txs)) | ||
| for i, tx := range txs { | ||
| var err error | ||
| envs[i], txIDs[i], err = stream.CreateEnvelope(tx) |
There was a problem hiding this comment.
We have an issue to parallelize this. This change may make it hard to achieve that.
| }) | ||
| } | ||
| processedBlocks.Write(statusBatch) | ||
| processedBlocks.Write(mapToStatusBatch(block)) |
There was a problem hiding this comment.
We can use multiple goroutines to process the committed status as we are unmarshaling the envelope. Otherwise, this could increase the latency unnecessarily.
Type of change
Description
Related issues