Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

funding: stub LQT actions #5014

Closed
Tracked by #5010
erwanor opened this issue Jan 28, 2025 · 0 comments · Fixed by #5027
Closed
Tracked by #5010

funding: stub LQT actions #5014

erwanor opened this issue Jan 28, 2025 · 0 comments · Fixed by #5027
Assignees

Comments

@erwanor
Copy link
Member

erwanor commented Jan 28, 2025

To implement delegator voting, we can reuse the circuit used for delegator voting in the governance component. This works because we want to show that:

  1. We have a bona-fide note that is real and predates the epoch start
  2. That we are authorized to spend it
  3. The nullifier we provide is derived from the right key
  4. Balance commitment is consistent with the note value
  5. The note’s position predates the start_position of the tournament
message ActionTournamentVote {
    message DelegatorVote {
      // The effecting data for the tournament vote.
      TournamentVoteBody body = 1;
      // The vote authorization signature is authorizing data.
      penumbra.crypto.decaf377_rdsa.v1.SpendAuthSignature auth_sig = 2;
      // The vote proof is authorizing data.
      ZKDelegatorVoteProof proof = 3;
  }
  
  message TournamentVoteBody {
    // The start of the tournament as a TCT position.
    // Note(erwan): this is a packed u64 that decodes to a
    // `tct::Position`.
    uint64 start_position = 2;
    // The value of the delegation note.
    asset.v1.Value value = 4;
    // The amount of the delegation note, in unbonded penumbra.
    num.v1.Amount unbonded_amount = 5;
    // The nullifier of the input note.
    sct.v1.Nullifier nullifier = 6;
    // The randomized validating key for the spend authorization signature.
    crypto.decaf377_rdsa.v1.SpendVerificationKey rk = 7;
  }
  
  // A randomized address to mint rewards to.
  penumbra.core.keys.v1.Address rewards_recipient = 1;
  // The asset that this vote will count towards.
  string incentivized_asset_denom = 2;
  // zkp, effecting data, modeled after gov
  DelegatorVoteProof vote = 3;
}

Stateless validation

  1. The incentivized asset is an IBC asset:
    1. incentivized_asset_denom starts with transfer/
    2. incentivized_asset_denom is less than 256 characters
  2. proposal is 0
  3. Vote is UNSPECIFIED
  4. RK verifies
  5. Proof verifies

We can leave the stateful validation and pre-execution checks out for now.

@erwanor erwanor mentioned this issue Jan 28, 2025
28 tasks
@erwanor erwanor added this to Penumbra Jan 28, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Penumbra Jan 28, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Penumbra Jan 30, 2025
cronokirby added a commit that referenced this issue Jan 30, 2025
## Describe your changes

Closes #5014.

This implements the action for LQT voting, up to (and including)
stateless checks. This is similar to delegator voting, but with some
light simplification. This also reuses the strategy of UndelegateClaim
in using an inner proof shared with a different circuit, which is, imo,
cleaner code since the fact that the delegator vote circuit can be
reused is a happy coincidence.

Testing deferred.

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > you betcha

---------

Signed-off-by: Lúcás Meier <[email protected]>
Co-authored-by: Erwan Or <[email protected]>
conorsch pushed a commit that referenced this issue Jan 31, 2025
## Describe your changes

Closes #5014.

This implements the action for LQT voting, up to (and including)
stateless checks. This is similar to delegator voting, but with some
light simplification. This also reuses the strategy of UndelegateClaim
in using an inner proof shared with a different circuit, which is, imo,
cleaner code since the fact that the delegator vote circuit can be
reused is a happy coincidence.

Testing deferred.

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > you betcha

---------

Signed-off-by: Lúcás Meier <[email protected]>
Co-authored-by: Erwan Or <[email protected]>
conorsch pushed a commit that referenced this issue Feb 4, 2025
## Describe your changes

Closes #5014.

This implements the action for LQT voting, up to (and including)
stateless checks. This is similar to delegator voting, but with some
light simplification. This also reuses the strategy of UndelegateClaim
in using an inner proof shared with a different circuit, which is, imo,
cleaner code since the fact that the delegator vote circuit can be
reused is a happy coincidence.

Testing deferred.

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > you betcha

---------

Signed-off-by: Lúcás Meier <[email protected]>
Co-authored-by: Erwan Or <[email protected]>
conorsch pushed a commit that referenced this issue Feb 5, 2025
## Describe your changes

Closes #5014.

This implements the action for LQT voting, up to (and including)
stateless checks. This is similar to delegator voting, but with some
light simplification. This also reuses the strategy of UndelegateClaim
in using an inner proof shared with a different circuit, which is, imo,
cleaner code since the fact that the delegator vote circuit can be
reused is a happy coincidence.

Testing deferred.

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > you betcha

---------

Signed-off-by: Lúcás Meier <[email protected]>
Co-authored-by: Erwan Or <[email protected]>
conorsch pushed a commit that referenced this issue Feb 5, 2025
## Describe your changes

Closes #5014.

This implements the action for LQT voting, up to (and including)
stateless checks. This is similar to delegator voting, but with some
light simplification. This also reuses the strategy of UndelegateClaim
in using an inner proof shared with a different circuit, which is, imo,
cleaner code since the fact that the delegator vote circuit can be
reused is a happy coincidence.

Testing deferred.

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > you betcha

---------

Signed-off-by: Lúcás Meier <[email protected]>
Co-authored-by: Erwan Or <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants