diff --git a/docs/static/swagger.yaml b/docs/static/swagger.yaml index c1c094a97..a383e254c 100644 --- a/docs/static/swagger.yaml +++ b/docs/static/swagger.yaml @@ -18474,6 +18474,7 @@ definitions: type: object type: object neutron.interchainqueries.Block: + description: A single verifiable result of an Interchain Query of TX type. properties: header: properties: @@ -18483,7 +18484,11 @@ definitions: format: byte type: string type: object - title: We need to know block X to verify inclusion of transaction for block X + description: >- + The header of the block the transaction is included in. It is needed + to know block header to + + verify inclusion of the transaction. next_block_header: properties: type_url: @@ -18492,26 +18497,27 @@ definitions: format: byte type: string type: object - title: >- - We need to know block X+1 to verify response of transaction for block - X + description: >- + The header of the block next to the block the transaction is included + in. It is needed to know - since LastResultsHash is root hash of all results from the txs from - the + block X+1 header to verify response of transaction for block X since + LastResultsHash is root - previous block + hash of all results of the txs from the previous block. tx: + description: The transaction matched by the Interchain Query's transaction filter. properties: data: + description: The arbitrary data typed body of the transaction. format: byte - title: is body of the transaction type: string delivery_proof: - title: >- - is the Merkle Proof which proves existence of response in block - with height + description: >- + The Merkle Proof which proves existence of response in the block + next to the block the - next_block_header.Height + transaction is included in. properties: aunts: items: @@ -18529,11 +18535,9 @@ definitions: type: string type: object inclusion_proof: - title: >- - is the Merkle Proof which proves existence of data in block with - height - - header.Height + description: >- + The Merkle Proof which proves inclusion of the transaction in the + block. properties: aunts: items: @@ -18551,13 +18555,7 @@ definitions: type: string type: object response: - description: >- - ExecTxResult contains results of executing one individual - transaction. - - - * Its structure is equivalent to #ResponseDeliverTx which will be - deprecated/deleted + description: The result of the transaction execution. properties: code: format: int64 @@ -18609,21 +18607,24 @@ definitions: type: object type: object neutron.interchainqueries.KVKey: + description: Represents a path to an IAVL storage node. properties: key: + description: >- + A bytes field representing the key for specific data in the module's + storage. format: byte - title: Key you want to read from the storage type: string path: - title: >- - Path (storage prefix) to the storage where you want to read value by - key + description: >- + The substore name used in an Interchain Query. Typically, this + corresponds to the keeper's - (usually name of cosmos-sdk module: 'staking', 'bank', etc.) + storeKey, usually the module's name, such as "bank", "staking", etc. type: string type: object neutron.interchainqueries.Params: - description: Params defines the parameters for the module. + description: The parameters for the module. properties: max_kv_query_keys_count: format: uint64 @@ -18636,7 +18637,9 @@ definitions: in msgRegisterInterchainQuery type: string query_deposit: - description: Amount of coins deposited for the query. + description: >- + Amount of coins required to be provided as deposit on Interchain Query + registration. items: description: |- Coin defines a token with a denomination and an amount. @@ -18651,34 +18654,43 @@ definitions: type: object type: array query_submit_timeout: + description: >- + The duration, measured in blocks, that must pass since the query's + registration or its last + + result submission before the query becomes eligible for removal by + anyone. Is used to set + + `submit_timeout` on Interchain Query registration. format: uint64 - title: |- - Defines amount of blocks required before query becomes available for - removal by anybody type: string tx_query_removal_limit: description: >- Amount of tx hashes to be removed during a single EndBlock. Can vary - to - - balance between network cleaning speed and EndBlock duration. A zero - value + to balance between - means no limit. + network cleaning speed and EndBlock duration. A zero value means no + limit. format: uint64 type: string type: object neutron.interchainqueries.QueryLastRemoteHeightResponse: + description: Response type for the Query/LastRemoteHeight RPC method. properties: height: + description: The height of the chain that the IBC client is currently on. + format: uint64 + type: string + revision: + description: The revision of the chain that the IBC client is currently on. format: uint64 type: string type: object neutron.interchainqueries.QueryParamsResponse: - description: QueryParamsResponse is response type for the Query/Params RPC method. + description: Response type for the Query/Params RPC method. properties: params: - description: params holds all the parameters of this module. + description: Contains all parameters of the module. properties: max_kv_query_keys_count: format: uint64 @@ -18691,7 +18703,9 @@ definitions: filters in msgRegisterInterchainQuery type: string query_deposit: - description: Amount of coins deposited for the query. + description: >- + Amount of coins required to be provided as deposit on Interchain + Query registration. items: description: >- Coin defines a token with a denomination and an amount. @@ -18709,27 +18723,29 @@ definitions: type: object type: array query_submit_timeout: - format: uint64 - title: >- - Defines amount of blocks required before query becomes available - for + description: >- + The duration, measured in blocks, that must pass since the query's + registration or its last - removal by anybody + result submission before the query becomes eligible for removal by + anyone. Is used to set + + `submit_timeout` on Interchain Query registration. + format: uint64 type: string tx_query_removal_limit: description: >- Amount of tx hashes to be removed during a single EndBlock. Can - vary to + vary to balance between - balance between network cleaning speed and EndBlock duration. A - zero value - - means no limit. + network cleaning speed and EndBlock duration. A zero value means + no limit. format: uint64 type: string type: object type: object neutron.interchainqueries.QueryRegisteredQueriesResponse: + description: Response type for the Query/RegisteredQueries RPC method. properties: pagination: description: |- @@ -18758,15 +18774,27 @@ definitions: type: string type: object registered_queries: + description: A list of registered Interchain Queries. items: + description: >- + Information about an Interchain Query registered in the + interchainqueries module. properties: connection_id: - title: >- - The IBC connection ID for getting ConsensusState to verify - proofs + description: >- + The IBC connection ID to the remote chain (the source of + querying data). Is used for getting + + ConsensusState from the respective IBC client to verify query + result proofs. type: string deposit: - description: Amount of coins deposited for the query. + description: >- + Amount of coins paid for the Interchain Query registration. The + deposit is paid back to the + + remover. The remover can be either the query owner (during the + submit timeout) or anybody. items: description: >- Coin defines a token with a denomination and an amount. @@ -18788,35 +18816,41 @@ definitions: format: uint64 type: string keys: + description: >- + The KV-storage keys for which to get values from the remote + chain. Only applicable for the + + KV Interchain Queries. Max amount of keys is limited by the + module's `max_kv_query_keys_count` + + parameters. items: + description: Represents a path to an IAVL storage node. properties: key: + description: >- + A bytes field representing the key for specific data in + the module's storage. format: byte - title: Key you want to read from the storage type: string path: - title: >- - Path (storage prefix) to the storage where you want to - read value by key + description: >- + The substore name used in an Interchain Query. Typically, + this corresponds to the keeper's - (usually name of cosmos-sdk module: 'staking', 'bank', - etc.) + storeKey, usually the module's name, such as "bank", + "staking", etc. type: string type: object - title: >- - The KV-storage keys for which we want to get values from remote - chain type: array last_submitted_result_local_height: - description: >- - The local chain last block height when the query result was - updated. + description: The local chain block height of the last query results update. format: uint64 type: string last_submitted_result_remote_height: description: >- - The remote chain last block height when the query result was - updated. + The remote chain block height that corresponds to the last query + result update. properties: revision_height: format: uint64 @@ -18835,38 +18869,73 @@ definitions: freezing clients type: object owner: - description: The address that registered the query. + description: The address of the contract that registered the query. type: string query_type: - title: 'The query type identifier: `kv` or `tx` now' + description: 'The query type identifier: `kv` or `tx`.' type: string registered_at_height: - description: The local chain height when the query was registered. + description: >- + The local chain block height of the Interchain Query + registration. format: uint64 type: string submit_timeout: - description: Timeout before query becomes available for everybody to remove. + description: >- + The duration, measured in blocks, that must pass since the + query's registration or its last + + result submission before the query becomes eligible for removal + by anyone. format: uint64 type: string transactions_filter: - title: The filter for transaction search ICQ + description: >- + A stringified list of filters for remote transactions search. + Only applicable for the TX + + Interchain Queries. Example: + "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]". + + Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount + of filter conditions is limited + + by the module's `max_transactions_filters` parameters. type: string update_period: - description: Parameter that defines how often the query must be updated. + description: >- + Parameter that defines the minimal delay between consecutive + query executions (i.e. the + + minimal delay between query results update). format: uint64 type: string type: object type: array type: object neutron.interchainqueries.QueryRegisteredQueryResponse: + description: Response type for the Query/RegisteredQuery RPC method. properties: registered_query: + description: >- + Information about an Interchain Query registered in the + interchainqueries module. properties: connection_id: - title: The IBC connection ID for getting ConsensusState to verify proofs + description: >- + The IBC connection ID to the remote chain (the source of querying + data). Is used for getting + + ConsensusState from the respective IBC client to verify query + result proofs. type: string deposit: - description: Amount of coins deposited for the query. + description: >- + Amount of coins paid for the Interchain Query registration. The + deposit is paid back to the + + remover. The remover can be either the query owner (during the + submit timeout) or anybody. items: description: >- Coin defines a token with a denomination and an amount. @@ -18888,34 +18957,41 @@ definitions: format: uint64 type: string keys: + description: >- + The KV-storage keys for which to get values from the remote chain. + Only applicable for the + + KV Interchain Queries. Max amount of keys is limited by the + module's `max_kv_query_keys_count` + + parameters. items: + description: Represents a path to an IAVL storage node. properties: key: + description: >- + A bytes field representing the key for specific data in the + module's storage. format: byte - title: Key you want to read from the storage type: string path: - title: >- - Path (storage prefix) to the storage where you want to read - value by key + description: >- + The substore name used in an Interchain Query. Typically, + this corresponds to the keeper's - (usually name of cosmos-sdk module: 'staking', 'bank', etc.) + storeKey, usually the module's name, such as "bank", + "staking", etc. type: string type: object - title: >- - The KV-storage keys for which we want to get values from remote - chain type: array last_submitted_result_local_height: - description: >- - The local chain last block height when the query result was - updated. + description: The local chain block height of the last query results update. format: uint64 type: string last_submitted_result_remote_height: description: >- - The remote chain last block height when the query result was - updated. + The remote chain block height that corresponds to the last query + result update. properties: revision_height: format: uint64 @@ -18934,35 +19010,69 @@ definitions: freezing clients type: object owner: - description: The address that registered the query. + description: The address of the contract that registered the query. type: string query_type: - title: 'The query type identifier: `kv` or `tx` now' + description: 'The query type identifier: `kv` or `tx`.' type: string registered_at_height: - description: The local chain height when the query was registered. + description: The local chain block height of the Interchain Query registration. format: uint64 type: string submit_timeout: - description: Timeout before query becomes available for everybody to remove. + description: >- + The duration, measured in blocks, that must pass since the query's + registration or its last + + result submission before the query becomes eligible for removal by + anyone. format: uint64 type: string transactions_filter: - title: The filter for transaction search ICQ + description: >- + A stringified list of filters for remote transactions search. Only + applicable for the TX + + Interchain Queries. Example: + "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]". + + Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount of + filter conditions is limited + + by the module's `max_transactions_filters` parameters. type: string update_period: - description: Parameter that defines how often the query must be updated. + description: >- + Parameter that defines the minimal delay between consecutive query + executions (i.e. the + + minimal delay between query results update). format: uint64 type: string type: object type: object neutron.interchainqueries.QueryRegisteredQueryResultResponse: + description: Response type for the Query/QueryResult RPC method. properties: result: + description: The last successfully submitted result of an Interchain Query. properties: allow_kv_callbacks: + description: >- + Whether to send the query result to the owner contract as a sudo + message. Only applicable for + + KV type of Interchain Queries. type: boolean block: + description: >- + A TX Interchain Query execution result. Contains metainformation + about the blocks of the query + + execution height. Only populated when submitting an Interchain + Query result for verification + + and emptied when saving the result on chain. properties: header: properties: @@ -18972,9 +19082,11 @@ definitions: format: byte type: string type: object - title: >- - We need to know block X to verify inclusion of transaction for - block X + description: >- + The header of the block the transaction is included in. It is + needed to know block header to + + verify inclusion of the transaction. next_block_header: properties: type_url: @@ -18983,26 +19095,29 @@ definitions: format: byte type: string type: object - title: >- - We need to know block X+1 to verify response of transaction - for block X + description: >- + The header of the block next to the block the transaction is + included in. It is needed to know - since LastResultsHash is root hash of all results from the txs - from the + block X+1 header to verify response of transaction for block X + since LastResultsHash is root - previous block + hash of all results of the txs from the previous block. tx: + description: >- + The transaction matched by the Interchain Query's transaction + filter. properties: data: + description: The arbitrary data typed body of the transaction. format: byte - title: is body of the transaction type: string delivery_proof: - title: >- - is the Merkle Proof which proves existence of response in - block with height + description: >- + The Merkle Proof which proves existence of response in the + block next to the block the - next_block_header.Height + transaction is included in. properties: aunts: items: @@ -19020,11 +19135,9 @@ definitions: type: string type: object inclusion_proof: - title: >- - is the Merkle Proof which proves existence of data in - block with height - - header.Height + description: >- + The Merkle Proof which proves inclusion of the transaction + in the block. properties: aunts: items: @@ -19042,13 +19155,7 @@ definitions: type: string type: object response: - description: >- - ExecTxResult contains results of executing one individual - transaction. - - - * Its structure is equivalent to #ResponseDeliverTx which - will be deprecated/deleted + description: The result of the transaction execution. properties: code: format: int64 @@ -19101,17 +19208,28 @@ definitions: type: object type: object height: + description: >- + The height of the chain at the moment of the Interchain Query + execution. format: uint64 type: string kv_results: + description: >- + A list of a KV Interchain Query execution results. Each result + contains query parameters, a + + response value and a proof. items: + description: A verifiable result of performing a single KVKey read. properties: Proof: - title: >- - is the Merkle Proof which proves existence of key-value pair - in IAVL + description: >- + The Merkle Proof which proves existence/nonexistence of + key-value pair in IAVL storage. Is + + used to verify - storage + the pair against the respective remote chain's header. properties: ops: items: @@ -19134,30 +19252,76 @@ definitions: for example neighbouring node hash type: object type: array + title: ProofOps is Merkle proof defined by the list of ProofOps type: object key: + description: >- + A bytes field representing the key of the data read from the + module's storage. format: byte - title: is the key in IAVL store type: string storage_prefix: - title: is the substore name (acc, staking, etc.) + description: >- + The substore name used in the read operation. Typically, + this corresponds to the keeper's + + storeKey, usually the module's name, such as "bank", + "staking", etc. type: string value: + description: >- + A bytes field containing the value associated with the key + in the store. format: byte - title: is the value in IAVL store type: string type: object type: array revision: + description: >- + The revision number of the chain at the moment of the Interchain + Query execution. format: uint64 type: string type: object type: object neutron.interchainqueries.QueryResult: + description: >- + Contains different information about a single Interchain Query execution + result. Currently, + + this structure is used both in query result submission via an ICQ Relayer + and as a query result + + storage for read/write operations to interchainqueries module, but the + structure fields are + + populated in a bit different ways. When submitting a query result, all + fields are populated and + + provided to the interchainqueries module in order to verify the result + against the IBC client's + + state. But in order to lighten the chain state, the interchainqueries + module removes the block + + field and proofs from the kv_results. properties: allow_kv_callbacks: + description: >- + Whether to send the query result to the owner contract as a sudo + message. Only applicable for + + KV type of Interchain Queries. type: boolean block: + description: >- + A TX Interchain Query execution result. Contains metainformation about + the blocks of the query + + execution height. Only populated when submitting an Interchain Query + result for verification + + and emptied when saving the result on chain. properties: header: properties: @@ -19167,9 +19331,11 @@ definitions: format: byte type: string type: object - title: >- - We need to know block X to verify inclusion of transaction for - block X + description: >- + The header of the block the transaction is included in. It is + needed to know block header to + + verify inclusion of the transaction. next_block_header: properties: type_url: @@ -19178,26 +19344,29 @@ definitions: format: byte type: string type: object - title: >- - We need to know block X+1 to verify response of transaction for - block X + description: >- + The header of the block next to the block the transaction is + included in. It is needed to know - since LastResultsHash is root hash of all results from the txs - from the + block X+1 header to verify response of transaction for block X + since LastResultsHash is root - previous block + hash of all results of the txs from the previous block. tx: + description: >- + The transaction matched by the Interchain Query's transaction + filter. properties: data: + description: The arbitrary data typed body of the transaction. format: byte - title: is body of the transaction type: string delivery_proof: - title: >- - is the Merkle Proof which proves existence of response in - block with height + description: >- + The Merkle Proof which proves existence of response in the + block next to the block the - next_block_header.Height + transaction is included in. properties: aunts: items: @@ -19215,11 +19384,9 @@ definitions: type: string type: object inclusion_proof: - title: >- - is the Merkle Proof which proves existence of data in block - with height - - header.Height + description: >- + The Merkle Proof which proves inclusion of the transaction in + the block. properties: aunts: items: @@ -19237,13 +19404,7 @@ definitions: type: string type: object response: - description: >- - ExecTxResult contains results of executing one individual - transaction. - - - * Its structure is equivalent to #ResponseDeliverTx which will - be deprecated/deleted + description: The result of the transaction execution. properties: code: format: int64 @@ -19295,17 +19456,28 @@ definitions: type: object type: object height: + description: >- + The height of the chain at the moment of the Interchain Query + execution. format: uint64 type: string kv_results: + description: >- + A list of a KV Interchain Query execution results. Each result + contains query parameters, a + + response value and a proof. items: + description: A verifiable result of performing a single KVKey read. properties: Proof: - title: >- - is the Merkle Proof which proves existence of key-value pair in - IAVL + description: >- + The Merkle Proof which proves existence/nonexistence of + key-value pair in IAVL storage. Is - storage + used to verify + + the pair against the respective remote chain's header. properties: ops: items: @@ -19328,31 +19500,57 @@ definitions: for example neighbouring node hash type: object type: array + title: ProofOps is Merkle proof defined by the list of ProofOps type: object key: + description: >- + A bytes field representing the key of the data read from the + module's storage. format: byte - title: is the key in IAVL store type: string storage_prefix: - title: is the substore name (acc, staking, etc.) + description: >- + The substore name used in the read operation. Typically, this + corresponds to the keeper's + + storeKey, usually the module's name, such as "bank", "staking", + etc. type: string value: + description: >- + A bytes field containing the value associated with the key in + the store. format: byte - title: is the value in IAVL store type: string type: object type: array revision: + description: >- + The revision number of the chain at the moment of the Interchain Query + execution. format: uint64 type: string type: object neutron.interchainqueries.RegisteredQuery: + description: >- + Information about an Interchain Query registered in the interchainqueries + module. properties: connection_id: - title: The IBC connection ID for getting ConsensusState to verify proofs + description: >- + The IBC connection ID to the remote chain (the source of querying + data). Is used for getting + + ConsensusState from the respective IBC client to verify query result + proofs. type: string deposit: - description: Amount of coins deposited for the query. + description: >- + Amount of coins paid for the Interchain Query registration. The + deposit is paid back to the + + remover. The remover can be either the query owner (during the submit + timeout) or anybody. items: description: |- Coin defines a token with a denomination and an amount. @@ -19371,28 +19569,41 @@ definitions: format: uint64 type: string keys: + description: >- + The KV-storage keys for which to get values from the remote chain. + Only applicable for the + + KV Interchain Queries. Max amount of keys is limited by the module's + `max_kv_query_keys_count` + + parameters. items: + description: Represents a path to an IAVL storage node. properties: key: + description: >- + A bytes field representing the key for specific data in the + module's storage. format: byte - title: Key you want to read from the storage type: string path: - title: >- - Path (storage prefix) to the storage where you want to read - value by key + description: >- + The substore name used in an Interchain Query. Typically, this + corresponds to the keeper's - (usually name of cosmos-sdk module: 'staking', 'bank', etc.) + storeKey, usually the module's name, such as "bank", "staking", + etc. type: string type: object - title: The KV-storage keys for which we want to get values from remote chain type: array last_submitted_result_local_height: - description: The local chain last block height when the query result was updated. + description: The local chain block height of the last query results update. format: uint64 type: string last_submitted_result_remote_height: - description: The remote chain last block height when the query result was updated. + description: >- + The remote chain block height that corresponds to the last query + result update. properties: revision_height: format: uint64 @@ -19411,33 +19622,57 @@ definitions: freezing clients type: object owner: - description: The address that registered the query. + description: The address of the contract that registered the query. type: string query_type: - title: 'The query type identifier: `kv` or `tx` now' + description: 'The query type identifier: `kv` or `tx`.' type: string registered_at_height: - description: The local chain height when the query was registered. + description: The local chain block height of the Interchain Query registration. format: uint64 type: string submit_timeout: - description: Timeout before query becomes available for everybody to remove. + description: >- + The duration, measured in blocks, that must pass since the query's + registration or its last + + result submission before the query becomes eligible for removal by + anyone. format: uint64 type: string transactions_filter: - title: The filter for transaction search ICQ + description: >- + A stringified list of filters for remote transactions search. Only + applicable for the TX + + Interchain Queries. Example: + "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]". + + Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount of + filter conditions is limited + + by the module's `max_transactions_filters` parameters. type: string update_period: - description: Parameter that defines how often the query must be updated. + description: >- + Parameter that defines the minimal delay between consecutive query + executions (i.e. the + + minimal delay between query results update). format: uint64 type: string type: object neutron.interchainqueries.StorageValue: + description: A verifiable result of performing a single KVKey read. properties: Proof: - title: |- - is the Merkle Proof which proves existence of key-value pair in IAVL - storage + description: >- + The Merkle Proof which proves existence/nonexistence of key-value pair + in IAVL storage. Is + + used to verify + + the pair against the respective remote chain's header. properties: ops: items: @@ -19456,31 +19691,41 @@ definitions: for example neighbouring node hash type: object type: array + title: ProofOps is Merkle proof defined by the list of ProofOps type: object key: + description: >- + A bytes field representing the key of the data read from the module's + storage. format: byte - title: is the key in IAVL store type: string storage_prefix: - title: is the substore name (acc, staking, etc.) + description: >- + The substore name used in the read operation. Typically, this + corresponds to the keeper's + + storeKey, usually the module's name, such as "bank", "staking", etc. type: string value: + description: >- + A bytes field containing the value associated with the key in the + store. format: byte - title: is the value in IAVL store type: string type: object neutron.interchainqueries.TxValue: + description: Contains transaction body, response, and proofs of inclusion and delivery. properties: data: + description: The arbitrary data typed body of the transaction. format: byte - title: is body of the transaction type: string delivery_proof: - title: >- - is the Merkle Proof which proves existence of response in block with - height + description: >- + The Merkle Proof which proves existence of response in the block next + to the block the - next_block_header.Height + transaction is included in. properties: aunts: items: @@ -19498,11 +19743,9 @@ definitions: type: string type: object inclusion_proof: - title: >- - is the Merkle Proof which proves existence of data in block with - height - - header.Height + description: >- + The Merkle Proof which proves inclusion of the transaction in the + block. properties: aunts: items: @@ -19520,12 +19763,7 @@ definitions: type: string type: object response: - description: >- - ExecTxResult contains results of executing one individual transaction. - - - * Its structure is equivalent to #ResponseDeliverTx which will be - deprecated/deleted + description: The result of the transaction execution. properties: code: format: int64 @@ -44580,12 +44818,10 @@ paths: '200': description: A successful response. schema: - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. + description: Response type for the Query/Params RPC method. properties: params: - description: params holds all the parameters of this module. + description: Contains all parameters of the module. properties: max_kv_query_keys_count: format: uint64 @@ -44598,7 +44834,9 @@ paths: tx filters in msgRegisterInterchainQuery type: string query_deposit: - description: Amount of coins deposited for the query. + description: >- + Amount of coins required to be provided as deposit on + Interchain Query registration. items: description: >- Coin defines a token with a denomination and an amount. @@ -44616,21 +44854,22 @@ paths: type: object type: array query_submit_timeout: - format: uint64 - title: >- - Defines amount of blocks required before query becomes - available for + description: >- + The duration, measured in blocks, that must pass since the + query's registration or its last - removal by anybody + result submission before the query becomes eligible for + removal by anyone. Is used to set + + `submit_timeout` on Interchain Query registration. + format: uint64 type: string tx_query_removal_limit: description: >- Amount of tx hashes to be removed during a single - EndBlock. Can vary to - - balance between network cleaning speed and EndBlock - duration. A zero value + EndBlock. Can vary to balance between + network cleaning speed and EndBlock duration. A zero value means no limit. format: uint64 type: string @@ -44658,14 +44897,15 @@ paths: message: type: string type: object - summary: Parameters queries the parameters of the module. + summary: Fetches the current parameters of the interchainqueries module. tags: - Query /neutron/interchainqueries/query_result: get: operationId: QueryResult parameters: - - format: uint64 + - description: ID of an Interchain Query. + format: uint64 in: query name: query_id required: false @@ -44674,12 +44914,27 @@ paths: '200': description: A successful response. schema: + description: Response type for the Query/QueryResult RPC method. properties: result: + description: The last successfully submitted result of an Interchain Query. properties: allow_kv_callbacks: + description: >- + Whether to send the query result to the owner contract as + a sudo message. Only applicable for + + KV type of Interchain Queries. type: boolean block: + description: >- + A TX Interchain Query execution result. Contains + metainformation about the blocks of the query + + execution height. Only populated when submitting an + Interchain Query result for verification + + and emptied when saving the result on chain. properties: header: properties: @@ -44689,9 +44944,11 @@ paths: format: byte type: string type: object - title: >- - We need to know block X to verify inclusion of - transaction for block X + description: >- + The header of the block the transaction is included + in. It is needed to know block header to + + verify inclusion of the transaction. next_block_header: properties: type_url: @@ -44700,26 +44957,30 @@ paths: format: byte type: string type: object - title: >- - We need to know block X+1 to verify response of - transaction for block X + description: >- + The header of the block next to the block the + transaction is included in. It is needed to know - since LastResultsHash is root hash of all results from - the txs from the + block X+1 header to verify response of transaction for + block X since LastResultsHash is root - previous block + hash of all results of the txs from the previous + block. tx: + description: >- + The transaction matched by the Interchain Query's + transaction filter. properties: data: + description: The arbitrary data typed body of the transaction. format: byte - title: is body of the transaction type: string delivery_proof: - title: >- - is the Merkle Proof which proves existence of - response in block with height + description: >- + The Merkle Proof which proves existence of + response in the block next to the block the - next_block_header.Height + transaction is included in. properties: aunts: items: @@ -44737,11 +44998,9 @@ paths: type: string type: object inclusion_proof: - title: >- - is the Merkle Proof which proves existence of data - in block with height - - header.Height + description: >- + The Merkle Proof which proves inclusion of the + transaction in the block. properties: aunts: items: @@ -44759,14 +45018,7 @@ paths: type: string type: object response: - description: >- - ExecTxResult contains results of executing one - individual transaction. - - - * Its structure is equivalent to - #ResponseDeliverTx which will be - deprecated/deleted + description: The result of the transaction execution. properties: code: format: int64 @@ -44819,17 +45071,29 @@ paths: type: object type: object height: + description: >- + The height of the chain at the moment of the Interchain + Query execution. format: uint64 type: string kv_results: + description: >- + A list of a KV Interchain Query execution results. Each + result contains query parameters, a + + response value and a proof. items: + description: A verifiable result of performing a single KVKey read. properties: Proof: - title: >- - is the Merkle Proof which proves existence of - key-value pair in IAVL + description: >- + The Merkle Proof which proves existence/nonexistence + of key-value pair in IAVL storage. Is + + used to verify - storage + the pair against the respective remote chain's + header. properties: ops: items: @@ -44852,21 +45116,36 @@ paths: for example neighbouring node hash type: object type: array + title: >- + ProofOps is Merkle proof defined by the list of + ProofOps type: object key: + description: >- + A bytes field representing the key of the data read + from the module's storage. format: byte - title: is the key in IAVL store type: string storage_prefix: - title: is the substore name (acc, staking, etc.) + description: >- + The substore name used in the read operation. + Typically, this corresponds to the keeper's + + storeKey, usually the module's name, such as "bank", + "staking", etc. type: string value: + description: >- + A bytes field containing the value associated with + the key in the store. format: byte - title: is the value in IAVL store type: string type: object type: array revision: + description: >- + The revision number of the chain at the moment of the + Interchain Query execution. format: uint64 type: string type: object @@ -44893,6 +45172,11 @@ paths: message: type: string type: object + summary: >- + Retrieves the most recent successfully submitted result of an Interchain + Query. This is only + + applicable for KV Interchain Queries. tags: - Query /neutron/interchainqueries/registered_queries: @@ -44900,13 +45184,29 @@ paths: operationId: RegisteredQueries parameters: - collectionFormat: multi + description: >- + A list of owners of Interchain Queries. Query response will contain + only Interchain Queries + + that are owned by one of the owners in the list. If none, Interchain + Queries are not filtered + + out by the owner field. in: query items: type: string name: owners required: false type: array - - in: query + - description: >- + IBC connection ID. Query response will contain only Interchain + Queries that have the same IBC + + connection ID parameter. If none, Interchain Queries are not + filtered out by the connection ID + + field. + in: query name: connection_id required: false type: string @@ -44970,6 +45270,7 @@ paths: '200': description: A successful response. schema: + description: Response type for the Query/RegisteredQueries RPC method. properties: pagination: description: >- @@ -45000,15 +45301,27 @@ paths: type: string type: object registered_queries: + description: A list of registered Interchain Queries. items: + description: >- + Information about an Interchain Query registered in the + interchainqueries module. properties: connection_id: - title: >- - The IBC connection ID for getting ConsensusState to - verify proofs + description: >- + The IBC connection ID to the remote chain (the source of + querying data). Is used for getting + + ConsensusState from the respective IBC client to verify + query result proofs. type: string deposit: - description: Amount of coins deposited for the query. + description: >- + Amount of coins paid for the Interchain Query + registration. The deposit is paid back to the + + remover. The remover can be either the query owner + (during the submit timeout) or anybody. items: description: >- Coin defines a token with a denomination and an @@ -45031,35 +45344,43 @@ paths: format: uint64 type: string keys: + description: >- + The KV-storage keys for which to get values from the + remote chain. Only applicable for the + + KV Interchain Queries. Max amount of keys is limited by + the module's `max_kv_query_keys_count` + + parameters. items: + description: Represents a path to an IAVL storage node. properties: key: + description: >- + A bytes field representing the key for specific + data in the module's storage. format: byte - title: Key you want to read from the storage type: string path: - title: >- - Path (storage prefix) to the storage where you - want to read value by key + description: >- + The substore name used in an Interchain Query. + Typically, this corresponds to the keeper's - (usually name of cosmos-sdk module: 'staking', - 'bank', etc.) + storeKey, usually the module's name, such as + "bank", "staking", etc. type: string type: object - title: >- - The KV-storage keys for which we want to get values from - remote chain type: array last_submitted_result_local_height: description: >- - The local chain last block height when the query result - was updated. + The local chain block height of the last query results + update. format: uint64 type: string last_submitted_result_remote_height: description: >- - The remote chain last block height when the query result - was updated. + The remote chain block height that corresponds to the + last query result update. properties: revision_height: format: uint64 @@ -45078,28 +45399,45 @@ paths: freezing clients type: object owner: - description: The address that registered the query. + description: The address of the contract that registered the query. type: string query_type: - title: 'The query type identifier: `kv` or `tx` now' + description: 'The query type identifier: `kv` or `tx`.' type: string registered_at_height: - description: The local chain height when the query was registered. + description: >- + The local chain block height of the Interchain Query + registration. format: uint64 type: string submit_timeout: description: >- - Timeout before query becomes available for everybody to - remove. + The duration, measured in blocks, that must pass since + the query's registration or its last + + result submission before the query becomes eligible for + removal by anyone. format: uint64 type: string transactions_filter: - title: The filter for transaction search ICQ + description: >- + A stringified list of filters for remote transactions + search. Only applicable for the TX + + Interchain Queries. Example: + "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]". + + Supported operators: "eq", "lt", "gt", "lte", "gte". Max + amount of filter conditions is limited + + by the module's `max_transactions_filters` parameters. type: string update_period: description: >- - Parameter that defines how often the query must be - updated. + Parameter that defines the minimal delay between + consecutive query executions (i.e. the + + minimal delay between query results update). format: uint64 type: string type: object @@ -45127,13 +45465,19 @@ paths: message: type: string type: object + summary: >- + Retrieves all registered Interchain Queries in the module, with optional + filtering by owner + + and/or connection ID. tags: - Query /neutron/interchainqueries/registered_query: get: operationId: RegisteredQuery parameters: - - format: uint64 + - description: ID of an Interchain Query. + format: uint64 in: query name: query_id required: false @@ -45142,16 +45486,28 @@ paths: '200': description: A successful response. schema: + description: Response type for the Query/RegisteredQuery RPC method. properties: registered_query: + description: >- + Information about an Interchain Query registered in the + interchainqueries module. properties: connection_id: - title: >- - The IBC connection ID for getting ConsensusState to verify - proofs + description: >- + The IBC connection ID to the remote chain (the source of + querying data). Is used for getting + + ConsensusState from the respective IBC client to verify + query result proofs. type: string deposit: - description: Amount of coins deposited for the query. + description: >- + Amount of coins paid for the Interchain Query + registration. The deposit is paid back to the + + remover. The remover can be either the query owner (during + the submit timeout) or anybody. items: description: >- Coin defines a token with a denomination and an amount. @@ -45173,35 +45529,43 @@ paths: format: uint64 type: string keys: + description: >- + The KV-storage keys for which to get values from the + remote chain. Only applicable for the + + KV Interchain Queries. Max amount of keys is limited by + the module's `max_kv_query_keys_count` + + parameters. items: + description: Represents a path to an IAVL storage node. properties: key: + description: >- + A bytes field representing the key for specific data + in the module's storage. format: byte - title: Key you want to read from the storage type: string path: - title: >- - Path (storage prefix) to the storage where you want - to read value by key + description: >- + The substore name used in an Interchain Query. + Typically, this corresponds to the keeper's - (usually name of cosmos-sdk module: 'staking', - 'bank', etc.) + storeKey, usually the module's name, such as "bank", + "staking", etc. type: string type: object - title: >- - The KV-storage keys for which we want to get values from - remote chain type: array last_submitted_result_local_height: description: >- - The local chain last block height when the query result - was updated. + The local chain block height of the last query results + update. format: uint64 type: string last_submitted_result_remote_height: description: >- - The remote chain last block height when the query result - was updated. + The remote chain block height that corresponds to the last + query result update. properties: revision_height: format: uint64 @@ -45220,28 +45584,45 @@ paths: freezing clients type: object owner: - description: The address that registered the query. + description: The address of the contract that registered the query. type: string query_type: - title: 'The query type identifier: `kv` or `tx` now' + description: 'The query type identifier: `kv` or `tx`.' type: string registered_at_height: - description: The local chain height when the query was registered. + description: >- + The local chain block height of the Interchain Query + registration. format: uint64 type: string submit_timeout: description: >- - Timeout before query becomes available for everybody to - remove. + The duration, measured in blocks, that must pass since the + query's registration or its last + + result submission before the query becomes eligible for + removal by anyone. format: uint64 type: string transactions_filter: - title: The filter for transaction search ICQ + description: >- + A stringified list of filters for remote transactions + search. Only applicable for the TX + + Interchain Queries. Example: + "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]". + + Supported operators: "eq", "lt", "gt", "lte", "gte". Max + amount of filter conditions is limited + + by the module's `max_transactions_filters` parameters. type: string update_period: description: >- - Parameter that defines how often the query must be - updated. + Parameter that defines the minimal delay between + consecutive query executions (i.e. the + + minimal delay between query results update). format: uint64 type: string type: object @@ -45268,13 +45649,19 @@ paths: message: type: string type: object + summary: Fetches details of a registered Interchain Query using its ID. tags: - Query /neutron/interchainqueries/remote_height: get: operationId: LastRemoteHeight parameters: - - in: query + - description: >- + Connection ID of an IBC connection to a remote chain. Determines the + IBC client used in query + + handling. + in: query name: connection_id required: false type: string @@ -45282,8 +45669,14 @@ paths: '200': description: A successful response. schema: + description: Response type for the Query/LastRemoteHeight RPC method. properties: height: + description: The height of the chain that the IBC client is currently on. + format: uint64 + type: string + revision: + description: The revision of the chain that the IBC client is currently on. format: uint64 type: string type: object @@ -45309,6 +45702,11 @@ paths: message: type: string type: object + summary: >- + Retrieves the most recent height of a remote chain as known by the IBC + client associated with + + a given connection ID. tags: - Query /neutron/interchaintxs/params: diff --git a/proto/neutron/interchainqueries/genesis.proto b/proto/neutron/interchainqueries/genesis.proto index 41a2870ab..fe1675c14 100644 --- a/proto/neutron/interchainqueries/genesis.proto +++ b/proto/neutron/interchainqueries/genesis.proto @@ -8,57 +8,59 @@ import "neutron/interchainqueries/params.proto"; option go_package = "github.com/neutron-org/neutron/v5/x/interchainqueries/types"; +// Information about an Interchain Query registered in the interchainqueries module. message RegisteredQuery { // The unique id of the registered query. uint64 id = 1; - - // The address that registered the query. + // The address of the contract that registered the query. string owner = 2; - - // The query type identifier: `kv` or `tx` now + // The query type identifier: `kv` or `tx`. string query_type = 3; - - // The KV-storage keys for which we want to get values from remote chain + // The KV-storage keys for which to get values from the remote chain. Only applicable for the + // KV Interchain Queries. Max amount of keys is limited by the module's `max_kv_query_keys_count` + // parameters. repeated KVKey keys = 4; - - // The filter for transaction search ICQ + // A stringified list of filters for remote transactions search. Only applicable for the TX + // Interchain Queries. Example: "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]". + // Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount of filter conditions is limited + // by the module's `max_transactions_filters` parameters. string transactions_filter = 5; - - // The IBC connection ID for getting ConsensusState to verify proofs + // The IBC connection ID to the remote chain (the source of querying data). Is used for getting + // ConsensusState from the respective IBC client to verify query result proofs. string connection_id = 6; - - // Parameter that defines how often the query must be updated. + // Parameter that defines the minimal delay between consecutive query executions (i.e. the + // minimal delay between query results update). uint64 update_period = 7; - - // The local chain last block height when the query result was updated. + // The local chain block height of the last query results update. uint64 last_submitted_result_local_height = 8; - - // The remote chain last block height when the query result was updated. + // The remote chain block height that corresponds to the last query result update. ibc.core.client.v1.Height last_submitted_result_remote_height = 9; - - // Amount of coins deposited for the query. + // Amount of coins paid for the Interchain Query registration. The deposit is paid back to the + // remover. The remover can be either the query owner (during the submit timeout) or anybody. repeated cosmos.base.v1beta1.Coin deposit = 10 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false ]; - - // Timeout before query becomes available for everybody to remove. + // The duration, measured in blocks, that must pass since the query's registration or its last + // result submission before the query becomes eligible for removal by anyone. uint64 submit_timeout = 11; - - // The local chain height when the query was registered. + // The local chain block height of the Interchain Query registration. uint64 registered_at_height = 12; } +// Represents a path to an IAVL storage node. message KVKey { - // Path (storage prefix) to the storage where you want to read value by key - // (usually name of cosmos-sdk module: 'staking', 'bank', etc.) + // The substore name used in an Interchain Query. Typically, this corresponds to the keeper's + // storeKey, usually the module's name, such as "bank", "staking", etc. string path = 1; - // Key you want to read from the storage + // A bytes field representing the key for specific data in the module's storage. bytes key = 2; } -// GenesisState defines the interchainqueries module's genesis state. +// The interchainqueries module's genesis state model. message GenesisState { + // The parameters of the module. Params params = 1 [(gogoproto.nullable) = false]; + // A list of registered Interchain Queries. repeated RegisteredQuery registered_queries = 2; } diff --git a/proto/neutron/interchainqueries/params.proto b/proto/neutron/interchainqueries/params.proto index bbfe620d9..e3e4768a9 100644 --- a/proto/neutron/interchainqueries/params.proto +++ b/proto/neutron/interchainqueries/params.proto @@ -6,22 +6,20 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/neutron-org/neutron/v5/x/interchainqueries/types"; -// Params defines the parameters for the module. +// The parameters for the module. message Params { option (gogoproto.goproto_stringer) = false; - // Defines amount of blocks required before query becomes available for - // removal by anybody + // The duration, measured in blocks, that must pass since the query's registration or its last + // result submission before the query becomes eligible for removal by anyone. Is used to set + // `submit_timeout` on Interchain Query registration. uint64 query_submit_timeout = 1; - - // Amount of coins deposited for the query. + // Amount of coins required to be provided as deposit on Interchain Query registration. repeated cosmos.base.v1beta1.Coin query_deposit = 2 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false ]; - - // Amount of tx hashes to be removed during a single EndBlock. Can vary to - // balance between network cleaning speed and EndBlock duration. A zero value - // means no limit. + // Amount of tx hashes to be removed during a single EndBlock. Can vary to balance between + // network cleaning speed and EndBlock duration. A zero value means no limit. uint64 tx_query_removal_limit = 3; // Maximum amount of keys in a registered key value query diff --git a/proto/neutron/interchainqueries/query.proto b/proto/neutron/interchainqueries/query.proto index 8f80a9180..dab826d44 100644 --- a/proto/neutron/interchainqueries/query.proto +++ b/proto/neutron/interchainqueries/query.proto @@ -10,65 +10,87 @@ import "neutron/interchainqueries/tx.proto"; option go_package = "github.com/neutron-org/neutron/v5/x/interchainqueries/types"; -// Query defines the gRPC querier service. +// Defines the Query interface of the module. service Query { - // Parameters queries the parameters of the module. + // Fetches the current parameters of the interchainqueries module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/neutron/interchainqueries/params"; } - + // Retrieves all registered Interchain Queries in the module, with optional filtering by owner + // and/or connection ID. rpc RegisteredQueries(QueryRegisteredQueriesRequest) returns (QueryRegisteredQueriesResponse) { option (google.api.http).get = "/neutron/interchainqueries/registered_queries"; } - + // Fetches details of a registered Interchain Query using its ID. rpc RegisteredQuery(QueryRegisteredQueryRequest) returns (QueryRegisteredQueryResponse) { option (google.api.http).get = "/neutron/interchainqueries/registered_query"; } - + // Retrieves the most recent successfully submitted result of an Interchain Query. This is only + // applicable for KV Interchain Queries. rpc QueryResult(QueryRegisteredQueryResultRequest) returns (QueryRegisteredQueryResultResponse) { option (google.api.http).get = "/neutron/interchainqueries/query_result"; } - + // Retrieves the most recent height of a remote chain as known by the IBC client associated with + // a given connection ID. rpc LastRemoteHeight(QueryLastRemoteHeight) returns (QueryLastRemoteHeightResponse) { option (google.api.http).get = "/neutron/interchainqueries/remote_height"; } } -// QueryParamsRequest is request type for the Query/Params RPC method. +// Request type for the Query/Params RPC method. message QueryParamsRequest {} -// QueryParamsResponse is response type for the Query/Params RPC method. +// Response type for the Query/Params RPC method. message QueryParamsResponse { - // params holds all the parameters of this module. + // Contains all parameters of the module. Params params = 1 [(gogoproto.nullable) = false]; } +// Request type for the Query/RegisteredQueries RPC method. message QueryRegisteredQueriesRequest { + // A list of owners of Interchain Queries. Query response will contain only Interchain Queries + // that are owned by one of the owners in the list. If none, Interchain Queries are not filtered + // out by the owner field. repeated string owners = 1; + // IBC connection ID. Query response will contain only Interchain Queries that have the same IBC + // connection ID parameter. If none, Interchain Queries are not filtered out by the connection ID + // field. string connection_id = 2; + // Pagination parameters for the request. Use values from previous response in the next request + // in consecutive requests with paginated responses. cosmos.base.query.v1beta1.PageRequest pagination = 3; } +// Response type for the Query/RegisteredQueries RPC method. message QueryRegisteredQueriesResponse { + // A list of registered Interchain Queries. repeated RegisteredQuery registered_queries = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. + // Current page information. Use values from previous response in the next request in consecutive + // requests with paginated responses. cosmos.base.query.v1beta1.PageResponse pagination = 2; } +// Request type for the Query/RegisteredQuery RPC method. message QueryRegisteredQueryRequest { + // ID of an Interchain Query. uint64 query_id = 1; } +// Response type for the Query/RegisteredQuery RPC method. message QueryRegisteredQueryResponse { + // A registered Interchain Query. RegisteredQuery registered_query = 1; } +// Request type for the Query/QueryResult RPC method. message QueryRegisteredQueryResultRequest { + // ID of an Interchain Query. uint64 query_id = 1; } +// Response type for the Query/QueryResult RPC method. message QueryRegisteredQueryResultResponse { + // The last successfully submitted result of an Interchain Query. QueryResult result = 1; } @@ -78,10 +100,17 @@ message Transaction { bytes data = 3; } +// Request type for the Query/LastRemoteHeight RPC method. message QueryLastRemoteHeight { + // Connection ID of an IBC connection to a remote chain. Determines the IBC client used in query + // handling. string connection_id = 1; } +// Response type for the Query/LastRemoteHeight RPC method. message QueryLastRemoteHeightResponse { + // The height of the chain that the IBC client is currently on. uint64 height = 1; + // The revision of the chain that the IBC client is currently on. + uint64 revision = 2; } diff --git a/proto/neutron/interchainqueries/tx.proto b/proto/neutron/interchainqueries/tx.proto index b1145775f..356bee544 100644 --- a/proto/neutron/interchainqueries/tx.proto +++ b/proto/neutron/interchainqueries/tx.proto @@ -13,147 +13,194 @@ import "tendermint/crypto/proof.proto"; option go_package = "github.com/neutron-org/neutron/v5/x/interchainqueries/types"; -// Msg defines the Msg service. +// Defines the Msg interface of the module. service Msg { option (cosmos.msg.v1.service) = true; - + // Registers a new Interchain Query in the `interchainqueries` module. This message should only + // be issued by a smart contract. The calling contract is automatically charged a query + // registration deposit, based on the module's query deposit parameter. The deposit is refunded + // when the query is removed. Ensure the contract's account has sufficient assets at the time of + // message execution. + // + // The response includes the ID assigned to the registered query. Use a reply handler to process + // this response and utilize the query ID. rpc RegisterInterchainQuery(MsgRegisterInterchainQuery) returns (MsgRegisterInterchainQueryResponse); + // Submits the result of an Interchain Query execution to the chain. Handling this message may + // involve forwarding the result to the smart contract that owns the query for processing, which + // could require significant gas usage. rpc SubmitQueryResult(MsgSubmitQueryResult) returns (MsgSubmitQueryResultResponse); + // Removes a specific Interchain Query and its results from the module. The query can only be + // removed by its owner during the query's submit timeout. After the timeout, anyone can remove + // it. Upon successful removal, the query deposit is refunded to the caller. rpc RemoveInterchainQuery(MsgRemoveInterchainQueryRequest) returns (MsgRemoveInterchainQueryResponse); + // Updates the parameters of a registered Interchain Query. This action can only be performed by + // the query's owner. rpc UpdateInterchainQuery(MsgUpdateInterchainQueryRequest) returns (MsgUpdateInterchainQueryResponse); + // Updates the parameters of the `interchainqueries` module. This action can only be performed + // by the module's authority. rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } +// Request type for the Msg/RegisterInterchainQuery RPC method. message MsgRegisterInterchainQuery { option (cosmos.msg.v1.signer) = "sender"; - - // defines a query type: `kv` or `tx` now + // The query type identifier: `kv` or `tx`. string query_type = 1; - - // is used to define KV-storage keys for which we want to get values from - // remote chain + // The KV-storage keys for which we want to get values from remote chain. Only applicable for the + // KV Interchain Queries. Max amount of keys is limited by the module's `max_kv_query_keys_count` + // parameters. repeated KVKey keys = 2; - - // is used to define a filter for transaction search ICQ + // A stringified list of filters for remote transactions search. Only applicable for the TX + // Interchain Queries. Example: "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]". + // Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount of filter conditions is + // limited by the module's `max_transactions_filters` parameters. string transactions_filter = 3; - - // is IBC connection ID for getting ConsensusState to verify proofs + // The IBC connection ID to the remote chain (the source of querying data). Is used for getting + // ConsensusState from the respective IBC client to verify query result proofs. string connection_id = 4; - - // is used to specify how often (in neutron blocks) the query must be updated + // Parameter that defines the minimal delay between consecutive query executions (i.e. the + // minimal delay between query results update). uint64 update_period = 5; - - // is the signer of the message + // The signer of the message. string sender = 6; } +// Response type for the Msg/RegisterInterchainQuery RPC method. message MsgRegisterInterchainQueryResponse { + // The ID assigned to the registered Interchain Query by the module. uint64 id = 1; } +// Request type for the Msg/SubmitQueryResult RPC method. message MsgSubmitQueryResult { option (cosmos.msg.v1.signer) = "sender"; - + // The ID of the Interchain Query. uint64 query_id = 1; + // The signer of the message. string sender = 2; - - // is the IBC client ID for an IBC connection between Neutron chain and target - // chain (where the result was obtained from) + // The IBC client ID that corresponds to the IBC connection to the remote chain (where the + // query result is coming from). // Deprecated: populating this field does not make any affect string client_id = 3 [deprecated = true]; + // The result of the Interchain Query execution. QueryResult result = 4; } +// Contains different information about a single Interchain Query execution result. Currently, +// this structure is used both in query result submission via an ICQ Relayer and as a query result +// storage for read/write operations to interchainqueries module, but the structure fields are +// populated in a bit different ways. When submitting a query result, all fields are populated and +// provided to the interchainqueries module in order to verify the result against the IBC client's +// state. But in order to lighten the chain state, the interchainqueries module removes the block +// field and proofs from the kv_results. message QueryResult { + // A list of a KV Interchain Query execution results. Each result contains query parameters, a + // response value and a proof. repeated StorageValue kv_results = 1; + // A TX Interchain Query execution result. Contains metainformation about the blocks of the query + // execution height. Only populated when submitting an Interchain Query result for verification + // and emptied when saving the result on chain. Block block = 2; + // The height of the chain at the moment of the Interchain Query execution. uint64 height = 3; + // The revision number of the chain at the moment of the Interchain Query execution. uint64 revision = 4; + // Whether to send the query result to the owner contract as a sudo message. Only applicable for + // KV type of Interchain Queries. bool allow_kv_callbacks = 5; } +// A verifiable result of performing a single KVKey read. message StorageValue { - // is the substore name (acc, staking, etc.) + // The substore name used in the read operation. Typically, this corresponds to the keeper's + // storeKey, usually the module's name, such as "bank", "staking", etc. string storage_prefix = 1; - - // is the key in IAVL store + // A bytes field representing the key of the data read from the module's storage. bytes key = 2; - - // is the value in IAVL store + // A bytes field containing the value associated with the key in the store. bytes value = 3; - - // is the Merkle Proof which proves existence of key-value pair in IAVL - // storage + // The Merkle Proof which proves existence/nonexistence of key-value pair in IAVL storage. Is + // used to verify + // the pair against the respective remote chain's header. tendermint.crypto.ProofOps Proof = 4; } +// A single verifiable result of an Interchain Query of TX type. message Block { - // We need to know block X+1 to verify response of transaction for block X - // since LastResultsHash is root hash of all results from the txs from the - // previous block + // The header of the block next to the block the transaction is included in. It is needed to know + // block X+1 header to verify response of transaction for block X since LastResultsHash is root + // hash of all results of the txs from the previous block. google.protobuf.Any next_block_header = 1; - - // We need to know block X to verify inclusion of transaction for block X + // The header of the block the transaction is included in. It is needed to know block header to + // verify inclusion of the transaction. google.protobuf.Any header = 2; - + // The transaction matched by the Interchain Query's transaction filter. TxValue tx = 3; } +// Contains transaction body, response, and proofs of inclusion and delivery. message TxValue { + // The result of the transaction execution. tendermint.abci.ExecTxResult response = 1; - - // is the Merkle Proof which proves existence of response in block with height - // next_block_header.Height + // The Merkle Proof which proves existence of response in the block next to the block the + // transaction is included in. tendermint.crypto.Proof delivery_proof = 2; - - // is the Merkle Proof which proves existence of data in block with height - // header.Height + // The Merkle Proof which proves inclusion of the transaction in the block. tendermint.crypto.Proof inclusion_proof = 3; - - // is body of the transaction + // The arbitrary data typed body of the transaction. bytes data = 4; } +// Response type for the Msg/SubmitQueryResult RPC method. message MsgSubmitQueryResultResponse {} +// Request type for the Msg/RemoveInterchainQuery RPC method. message MsgRemoveInterchainQueryRequest { option (cosmos.msg.v1.signer) = "sender"; + // The ID of the query to remove. uint64 query_id = 1; - string sender = 2; // is the signer of the message + // The signer of the message. + string sender = 2; } + +// Response type for the Msg/RemoveInterchainQuery RPC method. message MsgRemoveInterchainQueryResponse {} +// Request type for the Msg/UpdateInterchainQuery RPC method. message MsgUpdateInterchainQueryRequest { option (cosmos.msg.v1.signer) = "sender"; + // The ID of the query to update. uint64 query_id = 1; + // A new list of KV-storage keys for which to get values from the remote chain. Only applicable + // for a KV Interchain Query. Max amount of keys is limited by the module's `max_kv_query_keys_count` + // parameters. repeated KVKey new_keys = 2; + // A new minimal delay between consecutive query executions. uint64 new_update_period = 3; + // A new list of filters for remote transactions search. Only applicable for a TX Interchain + // Query. Example: "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]". + // Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount of filter conditions is + // limited by the module's `max_transactions_filters` parameters. string new_transactions_filter = 4; - string sender = 5; // is the signer of the message + // The signer of the message. + string sender = 5; } + +// Response type for the Msg/UpdateInterchainQuery RPC method. message MsgUpdateInterchainQueryResponse {} -// MsgUpdateParams is the MsgUpdateParams request type. -// -// Since: 0.47 +// Request type for the Msg/UpdateParams RPC method. message MsgUpdateParams { option (amino.name) = "interchainqueries/MsgUpdateParams"; option (cosmos.msg.v1.signer) = "authority"; - - // Authority is the address of the governance account. + // The address of the authority of the module. string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // params defines the x/interchainqueries parameters to update. - // - // NOTE: All parameters must be supplied. + // The new parameters of the module. All parameters must be supplied. Params params = 2 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: 0.47 +// Response type for the Msg/UpdateParams RPC method. message MsgUpdateParamsResponse {} diff --git a/x/contractmanager/types/sudo.go b/x/contractmanager/types/sudo.go index 5cdc86348..660a83886 100644 --- a/x/contractmanager/types/sudo.go +++ b/x/contractmanager/types/sudo.go @@ -5,20 +5,34 @@ import ( channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ) -// MessageTxQueryResult is passed to a contract's sudo() entrypoint when a tx was submitted -// for a transaction query. +// MessageTxQueryResult is the model of the `sudo` message sent to a smart contract when a TX +// Interchain Query result is submitted. The owner of a TX Interchain Query must implement a `sudo` +// entry point to handle `tx_query_result` messages and include the necessary logic in it. The +// `tx_query_result` handler functions as a callback, triggered by the `interchainqueries` module +// each time a TX query result is submitted. type MessageTxQueryResult struct { TxQueryResult struct { - QueryID uint64 `json:"query_id"` - Height ibcclienttypes.Height `json:"height"` - Data []byte `json:"data"` + // QueryID is the ID of the TX query which result is being submitted. + QueryID uint64 `json:"query_id"` + // Height is the remote chain's block height the transaction was included in. + Height ibcclienttypes.Height `json:"height"` + // Data is the body of the transaction. + Data []byte `json:"data"` } `json:"tx_query_result"` } -// MessageKVQueryResult is passed to a contract's sudo() entrypoint when a result -// was submitted for a kv-query. +// MessageKvQueryResult is the model of the `sudo` message sent to a smart contract when a KV +// Interchain Query result is submitted. If the owner of a KV Interchain Query wants to handle +// query updates as part of the result submission transaction, they must implement a `sudo` entry +// point to process `kv_query_result` messages and include the necessary logic in it. The +// `kv_query_result` handler acts as a callback, triggered by the interchainqueries module whenever +// a KV query result is submitted. +// +// Note that the message does not include the actual query result, only the query ID. To access the +// result data, use the `Query/QueryResult` RPC of the `interchainqueries` module. type MessageKVQueryResult struct { KVQueryResult struct { + // QueryID is the ID of the KV query which result is being submitted. QueryID uint64 `json:"query_id"` } `json:"kv_query_result"` } diff --git a/x/interchainqueries/README.md b/x/interchainqueries/README.md new file mode 100644 index 000000000..4928336a9 --- /dev/null +++ b/x/interchainqueries/README.md @@ -0,0 +1,3 @@ +# `x/interchainqueries` + +Documentation: https://docs.neutron.org/neutron/modules/interchain-queries/overview diff --git a/x/interchainqueries/types/genesis.pb.go b/x/interchainqueries/types/genesis.pb.go index 94451d85e..5ff024397 100644 --- a/x/interchainqueries/types/genesis.pb.go +++ b/x/interchainqueries/types/genesis.pb.go @@ -26,30 +26,40 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// Information about an Interchain Query registered in the interchainqueries module. type RegisteredQuery struct { // The unique id of the registered query. Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // The address that registered the query. + // The address of the contract that registered the query. Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - // The query type identifier: `kv` or `tx` now + // The query type identifier: `kv` or `tx`. QueryType string `protobuf:"bytes,3,opt,name=query_type,json=queryType,proto3" json:"query_type,omitempty"` - // The KV-storage keys for which we want to get values from remote chain + // The KV-storage keys for which to get values from the remote chain. Only applicable for the + // KV Interchain Queries. Max amount of keys is limited by the module's `max_kv_query_keys_count` + // parameters. Keys []*KVKey `protobuf:"bytes,4,rep,name=keys,proto3" json:"keys,omitempty"` - // The filter for transaction search ICQ + // A stringified list of filters for remote transactions search. Only applicable for the TX + // Interchain Queries. Example: "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]". + // Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount of filter conditions is limited + // by the module's `max_transactions_filters` parameters. TransactionsFilter string `protobuf:"bytes,5,opt,name=transactions_filter,json=transactionsFilter,proto3" json:"transactions_filter,omitempty"` - // The IBC connection ID for getting ConsensusState to verify proofs + // The IBC connection ID to the remote chain (the source of querying data). Is used for getting + // ConsensusState from the respective IBC client to verify query result proofs. ConnectionId string `protobuf:"bytes,6,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` - // Parameter that defines how often the query must be updated. + // Parameter that defines the minimal delay between consecutive query executions (i.e. the + // minimal delay between query results update). UpdatePeriod uint64 `protobuf:"varint,7,opt,name=update_period,json=updatePeriod,proto3" json:"update_period,omitempty"` - // The local chain last block height when the query result was updated. + // The local chain block height of the last query results update. LastSubmittedResultLocalHeight uint64 `protobuf:"varint,8,opt,name=last_submitted_result_local_height,json=lastSubmittedResultLocalHeight,proto3" json:"last_submitted_result_local_height,omitempty"` - // The remote chain last block height when the query result was updated. + // The remote chain block height that corresponds to the last query result update. LastSubmittedResultRemoteHeight *types.Height `protobuf:"bytes,9,opt,name=last_submitted_result_remote_height,json=lastSubmittedResultRemoteHeight,proto3" json:"last_submitted_result_remote_height,omitempty"` - // Amount of coins deposited for the query. + // Amount of coins paid for the Interchain Query registration. The deposit is paid back to the + // remover. The remover can be either the query owner (during the submit timeout) or anybody. Deposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,10,rep,name=deposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"deposit"` - // Timeout before query becomes available for everybody to remove. + // The duration, measured in blocks, that must pass since the query's registration or its last + // result submission before the query becomes eligible for removal by anyone. SubmitTimeout uint64 `protobuf:"varint,11,opt,name=submit_timeout,json=submitTimeout,proto3" json:"submit_timeout,omitempty"` - // The local chain height when the query was registered. + // The local chain block height of the Interchain Query registration. RegisteredAtHeight uint64 `protobuf:"varint,12,opt,name=registered_at_height,json=registeredAtHeight,proto3" json:"registered_at_height,omitempty"` } @@ -170,11 +180,12 @@ func (m *RegisteredQuery) GetRegisteredAtHeight() uint64 { return 0 } +// Represents a path to an IAVL storage node. type KVKey struct { - // Path (storage prefix) to the storage where you want to read value by key - // (usually name of cosmos-sdk module: 'staking', 'bank', etc.) + // The substore name used in an Interchain Query. Typically, this corresponds to the keeper's + // storeKey, usually the module's name, such as "bank", "staking", etc. Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // Key you want to read from the storage + // A bytes field representing the key for specific data in the module's storage. Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` } @@ -225,9 +236,11 @@ func (m *KVKey) GetKey() []byte { return nil } -// GenesisState defines the interchainqueries module's genesis state. +// The interchainqueries module's genesis state model. type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // The parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // A list of registered Interchain Queries. RegisteredQueries []*RegisteredQuery `protobuf:"bytes,2,rep,name=registered_queries,json=registeredQueries,proto3" json:"registered_queries,omitempty"` } diff --git a/x/interchainqueries/types/params.pb.go b/x/interchainqueries/types/params.pb.go index ef23f50c8..cb97993ae 100644 --- a/x/interchainqueries/types/params.pb.go +++ b/x/interchainqueries/types/params.pb.go @@ -25,16 +25,16 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Params defines the parameters for the module. +// The parameters for the module. type Params struct { - // Defines amount of blocks required before query becomes available for - // removal by anybody + // The duration, measured in blocks, that must pass since the query's registration or its last + // result submission before the query becomes eligible for removal by anyone. Is used to set + // `submit_timeout` on Interchain Query registration. QuerySubmitTimeout uint64 `protobuf:"varint,1,opt,name=query_submit_timeout,json=querySubmitTimeout,proto3" json:"query_submit_timeout,omitempty"` - // Amount of coins deposited for the query. + // Amount of coins required to be provided as deposit on Interchain Query registration. QueryDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=query_deposit,json=queryDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"query_deposit"` - // Amount of tx hashes to be removed during a single EndBlock. Can vary to - // balance between network cleaning speed and EndBlock duration. A zero value - // means no limit. + // Amount of tx hashes to be removed during a single EndBlock. Can vary to balance between + // network cleaning speed and EndBlock duration. A zero value means no limit. TxQueryRemovalLimit uint64 `protobuf:"varint,3,opt,name=tx_query_removal_limit,json=txQueryRemovalLimit,proto3" json:"tx_query_removal_limit,omitempty"` // Maximum amount of keys in a registered key value query MaxKvQueryKeysCount uint64 `protobuf:"varint,4,opt,name=max_kv_query_keys_count,json=maxKvQueryKeysCount,proto3" json:"max_kv_query_keys_count,omitempty"` diff --git a/x/interchainqueries/types/query.pb.go b/x/interchainqueries/types/query.pb.go index 10f7d517d..c8a5180de 100644 --- a/x/interchainqueries/types/query.pb.go +++ b/x/interchainqueries/types/query.pb.go @@ -30,7 +30,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryParamsRequest is request type for the Query/Params RPC method. +// Request type for the Query/Params RPC method. type QueryParamsRequest struct { } @@ -67,9 +67,9 @@ func (m *QueryParamsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo -// QueryParamsResponse is response type for the Query/Params RPC method. +// Response type for the Query/Params RPC method. type QueryParamsResponse struct { - // params holds all the parameters of this module. + // Contains all parameters of the module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } @@ -113,10 +113,19 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } +// Request type for the Query/RegisteredQueries RPC method. type QueryRegisteredQueriesRequest struct { - Owners []string `protobuf:"bytes,1,rep,name=owners,proto3" json:"owners,omitempty"` - ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` + // A list of owners of Interchain Queries. Query response will contain only Interchain Queries + // that are owned by one of the owners in the list. If none, Interchain Queries are not filtered + // out by the owner field. + Owners []string `protobuf:"bytes,1,rep,name=owners,proto3" json:"owners,omitempty"` + // IBC connection ID. Query response will contain only Interchain Queries that have the same IBC + // connection ID parameter. If none, Interchain Queries are not filtered out by the connection ID + // field. + ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` + // Pagination parameters for the request. Use values from previous response in the next request + // in consecutive requests with paginated responses. + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } func (m *QueryRegisteredQueriesRequest) Reset() { *m = QueryRegisteredQueriesRequest{} } @@ -173,9 +182,12 @@ func (m *QueryRegisteredQueriesRequest) GetPagination() *query.PageRequest { return nil } +// Response type for the Query/RegisteredQueries RPC method. type QueryRegisteredQueriesResponse struct { + // A list of registered Interchain Queries. RegisteredQueries []RegisteredQuery `protobuf:"bytes,1,rep,name=registered_queries,json=registeredQueries,proto3" json:"registered_queries"` - // pagination defines the pagination in the response. + // Current page information. Use values from previous response in the next request in consecutive + // requests with paginated responses. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -226,7 +238,9 @@ func (m *QueryRegisteredQueriesResponse) GetPagination() *query.PageResponse { return nil } +// Request type for the Query/RegisteredQuery RPC method. type QueryRegisteredQueryRequest struct { + // ID of an Interchain Query. QueryId uint64 `protobuf:"varint,1,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` } @@ -270,7 +284,9 @@ func (m *QueryRegisteredQueryRequest) GetQueryId() uint64 { return 0 } +// Response type for the Query/RegisteredQuery RPC method. type QueryRegisteredQueryResponse struct { + // A registered Interchain Query. RegisteredQuery *RegisteredQuery `protobuf:"bytes,1,opt,name=registered_query,json=registeredQuery,proto3" json:"registered_query,omitempty"` } @@ -314,7 +330,9 @@ func (m *QueryRegisteredQueryResponse) GetRegisteredQuery() *RegisteredQuery { return nil } +// Request type for the Query/QueryResult RPC method. type QueryRegisteredQueryResultRequest struct { + // ID of an Interchain Query. QueryId uint64 `protobuf:"varint,1,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` } @@ -358,7 +376,9 @@ func (m *QueryRegisteredQueryResultRequest) GetQueryId() uint64 { return 0 } +// Response type for the Query/QueryResult RPC method. type QueryRegisteredQueryResultResponse struct { + // The last successfully submitted result of an Interchain Query. Result *QueryResult `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` } @@ -462,7 +482,10 @@ func (m *Transaction) GetData() []byte { return nil } +// Request type for the Query/LastRemoteHeight RPC method. type QueryLastRemoteHeight struct { + // Connection ID of an IBC connection to a remote chain. Determines the IBC client used in query + // handling. ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` } @@ -506,8 +529,12 @@ func (m *QueryLastRemoteHeight) GetConnectionId() string { return "" } +// Response type for the Query/LastRemoteHeight RPC method. type QueryLastRemoteHeightResponse struct { + // The height of the chain that the IBC client is currently on. Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + // The revision of the chain that the IBC client is currently on. + Revision uint64 `protobuf:"varint,2,opt,name=revision,proto3" json:"revision,omitempty"` } func (m *QueryLastRemoteHeightResponse) Reset() { *m = QueryLastRemoteHeightResponse{} } @@ -550,6 +577,13 @@ func (m *QueryLastRemoteHeightResponse) GetHeight() uint64 { return 0 } +func (m *QueryLastRemoteHeightResponse) GetRevision() uint64 { + if m != nil { + return m.Revision + } + return 0 +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "neutron.interchainqueries.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "neutron.interchainqueries.QueryParamsResponse") @@ -569,55 +603,56 @@ func init() { } var fileDescriptor_2254be23ba3ff3b4 = []byte{ - // 758 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x4d, 0x4f, 0x14, 0x4d, - 0x10, 0xde, 0x5e, 0xf6, 0x5d, 0x5e, 0x6a, 0x79, 0x5f, 0xa0, 0x45, 0x03, 0x2b, 0xae, 0x30, 0x44, - 0x58, 0x30, 0x3b, 0xc3, 0x47, 0x10, 0x8c, 0x88, 0x09, 0x07, 0x95, 0xc4, 0x03, 0x4c, 0xc4, 0x83, - 0x97, 0x4d, 0xef, 0x6e, 0x67, 0x76, 0x12, 0xb6, 0x7b, 0x99, 0xe9, 0x45, 0xe6, 0xea, 0xcd, 0x9b, - 0xd1, 0xbf, 0xe0, 0x0f, 0xf0, 0xe6, 0xc1, 0x83, 0x57, 0xe2, 0x89, 0xc4, 0x8b, 0x27, 0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0, 0xfb, - 0x57, 0xe7, 0x1e, 0xe0, 0xaf, 0x08, 0x12, 0x0d, 0x4d, 0x8f, 0xb7, 0x07, 0x8f, 0x5e, 0x9f, 0xd5, - 0xe4, 0xe3, 0x6b, 0xa2, 0x75, 0x06, 0x96, 0xcc, 0x60, 0x09, 0x2f, 0x5a, 0x7d, 0x9e, 0xf0, 0xac, - 0x1a, 0x4d, 0xfc, 0x19, 0xc1, 0x78, 0xdb, 0x2c, 0xad, 0xf4, 0x23, 0xd1, 0x8a, 0x48, 0x6e, 0x0d, - 0x8a, 0xa8, 0x31, 0x5e, 0x91, 0x8c, 0x97, 0x71, 0xba, 0xa7, 0xe6, 0x21, 0x30, 0xab, 0x66, 0x71, - 0xf7, 0xf0, 0xec, 0x22, 0x85, 0xce, 0x2f, 0x52, 0xe8, 0xf7, 0x45, 0x0a, 0xbd, 0xbf, 0x4c, 0x45, - 0xce, 0x2f, 0x53, 0x91, 0x9f, 0x97, 0xa9, 0xc8, 0xeb, 0x47, 0x8e, 0x2b, 0x8a, 0x95, 0x9c, 0x99, - 0xe7, 0xa5, 0xaa, 0xb7, 0x0c, 0xf7, 0x9c, 0x9a, 0xe7, 0x93, 0x0d, 0xeb, 0xb4, 0xd3, 0x03, 0x1f, - 0x94, 0xa9, 0x9f, 0x8b, 0xcb, 0x47, 0x7e, 0xfd, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x40, - 0xc6, 0x00, 0xfd, 0x08, 0x00, 0x00, + // 770 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x4f, 0x13, 0x4f, + 0x14, 0xef, 0x94, 0x7e, 0x0b, 0xbc, 0xf2, 0x15, 0x18, 0xd1, 0xc0, 0x8a, 0x15, 0x96, 0x08, 0x05, + 0xd3, 0x5d, 0x7e, 0x04, 0xc5, 0x88, 0x98, 0x70, 0x50, 0x49, 0x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} // Reference imports to suppress errors if they are not otherwise used. @@ -632,11 +667,18 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // Parameters queries the parameters of the module. + // Fetches the current parameters of the interchainqueries module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Retrieves all registered Interchain Queries in the module, with optional filtering by owner + // and/or connection ID. RegisteredQueries(ctx context.Context, in *QueryRegisteredQueriesRequest, opts ...grpc.CallOption) (*QueryRegisteredQueriesResponse, error) + // Fetches details of a registered Interchain Query using its ID. RegisteredQuery(ctx context.Context, in *QueryRegisteredQueryRequest, opts ...grpc.CallOption) (*QueryRegisteredQueryResponse, error) + // Retrieves the most recent successfully submitted result of an Interchain Query. This is only + // applicable for KV Interchain Queries. QueryResult(ctx context.Context, in *QueryRegisteredQueryResultRequest, opts ...grpc.CallOption) (*QueryRegisteredQueryResultResponse, error) + // Retrieves the most recent height of a remote chain as known by the IBC client associated with + // a given connection ID. LastRemoteHeight(ctx context.Context, in *QueryLastRemoteHeight, opts ...grpc.CallOption) (*QueryLastRemoteHeightResponse, error) } @@ -695,11 +737,18 @@ func (c *queryClient) LastRemoteHeight(ctx context.Context, in *QueryLastRemoteH // QueryServer is the server API for Query service. type QueryServer interface { - // Parameters queries the parameters of the module. + // Fetches the current parameters of the interchainqueries module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Retrieves all registered Interchain Queries in the module, with optional filtering by owner + // and/or connection ID. RegisteredQueries(context.Context, *QueryRegisteredQueriesRequest) (*QueryRegisteredQueriesResponse, error) + // Fetches details of a registered Interchain Query using its ID. RegisteredQuery(context.Context, *QueryRegisteredQueryRequest) (*QueryRegisteredQueryResponse, error) + // Retrieves the most recent successfully submitted result of an Interchain Query. This is only + // applicable for KV Interchain Queries. QueryResult(context.Context, *QueryRegisteredQueryResultRequest) (*QueryRegisteredQueryResultResponse, error) + // Retrieves the most recent height of a remote chain as known by the IBC client associated with + // a given connection ID. LastRemoteHeight(context.Context, *QueryLastRemoteHeight) (*QueryLastRemoteHeightResponse, error) } @@ -1218,6 +1267,11 @@ func (m *QueryLastRemoteHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if m.Revision != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Revision)) + i-- + dAtA[i] = 0x10 + } if m.Height != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.Height)) i-- @@ -1390,6 +1444,9 @@ func (m *QueryLastRemoteHeightResponse) Size() (n int) { if m.Height != 0 { n += 1 + sovQuery(uint64(m.Height)) } + if m.Revision != 0 { + n += 1 + sovQuery(uint64(m.Revision)) + } return n } @@ -2364,6 +2421,25 @@ func (m *QueryLastRemoteHeightResponse) Unmarshal(dAtA []byte) error { break } } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + } + m.Revision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Revision |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/interchainqueries/types/tx.pb.go b/x/interchainqueries/types/tx.pb.go index 5a7f0ca2f..623817022 100644 --- a/x/interchainqueries/types/tx.pb.go +++ b/x/interchainqueries/types/tx.pb.go @@ -34,19 +34,26 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// Request type for the Msg/RegisterInterchainQuery RPC method. type MsgRegisterInterchainQuery struct { - // defines a query type: `kv` or `tx` now + // The query type identifier: `kv` or `tx`. QueryType string `protobuf:"bytes,1,opt,name=query_type,json=queryType,proto3" json:"query_type,omitempty"` - // is used to define KV-storage keys for which we want to get values from - // remote chain + // The KV-storage keys for which we want to get values from remote chain. Only applicable for the + // KV Interchain Queries. Max amount of keys is limited by the module's `max_kv_query_keys_count` + // parameters. Keys []*KVKey `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` - // is used to define a filter for transaction search ICQ + // A stringified list of filters for remote transactions search. Only applicable for the TX + // Interchain Queries. Example: "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]". + // Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount of filter conditions is + // limited by the module's `max_transactions_filters` parameters. TransactionsFilter string `protobuf:"bytes,3,opt,name=transactions_filter,json=transactionsFilter,proto3" json:"transactions_filter,omitempty"` - // is IBC connection ID for getting ConsensusState to verify proofs + // The IBC connection ID to the remote chain (the source of querying data). Is used for getting + // ConsensusState from the respective IBC client to verify query result proofs. ConnectionId string `protobuf:"bytes,4,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` - // is used to specify how often (in neutron blocks) the query must be updated + // Parameter that defines the minimal delay between consecutive query executions (i.e. the + // minimal delay between query results update). UpdatePeriod uint64 `protobuf:"varint,5,opt,name=update_period,json=updatePeriod,proto3" json:"update_period,omitempty"` - // is the signer of the message + // The signer of the message. Sender string `protobuf:"bytes,6,opt,name=sender,proto3" json:"sender,omitempty"` } @@ -125,7 +132,9 @@ func (m *MsgRegisterInterchainQuery) GetSender() string { return "" } +// Response type for the Msg/RegisterInterchainQuery RPC method. type MsgRegisterInterchainQueryResponse struct { + // The ID assigned to the registered Interchain Query by the module. Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } @@ -169,14 +178,18 @@ func (m *MsgRegisterInterchainQueryResponse) GetId() uint64 { return 0 } +// Request type for the Msg/SubmitQueryResult RPC method. type MsgSubmitQueryResult struct { + // The ID of the Interchain Query. QueryId uint64 `protobuf:"varint,1,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` - // is the IBC client ID for an IBC connection between Neutron chain and target - // chain (where the result was obtained from) + // The signer of the message. + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + // The IBC client ID that corresponds to the IBC connection to the remote chain (where the + // query result is coming from). // Deprecated: populating this field does not make any affect - ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` // Deprecated: Do not use. - Result *QueryResult `protobuf:"bytes,4,opt,name=result,proto3" json:"result,omitempty"` + ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` // Deprecated: Do not use. + // The result of the Interchain Query execution. + Result *QueryResult `protobuf:"bytes,4,opt,name=result,proto3" json:"result,omitempty"` } func (m *MsgSubmitQueryResult) Reset() { *m = MsgSubmitQueryResult{} } @@ -241,12 +254,28 @@ func (m *MsgSubmitQueryResult) GetResult() *QueryResult { return nil } +// Contains different information about a single Interchain Query execution result. Currently, +// this structure is used both in query result submission via an ICQ Relayer and as a query result +// storage for read/write operations to interchainqueries module, but the structure fields are +// populated in a bit different ways. When submitting a query result, all fields are populated and +// provided to the interchainqueries module in order to verify the result against the IBC client's +// state. But in order to lighten the chain state, the interchainqueries module removes the block +// field and proofs from the kv_results. type QueryResult struct { - KvResults []*StorageValue `protobuf:"bytes,1,rep,name=kv_results,json=kvResults,proto3" json:"kv_results,omitempty"` - Block *Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` - Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - Revision uint64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"` - AllowKvCallbacks bool `protobuf:"varint,5,opt,name=allow_kv_callbacks,json=allowKvCallbacks,proto3" json:"allow_kv_callbacks,omitempty"` + // A list of a KV Interchain Query execution results. Each result contains query parameters, a + // response value and a proof. + KvResults []*StorageValue `protobuf:"bytes,1,rep,name=kv_results,json=kvResults,proto3" json:"kv_results,omitempty"` + // A TX Interchain Query execution result. Contains metainformation about the blocks of the query + // execution height. Only populated when submitting an Interchain Query result for verification + // and emptied when saving the result on chain. + Block *Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + // The height of the chain at the moment of the Interchain Query execution. + Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + // The revision number of the chain at the moment of the Interchain Query execution. + Revision uint64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"` + // Whether to send the query result to the owner contract as a sudo message. Only applicable for + // KV type of Interchain Queries. + AllowKvCallbacks bool `protobuf:"varint,5,opt,name=allow_kv_callbacks,json=allowKvCallbacks,proto3" json:"allow_kv_callbacks,omitempty"` } func (m *QueryResult) Reset() { *m = QueryResult{} } @@ -317,15 +346,18 @@ func (m *QueryResult) GetAllowKvCallbacks() bool { return false } +// A verifiable result of performing a single KVKey read. type StorageValue struct { - // is the substore name (acc, staking, etc.) + // The substore name used in the read operation. Typically, this corresponds to the keeper's + // storeKey, usually the module's name, such as "bank", "staking", etc. StoragePrefix string `protobuf:"bytes,1,opt,name=storage_prefix,json=storagePrefix,proto3" json:"storage_prefix,omitempty"` - // is the key in IAVL store + // A bytes field representing the key of the data read from the module's storage. Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - // is the value in IAVL store + // A bytes field containing the value associated with the key in the store. Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - // is the Merkle Proof which proves existence of key-value pair in IAVL - // storage + // The Merkle Proof which proves existence/nonexistence of key-value pair in IAVL storage. Is + // used to verify + // the pair against the respective remote chain's header. Proof *crypto.ProofOps `protobuf:"bytes,4,opt,name=Proof,proto3" json:"Proof,omitempty"` } @@ -390,14 +422,17 @@ func (m *StorageValue) GetProof() *crypto.ProofOps { return nil } +// A single verifiable result of an Interchain Query of TX type. type Block struct { - // We need to know block X+1 to verify response of transaction for block X - // since LastResultsHash is root hash of all results from the txs from the - // previous block + // The header of the block next to the block the transaction is included in. It is needed to know + // block X+1 header to verify response of transaction for block X since LastResultsHash is root + // hash of all results of the txs from the previous block. NextBlockHeader *types.Any `protobuf:"bytes,1,opt,name=next_block_header,json=nextBlockHeader,proto3" json:"next_block_header,omitempty"` - // We need to know block X to verify inclusion of transaction for block X + // The header of the block the transaction is included in. It is needed to know block header to + // verify inclusion of the transaction. Header *types.Any `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"` - Tx *TxValue `protobuf:"bytes,3,opt,name=tx,proto3" json:"tx,omitempty"` + // The transaction matched by the Interchain Query's transaction filter. + Tx *TxValue `protobuf:"bytes,3,opt,name=tx,proto3" json:"tx,omitempty"` } func (m *Block) Reset() { *m = Block{} } @@ -454,15 +489,16 @@ func (m *Block) GetTx() *TxValue { return nil } +// Contains transaction body, response, and proofs of inclusion and delivery. type TxValue struct { + // The result of the transaction execution. Response *types1.ExecTxResult `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - // is the Merkle Proof which proves existence of response in block with height - // next_block_header.Height + // The Merkle Proof which proves existence of response in the block next to the block the + // transaction is included in. DeliveryProof *crypto.Proof `protobuf:"bytes,2,opt,name=delivery_proof,json=deliveryProof,proto3" json:"delivery_proof,omitempty"` - // is the Merkle Proof which proves existence of data in block with height - // header.Height + // The Merkle Proof which proves inclusion of the transaction in the block. InclusionProof *crypto.Proof `protobuf:"bytes,3,opt,name=inclusion_proof,json=inclusionProof,proto3" json:"inclusion_proof,omitempty"` - // is body of the transaction + // The arbitrary data typed body of the transaction. Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` } @@ -527,6 +563,7 @@ func (m *TxValue) GetData() []byte { return nil } +// Response type for the Msg/SubmitQueryResult RPC method. type MsgSubmitQueryResultResponse struct { } @@ -563,9 +600,12 @@ func (m *MsgSubmitQueryResultResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitQueryResultResponse proto.InternalMessageInfo +// Request type for the Msg/RemoveInterchainQuery RPC method. type MsgRemoveInterchainQueryRequest struct { + // The ID of the query to remove. QueryId uint64 `protobuf:"varint,1,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + // The signer of the message. + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` } func (m *MsgRemoveInterchainQueryRequest) Reset() { *m = MsgRemoveInterchainQueryRequest{} } @@ -615,6 +655,7 @@ func (m *MsgRemoveInterchainQueryRequest) GetSender() string { return "" } +// Response type for the Msg/RemoveInterchainQuery RPC method. type MsgRemoveInterchainQueryResponse struct { } @@ -651,12 +692,23 @@ func (m *MsgRemoveInterchainQueryResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRemoveInterchainQueryResponse proto.InternalMessageInfo +// Request type for the Msg/UpdateInterchainQuery RPC method. type MsgUpdateInterchainQueryRequest struct { - QueryId uint64 `protobuf:"varint,1,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - NewKeys []*KVKey `protobuf:"bytes,2,rep,name=new_keys,json=newKeys,proto3" json:"new_keys,omitempty"` - NewUpdatePeriod uint64 `protobuf:"varint,3,opt,name=new_update_period,json=newUpdatePeriod,proto3" json:"new_update_period,omitempty"` - NewTransactionsFilter string `protobuf:"bytes,4,opt,name=new_transactions_filter,json=newTransactionsFilter,proto3" json:"new_transactions_filter,omitempty"` - Sender string `protobuf:"bytes,5,opt,name=sender,proto3" json:"sender,omitempty"` + // The ID of the query to update. + QueryId uint64 `protobuf:"varint,1,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` + // A new list of KV-storage keys for which to get values from the remote chain. Only applicable + // for a KV Interchain Query. Max amount of keys is limited by the module's `max_kv_query_keys_count` + // parameters. + NewKeys []*KVKey `protobuf:"bytes,2,rep,name=new_keys,json=newKeys,proto3" json:"new_keys,omitempty"` + // A new minimal delay between consecutive query executions. + NewUpdatePeriod uint64 `protobuf:"varint,3,opt,name=new_update_period,json=newUpdatePeriod,proto3" json:"new_update_period,omitempty"` + // A new list of filters for remote transactions search. Only applicable for a TX Interchain + // Query. Example: "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]". + // Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount of filter conditions is + // limited by the module's `max_transactions_filters` parameters. + NewTransactionsFilter string `protobuf:"bytes,4,opt,name=new_transactions_filter,json=newTransactionsFilter,proto3" json:"new_transactions_filter,omitempty"` + // The signer of the message. + Sender string `protobuf:"bytes,5,opt,name=sender,proto3" json:"sender,omitempty"` } func (m *MsgUpdateInterchainQueryRequest) Reset() { *m = MsgUpdateInterchainQueryRequest{} } @@ -727,6 +779,7 @@ func (m *MsgUpdateInterchainQueryRequest) GetSender() string { return "" } +// Response type for the Msg/UpdateInterchainQuery RPC method. type MsgUpdateInterchainQueryResponse struct { } @@ -763,15 +816,11 @@ func (m *MsgUpdateInterchainQueryResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateInterchainQueryResponse proto.InternalMessageInfo -// MsgUpdateParams is the MsgUpdateParams request type. -// -// Since: 0.47 +// Request type for the Msg/UpdateParams RPC method. type MsgUpdateParams struct { - // Authority is the address of the governance account. + // The address of the authority of the module. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/interchainqueries parameters to update. - // - // NOTE: All parameters must be supplied. + // The new parameters of the module. All parameters must be supplied. Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` } @@ -822,10 +871,7 @@ func (m *MsgUpdateParams) GetParams() Params { return Params{} } -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: 0.47 +// Response type for the Msg/UpdateParams RPC method. type MsgUpdateParamsResponse struct { } @@ -973,10 +1019,28 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { + // Registers a new Interchain Query in the `interchainqueries` module. This message should only + // be issued by a smart contract. The calling contract is automatically charged a query + // registration deposit, based on the module's query deposit parameter. The deposit is refunded + // when the query is removed. Ensure the contract's account has sufficient assets at the time of + // message execution. + // + // The response includes the ID assigned to the registered query. Use a reply handler to process + // this response and utilize the query ID. RegisterInterchainQuery(ctx context.Context, in *MsgRegisterInterchainQuery, opts ...grpc.CallOption) (*MsgRegisterInterchainQueryResponse, error) + // Submits the result of an Interchain Query execution to the chain. Handling this message may + // involve forwarding the result to the smart contract that owns the query for processing, which + // could require significant gas usage. SubmitQueryResult(ctx context.Context, in *MsgSubmitQueryResult, opts ...grpc.CallOption) (*MsgSubmitQueryResultResponse, error) + // Removes a specific Interchain Query and its results from the module. The query can only be + // removed by its owner during the query's submit timeout. After the timeout, anyone can remove + // it. Upon successful removal, the query deposit is refunded to the caller. RemoveInterchainQuery(ctx context.Context, in *MsgRemoveInterchainQueryRequest, opts ...grpc.CallOption) (*MsgRemoveInterchainQueryResponse, error) + // Updates the parameters of a registered Interchain Query. This action can only be performed by + // the query's owner. UpdateInterchainQuery(ctx context.Context, in *MsgUpdateInterchainQueryRequest, opts ...grpc.CallOption) (*MsgUpdateInterchainQueryResponse, error) + // Updates the parameters of the `interchainqueries` module. This action can only be performed + // by the module's authority. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } @@ -1035,10 +1099,28 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. type MsgServer interface { + // Registers a new Interchain Query in the `interchainqueries` module. This message should only + // be issued by a smart contract. The calling contract is automatically charged a query + // registration deposit, based on the module's query deposit parameter. The deposit is refunded + // when the query is removed. Ensure the contract's account has sufficient assets at the time of + // message execution. + // + // The response includes the ID assigned to the registered query. Use a reply handler to process + // this response and utilize the query ID. RegisterInterchainQuery(context.Context, *MsgRegisterInterchainQuery) (*MsgRegisterInterchainQueryResponse, error) + // Submits the result of an Interchain Query execution to the chain. Handling this message may + // involve forwarding the result to the smart contract that owns the query for processing, which + // could require significant gas usage. SubmitQueryResult(context.Context, *MsgSubmitQueryResult) (*MsgSubmitQueryResultResponse, error) + // Removes a specific Interchain Query and its results from the module. The query can only be + // removed by its owner during the query's submit timeout. After the timeout, anyone can remove + // it. Upon successful removal, the query deposit is refunded to the caller. RemoveInterchainQuery(context.Context, *MsgRemoveInterchainQueryRequest) (*MsgRemoveInterchainQueryResponse, error) + // Updates the parameters of a registered Interchain Query. This action can only be performed by + // the query's owner. UpdateInterchainQuery(context.Context, *MsgUpdateInterchainQueryRequest) (*MsgUpdateInterchainQueryResponse, error) + // Updates the parameters of the `interchainqueries` module. This action can only be performed + // by the module's authority. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) }