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

Added function for locking previously delegated stake and removed requirement that delegation pool vesting start times be in the future #152

Merged
merged 14 commits into from
Dec 31, 2024

Conversation

isaacdoidge
Copy link

@isaacdoidge isaacdoidge commented Dec 29, 2024

See #150 and #151.

QA Notes:

Please perform the following steps to help us verify that this new functionality is safe to deploy to and use in mainnet:

  1. Start a local network running the current mainnet release (release/v7.1). Set epoch_duration_secs to something short---maybe 30 seconds. Also set recurring_lockup_duration_secs and voting_duration_secs to small values so that it is possible to unlock and withdraw stake during this test. Finally, set the genesis_timestamp_microseconds to 31 days ago (in microseconds). This will ensure that the first lockup period of the Delegation Pool vesting schedules has passed.
  2. Delegate some stake to one of the genesis Delegation Pools on behalf of a few accounts using 0x1::pbo_delegation_pool::fund_delegators_with_stake. You can find the keys for the pool owners after starting the local network in smr-moonshot/remote-env/Logs/owners.
  3. Move the stake of different accounts into different states:
    a. Leave one account untouched.
    b. Unlock half of the stake of one account, but do not withdraw any.
    c. Unlock the full stake of one account, but do not withdraw any.
    d. Unlock the full stake of one account and withdraw half.
  4. Build the new version of the Supra Framework from dev of our fork of aptos-core and deploy it to the local network via a framework upgrade governance transaction.
  5. Unlock the stake of one account just before performing Step 6. The goal of this step is to ensure that one of the accounts has a pending_inactive allocation when Step 6 is performed.
  6. Lock the previously delegated stakes by calling 0x1::pbo_delegation_pool::lock_delegators_stakes. Use the original allocations when calling this function: Do not adjust for the fact that some of the stake has been withdrawn from some accounts.
  7. Ensure that the remaining allocations of the accounts are now active and are subject to the vesting schedule. This can be confirmed by ensuring that the accounts that did not withdraw anything in the steps above can now unlock and withdraw their first-period allocations, and that the other accounts cannot unlock anything (yet).

…w upper bounds on the total amount locked for the related delegator. Updated the tests accordingly.
…ew principle stake for the account. Added additional checks to the stake reactivation logic to address Dr Joshi's PR comments.
Copy link

@sjoshisupra sjoshisupra left a comment

Choose a reason for hiding this comment

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

I believe that the amount is too low for reactivation, the assertion can fail because in the pool we would have less than MIN_COIN_SHARES_IN_POOL. So (i) either we ensure that the assertion will always hold or (ii) do not perform the operation for those delegator where this might fail.

@isaacdoidge isaacdoidge merged commit 489ecc9 into dev Dec 31, 2024
1 check passed
@isaacdoidge isaacdoidge deleted the issue-150 branch December 31, 2024 13:32
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