-
Notifications
You must be signed in to change notification settings - Fork 1
supernode: postpone on low balance #90
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
base: master
Are you sure you want to change the base?
Conversation
All issues resolved. The previous issue about logging when supernode account address parsing fails has been addressed in this commit.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
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.
Pull request overview
This PR introduces a balance-based postponement mechanism for supernodes and improves state validation safety. When a supernode's account balance falls below 1 LUME (1,000,000 ulume), the supernode is automatically marked as POSTPONED during EndBlock processing. Additionally, the PR refactors the SetSuperNode function to validate account uniqueness before mutating state, preventing partial state updates when validation fails.
- Added balance check in metrics staleness handler to postpone supernodes with insufficient funds
- Refactored SetSuperNode to validate account conflicts before state mutation
- Added comprehensive tests for balance-based postponement
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| x/supernode/v1/keeper/metrics_staleness.go | Added balance check logic to postpone supernodes with < 1 LUME spendable balance, defined constants for denomination and minimum balance |
| x/supernode/v1/keeper/metrics_staleness_test.go | New test file with tests for balance-based postponement at boundary conditions (below and at 1 LUME) |
| x/supernode/v1/keeper/supernode.go | Moved account uniqueness validation before state mutation to prevent partial updates on validation failure |
| x/supernode/v1/keeper/supernode_by_account_internal_test.go | Added test to verify failed writes don't mutate state, confirming the validation refactoring works correctly |
| x/supernode/v1/keeper/abci.go | Updated documentation to reflect new balance-based postponement behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.