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

Implement delegator voting #1795

Closed
Tracked by #1790
plaidfinch opened this issue Jan 5, 2023 · 4 comments · Fixed by #1881
Closed
Tracked by #1790

Implement delegator voting #1795

plaidfinch opened this issue Jan 5, 2023 · 4 comments · Fixed by #1881
Assignees
Labels

Comments

@plaidfinch
Copy link
Collaborator

plaidfinch commented Jan 5, 2023

This ticket tracks delegator voting in the v1 of governance, which does not incorporate flow encryption. However, design discussion here should try to hew to what will later be compatible with flow encryption. Should we use mock flow ciphertexts here?

@plaidfinch
Copy link
Collaborator Author

plaidfinch commented Jan 17, 2023

A delegator vote should consist of a spend proof from the current state commitment tree root to a note commitment for a delegation token that was unspent as of the start height of voting. The vote proof is like a spend proof, but additionally proves the position of the note is strictly less than the start height of voting. The stateful verification in consensus checks that the submitted nullifier is either (a) currently unspent, or (b) has been spent, but was spent after or at the start height of voting. This together with the vote proof shows that the delegation token was unspent at voting period start.

In order to do the stateful verification, we need to record the spend height of a nullifier. Currently we only record the NoteSource when we spend one. Instead we should have:

struct SpendInfo {
    note_source: NoteSource,
    spend_height: u64,
}

To facilitate this check, we should also add another getter to the note manager that returns Option<SpendInfo> instead of Result<()>.

@plaidfinch
Copy link
Collaborator Author

The default behavior of the planner should be to "roll over" delegation tokens during voting, to minimize linkability. Doing this means that a vote transaction will be [Vote, Spend, Output] with the output self-addressed to the same address as the note originated. This can't be done if the note being voted with was already spent; in that case, the transaction should just be a vote action.

@plaidfinch
Copy link
Collaborator Author

In order to be able to produce vote proofs, clients should not forget delegation tokens when they are spent. As a first cut, they should never forget delegation tokens. Later, we can add scheduled cleanup for sufficiently old spent delegation tokens.

@erwanor erwanor moved this to Testnet 44: Ananke in Testnets Feb 3, 2023
@conorsch conorsch moved this from Testnet 44: Ananke to Testnet 45: Meti in Testnets Feb 10, 2023
@plaidfinch plaidfinch linked a pull request Feb 16, 2023 that will close this issue
@plaidfinch plaidfinch moved this from Testnet 45: Meti to In Progress in Testnets Feb 16, 2023
@redshiftzero redshiftzero moved this from In Progress to Testnet 46: Lysithea in Testnets Feb 17, 2023
@plaidfinch
Copy link
Collaborator Author

The planner needn't permit fine-grained "vote with this note" functionality; it should vote with all the applicable voting weight for the proposal, for all validators at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Testnet 46: Lysithea
Development

Successfully merging a pull request may close this issue.

1 participant