Skip to content

fix: reject unsupported (arity != 2) tuple-typed values at eval (JVM checkType)#897

Open
mwaddip wants to merge 1 commit into
ergoplatform:developfrom
mwaddip:fix/checktype-ingress-divergences
Open

fix: reject unsupported (arity != 2) tuple-typed values at eval (JVM checkType)#897
mwaddip wants to merge 1 commit into
ergoplatform:developfrom
mwaddip:fix/checktype-ingress-divergences

Conversation

@mwaddip

@mwaddip mwaddip commented Jun 10, 2026

Copy link
Copy Markdown

The JVM checkTypes each Tuple item (values.scala:801/804) via SType.isValueOfType, which rejects a tuple type of arity != 2 with "Unsupported tuple type" (SType.scala:200-205). sigma-rust models flat N-ary tuples (2..=255), so an arity-3 tuple carried as a constant (the item of a valid pair) evaluated where the JVM rejects — a consensus accept/reject divergence on crafted trees.

Adds check_value_type (eval.rs) mirroring isValueOfType's reachable rejections, called on Tuple-eval items. Constants are substituted into the body before eval on develop, so the segregated-constant case reduces to the same inline Tuple-item case.

Regression tests drive the JVM-blessed vector bytes end-to-end (parse → eval → expect the eval error).

…checkType)

The JVM checkTypes each Tuple item (values.scala:801/804) via
SType.isValueOfType, which rejects a tuple type of arity != 2 (and a function
type of arity != 1) with "Unsupported tuple type" (SType.scala:200-205).
sigma-rust models flat N-ary tuples (TupleItems 2..=255), so an arity-3 tuple
carried as a constant (the item of a valid pair) evaluated where the JVM
rejects — a consensus accept/reject divergence.

Add check_value_type mirroring isValueOfType's reachable rejections and call it
at the Tuple-eval items. Placeholder constants are substituted into the body
before eval on this branch, so the segregated case reduces to the same inline
Tuple-item case; the eni cherry-pick additionally guards ConstantPlaceholder
eval (where eni resolves placeholders lazily).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant