Closed sug0 closed 2 years ago
nice catch! I'm not sure if it's currently broken because we also give tendermint validator's address, which isn't derived from consensus key and it seems to be fine with it, but it's not following its convention, so I think it really should be changed to use the consensus key instead.
Let's check this with #14.
I believe the
PosBase
API is being misused in theShell
.This trait contains a method
read_validator_address_raw_hash
, which takes araw_hash
parameter of typeimpl AsRef<str>
(the Tendermint address of some validator), and returns theAddress
of the equivalent node on Anoma's side, from what I've gathered.ABCI++ hands us an
Evidence
struct for each Byzantine validator detected during a consensus round, which internally contains aValidator
struct reflecting theaddress
of the Byzantine node. Thisaddress
is the 20-byte prefix of the SHA256 hash of the public key of a Tendermint validator.When processing individual
Evidence
structs, we try to decode theaddress
handed us via ABCI++ as a UTF-8 string, which may not always succeed (since we are dealing with a raw hash). In case this operation fails, we skip Byzantine validators which would have otherwise been slashed.