mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-03 11:45:18 +00:00
privval: add chainID to requests (#5239)
## Description Add chainid to requests to privval. This is a non-breaking change and hardware devices can opt to ignore the field. Closes: #4503 Took the approach of passing chainID to the client instead of modifying `GetPubKey` because it would lead to a larger change throughout the codebase and in some places it could get tricky to get chainID.
This commit is contained in:
@@ -655,7 +655,7 @@ func NewNode(config *cfg.Config,
|
||||
// external signing process.
|
||||
if config.PrivValidatorListenAddr != "" {
|
||||
// FIXME: we should start services inside OnStart
|
||||
privValidator, err = createAndStartPrivValidatorSocketClient(config.PrivValidatorListenAddr, logger)
|
||||
privValidator, err = createAndStartPrivValidatorSocketClient(config.PrivValidatorListenAddr, genDoc.ChainID, logger)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error with private validator socket client: %w", err)
|
||||
}
|
||||
@@ -1312,7 +1312,8 @@ func saveGenesisDoc(db dbm.DB, genDoc *types.GenesisDoc) error {
|
||||
}
|
||||
|
||||
func createAndStartPrivValidatorSocketClient(
|
||||
listenAddr string,
|
||||
listenAddr,
|
||||
chainID string,
|
||||
logger log.Logger,
|
||||
) (types.PrivValidator, error) {
|
||||
pve, err := privval.NewSignerListener(listenAddr, logger)
|
||||
@@ -1320,7 +1321,7 @@ func createAndStartPrivValidatorSocketClient(
|
||||
return nil, fmt.Errorf("failed to start private validator: %w", err)
|
||||
}
|
||||
|
||||
pvsc, err := privval.NewSignerClient(pve)
|
||||
pvsc, err := privval.NewSignerClient(pve, chainID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to start private validator: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user