-
Notifications
You must be signed in to change notification settings - Fork 204
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
[DRAFT][TEST-12] Add DelegateOnHost
ICA call
#12
Conversation
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.
Leaving a few quick/early comments on this one, seems like it's still in DRAFT
// we could make these fields repeated for more granularity, if we want | ||
ICAAccount rewardsAccount = 5; | ||
ICAAccount feeAccount = 6; | ||
ICAAccount delegationAccount = 8; |
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 was holding we'd keep a list of delegatoinAccounts in case we want to move to governance pass through later. You thinking it's easier to start with a single account on each host zone for now?
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 think for the MVP it might be easier to start with one (because we won't have pass through governance at launch). Even if we do launch with multiple I think we should push that to a later ticket (just so that we can get something working). Wdyt?
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.
Agreed!
stride/x/stakeibc/keeper/ica.go
Outdated
// How can we fetch chainId here? | ||
chainId := "hardcoded-chainId" | ||
// Sanity check the output of account.GetTarget() (not sure if it prints an int or a stringified ICAAccountType) | ||
owner := fmt.Sprintf("%s-%s-%s", account.GetAddress(), chainId, account.GetTarget().String()) |
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.
Does GetTarget() need to be implemented?
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.
It gets auto-generated for us
stride/x/stakeibc/keeper/ica.go
Outdated
) | ||
|
||
// SubmitTx submits an ICA transaction | ||
// NOTE: this is not a standard message; only the stakeibc module can call this function |
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 are we enforcing "only the stakeibc module can call this function"?
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.
It's not in the message server so clients can't call it (fairly sure). There are no formal checks (but it's not being called by any other modules and would require a code update for that to be the case)
stride/x/stakeibc/keeper/ica.go
Outdated
|
||
// RegisterAccount registers an ICA account on behalf of the stakeibc module | ||
// NOTE: this is not a standard message; only the stakeibc module can call this function | ||
func (k Keeper) RegisterAccount(goCtx context.Context, connectionId string, owner string) (*types.ICAAccount, error) { |
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.
Why is RegisterAccount included in this commit? Seems like it would be used in InitGenesis rathre than DelegateOnHost. Perhaps you're planning to add logic that opens an ICA account on a hostZone if one does not yet exist when DelegateOnHost is called?
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.
That's what I was planning on, but regardless this is just a function - it's being called anywhere yet (even if it's only used in InitGenesis, it needs to be defined somewhere)
ICA calls are now working. Note, they still need to be invoked by a client. There were a number of bug fixes / additions bugs fixed
updates include
for part 3
Going to close this in favor of breaking this PR up into 3 distinct pieces
|
Fill out emoney-3 chain information
Summary
Add
DelegateOnHost
function to send an ICAMsgDelegate
tx. This is an outline of how the logic could work, but isn't functional yet. There are a number of issues to resolve (tickets marked as blockers on TEST-12 on JIRA). Some high level questionsamount
to stake?For more detail, see https://stridelabs.atlassian.net/jira/software/projects/TEST/boards/2?selectedIssue=TEST-12
Test plan
draft PR