Merged
Conversation
Pull Request Test Coverage Report for Build 22763067844Details
💛 - Coveralls |
43f6d00 to
b598207
Compare
richardkiss
added a commit
that referenced
this pull request
Mar 6, 2026
Add process-global validation cache for G1/G2 point validation in strict negate operations. This approach has several advantages over deferred validation: - No changes to Allocator (no new fields, no checkpoint interaction) - No changes to run_program (no deferred validation at end-of-run) - Fails fast: invalid point returns immediate error - Cache persists across transactions and blocks - Thread-safe using RwLock with read-path for cached lookups - Exploits BLS12-381 property: negation flips bit 5, so -p has same validity as p, allowing us to cache both with one validation The cache is explicitly temporary until HF3 fixes the cost model. Alternative to #731 for mitigating g1/g2_negate_strict DoS attack. Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
richardkiss
reviewed
Mar 6, 2026
richardkiss
reviewed
Mar 6, 2026
richardkiss
approved these changes
Mar 6, 2026
auto-merge was automatically disabled
March 6, 2026 12:16
Pull request was closed
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.
Note
Medium Risk
Touches consensus-critical BLS op argument validation and introduces new allocator-side caching that could affect error behavior and memory usage if not cleared on all exit paths.
Overview
Optimizes strict BLS negation ops by caching successful
G1Element::from_bytes/G2Element::from_bytesvalidations inAllocator(keyed by raw point bytes) and reusing that cache inop_bls_g1_negate_strictandop_bls_g2_negate_strict.Adds
Allocator::validate_g1,validate_g2, andclear_validation_caches, and clears these caches afterrun_programfinishes to avoid carrying validation state across program executions.Written by Cursor Bugbot for commit bb93035. This will update automatically on new commits. Configure here.