Skip to content

Implement config flag for different PrivVal implementations #2827

@hendrikhofstadt

Description

@hendrikhofstadt

Since the implementation of IPCVal we have 3 different implementations of PrivVal.

For TCPVal we have a config flag that overrides the privValidator that is passed to the node constructor:

tendermint/node/node.go

Lines 224 to 241 in 80d0a36

if config.PrivValidatorListenAddr != "" {
var (
// TODO: persist this key so external signer
// can actually authenticate us
privKey = ed25519.GenPrivKey()
pvsc = privval.NewTCPVal(
logger.With("module", "privval"),
config.PrivValidatorListenAddr,
privKey,
)
)
if err := pvsc.Start(); err != nil {
return nil, fmt.Errorf("Error starting private validator client: %v", err)
}
privValidator = pvsc
}

On the one hand this might cause confusions for people implementing an App on Tendermint as you would not expect that the privValidator you are passing could be overwritten and on the other hand this implementation makes it harder or at least ugly to implement the third (IPCVal) and potentially even more implementations.

The questions are:

  • Do we want to leave the choice of the PrivVal implementation to the App built on tendermint and use the passed PV ?
  • If not how can we beautifully implement the third interface IPCVal ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions