diff --git a/tools/tm-bench/main.go b/tools/tm-bench/main.go index a8ede4a0..a418e036 100644 --- a/tools/tm-bench/main.go +++ b/tools/tm-bench/main.go @@ -25,7 +25,7 @@ func main() { flagSet.IntVar(&connections, "c", 1, "Connections to keep open per endpoint") flagSet.IntVar(&durationInt, "T", 10, "Exit after the specified amount of time in seconds") flagSet.IntVar(&txsRate, "r", 1000, "Txs per second to send in a connection") - flagSet.IntVar(&txSize, "s", 250, "The size of a transaction in bytes.") + flagSet.IntVar(&txSize, "s", 250, "The size of a transaction in bytes, must be greater than or equal to 40.") flagSet.StringVar(&outputFormat, "output-format", "plain", "Output format: plain or json") flagSet.StringVar(&broadcastTxMethod, "broadcast-tx-method", "async", "Broadcast method: async (no guarantees; fastest), sync (ensures tx is checked) or commit (ensures tx is checked and committed; slowest)") flagSet.BoolVar(&verbose, "v", false, "Verbose output") @@ -68,6 +68,14 @@ Examples: fmt.Printf("Running %ds test @ %s\n", durationInt, flagSet.Arg(0)) } + if txSize < 40 { + fmt.Fprintln( + os.Stderr, + "The size of a transaction must be greater than or equal to 40.", + ) + os.Exit(1) + } + if broadcastTxMethod != "async" && broadcastTxMethod != "sync" && broadcastTxMethod != "commit" { diff --git a/tools/tm-bench/transacter_test.go b/tools/tm-bench/transacter_test.go index 086a43c3..03f30460 100644 --- a/tools/tm-bench/transacter_test.go +++ b/tools/tm-bench/transacter_test.go @@ -22,7 +22,7 @@ func TestGenerateTxUpdateTxConsistentency(t *testing.T) { hostname string numTxsToTest int }{ - {0, 0, 50, "localhost:26657", 1000}, + {0, 0, 40, "localhost:26657", 1000}, {70, 300, 10000, "localhost:26657", 1000}, {0, 50, 100000, "localhost:26657", 1000}, }