Signed armageddon#945
Conversation
f68146d to
b7b7bfc
Compare
9ebecc4 to
5c4da1a
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for sending signed transactions in the armageddon load command via a new --isSigned flag, and introduces an integration test that exercises signed load transactions and validates signatures in pulled blocks.
Changes:
- Add
--isSignedflag toarmageddon loadand plumb the option through load/send codepaths. - Create/load signing materials (MSP key + cert + org) and generate signed envelopes when enabled.
- Add an integration test that runs
armageddon load --isSignedand verifies received envelopes are properly signed.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
common/tools/armageddon/armageddon.go |
Adds --isSigned flag, loads signing materials, and sends signed envelopes when enabled. |
testutil/tx/tx_utils.go |
Adds an envelope builder that can return signed vs unsigned envelopes. |
testutil/signutil/signer.go |
Exposes MSP ID extraction helper for use by armageddon. |
common/tools/armageddon/armageddon_test.go |
Adds integration test verifying signed load transactions are signed and verifiable. |
docs/cli/armageddon.md |
Documents the new --isSigned CLI flag. |
Comments suppressed due to low confidence (1)
common/tools/armageddon/armageddon.go:608
tx.PrepareEnvWithTimestampAndSignatureChoicecan returnnil(e.g., if signing fails). The current code will pass a nil envelope intoSendTxToAllRouters, which is likely to panic. Handle a nil envelope explicitly and exit with an actionable error.
for i := 0; i < numOfTxs; i++ {
env := tx.PrepareEnvWithTimestampAndSignatureChoice(i, txSize, sessionNumber, isSigned, signer, certBytes, org)
status := rl.GetToken()
if !status {
fmt.Fprintf(os.Stderr, "failed to send tx %d", i+1)
os.Exit(3)
}
broadcastClient.SendTxToAllRouters(env)
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5c4da1a to
726b5a6
Compare
|
|
||
| parties := []types.PartyID{1, 2, 3, 4} | ||
| statusUnknown := common.Status_UNKNOWN | ||
| test_utils.PullFromAssemblers(t, &test_utils.BlockPullerOptions{ |
There was a problem hiding this comment.
You are using a different approach here.
The PullFromAssemblers is a method used in our integration tests.
Why not use the receive command as done in all armageddon tests ?
We want to confirm that armageddon works as expected, i.e., we can load signed transactions and receive them.
There was a problem hiding this comment.
I thought that the test should also verify that each tx is really signed, but since we don't need to test it as part of this test i will change it to the simpler test approach instead
d5345af to
3b88548
Compare
| loadTransactions *int | ||
| loadRate *string | ||
| loadTxSize *int | ||
| loadIsSigned *bool |
There was a problem hiding this comment.
We need to support three modes:
- No signatures
- Full signatures — including the certificate
- Short signatures — using known certificates, referenced by hash
To prepare for this, let’s define a string flag, called "signature-mode," for example, with three meaningful values.
If the flag is missing from the command, it means no signatures should be used and the submitted transaction should remain unchanged from today (when txSize = 300, the size will refer to the full envelope size)
If the flag is set to full, the transaction is signed and includes the full certificate. This increases the transaction size. Therefore, when txSize = 300, the size will refer only to the payload data, not to the full envelope size.
If the flag is set to short, the transaction is signed and includes only the certificate hash. In this case, the transaction size is smaller than a transaction signed in full mode.
8565fd1 to
0d20085
Compare
2dcb19b to
501c400
Compare
13ea39e to
111fb9c
Compare
changing to use signed mode instead of boolean flag Signed-off-by: Moran Abilea <moran.abilea@ibm.com>
111fb9c to
32084d2
Compare
added --isSigned flag to armageddon load command.
added test as well