forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only add non-empty rewards as delegation when processing delegation s…
…witches (MystenLabs#7581) Right now when we process delegation switches at epoch changes, we add the rewards portion of the stake as a delegation to the new validator directly without checking whether the rewards are empty or not. When the rewards are empty, it will cause the `request_add_delegation` code to abort because `request_add_delegation` asserts that the new delegate stake has balance > 0. This PR adds a check before we add the rewards as new delegation, and a unit test for switching delegation when rewards == 0.
- Loading branch information
Showing
4 changed files
with
78 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters