-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
R4R: implement validator queue #2451
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2451 +/- ##
==========================================
Coverage ? 61.93%
==========================================
Files ? 150
Lines ? 9476
Branches ? 0
==========================================
Hits ? 5869
Misses ? 3199
Partials ? 408 |
x/stake/handler.go
Outdated
} | ||
k.UnbondingToUnbonded(ctx, val) | ||
|
||
// endBlockerTags.AppendTags(sdk.NewTags( |
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.
Should this be deleted/uncommented ?
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.
Dopeness! Thanks for this! - few comments
got = handleMsgBeginUnbonding(ctx, msgBeginUnbondingValidator, keeper) | ||
require.True(t, got.IsOK(), "expected no error: %v", got) | ||
var finishTime time.Time | ||
types.MsgCdc.MustUnmarshalBinary(got.Data, &finishTime) |
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.
I guess this is okay - I think it would be a bit nicer if we queried for the validator, and used the finish time from that object
@sunnya97 Any chance you can address these comments today so we can get this merged? |
Lets try to get this in today cc @cwgoes @rigelrozanski @jaekwon |
It's failing |
Does this have to do with the non-determinism @cwgoes |
Not the lint, maybe |
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.
A few concerns, see comments.
x/stake/keeper/validator.go
Outdated
} | ||
|
||
// Returns a concatenated list of all the timeslices before currTime, and deletes the timeslices from the queue | ||
func (k Keeper) DequeueAllMatureValidatorQueue(ctx sdk.Context, currTime time.Time) (matureValsAddrs []sdk.ValAddress) { |
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.
Why do we copy these into memory instead of executing the validator state transition during iteration?
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.
Left over from the Unbonding/Redelegations queue where the actual unbonding was done in the Handler, so it could add tags (and not double iterate)
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.
Maybe keeping a separate GetAllMatureValidatorQueue
function could be useful for a future querier endpoint.
I think |
yeah there's some non-determinism lingering - I noticed it in some other PRs forsure |
LGTM - giving @rigelrozanski a chance to final-review. |
Nice job @sunnya97 🎉 !!! |
closes #2412
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerFor Admin Use: