From 3a7c88a73797407e3884acd2a98508ed6c0ca75b Mon Sep 17 00:00:00 2001 From: swelf Date: Wed, 24 Jan 2024 02:12:40 +0300 Subject: [PATCH 01/29] updated icatx docs --- .../modules/contract-manager/client.md | 111 ++++++++++++------ .../modules/contract-manager/overview.md | 33 +++++- .../neutron/modules/contract-manager/state.md | 8 +- .../modules/interchain-txs/overview.md | 33 +++++- .../modules/interchain-txs/overview.md | 42 +++++-- 5 files changed, 179 insertions(+), 48 deletions(-) diff --git a/docs/neutron/modules/contract-manager/client.md b/docs/neutron/modules/contract-manager/client.md index 0ec2710b2..4fc5f8094 100644 --- a/docs/neutron/modules/contract-manager/client.md +++ b/docs/neutron/modules/contract-manager/client.md @@ -7,20 +7,20 @@ In this section we describe the queries required on grpc server. ```protobuf // Query defines the gRPC querier service. service Query { - // Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/neutron-org/neutron/contractmanager/params"; - } - - // Queries a Failures by address. - rpc Failure(QueryGetFailuresByAddressRequest) returns (QueryGetFailuresByAddressResponse) { - option (google.api.http).get = "/neutron-org/neutron/contractmanager/failure/{address}"; - } - - // Queries a list of failed addresses. - rpc AllFailures(QueryAllFailureRequest) returns (QueryAllFailureResponse) { - option (google.api.http).get = "/neutron-org/neutron/contractmanager/failure"; - } + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/neutron-org/neutron/contractmanager/params"; + } + + // Queries a Failures by address. + rpc Failure(QueryGetFailuresByAddressRequest) returns (QueryGetFailuresByAddressResponse) { + option (google.api.http).get = "/neutron-org/neutron/contractmanager/failure/{address}"; + } + + // Queries a list of failed addresses. + rpc AllFailures(QueryAllFailureRequest) returns (QueryAllFailureResponse) { + option (google.api.http).get = "/neutron-org/neutron/contractmanager/failure"; + } } ``` @@ -43,22 +43,23 @@ neutrond query contractmanager failures Output: ```yaml - failures: - - address: neutron1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqcd0mrx - id: 0 - sudo_payload: - - address: neutron14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s5c2epq - id: 1 - sudo_payload: - pagination: - next_key: null - total: "2" +failures: +- address: neutron1nxshmmwrvxa2cp80nwvf03t8u5kvl2ttr8m8f43vamudsqrdvs8qqvfwpj + error: 'codespace: wasm, code: 5' + id: "1" + sudo_payload: +- address: neutron1nxshmmwrvxa2cp80nwvf03t8u5kvl2ttr8m8f43vamudsqrdvs8qqvfwpj + error: 'codespace: wasm, code: 5' + id: "2" + sudo_payload: +- address: neutron1nxshmmwrvxa2cp80nwvf03t8u5kvl2ttr8m8f43vamudsqrdvs8qqvfwpj + error: 'codespace: contractmanager, code: 1103' + id: "3" + sudo_payload: ``` - - Returns list of all failures for specific contract address. ```bash @@ -70,22 +71,58 @@ neutrond query contractmanager failures [address] Returns failures for specific contract address: ```shell - neutrond query contractmanager failures neutron14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s5c2epq + neutrond query contractmanager failures neutron1nxshmmwrvxa2cp80nwvf03t8u5kvl2ttr8m8f43vamudsqrdvs8qqvfwpj + ``` + +Output: + + ```yaml +failures: +- address: neutron1nxshmmwrvxa2cp80nwvf03t8u5kvl2ttr8m8f43vamudsqrdvs8qqvfwpj + error: 'codespace: wasm, code: 5' + id: "1" + sudo_payload: +- address: neutron1nxshmmwrvxa2cp80nwvf03t8u5kvl2ttr8m8f43vamudsqrdvs8qqvfwpj + error: 'codespace: wasm, code: 5' + id: "2" + sudo_payload: +- address: neutron1nxshmmwrvxa2cp80nwvf03t8u5kvl2ttr8m8f43vamudsqrdvs8qqvfwpj + error: 'codespace: contractmanager, code: 1103' + id: "3" + sudo_payload: + ``` + + + +### Failure Details + +Returns an exact error why contract failed to process certain ibc acknowledgement. + +> **Note** +> It is a CLI like query, and you can not perform it onchain, e.g. you can not make a query from a contract. The reason is - cosmos-sdk do not store raw errors in a storage due to non determenistic nature of errors. You can not consider the data which are not under you control as determenistic. But to make developers life easier we inorporated the folowwing mechnism. In case of error hapenned during the `sudo` call we emit an event with full error text under the key `(contract_address,failure_id)`. Events are not the part of the consensus, and it's safe to emit any data you want. The cli command is looking for [transaction](https://github.com/neutron-org/neutron/blob/v2.0.2/x/contractmanager/client/cli/query_failure.go#L85) by a set of events. +> +> **Note** +> If the node you are making query to either does not index transaction or already cleared the block with the wanted transaction you get the error - `detailed failure error message not found in node events`. In this case you need to query a node, which: +> +> 1) Indexes transactions +> 2) Keeps block with wanted height. + +```shell +neutrond q contractmanager failure-details [address] [failure_id] +``` + +
+ Example + Returns failures for specific contract address: + + ```shell + neutrond q contractmanager failure-details neutron1nxshmmwrvxa2cp80nwvf03t8u5kvl2ttr8m8f43vamudsqrdvs8qqvfwpj 1 ``` Output: ```yaml - failures: - - address: neutron14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s5c2epq - id: 0 - sudo_payload: - - address: neutron14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s5c2epq - id: 1 - sudo_payload: - pagination: - next_key: null - total: "2" +dispatch: submessages: Generic error: Integrations test mock submsg error: execute wasm contract failed ```
diff --git a/docs/neutron/modules/contract-manager/overview.md b/docs/neutron/modules/contract-manager/overview.md index 8e96e276e..78897d691 100644 --- a/docs/neutron/modules/contract-manager/overview.md +++ b/docs/neutron/modules/contract-manager/overview.md @@ -15,13 +15,29 @@ But this in turn exposes the problem of informing the owner of the contract that To ensure that the state of the contract is consistent, the call to the sudo handler takes place in a temporary state (using `CacheContext`), which is written to the active state if the call succeeds. +## SudoLimitWrapper + +[SudoLimitWrapper](https://github.com/neutron-org/neutron/blob/v2.0.0/x/contractmanager/ibc_middleware.go#L14) is a middleware wrapper with interface + +```go +type WasmKeeper interface { + HasContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) bool + Sudo(ctx sdk.Context, contractAddress sdk.AccAddress, msg []byte) ([]byte, error) +} +``` + +It performs two important functions: + +1. Make sure that the sudo contract call does not use more gas than allowed by a chain [parameter](#gas-limitation). If the gas limit is exceeded and an out of gas panic occurs inside the sudo call, the vrapper intercepts the panic (only the out of gas panic is intercepted) and converts it to an error. +2. Capture an error from the sudo handler of the interchaintxs module, either directly initiated by the contract or an error that was received from an out of gas panic and write the error with the data to Failures for further processing + ### Gas limitation To make sure there are no exploits with infinite recursion of IBC messages which call other IBC messages in sudo handler we use constant gas `LIMIT` to spend. The LIMIT is small, so you can't place extensive work in Sudo handlers. As a workaround, in such cases you can use Sudo handlers to simply store required payload in contract's state, and use Execute messages to handle results separately. If your contract exceeds this constant `LIMIT`, it will terminate sudo handler call and save a `Failure` with full call info. You can [resubmit failure](#resubmitfailure) from this contract. -The `LIMIT` is defined by `SudoCallGasLimit` module's parameter. +The `LIMIT` is defined by [`SudoCallGasLimit`](https://github.com/neutron-org/neutron/blob/v2.0.2/x/contractmanager/types/params.pb.go#L29) module's parameter. We provide an ability to resubmit bindings through the contract that initiated the IBC transaction. @@ -67,6 +83,21 @@ Response: type FailuresResponse struct { Failures []contractmanagertypes.Failure `json:"failures"` } + +type Failure struct { + // Address of the failed contract + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // Id of the failure under specific address + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + // Serialized MessageSudoCallback with Packet and Ack(if exists) + SudoPayload []byte `protobuf:"bytes,3,opt,name=sudo_payload,json=sudoPayload,proto3" json:"sudo_payload,omitempty"` + // Redacted error response of the sudo call. Full error is emitted as an event + Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` +} ``` You're encouraged to use our neutron-sdk implementation in contracts - [request](https://github.com/neutron-org/neutron-sdk/blob/feat/contract-manager-resubmit/packages/neutron-sdk/src/bindings/query.rs#L61) and [response](https://github.com/neutron-org/neutron-sdk/blob/feat/contract-manager-resubmit/packages/neutron-sdk/src/bindings/query.rs#L119) + +## Failures details + +In the case of a contract-initiated error, the error is stored in [Failure](state.md). Since raw errors are not part of the consensus and cannot guarantee determinism when saved to the state, errors saved in `Failure` are redacted to `codespace + code_id` using the [RedactError](https://github.com/neutron-org/neutron/blob/v2.0.2/x/contractmanager/keeper/failure.go#L109) function. At the same time, we emit the full text of the error into transaction events that do not affect the consensus and if you need to get detailed information about the error returned by the contract, you need to find the transaction in which the redacted error occurred and see the events in which we emit the error. To simplify this procedure we added a special [cli query](#failures-details), the error can be found by the address of the contract that caused the error and the failure_id. diff --git a/docs/neutron/modules/contract-manager/state.md b/docs/neutron/modules/contract-manager/state.md index 37396265a..27c0df26f 100644 --- a/docs/neutron/modules/contract-manager/state.md +++ b/docs/neutron/modules/contract-manager/state.md @@ -1,3 +1,9 @@ # State -The ContractManager module stores one [Failure](https://github.com/neutron-org/neutron/blob/v1.0.4/proto/contractmanager/genesis.proto#L12) per contract address and record id. +The ContractManager module stores [Failure](https://github.com/neutron-org/neutron/blob/v2.0.0/proto/neutron/contractmanager/failure.proto#L11) under `contract address` and `record id` key. +`Failure` contains all the necessary info about ACK sudo handler call failure. + +- `address` contains contract address and it is used in conjunction with +- `id` field to create index of the record in the `KVStore`. +- `SudoPayload` - serialized MessageSudoCallback with Packet and Ack(if exists) +- `Error` - redacted error response of the sudo call. Full error is emitted as an event diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 200cc4e52..c2b9d7ba5 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -25,7 +25,7 @@ complete list of IBC events for each module message in the [messages](./messages ## Sudo errors handling -Interchaintxs module configured the following way, all the errors from a sudo handler are being suppressed by [contract manager middleware](/neutron/modules/contract-manager/overview#concepts), sudo handler is limited with [LIMIT](/neutron/modules/contract-manager/overview#gas-limitation) amount of gas +Interchaintxs module configured the following way, all the errors from a sudo handler are being suppressed by [contract manager middleware](/neutron/modules/contract-manager/overview#sudolimitwrapper), sudo handler is limited with [LIMIT](/neutron/modules/contract-manager/overview#gas-limitation) amount of gas ## Importing interchaintxs module @@ -48,6 +48,37 @@ If you use interchaintxs module in your application and if your Sudo handler fai > execute [RegisterInterchainAccount message]( /neutron/modules/interchain-txs/messages#msgregisterinterchainaccount) again to > recover access to your interchain account. > **Note** Keep in mind, new channel is created +> + +## Sudo Handlers + +The interchaintxs module in neutrond configured the following way. +wasmd sudo handler wrapped with [sudolimitwrapper](../contract-manager/overview.md#sudolimitwrapper) + +And acknoledgement packet follows the way +`OnAcknowledgementPacket` --> [sudolimitwrapper](../contract-manager/overview.md#sudolimitwrapper) --> `wasmd sudo handler` + +Using `sudolimitwrapper` has two purposes: + +In case of error/expensive tx + +1. Suppress the sudo handler error itself, and mark the ibc acknowledgement packet as received and processed. Other way, the error makes relayer send an acknowledgement again and again +2. Limit the amount of gas available for sudo handler execution. Out of gas panic will later be captured by `sudolimitwrapper` and converted into an error. +3. Information about an unsuccessfully processed ack is stored in [state](../contract-manager/state.md). + +## Failed interchain txs + +Not every interchaintx executes succesfully on a remote network. Some of them fails to execute with errors and then you get ibc acknowledgement with `Error` type. In this case, in order to get additional details about the transaction parameters as well as details about the error, you can use the commands ` q interchain-accounts host packet-events ` +Where: + +- `channel-id` is the id of the channel on the host side of the interchain accounts +- `seq-id` - seq of the ibc message received on the host + +For example `gaiad q interchain-accounts host packet-events channel-736 1` is a transaction `fund community pool from neutron unclaimed airdrop` on `cosmoshub-4` chain. Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. + +Unfortunately, to avoid the nondeterminism associated with error test generation, the error text is severely truncated by redact down to the error code without any additional details, before being saved to the state on the host interchain account side of the module. +And even the ` q interchain-accounts host packet-events` command is unable to show the full error text +If you really lack information about the error for diagnostics, you can look at the validator/node logs at the moment of transaction execution. All necessary information will be there. ## Relaying diff --git a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md index d5b386476..7a0b2d64f 100644 --- a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md +++ b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md @@ -23,25 +23,51 @@ a [Sudo() call](https://github.com/CosmWasm/wasmd/blob/288609255ad92dfe5c54eae57 and a custom [message scheme](https://github.com/neutron-org/neutron/blob/v1.0.4/x/contractmanager/types/sudo.go). You can find a complete list of IBC events for each module message in the [messages](./messages) section. -> **Note**: if your Sudo handler fails, the acknowledgment won't be marked as processed inside the IBC module. This will +> **Note**: if your Sudo handler fails, the acknowledgment will be marked as processed inside the IBC module anyway. +> The module designed this way to avoid > make most IBC relayers try to submit the acknowledgment over and over again. And since the ICA channels are `ORDERED`, > ACKs must be processed in the same order as corresponding transactions were sent, meaning no further acknowledgments -> will be process until the previous one processed successfully. +> will be process until the previous one processed successfully. In addition, if sudo handler fails, we save the packetId +> failed to be processed with contract manager's failures [state](../contract-manager/state.md). It is possible to suppress +> Sudo handler fails by using [cachedContext](#sudo-handlers) with th handlers. > -> We strongly recommend developers to write Sudo handlers very carefully and keep them as simple as possible. If you do -> want to have elaborate logic in your handler, you should verify the acknowledgement data before making any state -> changes; that way you can, if the data received with the acknowledgement is incompatible with executing the handler -> logic normally, return an `Ok()` response immediately, which will prevent the acknowledgement from being resubmitted. - > **Note**: there is no dedicated event for a closed channel (ICA disables all messages related to closing the channels) > . Your channel, however, can still be closed if a packet timeout occurs; thus, if you are notified about a packet > timeout, you can be sure that the affected channel was closed. Please note that it is generally a good practice to set > the packet timeout for your interchain transactions to a really large value. > -> If the timeout occurs anyway, you can just +> If the timeout occurs anyway, you can just > execute [RegisterInterchainAccount message]( /neutron/modules/interchain-txs/messages#msgregisterinterchainaccount) again to > recover access to your interchain account. +## Sudo Handlers + +Before calling a sudo handler, we create a child context [cachedCtx](#cachedctx), with which we call this handler. +Calling a handler via a child context has 2 purposes: + +1. Suppress the sudo handler error itself, and mark the ibc acknowledgement packet as received and processed. Other way, the error makes relayer send an acknowledgement again and again +2. Suppress out of gas panic triggered by sudo handler operation +3. Information about an unsuccessfully processed ack is stored in [state](../contract-manager/state.md). + +### CachedCtx + +CachedCtx is created with `gas limit = gas limit in the parent context - GasReserve`, where `GasReserve` is a constant equal to 15000. +This reserve gas is needed to guarantee that [Failure](../contract-manager/state.md) is saved, for example in case a contract has used all the gas it is entitled to and ended with an out of gas panic. + +## Failed interchain txs + +Not every interchaintx executes succesfully on a remote network. Some of them fails to execute with errors and then you get ibc acknowledgement with `Error` type. In this case, in order to get additional details about the transaction parameters as well as details about the error, you can use the commands ` q interchain-accounts host packet-events ` +Where: + +- `channel-id` is the id of the channel on the host side of the interchain accounts +- `seq-id` - seq of the ibc message received on the host + +For example `gaiad q interchain-accounts host packet-events channel-736 1` is a transaction `fund community pool from neutron unclaimed airdrop` on `cosmoshub-4` chain. Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. + +Unfortunately, to avoid the nondeterminism associated with error test generation, the error text is severely truncated by redact down to the error code without any additional details, before being saved to the state on the host interchain account side of the module. +And even the ` q interchain-accounts host packet-events` command is unable to show the full error text +If you really lack information about the error for diagnostics, you can look at the validator/node logs at the moment of transaction execution. All necessary information will be there. + ## Relaying Neutron introduces smart-contract level callbacks for IBC packets. From an IBC relayer's perspective, this means that From 382d2acd281ade01cbf0bd49a33f23d71604e9ec Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:40:57 +0300 Subject: [PATCH 02/29] Update docs/neutron/modules/contract-manager/overview.md Co-authored-by: Mike Mozhaev --- docs/neutron/modules/contract-manager/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/contract-manager/overview.md b/docs/neutron/modules/contract-manager/overview.md index 78897d691..ab9a9f1fb 100644 --- a/docs/neutron/modules/contract-manager/overview.md +++ b/docs/neutron/modules/contract-manager/overview.md @@ -28,7 +28,7 @@ type WasmKeeper interface { It performs two important functions: -1. Make sure that the sudo contract call does not use more gas than allowed by a chain [parameter](#gas-limitation). If the gas limit is exceeded and an out of gas panic occurs inside the sudo call, the vrapper intercepts the panic (only the out of gas panic is intercepted) and converts it to an error. +1. Make sure that the sudo contract call does not use more gas than allowed by a chain [parameter](#gas-limitation). If the gas limit is exceeded and an out of gas panic occurs inside the sudo call, the wrapper intercepts the panic (only the out of gas panic is intercepted) and converts it to an error. 2. Capture an error from the sudo handler of the interchaintxs module, either directly initiated by the contract or an error that was received from an out of gas panic and write the error with the data to Failures for further processing ### Gas limitation From d86c659dd3cf2cd486af973f7ca52fd220a597f5 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:41:02 +0300 Subject: [PATCH 03/29] Update docs/neutron/modules/interchain-txs/overview.md Co-authored-by: Mike Mozhaev --- docs/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 4e37ea2dd..2974aadeb 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -53,7 +53,7 @@ If you use interchaintxs module in your application and if your Sudo handler fai ## Sudo Handlers The interchaintxs module in neutrond configured the following way. -wasmd sudo handler wrapped with [sudolimitwrapper](../contract-manager/overview.md#sudolimitwrapper) +Wasmd Sudo handler wrapped with [SudoLimitWrapper](../contract-manager/overview.md#sudolimitwrapper) And acknoledgement packet follows the way `OnAcknowledgementPacket` --> [sudolimitwrapper](../contract-manager/overview.md#sudolimitwrapper) --> `wasmd sudo handler` From 9ecd9e4fc7bae56de613c52e85154062137abed8 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:41:09 +0300 Subject: [PATCH 04/29] Update docs/neutron/modules/interchain-txs/overview.md Co-authored-by: Mike Mozhaev --- docs/neutron/modules/interchain-txs/overview.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 2974aadeb..e97938d0e 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -53,6 +53,7 @@ If you use interchaintxs module in your application and if your Sudo handler fai ## Sudo Handlers The interchaintxs module in neutrond configured the following way. + Wasmd Sudo handler wrapped with [SudoLimitWrapper](../contract-manager/overview.md#sudolimitwrapper) And acknoledgement packet follows the way From a169c00fac2724e6a7bcba675acd3041e430812f Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:41:14 +0300 Subject: [PATCH 05/29] Update docs/neutron/modules/interchain-txs/overview.md Co-authored-by: Mike Mozhaev --- docs/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index e97938d0e..ef1e14aef 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -57,7 +57,7 @@ The interchaintxs module in neutrond configured the following way. Wasmd Sudo handler wrapped with [SudoLimitWrapper](../contract-manager/overview.md#sudolimitwrapper) And acknoledgement packet follows the way -`OnAcknowledgementPacket` --> [sudolimitwrapper](../contract-manager/overview.md#sudolimitwrapper) --> `wasmd sudo handler` +`OnAcknowledgementPacket` --> [SudoLimitErapper](../contract-manager/overview.md#sudolimitwrapper) --> `Wasmd Sudo handler` Using `sudolimitwrapper` has two purposes: From 8a1d0da3a4dd2ac4ddc7846691c6d15558d4b67c Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:41:51 +0300 Subject: [PATCH 06/29] Update docs/neutron/modules/interchain-txs/overview.md Co-authored-by: Mike Mozhaev --- docs/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index ef1e14aef..9d32135e3 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -59,7 +59,7 @@ Wasmd Sudo handler wrapped with [SudoLimitWrapper](../contract-manager/overview. And acknoledgement packet follows the way `OnAcknowledgementPacket` --> [SudoLimitErapper](../contract-manager/overview.md#sudolimitwrapper) --> `Wasmd Sudo handler` -Using `sudolimitwrapper` has two purposes: +Using `SudoLimitWrapper` has two purposes: In case of error/expensive tx From b077538da2126d4fca5e91cf5320718a3515af0f Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:44:51 +0300 Subject: [PATCH 07/29] Update docs/neutron/modules/interchain-txs/overview.md Co-authored-by: Mike Mozhaev --- docs/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 9d32135e3..d6554ab77 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -61,7 +61,7 @@ And acknoledgement packet follows the way Using `SudoLimitWrapper` has two purposes: -In case of error/expensive tx +In case of error/expensive tx: 1. Suppress the sudo handler error itself, and mark the ibc acknowledgement packet as received and processed. Other way, the error makes relayer send an acknowledgement again and again 2. Limit the amount of gas available for sudo handler execution. Out of gas panic will later be captured by `sudolimitwrapper` and converted into an error. From 167e84c9fb8f9bf0577f55a0e456ce319d1b0b4a Mon Sep 17 00:00:00 2001 From: swelf Date: Fri, 26 Jan 2024 12:58:03 +0300 Subject: [PATCH 08/29] review fixes. added links to the code. added node to get query result --- docs/neutron/modules/interchain-txs/overview.md | 12 ++++++------ .../neutron/modules/interchain-txs/overview.md | 10 ++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index d6554ab77..79b16e492 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -61,23 +61,23 @@ And acknoledgement packet follows the way Using `SudoLimitWrapper` has two purposes: -In case of error/expensive tx: - -1. Suppress the sudo handler error itself, and mark the ibc acknowledgement packet as received and processed. Other way, the error makes relayer send an acknowledgement again and again +1. Suppress the sudo handler error itself, and mark the ibc acknowledgement packet as received and processed. Other way, the error makes relayer send an acknowledgement again and again. Information about an unsuccessfully processed ack is stored in [state](../contract-manager/state.md). 2. Limit the amount of gas available for sudo handler execution. Out of gas panic will later be captured by `sudolimitwrapper` and converted into an error. -3. Information about an unsuccessfully processed ack is stored in [state](../contract-manager/state.md). ## Failed interchain txs Not every interchaintx executes succesfully on a remote network. Some of them fails to execute with errors and then you get ibc acknowledgement with `Error` type. In this case, in order to get additional details about the transaction parameters as well as details about the error, you can use the commands ` q interchain-accounts host packet-events ` Where: +- `binary` is a binary on the chain you are working with - `channel-id` is the id of the channel on the host side of the interchain accounts - `seq-id` - seq of the ibc message received on the host -For example `gaiad q interchain-accounts host packet-events channel-736 1` is a transaction `fund community pool from neutron unclaimed airdrop` on `cosmoshub-4` chain. Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. +For example `gaiad q interchain-accounts host packet-events channel-736 1 --node https://cosmos-rpc.quickapi.com:443` is the transaction `fund community pool from neutron unclaimed airdrop` on `cosmoshub-4` chain. The node may remove tx from storage in future. You may need to find another one to get details. + +Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. -Unfortunately, to avoid the nondeterminism associated with error test generation, the error text is severely truncated by redact down to the error code without any additional details, before being saved to the state on the host interchain account side of the module. +Unfortunately, to avoid the nondeterminism associated with error test generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before being saved to the state on the host interchain account side of the module. And even the ` q interchain-accounts host packet-events` command is unable to show the full error text If you really lack information about the error for diagnostics, you can look at the validator/node logs at the moment of transaction execution. All necessary information will be there. diff --git a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md index 7a0b2d64f..9ffbea059 100644 --- a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md +++ b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md @@ -45,9 +45,8 @@ complete list of IBC events for each module message in the [messages](./messages Before calling a sudo handler, we create a child context [cachedCtx](#cachedctx), with which we call this handler. Calling a handler via a child context has 2 purposes: -1. Suppress the sudo handler error itself, and mark the ibc acknowledgement packet as received and processed. Other way, the error makes relayer send an acknowledgement again and again +1. Suppress the sudo handler error itself, and mark the ibc acknowledgement packet as received and processed. Other way, the error makes relayer send an acknowledgement again and again. Information about an unsuccessfully processed ack is stored in [state](../contract-manager/state.md). 2. Suppress out of gas panic triggered by sudo handler operation -3. Information about an unsuccessfully processed ack is stored in [state](../contract-manager/state.md). ### CachedCtx @@ -59,12 +58,15 @@ This reserve gas is needed to guarantee that [Failure](../contract-manager/state Not every interchaintx executes succesfully on a remote network. Some of them fails to execute with errors and then you get ibc acknowledgement with `Error` type. In this case, in order to get additional details about the transaction parameters as well as details about the error, you can use the commands ` q interchain-accounts host packet-events ` Where: +- `binary` is a binary on the chain you are working with - `channel-id` is the id of the channel on the host side of the interchain accounts - `seq-id` - seq of the ibc message received on the host -For example `gaiad q interchain-accounts host packet-events channel-736 1` is a transaction `fund community pool from neutron unclaimed airdrop` on `cosmoshub-4` chain. Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. +For example `gaiad q interchain-accounts host packet-events channel-736 1 --node https://cosmos-rpc.quickapi.com:443` is the transaction `fund community pool from neutron unclaimed airdrop` on `cosmoshub-4` chain. The node may remove tx from storage in future. You may need to find another one to get details. -Unfortunately, to avoid the nondeterminism associated with error test generation, the error text is severely truncated by redact down to the error code without any additional details, before being saved to the state on the host interchain account side of the module. +Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. + +Unfortunately, to avoid the nondeterminism associated with error test generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before being saved to the state on the host interchain account side of the module. And even the ` q interchain-accounts host packet-events` command is unable to show the full error text If you really lack information about the error for diagnostics, you can look at the validator/node logs at the moment of transaction execution. All necessary information will be there. From 109d6482afafda2b3605f5153caaae95fa7de450 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:50:41 +0300 Subject: [PATCH 09/29] Update docs/neutron/modules/contract-manager/client.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- docs/neutron/modules/contract-manager/client.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/contract-manager/client.md b/docs/neutron/modules/contract-manager/client.md index 4fc5f8094..67a253a9a 100644 --- a/docs/neutron/modules/contract-manager/client.md +++ b/docs/neutron/modules/contract-manager/client.md @@ -99,7 +99,7 @@ failures: Returns an exact error why contract failed to process certain ibc acknowledgement. > **Note** -> It is a CLI like query, and you can not perform it onchain, e.g. you can not make a query from a contract. The reason is - cosmos-sdk do not store raw errors in a storage due to non determenistic nature of errors. You can not consider the data which are not under you control as determenistic. But to make developers life easier we inorporated the folowwing mechnism. In case of error hapenned during the `sudo` call we emit an event with full error text under the key `(contract_address,failure_id)`. Events are not the part of the consensus, and it's safe to emit any data you want. The cli command is looking for [transaction](https://github.com/neutron-org/neutron/blob/v2.0.2/x/contractmanager/client/cli/query_failure.go#L85) by a set of events. +> It is a CLI-like query, and you can not perform it onchain, e.g. you can not make a query from a contract. The reason is - cosmos-sdk do not store raw errors in a storage due to non-deterministic nature of errors. You can not consider the data which are not under you control as deterministic. But to make developers life easier we inorporated the following mechanism. In case of error happened during the `sudo` call we emit an event with full error text under the key `(contract_address,failure_id)`. Events are not the part of the consensus, and it's safe to emit any data you want. The CLI command looks for [transaction](https://github.com/neutron-org/neutron/blob/v2.0.2/x/contractmanager/client/cli/query_failure.go#L85) by a set of events. > > **Note** > If the node you are making query to either does not index transaction or already cleared the block with the wanted transaction you get the error - `detailed failure error message not found in node events`. In this case you need to query a node, which: From 60b4d879d0fe3c765032a3e80ce52d9ed71e2948 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:51:00 +0300 Subject: [PATCH 10/29] Update docs/neutron/modules/contract-manager/client.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- docs/neutron/modules/contract-manager/client.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/contract-manager/client.md b/docs/neutron/modules/contract-manager/client.md index 67a253a9a..a2f03100d 100644 --- a/docs/neutron/modules/contract-manager/client.md +++ b/docs/neutron/modules/contract-manager/client.md @@ -102,7 +102,7 @@ Returns an exact error why contract failed to process certain ibc acknowledgemen > It is a CLI-like query, and you can not perform it onchain, e.g. you can not make a query from a contract. The reason is - cosmos-sdk do not store raw errors in a storage due to non-deterministic nature of errors. You can not consider the data which are not under you control as deterministic. But to make developers life easier we inorporated the following mechanism. In case of error happened during the `sudo` call we emit an event with full error text under the key `(contract_address,failure_id)`. Events are not the part of the consensus, and it's safe to emit any data you want. The CLI command looks for [transaction](https://github.com/neutron-org/neutron/blob/v2.0.2/x/contractmanager/client/cli/query_failure.go#L85) by a set of events. > > **Note** -> If the node you are making query to either does not index transaction or already cleared the block with the wanted transaction you get the error - `detailed failure error message not found in node events`. In this case you need to query a node, which: +> If the node you are making query to either does not index transaction or already cleared the block with the wanted transaction, you get the error - `detailed failure error message not found in node events`. In this case you need to query a node, which: > > 1) Indexes transactions > 2) Keeps block with wanted height. From 96803c7cbfea1d23e7606c7b1ef7767e89e432e9 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:51:43 +0300 Subject: [PATCH 11/29] Update docs/neutron/modules/contract-manager/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- docs/neutron/modules/contract-manager/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/contract-manager/overview.md b/docs/neutron/modules/contract-manager/overview.md index ab9a9f1fb..e33c93e4a 100644 --- a/docs/neutron/modules/contract-manager/overview.md +++ b/docs/neutron/modules/contract-manager/overview.md @@ -29,7 +29,7 @@ type WasmKeeper interface { It performs two important functions: 1. Make sure that the sudo contract call does not use more gas than allowed by a chain [parameter](#gas-limitation). If the gas limit is exceeded and an out of gas panic occurs inside the sudo call, the wrapper intercepts the panic (only the out of gas panic is intercepted) and converts it to an error. -2. Capture an error from the sudo handler of the interchaintxs module, either directly initiated by the contract or an error that was received from an out of gas panic and write the error with the data to Failures for further processing +2. Capture an error from the sudo handler of the interchaintxs module, either directly initiated by the contract or an error that was received from an out of gas panic and write the error with the data to [Failures](#failures-details) for further processing ### Gas limitation From cad13cb013d4f31a16dd313b79abb837aa361a75 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:53:30 +0300 Subject: [PATCH 12/29] Update docs/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- docs/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 79b16e492..958530ac3 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -57,7 +57,7 @@ The interchaintxs module in neutrond configured the following way. Wasmd Sudo handler wrapped with [SudoLimitWrapper](../contract-manager/overview.md#sudolimitwrapper) And acknoledgement packet follows the way -`OnAcknowledgementPacket` --> [SudoLimitErapper](../contract-manager/overview.md#sudolimitwrapper) --> `Wasmd Sudo handler` +`OnAcknowledgementPacket` --> [SudoLimitWrapper](../contract-manager/overview.md#sudolimitwrapper) --> `Wasmd Sudo handler` Using `SudoLimitWrapper` has two purposes: From 8cd94fb8ce19abcc967c7d58e9d500f66c6e6b19 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:54:55 +0300 Subject: [PATCH 13/29] Update docs/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- docs/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 958530ac3..d7bcba972 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -77,7 +77,7 @@ For example `gaiad q interchain-accounts host packet-events channel-736 1 --node Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. -Unfortunately, to avoid the nondeterminism associated with error test generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before being saved to the state on the host interchain account side of the module. +Unfortunately, to avoid the nondeterminism associated with error text generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before being saved to the state on the host interchain account side of the module. And even the ` q interchain-accounts host packet-events` command is unable to show the full error text If you really lack information about the error for diagnostics, you can look at the validator/node logs at the moment of transaction execution. All necessary information will be there. From b0e18bf74ae5620bbdfd3f792ab6266a2f39f260 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:55:34 +0300 Subject: [PATCH 14/29] Update versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- .../version-1.0/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md index 9ffbea059..6a6903a10 100644 --- a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md +++ b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md @@ -66,7 +66,7 @@ For example `gaiad q interchain-accounts host packet-events channel-736 1 --node Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. -Unfortunately, to avoid the nondeterminism associated with error test generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before being saved to the state on the host interchain account side of the module. +Unfortunately, to avoid the nondeterminism associated with error text generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before being saved to the state on the host interchain account side of the module. And even the ` q interchain-accounts host packet-events` command is unable to show the full error text If you really lack information about the error for diagnostics, you can look at the validator/node logs at the moment of transaction execution. All necessary information will be there. From 89aabace2024a2f079ca075d20490b52495979bb Mon Sep 17 00:00:00 2001 From: swelf Date: Wed, 31 Jan 2024 12:35:25 +0300 Subject: [PATCH 15/29] review fixes --- docs/neutron/modules/contract-manager/client.md | 2 +- docs/neutron/modules/contract-manager/overview.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/neutron/modules/contract-manager/client.md b/docs/neutron/modules/contract-manager/client.md index a2f03100d..e738c52af 100644 --- a/docs/neutron/modules/contract-manager/client.md +++ b/docs/neutron/modules/contract-manager/client.md @@ -113,7 +113,7 @@ neutrond q contractmanager failure-details [address] [failure_id]
Example - Returns failures for specific contract address: + Query the detailed error related to a contract's sudo call failure: ```shell neutrond q contractmanager failure-details neutron1nxshmmwrvxa2cp80nwvf03t8u5kvl2ttr8m8f43vamudsqrdvs8qqvfwpj 1 diff --git a/docs/neutron/modules/contract-manager/overview.md b/docs/neutron/modules/contract-manager/overview.md index e33c93e4a..248fa20ce 100644 --- a/docs/neutron/modules/contract-manager/overview.md +++ b/docs/neutron/modules/contract-manager/overview.md @@ -100,4 +100,4 @@ You're encouraged to use our neutron-sdk implementation in contracts - [request] ## Failures details -In the case of a contract-initiated error, the error is stored in [Failure](state.md). Since raw errors are not part of the consensus and cannot guarantee determinism when saved to the state, errors saved in `Failure` are redacted to `codespace + code_id` using the [RedactError](https://github.com/neutron-org/neutron/blob/v2.0.2/x/contractmanager/keeper/failure.go#L109) function. At the same time, we emit the full text of the error into transaction events that do not affect the consensus and if you need to get detailed information about the error returned by the contract, you need to find the transaction in which the redacted error occurred and see the events in which we emit the error. To simplify this procedure we added a special [cli query](#failures-details), the error can be found by the address of the contract that caused the error and the failure_id. +In the case of a contract-initiated error, the error is stored in [Failure](state.md). Since raw errors are not part of the consensus and cannot guarantee determinism when saved to the state, errors saved in `Failure` are redacted to `codespace + code_id` using the [RedactError](https://github.com/neutron-org/neutron/blob/v2.0.2/x/contractmanager/keeper/failure.go#L109) function. At the same time, we emit the full text of the error into transaction events that do not affect the consensus and if you need to get detailed information about the error returned by the contract, you need to find the transaction in which the redacted error occurred and see the events in which we emit the error. To simplify this procedure we added a special [cli query](./client.md#failure-details), the error can be found by the `Failure.Address` and the `Failure.Id`. From e3d0819a38d45d9e710c313e7421163a023d94cd Mon Sep 17 00:00:00 2001 From: swelf Date: Wed, 31 Jan 2024 12:42:35 +0300 Subject: [PATCH 16/29] missed dot --- docs/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index d7bcba972..4b4dd4323 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -78,7 +78,7 @@ For example `gaiad q interchain-accounts host packet-events channel-736 1 --node Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. Unfortunately, to avoid the nondeterminism associated with error text generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before being saved to the state on the host interchain account side of the module. -And even the ` q interchain-accounts host packet-events` command is unable to show the full error text +And even the ` q interchain-accounts host packet-events` command is unable to show the full error text. If you really lack information about the error for diagnostics, you can look at the validator/node logs at the moment of transaction execution. All necessary information will be there. ## Relaying From 877b30ea696ef715f8209550e9372aefc4f80e9f Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:51:00 +0300 Subject: [PATCH 17/29] Update docs/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- docs/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 4b4dd4323..63cc2bf03 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -62,7 +62,7 @@ And acknoledgement packet follows the way Using `SudoLimitWrapper` has two purposes: 1. Suppress the sudo handler error itself, and mark the ibc acknowledgement packet as received and processed. Other way, the error makes relayer send an acknowledgement again and again. Information about an unsuccessfully processed ack is stored in [state](../contract-manager/state.md). -2. Limit the amount of gas available for sudo handler execution. Out of gas panic will later be captured by `sudolimitwrapper` and converted into an error. +2. Limit the amount of gas available for sudo handler execution. Out of gas panic will later be captured by `SudoLimitWrapper` and converted into an error. ## Failed interchain txs From e4dfc04ed368e1f879ff92e6a527fdb3df9dd841 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:52:54 +0300 Subject: [PATCH 18/29] Update versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- .../version-1.0/neutron/modules/interchain-txs/overview.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md index 6a6903a10..63f7509df 100644 --- a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md +++ b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md @@ -55,9 +55,11 @@ This reserve gas is needed to guarantee that [Failure](../contract-manager/state ## Failed interchain txs -Not every interchaintx executes succesfully on a remote network. Some of them fails to execute with errors and then you get ibc acknowledgement with `Error` type. In this case, in order to get additional details about the transaction parameters as well as details about the error, you can use the commands ` q interchain-accounts host packet-events ` +Not every interchaintx executes succesfully on a remote network. Some of them fail to execute with errors and then you get ibc acknowledgement with `Error` type. In this case, in order to get additional details about the transaction parameters as well as details about the error, you can use the command: +` q interchain-accounts host packet-events ` Where: + - `binary` is a binary on the chain you are working with - `channel-id` is the id of the channel on the host side of the interchain accounts - `seq-id` - seq of the ibc message received on the host From e8e379c83fbaf0ef91e1dec58a20a892f5801f23 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:53:34 +0300 Subject: [PATCH 19/29] Update docs/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- docs/neutron/modules/interchain-txs/overview.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 63cc2bf03..bfd4538bd 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -66,7 +66,10 @@ Using `SudoLimitWrapper` has two purposes: ## Failed interchain txs -Not every interchaintx executes succesfully on a remote network. Some of them fails to execute with errors and then you get ibc acknowledgement with `Error` type. In this case, in order to get additional details about the transaction parameters as well as details about the error, you can use the commands ` q interchain-accounts host packet-events ` +Not every interchaintx executes succesfully on a remote network. Some of them fail to execute with errors and then you get ibc acknowledgement with `Error` type. In this case, in order to get additional details about the transaction parameters as well as details about the error, you can use the command: + +` q interchain-accounts host packet-events ` + Where: - `binary` is a binary on the chain you are working with From 6ca4a9d9937017630f217b5e4bff19673fd0dd7f Mon Sep 17 00:00:00 2001 From: swelf Date: Wed, 31 Jan 2024 12:56:31 +0300 Subject: [PATCH 20/29] list formatting --- docs/neutron/modules/contract-manager/client.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/neutron/modules/contract-manager/client.md b/docs/neutron/modules/contract-manager/client.md index e738c52af..c433ad53a 100644 --- a/docs/neutron/modules/contract-manager/client.md +++ b/docs/neutron/modules/contract-manager/client.md @@ -104,7 +104,8 @@ Returns an exact error why contract failed to process certain ibc acknowledgemen > **Note** > If the node you are making query to either does not index transaction or already cleared the block with the wanted transaction, you get the error - `detailed failure error message not found in node events`. In this case you need to query a node, which: > -> 1) Indexes transactions +> 1) Indexes transactions. +> > 2) Keeps block with wanted height. ```shell From 621c60bb3accb437704ae33fa44ee829f50f88e5 Mon Sep 17 00:00:00 2001 From: swelf Date: Wed, 31 Jan 2024 19:59:03 +0300 Subject: [PATCH 21/29] removed "see logs" advice --- docs/neutron/modules/interchain-txs/overview.md | 1 - .../version-1.0/neutron/modules/interchain-txs/overview.md | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index bfd4538bd..5045513b3 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -82,7 +82,6 @@ Because this command is just an alias for the transaction search functionality, Unfortunately, to avoid the nondeterminism associated with error text generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before being saved to the state on the host interchain account side of the module. And even the ` q interchain-accounts host packet-events` command is unable to show the full error text. -If you really lack information about the error for diagnostics, you can look at the validator/node logs at the moment of transaction execution. All necessary information will be there. ## Relaying diff --git a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md index 63f7509df..b064cb166 100644 --- a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md +++ b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md @@ -69,8 +69,7 @@ For example `gaiad q interchain-accounts host packet-events channel-736 1 --node Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. Unfortunately, to avoid the nondeterminism associated with error text generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before being saved to the state on the host interchain account side of the module. -And even the ` q interchain-accounts host packet-events` command is unable to show the full error text -If you really lack information about the error for diagnostics, you can look at the validator/node logs at the moment of transaction execution. All necessary information will be there. +And even the ` q interchain-accounts host packet-events` command is unable to show the full error text. ## Relaying From 2ff0d9f805bb4d8f88e5f37bb936f75cbd789f4b Mon Sep 17 00:00:00 2001 From: swelf Date: Thu, 1 Feb 2024 16:15:16 +0300 Subject: [PATCH 22/29] uptodate "find failed tx" tutorial --- .../modules/interchain-txs/overview.md | 48 ++++++++++++++---- .../modules/interchain-txs/overview.md | 49 +++++++++++++++---- 2 files changed, 77 insertions(+), 20 deletions(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 5045513b3..4ce83f332 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -66,22 +66,50 @@ Using `SudoLimitWrapper` has two purposes: ## Failed interchain txs -Not every interchaintx executes succesfully on a remote network. Some of them fail to execute with errors and then you get ibc acknowledgement with `Error` type. In this case, in order to get additional details about the transaction parameters as well as details about the error, you can use the command: +Not every interchaintx executes succesfully on a remote network. Some of them fail to execute with errors and then you get ibc acknowledgement with `Error` type. The error is passed into the caller contract via sudo call with SudoMsg::Error [varian](../../../tutorials/cosmwasm_ica.md#ibc-events) +Unfortunately, to avoid the nondeterminism associated with error text generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before converting into AcknowledgementError. + +Find the error text is possible if host chain includes ibc-go v7.2.3+, v7.3.2+, v8.0.1+, v8.1+ which include patch [5541](https://github.com/cosmos/ibc-go/pull/5541) ` q interchain-accounts host packet-events ` Where: -- `binary` is a binary on the chain you are working with -- `channel-id` is the id of the channel on the host side of the interchain accounts -- `seq-id` - seq of the ibc message received on the host - -For example `gaiad q interchain-accounts host packet-events channel-736 1 --node https://cosmos-rpc.quickapi.com:443` is the transaction `fund community pool from neutron unclaimed airdrop` on `cosmoshub-4` chain. The node may remove tx from storage in future. You may need to find another one to get details. - -Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. +- `binary` is a binary on the chain you are working with (the remote chain) +- `channel-id` is the ID of the ICA's channel on the remote chain's side. You can find a couterparty channel-id with CLI command `neutrond q ibc channel end ` +- `seq-id` - sequence ID of the IBC message received on the remove chain + +Output example (filtered events): + +```json +{ +"type": "ibccallbackerror-ics27_packet", +"attributes": [ + { + "key": "ibccallbackerror-module", + "value": "interchainaccounts", + "index": true + }, + { + "key": "ibccallbackerror-host_channel_id", + "value": "channel-2", + "index": true + }, + { + "key": "ibccallbackerror-success", + "value": "false", + "index": true + }, + { + "key": "ibccallbackerror-error", + "value": "invalid validator address: decoding bech32 failed: invalid separator index -1: invalid address", + "index": true + } +] +} +``` -Unfortunately, to avoid the nondeterminism associated with error text generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before being saved to the state on the host interchain account side of the module. -And even the ` q interchain-accounts host packet-events` command is unable to show the full error text. +On earlier versions of ibc-go it's barerly possible to get full text error due to [patch](https://github.com/cosmos/ibc-go/commit/fdbb508c1ca68811206d7175fb9e202c1611a43e) ## Relaying diff --git a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md index b064cb166..75aad6183 100644 --- a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md +++ b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md @@ -55,21 +55,50 @@ This reserve gas is needed to guarantee that [Failure](../contract-manager/state ## Failed interchain txs -Not every interchaintx executes succesfully on a remote network. Some of them fail to execute with errors and then you get ibc acknowledgement with `Error` type. In this case, in order to get additional details about the transaction parameters as well as details about the error, you can use the command: -` q interchain-accounts host packet-events ` -Where: +Not every interchaintx executes succesfully on a remote network. Some of them fail to execute with errors and then you get ibc acknowledgement with `Error` type. The error is passed into the caller contract via sudo call with SudoMsg::Error [varian](../../../tutorials/cosmwasm_ica.md#ibc-events) +Unfortunately, to avoid the nondeterminism associated with error text generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before converting into AcknowledgementError. -- `binary` is a binary on the chain you are working with -- `channel-id` is the id of the channel on the host side of the interchain accounts -- `seq-id` - seq of the ibc message received on the host +Find the error text is possible if host chain includes ibc-go v7.2.3+, v7.3.2+, v8.0.1+, v8.1+ which include patch [5541](https://github.com/cosmos/ibc-go/pull/5541) +` q interchain-accounts host packet-events ` -For example `gaiad q interchain-accounts host packet-events channel-736 1 --node https://cosmos-rpc.quickapi.com:443` is the transaction `fund community pool from neutron unclaimed airdrop` on `cosmoshub-4` chain. The node may remove tx from storage in future. You may need to find another one to get details. +Where: -Because this command is just an alias for the transaction search functionality, it searches for the transaction using the following keys `recv_packet.packet_dst_channel = AND recv_packet.packet_dst_port = AND recv_packet. packet_sequence = `. The node you are accessing may not have this transaction, due to the fact that it was included in the block a long time ago and it has already been removed by the pruning procedure. +- `binary` is a binary on the chain you are working with (the remote chain) +- `channel-id` is the ID of the ICA's channel on the remote chain's side. You can find a couterparty channel-id with CLI command `neutrond q ibc channel end ` +- `seq-id` - sequence ID of the IBC message received on the remove chain + +Output example (filtered events): + +```json +{ +"type": "ibccallbackerror-ics27_packet", +"attributes": [ + { + "key": "ibccallbackerror-module", + "value": "interchainaccounts", + "index": true + }, + { + "key": "ibccallbackerror-host_channel_id", + "value": "channel-2", + "index": true + }, + { + "key": "ibccallbackerror-success", + "value": "false", + "index": true + }, + { + "key": "ibccallbackerror-error", + "value": "invalid validator address: decoding bech32 failed: invalid separator index -1: invalid address", + "index": true + } +] +} +``` -Unfortunately, to avoid the nondeterminism associated with error text generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before being saved to the state on the host interchain account side of the module. -And even the ` q interchain-accounts host packet-events` command is unable to show the full error text. +On earlier versions of ibc-go it's barerly possible to get full text error due to [patch](https://github.com/cosmos/ibc-go/commit/fdbb508c1ca68811206d7175fb9e202c1611a43e) ## Relaying From bde1ba68095cb825780677697a8041551481fa72 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Thu, 8 Feb 2024 13:25:01 +0300 Subject: [PATCH 23/29] Update versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- .../version-1.0/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md index 75aad6183..935dd261b 100644 --- a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md +++ b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md @@ -64,7 +64,7 @@ Find the error text is possible if host chain includes ibc-go v7.2.3+, v7.3.2+, Where: -- `binary` is a binary on the chain you are working with (the remote chain) +- `binary` is a binary of the chain you are working with (the remote chain) - `channel-id` is the ID of the ICA's channel on the remote chain's side. You can find a couterparty channel-id with CLI command `neutrond q ibc channel end ` - `seq-id` - sequence ID of the IBC message received on the remove chain From f98e0073369cec7496770668b101f6569a114fb0 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Thu, 8 Feb 2024 13:25:10 +0300 Subject: [PATCH 24/29] Update versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- .../version-1.0/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md index 935dd261b..1e537d884 100644 --- a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md +++ b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md @@ -98,7 +98,7 @@ Output example (filtered events): } ``` -On earlier versions of ibc-go it's barerly possible to get full text error due to [patch](https://github.com/cosmos/ibc-go/commit/fdbb508c1ca68811206d7175fb9e202c1611a43e) +On earlier versions of ibc-go it's barely possible to get full text error due to [patch](https://github.com/cosmos/ibc-go/commit/fdbb508c1ca68811206d7175fb9e202c1611a43e) ## Relaying From 9565a9b5d86dd2725a176de68638fc0fc23bffeb Mon Sep 17 00:00:00 2001 From: swelf Date: Thu, 8 Feb 2024 14:34:15 +0300 Subject: [PATCH 25/29] review changes. improved failed icatx tutorial --- docs/neutron/modules/interchain-txs/overview.md | 14 ++++++++++---- .../neutron/modules/interchain-txs/overview.md | 16 +++++++++++----- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 4ce83f332..60fff47ca 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -66,7 +66,7 @@ Using `SudoLimitWrapper` has two purposes: ## Failed interchain txs -Not every interchaintx executes succesfully on a remote network. Some of them fail to execute with errors and then you get ibc acknowledgement with `Error` type. The error is passed into the caller contract via sudo call with SudoMsg::Error [varian](../../../tutorials/cosmwasm_ica.md#ibc-events) +Not every interchaintx executes succesfully on a remote network. Some of them fail to execute with errors and then you get ibc acknowledgement with `Error` type. The error is passed into the caller contract via sudo call with SudoMsg::Error [variant](../../../tutorials/cosmwasm_ica.md#ibc-events) Unfortunately, to avoid the nondeterminism associated with error text generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before converting into AcknowledgementError. @@ -76,8 +76,11 @@ Find the error text is possible if host chain includes ibc-go v7.2.3+, v7.3.2+, Where: - `binary` is a binary on the chain you are working with (the remote chain) -- `channel-id` is the ID of the ICA's channel on the remote chain's side. You can find a couterparty channel-id with CLI command `neutrond q ibc channel end ` -- `seq-id` - sequence ID of the IBC message received on the remove chain +- `seq-id` - sequence ID of the IBC message sent to the remove chain. The seq-id is returned to the contract in the [SubmitTx](./messages.md#response) response +- `channel-id` is the ID of the ICA's channel on the remote chain's side. You should know it from registration [procedure](../../../tutorials/cosmwasm-ica.md#2-register-an-interchain-account) via `SudoMsg::OpenAck` from `counterparty_channel_id` field. If you missed it you can always get counterparty channel-id with CLI command `neutrond q ibc channel end ` +- `src-channel-id` is the channel you intechain account associated with. +- `src-port` is the channel you intechain account associated with. +You should know both `src-channel-id` and `src-port` from registration [procedure](../../../tutorials/cosmwasm-ica.md#2-register-an-interchain-account). Also `src-port` is `icacontroller-.` where `ica_id` defined by you during ica registration. Output example (filtered events): @@ -109,7 +112,10 @@ Output example (filtered events): } ``` -On earlier versions of ibc-go it's barerly possible to get full text error due to [patch](https://github.com/cosmos/ibc-go/commit/fdbb508c1ca68811206d7175fb9e202c1611a43e) +On earlier versions of ibc-go it's barely possible to get full text error due to [patch](https://github.com/cosmos/ibc-go/commit/fdbb508c1ca68811206d7175fb9e202c1611a43e). + +In the IBC error acknowledgement you get ABCI error and a code, e.g. `codespace: wasm, code: 5` +where codespace usually is `ModuleName`, and `code` is uniq code for the module. `codespace` and `code` pair uniq for the whole app. You can find the error description in source code. Usualy all the error of the module are [placed](https://github.com/CosmWasm/wasmd/blob/5f444cd9d393513e534cbfa9a0e938295c4e84e1/x/wasm/types/errors.go#L25) in `x//types/errors.go` where `module` is the module where the error was thrown ## Relaying diff --git a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md index 1e537d884..9e4a6114b 100644 --- a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md +++ b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md @@ -55,7 +55,7 @@ This reserve gas is needed to guarantee that [Failure](../contract-manager/state ## Failed interchain txs -Not every interchaintx executes succesfully on a remote network. Some of them fail to execute with errors and then you get ibc acknowledgement with `Error` type. The error is passed into the caller contract via sudo call with SudoMsg::Error [varian](../../../tutorials/cosmwasm_ica.md#ibc-events) +Not every interchaintx executes succesfully on a remote network. Some of them fail to execute with errors and then you get ibc acknowledgement with `Error` type. The error is passed into the caller contract via sudo call with SudoMsg::Error [variant](../../../tutorials/cosmwasm_ica.md#ibc-events) Unfortunately, to avoid the nondeterminism associated with error text generation, the error text is severely truncated by [redact down](https://github.com/cosmos/ibc-go/blob/v7.3.1/modules/apps/27-interchain-accounts/host/ibc_module.go#L115) to the error code without any additional details, before converting into AcknowledgementError. @@ -64,9 +64,12 @@ Find the error text is possible if host chain includes ibc-go v7.2.3+, v7.3.2+, Where: -- `binary` is a binary of the chain you are working with (the remote chain) -- `channel-id` is the ID of the ICA's channel on the remote chain's side. You can find a couterparty channel-id with CLI command `neutrond q ibc channel end ` -- `seq-id` - sequence ID of the IBC message received on the remove chain +- `binary` is a binary on the chain you are working with (the remote chain) +- `seq-id` - sequence ID of the IBC message sent to the remove chain. The seq-id is returned to the contract in the [SubmitTx](./messages.md#response) response +- `channel-id` is the ID of the ICA's channel on the remote chain's side. You should know it from registration [procedure](../../../tutorials/cosmwasm-ica.md#2-register-an-interchain-account) via `SudoMsg::OpenAck` from `counterparty_channel_id` field. If you missed it you can always get counterparty channel-id with CLI command `neutrond q ibc channel end ` +- `src-channel-id` is the channel you intechain account associated with. +- `src-port` is the channel you intechain account associated with. +You should know both `src-channel-id` and `src-port` from registration [procedure](../../../tutorials/cosmwasm-ica.md#2-register-an-interchain-account). Also `src-port` is `icacontroller-.` where `ica_id` defined by you during ica registration. Output example (filtered events): @@ -98,7 +101,10 @@ Output example (filtered events): } ``` -On earlier versions of ibc-go it's barely possible to get full text error due to [patch](https://github.com/cosmos/ibc-go/commit/fdbb508c1ca68811206d7175fb9e202c1611a43e) +On earlier versions of ibc-go it's barely possible to get full text error due to [patch](https://github.com/cosmos/ibc-go/commit/fdbb508c1ca68811206d7175fb9e202c1611a43e). + +In the IBC error acknowledgement you get ABCI error and a code, e.g. `codespace: wasm, code: 5` +where codespace usually is `ModuleName`, and `code` is uniq code for the module. `codespace` and `code` pair uniq for the whole app. You can find the error description in source code. Usualy all the error of the module are [placed](https://github.com/CosmWasm/wasmd/blob/5f444cd9d393513e534cbfa9a0e938295c4e84e1/x/wasm/types/errors.go#L25) in `x//types/errors.go` where `module` is the module where the error was thrown ## Relaying From 92ccef4883da187dfb01b5bad444766cc7146747 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:14:54 +0300 Subject: [PATCH 26/29] Update versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- .../version-1.0/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md index 9e4a6114b..5013ff707 100644 --- a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md +++ b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md @@ -68,7 +68,7 @@ Where: - `seq-id` - sequence ID of the IBC message sent to the remove chain. The seq-id is returned to the contract in the [SubmitTx](./messages.md#response) response - `channel-id` is the ID of the ICA's channel on the remote chain's side. You should know it from registration [procedure](../../../tutorials/cosmwasm-ica.md#2-register-an-interchain-account) via `SudoMsg::OpenAck` from `counterparty_channel_id` field. If you missed it you can always get counterparty channel-id with CLI command `neutrond q ibc channel end ` - `src-channel-id` is the channel you intechain account associated with. -- `src-port` is the channel you intechain account associated with. +- `src-port` is the port you interchain account is associated with. You should know both `src-channel-id` and `src-port` from registration [procedure](../../../tutorials/cosmwasm-ica.md#2-register-an-interchain-account). Also `src-port` is `icacontroller-.` where `ica_id` defined by you during ica registration. Output example (filtered events): From 8b6e4e8cbd055dca8a1670584f1695e2b0b7cf87 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:15:02 +0300 Subject: [PATCH 27/29] Update docs/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- docs/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 60fff47ca..02d5d13eb 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -79,7 +79,7 @@ Where: - `seq-id` - sequence ID of the IBC message sent to the remove chain. The seq-id is returned to the contract in the [SubmitTx](./messages.md#response) response - `channel-id` is the ID of the ICA's channel on the remote chain's side. You should know it from registration [procedure](../../../tutorials/cosmwasm-ica.md#2-register-an-interchain-account) via `SudoMsg::OpenAck` from `counterparty_channel_id` field. If you missed it you can always get counterparty channel-id with CLI command `neutrond q ibc channel end ` - `src-channel-id` is the channel you intechain account associated with. -- `src-port` is the channel you intechain account associated with. +- `src-port` is the port you interchain account is associated with. You should know both `src-channel-id` and `src-port` from registration [procedure](../../../tutorials/cosmwasm-ica.md#2-register-an-interchain-account). Also `src-port` is `icacontroller-.` where `ica_id` defined by you during ica registration. Output example (filtered events): From 50f554f234bef189ef4e3f535de1eff5e669b937 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:15:14 +0300 Subject: [PATCH 28/29] Update versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- .../version-1.0/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md index 5013ff707..c4b05ce95 100644 --- a/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md +++ b/versioned_docs/version-1.0/neutron/modules/interchain-txs/overview.md @@ -65,7 +65,7 @@ Find the error text is possible if host chain includes ibc-go v7.2.3+, v7.3.2+, Where: - `binary` is a binary on the chain you are working with (the remote chain) -- `seq-id` - sequence ID of the IBC message sent to the remove chain. The seq-id is returned to the contract in the [SubmitTx](./messages.md#response) response +- `seq-id` - sequence ID of the IBC message sent to the remote chain. The seq-id is returned to the contract in the [SubmitTx](./messages.md#response) response - `channel-id` is the ID of the ICA's channel on the remote chain's side. You should know it from registration [procedure](../../../tutorials/cosmwasm-ica.md#2-register-an-interchain-account) via `SudoMsg::OpenAck` from `counterparty_channel_id` field. If you missed it you can always get counterparty channel-id with CLI command `neutrond q ibc channel end ` - `src-channel-id` is the channel you intechain account associated with. - `src-port` is the port you interchain account is associated with. From fb9e126bdcfcd5ea45106b92a32e4c73863d5c37 Mon Sep 17 00:00:00 2001 From: swelf19 <62722506+swelf19@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:15:23 +0300 Subject: [PATCH 29/29] Update docs/neutron/modules/interchain-txs/overview.md Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- docs/neutron/modules/interchain-txs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/neutron/modules/interchain-txs/overview.md b/docs/neutron/modules/interchain-txs/overview.md index 02d5d13eb..9151912bd 100644 --- a/docs/neutron/modules/interchain-txs/overview.md +++ b/docs/neutron/modules/interchain-txs/overview.md @@ -76,7 +76,7 @@ Find the error text is possible if host chain includes ibc-go v7.2.3+, v7.3.2+, Where: - `binary` is a binary on the chain you are working with (the remote chain) -- `seq-id` - sequence ID of the IBC message sent to the remove chain. The seq-id is returned to the contract in the [SubmitTx](./messages.md#response) response +- `seq-id` - sequence ID of the IBC message sent to the remote chain. The seq-id is returned to the contract in the [SubmitTx](./messages.md#response) response - `channel-id` is the ID of the ICA's channel on the remote chain's side. You should know it from registration [procedure](../../../tutorials/cosmwasm-ica.md#2-register-an-interchain-account) via `SudoMsg::OpenAck` from `counterparty_channel_id` field. If you missed it you can always get counterparty channel-id with CLI command `neutrond q ibc channel end ` - `src-channel-id` is the channel you intechain account associated with. - `src-port` is the port you interchain account is associated with.