Skip to content

Fix visibility guards in bundled groups - #9

Open
shukudaidayo wants to merge 2 commits into
llbartekll:mainfrom
shukudaidayo:fix-visibility-bundled-groups
Open

Fix visibility guards in bundled groups#9
shukudaidayo wants to merge 2 commits into
llbartekll:mainfrom
shukudaidayo:fix-visibility-bundled-groups

Conversation

@shukudaidayo

Copy link
Copy Markdown

Summary

  • Preserve array positions when array-expanded fields are hidden by visibility rules
  • Allow calldata visibility checks to match descriptor-friendly uint/address literals
  • Add regression tests for hidden guard fields in bundled calldata and EIP-712 groups

Context

This was surfaced while testing the Ocarina ERC-7730 registry submission: ethereum/clear-signing-erc7730-registry#2598.

The runner reported failures for descriptors that use hidden visible.mustBe guard fields inside bundled offer/receive/tip item groups:

  • calldata uint guard values decoded as ABI hex words did not match descriptor literals like "1" or "2"
  • bundled groups skipped hidden array-expanded fields instead of preserving their array positions, causing sibling array fields to fail the equal-length check

Details

For bundled groups, array-expanded fields now preallocate one bundle slot per source array item and leave the slot empty when a field is hidden. This keeps sibling array fields aligned even when a guard field such as itemType is intentionally hidden with visible.mustBe.

For calldata visibility, comparisons now keep exact JSON matching but also support common descriptor literals:

  • decimal string or numeric literals for ABI uint values, e.g. "1" or 1
  • case-insensitive 0x... string comparison for addresses / hex values

Validation

  • cargo test --quiet
  • Ocarina calldata testsv2: 3/3 passed
  • Ocarina EIP-712 testsv2: 3/3 passed

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