mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-26 09:54:19 +00:00
e2e: add evidence generation and testing (#6276)
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"text/template"
|
||||
"time"
|
||||
@@ -132,28 +131,6 @@ func Setup(testnet *e2e.Testnet) error {
|
||||
func MakeDockerCompose(testnet *e2e.Testnet) ([]byte, error) {
|
||||
// Must use version 2 Docker Compose format, to support IPv6.
|
||||
tmpl, err := template.New("docker-compose").Funcs(template.FuncMap{
|
||||
"startCommands": func(misbehaviors map[int64]string, logLevel string) string {
|
||||
command := "start"
|
||||
|
||||
// FIXME: Temporarily disable behaviors until maverick is redesigned
|
||||
// misbehaviorString := ""
|
||||
// for height, misbehavior := range misbehaviors {
|
||||
// // after the first behavior set, a comma must be prepended
|
||||
// if misbehaviorString != "" {
|
||||
// misbehaviorString += ","
|
||||
// }
|
||||
// heightString := strconv.Itoa(int(height))
|
||||
// misbehaviorString += misbehavior + "," + heightString
|
||||
// }
|
||||
|
||||
// if misbehaviorString != "" {
|
||||
// command += " --misbehaviors " + misbehaviorString
|
||||
// }
|
||||
if logLevel != "" && logLevel != config.DefaultLogLevel {
|
||||
command += " --log-level " + logLevel
|
||||
}
|
||||
return command
|
||||
},
|
||||
"addUint32": func(x, y uint32) uint32 {
|
||||
return x + y
|
||||
},
|
||||
@@ -181,8 +158,8 @@ services:
|
||||
image: tendermint/e2e-node
|
||||
{{- if eq .ABCIProtocol "builtin" }}
|
||||
entrypoint: /usr/bin/entrypoint-builtin
|
||||
{{- else }}
|
||||
command: {{ startCommands .Misbehaviors .LogLevel }}
|
||||
{{- else if .LogLevel }}
|
||||
command: start --log-level {{ .LogLevel }}
|
||||
{{- end }}
|
||||
init: true
|
||||
ports:
|
||||
@@ -223,6 +200,8 @@ func MakeGenesis(testnet *e2e.Testnet) (types.GenesisDoc, error) {
|
||||
default:
|
||||
return genesis, errors.New("unsupported KeyType")
|
||||
}
|
||||
genesis.ConsensusParams.Evidence.MaxAgeNumBlocks = e2e.EvidenceAgeHeight
|
||||
genesis.ConsensusParams.Evidence.MaxAgeDuration = e2e.EvidenceAgeTime
|
||||
for validator, power := range testnet.Validators {
|
||||
genesis.Validators = append(genesis.Validators, types.GenesisValidator{
|
||||
Name: validator.Name,
|
||||
@@ -403,12 +382,6 @@ func MakeAppConfig(node *e2e.Node) ([]byte, error) {
|
||||
}
|
||||
}
|
||||
|
||||
misbehaviors := make(map[string]string)
|
||||
for height, misbehavior := range node.Misbehaviors {
|
||||
misbehaviors[strconv.Itoa(int(height))] = misbehavior
|
||||
}
|
||||
cfg["misbehaviors"] = misbehaviors
|
||||
|
||||
if len(node.Testnet.ValidatorUpdates) > 0 {
|
||||
validatorUpdates := map[string]map[string]int64{}
|
||||
for height, validators := range node.Testnet.ValidatorUpdates {
|
||||
|
||||
Reference in New Issue
Block a user