# ICA Testing
Proposal to change the AllowMessages key:
{
"title": "ICA host allowed messages param change",
"description": "Update host allow messages",
"changes": [
{
"subspace": "ibc",
"key": "AllowMessages",
"value": ["*"] // or whatever messages you want to have here
}
],
"deposit": "100stake"
}
## 2022-09-22
### Set up chains and relayer
Use hermes playbook
### Recover validator-40 keys
On chain1:
```
gaiad keys add controller --recover
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art
```
### Establish an ICA on chain2 controlled by chain1
On chain1:
```
gaiad tx icamauth register --from controller --connection-id connection-0 --connection-id connection-0 --gas-prices 0.001uatom
```
### Query the ICA address
On chain1:
```
gaiad q icamauth interchainaccounts connection-0 chain1_validator_address
```
**-> Failed**
## 2022-09-23
Try again on the devnet
## Establish an ICA on chain2 controlled by chain1
On chain1:
```
gaiad tx icamauth register --from controller --connection-id connection-0 --connection-id connection-0 --gas-prices 0.05uatom
```
### Query the ICA address
On chain1:
```
gaiad q icamauth interchainaccounts connection-0 controller
```
**-> Failed**
## 2022-09-25
Try again with the modified genesis file (`"allow_messages": ["*"]"`)
### Recover validator-40 keys
On chain1:
```
gaiad keys add controller --recover
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art
```
## Establish an ICA on chain2 controlled by chain1
On chain1:
```
gaiad tx icamauth register --from controller --connection-id connection-0 --connection-id connection-0 --gas-prices 0.001uatom
auth_info:
fee:
amount:
- amount: "200"
denom: uatom
gas_limit: "200000"
granter: ""
payer: ""
signer_infos: []
tip: null
body:
extension_options: []
memo: ""
messages:
- '@type': /gaia.icamauth.v1beta1.MsgRegisterAccount
connection_id: connection-0
owner: cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
version: ""
non_critical_extension_options: []
timeout_height: "0"
signatures: []
confirm transaction before signing and broadcasting [y/N]: y
code: 0
codespace: ""
data: ""
events: []
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: C3F9D13DA54230DAF9CCD81F5F9F06FB20A1B0B0B7963FEA4D879F458FB6B47C
```
Hermes log doesn't show anything
### Query the ICA address
On chain1:
```
gaiad q icamauth interchainaccounts connection-0 controller
```
## 2022-09-27
Try again with the modified genesis file (`"allow_messages": ["*"]"`)
### Recover validator-40 keys
On chain1:
```
gaiad keys add controller --recover
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art
```
### Establish an ICA on chain2 controlled by chain1
On chain1:
```
gaiad tx icamauth register cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl --from controller --connection-id connection-0 --connection-id connection-0 --gas-prices 0.001uatom
```
### Query the ICA address
On chain1:
```
gaiad q icamauth interchainaccounts connection-0 cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
```
Failed: ask Yaru about this.
**Per Yaru: the hermes config must have `mode.channels.enabled=true`**
Try again with the mode.connections and mode.channels enabled:
### Recover validator-40 keys
On chain1:
```
gaiad keys add controller --recover --keyring-backend test
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art
```
### Establish an ICA on chain2 controlled by chain1
On chain1:
```
gaiad tx icamauth register cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl --from controller --connection-id connection-0 --connection-id connection-0 --gas-prices 0.001uatom
```
The hermes log shows this:
```
Sep 27 10:11:59 dante-rho-test hermes[50110]: 2022-09-27T14:11:59.690890Z INFO ThreadId(24) wait_for_block_commits: waiting for commit of tx hashes(s) 97930F4F0AB6A34DB0ABC5CFC66FA3CDA1965E67412981AA31AA6BB16072893E id=chain2
Sep 27 10:12:01 dante-rho-test hermes[50110]: 2022-09-27T14:12:01.803767Z INFO ThreadId(183) worker.channel{channel=channel::channel-1/icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl:chain1->chain2}: 🎊 chain2 => IbcEventWithHeight {
Sep 27 10:12:01 dante-rho-test hermes[50110]: event: OpenTryChannel(
Sep 27 10:12:01 dante-rho-test hermes[50110]: OpenTry {
Sep 27 10:12:01 dante-rho-test hermes[50110]: port_id: PortId(
Sep 27 10:12:01 dante-rho-test hermes[50110]: "icahost",
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: channel_id: Some(
Sep 27 10:12:01 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:01 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: connection_id: ConnectionId(
Sep 27 10:12:01 dante-rho-test hermes[50110]: "connection-0",
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: counterparty_port_id: PortId(
Sep 27 10:12:01 dante-rho-test hermes[50110]: "icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl",
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: counterparty_channel_id: Some(
Sep 27 10:12:01 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:01 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: },
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: height: Height {
Sep 27 10:12:01 dante-rho-test hermes[50110]: revision: 0,
Sep 27 10:12:01 dante-rho-test hermes[50110]: height: 43,
Sep 27 10:12:01 dante-rho-test hermes[50110]: },
Sep 27 10:12:01 dante-rho-test hermes[50110]: }
Sep 27 10:12:01 dante-rho-test hermes[50110]: 2022-09-27T14:12:01.803852Z INFO ThreadId(183) worker.channel{channel=channel::channel-1/icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl:chain1->chain2}: channel handshake step completed with events: OpenTryChannel(
Sep 27 10:12:01 dante-rho-test hermes[50110]: OpenTry {
Sep 27 10:12:01 dante-rho-test hermes[50110]: port_id: PortId(
Sep 27 10:12:01 dante-rho-test hermes[50110]: "icahost",
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: channel_id: Some(
Sep 27 10:12:01 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:01 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: connection_id: ConnectionId(
Sep 27 10:12:01 dante-rho-test hermes[50110]: "connection-0",
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: counterparty_port_id: PortId(
Sep 27 10:12:01 dante-rho-test hermes[50110]: "icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl",
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: counterparty_channel_id: Some(
Sep 27 10:12:01 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:01 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: ),
Sep 27 10:12:01 dante-rho-test hermes[50110]: },
Sep 27 10:12:01 dante-rho-test hermes[50110]: )
Sep 27 10:12:11 dante-rho-test hermes[50110]: 2022-09-27T14:12:11.919763Z INFO ThreadId(23) wait_for_block_commits: waiting for commit of tx hashes(s) D753D003630B07C28C66256DE9D409ED3C2A526BD6B2E6B920B333AC69CD28C9 id=chain1
Sep 27 10:12:14 dante-rho-test hermes[50110]: 2022-09-27T14:12:14.639167Z INFO ThreadId(202) worker.channel{channel=channel::channel-1/icahost:chain2->chain1}: 🎊 chain1 => IbcEventWithHeight {
Sep 27 10:12:14 dante-rho-test hermes[50110]: event: OpenAckChannel(
Sep 27 10:12:14 dante-rho-test hermes[50110]: OpenAck {
Sep 27 10:12:14 dante-rho-test hermes[50110]: port_id: PortId(
Sep 27 10:12:14 dante-rho-test hermes[50110]: "icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl",
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: channel_id: Some(
Sep 27 10:12:14 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:14 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: counterparty_channel_id: Some(
Sep 27 10:12:14 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:14 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: connection_id: ConnectionId(
Sep 27 10:12:14 dante-rho-test hermes[50110]: "connection-0",
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: counterparty_port_id: PortId(
Sep 27 10:12:14 dante-rho-test hermes[50110]: "icahost",
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: },
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: height: Height {
Sep 27 10:12:14 dante-rho-test hermes[50110]: revision: 0,
Sep 27 10:12:14 dante-rho-test hermes[50110]: height: 61,
Sep 27 10:12:14 dante-rho-test hermes[50110]: },
Sep 27 10:12:14 dante-rho-test hermes[50110]: }
Sep 27 10:12:14 dante-rho-test hermes[50110]: 2022-09-27T14:12:14.639262Z INFO ThreadId(202) worker.channel{channel=channel::channel-1/icahost:chain2->chain1}: channel handshake step completed with events: OpenAckChannel(
Sep 27 10:12:14 dante-rho-test hermes[50110]: OpenAck {
Sep 27 10:12:14 dante-rho-test hermes[50110]: port_id: PortId(
Sep 27 10:12:14 dante-rho-test hermes[50110]: "icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl",
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: channel_id: Some(
Sep 27 10:12:14 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:14 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: counterparty_channel_id: Some(
Sep 27 10:12:14 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:14 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: connection_id: ConnectionId(
Sep 27 10:12:14 dante-rho-test hermes[50110]: "connection-0",
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: counterparty_port_id: PortId(
Sep 27 10:12:14 dante-rho-test hermes[50110]: "icahost",
Sep 27 10:12:14 dante-rho-test hermes[50110]: ),
Sep 27 10:12:14 dante-rho-test hermes[50110]: },
Sep 27 10:12:14 dante-rho-test hermes[50110]: )
Sep 27 10:12:24 dante-rho-test hermes[50110]: 2022-09-27T14:12:24.999543Z INFO ThreadId(24) wait_for_block_commits: waiting for commit of tx hashes(s) 88F63744A1D180BA9ADF57671ECF45BC1900FF806B4F5F25ADB5DDD7ED43B9F0 id=chain2
Sep 27 10:12:26 dante-rho-test hermes[50110]: 2022-09-27T14:12:26.817198Z INFO ThreadId(183) worker.channel{channel=channel::channel-1/icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl:chain1->chain2}: 🎊 chain2 => IbcEventWithHeight {
Sep 27 10:12:26 dante-rho-test hermes[50110]: event: OpenConfirmChannel(
Sep 27 10:12:26 dante-rho-test hermes[50110]: OpenConfirm {
Sep 27 10:12:26 dante-rho-test hermes[50110]: port_id: PortId(
Sep 27 10:12:26 dante-rho-test hermes[50110]: "icahost",
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: channel_id: Some(
Sep 27 10:12:26 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:26 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: connection_id: ConnectionId(
Sep 27 10:12:26 dante-rho-test hermes[50110]: "connection-0",
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: counterparty_port_id: PortId(
Sep 27 10:12:26 dante-rho-test hermes[50110]: "icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl",
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: counterparty_channel_id: Some(
Sep 27 10:12:26 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:26 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: },
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: height: Height {
Sep 27 10:12:26 dante-rho-test hermes[50110]: revision: 0,
Sep 27 10:12:26 dante-rho-test hermes[50110]: height: 48,
Sep 27 10:12:26 dante-rho-test hermes[50110]: },
Sep 27 10:12:26 dante-rho-test hermes[50110]: }
Sep 27 10:12:26 dante-rho-test hermes[50110]: 2022-09-27T14:12:26.817268Z INFO ThreadId(183) worker.channel{channel=channel::channel-1/icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl:chain1->chain2}: channel handshake step completed with events: OpenConfirmChannel(
Sep 27 10:12:26 dante-rho-test hermes[50110]: OpenConfirm {
Sep 27 10:12:26 dante-rho-test hermes[50110]: port_id: PortId(
Sep 27 10:12:26 dante-rho-test hermes[50110]: "icahost",
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: channel_id: Some(
Sep 27 10:12:26 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:26 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: connection_id: ConnectionId(
Sep 27 10:12:26 dante-rho-test hermes[50110]: "connection-0",
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: counterparty_port_id: PortId(
Sep 27 10:12:26 dante-rho-test hermes[50110]: "icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl",
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: counterparty_channel_id: Some(
Sep 27 10:12:26 dante-rho-test hermes[50110]: ChannelId(
Sep 27 10:12:26 dante-rho-test hermes[50110]: "channel-1",
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: ),
Sep 27 10:12:26 dante-rho-test hermes[50110]: },
Sep 27 10:12:26 dante-rho-test hermes[50110]: )
```
### Query the ICA address
On chain1:
```
gaiad q icamauth interchainaccounts connection-0 cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
interchain_account_address: cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf
```
ICA address: `cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf`
### Fund the ICA address in chain 2
Recover the controller account in chain2
```
gaiad keys add controller --recover --keyring-backend test
> Enter your bip39 mnemonic
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art
- address: cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
name: controller
pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"ArpmqEz3g5rxcqE+f8n15wCMuLyhWF+PO6+zA57aPB/d"}'
type: local
```
Send funds from controller to the ICA address within chain2
```
gaiad tx bank send cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf 100000000uatom --gas-prices 0.001uatom
```
Query the ICA address in chain2
```
gaiad q bank balances cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf
balances:
- amount: "100000000"
denom: uatom
pagination:
next_key: null
total: "0"
gaiad q account cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf
'@type': /ibc.applications.interchain_accounts.v1.InterchainAccount
account_owner: icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
base_account:
account_number: "8"
address: cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf
pub_key: null
sequence: "0"
```
### Send tokens from ICA account to controller within chain2
Generate tx on chain1
```
gaiad tx bank send cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl 10000000uatom --chain-id chain2 --generate-only | jq '.body.messages[0]' > send_raw.json
```
Check balances prior to tx
```
gaiad q bank balances cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf
balances:
- amount: "100000000"
denom: uatom
pagination:
next_key: null
total: "0"
gaiad q bank balances cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
balances:
- amount: "899993215"
denom: uatom
pagination:
next_key: null
total: "0"
```
Submit to chain2
```
gaiad tx icamauth submit send_raw.json --connection-id connection-0 --from controller --gas-prices 0.001uatom
```
Check balances after tx
```
gaiad q bank balances cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf
balances:
- amount: "90000000"
denom: uatom
pagination:
next_key: null
total: "0"
gaiad q bank balances cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
balances:
- amount: "909992265"
denom: uatom
pagination:
next_key: null
total: "0"
```
Hermes tx log:
```
Sep 27 11:03:48 dante-rho-test hermes[50110]: 2022-09-27T15:03:48.067868Z INFO ThreadId(293) packet_cmd{src_chain=chain1 src_port=icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl src_channel=channel-1 dst_chain=chain2}: pulled packet data for 0 events; events_total=1 events_left=0
Sep 27 11:03:48 dante-rho-test hermes[50110]: 2022-09-27T15:03:48.130750Z INFO ThreadId(293) packet_cmd{src_chain=chain1 src_port=icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl src_channel=channel-1 dst_chain=chain2}:relay{odata=c0dcdfea ->Destination @0-671; len=1}: assembled batch of 2 message(s)
Sep 27 11:03:48 dante-rho-test hermes[50110]: 2022-09-27T15:03:48.137326Z ERROR ThreadId(24) send_tx_with_account_sequence_retry{id=chain2}:estimate_gas: failed to simulate tx. propagating error to caller: gRPC call failed with status: status: Unknown, message: "codespace sdk code 32: incorrect account sequence: account sequence mismatch, expected 9, got 8", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "x-cosmos-block-height": "656"} }
Sep 27 11:03:48 dante-rho-test hermes[50110]: 2022-09-27T15:03:48.137386Z WARN ThreadId(24) send_tx_with_account_sequence_retry{id=chain2}: failed at estimate_gas step mismatching account sequence gRPC call failed with status: status: Unknown, message: "codespace sdk code 32: incorrect account sequence: account sequence mismatch, expected 9, got 8", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "x-cosmos-block-height": "656"} }. refresh account sequence number and retry once
Sep 27 11:03:48 dante-rho-test hermes[50110]: 2022-09-27T15:03:48.141091Z INFO ThreadId(24) send_tx_with_account_sequence_retry{id=chain2}: refresh: retrieved account sequence=9 number=1
Sep 27 11:03:48 dante-rho-test hermes[50110]: 2022-09-27T15:03:48.458785Z INFO ThreadId(293) packet_cmd{src_chain=chain1 src_port=icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl src_channel=channel-1 dst_chain=chain2}:relay{odata=c0dcdfea ->Destination @0-671; len=1}: [Async~>chain2] response(s): 1; Ok:CA15B7CC9EB1B48103650036FD3CEF3C8535AF1D43E8A525713B34490593E97F
Sep 27 11:03:48 dante-rho-test hermes[50110]: 2022-09-27T15:03:48.458847Z INFO ThreadId(293) packet_cmd{src_chain=chain1 src_port=icacontroller-cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl src_channel=channel-1 dst_chain=chain2}:relay{odata=c0dcdfea ->Destination @0-671; len=1}: success
Sep 27 11:03:53 dante-rho-test hermes[50110]: 2022-09-27T15:03:53.822029Z INFO ThreadId(313) packet_cmd{src_chain=chain2 src_port=icahost src_channel=channel-1 dst_chain=chain1}: pulled packet data for 0 events; events_total=1 events_left=0
Sep 27 11:03:53 dante-rho-test hermes[50110]: 2022-09-27T15:03:53.891640Z INFO ThreadId(313) packet_cmd{src_chain=chain2 src_port=icahost src_channel=channel-1 dst_chain=chain1}:relay{odata=9cf44f4b ->Destination @0-657; len=1}: assembled batch of 2 message(s)
Sep 27 11:03:53 dante-rho-test hermes[50110]: 2022-09-27T15:03:53.897318Z ERROR ThreadId(23) send_tx_with_account_sequence_retry{id=chain1}:estimate_gas: failed to simulate tx. propagating error to caller: gRPC call failed with status: status: Unknown, message: "codespace sdk code 32: incorrect account sequence: account sequence mismatch, expected 9, got 8", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "x-cosmos-block-height": "673"} }
Sep 27 11:03:53 dante-rho-test hermes[50110]: 2022-09-27T15:03:53.897370Z WARN ThreadId(23) send_tx_with_account_sequence_retry{id=chain1}: failed at estimate_gas step mismatching account sequence gRPC call failed with status: status: Unknown, message: "codespace sdk code 32: incorrect account sequence: account sequence mismatch, expected 9, got 8", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "x-cosmos-block-height": "673"} }. refresh account sequence number and retry once
Sep 27 11:03:53 dante-rho-test hermes[50110]: 2022-09-27T15:03:53.901861Z INFO ThreadId(23) send_tx_with_account_sequence_retry{id=chain1}: refresh: retrieved account sequence=9 number=1
Sep 27 11:03:54 dante-rho-test hermes[50110]: 2022-09-27T15:03:54.223326Z INFO ThreadId(313) packet_cmd{src_chain=chain2 src_port=icahost src_channel=channel-1 dst_chain=chain1}:relay{odata=9cf44f4b ->Destination @0-657; len=1}: [Async~>chain1] response(s): 1; Ok:85B5B22BC2235B22DE0B5EF682AAC50C0CBD276386BECF8C638CC965E4187004
Sep 27 11:03:54 dante-rho-test hermes[50110]: 2022-09-27T15:03:54.223382Z INFO ThreadId(313) packet_cmd{src_chain=chain2 src_port=icahost src_channel=channel-1 dst_chain=chain1}:relay{odata=9cf44f4b ->Destination @0-657; len=1}: success
```
### Fund account on host chain with IBC tokens
Send from tokens chain1 controller account to chain2 controller account
```
gaiad tx ibc-transfer transfer transfer channel-0 cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl 10000000uatom --from controller --gas-prices 0.001uatom
```
Send ibc tokens from chain2 controller to ICA account
```
gaiad tx bank send controller cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf 5000000ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 --gas-prices 0.001uatom
```
Check the balance on ICA account
```
gaiad q bank balances cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf
balances:
- amount: "5000000"
denom: ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2
- amount: "90000000"
denom: uatom
pagination:
next_key: null
total: "0"
```
### Send IBC token from ICA account to chain1 controller account
Generate tx on chain1
```
gaiad tx ibc-transfer transfer transfer channel-0 cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl 5000000ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 --from cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf --chain-id chain2 --generate-only | jq '.body.messages[0]' > send_raw_2.json
```
Check balances on chain1 controller prior to tx
```
gaiad q bank balances cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
balances:
- amount: "989992857"
denom: uatom
pagination:
next_key: null
total: "0"
```
Submit transaction
```
gaiad tx icamauth submit send_raw_2.json --connection-id connection-0 --from cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl --gas-prices 0.001uatom
```
Check balances after submitting transaction
```
gaiad q bank balances cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
balances:
- amount: "994991970"
denom: uatom
pagination:
next_key: null
total: "0"
```
Create another ibc channel for transfers:
```
hermes create channel --a-chain chain1 --a-connection connection-0 --a-port transfer --b-port transfer
```
We now have `channel-2` available.
Send another 1000000 chain1 uatom from controller to ICA account within chain2:
```
gaiad tx bank send controller cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf 1000000ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 --gas-prices 0.001uatom
```
Check balances of ICA account:
```
gaiad q bank balances cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf
balances:
- amount: "1000000"
denom: ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2
- amount: "90000000"
denom: uatom
pagination:
next_key: null
total: "0"
```
Send channel-0 IBC tokens back to chain1 controller over channel-2 from ICA account.
Generate tx on chain1
```
gaiad tx ibc-transfer transfer transfer channel-2 cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl 1000000ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 --from cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf --chain-id chain2 --generate-only | jq '.body.messages[0]' > send_raw_3.json
```
Check controller balances on chain1
```
gaiad q bank balances cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
balances:
- amount: "994989727"
denom: uatom
pagination:
next_key: null
total: "0"
```
Submit ICA transaction
```
gaiad tx icamauth submit send_raw_3.json --connection-id connection-0 --from cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl --gas-prices 0.001uatom
```
Check controller balances on chain1
```
gaiad q bank balances cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
balances:
- amount: "1000000"
denom: ibc/5F78C42BCC76287AE6B3185C6C1455DFFF8D805B1847F94B9B625384B93885C7
- amount: "994988404"
denom: uatom
pagination:
next_key: null
total: "0"
```
### Delegate using ICA account
Obtain validator operator address in chain2:
```
gaiad q staking validators -o json | jq -r '.validators[0].operator_address'
cosmosvaloper18g5muxlmzwegp3ldzdggla7kamjpaa9yy2yzzc
```
Generate tx in chain1:
```
gaiad tx staking delegate cosmosvaloper18g5muxlmzwegp3ldzdggla7kamjpaa9yy2yzzc 4000000uatom --from cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf --chain-id chain2 --generate-only | jq '.body.messages[0]' > send_del.json
```
Query ICA account delegations prior to tx in chain2
```
gaiad q staking delegations cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf
delegation_responses: []
pagination:
next_key: null
total: "0"
```
Submit ICA transaction in chain1
```
gaiad tx icamauth submit send_del.json --connection-id connection-0 --from cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl --gas-prices 0.001uatom
```
Query ICA account delegations after tx has gone through
```
gaiad q staking delegations cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf
delegation_responses:
- balance:
amount: "4000000"
denom: uatom
delegation:
delegator_address: cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf
shares: "4000000.000000000000000000"
validator_address: cosmosvaloper18g5muxlmzwegp3ldzdggla7kamjpaa9yy2yzzc
pagination:
next_key: null
total: "0"
```
### Submit gov vote over ICA
Submit proposal to change the max_validators param
gov-proposal.json
```
{
"title": "Three validators only",
"description": "Changing max_validators to 3",
"changes": [
{
"subspace": "staking",
"key": "MaxValidators",
"value": 3
}
],
"deposit": "1uatom"
}
```
Generate vote tx in chain1
```
gaiad tx gov vote 1 yes --from cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf --chain-id chain2 --generate-only | jq '.body.messages[0]' > send_vote.json
```
Submit proposal from validator account in chain2
```
gaiad tx gov submit-legacy-proposal param-change gov-proposal.json --from validator --gas-prices 0.001uatom
```
Submit vote tx in chain1
```
gaiad tx icamauth submit send_vote.json --connection-id connection-0 --from cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl --gas-prices 0.001uatom
```
Query proposal: The yes_count tally has a non-zero amount (4000000uatom is the amount that the ICA account has delegated to the single validator)
```
gaiad q gov proposal 1
deposit_end_time: "2022-09-29T19:08:03.798585474Z"
final_tally_result:
abstain_count: "0"
no_count: "0"
no_with_veto_count: "0"
yes_count: "4000000"
id: "1"
messages:
- '@type': /cosmos.gov.v1.MsgExecLegacyContent
authority: cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn
content:
'@type': /cosmos.params.v1beta1.ParameterChangeProposal
changes:
- key: MaxValidators
subspace: staking
value: "3"
description: Changing max_validators to 3
title: Three validators only
metadata: ""
status: PROPOSAL_STATUS_REJECTED
submit_time: "2022-09-27T19:08:03.798585474Z"
total_deposit:
- amount: "1"
denom: uatom
voting_end_time: "2022-09-27T19:08:33.798585474Z"
voting_start_time: "2022-09-27T19:08:03.798585474Z"
```
### Submit gov proposal over ICA
gov-proposal-10.json
```
{
"title": "Ten validators only",
"description": "Changing max_validators to 10",
"changes": [
{
"subspace": "staking",
"key": "MaxValidators",
"value": 10
}
],
"deposit": "1uatom"
}
```
Generate gov submit tx in chain1
```
gaiad tx gov submit-legacy-proposal param-change gov-proposal-10.json --from cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf --chain-id chain2 --generate-only | jq '.body.messages[0]' > ica-gov-proposal.json
```
Generate yes vote for prop 4 in chain1
```
gaiad tx gov vote 4 yes --from cosmos1c4a28nedvzrf5arlgq7enc4uhr83n0939g5fdynysqhd97m6dulqz3vsmf --chain-id chain2 --generate-only | jq '.body.messages[0]' > send_vote.json
```
Submit prop tx in chain1
```
gaiad tx icamauth submit ica-gov-proposal.json --connection-id connection-0 --from cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl --gas-prices 0.001uatom
```
Query proposals in chain2
```
gaiad q gov proposals
[...]
- deposit_end_time: "2022-09-29T19:24:56.831167933Z"
final_tally_result:
abstain_count: "0"
no_count: "0"
no_with_veto_count: "0"
yes_count: "0"
id: "4"
messages:
- '@type': /cosmos.gov.v1.MsgExecLegacyContent
authority: cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn
content:
'@type': /cosmos.params.v1beta1.ParameterChangeProposal
changes:
- key: MaxValidators
subspace: staking
value: "10"
description: Changing max_validators to 10
title: Ten validators only
metadata: ""
status: PROPOSAL_STATUS_VOTING_PERIOD
submit_time: "2022-09-27T19:24:56.831167933Z"
total_deposit:
- amount: "1"
denom: uatom
voting_end_time: "2022-09-27T19:25:26.831167933Z"
voting_start_time: "2022-09-27T19:24:56.831167933Z"
```
Submit yes vote in chain1
```
gaiad tx icamauth submit send_vote.json --connection-id connection-0 --from cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl --gas-prices 0.001uatom
```
Query prop 4 in chain2: The yes_count tally has a non-zero amount
```
gaiad q gov proposal 4
deposit_end_time: "2022-09-29T19:24:56.831167933Z"
final_tally_result:
abstain_count: "0"
no_count: "0"
no_with_veto_count: "0"
yes_count: "4000000"
id: "4"
messages:
- '@type': /cosmos.gov.v1.MsgExecLegacyContent
authority: cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn
content:
'@type': /cosmos.params.v1beta1.ParameterChangeProposal
changes:
- key: MaxValidators
subspace: staking
value: "10"
description: Changing max_validators to 10
title: Ten validators only
metadata: ""
status: PROPOSAL_STATUS_REJECTED
submit_time: "2022-09-27T19:24:56.831167933Z"
total_deposit:
- amount: "1"
denom: uatom
voting_end_time: "2022-09-27T19:25:26.831167933Z"
voting_start_time: "2022-09-27T19:24:56.831167933Z"
```
## 2022-09-28
Run tests in rho devnet:
### Change config in hermes config.toml to enable `channels.mode`
### Restart hermes service
### Recover faucet key
On chain1:
```
gaiad keys add controller --recover
(get mnemonic for faucet from bitwarden)
```
### Set up ICA account on chain2
From chain1:
```
gaiad tx icamauth register cosmos1axrwq70w5zd4ar60ksnt9cr4642xx337tnu323 --from controller --connection-id connection-0 --connection-id connection-0 --gas-prices 0.05uatom
```
### Query ICA account
From chain1:
```
gaiad q icamauth interchainaccounts connection-0 cosmos1axrwq70w5zd4ar60ksnt9cr4642xx337tnu323
interchain_account_address: cosmos1dlzvmwxmxjkqfy5krsu28uk4c3sqwpsg7ely9afylasewv5w72jqvf7hs7
```
There is an interchain account address created in chain 2: `cosmos1dlzvmwxmxjkqfy5krsu28uk4c3sqwpsg7ely9afylasewv5w72jqvf7hs7`
### Fund the ICA address in chain 2
Recover the controller account in chain2
```
gaiad keys add controller --recover --keyring-backend test
> Enter your bip39 mnemonic
(see bitwarden for the faucet mnemonic)
```
Send funds from controller to the ICA address within chain2
```
gaiad tx bank send cosmos1axrwq70w5zd4ar60ksnt9cr4642xx337tnu323 cosmos1dlzvmwxmxjkqfy5krsu28uk4c3sqwpsg7ely9afylasewv5w72jqvf7hs7 10000000uatom --gas-prices 0.001uatom
```
### Send tokens from ICA account to controller within chain2
Generate tx on chain1
```
gaiad tx bank send cosmos1dlzvmwxmxjkqfy5krsu28uk4c3sqwpsg7ely9afylasewv5w72jqvf7hs7 cosmos1axrwq70w5zd4ar60ksnt9cr4642xx337tnu323 1000000uatom --chain-id chain2 --generate-only | jq '.body.messages[0]' > send_raw.json
```
Check balances prior to tx
```
gaiad q bank balances cosmos1dlzvmwxmxjkqfy5krsu28uk4c3sqwpsg7ely9afylasewv5w72jqvf7hs7
balances:
- amount: "10000000"
denom: uatom
pagination:
next_key: null
total: "0"
gaiad q bank balances cosmos1axrwq70w5zd4ar60ksnt9cr4642xx337tnu323
balances:
- amount: "232614100"
denom: uatom
pagination:
next_key: null
total: "0"
```
Submit to chain2 from chain1
```
gaiad tx icamauth submit send_raw.json --connection-id connection-0 --from controller --gas-prices 0.05uatom
```
Check balances after tx
```
gaiad q bank balances cosmos1dlzvmwxmxjkqfy5krsu28uk4c3sqwpsg7ely9afylasewv5w72jqvf7hs7
balances:
- amount: "10000000"
denom: uatom
pagination:
next_key: null
total: "0"
gaiad q bank balances cosmos1axrwq70w5zd4ar60ksnt9cr4642xx337tnu323
balances:
- amount: "232614100"
denom: uatom
pagination:
next_key: null
total: "0"
```
Checking the tx hash:
```
raw_log: "recovered: parameter AllowMessages not registered\nstack:\ngoroutine 74
```