-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: add restaking client and invariants #56
Conversation
x/restaking/client/cli/query.go
Outdated
// GetPoolsQueryCmd returns the command allowing to query pools | ||
func GetPoolsQueryCmd() *cobra.Command { | ||
queryCmd := &cobra.Command{ | ||
Use: "pools", |
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.
How about use "pool"
instead? That way, the full command will look like:
milkywayd tx restaking pool delegations 1
milkywayd tx restaking pool delegation 1 init1...
x/restaking/client/cli/tx.go
Outdated
txCmd.AddCommand( | ||
GetPoolsTxCmd(), | ||
GetOperatorsTxCmd(), | ||
GetServicesTxCmd(), | ||
) |
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 understand it's just a personal preference, but here are my suggestions:
milkywayd tx restaking delegate-pool 1000000umilk
milkywayd tx restaking delegate-operator 1 1000000umilk
milkywayd tx restaking delegate-service 2 1000000umilk
Or
milkywayd tx restaking delegate pool 1000000umilk
milkywayd tx restaking delegate operator 1 1000000umilk
milkywayd tx restaking delegate service 2 1000000umilk
What do you think?
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.
Thanks for the suggestion, will update it to follow the second one (delegate <pool|operator|service>
) 🙏
x/restaking/keeper/invariants.go
Outdated
poolsBroken := !poolsBalances.Equal(poolsTokens) | ||
operatorsBroken := !operatorsBalances.Equal(operatorsTokens) | ||
servicesBroken := !servicesBalances.Equal(servicesTokens) |
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.
We should these instead:
poolsBroken := !poolsBalances.Equal(poolsTokens) | |
operatorsBroken := !operatorsBalances.Equal(operatorsTokens) | |
servicesBroken := !servicesBalances.Equal(servicesTokens) | |
poolsBroken := !poolsBalances.IsAllGTE(poolsTokens) | |
operatorsBroken := !operatorsBalances.IsAllGTE(operatorsTokens) | |
servicesBroken := !servicesBalances.IsAllGTE(servicesTokens) |
Because an attacker can send assets to the module addresses to halt the chain with this invariant.
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.
@RiccardoM Can you check this again please?
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.
Fixed. Must've been the rebase that brought it back 🤦
feat: rename pools command to pool instead
feat: rename pools query command to pool
9dfb3a4
to
5d0f213
Compare
x/restaking/keeper/invariants.go
Outdated
poolsBroken := !poolsBalances.Equal(poolsTokens) | ||
operatorsBroken := !operatorsBalances.Equal(operatorsTokens) | ||
servicesBroken := !servicesBalances.Equal(servicesTokens) |
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.
@RiccardoM Can you check this again please?
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.
LGTM!
Description
This PR adds the
x/restaking
CLI client as well as invariants.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change