-
Notifications
You must be signed in to change notification settings - Fork 45
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
Staking Messages #21
Staking Messages #21
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,13 @@ Where message `type` must be one of: | |
- `4`: `Transact` | ||
- `5`: `RelayTo` | ||
- `6`: `RelayedFrom` | ||
- `7`: `HrmpNewChannelOpenRequest` | ||
- `8`: `HrmpChannelAccepted` | ||
- `9`: `HrmpChannelClosing` | ||
- `10`: `HrmpInitOpenChannel` | ||
- `11`: `HrmpAcceptOpenChannel` | ||
- `12`: `HrmpCloseChannel` | ||
- `13`: `Staking` | ||
|
||
Within XCM, there is an internal datatype `Order`, which encodes an operation on the holding account. It is defined as: | ||
|
||
|
@@ -173,6 +180,62 @@ Kind: *Trusted Indication*. | |
|
||
Errors: | ||
|
||
### `Staking` | ||
|
||
Send staking related messages. All the messages should be executed sequentially and applied atomically. | ||
|
||
- `messages: Vec<StakingMssage>` | ||
|
||
Kind: *Meta*. | ||
|
||
Errors: | ||
|
||
#### `StakingMessage` Types | ||
|
||
##### `Bond` | ||
|
||
- `value: Compact`: The amount of token to bond. | ||
|
||
Kind: *Instruction*. | ||
|
||
##### `Unbond` | ||
|
||
- `value: Compact`: The amount of token to unbond. | ||
|
||
Kind: *Instruction*. | ||
|
||
##### `Rebond` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI if the goal is to be general: this is assuming the existence of a bonding duration in which you can rebond your tokens. While unlikely, some chains might not have this. Or, if this applies also to the notion of delegators, they usually don't have any bonding duration applied. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. XCM aims to be general, exhaustive and composable. |
||
|
||
- `value: Compact`: The amount of token to bond. | ||
|
||
Kind: *Instruction*. | ||
|
||
##### `SetPayee` | ||
|
||
- `payee: RewardDestination`: The destination account for payment. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How are we going to define RewardDestination? Do we want to mimic the Substrate Staking pallet? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not very familiar with XCM: what are the assumptions? That we have two any arbitrary chains talking to each other, or two substrate based chains, or two FRAME-based chains? If not the former, then the design of this can be reflected on pallet-staking, and we can make sure that things that are noted here will rarely change in pallet-staking. Although, my guess is that this is totally generic over chain and we can't make an assumption about the existence of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any two arbitrary chains. |
||
|
||
TODO: How are we going to define RewardDestination type?? | ||
|
||
Kind: *Instruction*. | ||
|
||
##### `WithdrawUnbonded` | ||
|
||
Kind: *Instruction*. | ||
|
||
##### `Nominate` | ||
|
||
- `targets: Vec<MultiLocation>`: Declare the desire to nominate `targets`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think of XCM as a language; there's no need for every sentence to be true or even to make sense. XCM just let's you express ideas in an unambiguous way - it's up to the destination chain to decide what those mean in its context. In this case, it's perfectly reasonable for a substrate chain to require this |
||
|
||
Kind: *Instruction*. | ||
|
||
##### `Chill` | ||
|
||
Kind: *Instruction*. | ||
|
||
##### `PayoutStakers` | ||
|
||
Kind: *Instruction*. | ||
|
||
## `Order` Types | ||
|
||
### `Null` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just put the different message types right in here.