Err="proto: wrong wireType = 2 for field Power"

I keep getting this error when returning an ResponseEndBlock message. I am using the JS abci binding, and my code returns the following:

let validatorUpdates = []
let pubKeyStr = "riisnlb8fTGY10F3Ta4y3feXVUTQin0kh98ByLmXaoI"
    pubKey: { type: 'ed25519', data: Buffer.from(pubKeyStr, 'base64') },
    power: 10
return {

The proto description for the validator object is like so:

message Validator {
  bytes address = 1;
  //PubKey pub_key = 2 [(gogoproto.nullable)=false];
  int64 power = 3;

Can anyone suggest what the problem might be? Thanks.

What version of Tendermint are you on?

It looks like you need to reference the validator by address and not public key.

Thanks for your comment! I have pasted a wrong message format, my bad. Theere has been some change in the proto format recently. The object which should be returned now is actually:

// ValidatorUpdate
message ValidatorUpdate {
  PubKey pub_key = 1 [(gogoproto.nullable)=false];
  int64 power = 2;

I have pasted the wrong message, sorry. ResponseEndBlock is described like so:

message ResponseEndBlock {
  repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable)=false];
  ConsensusParams consensus_param_updates = 2;
  repeated common.KVPair tags = 3 [(gogoproto.nullable)=false, (gogoproto.jsontag)="tags,omitempty"];

So I think I should still be returning a PubKey.

I managed to solved my problem which was due to old version of the abci js package which I have installed through NPM. The older package was using a different proto format which did not match my recent tendermint node version.

1 Like

Glad you were able to get this fixed @YPavlov!