Skip to content

Simplex QuorumCertificate and BLS aggregator #4091

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

Merged
merged 27 commits into from
Jul 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions simplex/bls.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/ava-labs/simplex"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils"
"github.com/ava-labs/avalanchego/utils/crypto/bls"
)

Expand Down Expand Up @@ -37,6 +38,9 @@ type BLSVerifier struct {
nodeID2PK map[ids.NodeID]*bls.PublicKey
networkID uint32
chainID ids.ID

canonicalNodeIDs []ids.NodeID
canonicalNodeIDIndices map[ids.NodeID]int
}

func NewBLSAuth(config *Config) (BLSSigner, BLSVerifier) {
Expand Down Expand Up @@ -116,8 +120,17 @@ func createVerifier(config *Config) BLSVerifier {
chainID: config.Ctx.ChainID,
}

nodeIDs := make([]ids.NodeID, 0, len(config.Validators))
for _, node := range config.Validators {
verifier.nodeID2PK[node.NodeID] = node.PublicKey
nodeIDs = append(nodeIDs, node.NodeID)
}

utils.Sort(nodeIDs)
verifier.canonicalNodeIDs = nodeIDs
verifier.canonicalNodeIDIndices = make(map[ids.NodeID]int, len(nodeIDs))
for i, nodeID := range nodeIDs {
verifier.canonicalNodeIDIndices[nodeID] = i
}

return verifier
Expand Down
220 changes: 220 additions & 0 deletions simplex/qc.canoto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading