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: mint delegation token lqt rewards #5060

Merged
merged 9 commits into from
Feb 6, 2025

Conversation

erwanor
Copy link
Member

@erwanor erwanor commented Feb 5, 2025

Describe your changes

This PR adds a component API to allow funding to deposit into a validator's delegation pool. It does so by exposing a ValidatorPoolDeposit::deposit_to_validator_pool method to safely handle it.

One tension in the current design, is that the LQT logic lives in the funding component which execute last. As a result, delegation pool increases do not affect the validator's voting power until the following epoch. LQT rewards however, are immediately useful to awardees and can be directed towards future LQT seasons.

One notable change to this PR is that we now track voters based on:

  • the beneficiary address for the rewards
  • the identity key of the validator corresponding to the delegation note used for voting

Alternative solution
If we want to solve this another way, we could close the current PR, and refactor the LQT logic into its own component. The approach should be the same: the lqt component calls the safe pool increase handle and the staking component takes care of the rest.

Issue ticket number and link

Discussing and overview in #5046

Checklist before requesting a review

  • I have added guiding text to explain how a reviewer should test these changes.

  • 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:

    LQT

@erwanor erwanor changed the title Erwan/mint delegation tokens funding: mint delegation token lqt rewards Feb 5, 2025
@erwanor erwanor marked this pull request as ready for review February 6, 2025 01:05
@erwanor erwanor force-pushed the erwan/mint_delegation_tokens branch from faff411 to 4a2a238 Compare February 6, 2025 01:20
};

ensure!(
!matches!(validator_state, State::Defined | State::Tombstoned),
Copy link
Contributor

Choose a reason for hiding this comment

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

For posterity: we want to allow voting with jailed power, because that validator might be able to recover, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I think every bonding note is fair game unless the validator is in an irrecoverable state e.g, Tombstoned OR if it is in a precursor state with no resources bound to it.

@erwanor erwanor merged commit cbe2237 into protocol/lqt_branch Feb 6, 2025
10 checks passed
@erwanor erwanor deleted the erwan/mint_delegation_tokens branch February 6, 2025 13:54
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.

2 participants