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
FIX: Low waiting list edge case in StakingV4Step2 #5111
FIX: Low waiting list edge case in StakingV4Step2 #5111
Conversation
// Epoch = 0, before staking v4, owner2 stakes 2 nodes | ||
// - maxNumNodes = 20 | ||
// - activeNumNodes = 10 | ||
// Newly staked nodes should be sent tu new list |
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.
tu -> to
@@ -325,7 +326,7 @@ func shuffleNodes(arg shuffleNodesArg) (*ResUpdateNodes, error) { | |||
} | |||
} | |||
|
|||
if shouldDistributeShuffledToWaiting(shuffledNodesCfg) { | |||
if !arg.flagStakingV4Step2 || lowWaitingList { |
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.
if lowWaitingList is true, it will distributeValidators 2 times? Once on line 318 and once on line 329?
if !shuffledNodesCfg.flagStakingV4Step2 { | ||
return true | ||
return false |
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.
some unitTest should have failed here. Can you please add an unit test?
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## feat/staking-v4 #5111 +/- ##
==================================================
Coverage ? 71.03%
==================================================
Files ? 690
Lines ? 88960
Branches ? 0
==================================================
Hits ? 63197
Misses ? 21078
Partials ? 4685 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Reasoning behind the pull request
Proposed changes
Testing procedure
!!! For both 1. & 2. we should have numNodes (active + waiting) <= 46 !!!
Meanwhile, nodes config should be unchanged,e.g.:
feat/staking-v4
( before fix )StakingV4Step1EnableEpoch = 4
stake 2 nodes. Both nodes should be in auction. Checkvalidator/auction
StakingV4Step2EnableEpoch = 5
the nodes above should still be in auction.StakingV4Step2EnableEpoch = 6
those nodes should have been distributed to waiting listMX-13983-fix-edge-case-auction-stakingv4step2
( after fix )StakingV4Step1EnableEpoch = 4
stake 2 nodes. Both nodes should be in auction. Checkvalidator/auction
StakingV4Step2EnableEpoch = 5
the nodes above should be distributed to waiting list.StakingV4Step2EnableEpoch = 6
those nodes should still be in waiting(or already eligibile, depending on the configuration)Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?