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

Skip to content

Conversation

@lukaszcz
Copy link
Collaborator

  • Fixes computation of nonce for the intent resource: it should be set to the nullifier of the ephemeral consumed resource from the same compliance unit.
  • Fixes computation of rcv fields for created resources in Action.create: they should be different random numbers.

@lukaszcz lukaszcz self-assigned this Jul 23, 2025
@lukaszcz lukaszcz requested review from Copilot and janmasrovira July 23, 2025 12:16
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 fixes issues with nonce computation for intent resources and random value generation for compliance witnesses. The changes ensure that nonces are properly derived from nullifiers of ephemeral consumed resources, and that different random numbers are used for rcv fields in created resources.

  • Fixed nonce computation in Intent translation to use nullifier from ephemeral consumed resource
  • Refactored random value generation to ensure unique rcv values
  • Updated random number generator state management to prevent reuse

Reviewed Changes

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

File Description
AVM/Intent/Translation.lean Updates nonce computation to derive from nullifier and fixes random number generator usage
AVM/Action.lean Refactors compliance witness creation to generate unique random values per witness
Comments suppressed due to low confidence (2)

AVM/Intent/Translation.lean:63

  • [nitpick] The variable name 'res' is too generic and unclear. Consider renaming it to 'ephemeralResource' or 'consumedResource' to better reflect its purpose in nonce computation.
  let res := dummyResource ⟨r1⟩

AVM/Intent/Translation.lean:64

  • [nitpick] The variable name 'can_nullify' uses snake_case which appears inconsistent with the camelCase naming convention used elsewhere in the codebase (e.g., 'createdWitness', 'intentResource').
  let can_nullify := Anoma.nullifyUniversal res Anoma.NullifierKey.universal rfl rfl

@lukaszcz lukaszcz merged commit 62ce834 into main Jul 24, 2025
2 checks passed
@lukaszcz lukaszcz deleted the fix-nonce-rcv branch July 24, 2025 10:02
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.

3 participants