Skip to content

Commit

Permalink
add number, lint
Browse files Browse the repository at this point in the history
  • Loading branch information
2501babe committed May 1, 2024
1 parent 95c0064 commit 1f1cc74
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
simd: 'XXXX'
simd: '0148'
title: MoveStake and MoveLamports Instructions
authors:
- Hanako Mumei
Expand All @@ -14,6 +14,7 @@ feature: (fill in with feature tracking issues once accepted)

We propose introducing two new instructions to the stake program for moving
value between stake accounts with identical `Authorized` and `Lockup`:

* `MoveStake`: Move a given `amount` of active stake from one fully active
account to another fully active account, or from a fully active account to an
inactive one, turning it into an active account. In all cases, rent-exempt
Expand Down Expand Up @@ -44,6 +45,7 @@ accumulating (undelegated) in the destination merge accounts.
The purpose of the `MoveStake` instruction is to enable a flow whereby moving
stake from a user's stake accounts U1 -> U2 from validator V1 to validator V2
may proceed:

* `MoveStake` the `amount` of stake from the user stake account U1 to a
"transient" inactive account T holding sufficient lamports for rent exemption
and minimum delegation. T instantly becomes a second active stake account
Expand Down Expand Up @@ -81,9 +83,6 @@ the proposed flow.
This is undesirable because that restriction was added for very good reason: an
effectively unbounded amount of stake could be instantly deactivated through
repeated splitting.
* No action. This does not seem reasonable because this SIMD is addressing a
proliferation of stake accounts being created to work around the issue it
intends to solve.

## New Terminology

Expand All @@ -94,16 +93,19 @@ intends to solve.
### `MoveStake`

`MoveStake` requires 5 accounts:

* Source stake account
* Destination stake account
* Clock
* Stake history
* Stake account authority

`MoveStake` requires 1 argument:

* `amount`, a `u64` indicating the quantity of lamports to move

`MoveStake` aborts the transaction when:

* `amount` is 0
* Source and destination have the same address
* Source and destination do not have identical `Authorized` and `Lockup`
Expand All @@ -119,6 +121,7 @@ vote account
* Moving `amount` stake would fail to bring destination up to minimum delegation

If all of these conditions hold, then:

* Delegation and lamports on source are debited `amount`
* Delegation and lamports on destination are credited `amount`
* If destination is inactive, it is set to active with the same `Stake` as
Expand All @@ -129,6 +132,7 @@ source, aside from delegation amount
Accounts and arguments are identical to the above.

`MoveLamports` aborts the transaction when:

* `amount` is 0
* Source and destination have the same address
* Source and destination do not have identical `Authorized` and `Lockup`
Expand All @@ -139,6 +143,7 @@ Accounts and arguments are identical to the above.
* `amount` exceeds source `lamports - stake - rent_exempt_reserve`

If all of these conditions hold, then:

* Lamports on source are debited `amount`
* Lamports on destination are credited `amount`

Expand Down

0 comments on commit 1f1cc74

Please sign in to comment.