Skip to content

Conversation

@mateeullahmalik
Copy link
Contributor

No description provided.

@roomote
Copy link

roomote bot commented Jan 5, 2026

Rooviewer Clock   See task on Roo Cloud

All issues resolved. The previous issue about logging when supernode account address parsing fails has been addressed in this commit.

  • Add logging when supernode account address parsing fails in balance check
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Copy link
Contributor

Copilot AI left a 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.

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.

3 participants