You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to decode (in tendermint-rs) a proto encoded ValidatorSet (encoded in tendermint) you get the following error:
StringTracer: error converting message type into domain type: StringTracer: mismatch between raw voting (Power(0)) and computed one (Power(10))
I believe that the problem is strictly encoding in tendermint -> decoding in tendermint-rs. The opposite path should work if I understand correctly.
This issue originates from a difference in behavior in encoding/decoding between tendermint and tendermint-rs.
Specifically here you can notice that ValidatorSet.ToProto() will always result in ValidatorSet.TotalVotingPower = 0 (changed in this PR).
However, in tendermint-rs, you require (here) for the raw voting power to match the computed one.
You can also see that in tendermint this is not getting checked in decoding here. vals.TotalVotingPower() recalculates the voting power based on the validator set, and ignores the received raw one.
The encoding/decoding in tendermint and tendermint-rs should match.
I guess the easy way would be to remove the said assertion in ValidatorSet's try_from() (Set::new() recalculates total_voting_power anyway), But I'm not sure if this is the desired behavior.
The text was updated successfully, but these errors were encountered:
HI 👋🏼
What went wrong?
When trying to decode (in tendermint-rs) a proto encoded ValidatorSet (encoded in tendermint) you get the following error:
I believe that the problem is strictly
encoding in tendermint -> decoding in tendermint-rs
. The opposite path should work if I understand correctly.This issue originates from a difference in behavior in encoding/decoding between tendermint and tendermint-rs.
Specifically here you can notice that
ValidatorSet.ToProto()
will always result inValidatorSet.TotalVotingPower = 0
(changed in this PR).However, in tendermint-rs, you require (here) for the raw voting power to match the computed one.
You can also see that in tendermint this is not getting checked in decoding here.
vals.TotalVotingPower()
recalculates the voting power based on the validator set, and ignores the received raw one.Steps to reproduce
In
tendermint
:<--- ffi magic (or copy-paste raw bytes 🙃) --->
Then in
tendermint-rs
:Definition of "done"
The encoding/decoding in
tendermint
andtendermint-rs
should match.I guess the easy way would be to remove the said assertion in ValidatorSet's
try_from()
(Set::new()
recalculatestotal_voting_power
anyway), But I'm not sure if this is the desired behavior.The text was updated successfully, but these errors were encountered: