Skip to content

Pass validator membership to QuorumCertificate.Verify()#407

Merged
yacovm merged 2 commits into
mainfrom
406
Jun 15, 2026
Merged

Pass validator membership to QuorumCertificate.Verify()#407
yacovm merged 2 commits into
mainfrom
406

Conversation

@yacovm

@yacovm yacovm commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

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.

Instead of wiring the public keys of the epoch to the QC, the QuorumCertificate.Verify() now receives the set of nodes so the verifier has access to validator membership (and their public keys) when checking a quorum certificate. The nodes argument is threaded through verifyContextQC, the Finalization/Notarization/EmptyNotarization Verify() methods, the verifiableMessage interface, and VerifyQC, with e.nodes supplied at every call site in epoch.go.

To support this, common.Node is reworked:

  • rename the Node.Node field to Node.Id to disambiguate it from the surrounding type
  • add a PK []byte field to carry each node's public key

Comment thread common/api.go Outdated
return nodes
}

// Node is a struct that pairs a node with its weight in the signature aggregator.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this common is out of date now

Comment thread simplex/util.go
}

func VerifyQC(qc common.QuorumCertificate, logger common.Logger, messageType string, isQuorum func(signers []common.NodeID) bool, eligibleSigners map[string]struct{}, messageToVerify verifiableMessage, from common.NodeID) error {
func VerifyQC(qc common.QuorumCertificate, logger common.Logger, messageType string, isQuorum func(signers []common.NodeID) bool, eligibleSigners map[string]struct{}, messageToVerify verifiableMessage, from common.NodeID, nodes common.Nodes) error {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe for a separate pr we can remove the params logger, messageType, and from for verifyQC? We still return an error, so we can just log it at the call site.

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.

Instead of wiring the public keys of the epoch to the QC, the QuorumCertificate.Verify() now receives the set of nodes so the verifier has access to validator membership (and their public keys) when checking a quorum certificate.
The nodes argument is threaded through verifyContextQC, the Finalization/Notarization/EmptyNotarization Verify() methods, the verifiableMessage interface, and VerifyQC, with
e.nodes supplied at every call site in epoch.go.

To support this, common.Node is reworked:
  - rename the Node.Node field to Node.Id to disambiguate it from the
      surrounding type
  - add a PK []byte field to carry each node's public key

Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
@yacovm yacovm merged commit 39962d5 into main Jun 15, 2026
6 checks passed
@yacovm yacovm deleted the 406 branch June 15, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants