Skip to content

fix(wstaking): block region moves with delegations#1234

Open
jamilahmadzai wants to merge 1 commit into
openmetaearth:mainfrom
jamilahmadzai:fix/wstaking-block-region-reassignment-1230
Open

fix(wstaking): block region moves with delegations#1234
jamilahmadzai wants to merge 1 commit into
openmetaearth:mainfrom
jamilahmadzai:fix/wstaking-block-region-reassignment-1230

Conversation

@jamilahmadzai

Copy link
Copy Markdown
Contributor

Summary

Fixes #1230.

This blocks UpdateValidator region reassignment when the old region still has active delegated funds. The current flow calls UnBondRegion(oldRegionId), which clears the old region operator before users in that region can safely undelegate, delegate again, or withdraw rewards. Rejecting the reassignment while DelegateAmount is non-zero keeps the old region state intact and avoids locking those delegations behind an empty operator address.

A reassignment with no delegated funds still follows the existing path and binds the validator to the new empty region.

Tests

  • go test ./x/wstaking/keeper -run 'TestKeeperTestSuite/TestUpdateValidator(RejectsRegionMoveWithDelegations|MovesRegionWithoutDelegations)$' -count=1 -v
  • go test ./x/wstaking/keeper -count=1
  • go test ./x/wstaking/... -count=1
  • git diff --check

Bounty payout

Meta Earth bug bounty payout in $MEC via ME Pass: me1ya82w6cjflk9r2qeyfeu64sm7gxtfr7mu62w9j

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG BOUNTY] [High] [wstaking] UpdateValidator Region Reassignment Permanently Locks All Delegated Funds in Old Region

1 participant