problem: our validator node would start up with the correct identity, report in the logs it was a validator, but upon trying to submit a block for validation we get the error:
2024-06-17T18:37:27.856345127Z stdout F {"level":"error","module":"server","module":"baseapp","height":403750,"time":"2024-06-17T18:37:26Z","err":"expected signature length 96, got 64: signer returned an invalid signature","time":"2024-06-17T18:37:27Z","message":"failed to prepare proposal"}
Issues
1) the function ProvideBlsSigner has a hardcoded path to look for your private key at homeDir+"/config/priv_validator_key.json", overriding the value of config.toml:priv_validator_key_file
2) In the block signing code the functionNewBLSSigner uses the method privval.LoadOrGenFilePV(keyFilePath, stateFilePath). And since keyFilePath from issue 1 selects what can be a non-existant, hardcoded path, the method .LoadOrGenFilePVsilently creates a new private key at homeDir+"/config/priv_validator_key.json and attempts to sign blocks with that second private key. This conflicts with the validator identity beacond is setting via config.toml:priv_validator_key_file
Silently creating a second pair of private keys instead of just erroring out if no keys are found also seems like a somewhat dangerous choice for validator operation
Workaround
For anyone hitting this issue our ugly workaround is to run this command before node startup:
cp -a <config.toml:priv_validator_key_file> ${BEACOND_HOME}/config/priv_validator_key.json
problem: our validator node would start up with the correct identity, report in the logs it was a validator, but upon trying to submit a block for validation we get the error:
Issues
1) the function
ProvideBlsSigner
has a hardcoded path to look for your private key athomeDir+"/config/priv_validator_key.json"
, overriding the value ofconfig.toml:priv_validator_key_file
@po-bera actually flagged this as a problem on the initial PR review:
2) In the block signing code the function
NewBLSSigner
uses the methodprivval.LoadOrGenFilePV(keyFilePath, stateFilePath)
. And sincekeyFilePath
from issue 1 selects what can be a non-existant, hardcoded path, the method.LoadOrGenFilePV
silently creates a new private key athomeDir+"/config/priv_validator_key.json
and attempts to sign blocks with that second private key. This conflicts with the validator identitybeacond
is setting viaconfig.toml:priv_validator_key_file
Silently creating a second pair of private keys instead of just erroring out if no keys are found also seems like a somewhat dangerous choice for validator operation
Workaround
For anyone hitting this issue our ugly workaround is to run this command before node startup: