-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change hermes to use broadcast_tx_sync for transaction submission (#1091
) * temp change for ft-transfer to send one msg/Tx * event monitor: Bulk events from all transactions included in a block * Update changelog * temp change for ft-transfer to send one msg/Tx * Optimize spawning of workers - draft * Add back check to start workers only if channel is open * Cleanup * Check connection state * temp change for ft-transfer to send one msg/Tx * Improve config loading message (#933) * Improve config load message * Raised log level to error. Log link to config example in the guide. * Changelog Co-authored-by: Adi Seredinschi <adi@informal.systems> * Migration to tx sync * Add Tx simulate * Add adjustment to the tx simulate result, some cleanup * Nitpick in CosmosSdkChain::key_and_bytes * Small cleanup * Remove duplicate send_msgs method * Cleanup config file * Fix typo after refactoring * Fix `query packet tx` description * Rework `wait_for_block_commits` to use the `retry` crate * Compute tx fee based on gas from tx simulate and gas price * Re-add missing error type * Combine `fee_denom` and `gas_price` into `gas_price` config option * Add tests for `mul_ceil` * Fix config serialization * Remove `fee_amount` config property * Update changelog * Avoid op data regeneration if retries exhausted. * Increase the number of retries while checking Tx is included in a block. * Move `query packet tx` to `query tx events` * better error msgs * Add Display instance for GasPrice * Fix default gas price denomination * Improve some debug messages * Rename `gas_price.amount` to `gase_price.price` * Add configurable fee adjustment to make it more likely gas estimate ends up being enough * Add Tx hash to ChainErr * Fix config files * Masked tonic::Code::NotFound result for query_client_connections. * Modified cfg option from gas to max_gas * Consistent trust_threshold in default config.toml * Revert guide updates * Nit: Imports for query.rs * Print info message when Hermes starts * Fix gas adjustement to be percentage on top of computed gas * Variables renamed to be more explicit in calculate_fee and send_tx. * Cached acct number in CosmosSDK * Cache account information * Remove noisy tracing in counterparty module * Fix unused import * Improve logs a bit by using the Display impl for Height * Only show first 100 consensus states in logs * Attempt to fix gas_limit cherry-picked 0886401 from romac/channel-filter * Adjust up to max_gas Co-authored-by: Romain Ruetschi <romain@informal.systems> Co-authored-by: Adi Seredinschi <adi@informal.systems>
- Loading branch information
1 parent
0af53fd
commit 3e53090
Showing
24 changed files
with
759 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//! `query tx` subcommand | ||
|
||
use abscissa_core::{Command, Options, Runnable}; | ||
|
||
mod events; | ||
|
||
/// `query tx` subcommand | ||
#[derive(Command, Debug, Options, Runnable)] | ||
pub enum QueryTxCmd { | ||
/// The `query tx events` subcommand | ||
#[options(help = "Query the events emitted by transaction")] | ||
Events(events::QueryTxEventsCmd), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
use std::str::FromStr; | ||
use std::sync::Arc; | ||
|
||
use abscissa_core::{Command, Options, Runnable}; | ||
use tokio::runtime::Runtime as TokioRuntime; | ||
use tracing::debug; | ||
|
||
use tendermint::abci::transaction::Hash; | ||
|
||
use ibc::ics24_host::identifier::ChainId; | ||
use ibc::query::{QueryTxHash, QueryTxRequest}; | ||
|
||
use ibc_relayer::chain::runtime::ChainRuntime; | ||
use ibc_relayer::chain::CosmosSdkChain; | ||
|
||
use crate::conclude::Output; | ||
use crate::prelude::app_config; | ||
|
||
/// Query the events emitted by transaction | ||
#[derive(Clone, Command, Debug, Options)] | ||
pub struct QueryTxEventsCmd { | ||
#[options(free, required, help = "identifier of the chain to query")] | ||
chain_id: ChainId, | ||
|
||
#[options(free, required, help = "transaction hash to query")] | ||
hash: String, | ||
} | ||
|
||
// cargo run --bin hermes -- query tx events ibc-0 B8E78AD83810239E21863AC7B5FC4F99396ABB39EB534F721EEF43A4979C2821 | ||
impl Runnable for QueryTxEventsCmd { | ||
fn run(&self) { | ||
let config = app_config(); | ||
|
||
debug!("Options: {:?}", self); | ||
|
||
let chain_config = match config | ||
.find_chain(&self.chain_id) | ||
.ok_or_else(|| format!("chain '{}' not found in configuration file", self.chain_id)) | ||
{ | ||
Err(err) => return Output::error(err).exit(), | ||
Ok(result) => result, | ||
}; | ||
|
||
let rt = Arc::new(TokioRuntime::new().unwrap()); | ||
let (chain, _) = ChainRuntime::<CosmosSdkChain>::spawn(chain_config.clone(), rt).unwrap(); | ||
|
||
let res = chain.query_txs(QueryTxRequest::Transaction(QueryTxHash( | ||
Hash::from_str(self.hash.as_str()).unwrap(), | ||
))); | ||
|
||
match res { | ||
Ok(res) => Output::success(res).exit(), | ||
Err(e) => Output::error(format!("{}", e)).exit(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.