Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lukaszcz
Copy link
Collaborator

@lukaszcz lukaszcz commented Jul 15, 2025

  • Closes Include compliance units in the RM model #10
  • The translation is modified to divide each action into compliance units. Dummy ephemeral resources with quantity 0 are added to satisfy the requirement that each compliance unit needs to have one consumed and one created resource.
  • The RLs are updated to filter out (ignore) the dummy resources.

@lukaszcz lukaszcz requested review from Copilot and janmasrovira July 15, 2025 16:27
@lukaszcz lukaszcz self-assigned this Jul 15, 2025

This comment was marked as outdated.

@lukaszcz lukaszcz marked this pull request as draft July 15, 2025 16:31
@lukaszcz lukaszcz marked this pull request as ready for review July 15, 2025 17:00
@lukaszcz lukaszcz requested a review from Copilot July 15, 2025 17:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new compliance‐unit abstraction for actions, refactors transactions accordingly, and updates the intent and class translation layers to emit compliance units with dummy resources.

  • Add ComplianceWitness, ComplianceInstance, and ComplianceUnit structures with a placeholder create function
  • Change Anoma.Transaction and Anoma.Action to reference lists of compliance units and logic‐verifier inputs, dropping the old roots field
  • Update intent and class translation code to generate compliance units (using dummy ephemeral resources) and filter them out in logic checks

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Anoma/Transaction.lean Removed old Tag, Action, and roots; import new Anoma.Action
Anoma/Compliance.lean Introduced compliance unit types and placeholder create impl
Anoma/Action.lean Defined Action with complianceUnits and logicVerifierInputs
AVM/Object/Consumable.lean Deleted legacy toRootedNullifiableResource helpers
AVM/Intent/Translation.lean Emit compliance units, filter dummy resources, and rename maps
AVM/Class/Translation.lean Generate compliance units and verifier inputs in class actions
AVM/Class/Member/Logic.lean Added dummyResource and filterOutDummy to ignore ephemeral resources
Comments suppressed due to low confidence (3)

Anoma/Compliance.lean:19

  • [nitpick] Field name 'rcv' is unclear; consider renaming to a more descriptive identifier like 'randomScalar' and using a domain‐specific numeric type instead of String.
    rcv : String := ""

Anoma/Compliance.lean:21

  • [nitpick] The ComplianceInstance struct is currently empty. Please document its intended fields or populate it with the necessary data to represent a compliance instance.
structure ComplianceInstance where

Anoma/Compliance.lean:29

  • The placeholder 'ComplianceUnit.create' implementation currently has no tests. Add unit tests to cover its behavior once it is fully implemented.
def ComplianceUnit.create (_witness : ComplianceWitness) : ComplianceUnit :=


abbrev MerklePath := List Nat

structure ComplianceWitness where
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not too troublesome, I would consider adding an additional field nullifierProof : NullifierProof nfKey consumedResource

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add it later

@janmasrovira janmasrovira merged commit 3db1b8e into main Jul 16, 2025
2 checks passed
@janmasrovira janmasrovira deleted the compliance-units branch July 16, 2025 04:42
janmasrovira added a commit that referenced this pull request Jul 18, 2025
commit 4b9457b
Author: Jan Mas Rovira <[email protected]>
Date:   Fri Jul 18 09:44:49 2025 +0200

    add keys

commit 0695dd3
Author: Jan Mas Rovira <[email protected]>
Date:   Fri Jul 18 08:00:17 2025 +0200

    action

commit 9c21534
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 22:01:49 2025 +0200

    Logic

commit c0c6d22
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 18:41:41 2025 +0200

    more refactors

commit bcaa410
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 17:30:49 2025 +0200

    refactor files

commit 5bb96be
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 15:47:59 2025 +0200

    adapt examples

commit 0e0cdf6
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 13:19:14 2025 +0200

    label for intents

commit eae64cf
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 10:06:38 2025 +0200

    logic checks

commit 7155377
Author: Jan Mas Rovira <[email protected]>
Date:   Wed Jul 16 22:32:16 2025 +0200

    move intents out

commit e0882f4
Author: Jan Mas Rovira <[email protected]>
Date:   Wed Jul 16 22:15:20 2025 +0200

    function logic

commit 2051950
Author: Jan Mas Rovira <[email protected]>
Date:   Wed Jul 16 14:37:26 2025 +0200

    more changes

commit 9e8ca17
Author: Jan Mas Rovira <[email protected]>
Date:   Tue Jul 15 19:14:04 2025 +0200

    ecosystem wip

commit 4d809d0
Author: Łukasz Czajka <[email protected]>
Date:   Wed Jul 16 15:47:23 2025 +0200

    Use the `label` field to store Intent.ResourceData (#44)

    - Closes #39

commit 3db1b8e
Author: Łukasz Czajka <[email protected]>
Date:   Wed Jul 16 06:42:20 2025 +0200

    Compliance units (#43)

    - Closes #10
    - The translation is modified to divide each action into compliance
    units. Dummy ephemeral resources with quantity 0 are added to satisfy
    the requirement that each compliance unit needs to have one consumed and
    one created resource.
    - The RLs are updated to filter out (ignore) the dummy resources.

    ---------

    Co-authored-by: Copilot <[email protected]>
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.

Include compliance units in the RM model

3 participants