Skip to content

fix(light-clients/08-wasm): Replace OffchainLabs/prysm/v6 with supranational/blst - #9175

Open
dianab-cl wants to merge 7 commits into
lfdt-ibc:mainfrom
dianab-cl:diana/fou-2319-fix-licensing
Open

dianab-cl wants to merge 7 commits into
lfdt-ibc:mainfrom
dianab-cl:diana/fou-2319-fix-licensing

Conversation

@dianab-cl

Copy link
Copy Markdown
Contributor

Description

What does this change and why. Link the issue: fixes #

Checklist

  • One logical change, diff kept as small as practical
  • Commits signed off for the DCO (git commit -s), matching your commit author identity
  • AI assistance, if any, disclosed with a Co-Authored-By or Assisted-By trailer in the commit body
  • Commit messages follow Conventional Commits
  • Tests added or updated, covering expected and error paths
  • CI is green
  • SPDX license header on new files
  • Pull request title follows Conventional Commits (the changelog is generated from it)
  • ADR merged first if this changes architecture, a public interface, or a spec

Signed-off-by: Diana Borbe <diana@cosmoslabs.io>
@dianab-cl
dianab-cl requested a review from a team as a code owner November 17, 2026 16:04
@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; no new actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Replaces Prysm with blst for BLS key aggregation and signature checks.

  • The 08-wasm BLS verifier uses blst to aggregate keys and check signatures.
  • Channel and test code use simpler Go expressions.

Reviews (5) · Last reviewed commit: "After code review" · Reviewed by Greptile

Comment thread CHANGELOG.md Resolved
@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.55556% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...odules/light-clients/08-wasm/blsverifier/crypto.go 95.23% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Comment thread CHANGELOG.md Resolved
Signed-off-by: dianab-cl <diana@cosmoslabs.io>

var (
publicKeys = [][]byte{
mustDecodeHex("84fe268400062ae6255010a421204dad5b0a8bd93522a4abc023037fa7a769f6ef29acc14c7fae8c5c0cd1df21ae1f52"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

where do these vectors come from? If prysm or another independent implementation produced them, the success cases prove we match the old behavior; if the new code produced them, they only show it agrees with itself.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

// The success vectors were checked against two independent implementations:
// github.com/OffchainLabs/prysm/v6@v6.1.4 crypto/bls, which this package wrapped
// before, and github.com/consensys/gnark-crypto. Both produce aggregatedPublicKey
// from publicKeys and accept aggregatedSignature over message.

Signed-off-by: Diana Borbe <diana@cosmoslabs.io>
@dianab-cl

Copy link
Copy Markdown
Contributor Author

@greptile review

Comment thread CHANGELOG.md Resolved
@dianab-cl dianab-cl changed the title fix: Replace OffchainLabs/prysm/v6 with supranational/blst fix(light-clients/08-wasm): Replace OffchainLabs/prysm/v6 with supranational/blst Nov 18, 2026
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: dianab-cl <diana@cosmoslabs.io>
@dianab-cl

Copy link
Copy Markdown
Contributor Author

@greptile review

gjermundgaraba
gjermundgaraba previously approved these changes Nov 18, 2026
Signed-off-by: Diana Borbe <diana@cosmoslabs.io>
Signed-off-by: Diana Borbe <diana@cosmoslabs.io>
@dianab-cl

Copy link
Copy Markdown
Contributor Author

@greptile review

@gjermundgaraba gjermundgaraba left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One performance regression when validator keys are reused; details inline.

if len(bz) != blst.BLST_P1_COMPRESS_BYTES {
return nil, fmt.Errorf("public key must be %d bytes", blst.BLST_P1_COMPRESS_BYTES)
}
pk := new(blst.P1Affine).Uncompress(bz)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Preserve caching of validated public keys

Successive light-client updates commonly reuse validator keys. Prysm cached validated points, but this loop repeats decompression and subgroup validation on every query. The review benchmark reports 100 recurring keys increasing from ~0.086 ms to ~3.32 ms per aggregation (39× slower). Please preserve reuse through a bounded, concurrency-safe cache populated only after successful validation, and add a repeated-key benchmark.

Signed-off-by: Diana Borbe <diana@cosmoslabs.io>
@dianab-cl

Copy link
Copy Markdown
Contributor Author

@greptile review

This branch has not been deployed

No deployments
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.

3 participants