Conversation
|
|
||
| if err := vote.Verify(signature.Value, e.Verifier, signature.Signer); err != nil { | ||
| pk, exists := e.nodesToPKs[string(signature.Signer)] | ||
| if !exists { |
There was a problem hiding this comment.
these checks should never happen right? we filter messages here and eligibleNodeIds should have the same exact key set as nodeToPks
_, known := e.eligibleNodeIDs[string(from)]There was a problem hiding this comment.
i think it would be better to combine these two maps(nodeToPks and eligibleNodeIds) into one? maybe eligibleSigners?
There was a problem hiding this comment.
these checks should never happen right? we filter messages here and eligibleNodeIds should have the same exact key set as nodeToPks
but this is not from, this is who signed the message. We bind the from and the signer everywhere except in the signer of a block message (VerifyBlockMessageVote).
Even if we add a check there, I think we should still do the lookup right before we verify the signature, otherwise the risk is just too great. I don't know how BLST will behave with an empty public key and I don't want to find out...
However, you are right that if we have the mapping, we don't need the eligible nodes anymore.
| } | ||
|
|
||
| // Guard against receiving messages from unknown nodes | ||
| _, known := e.eligibleNodeIDs[string(from)] |
There was a problem hiding this comment.
can we make this map named something like validatorsToPKs or signers? it would be helpful to note these as different than the non-validator nodes, especially since we will need to update this guard in a pr i'm working on.
5f4503b to
9c1968e
Compare
Since the epoch now has its own membership reference that includes public keys, it's easier to support epoch changes by altering the API accordingly. Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Since the epoch now has its own membership reference that includes public keys, it's easier to support epoch changes by altering the API accordingly.