You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
messageTxResponse {
// The output of the application's logger (raw string). May be// non-deterministic.stringraw_log=6;
}
As can be seen, checking for errors depend on the existence of a predefined set of phrases in the transaction response logs. This method is highly unreliable, and even if it may work now, it is bound to fail with one of the next updates to the Cosmos GRPC end points.
As can be seen above, the Contact::send_transaction() function will succeed in that case, although the transaction has actually failed.
While it may seem that the case of a failing transaction will be caught by Contact::wait_for_tx(), this function also doesn't seem to handle all possible cases reliably, as e.g. demonstrated by this commit. Besides, it depends on the function get_tx_by_hash(), which also doesn't seem to follow proper error handling discipline:
// Gets a transaction using it's hash value, TODO should fail if the transaction isn't foundpubasyncfnget_tx_by_hash(&self,txhash:String) -> Result<GetTxResponse,CosmosGrpcError>{letmut txrpc = TxServiceClient::connect(self.url.clone()).await?;let res = txrpc
.get_tx(GetTxRequest{hash: txhash }).await?
.into_inner();Ok(res)}
Problem Scenarios
There is a possibility of transactions sent to Cosmos from orchestrator to be silently failing due to an unaccounted combination of errors during GRPC requests.
Recommendation
Rework error handling in the Deep Space library, in particular make it independent from the non-deterministic output of application's logger.
The text was updated successfully, but these errors were encountered:
Surfaced from @informalsystems audit of Althea Gravity Bridge at commit 19a4cfe
severity: Medium
type: Implementation bug
difficulty: Easy
Involved artifacts
Description
For communicating with Cosmos Orchestrator uses in multiple places the Deep Space library, also from Althea. In particular, in multiple places the Contact::send_transaction function is called; the typical usage is e.g. in send_valset_confirms():
The Contact::send_transaction() function, after broadcasting the transaction, checks for possible errors in the following way:
The functions determine_min_fees_and_gas() and check_tx_response() contain these problematic code:
and
This is particularly worrying taking into account cosmos/base/abci/v1beta1/abci.proto: TxResponse:
As can be seen, checking for errors depend on the existence of a predefined set of phrases in the transaction response logs. This method is highly unreliable, and even if it may work now, it is bound to fail with one of the next updates to the Cosmos GRPC end points.
As can be seen above, the Contact::send_transaction() function will succeed in that case, although the transaction has actually failed.
While it may seem that the case of a failing transaction will be caught by Contact::wait_for_tx(), this function also doesn't seem to handle all possible cases reliably, as e.g. demonstrated by this commit. Besides, it depends on the function get_tx_by_hash(), which also doesn't seem to follow proper error handling discipline:
Problem Scenarios
There is a possibility of transactions sent to Cosmos from orchestrator to be silently failing due to an unaccounted combination of errors during GRPC requests.
Recommendation
Rework error handling in the Deep Space library, in particular make it independent from the non-deterministic output of application's logger.
The text was updated successfully, but these errors were encountered: