From cade76665326e285e8795d85bd1602f04ef3ed76 Mon Sep 17 00:00:00 2001 From: SolidityGo Date: Wed, 29 Dec 2021 14:59:25 +0800 Subject: [PATCH 1/5] BEP-99: init --- BEP99.md | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 BEP99.md diff --git a/BEP99.md b/BEP99.md new file mode 100644 index 00000000..507e58ea --- /dev/null +++ b/BEP99.md @@ -0,0 +1,75 @@ +# BEP-99: Temporary Maintenance Mode for Validators + +- [BEP-99: Temporary Maintenance Mode for Validators](#bep-99-temporary-maintenance-mode-for-validators) + - [1. Summary](#1-summary) + - [2. Abstract](#2-abstract) + - [3. Status](#3-status) + - [4. Motivation](#4-motivation) + - [5. Specification](#5-specification) + - [6. License](#6-license) + +## 1. Summary + +This BEP introduces the Temporary Maintenance mode for validators on the Binance Smart Chain. + +## 2. Abstract + +Temporary Maintenance is supposed to last a few minutes to one hour. + +The validator seat will be temporarily dropped from the block producing rotation during the maintenance. + +Since frequent offline maintenance is not encouraged, a certain part of reward from the validator will be deducted. + +To lower the impact from poorly-operating validators who forget to claim its maintenance, they will be forced to enter Temporary Maintenance mode too. + +## 3. Status + +This BEP is a draft. + +## 4. Motivation + +Due to the design of Parlia consensus, the absence of the validator, even if it is due to scheduled maintenance, will cause instability and capacity loss of BSC due to the extra waiting time and chain reorganization for other validators. + +Introducing Temporary Maintenance mode will stabilize the blocking rotation and maintain the capacity of BSC. + +## 5. Specification + +### Current Slash Mechanisms + +The [slash contract](https://bscscan.com/address/0x0000000000000000000000000000000000001001) will record the missed blocking metrics of each validator. + +1. Once the metrics are above the predefined threshold, the blocking reward for validator will not be relayed to BC for distribution but shared with other better validators. + +2. If the metrics remain above another higher level of threshold, the validator will be dropped from the rotation, and put as “in jail”. This will be propagated back to Binance Chain, where a predefined amount of BNB would be slashed from the self-delegated BNB of the validator. + +### Temporary Maintenance Mode + +[Temporary Maintenance Flow]() + +#### Positive Maintenance + +Validator can claim itself to enter scheduled maintenance by sending a transaction signed by the consensus key. + +A percentage of the collected reward will be distributed to the system reward contract within the transaction. + +The validator can claim itself to exit maintenance by sending another transaction. + +The maintenance should not last over a limited time, otherwise the validator will be slashed. + +#### Passive Maintenance + +Once the number of missed blocks is above a predefined threshold, the validator will enter maintenance automatically. + +The validator still gets a chance to catch up and claim itself online again. + +If it fails to be online within a predefined period, anyone(reward searcher) can enforce the validator online by sending a transaction, and the sender can get reward in return. The slash contract will convert the maintenance period into missed blocks and record it on-chain to lower the impact from the poor performance validator. + +#### Limit + +The number of maintained validators has an upper limit. Once exceeded, the following claim request will be rejected. + +A validator can only enter maintenance once per day. + +## 6. License + +The content is licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 5b9649b25c20ee3c3f90527c86781b8df0eb543b Mon Sep 17 00:00:00 2001 From: SolidityGo Date: Wed, 29 Dec 2021 17:27:52 +0800 Subject: [PATCH 2/5] BEP-99: update --- BEP99.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/BEP99.md b/BEP99.md index 507e58ea..7cdc937d 100644 --- a/BEP99.md +++ b/BEP99.md @@ -46,23 +46,25 @@ The [slash contract](https://bscscan.com/address/0x00000000000000000000000000000 [Temporary Maintenance Flow]() -#### Positive Maintenance +#### Proactive Maintenance -Validator can claim itself to enter scheduled maintenance by sending a transaction signed by the consensus key. +Validator can claim itself to enter scheduled maintenance by sending a transaction signed by the consensus key. The validator can claim itself to exit maintenance by sending another transaction. -A percentage of the collected reward will be distributed to the system reward contract within the transaction. +The slash cleaning work will be done within the exit transaction: -The validator can claim itself to exit maintenance by sending another transaction. +`SlashCount` = (`MaintenanceEndHeight` - `MaintenanceStartHeight`) / len(`currentValidatorSet`) / `Scale` -The maintenance should not last over a limited time, otherwise the validator will be slashed. +Scale is a governable parameter, the initial setting is 2, usually it should be larger than 1. If SlashCount is larger than a predefined value, the validator will still be slashed. + +The validator can get more time to bring the node back before being slashed if it claims itself to enter maintenance. + +Validator is encouraged to claim itself to exit maintenance even if it will be put in jail, since it can send the unjail transaction earlier. #### Passive Maintenance Once the number of missed blocks is above a predefined threshold, the validator will enter maintenance automatically. -The validator still gets a chance to catch up and claim itself online again. - -If it fails to be online within a predefined period, anyone(reward searcher) can enforce the validator online by sending a transaction, and the sender can get reward in return. The slash contract will convert the maintenance period into missed blocks and record it on-chain to lower the impact from the poor performance validator. +The validator still gets a chance to catch up and claim itself online again. #### Limit From af88ed02e61ff6a65377bcb3ddc59483378eb7e7 Mon Sep 17 00:00:00 2001 From: zjubfd <296179868@qq.com> Date: Mon, 10 Jan 2022 12:15:20 +0800 Subject: [PATCH 3/5] rename BEP99 to BEP127 --- BEP127.md | 57 ++++++++++++++++++++++++++++++++++++++++ BEP99.md | 77 ------------------------------------------------------- 2 files changed, 57 insertions(+), 77 deletions(-) create mode 100644 BEP127.md delete mode 100644 BEP99.md diff --git a/BEP127.md b/BEP127.md new file mode 100644 index 00000000..a18a9ad1 --- /dev/null +++ b/BEP127.md @@ -0,0 +1,57 @@ +# BEP-127: Temporary Maintenance Mode for Validators + +- [BEP-127: Temporary Maintenance Mode for Validators](#bep-99-temporary-maintenance-mode-for-validators) + - [1. Summary](#1-summary) + - [2. Abstract](#2-abstract) + - [3. Status](#3-status) + - [4. Motivation](#4-motivation) + - [5. Specification](#5-specification) + - [6. License](#6-license) + +## 1. Summary +This BEP introduces the **Temporary Maintenance** mode for validators on the Binance Smart Chain. + +## 2. Abstract +**Temporary Maintenance** is supposed to last one or a few hours. The validator seat will be temporarily dropped from the block producing rotation during the maintenance. Since long-time offline maintenance is not encouraged, the validator will still be slashed if the maintenance lasts too long. To lower the impact from poorly-operating validators who forget to claim its maintenance, they will be forced to enter **Temporary Maintenance** mode too. + +## 3. Status +Draft. + +## 4. Motivation +Due to the design of **Parlia** consensus, the absence of the validator, even if it is due to scheduled maintenance, will cause instability and capacity loss of BSC due to the extra waiting time and chain reorganization for other validators. Introducing **Temporary Maintenance** mode will stabilize the blocking rotation and maintain the capacity of BSC. + +## 5. Specification + +### Current Slash Mechanisms +The [slash contract](https://bscscan.com/address/0x0000000000000000000000000000000000001001) will record the missed blocking metrics of each validator. +- Once the metrics are above the predefined threshold, the blocking reward for validator will not be relayed to BC for distribution but shared with other better validators. +- If the metrics remain above another higher level of threshold, the validator will be dropped from the rotation, and put as “in jail”. This will be propagated back to Binance Chain, where a predefined amount of BNB would be slashed from the self-delegated BNB of the validator. + +### Temporary Maintenance Mode + +#### Proactive Maintenance +Validator can claim itself to enter scheduled maintenance by sending a transaction signed by the consensus key. The validator can claim itself to exit maintenance by sending another transaction. The slash cleaning work will be done within the exit transaction: + +**SlashCount = (MaintenanceEndHeight - MaintenanceStartHeight)/len(currentValidatorSet)/Scale** + +**Scale** is a governable parameter, the initial setting is 2, usually it should be larger than 1. If **SlashCount** is larger than a predefined value, the validator will still be slashed. The validator can get more time to bring the node back before being slashed if it claims itself to enter maintenance. Validator is encouraged to claim itself to exit maintenance even if it will be put in jail, since it can send the unjail transaction earlier. + +#### Passive Maintenance +Once the number of missed blocks is above a predefined threshold, the validator will enter maintenance automatically. The validator still gets a chance to catch up and claim itself online again. + +### Limit +1. The number of maintained validators has an upper limit at the same time. Once exceeded, the following proactive/passive claim request will be rejected. +2. A validator can only enter maintenance once per day. + +### ValidatorSet Change +The validators election will repeat every 24 hours, the maintenance will end immediately once election happens. + +### Impact to Validator Maintainers +Validator maintainers can claim the validator to enter maintenance mode once the node runs into unexpected issues. Validator maintainers need to send transactions to exit maintenance mode even if the validator is enforced into maintenance, otherwise, the validator may be put in jail. + +## 6. License + +The content is licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0/). + + + diff --git a/BEP99.md b/BEP99.md deleted file mode 100644 index 7cdc937d..00000000 --- a/BEP99.md +++ /dev/null @@ -1,77 +0,0 @@ -# BEP-99: Temporary Maintenance Mode for Validators - -- [BEP-99: Temporary Maintenance Mode for Validators](#bep-99-temporary-maintenance-mode-for-validators) - - [1. Summary](#1-summary) - - [2. Abstract](#2-abstract) - - [3. Status](#3-status) - - [4. Motivation](#4-motivation) - - [5. Specification](#5-specification) - - [6. License](#6-license) - -## 1. Summary - -This BEP introduces the Temporary Maintenance mode for validators on the Binance Smart Chain. - -## 2. Abstract - -Temporary Maintenance is supposed to last a few minutes to one hour. - -The validator seat will be temporarily dropped from the block producing rotation during the maintenance. - -Since frequent offline maintenance is not encouraged, a certain part of reward from the validator will be deducted. - -To lower the impact from poorly-operating validators who forget to claim its maintenance, they will be forced to enter Temporary Maintenance mode too. - -## 3. Status - -This BEP is a draft. - -## 4. Motivation - -Due to the design of Parlia consensus, the absence of the validator, even if it is due to scheduled maintenance, will cause instability and capacity loss of BSC due to the extra waiting time and chain reorganization for other validators. - -Introducing Temporary Maintenance mode will stabilize the blocking rotation and maintain the capacity of BSC. - -## 5. Specification - -### Current Slash Mechanisms - -The [slash contract](https://bscscan.com/address/0x0000000000000000000000000000000000001001) will record the missed blocking metrics of each validator. - -1. Once the metrics are above the predefined threshold, the blocking reward for validator will not be relayed to BC for distribution but shared with other better validators. - -2. If the metrics remain above another higher level of threshold, the validator will be dropped from the rotation, and put as “in jail”. This will be propagated back to Binance Chain, where a predefined amount of BNB would be slashed from the self-delegated BNB of the validator. - -### Temporary Maintenance Mode - -[Temporary Maintenance Flow]() - -#### Proactive Maintenance - -Validator can claim itself to enter scheduled maintenance by sending a transaction signed by the consensus key. The validator can claim itself to exit maintenance by sending another transaction. - -The slash cleaning work will be done within the exit transaction: - -`SlashCount` = (`MaintenanceEndHeight` - `MaintenanceStartHeight`) / len(`currentValidatorSet`) / `Scale` - -Scale is a governable parameter, the initial setting is 2, usually it should be larger than 1. If SlashCount is larger than a predefined value, the validator will still be slashed. - -The validator can get more time to bring the node back before being slashed if it claims itself to enter maintenance. - -Validator is encouraged to claim itself to exit maintenance even if it will be put in jail, since it can send the unjail transaction earlier. - -#### Passive Maintenance - -Once the number of missed blocks is above a predefined threshold, the validator will enter maintenance automatically. - -The validator still gets a chance to catch up and claim itself online again. - -#### Limit - -The number of maintained validators has an upper limit. Once exceeded, the following claim request will be rejected. - -A validator can only enter maintenance once per day. - -## 6. License - -The content is licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 9f69c28282fbae8f1e1b36d395f9a7e95e83dab0 Mon Sep 17 00:00:00 2001 From: zjubfd <296179868@qq.com> Date: Mon, 10 Jan 2022 12:16:31 +0800 Subject: [PATCH 4/5] update readme for bep127 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 53ad5489..232ef8f1 100644 --- a/README.md +++ b/README.md @@ -26,4 +26,4 @@ Here are the list of subjects of BEPs: * [BEP-91](BEP91.md): Increase Block Gas Ceiling for Binance Smart Chain * [BEP-93](BEP93.md): Diff Sync Protocol on BSC * [BEP-95](BEP95.md): Introduce Real-Time Burning Mechanism - +* [BEP-127](BEP127.md): Temporary Maintenance Mode for Validators From 42ca896051f0b44bcd9565236327c1e2649f993c Mon Sep 17 00:00:00 2001 From: SolidityGo Date: Thu, 17 Feb 2022 15:11:46 +0800 Subject: [PATCH 5/5] feat: modify bsc to BNB Smart Chain --- BEP127.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BEP127.md b/BEP127.md index a18a9ad1..88f0ade4 100644 --- a/BEP127.md +++ b/BEP127.md @@ -9,7 +9,7 @@ - [6. License](#6-license) ## 1. Summary -This BEP introduces the **Temporary Maintenance** mode for validators on the Binance Smart Chain. +This BEP introduces the **Temporary Maintenance** mode for validators on the BNB Smart Chain. ## 2. Abstract **Temporary Maintenance** is supposed to last one or a few hours. The validator seat will be temporarily dropped from the block producing rotation during the maintenance. Since long-time offline maintenance is not encouraged, the validator will still be slashed if the maintenance lasts too long. To lower the impact from poorly-operating validators who forget to claim its maintenance, they will be forced to enter **Temporary Maintenance** mode too. @@ -25,7 +25,7 @@ Due to the design of **Parlia** consensus, the absence of the validator, even if ### Current Slash Mechanisms The [slash contract](https://bscscan.com/address/0x0000000000000000000000000000000000001001) will record the missed blocking metrics of each validator. - Once the metrics are above the predefined threshold, the blocking reward for validator will not be relayed to BC for distribution but shared with other better validators. -- If the metrics remain above another higher level of threshold, the validator will be dropped from the rotation, and put as “in jail”. This will be propagated back to Binance Chain, where a predefined amount of BNB would be slashed from the self-delegated BNB of the validator. +- If the metrics remain above another higher level of threshold, the validator will be dropped from the rotation, and put as “in jail”. This will be propagated back to BNB Beacon Chain, where a predefined amount of BNB would be slashed from the self-delegated BNB of the validator. ### Temporary Maintenance Mode