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
POC: Distribute to waiting from auction based on leaving nodes #6114
POC: Distribute to waiting from auction based on leaving nodes #6114
Conversation
@@ -88,6 +88,14 @@ func (sdps *StakingDataProviderStub) GetNumOfValidatorsInCurrentEpoch() uint32 { | |||
return 0 | |||
} | |||
|
|||
func (sdps *StakingDataProviderStub) GetCurrentEpochValidatorStats() epochStart.ValidatorStatsInEpoch { |
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.
add comment.
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.
Added comm
} | ||
|
||
// If no previous list is set, means that staking v4 is not activated or node is leaving right before activation | ||
// and this node will be considered as eligible by the nodes coordinator with legacy bug. |
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.
with old code.
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.
Refactored
// If no previous list is set, means that staking v4 is not activated or node is leaving right before activation | ||
// and this node will be considered as eligible by the nodes coordinator with legacy bug. | ||
// Otherwise, it will have it set, and we should check its previous list in the current epoch | ||
if len(validatorPreviousList) == 0 || validatorPreviousList == common.EligibleList || validatorPreviousList == common.WaitingList { |
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.
return directly. no need for if.
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.
Right, good suggestion
…-list-distribution-leaving-nodes
Reasoning behind the pull request
Proposed changes
Testing procedure
TestChainSimulator_UnStakeOneActiveNodeAndCheckAPIAuctionList
Scenario 1:
Scenario 2:
At all times for all these tests, we should always have in system eligible + waiting nodes <= maxNumNodes from config.
Please check this at all times