You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/operators/becoming-a-validator/unbonding.md
+34-50Lines changed: 34 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ title: Unbonding
6
6
7
7
Once a bid is placed, it will remain in the state of the auction contract, even if the bid fails to win a slot immediately. New slots may become available if bonded validators leave the network or reduce their bond amounts. Therefore, a bid must be explicitly withdrawn to remove it from the auction.
8
8
9
-
## Method 1: Unbonding with the System Auction Contract {#withdraw-system-auction}
9
+
## Unbonding with the System Auction Contract {#withdraw-system-auction}
10
10
11
11
This method withdraws a bid using the system auction contract. Call the existing `withdraw_bid` entry point from the system auction contract. Using this method, you do not need to build any contracts, reducing costs and complexity.
12
12
@@ -46,6 +46,39 @@ Calling the `withdraw_bid` entry point on the auction contract has a fixed cost
46
46
47
47
:::
48
48
49
+
## `withdraw-bid` Guardrails
50
+
51
+
There are additional guardrails in place to ensure accidental full withdrawal/unstaking of the stakes.
52
+
53
+
-`withdraw-bid` will check if the withdraw bid will not result in a Validator's stake dropping below the Validator minimum bid threshold. It will return an error if a Validator's staked amount will fall below the minimum bid amount for Validators when executing the transaction.
54
+
-`withdraw-bid-all` is a sub-command that takes in a public key of a Validator and produces a withdraw bid transaction that will completely unbond the Validator.
55
+
- A minimum-bid override flag `min-bid-override` is available for Validators to log a warning to the standard output and produce/send the withdraw bid transaction.
56
+
- The withdraw-bid guardrails have been extended to `put-transaction` and `put-deploy` subcommands that invoke the entry point via stored contract by hash/name and package by hash/name.
|**When the withdraw-bid transaction will result in remaining stake falling below the minimum bid threshold - i.e. <10,000,000,000,000 motes**| <br/>Staked: 17,536,609,871,045 motes<br/><br/>Withdraw: 17,536,609,871,045 motes <br/><br/>Remaining Stake: 0 motes |`withdraw-bid` <br/>without<br/>`--min-bid-override`| Client guardrail prevents execution with <br/>"**Attempting to withdraw bid will reduce stake below the minimum amount.**" error |
63
+
|**When the withdraw-bid transaction will result in remaining stake being equal to or over the minimum bid threshold - i.e. >=10,000,000,000,000 motes**| <br/>Staked: 17,536,609,871,045 motes<br/><br/>Withdraw: 7,536,609,871,045 motes <br/><br/>Remaining Stake: 10,000,000,000,000 motes |`withdraw-bid` <br/>without<br/>`--min-bid-override`| Transaction will execute successfully |
64
+
|**When the withdraw-bid transaction with min-bid-override flag will result in remaining stake being less than minimum bid threshold - i.e. <10,000,000,000,000 motes**| <br/>Before: 17,536,609,871,045 motes<br/><br/>Withdraw: 17,536,609,871,044 motes |`withdraw-bid` <br/>with<br/>`--min-bid-override`| Transaction will execute with a warning `Execution of this withdraw bid will result in unbonding of all stake`|
65
+
|**When the withdraw-bid transaction with min-bid-override flag will result in remaining stake being equal to or greater than minimum bid threshold - i.e. >=10,000,000,000,000 motes**| <br/>Before: 17,536,609,871,045 motes<br/><br/>Withdraw: 7,536,609,871,044 motes |`withdraw-bid` <br/>with<br/>`--min-bid-override`| Transaction will execute successfully |
66
+
67
+
**How to use the `min-bid-override` flag in a transaction?**
## Method 2: Unbonding with Compiled Wasm {#withdraw-compiled-wasm}
80
-
81
-
There is a second way to withdraw a bid, using the compiled Wasm `withdraw_bid.wasm`. The process is the same as bonding but uses a different contract.
1.`node-address` - An IP address of a peer on the network. The default port of nodes' JSON-RPC servers on Mainnet and Testnet is 7777
95
-
2.`secret-key` - The file name containing the secret key of the account paying for the Deploy
96
-
3.`chain-name` - The chain-name to the network where you wish to send the Deploy. For Mainnet, use *casper*. For Testnet, use *casper-test*
97
-
4.`payment-amount` - The payment for the Deploy in motes estimated
98
-
5.`session-path` - The path to the compiled Wasm on your computer
99
-
100
-
The `withdraw_bid.wasm` expects two arguments, while the third one is optional:
101
-
102
-
6.`public key`: The hexadecimal public key of the account's purse to withdraw. This key must match the secret key that signs the deploy and has to match the public key of a bid in the auction contract
103
-
7.`amount`: The amount being withdrawn
104
-
105
-
The command will return a deploy hash, which is needed to verify the deploy's processing results.
106
-
107
-
:::note
108
-
109
-
This method is more expensive than calling the `withdraw_bid` entrypoint in the system auction contract, which has a fixed cost of 2.5 CSPR.
110
-
111
-
:::
112
-
113
-
**Example:**
114
-
115
-
Here is an example request to unbond stake using the `withdraw_bid.wasm`. The payment amount specified is 4 CSPR. You must modify the payment and other values in the deploy based on the network's [chainspec.toml](../../concepts/glossary/C.md#chainspec).
Copy file name to clipboardExpand all lines: versioned_docs/version-2.0.0/operators/becoming-a-validator/unbonding.md
+33-50Lines changed: 33 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,39 @@ Calling the `withdraw_bid` entry point on the auction contract has a fixed cost
46
46
47
47
:::
48
48
49
+
## `withdraw-bid` Guardrails
50
+
51
+
There are additional guardrails in place to ensure accidental full withdrawal/unstaking of the stakes.
52
+
53
+
-`withdraw-bid` will check if the withdraw bid will not result in a Validator's stake dropping below the Validator minimum bid threshold. It will return an error if a Validator's staked amount will fall below the minimum bid amount for Validators when executing the transaction.
54
+
-`withdraw-bid-all` is a sub-command that takes in a public key of a Validator and produces a withdraw bid transaction that will completely unbond the Validator.
55
+
- A minimum-bid override flag `min-bid-override` is available for Validators to use it when they want to override the minimum bid staking amount check to the standard output when they produce/send the withdraw bid transaction.
56
+
- The withdraw-bid guardrails have been extended to `put-transaction` and `put-deploy` subcommands that invoke the entry point via stored contract by hash/name and package by hash/name.
|**When the withdraw-bid transaction will result in remaining stake falling below the minimum bid threshold - i.e. <10,000,000,000,000 motes**| <br/>Staked: 17,536,609,871,045 motes<br/><br/>Withdraw: 17,536,609,871,045 motes <br/><br/>Remaining Stake: 0 motes |`withdraw-bid` <br/>without<br/>`--min-bid-override`| Client guardrail prevents execution with <br/>"**Attempting to withdraw bid will reduce stake below the minimum amount.**" error |
63
+
|**When the withdraw-bid transaction will result in remaining stake being equal to or over the minimum bid threshold - i.e. >=10,000,000,000,000 motes**| <br/>Staked: 17,536,609,871,045 motes<br/><br/>Withdraw: 7,536,609,871,045 motes <br/><br/>Remaining Stake: 10,000,000,000,000 motes |`withdraw-bid` <br/>without<br/>`--min-bid-override`| Transaction will execute successfully |
64
+
|**When the withdraw-bid transaction with min-bid-override flag will result in remaining stake being less than minimum bid threshold - i.e. <10,000,000,000,000 motes**| <br/>Before: 17,536,609,871,045 motes<br/><br/>Withdraw: 17,536,609,871,044 motes |`withdraw-bid` <br/>with<br/>`--min-bid-override`| Transaction will execute with a warning `Execution of this withdraw bid will result in unbonding of all stake`|
65
+
|**When the withdraw-bid transaction with min-bid-override flag will result in remaining stake being equal to or greater than minimum bid threshold - i.e. >=10,000,000,000,000 motes**| <br/>Before: 17,536,609,871,045 motes<br/><br/>Withdraw: 7,536,609,871,044 motes |`withdraw-bid` <br/>with<br/>`--min-bid-override`| Transaction will execute successfully |
66
+
67
+
**How to use the `min-bid-override` flag in a transaction?**
## Method 2: Unbonding with Compiled Wasm {#withdraw-compiled-wasm}
80
-
81
-
There is a second way to withdraw a bid, using the compiled Wasm `withdraw_bid.wasm`. The process is the same as bonding but uses a different contract.
1.`node-address` - An IP address of a peer on the network. The default port of nodes' JSON-RPC servers on Mainnet and Testnet is 7777
95
-
2.`secret-key` - The file name containing the secret key of the account paying for the Deploy
96
-
3.`chain-name` - The chain-name to the network where you wish to send the Deploy. For Mainnet, use *casper*. For Testnet, use *casper-test*
97
-
4.`payment-amount` - The payment for the Deploy in motes estimated
98
-
5.`session-path` - The path to the compiled Wasm on your computer
99
-
100
-
The `withdraw_bid.wasm` expects two arguments, while the third one is optional:
101
-
102
-
6.`public key`: The hexadecimal public key of the account's purse to withdraw. This key must match the secret key that signs the deploy and has to match the public key of a bid in the auction contract
103
-
7.`amount`: The amount being withdrawn
104
-
105
-
The command will return a deploy hash, which is needed to verify the deploy's processing results.
106
-
107
-
:::note
108
-
109
-
This method is more expensive than calling the `withdraw_bid` entrypoint in the system auction contract, which has a fixed cost of 2.5 CSPR.
110
-
111
-
:::
112
-
113
-
**Example:**
114
-
115
-
Here is an example request to unbond stake using the `withdraw_bid.wasm`. The payment amount specified is 4 CSPR. You must modify the payment and other values in the deploy based on the network's [chainspec.toml](../../concepts/glossary/C.md#chainspec).
0 commit comments