Closed n-hutton closed 4 months ago
The comment in the code claims that calling verify_messages(agg.signature, &messages, &public_keys)
as defined in
https://docs.rs/bls-signatures/latest/bls_signatures/fn.verify_messages.html
will not work, but unclear why.
@JamesHinshelwood can you have a quick look as agreed before we decide whether to work on it now or rather later?
I guess I spotted why it didn't work.
The signatures that are aggregated in an AggregateQC
were created as part of NewView
messages by signing a QC's hash, a view number and the signer's public key in
https://github.com/Zilliqa/zq2/blob/main/zilliqa/src/message.rs#L163-L166
However, the batch verification uses the signers' indices in the validator set as stored in the AggregateQC
and not their public keys. Thus, we try to verify the signatures against incorrect messages in
https://github.com/Zilliqa/zq2/blob/main/zilliqa/src/consensus.rs#L1794-L1798
Well spotted, thank you :)
The AggQC is not batch verified: https://github.com/Zilliqa/zq2/blob/main/zilliqa/src/consensus.rs#L1809