simplify forks by passing along ClvmFlags into the operator functions#741
Open
simplify forks by passing along ClvmFlags into the operator functions#741
Conversation
Contributor
Author
|
@cursor review |
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.
| ClvmFlags::empty(), | ||
| ClvmFlags::DISABLE_OP, | ||
| ClvmFlags::MALACHITE, | ||
| ]; |
There was a problem hiding this comment.
Fuzz target never exercises relaxed BLS code path
Medium Severity
The FLAGS array omits ClvmFlags::RELAXED_BLS, meaning the fuzzer never tests the non-strict BLS negate code path. Previously, both op_bls_g1_negate (non-strict) and op_bls_g1_negate_strict were in the FUNS array, ensuring both paths were fuzzed. Now only op_bls_g1_negate remains, and its strict behavior is controlled by RELAXED_BLS in the flags — but that flag is absent from FLAGS, so only the strict path is ever exercised.
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.


This makes it a lot simpler and more straight forward to implement soft forks (and the upcoming hard fork) per operators.
Note
Medium Risk
Touches the core operator dispatch path and changes every operator’s function signature, so any missed callsite or subtle flag-handling difference could alter consensus/mempool behavior. Logic changes are mostly mechanical but include behavior selection for MALACHITE and relaxed BLS validation.
Overview
Refactors the CLVM operator ABI so all native ops take
ClvmFlags(fn(..., max_cost, flags) -> Response), and updates dispatch (ChiaDialect,RuntimeDialect,f_table) plus fuzzers/tests to pass flags through.Simplifies fork/variant handling by moving it inside ops:
op_div/op_divmod/op_mod/op_modpownow branch onClvmFlags::MALACHITE, large-operand limits useClvmFlags::DISABLE_OP, and BLSg1/g2_negatestrict vs relaxed behavior is controlled viaClvmFlags::RELAXED_BLS(removing separate*_strictentrypoints).Written by Cursor Bugbot for commit 6e0b86f. This will update automatically on new commits. Configure here.