Skip to content

Refactor BLS12_381 conformance tests to remove literal curve points - #7837

Merged
kwxm merged 2 commits into
masterfrom
kwxm/conformance/rewrite-bls-constants
Jul 10, 2026
Merged

Refactor BLS12_381 conformance tests to remove literal curve points#7837
kwxm merged 2 commits into
masterfrom
kwxm/conformance/rewrite-bls-constants

Conversation

@kwxm

@kwxm kwxm commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

We provide literal syntax for BLS12_381 constants in the textual format, but don't permit such constants in flat-encoded files because deserialisation is quite CPU-intensive. Instead, if you want to use a constant of this type you have to deserialise it from a bytestring during script execution using an appropriate uncompress function so that the user pays for deserialisation cost from the script budget. Using the textual format made it easy to write conformance tests, but tests using that feature couldn't be converted to flat, making it difficult for external users to use the tests. This PR updates most of the conformance tests to perform explicit deserialisation (in preparation for adding flat files to the repository). I haven't altered the tests in the constant directory because they're really tests of the parser, and in hindsight maybe shouldn't be included in the conformance tests; maybe we should move them elsewhere at some point.

@kwxm
kwxm requested a review from a team July 10, 2026 10:52
@kwxm

kwxm commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Hold on: I missed some files.

Fixed now.

@Unisay Unisay 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.

Uniform, correct refactor. LGTM.

@kwxm
kwxm merged commit 77f2000 into master Jul 10, 2026
10 checks passed
@kwxm
kwxm deleted the kwxm/conformance/rewrite-bls-constants branch July 10, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Crypto No Changelog Required Add this to skip the Changelog Check Test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants