-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cherrypick e2e changes regarding maverick from tm master #295
Changes from all commits
08b2961
e47705f
2563013
ff85aec
ee37afd
6628237
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ import ( | |
"fmt" | ||
"os" | ||
"path/filepath" | ||
"strconv" | ||
"time" | ||
|
||
"github.com/spf13/viper" | ||
|
@@ -19,8 +18,6 @@ import ( | |
"github.com/lazyledger/lazyledger-core/p2p" | ||
"github.com/lazyledger/lazyledger-core/privval" | ||
"github.com/lazyledger/lazyledger-core/proxy" | ||
mcs "github.com/lazyledger/lazyledger-core/test/maverick/consensus" | ||
maverick "github.com/lazyledger/lazyledger-core/test/maverick/node" | ||
) | ||
|
||
var logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout)) | ||
|
@@ -62,11 +59,12 @@ func run(configFile string) error { | |
// Start app server. | ||
switch cfg.Protocol { | ||
case "builtin": | ||
if len(cfg.Misbehaviors) == 0 { | ||
err = startNode(cfg) | ||
} else { | ||
err = startMaverick(cfg) | ||
} | ||
// FIXME: Temporarily remove maverick until it is redesigned | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I see
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the tm team plan to redesign maverick or we? IMO: good redesign would require consensus redesign in a more modular way. Copying code is nah There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it redesigned it already as far as I undertand. It's now part of the other e2e tests (at least the most relevant parts). |
||
// if len(cfg.Misbehaviors) == 0 { | ||
err = startNode(cfg) | ||
// } else { | ||
// err = startMaverick(cfg) | ||
// } | ||
default: | ||
err = fmt.Errorf("invalid protocol %q", cfg.Protocol) | ||
} | ||
|
@@ -114,41 +112,42 @@ func startNode(cfg *Config) error { | |
return n.Start() | ||
} | ||
|
||
// FIXME: Temporarily disconnected maverick until it is redesigned | ||
// startMaverick starts a Maverick node that runs the application directly. It assumes the Tendermint | ||
// configuration is in $TMHOME/config/tendermint.toml. | ||
func startMaverick(cfg *Config) error { | ||
app, err := NewApplication(cfg) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
tmcfg, logger, nodeKey, err := setupNode() | ||
if err != nil { | ||
return fmt.Errorf("failed to setup config: %w", err) | ||
} | ||
|
||
misbehaviors := make(map[int64]mcs.Misbehavior, len(cfg.Misbehaviors)) | ||
for heightString, misbehaviorString := range cfg.Misbehaviors { | ||
height, _ := strconv.ParseInt(heightString, 10, 64) | ||
misbehaviors[height] = mcs.MisbehaviorList[misbehaviorString] | ||
} | ||
|
||
n, err := maverick.NewNode(tmcfg, | ||
maverick.LoadOrGenFilePV(tmcfg.PrivValidatorKeyFile(), tmcfg.PrivValidatorStateFile()), | ||
*nodeKey, | ||
proxy.NewLocalClientCreator(app), | ||
maverick.DefaultGenesisDocProviderFunc(tmcfg), | ||
maverick.DefaultDBProvider, | ||
maverick.DefaultMetricsProvider(tmcfg.Instrumentation), | ||
logger, | ||
misbehaviors, | ||
) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return n.Start() | ||
} | ||
// func startMaverick(cfg *Config) error { | ||
// app, err := NewApplication(cfg) | ||
// if err != nil { | ||
// return err | ||
// } | ||
|
||
// tmcfg, logger, nodeKey, err := setupNode() | ||
// if err != nil { | ||
// return fmt.Errorf("failed to setup config: %w", err) | ||
// } | ||
|
||
// misbehaviors := make(map[int64]mcs.Misbehavior, len(cfg.Misbehaviors)) | ||
// for heightString, misbehaviorString := range cfg.Misbehaviors { | ||
// height, _ := strconv.ParseInt(heightString, 10, 64) | ||
// misbehaviors[height] = mcs.MisbehaviorList[misbehaviorString] | ||
// } | ||
|
||
// n, err := maverick.NewNode(tmcfg, | ||
// maverick.LoadOrGenFilePV(tmcfg.PrivValidatorKeyFile(), tmcfg.PrivValidatorStateFile()), | ||
// *nodeKey, | ||
// proxy.NewLocalClientCreator(app), | ||
// maverick.DefaultGenesisDocProviderFunc(tmcfg), | ||
// maverick.DefaultDBProvider, | ||
// maverick.DefaultMetricsProvider(tmcfg.Instrumentation), | ||
// logger, | ||
// misbehaviors, | ||
// ) | ||
// if err != nil { | ||
// return err | ||
// } | ||
|
||
// return n.Start() | ||
// } | ||
|
||
// startSigner starts a signer server connecting to the given endpoint. | ||
func startSigner(cfg *Config) error { | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this related to the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but otherwise: