Parse raw QC when receiving messages#405
Closed
yacovm wants to merge 1 commit into
Closed
Conversation
QuorumCertificates were carried around the network already parsed, which
forced parsing to happen before a message reached the epoch.
Since a QC has an ability to verify its own signature, it implicitly means that a QC
implementation needs knowledge of the public keys for the epoch the QC was created for.
To that end, we introduce a new type - RawQuorumCertificate,
and corresponding types for message handling (RawNotarization, RawEmptyNotarization, RawNotarization, RawQuorumRound).
Message and ReplicationResponse now carry these on the wire, while Raw() helpers convert verified types to raw when sending/broadcasting
Parsing now happens on the receive path:
- QCDeserializer gains ParseQuorumCertificate(RawQuorumCertificate); a new
QCDeserializerCreator builds a deserializer per epoch from the node set
(Node now carries its PK)
- handleRaw{Notarization,EmptyNotarization,Finalization}Message parse the
raw QC into a verified QC before delegating to the existing handlers;
parse failures are logged and the message is dropped
- RawQuorumRound.ToQuorumRound parses rounds in replication responses
- Epoch holds a runtime qcDeserializer built via init()
This ensures that in order to verify a QC signature we need to know the node public keys that correspond to the QC.
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
QuorumCertificates were carried around the network already parsed, which forced parsing to happen before a message reached the epoch.
Since a QC has an ability to verify its own signature, it implicitly means that a QC implementation needs knowledge of the public keys for the epoch the QC was created for.
To that end, we introduce a new type - RawQuorumCertificate, and corresponding types for message handling (RawNotarization, RawEmptyNotarization, RawNotarization, RawQuorumRound).
Message and ReplicationResponse now carry these on the wire, while Raw() helpers convert verified types to raw when sending/broadcasting
Parsing now happens on the receive path:
This ensures that in order to verify a QC signature we need to know the node public keys that correspond to the QC.