Skip to content
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

x/stake: Speed up handleMsgEditValidator #1862

Merged
merged 1 commit into from
Jul 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ IMPROVEMENTS
* [tests] Fixes ansible scripts to work with AWS too
* [tests] \#1806 CLI tests are now behind the build flag 'cli_test', so go test works on a new repo
* [x/gov] Initial governance parameters can now be set in the genesis file
* [x/stake] \#1815 Sped up the processing of `EditValidator` txs.

BUG FIXES
* \#1666 Add intra-tx counter to the genesis validators
Expand Down
4 changes: 3 additions & 1 deletion x/stake/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ func handleMsgEditValidator(ctx sdk.Context, msg types.MsgEditValidator, k keepe
}
validator.Description = description

k.UpdateValidator(ctx, validator)
// We don't need to run through all the power update logic within k.UpdateValidator
// We just need to override the entry in state, since only the description has changed.
k.SetValidator(ctx, validator)
tags := sdk.NewTags(
tags.Action, tags.ActionEditValidator,
tags.DstValidator, []byte(msg.ValidatorAddr.String()),
Expand Down
4 changes: 2 additions & 2 deletions x/stake/keeper/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ func (k Keeper) ClearTendermintUpdates(ctx sdk.Context) {

//___________________________________________________________________________

// Perfom all the nessisary steps for when a validator changes its power. This
// Perfom all the necessary steps for when a validator changes its power. This
// function updates all validator stores as well as tendermint update store.
// It may kick out validators if new validator is entering the bonded validator
// It may kick out validators if a new validator is entering the bonded validator
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think it was worth the overhead of making a separate PR for these typo fixes, so I just included it here.

// group.
//
// nolint: gocyclo
Expand Down