Browse Source

e2e: abci protocol should be consistent across networks (#7078) (#7086)

It seems weird in retrospect that we allow networks to contain
applications that use different ABCI protocols.

(cherry picked from commit f2a8f5e054)

Co-authored-by: Sam Kleinman <garen@tychoish.com>
pull/7097/head
mergify[bot] 3 years ago
committed by GitHub
parent
commit
af85f7e917
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 12 deletions
  1. +1
    -2
      test/e2e/generator/generate.go
  2. +6
    -6
      test/e2e/pkg/manifest.go
  3. +6
    -4
      test/e2e/pkg/testnet.go

+ 1
- 2
test/e2e/generator/generate.go View File

@ -134,6 +134,7 @@ const (
func generateTestnet(r *rand.Rand, opt map[string]interface{}) (e2e.Manifest, error) {
manifest := e2e.Manifest{
IPv6: ipv6.Choose(r).(bool),
ABCIProtocol: nodeABCIProtocols.Choose(r),
InitialHeight: int64(opt["initialHeight"].(int)),
InitialState: opt["initialState"].(map[string]string),
Validators: &map[string]int64{},
@ -365,7 +366,6 @@ func generateNode(
Mode: string(mode),
StartAt: startAt,
Database: nodeDatabases.Choose(r),
ABCIProtocol: nodeABCIProtocols.Choose(r),
PrivvalProtocol: nodePrivvalProtocols.Choose(r),
BlockSync: nodeBlockSyncs.Choose(r).(string),
Mempool: nodeMempools.Choose(r).(string),
@ -427,7 +427,6 @@ func generateLightNode(r *rand.Rand, startAt int64, providers []string) *e2e.Man
Mode: string(e2e.ModeLight),
StartAt: startAt,
Database: nodeDatabases.Choose(r),
ABCIProtocol: "builtin",
PersistInterval: ptrUint64(0),
PersistentPeers: providers,
}


+ 6
- 6
test/e2e/pkg/manifest.go View File

@ -65,6 +65,12 @@ type Manifest struct {
// Number of bytes per tx. Default is 1kb (1024)
TxSize int64
// ABCIProtocol specifies the protocol used to communicate with the ABCI
// application: "unix", "tcp", "grpc", or "builtin". Defaults to builtin.
// builtin will build a complete Tendermint node into the application and
// launch it instead of launching a separate Tendermint process.
ABCIProtocol string `toml:"abci_protocol"`
}
// ManifestNode represents a node in a testnet manifest.
@ -87,12 +93,6 @@ type ManifestNode struct {
// "rocksdb", "boltdb", or "badgerdb". Defaults to goleveldb.
Database string `toml:"database"`
// ABCIProtocol specifies the protocol used to communicate with the ABCI
// application: "unix", "tcp", "grpc", or "builtin". Defaults to unix.
// builtin will build a complete Tendermint node into the application and
// launch it instead of launching a separate Tendermint process.
ABCIProtocol string `toml:"abci_protocol"`
// PrivvalProtocol specifies the protocol used to sign consensus messages:
// "file", "unix", "tcp", or "grpc". Defaults to "file". For tcp and unix, the ABCI
// application will launch a remote signer client in a separate goroutine.


+ 6
- 4
test/e2e/pkg/testnet.go View File

@ -71,6 +71,7 @@ type Testnet struct {
Evidence int
LogLevel string
TxSize int64
ABCIProtocol string
}
// Node represents a Tendermint node in a testnet.
@ -141,6 +142,7 @@ func LoadTestnet(file string) (*Testnet, error) {
KeyType: "ed25519",
LogLevel: manifest.LogLevel,
TxSize: manifest.TxSize,
ABCIProtocol: manifest.ABCIProtocol,
}
if len(manifest.KeyType) != 0 {
testnet.KeyType = manifest.KeyType
@ -151,6 +153,9 @@ func LoadTestnet(file string) (*Testnet, error) {
if manifest.InitialHeight > 0 {
testnet.InitialHeight = manifest.InitialHeight
}
if testnet.ABCIProtocol == "" {
testnet.ABCIProtocol = string(ProtocolBuiltin)
}
// Set up nodes, in alphabetical order (IPs and ports get same order).
nodeNames := []string{}
@ -170,7 +175,7 @@ func LoadTestnet(file string) (*Testnet, error) {
ProxyPort: proxyPortGen.Next(),
Mode: ModeValidator,
Database: "goleveldb",
ABCIProtocol: ProtocolBuiltin,
ABCIProtocol: Protocol(testnet.ABCIProtocol),
PrivvalProtocol: ProtocolFile,
StartAt: nodeManifest.StartAt,
BlockSync: nodeManifest.BlockSync,
@ -194,9 +199,6 @@ func LoadTestnet(file string) (*Testnet, error) {
if nodeManifest.Database != "" {
node.Database = nodeManifest.Database
}
if nodeManifest.ABCIProtocol != "" {
node.ABCIProtocol = Protocol(nodeManifest.ABCIProtocol)
}
if nodeManifest.PrivvalProtocol != "" {
node.PrivvalProtocol = Protocol(nodeManifest.PrivvalProtocol)
}


Loading…
Cancel
Save