Skip to content

Commit

Permalink
Adjusted log & config & changelog (informalsystems#1160)
Browse files Browse the repository at this point in the history
  • Loading branch information
adizere authored Jul 8, 2021
1 parent f296d69 commit 5cf3b67
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@
Many thanks to Fraccaroli Gianmarco (@Fraccaman) for helping us improve the
reliability of Hermes ([#697]).

__! Configuration file changes:__
The Hermes config.toml configuration file has went through a few revisions
in this release. The changes are as follows:
- Added inline documentation for all options.
- Added a filtering mechanism to allow packet relaying only on
specific channels. Consequently, there are two new options in the
configuration file:
1. A global `filter` parameter to enable or disable filtering globally.
2. A per-chain `.filters` option that expects a list of channel and
port identifiers, so that packet relaying will be restricted to this
list for the corresponding chain.
- Added a packet clearing configuration option, to parametrize the frequency
at which Hermes will clear pending packets. This is a global option, called
`clear_packets_interval`, which applies to all chains in the configuration.

Note that both the `filter` and `clear_packets_interval` features apply
only to Hermes passive relaying mode (command `hermes start`), and will
not affect the other commands.

### FEATURES

- [ibc-relayer-cli]
Expand Down
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ strategy = 'packets'

# Enable or disable the filtering mechanism. Default: 'false'
# Valid options are 'true', 'false'.
filter = true
filter = false

# Specify the verbosity for the relayer logging output. Default: 'info'
# Valid options are 'error', 'warn', 'info', 'debug', 'trace'.
Expand Down
21 changes: 9 additions & 12 deletions relayer/src/chain/cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ impl CosmosSdkChain {
let account_seq = self.account_sequence()?;

debug!(
"send_tx: sending {} messages to {} using nonce {}",
proto_msgs.len(),
"[{}] send_tx: sending {} messages using nonce {}",
self.id(),
proto_msgs.len(),
account_seq,
);

Expand Down Expand Up @@ -320,7 +320,7 @@ impl CosmosSdkChain {
let adjusted_fee = self.fee_with_gas(estimated_gas);

trace!(
"send_tx: {} based on the estimated gas, adjusting fee from {:?} to {:?}",
"[{}] send_tx: based on the estimated gas, adjusting fee from {:?} to {:?}",
self.id(),
fee,
adjusted_fee
Expand All @@ -344,11 +344,7 @@ impl CosmosSdkChain {
.block_on(broadcast_tx_sync(self, tx_bytes))
.map_err(|e| Kind::Rpc(self.config.rpc_addr.clone()).context(e))?;

debug!(
"send_tx: broadcast_tx_sync to {}: {:?}",
self.id(),
response
);
debug!("[{}] send_tx: broadcast_tx_sync: {:?}", self.id(), response);

self.incr_account_sequence()?;

Expand Down Expand Up @@ -500,7 +496,7 @@ impl CosmosSdkChain {
debug!(
sequence = %account.sequence,
number = %account.account_number,
"send_tx: retrieved account for {}",
"[{}] send_tx: retrieved account",
self.id()
);

Expand Down Expand Up @@ -598,13 +594,13 @@ impl CosmosSdkChain {
) -> Result<Vec<TxSyncResult>, Error> {
use crate::util::retry::{retry_with_index, RetryResult};

trace!("waiting for commit of block(s)");

let hashes = tx_sync_results
.iter()
.map(|res| res.response.hash.to_string())
.join(", ");

debug!("[{}] waiting for commit of block(s) {}", self.id(), hashes);

// Wait a little bit initially
thread::sleep(Duration::from_millis(200));

Expand All @@ -614,7 +610,8 @@ impl CosmosSdkChain {
|index| {
if all_tx_results_found(&tx_sync_results) {
trace!(
"wait_for_block_commits: retrieved {} tx results after {} tries ({}ms)",
"[{}] wait_for_block_commits: retrieved {} tx results after {} tries ({}ms)",
self.id(),
tx_sync_results.len(),
index,
start.elapsed().as_millis()
Expand Down
4 changes: 0 additions & 4 deletions relayer/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,6 @@ impl RelayPath {
}
Err(e) => {
// Unrecoverable error, propagate up the stack
error!(
"[{}] unrecoverable error in send_from_operational_data {}",
self, e
);
return Err(e);
}
}
Expand Down
10 changes: 8 additions & 2 deletions relayer/src/worker/uni_chan_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ impl UniChanPathWorker {
};

if let Err(e) = result {
error!("[{}] step() encountered error: {}", link.a_to_b, e);
error!(
"[{}] worker: handling command encountered error: {}",
link.a_to_b, e
);
return RetryResult::Retry(index);
}
}
Expand All @@ -132,7 +135,10 @@ impl UniChanPathWorker {
match result {
Ok(summary) => RetryResult::Ok(summary),
Err(e) => {
error!("[{}] step() encountered error: {}", link.a_to_b, e);
error!(
"[{}] worker: schedule execution encountered error: {}",
link.a_to_b, e
);
RetryResult::Retry(index)
}
}
Expand Down

0 comments on commit 5cf3b67

Please sign in to comment.