p2p: extend e2e tests for new p2p framework (#6323)

This commit is contained in:
Sam Kleinman
2021-04-08 11:09:21 -04:00
committed by GitHub
parent 0b770870c9
commit 0f41f7465c
13 changed files with 118 additions and 64 deletions
+14
View File
@@ -58,6 +58,13 @@ type Manifest struct {
// LogLevel sets the log level of the entire testnet. This can be overridden
// by individual nodes.
LogLevel string `toml:"log_level"`
// UseNewP2P enables use of the new p2p layer for all nodes in
// a test.
UseNewP2P bool `toml:"use_new_p2p"`
// QueueType describes the type of queue that the system uses internally
QueueType string `toml:"queue_type"`
}
// ManifestNode represents a node in a testnet manifest.
@@ -134,6 +141,13 @@ type ManifestNode struct {
// This is helpful when debugging a specific problem. This overrides the network
// level.
LogLevel string `toml:"log_level"`
// UseNewP2P enables use of the new p2p layer for this node.
UseNewP2P bool `toml:"use_new_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.
+4
View File
@@ -90,6 +90,8 @@ type Node struct {
PersistentPeers []*Node
Perturbations []Perturbation
LogLevel string
UseNewP2P bool
QueueType string
}
// LoadTestnet loads a testnet from a manifest file, using the filename to
@@ -167,6 +169,8 @@ func LoadTestnet(file string) (*Testnet, error) {
RetainBlocks: nodeManifest.RetainBlocks,
Perturbations: []Perturbation{},
LogLevel: manifest.LogLevel,
UseNewP2P: manifest.UseNewP2P,
QueueType: manifest.QueueType,
}
if node.StartAt == testnet.InitialHeight {
node.StartAt = 0 // normalize to 0 for initial nodes, since code expects this