Skip to content

Simplex QuorumCertificate and BLS aggregator #4004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Conversation

samliok
Copy link
Contributor

@samliok samliok commented Jun 9, 2025

Why this should be merged

Implements the simplex QuorumCertificate, QCDeserializer and SignatureAggregator interfaces. This allows simplex to parse, aggregate and verify quorum certificates(ex. finalizations and notarizations) during execution.

How this works

  • Builds on top of the BLSVerifier to handle BLS signatures and public keys.
  • The bytes of a QC are serialized with asn1

How this was tested

Added unit tests to bls_test.go.

Need to be documented in RELEASES.md?

no

@Copilot Copilot AI review requested due to automatic review settings June 9, 2025 19:41
@samliok samliok requested a review from StephenButtolph as a code owner June 9, 2025 19:41
@samliok samliok self-assigned this Jun 9, 2025
@samliok samliok marked this pull request as draft June 9, 2025 19:41
@samliok samliok changed the base branch from master to simplex-bls June 9, 2025 19:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Implements BLS-based quorum certificates and aggregation for the Simplex consensus engine, along with test utilities and configuration.

  • Adds testValidatorInfo and newEngineConfig in simplex/test_util.go to bootstrap BLS-based engine tests.
  • Introduces QC, QCDeserializer, and SignatureAggregator in simplex/quorum.go for creating, serializing, verifying, and aggregating quorum certificates.
  • Implements BLS signing/verifying in simplex/bls.go and corresponding unit tests in simplex/bls_test.go.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
simplex/test_util.go Mock ValidatorInfo and newEngineConfig helper for tests
simplex/quorum.go QC implementation, bytes/deserialize logic, and signature aggregator
simplex/config.go Defines Config and SimplexChainContext
simplex/bls.go BLSSigner/BLSVerifier and message encoding for BLS auth
simplex/bls_test.go Unit tests for signing, verification, and QC aggregation
go.mod Adds github.com/ava-labs/simplex dependency
Comments suppressed due to low confidence (4)

simplex/bls_test.go:97

  • This test is empty; implement the scenario for when a QC has a signer not in the membership set or remove the placeholder.
func TestQCSignerNotInMembershipSet(t *testing.T) {

simplex/bls_test.go:101

  • This test is empty; implement the scenario for when deserialization or verification is attempted on a certificate outside the membership set or remove the placeholder.
func TestQCNotInMembershipSet(t *testing.T) {

simplex/bls.go:75

  • The comment refers to networkID and a length prefix that don't match the ASN.1 encoding of encodedSimplexSignedPayload. Update the docstring to reflect the actual fields and format produced by asn1.Marshal.
// encodesMessageToSign returns a byte slice [simplexLabel][chainID][networkID][message length][message].

simplex/quorum.go:90

  • Iterating with for range quorumSize over an integer is invalid. Use a standard index loop: for i := 0; i < int(quorumSize); i++ {.
for range quorumSize {

@samliok samliok marked this pull request as ready for review June 10, 2025 16:07
@@ -0,0 +1,92 @@
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

can we try renaming via git mv ?

Copy link
Contributor

@yacovm yacovm left a comment

Choose a reason for hiding this comment

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

generally LGTM, but can we use git mv ?

@samliok samliok moved this to In Progress 🏗️ in avalanchego Jun 16, 2025
Base automatically changed from simplex-bls to master June 17, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress 🏗️
Development

Successfully merging this pull request may close these issues.

2 participants