e2e: allow variable tx size (#6659)

This commit is contained in:
Callum Waters
2021-07-07 12:59:27 +02:00
committed by GitHub
parent e850863296
commit 800cce80b7
4 changed files with 21 additions and 12 deletions
+3 -4
View File
@@ -64,6 +64,9 @@ type Manifest struct {
// QueueType describes the type of queue that the system uses internally
QueueType string `toml:"queue_type"`
// Number of bytes per tx. Default is 1kb (1024)
TxSize int64
}
// ManifestNode represents a node in a testnet manifest.
@@ -143,10 +146,6 @@ type ManifestNode struct {
// UseNewP2P enables use of the new p2p layer for this node.
DisableLegacyP2P bool `toml:"disable_legacy_p2p"`
// QueueType describes the type of queue that the p2p layer
// uses internally.
QueueType string `toml:"queue_type"`
}
// Save saves the testnet manifest to a file.
+11 -1
View File
@@ -66,6 +66,7 @@ type Testnet struct {
KeyType string
Evidence int
LogLevel string
TxSize int64
}
// Node represents a Tendermint node in a testnet.
@@ -133,10 +134,14 @@ func LoadTestnet(file string) (*Testnet, error) {
Evidence: manifest.Evidence,
KeyType: "ed25519",
LogLevel: manifest.LogLevel,
TxSize: manifest.TxSize,
}
if len(manifest.KeyType) != 0 {
testnet.KeyType = manifest.KeyType
}
if testnet.TxSize <= 0 {
testnet.TxSize = 1024
}
if manifest.InitialHeight > 0 {
testnet.InitialHeight = manifest.InitialHeight
}
@@ -169,8 +174,8 @@ func LoadTestnet(file string) (*Testnet, error) {
RetainBlocks: nodeManifest.RetainBlocks,
Perturbations: []Perturbation{},
LogLevel: manifest.LogLevel,
DisableLegacyP2P: manifest.DisableLegacyP2P,
QueueType: manifest.QueueType,
DisableLegacyP2P: manifest.DisableLegacyP2P || nodeManifest.DisableLegacyP2P,
}
if node.StartAt == testnet.InitialHeight {
@@ -320,6 +325,11 @@ func (n Node) Validate(testnet Testnet) error {
default:
return fmt.Errorf("invalid fast sync setting %q", n.FastSync)
}
switch n.QueueType {
case "", "priority", "wdrr", "fifo":
default:
return fmt.Errorf("unsupported p2p queue type: %s", n.QueueType)
}
switch n.Database {
case "goleveldb", "cleveldb", "boltdb", "rocksdb", "badgerdb":
default: