-
Notifications
You must be signed in to change notification settings - Fork 749
Description
Summary
Add a new MsgServer to 27-interchain-accounts which exposes two distinct rpc endpoints:
RegisterAccountSubmitTx
Problem Definition
The current design implemented in 27-interchain-accounts mandates that a base application referred to as an authentication module is developed in order to provide custom authentication as an entrypoint to interchain accounts. In this approach an application developer is expected to compose their base application (authentication module) with the ICS27 controllerKeeper and leverage the exported APIs exposed for account registration and sending of interchain accounts transactions.
Since the release of cosmos-sdk v0.46.x, the new design of x/gov and x/group allow for arbitrary message passing via the cosmos-sdk's MsgServiceRouter. When a proposal is accepted it allows the state machine to execute an arbitrary number of sdk.Msgs. Since this functionality has been introduced it has become clear that x/gov and x/group act as authentication modules with respect to interchain accounts integration.
Proposal
Introduce a new MsgServer to 27-interchain-accounts/controller and incrementally move towards deprecation of public APIs.
This allows for existing app developers to simply change their code from a public API (RegisterInterchainAccount / SendTx) call to message passing, whereby one would compose their app with the cosmos-sdk MsgServiceRouter and retrieve the handler appropriately based on the message typeURL, as is done in many existing modules such as x/gov, x/group as well as 27-interchain-accounts/host. This provides a more standardised approach to integrating with interchain accounts.
RegisterAccount
Introduce a new rpc endpoint RegisterAccount. This rpc should provide the existing functionality of the exported RegisterInterchainAccount function in 27-interchain-accounts/controller.
- Add
RegisterAccountrpc and proto message definitions #2051 - Implement
sdk.Msginterface forMsgRegisterAccount#2053 - Implement the rpc handler method for
RegisterAccount#2055 - Add CLI for new ics27
RegisterAccountrpc #2061
service Msg {
rpc RegisterAccount(MsgRegisterAccount) returns (MsgRegisterAccountResponse);
...
}
message MsgRegisterAccount {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
string owner = 1;
string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""];
string version = 3;
}
message MsgRegisterAccountResponse {
string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""];
}SubmitTx
Introduce a new rpc endpoint SubmitTx. This rpc should provide the existing functionality of the exported SendTx function in 27-interchain-accounts/controller.
- Add
SendTxrpc and proto message definitions #2052 - Implement
sdk.Msginterface forMsgSendTx#2054 - Implement the rpc handler method for
SendTx#2056 - Add CLI for new ics27
SendTxrpc #2062
service Msg {
...
rpc SubmitTx(MsgSubmitTx) returns (MsgSubmitTxResponse);
}
message MsgSubmitTx {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
string owner = 1;
string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""];
InterchainAccountPacketData packet_data = 3 [(gogoproto.moretags) = "yaml:\"packet_data\""];
ibc.core.client.v1.Height timeout_height = 4 [(gogoproto.moretags) = "yaml:\"timeout_height\""];
uint64 timeout_timestamp = 5 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""];
}
message MsgSubmitTxResponse {
uint64 sequence = 1;
}For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate contributors tagged/assigned