Register GroupElement.expUnsigned in the method descriptor table#874
Open
mwaddip wants to merge 1 commit into
Open
Register GroupElement.expUnsigned in the method descriptor table#874mwaddip wants to merge 1 commit into
mwaddip wants to merge 1 commit into
Conversation
GroupElement.expUnsigned (method id 6, v6 / ErgoTreeVersion::V3) had a descriptor and an eval fn, but was never added to SGroupElement's METHOD_DESC registry. So ErgoTree deserialization (SMethod::from_ids) rejected it with UnknownMethodId(6, 7): any tree calling expUnsigned failed to parse, while the JVM (sigma-state) parses and evaluates it. That is a consensus divergence — a crafted tree using expUnsigned is accepted by a JVM node and rejected by a sigma-rust node. Add EXPONENTIATE_UNSIGNED_METHOD_DESC to METHOD_DESC (V3-gated via its existing min_version). exponentiate/multiply stay out: they serialize as dedicated Exponentiate/MultiplyGroup ops, not method calls. Verified against the blessed v6 vectors (GroupElement.expUnsigned): G^1 -> G, G^0 -> identity, G^order -> identity all now parse + evaluate (cost 999), matching sigma-state. Adds a from_ids regression test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
GroupElement.expUnsigned(method id 6, v6/V3) had a descriptor and an eval fn but was never added toSGroupElement'sMETHOD_DESC. SoSMethod::from_idsrejected it withUnknownMethodId(6, 7)— any ErgoTree callingexpUnsignedfailed to deserialize, while sigma-state parses + evaluates it. A crafted tree using it is accepted by a JVM node and rejected by a sigma-rust node — a consensus divergence.Fix: add
EXPONENTIATE_UNSIGNED_METHOD_DESCtoMETHOD_DESC(V3-gated via its existingmin_version).exponentiate/multiplystay out — they serialize as dedicated ops, not method calls.Verified against the v6 spec vectors:
G^1→G,G^0/G^order→identity, all now parse + eval. Adds afrom_idsregression test.