Skip to content

compliance merge optimization #220

Merged
XuyangSong merged 10 commits into
mainfrom
enrique/xuyang/compliance_merge
May 18, 2026
Merged

compliance merge optimization #220
XuyangSong merged 10 commits into
mainfrom
enrique/xuyang/compliance_merge

Conversation

@XuyangSong

Copy link
Copy Markdown
Collaborator

Summary

This PR adds variable-size compliance unit support, allowing a compliance witness/instance to carry multiple consumed resources and multiple created resources instead of the previous fixed 1:1 consumed/created shape.

Changes

  • Refactors ComplianceWitness and ComplianceInstance to use lists of consumed and created resource data.
  • Adds consumed/created resource public and witness structs.
  • Derives created-resource nonces from the full consumed-nullifier set with a nonce-derivation domain separator.
  • Rejects nonce derivation from an empty nullifier set.
  • Updates Action to contain a single variable-size compliance unit and match logic verifiers by consumed nullifier / created commitment tags.
  • Preserves compliance-instance tag order when constructing action trees and delta messages.
  • Updates transaction verification, nullifier duplication checks, delta aggregation, proof erasure, and aggregation instance construction for variable-size compliance instances.
  • Simplifies batch aggregation circuit inputs from fixed-size ComplianceInstanceWords to Vec<u32>.
  • Regenerates compliance and batch aggregation guest binaries and updates their verification keys.

larraia and others added 10 commits May 18, 2026 14:29
- resource.rs: derive_nonce uses big-endian for the index (matching
  quantity/PRF bytes); drop unnecessary nf_key.clone() in
  ConsumedResourceWitness constructors.
- compliance.rs: rebuild Default's nullifier vec via iter() (drops the
  index-2/key-1 typo); collapse the duplicate Resource literals; use
  rcv.as_ref(); document accumulate_kind's O(N²) trade-off; fix
   typo. Add ComplianceInstance::tags() as the canonical
  iterator, used by delta_msg and Action::get_logic_verifiers.
- action.rs: tighten get_logic_verifiers; strengthen
  construct_action_tree docs.
- arm_test_app: turn populate_created_resources panic into
  ArmError::MissingField; add Tester::{delta_witness, set_created_nonce}
  helpers and use them from the relevant tests; add #[ignore]'d
  test_aggregation_works_groth16.
@XuyangSong XuyangSong force-pushed the enrique/xuyang/compliance_merge branch from c252796 to 10a54c6 Compare May 18, 2026 10:05
@XuyangSong XuyangSong merged commit 2a47cf9 into main May 18, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Triage to Released in Anoma SDK - What's Cooking May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

2 participants