From 55390b32cd3aa061cbe5be3426043d2dd1d5f14f Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 22 Dec 2023 11:33:44 +0100 Subject: [PATCH 1/7] Run codespell on CI --- .github/codespell/codespell.ini | 3 +++ .github/codespell/words.txt | 2 ++ .github/workflows/codespell.yml | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 .github/codespell/codespell.ini create mode 100644 .github/codespell/words.txt create mode 100644 .github/workflows/codespell.yml diff --git a/.github/codespell/codespell.ini b/.github/codespell/codespell.ini new file mode 100644 index 0000000000..c1a20a75f2 --- /dev/null +++ b/.github/codespell/codespell.ini @@ -0,0 +1,3 @@ +[codespell] +skip = *.js,*.ts,*.css,*.svg,./target +ignore-words = .github/codespell/words.txt diff --git a/.github/codespell/words.txt b/.github/codespell/words.txt new file mode 100644 index 0000000000..71be76b0fc --- /dev/null +++ b/.github/codespell/words.txt @@ -0,0 +1,2 @@ +crate +shs diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..b352a70858 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,22 @@ +name: Codespell +on: + pull_request: + push: + branches: master + +# Cancel previous runs of this workflow when a new commit is added to the PR, branch or tag +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + codespell: + name: Check spelling + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@v2 + with: + skip: '*.js,*.ts,*.css,*.svg,./target' + ignore_words_file: .github/codespell/words.txt + From 945c1ac3160a2451c99c46b862c569e0a5c08fe4 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 22 Dec 2023 11:35:10 +0100 Subject: [PATCH 2/7] Only run cargo-doc when needed --- .github/workflows/cargo-doc.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cargo-doc.yaml b/.github/workflows/cargo-doc.yaml index cfe2f2468f..ebc03618b6 100644 --- a/.github/workflows/cargo-doc.yaml +++ b/.github/workflows/cargo-doc.yaml @@ -4,7 +4,17 @@ on: push: branches: - master - pull_request: {} + paths: + - .github/workflows/cargo-doc.yml + - Cargo.toml + - Cargo.lock + - crates/** + pull_request: + paths: + - .github/workflows/cargo-doc.yml + - Cargo.toml + - Cargo.lock + - crates/** # Cancel previous runs of this workflow when a new commit is added to the PR, branch or tag concurrency: From 7b4251b3a170b1fbe9a79c94bef7a0b8ca1c654d Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 22 Dec 2023 11:35:47 +0100 Subject: [PATCH 3/7] Fix all typos found in the repository --- CHANGELOG.md | 22 +++++++++---------- ci/misbehaviour-ics/double_sign_test.sh | 2 +- ci/misbehaviour/config.toml | 2 +- ci/misbehaviour/config_fork.toml | 2 +- config.toml | 4 ++-- crates/chain-registry/src/chain.rs | 4 ++-- crates/chain-registry/src/querier.rs | 2 +- crates/relayer-cli/src/cli_utils.rs | 2 +- .../src/commands/create/channel.rs | 4 ++-- crates/relayer-cli/src/commands/start.rs | 4 ++-- .../applications/transfer/acknowledgement.rs | 4 ++-- .../src/applications/transfer/denom.rs | 2 +- .../src/core/ics02_client/consensus_state.rs | 2 +- .../src/core/ics02_client/error.rs | 4 ++-- .../src/core/ics02_client/trust_threshold.rs | 2 +- .../src/core/ics03_connection/error.rs | 2 +- .../src/core/ics03_connection/version.rs | 2 +- .../src/core/ics04_channel/error.rs | 2 +- .../src/core/ics04_channel/timeout.rs | 2 +- .../src/core/ics23_commitment/merkle.rs | 2 +- crates/relayer-types/src/serializers.rs | 2 +- crates/relayer/src/chain/cosmos.rs | 2 +- crates/relayer/src/chain/cosmos/query/tx.rs | 4 ++-- crates/relayer/src/channel.rs | 2 +- crates/relayer/src/config/error.rs | 2 +- crates/relayer/src/config/filter.rs | 2 +- crates/relayer/src/config/proof_specs.rs | 4 ++-- crates/relayer/src/error.rs | 4 ++-- crates/relayer/src/link/relay_path.rs | 6 ++--- crates/relayer/src/rest/error.rs | 2 +- crates/relayer/src/util/task.rs | 6 ++--- crates/relayer/src/worker/packet.rs | 2 +- crates/telemetry/src/state.rs | 2 +- docs/architecture/adr-002-ibc-relayer.md | 2 +- .../adr-003-handler-implementation.md | 4 ++-- docs/architecture/adr-template.md | 2 +- docs/architecture/architecture.md | 2 +- docs/spec/connection-handshake/L1_2.md | 2 +- .../L2-tla/Environment.tla | 4 ++-- .../spec/tla/fungible-token-transfer/Bank.tla | 2 +- .../tla/fungible-token-transfer/Chain.tla | 2 +- .../IBCTokenTransferDefinitions.tla | 2 +- .../ICS04PacketHandlers.tla | 8 +++---- docs/spec/tla/ibc-core/Chain.tla | 2 +- docs/spec/tla/ibc-core/IBCCoreDefinitions.tla | 2 +- .../tla/ibc-core/ICS03ConnectionHandlers.tla | 2 +- .../spec/tla/ibc-core/ICS04PacketHandlers.tla | 12 +++++----- docs/spec/tla/packet-delay/Chain.tla | 2 +- .../IBCPacketDelayDefinitions.tla | 2 +- .../tla/packet-delay/ICS04PacketHandlers.tla | 14 ++++++------ guide/README.md | 2 +- .../troubleshooting/cross-comp-config.md | 4 ++-- .../troubleshooting/genesis-restart.md | 2 +- guide/src/assets/grafana_template.json | 2 +- .../src/documentation/commands/logs/index.md | 2 +- .../configuration/comet-compat-mode.md | 2 +- .../configuration/performance.md | 4 ++-- .../documentation/forwarding/legacy_test.md | 2 +- guide/src/documentation/forwarding/test.md | 2 +- .../tutorials/production/start-relaying.md | 2 +- .../src/tests/clear_packet.rs | 2 +- .../src/tests/connection_delay.rs | 2 +- .../integration-test/src/tests/denom_trace.rs | 2 +- .../src/tests/forward/forward_transfer.rs | 4 ++-- .../src/bootstrap/binary/chain.rs | 2 +- .../src/bootstrap/nary/channel.rs | 4 ++-- tools/test-framework/src/bootstrap/single.rs | 2 +- tools/test-framework/src/chain/builder.rs | 2 +- tools/test-framework/src/chain/ext/ica.rs | 2 +- .../src/docs/walkthroughs/ordered_channel.rs | 2 +- .../src/docs/walkthroughs/simple.rs | 2 +- tools/test-framework/src/error.rs | 2 +- .../src/framework/nary/chain.rs | 2 +- tools/test-framework/src/relayer/chain.rs | 2 +- tools/test-framework/src/relayer/transfer.rs | 2 +- .../test-framework/src/types/binary/chains.rs | 2 +- tools/test-framework/src/types/nary/mod.rs | 2 +- tools/test-framework/src/util/suspend.rs | 4 ++-- 78 files changed, 122 insertions(+), 122 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3039a2429..08dad0afd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,7 +79,7 @@ at a different value for each chain, using the new per-chain `clear_interval` se The global `clear_interval` setting is used as a default value if the per-chain setting is not defined. -Additionnaly, operators can now override the CometBFT compatibility mode to be used +Additionally, operators can now override the CometBFT compatibility mode to be used for a chain by using the new `compat_mode` per-chain setting. The main use case for this is to override the automatically detected compatibility mode in case Hermes gets it wrong or encounters a non-standard version number and falls back on the wrong CometBFT version. @@ -465,21 +465,21 @@ This patch release adds support for CometBFT in version checks. *March 27th, 2023* Hermes v1.4.0 brings compatibility with chains based on Tendermint/CometBFT 0.37, -while retaining compatiblity with Tendermint/CometBFT 0.34. This is transparent +while retaining compatibility with Tendermint/CometBFT 0.34. This is transparent and does not require any additional configuration. The relayer now supports ICS consumer chains, which only requires operators to specify the `unbonding_period` parameter in the chain settings. This is only -a temporary requirement, in the future Hermes will seamlessy support consumer +a temporary requirement, in the future Hermes will seamlessly support consumer chains with minimal changes to the configuration. This release also deprecates support for chains based on Cosmos SDK 0.43.x and lower, -and bumps the compatiblity to Cosmos SDK 0.47.x. +and bumps the compatibility to Cosmos SDK 0.47.x. The relayer now also allows operators to filter out packets to relay based on whether or not they contain a fee, and the minimal amount of such fee. Please check the relevant [documentation in the Hermes guide](fee-guide) for more information. -Additionnaly, Hermes now also tracks [metrics for ICS29 fees](fee-metrics). +Additionally, Hermes now also tracks [metrics for ICS29 fees](fee-metrics). This release includes a new `query client status` CLI to quickly check whether a client is active, expired or frozen. @@ -1063,7 +1063,7 @@ This is the third release candidate for Hermes v1.0.0 🎉 - Release version 0.18.0 of `ibc-telemetry` -#### IMROVEMENTS +#### IMPROVEMENTS - Improve the metrics - Renamed `oldest_sequence` metric to `backlog_oldest_sequence` @@ -1768,7 +1768,7 @@ Before running Hermes v0.11.0, make sure you remove the `mode.packets.filter` op and consensus states ([#1481](https://github.com/informalsystems/hermes/issues/1481)) - More structural logging in relayer, using tracing spans and key-value pairs. ([#1491](https://github.com/informalsystems/hermes/pull/1491)) - - Improved documention w.r.t. keys for Ethermint-based chains + - Improved documentation w.r.t. keys for Ethermint-based chains ([#1785](https://github.com/informalsystems/hermes/issues/1785)) - [Relayer CLI](crates/relayer-cli) - Add custom options to the `create client` command. @@ -2161,7 +2161,7 @@ This release also fixes a bug where the chain runtime within the relayer would c This release of Hermes is the first to be compatible with the development version of Cosmos SDK 0.43. Hermes 0.7.0 also improves the performance and reliability of the relayer, notably by waiting asynchronously for transactions to be confirmed. -Additionnally, Hermes now includes a REST server which exposes the relayer's internal state over HTTP. +Additionally, Hermes now includes a REST server which exposes the relayer's internal state over HTTP. ### BUG FIXES @@ -2760,7 +2760,7 @@ This release also finalizes the initial implementation of all the ICS 004 handle - Fix for chains that don't have `cosmos` account prefix ([#416]) - Fix for building the `trusted_validator_set` for the header used in client updates ([#770]) - Don't send `MsgAcknowledgment` if channel is closed ([#675]) - - Fix a bug where the keys addresses had their account prefix overriden by the prefix in the configuration ([#751]) + - Fix a bug where the keys addresses had their account prefix overridden by the prefix in the configuration ([#751]) - [ibc-relayer-cli] - Hermes guide: improved installation guideline ([#672]) @@ -2898,7 +2898,7 @@ Noteworthy changes in this release include: ### FEATURES -- Continous Integration (CI) end-to-end (e2e) testing with gaia v4 ([#32], [#582], [#602]) +- Continuous Integration (CI) end-to-end (e2e) testing with gaia v4 ([#32], [#582], [#602]) - Add support for streamlining releases ([#507]) - [ibc-relayer-cli] @@ -3055,7 +3055,7 @@ Special thanks to external contributors for this release: @CharlyCst ([#102], [# - CLI for client update message ([#277]) - Implement the relayer CLI for connection handshake messages ([#358], [#359], [#360]) - Implement the relayer CLI for channel handshake messages ([#371], [#372], [#373], [#374]) - - Added basic client, connection, and channel lifecyle in relayer v0 ([#376], [#377], [#378]) + - Added basic client, connection, and channel lifecycle in relayer v0 ([#376], [#377], [#378]) - Implement commands to add and list keys for a chain ([#363]) - Allow overriding of peer_id, height and hash in light add command ([#428]) - [proto-compiler] diff --git a/ci/misbehaviour-ics/double_sign_test.sh b/ci/misbehaviour-ics/double_sign_test.sh index 6c4bbf50b6..3685868433 100644 --- a/ci/misbehaviour-ics/double_sign_test.sh +++ b/ci/misbehaviour-ics/double_sign_test.sh @@ -330,7 +330,7 @@ do interchain-security-cd genesis add-genesis-account $CONS_ACCOUNT_ADDR2 $USER_COINS --home ${CONS_NODE_DIR} sleep 10 - ### this probably doesnt have to be done for each node + ### this probably does not have to be done for each node # Add consumer genesis states to genesis file RPC_LADDR_PORT=$(($RPC_LADDR_BASEPORT + $index)) RPC_LADDR=tcp://${NODE_IP}:${RPC_LADDR_PORT} diff --git a/ci/misbehaviour/config.toml b/ci/misbehaviour/config.toml index 1806039a34..92845f89ed 100644 --- a/ci/misbehaviour/config.toml +++ b/ci/misbehaviour/config.toml @@ -294,7 +294,7 @@ memo_prefix = '' # [chains.packet_filter.min_fees.'channel-0'] # recv = [ { amount = 20, denom = 'stake' }, { amount = 10, denom = 'uatom' } ] -# Specify that the transaction fees should be payed from this fee granter's account. +# Specify that the transaction fees should be paid from this fee granter's account. # Optional. If unspecified (the default behavior), then no fee granter is used, and # the account specified in `key_name` will pay the tx fees for all transactions # submitted to this chain. diff --git a/ci/misbehaviour/config_fork.toml b/ci/misbehaviour/config_fork.toml index d3ab4184d4..060dda1566 100644 --- a/ci/misbehaviour/config_fork.toml +++ b/ci/misbehaviour/config_fork.toml @@ -293,7 +293,7 @@ memo_prefix = '' # [chains.packet_filter.min_fees.'channel-0'] # recv = [ { amount = 20, denom = 'stake' }, { amount = 10, denom = 'uatom' } ] -# Specify that the transaction fees should be payed from this fee granter's account. +# Specify that the transaction fees should be paid from this fee granter's account. # Optional. If unspecified (the default behavior), then no fee granter is used, and # the account specified in `key_name` will pay the tx fees for all transactions # submitted to this chain. diff --git a/config.toml b/config.toml index bdc9ec4a18..b8dceadc3d 100644 --- a/config.toml +++ b/config.toml @@ -144,7 +144,7 @@ id = 'ibc-0' type = "CosmosSdk" # Whether or not this is a CCV consumer chain. Default: false -# Only specifiy true for CCV consumer chain, but NOT for sovereign chains. +# Only specify true for CCV consumer chain, but NOT for sovereign chains. ccv_consumer_chain = false # Specify the RPC address and port where the chain RPC server listens on. Required @@ -374,7 +374,7 @@ memo_prefix = '' # [chains.packet_filter.min_fees.'channel-0'] # recv = [ { amount = 20, denom = 'stake' }, { amount = 10, denom = 'uatom' } ] -# Specify that the transaction fees should be payed from this fee granter's account. +# Specify that the transaction fees should be paid from this fee granter's account. # Optional. If unspecified (the default behavior), then no fee granter is used, and # the account specified in `key_name` will pay the tx fees for all transactions # submitted to this chain. diff --git a/crates/chain-registry/src/chain.rs b/crates/chain-registry/src/chain.rs index f136d28fb0..48434c404d 100644 --- a/crates/chain-registry/src/chain.rs +++ b/crates/chain-registry/src/chain.rs @@ -152,8 +152,8 @@ pub struct Grpc { } impl Fetchable for ChainData { - fn path(ressource: &str) -> PathBuf { - [ressource, "chain.json"].iter().collect() + fn path(resource: &str) -> PathBuf { + [resource, "chain.json"].iter().collect() } } diff --git a/crates/chain-registry/src/querier.rs b/crates/chain-registry/src/querier.rs index a2f7de7685..ac5a2c385c 100644 --- a/crates/chain-registry/src/querier.rs +++ b/crates/chain-registry/src/querier.rs @@ -31,7 +31,7 @@ pub trait QueryTypes { #[async_trait] /// `QueryContext` represents the basic expectations for a query pub trait QueryContext: QueryTypes { - /// Return an error specific to the query which is retured when `query_healthy` fails + /// Return an error specific to the query which is returned when `query_healthy` fails /// /// # Arguments /// diff --git a/crates/relayer-cli/src/cli_utils.rs b/crates/relayer-cli/src/cli_utils.rs index d96761b0a7..733914fd06 100644 --- a/crates/relayer-cli/src/cli_utils.rs +++ b/crates/relayer-cli/src/cli_utils.rs @@ -59,7 +59,7 @@ pub fn spawn_chain_runtime(config: &Config, chain_id: &ChainId) -> Result(config, chain_id) } -/// Spawns a chain runtime for the chain in the configuraiton identified by the given chain identifier. +/// Spawns a chain runtime for the chain in the configuration identified by the given chain identifier. /// /// The `Handle` type parameter allows choosing which kind of [`ChainHandle`] implementation to use. /// diff --git a/crates/relayer-cli/src/commands/create/channel.rs b/crates/relayer-cli/src/commands/create/channel.rs index b949adff72..98b8464ff3 100644 --- a/crates/relayer-cli/src/commands/create/channel.rs +++ b/crates/relayer-cli/src/commands/create/channel.rs @@ -22,7 +22,7 @@ use crate::prelude::*; use ibc_relayer::config::default::connection_delay; static PROMPT: &str = "Are you sure you want a new connection & clients to be created? Hermes will use default security parameters."; -static HINT: &str = "Consider using the default invocation\n\nhermes create channel --a-port --b-port --a-chain --a-connection \n\nto re-use a pre-existing connection."; +static HINT: &str = "Consider using the default invocation\n\nhermes create channel --a-port --b-port --a-chain --a-connection \n\nto reuse a pre-existing connection."; /// The data structure that represents all the possible options when invoking /// the `create channel` CLI command. @@ -31,7 +31,7 @@ static HINT: &str = "Consider using the default invocation\n\nhermes create chan /// /// `create channel --a-port --b-port --a-chain --a-connection ` /// is the default way in which this command should be used, specifying a `Connection-ID` -/// associated with chain A for this new channel to re-use. +/// associated with chain A for this new channel to reuse. /// /// `create channel --a-port --b-port --a-chain --b-chain --new-client-connection` /// can alternatively be used to indicate that a new connection/client pair is being diff --git a/crates/relayer-cli/src/commands/start.rs b/crates/relayer-cli/src/commands/start.rs index c90ad23af9..5f0346d211 100644 --- a/crates/relayer-cli/src/commands/start.rs +++ b/crates/relayer-cli/src/commands/start.rs @@ -158,7 +158,7 @@ fn spawn_rest_server(config: &Config) -> Option { ); if let Err(e) = handle.await { - error!("REST service crashed with errror: {e}"); + error!("REST service crashed with error: {e}"); } } Err(e) => { @@ -213,7 +213,7 @@ fn spawn_telemetry_server(config: &Config) { info!("telemetry service running, exposing metrics at http://{addr}/metrics"); if let Err(e) = handle.await { - error!("telemetry service crashed with errror: {e}"); + error!("telemetry service crashed with error: {e}"); } } Err(e) => error!("telemetry service failed to start: {e}"), diff --git a/crates/relayer-types/src/applications/transfer/acknowledgement.rs b/crates/relayer-types/src/applications/transfer/acknowledgement.rs index 35251d4485..2277baebd6 100644 --- a/crates/relayer-types/src/applications/transfer/acknowledgement.rs +++ b/crates/relayer-types/src/applications/transfer/acknowledgement.rs @@ -64,8 +64,8 @@ mod test { #[test] fn test_ack_ser() { fn ser_json_assert_eq(ack: Acknowledgement, json_str: &str) { - let ser = serde_json::to_string(&ack).unwrap(); - assert_eq!(ser, json_str) + let set = serde_json::to_string(&ack).unwrap(); + assert_eq!(set, json_str) } ser_json_assert_eq(Acknowledgement::success(), r#"{"result":"AQ=="}"#); diff --git a/crates/relayer-types/src/applications/transfer/denom.rs b/crates/relayer-types/src/applications/transfer/denom.rs index dbc5a4cd3a..35a5e572b1 100644 --- a/crates/relayer-types/src/applications/transfer/denom.rs +++ b/crates/relayer-types/src/applications/transfer/denom.rs @@ -196,7 +196,7 @@ pub fn is_receiver_chain_source( // A: sender chain in this transfer, port "transfer" and channel "c2b" (to B) // B: receiver chain in this transfer, port "transfer" and channel "c2a" (to A) // - // If B had originally sent the token in a previous tranfer, then A would have stored the token as + // If B had originally sent the token in a previous transfer, then A would have stored the token as // "transfer/c2b/{token_denom}". Now, A is sending to B, so to check if B is the source of the token, // we need to check if the token starts with "transfer/c2b". let prefix = TracePrefix::new(source_port, source_channel); diff --git a/crates/relayer-types/src/core/ics02_client/consensus_state.rs b/crates/relayer-types/src/core/ics02_client/consensus_state.rs index b3c6cf7d69..fc544f800d 100644 --- a/crates/relayer-types/src/core/ics02_client/consensus_state.rs +++ b/crates/relayer-types/src/core/ics02_client/consensus_state.rs @@ -9,7 +9,7 @@ use crate::timestamp::Timestamp; /// to verify new commits & state roots. /// /// Users are not expected to implement sealed::ErasedPartialEqConsensusState. -/// Effectively, that trait bound mandates implementors to derive PartialEq, +/// Effectively, that trait bound mandates implementers to derive PartialEq, /// after which our blanket implementation will implement /// `ErasedPartialEqConsensusState` for their type. pub trait ConsensusState: Clone + Debug + Send + Sync // Any: From, diff --git a/crates/relayer-types/src/core/ics02_client/error.rs b/crates/relayer-types/src/core/ics02_client/error.rs index 6dee458d02..094a883aa6 100644 --- a/crates/relayer-types/src/core/ics02_client/error.rs +++ b/crates/relayer-types/src/core/ics02_client/error.rs @@ -161,7 +161,7 @@ define_error! { InvalidStringAsHeight { value: String } [ HeightError ] - | e | { format_args!("String {0} cannnot be converted to height", e.value) }, + | e | { format_args!("String {0} cannot be converted to height", e.value) }, InvalidHeight | _ | { "revision height cannot be zero" }, @@ -246,7 +246,7 @@ define_error! { update_time: Timestamp, } | e | { - format_args!("header not withing trusting period: expires_at={0} now={1}", e.latest_time, e.update_time) + format_args!("header not within trusting period: expires_at={0} now={1}", e.latest_time, e.update_time) }, MissingLocalConsensusState diff --git a/crates/relayer-types/src/core/ics02_client/trust_threshold.rs b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs index b2183c6f98..f2afbb315c 100644 --- a/crates/relayer-types/src/core/ics02_client/trust_threshold.rs +++ b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs @@ -66,7 +66,7 @@ impl TrustThreshold { /// The numerator of the fraction underlying this trust threshold. pub fn numerator(&self) -> u64 { - *self.0.numer() + *self.0.number() } /// The denominator of the fraction underlying this trust threshold. diff --git a/crates/relayer-types/src/core/ics03_connection/error.rs b/crates/relayer-types/src/core/ics03_connection/error.rs index 619f14b2e1..068b3ee30a 100644 --- a/crates/relayer-types/src/core/ics03_connection/error.rs +++ b/crates/relayer-types/src/core/ics03_connection/error.rs @@ -90,7 +90,7 @@ define_error! { VerifyConnectionState [ client_error::Error ] - | _ | { "error verifying connnection state" }, + | _ | { "error verifying connection state" }, Signer [ SignerError ] diff --git a/crates/relayer-types/src/core/ics03_connection/version.rs b/crates/relayer-types/src/core/ics03_connection/version.rs index a796ff3c05..108665d80e 100644 --- a/crates/relayer-types/src/core/ics03_connection/version.rs +++ b/crates/relayer-types/src/core/ics03_connection/version.rs @@ -19,7 +19,7 @@ pub struct Version { } impl Version { - /// Checks whether or not the given feature is supported in this versin + /// Checks whether or not the given feature is supported in this version pub fn is_supported_feature(&self, feature: String) -> bool { self.features.contains(&feature) } diff --git a/crates/relayer-types/src/core/ics04_channel/error.rs b/crates/relayer-types/src/core/ics04_channel/error.rs index 1f0f04de6c..817f0337f8 100644 --- a/crates/relayer-types/src/core/ics04_channel/error.rs +++ b/crates/relayer-types/src/core/ics04_channel/error.rs @@ -100,7 +100,7 @@ define_error! { | _ | { "missing channel end" }, InvalidVersionLengthConnection - | _ | { "single version must be negociated on connection before opening channel" }, + | _ | { "single version must be negotiated on connection before opening channel" }, ChannelFeatureNotSuportedByConnection | _ | { "the channel ordering is not supported by connection" }, diff --git a/crates/relayer-types/src/core/ics04_channel/timeout.rs b/crates/relayer-types/src/core/ics04_channel/timeout.rs index 076505ed49..aa33ec23b1 100644 --- a/crates/relayer-types/src/core/ics04_channel/timeout.rs +++ b/crates/relayer-types/src/core/ics04_channel/timeout.rs @@ -43,7 +43,7 @@ impl TimeoutHeight { } } - /// Check if a height is *stricly past* the timeout height, and thus is + /// Check if a height is *strictly past* the timeout height, and thus is /// deemed expired. pub fn has_expired(&self, height: Height) -> bool { match self { diff --git a/crates/relayer-types/src/core/ics23_commitment/merkle.rs b/crates/relayer-types/src/core/ics23_commitment/merkle.rs index 603374812e..fb7642b319 100644 --- a/crates/relayer-types/src/core/ics23_commitment/merkle.rs +++ b/crates/relayer-types/src/core/ics23_commitment/merkle.rs @@ -182,7 +182,7 @@ fn calculate_non_existence_root(proof: &NonExistenceProof) -> Result, Er // Merkle Proof serialization notes: // "Proof" id currently defined in a number of forms and included in a number of places // - TmProof: in tendermint-rs/src/merkle/proof.rs:Proof -// - RawProofOps: in tendermint-proto/tendermint.cyrpto.rs:ProofOps +// - RawProofOps: in tendermint-proto/tendermint.crypto.rs:ProofOps // - RawMerkleProof: in ibc-proto/ibc.core.commitment.v1.rs:MerkleProof // - structure that includes a RawProofOps in its only `proof` field. // #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/crates/relayer-types/src/serializers.rs b/crates/relayer-types/src/serializers.rs index da3cce68d1..505f8557fa 100644 --- a/crates/relayer-types/src/serializers.rs +++ b/crates/relayer-types/src/serializers.rs @@ -1,4 +1,4 @@ -use serde::ser::{Serialize, Serializer}; +use serde::set::{Serialize, Serializer}; use subtle_encoding::{Encoding, Hex}; pub fn ser_hex_upper(data: T, serializer: S) -> Result diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index e8d41f6975..7b7d881f09 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -2029,7 +2029,7 @@ impl ChainEndpoint for CosmosSdkChain { /// Note - there is no way to format the packet query such that it asks for Tx-es with either /// sequence (the query conditions can only be AND-ed). /// There is a possibility to include "<=" and ">=" conditions but it doesn't work with - /// string attributes (sequence is emmitted as a string). + /// string attributes (sequence is emitted as a string). /// Therefore, for packets we perform one tx_search for each sequence. /// Alternatively, a single query for all packets could be performed but it would return all /// packets ever sent. diff --git a/crates/relayer/src/chain/cosmos/query/tx.rs b/crates/relayer/src/chain/cosmos/query/tx.rs index f5ad53ea6d..e6897c02a4 100644 --- a/crates/relayer/src/chain/cosmos/query/tx.rs +++ b/crates/relayer/src/chain/cosmos/query/tx.rs @@ -43,7 +43,7 @@ pub async fn query_txs( // query the first Tx that includes the event matching the client request // Note: it is possible to have multiple Tx-es for same client and consensus height. - // In this case it must be true that the client updates were performed with tha + // In this case it must be true that the client updates were performed with the // same header as the first one, otherwise a subsequent transaction would have // failed on chain. Therefore only one Tx is of interest and current API returns // the first one. @@ -102,7 +102,7 @@ pub async fn query_txs( /// Note - there is no way to format the packet query such that it asks for Tx-es with either /// sequence (the query conditions can only be AND-ed). /// There is a possibility to include "<=" and ">=" conditions but it doesn't work with -/// string attributes (sequence is emmitted as a string). +/// string attributes (sequence is emitted as a string). /// Therefore, for packets we perform one tx_search for each sequence. /// Alternatively, a single query for all packets could be performed but it would return all /// packets ever sent. diff --git a/crates/relayer/src/channel.rs b/crates/relayer/src/channel.rs index 372ee4a42e..c2a9880262 100644 --- a/crates/relayer/src/channel.rs +++ b/crates/relayer/src/channel.rs @@ -1020,7 +1020,7 @@ impl Channel { let counterparty = Counterparty::new(self.src_port_id().clone(), self.src_channel_id().cloned()); - // Re-use the version that was either set on ChanOpenInit or overwritten by the application. + // Reuse the version that was either set on ChanOpenInit or overwritten by the application. let version = src_channel.version().clone(); let channel = ChannelEnd::new( diff --git a/crates/relayer/src/config/error.rs b/crates/relayer/src/config/error.rs index d2827f33c6..f26547629a 100644 --- a/crates/relayer/src/config/error.rs +++ b/crates/relayer/src/config/error.rs @@ -43,7 +43,7 @@ define_error! { |e| { format!("invalid compatibility mode: '{}' (supported: {})", e.compat_mode, e.valide_modes) }, Encode - [ TraceError ] + [ TraceError ] |_| { "invalid configuration" }, WrongType diff --git a/crates/relayer/src/config/filter.rs b/crates/relayer/src/config/filter.rs index 9733671b0c..3c7c28e402 100644 --- a/crates/relayer/src/config/filter.rs +++ b/crates/relayer/src/config/filter.rs @@ -199,7 +199,7 @@ impl Serialize for ChannelFilters { where S: Serializer, { - use serde::ser::SerializeSeq; + use serde::set::SerializeSeq; struct Pair<'a> { a: &'a FilterPattern, diff --git a/crates/relayer/src/config/proof_specs.rs b/crates/relayer/src/config/proof_specs.rs index d7c7f80cce..74b436dd2a 100644 --- a/crates/relayer/src/config/proof_specs.rs +++ b/crates/relayer/src/config/proof_specs.rs @@ -2,7 +2,7 @@ use core::fmt; use ibc_relayer_types::core::ics23_commitment::specs::ProofSpecs; -use serde::{de, ser, Deserializer, Serializer}; +use serde::{de, set, Deserializer, Serializer}; pub fn serialize( proof_specs: &Option, @@ -10,7 +10,7 @@ pub fn serialize( ) -> Result { match proof_specs { Some(proof_specs) => { - let json_str = serde_json::to_string_pretty(proof_specs).map_err(ser::Error::custom)?; + let json_str = serde_json::to_string_pretty(proof_specs).map_err(set::Error::custom)?; serializer.serialize_some(&json_str) } None => serializer.serialize_none(), diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index 1b47280661..e16a1c4e75 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -309,7 +309,7 @@ define_error! { ChannelReceiveTimeout [ TraceError ] - |_| { "timeout when waiting for reponse over inter-thread channel" }, + |_| { "timeout when waiting for response over inter-thread channel" }, InvalidInputHeader |_| { "the input header is not recognized as a header for this chain" }, @@ -648,7 +648,7 @@ impl GrpcStatusSubdetail { /// ## Note /// This error may happen even when packets are submitted in order when the `simulate_tx` /// gRPC endpoint is allowed to be called after a block is created and before - /// Tendermint/mempool finishes `recheck_tx`, similary to the issue described in + /// Tendermint/mempool finishes `recheck_tx`, similarly to the issue described in /// . /// /// See for more info. diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index b055bf1268..46bcf9ac46 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -988,7 +988,7 @@ impl RelayPath { // All updates were successful, no errors and no misbehaviour. (None, Some(update_event_height), None) => Ok(update_event_height), (Some(chain_error), _, _) => { - // Atleast one chain-error so retry if possible. + // At least one chain-error so retry if possible. if retries_left == 0 { Err(LinkError::client(ForeignClientError::chain_error_event( self.dst_chain().id(), @@ -1012,7 +1012,7 @@ impl RelayPath { _ => Err(LinkError::update_client_failed()), } } - // Atleast one misbehaviour event, so don't retry. + // At least one misbehaviour event, so don't retry. (_, _, Some(_misbehaviour)) => Err(LinkError::update_client_failed()), } } @@ -1055,7 +1055,7 @@ impl RelayPath { // All updates were successful, no errors and no misbehaviour. (None, Some(update_event_height), None) => Ok(update_event_height), (Some(chain_error), _, _) => { - // Atleast one chain-error so retry if possible. + // At least one chain-error so retry if possible. if retries_left == 0 { Err(LinkError::client(ForeignClientError::chain_error_event( self.src_chain().id(), diff --git a/crates/relayer/src/rest/error.rs b/crates/relayer/src/rest/error.rs index f74ed10746..c2e273f19f 100644 --- a/crates/relayer/src/rest/error.rs +++ b/crates/relayer/src/rest/error.rs @@ -1,4 +1,4 @@ -use serde::ser::{Serialize, SerializeMap, Serializer}; +use serde::set::{Serialize, SerializeMap, Serializer}; use thiserror::Error; use ibc_relayer_types::core::ics24_host::{error::ValidationErrorDetail, identifier::ChainId}; diff --git a/crates/relayer/src/util/task.rs b/crates/relayer/src/util/task.rs index 3a3638b864..34e2906814 100644 --- a/crates/relayer/src/util/task.rs +++ b/crates/relayer/src/util/task.rs @@ -38,14 +38,14 @@ struct DropJoinHandle(Option>); */ pub enum TaskError { /** - Inform the background task runner that an ignorable error has occured, + Inform the background task runner that an ignorable error has occurred, and the background task runner should log the error and then continue execution. */ Ignore(E), /** - Inform the background task runner that a fatal error has occured, + Inform the background task runner that a fatal error has occurred, and the background task runner should log the error and then abort execution. */ @@ -61,7 +61,7 @@ pub enum Next { Spawn a long-running background task with the given step runner. The step runner is a `FnMut` closure that is called repeatedly and - returns a `Result<(), TaskError>`. If the step is executed successfuly, + returns a `Result<(), TaskError>`. If the step is executed successfully, the step runner should return `Ok(())` so that it will be called again. Otherwise if errors occurred or of the task needs to be aborted, diff --git a/crates/relayer/src/worker/packet.rs b/crates/relayer/src/worker/packet.rs index 828ee2251b..2eb85f633c 100644 --- a/crates/relayer/src/worker/packet.rs +++ b/crates/relayer/src/worker/packet.rs @@ -124,7 +124,7 @@ pub fn spawn_packet_cmd_worker( if is_new_batch { idle_worker_timer = 0; - trace!("packet worker processed an event batch, reseting idle timer"); + trace!("packet worker processed an event batch, resetting idle timer"); } else { idle_worker_timer += 1; trace!("packet worker has not processed an event batch after {idle_worker_timer} blocks, incrementing idle timer"); diff --git a/crates/telemetry/src/state.rs b/crates/telemetry/src/state.rs index b0aff925df..00461eb2fc 100644 --- a/crates/telemetry/src/state.rs +++ b/crates/telemetry/src/state.rs @@ -1045,7 +1045,7 @@ impl TelemetryState { self.backlog_size .observe(&cx, path_backlog.len() as u64, labels); } else { - // No mimimum found, update the metrics to reflect an empty backlog + // No minimum found, update the metrics to reflect an empty backlog self.backlog_oldest_sequence .observe(&cx, EMPTY_BACKLOG_SYMBOL, labels); self.backlog_size.observe(&cx, EMPTY_BACKLOG_SYMBOL, labels); diff --git a/docs/architecture/adr-002-ibc-relayer.md b/docs/architecture/adr-002-ibc-relayer.md index 6ca29cb00a..983ff24805 100644 --- a/docs/architecture/adr-002-ibc-relayer.md +++ b/docs/architecture/adr-002-ibc-relayer.md @@ -793,6 +793,6 @@ The IBC Events, input to the relay thread are described here. ## References -> Are there any relevant PR comments, issues that led up to this, or articles referrenced for why we made the given design choice? If so link them here! +> Are there any relevant PR comments, issues that led up to this, or articles referenced for why we made the given design choice? If so link them here! * {reference link} diff --git a/docs/architecture/adr-003-handler-implementation.md b/docs/architecture/adr-003-handler-implementation.md index 62693d1c3f..e552f7672e 100644 --- a/docs/architecture/adr-003-handler-implementation.md +++ b/docs/architecture/adr-003-handler-implementation.md @@ -309,7 +309,7 @@ pub fn keep( > This section is very much a work in progress, as further investigation into what > a production-ready implementation of the `ctx` parameter of the top-level dispatcher -> is required. As such, implementors should feel free to disregard the recommendations +> is required. As such, implementers should feel free to disregard the recommendations > below, and are encouraged to come up with amendments to this ADR to better capture > the actual requirements. @@ -552,7 +552,7 @@ pub trait ClientKeeper { This way, only one implementation of the `ClientReader` and `ClientKeeper` trait is required, as it can delegate eg. the serialization of the underlying datatypes to the `Serialize` bound -of the `Any...` wrappper. +of the `Any...` wrapper. Both the `process` and `keep` function are defined to take a message generic over the actual client type: diff --git a/docs/architecture/adr-template.md b/docs/architecture/adr-template.md index 28a5ecfbbc..83d323eeec 100644 --- a/docs/architecture/adr-template.md +++ b/docs/architecture/adr-template.md @@ -31,6 +31,6 @@ If the proposed change will be large, please also indicate a way to do the chang ## References -> Are there any relevant PR comments, issues that led up to this, or articles referrenced for why we made the given design choice? If so link them here! +> Are there any relevant PR comments, issues that led up to this, or articles referenced for why we made the given design choice? If so link them here! * {reference link} diff --git a/docs/architecture/architecture.md b/docs/architecture/architecture.md index dddf2ae11a..e80c5bda79 100644 --- a/docs/architecture/architecture.md +++ b/docs/architecture/architecture.md @@ -110,7 +110,7 @@ Used by Hermes to gather telemetry data and expose it via a Prometheus endpoint. Most of the components in the `ibc` crate (i.e. the `modules` directory) have basic unit testing coverage. These unit tests make use of mocked up chain components in order to ensure that message payloads are being sent and received as expected. -We also run end-to-end tests to more thoroughly test IBC modules in a more heterogenous fashion. +We also run end-to-end tests to more thoroughly test IBC modules in a more heterogeneous fashion. ### Error Handling diff --git a/docs/spec/connection-handshake/L1_2.md b/docs/spec/connection-handshake/L1_2.md index 66a7eaa4eb..dbca2591d8 100644 --- a/docs/spec/connection-handshake/L1_2.md +++ b/docs/spec/connection-handshake/L1_2.md @@ -245,7 +245,7 @@ Specifically, termination implies that each module allocates in the local store _Remarks_: -- Uniqueness property essentially provides a safeguard against overwritting a connection in the store with some new set of parameters. +- Uniqueness property essentially provides a safeguard against overwriting a connection in the store with some new set of parameters. - The integrity property, in conjunction with uniqueness, ensures that there is continuity between the connections that a module initializes and the connections that this module opens. diff --git a/docs/spec/connection-handshake/L2-tla/Environment.tla b/docs/spec/connection-handshake/L2-tla/Environment.tla index c90176530b..6ea00d17c2 100644 --- a/docs/spec/connection-handshake/L2-tla/Environment.tla +++ b/docs/spec/connection-handshake/L2-tla/Environment.tla @@ -273,7 +273,7 @@ RelayNextEnv == the chains unless the chain has just a few (namely, `4`) heights left. 3. The environment may perform a relaying step, that is: - if there is a message in the ougoing buffer of a chain, the relayer + if there is a message in the outgoing buffer of a chain, the relayer moves this message to the ingoing buffer of the other chain, and also updates the client on the latter chain. @@ -328,7 +328,7 @@ Init == (* The two ICS3 modules and the environment alternate their steps non-deterministically. Eventually, the execution ends with either - successful (ICS3ReachedOpenConnection sub-action) or unsuccesfull + successful (ICS3ReachedOpenConnection sub-action) or unsuccessful (ICS3ImpossibleToAdvance sub-action) termination. *) Next == diff --git a/docs/spec/tla/fungible-token-transfer/Bank.tla b/docs/spec/tla/fungible-token-transfer/Bank.tla index 20e1af41ff..8b1630b584 100644 --- a/docs/spec/tla/fungible-token-transfer/Bank.tla +++ b/docs/spec/tla/fungible-token-transfer/Bank.tla @@ -30,7 +30,7 @@ AddCoins(accounts, accountID, amount) == ] -\* Transfer coins from senderAccounts to receiverAccounts, depeding on +\* Transfer coins from senderAccounts to receiverAccounts, depending on \* the sender addressees, receiver addressees and denomination \* - senderAccounts is a map from sender addresses and denominations \* to account balances diff --git a/docs/spec/tla/fungible-token-transfer/Chain.tla b/docs/spec/tla/fungible-token-transfer/Chain.tla index af779b2999..aeb25ea87b 100644 --- a/docs/spec/tla/fungible-token-transfer/Chain.tla +++ b/docs/spec/tla/fungible-token-transfer/Chain.tla @@ -126,7 +126,7 @@ SendPacket == LET updatedChainStore == WritePacketCommitment(chainStore, packet) IN \* if writing the packet commitment was successful /\ chainStore /= updatedChainStore - \* update chain store with packet committment + \* update chain store with packet commitment /\ chainStore' = updatedChainStore \* log sent packet /\ packetLog' = Append(packetLog, [ diff --git a/docs/spec/tla/fungible-token-transfer/IBCTokenTransferDefinitions.tla b/docs/spec/tla/fungible-token-transfer/IBCTokenTransferDefinitions.tla index 8e3f3c5641..3ce0509670 100644 --- a/docs/spec/tla/fungible-token-transfer/IBCTokenTransferDefinitions.tla +++ b/docs/spec/tla/fungible-token-transfer/IBCTokenTransferDefinitions.tla @@ -406,7 +406,7 @@ InitUnorderedChannelEnd(ChainID) == \* - height is initialized to 1 \* - counterpartyClientHeights is the set of installed client heights \* - the channelEnd is initialized to InitUnorderedChannelEnd -\* - the packet committments, receipts, acknowledgements, and packets +\* - the packet commitments, receipts, acknowledgements, and packets \* to acknowledge are empty ICS20InitChainStore(ChainID) == [ diff --git a/docs/spec/tla/fungible-token-transfer/ICS04PacketHandlers.tla b/docs/spec/tla/fungible-token-transfer/ICS04PacketHandlers.tla index cfcd4883a8..74f714434c 100644 --- a/docs/spec/tla/fungible-token-transfer/ICS04PacketHandlers.tla +++ b/docs/spec/tla/fungible-token-transfer/ICS04PacketHandlers.tla @@ -101,7 +101,7 @@ HandlePacketAck(chain, packetDatagram, log, accounts, escrowAccounts, maxBalance LET packet == packetDatagram.packet IN \* get acknowledgement LET ack == packetDatagram.acknowledgement IN - \* get packet committment that should be in chain store + \* get packet commitment that should be in chain store LET packetCommitment == [ portID |-> packet.srcPortID, channelID |-> packet.srcChannelID, @@ -141,7 +141,7 @@ HandlePacketAck(chain, packetDatagram, log, accounts, escrowAccounts, maxBalance escrowAccounts |-> escrowAccounts] -\* write packet committments to chain store +\* write packet commitments to chain store \* @type: (CHAINSTORE, PACKET) => CHAINSTORE; WritePacketCommitment(chain, packet) == \* get channel end @@ -245,7 +245,7 @@ TimeoutPacket(chain, counterpartyChain, accounts, escrowAccounts, packet, proofHeight, maxBalance) == \* get channel end LET channelEnd == chain.channelEnd IN - \* get packet committment that should be in chain store + \* get packet commitment that should be in chain store LET packetCommitment == [ portID |-> packet.srcPortID, channelID |-> packet.srcChannelID, @@ -303,7 +303,7 @@ TimeoutOnClose(chain, counterpartyChain, accounts, escrowAccounts, \* get counterparty channel end LET counterpartyChannelEnd == counterpartyChain.channelEnd IN - \* get packet committment that should be in chain store + \* get packet commitment that should be in chain store LET packetCommitment == [ portID |-> packet.srcPortID, channelID |-> packet.srcChannelID, diff --git a/docs/spec/tla/ibc-core/Chain.tla b/docs/spec/tla/ibc-core/Chain.tla index 500c985dec..5bbe315487 100644 --- a/docs/spec/tla/ibc-core/Chain.tla +++ b/docs/spec/tla/ibc-core/Chain.tla @@ -180,7 +180,7 @@ SendPacket == LET updatedChainStore == WritePacketCommitment(chainStore, packet) IN \* if writing the packet commitment was successful /\ chainStore /= updatedChainStore - \* update chain store with packet committment + \* update chain store with packet commitment /\ chainStore' = updatedChainStore \* log sent packet /\ packetLog' = Append(packetLog, [ diff --git a/docs/spec/tla/ibc-core/IBCCoreDefinitions.tla b/docs/spec/tla/ibc-core/IBCCoreDefinitions.tla index 53ee2a5731..3bd6e5bc2d 100644 --- a/docs/spec/tla/ibc-core/IBCCoreDefinitions.tla +++ b/docs/spec/tla/ibc-core/IBCCoreDefinitions.tla @@ -520,7 +520,7 @@ InitConnectionEnds(Versions, channelOrdering) == \* - height is initialized to 1 \* - the counterparty light client is uninitialized \* - the connection end is initialized to InitConnectionEnd -\* - the packet committments, receipts, acknowledgements, and +\* - the packet commitments, receipts, acknowledgements, and \* packets to acknowledge are empty \* @type: (Set(Int), Str) => Set(CHAINSTORE); InitChainStore(Versions, channelOrdering) == diff --git a/docs/spec/tla/ibc-core/ICS03ConnectionHandlers.tla b/docs/spec/tla/ibc-core/ICS03ConnectionHandlers.tla index 72fc205aa3..afe0443645 100644 --- a/docs/spec/tla/ibc-core/ICS03ConnectionHandlers.tla +++ b/docs/spec/tla/ibc-core/ICS03ConnectionHandlers.tla @@ -58,7 +58,7 @@ HandleConnOpenTry(chainID, chain, datagrams) == THEN LET connOpenTryDgr == CHOOSE dgr \in connOpenTryDgrs : TRUE IN LET versionIntersection == chain.connectionEnd.versions \intersect connOpenTryDgr.versions IN - \* if the versions from the datagram overlap with the supported versions of the connnection end + \* if the versions from the datagram overlap with the supported versions of the connection end IF /\ versionIntersection /= {} \* if the connection end is uninitialized /\ \/ chain.connectionEnd.state = "UNINIT" diff --git a/docs/spec/tla/ibc-core/ICS04PacketHandlers.tla b/docs/spec/tla/ibc-core/ICS04PacketHandlers.tla index 4e4808f040..bb08d53e22 100644 --- a/docs/spec/tla/ibc-core/ICS04PacketHandlers.tla +++ b/docs/spec/tla/ibc-core/ICS04PacketHandlers.tla @@ -93,7 +93,7 @@ HandlePacketAck(chainID, chain, packetDatagram, log) == LET channelEnd == GetChannelEnd(chain) IN \* get packet LET packet == packetDatagram.packet IN - \* get packet committment that should be in chain store + \* get packet commitment that should be in chain store LET packetCommitment == [ portID |-> packet.srcPortID, channelID |-> packet.srcChannelID, @@ -135,7 +135,7 @@ HandlePacketAck(chainID, chain, packetDatagram, log) == ELSE [chainStore |-> chain, packetLog |-> log] -\* write packet committments to chain store +\* write packet commitments to chain store \* @type: (CHAINSTORE, PACKET) => CHAINSTORE; WritePacketCommitment(chain, packet) == \* get chainID's connection end @@ -158,7 +158,7 @@ WritePacketCommitment(chain, packet) == /\ \/ packet.timeoutHeight = 0 \/ latestClientHeight < packet.timeoutHeight THEN IF \* if the channel is ordered, check if packetSeq is nextSendSeq, - \* add a packet committment in the chain store, and increase nextSendSeq + \* add a packet commitment in the chain store, and increase nextSendSeq /\ channelEnd.order = "ORDERED" /\ packet.sequence = channelEnd.nextSendSeq THEN [chain EXCEPT @@ -171,7 +171,7 @@ WritePacketCommitment(chain, packet) == ] \* otherwise, do not update the chain store ELSE IF \* if the channel is unordered, - \* add a packet committment in the chain store + \* add a packet commitment in the chain store /\ channelEnd.order = "UNORDERED" THEN [chain EXCEPT !.packetCommitments = @@ -248,7 +248,7 @@ TimeoutPacket(chain, counterpartyChain, packet, proofHeight) == \* get counterparty channel end LET counterpartyChannelEnd == GetChannelEnd(counterpartyChain) IN - \* get packet committment that should be in chain store + \* get packet commitment that should be in chain store LET packetCommitment == [ portID |-> packet.srcPortID, channelID |-> packet.srcChannelID, @@ -310,7 +310,7 @@ TimeoutOnClose(chain, counterpartyChain, packet, proofHeight) == \* get counterparty channel end LET counterpartyChannelEnd == GetChannelEnd(counterpartyChain) IN - \* get packet committment that should be in chain store + \* get packet commitment that should be in chain store LET packetCommitment == [ portID |-> packet.srcPortID, channelID |-> packet.srcChannelID, diff --git a/docs/spec/tla/packet-delay/Chain.tla b/docs/spec/tla/packet-delay/Chain.tla index c21ad200d0..f2b9f03e3c 100644 --- a/docs/spec/tla/packet-delay/Chain.tla +++ b/docs/spec/tla/packet-delay/Chain.tla @@ -90,7 +90,7 @@ SendPacket == srcChannelID |-> chainStore.channelEnd.channelID, dstPortID |-> chainStore.channelEnd.counterpartyPortID, dstChannelID |-> chainStore.channelEnd.counterpartyChannelID] IN - \* update chain store with packet committment + \* update chain store with packet commitment /\ chainStore' = WritePacketCommitment(chainStore, packet) \* log sent packet /\ packetLog' = Append(packetLog, diff --git a/docs/spec/tla/packet-delay/IBCPacketDelayDefinitions.tla b/docs/spec/tla/packet-delay/IBCPacketDelayDefinitions.tla index cad0aee7ea..915229f896 100644 --- a/docs/spec/tla/packet-delay/IBCPacketDelayDefinitions.tla +++ b/docs/spec/tla/packet-delay/IBCPacketDelayDefinitions.tla @@ -396,7 +396,7 @@ InitChannelEnd(ChainID, ChannelOrdering) == \* - timestamp is initialized to 1 \* - there are no installed client heights \* - the channel end is initialized to InitChannelEnd -\* - the packet committments, receipts, acknowledgements, and packets +\* - the packet commitments, receipts, acknowledgements, and packets \* to acknowledge are empty \* @type: (Str, Set(Int), Str, Int) => CHAINSTORE; InitChainStore(ChainID, Heights, ChannelOrdering, MaxDelay) == diff --git a/docs/spec/tla/packet-delay/ICS04PacketHandlers.tla b/docs/spec/tla/packet-delay/ICS04PacketHandlers.tla index 22a3b359be..36a5ea8379 100644 --- a/docs/spec/tla/packet-delay/ICS04PacketHandlers.tla +++ b/docs/spec/tla/packet-delay/ICS04PacketHandlers.tla @@ -111,7 +111,7 @@ HandlePacketAck(chainID, chain, packetDatagram, delay, log, datagramTimestamp) = LET channelEnd == chain.channelEnd IN \* get packet LET packet == packetDatagram.packet IN - \* get packet committment that should be in chain store + \* get packet commitment that should be in chain store LET packetCommitment == [portID |-> packet.srcPortID, channelID |-> packet.srcChannelID, sequence |-> packet.sequence, @@ -125,7 +125,7 @@ HandlePacketAck(chainID, chain, packetDatagram, delay, log, datagramTimestamp) = IF \* if the channel end is open for packet transmission /\ channelEnd.state = "OPEN" - \* if the packet committment exists in the chain store + \* if the packet commitment exists in the chain store /\ packetCommitment \in chain.packetCommitments \* if the "PacketRecv" datagram has valid port and channel IDs /\ packet.srcPortID = channelEnd.portID @@ -167,7 +167,7 @@ HandlePacketAck(chainID, chain, packetDatagram, delay, log, datagramTimestamp) = ELSE [chainStore |-> chain, packetLog |-> log, datagramTimestamp |-> datagramTimestamp] -\* write packet committments to chain store +\* write packet commitments to chain store \* @type: (CHAINSTORE, PACKET) => CHAINSTORE; WritePacketCommitment(chain, packet) == \* get channel end @@ -186,7 +186,7 @@ WritePacketCommitment(chain, packet) == /\ \/ packet.timeoutHeight = 0 \/ latestClientHeight < packet.timeoutHeight THEN IF \* if the channel is ordered, check if packetSeq is nextSendSeq, - \* add a packet committment in the chain store, and increase nextSendSeq + \* add a packet commitment in the chain store, and increase nextSendSeq /\ channelEnd.order = "ORDERED" /\ packet.sequence = channelEnd.nextSendSeq THEN [chain EXCEPT @@ -203,7 +203,7 @@ WritePacketCommitment(chain, packet) == \* otherwise, do not update the chain store ELSE chain ELSE IF \* if the channel is unordered, - \* add a packet committment in the chain store + \* add a packet commitment in the chain store /\ channelEnd.order = "UNORDERED" THEN [chain EXCEPT !.packetCommitments = @@ -282,7 +282,7 @@ TimeoutPacket(chain, counterpartyChain, packet, proofHeight) == \* get counterparty channel end LET counterpartyChannelEnd == counterpartyChain.channelEnd IN - \* get packet committment that should be in chain store + \* get packet commitment that should be in chain store LET packetCommitment == [portID |-> packet.srcPortID, channelID |-> packet.srcChannelID, sequence |-> packet.sequence, @@ -336,7 +336,7 @@ TimeoutOnClose(chain, counterpartyChain, packet, proofHeight) == \* get counterparty channel end LET counterpartyChannelEnd == counterpartyChain.channelEnd IN - \* get packet committment that should be in chain store + \* get packet commitment that should be in chain store LET packetCommitment == [portID |-> packet.srcPortID, channelID |-> packet.srcChannelID, sequence |-> packet.sequence, diff --git a/guide/README.md b/guide/README.md index b3234796fd..119ddbdef2 100644 --- a/guide/README.md +++ b/guide/README.md @@ -72,4 +72,4 @@ Basically if you want to add new content to the guide, just add an entry to the If you are adding content using your favorite IDE and have a terminal opened running `mdbook serve`, it provides a convenient watch functionality, so any changes detected on local files will trigger another build and if you refresh the guide on your browser they will be shown there. #### Submit your changes -Once you finish adding the new content just commit your changes (`git commit`) and push them to the respository (`git push`). +Once you finish adding the new content just commit your changes (`git commit`) and push them to the repository (`git push`). diff --git a/guide/src/advanced/troubleshooting/cross-comp-config.md b/guide/src/advanced/troubleshooting/cross-comp-config.md index 8c6c07cd9c..f5ae0cb389 100644 --- a/guide/src/advanced/troubleshooting/cross-comp-config.md +++ b/guide/src/advanced/troubleshooting/cross-comp-config.md @@ -42,7 +42,7 @@ __Hermes vs other configuration parameters that may cause Hermes failures__ ## Recheck When relaying packets, Hermes may send up multiple transactions to the full node's mempool. Hermes uses the `broadcast_tx_sync` RPC which does some basic verification and then returns the Tx hash back. -Unless configured with `sequential_batch_tx = true`, Hermes does not wait for a transaction to be included in a block before sending the next transaction. For this to be possible, Hermes keeps track of the account sequence number locally, incrementing it after each succesfull `broadcast_tx_sync` RPC. +Unless configured with `sequential_batch_tx = true`, Hermes does not wait for a transaction to be included in a block before sending the next transaction. For this to be possible, Hermes keeps track of the account sequence number locally, incrementing it after each successful `broadcast_tx_sync` RPC. During peak periods, it is possible that not all Tx-es in the mempool are included in a block. In order for new transactions to be accepted along with the pending Tx-es, the full node must be configured with `recheck = true`. Otherwise, Hermes may get the following error: ``` @@ -284,7 +284,7 @@ Set `ccv_consumer_chain = true` in `config.toml`. If Hermes is set to query CometBFT's `/block_results` RPC endpoint (which is the case when Hermes is set to use the [pull-based event source][pull-based-event-source]), you may encounter an `Internal error: node is not persisting abci responses (code: -32603)` when clearing packets. -This is likely due to the underlying CometBFT node being configured to discard ABCI responses via the `discard_abci_responses` configuration paramter being set to `true` in the Comet config. When this option is set to `true`, Hermes will not be able to clear any packets that were sent in either a `begin_block` or an `end_block`; transactions sent using `/tx_search` should still be cleared though. In addition, Hermes will not be able to relay using the pull-based event source if ABCI responses are being discarded. +This is likely due to the underlying CometBFT node being configured to discard ABCI responses via the `discard_abci_responses` configuration parameter being set to `true` in the Comet config. When this option is set to `true`, Hermes will not be able to clear any packets that were sent in either a `begin_block` or an `end_block`; transactions sent using `/tx_search` should still be cleared though. In addition, Hermes will not be able to relay using the pull-based event source if ABCI responses are being discarded. ### Fix Set the Comet node's `discard_abci_resonses = false` in the Comet configuration file. diff --git a/guide/src/advanced/troubleshooting/genesis-restart.md b/guide/src/advanced/troubleshooting/genesis-restart.md index dfeeefc37e..6d75986645 100644 --- a/guide/src/advanced/troubleshooting/genesis-restart.md +++ b/guide/src/advanced/troubleshooting/genesis-restart.md @@ -1,4 +1,4 @@ -# Updating a client after a Genesis restart withtout IBC upgrade proposal +# Updating a client after a Genesis restart without IBC upgrade proposal If a chain went through a genesis restart without an IBC upgrade proposal updating the client can result in an error due to blocks at lower heights not being available. diff --git a/guide/src/assets/grafana_template.json b/guide/src/assets/grafana_template.json index 80846ea8cf..ae3e049667 100644 --- a/guide/src/assets/grafana_template.json +++ b/guide/src/assets/grafana_template.json @@ -1715,7 +1715,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "description": "Indicates the number of `event` observed via the websocket subcription.", + "description": "Indicates the number of `event` observed via the websocket subscription.", "fieldConfig": { "defaults": { "color": { diff --git a/guide/src/documentation/commands/logs/index.md b/guide/src/documentation/commands/logs/index.md index cb94477a5c..e146314568 100644 --- a/guide/src/documentation/commands/logs/index.md +++ b/guide/src/documentation/commands/logs/index.md @@ -8,7 +8,7 @@ This command allows you to easily update the lowest log level displayed by Herme ## Set Raw Filter -This command allows you to update the tracing directive used to filter the logs. Please use this command with caution as it requires a precise syntaxe. +This command allows you to update the tracing directive used to filter the logs. Please use this command with caution as it requires a precise syntax. ```shell {{#include ../../../templates/help_templates/logs/raw.md}} diff --git a/guide/src/documentation/configuration/comet-compat-mode.md b/guide/src/documentation/configuration/comet-compat-mode.md index caf581102b..5ce5e07dfe 100644 --- a/guide/src/documentation/configuration/comet-compat-mode.md +++ b/guide/src/documentation/configuration/comet-compat-mode.md @@ -2,7 +2,7 @@ ## Overview -There are two different compatibility modes for CometBFT, one for version v0.34 and one for versions v0.37 and v0.38. In order to verify the compatiblity used Hermes queries the node's `/status` endpoint, which contains the CometBFT version used. This can be an issue if a chain uses a custom version which does not output the version string Hermes expects. To still be able to relay for these chains a configuration can be set in Hermes. +There are two different compatibility modes for CometBFT, one for version v0.34 and one for versions v0.37 and v0.38. In order to verify the compatibility used Hermes queries the node's `/status` endpoint, which contains the CometBFT version used. This can be an issue if a chain uses a custom version which does not output the version string Hermes expects. To still be able to relay for these chains a configuration can be set in Hermes. ## Configuration diff --git a/guide/src/documentation/configuration/performance.md b/guide/src/documentation/configuration/performance.md index 01f0a94de5..d2f768f1f9 100644 --- a/guide/src/documentation/configuration/performance.md +++ b/guide/src/documentation/configuration/performance.md @@ -91,7 +91,7 @@ setting `clear_on_start` to `false` under the `mode.packets` section, Hermes wil relay packets on active channels, provided they match the packet filter, if present. Otherwise Hermes will relay on all active channels. -Please note that because these settings are globa, they will affect the behaviour of Hermes for all chains listed in its configuration. +Please note that because these settings are global, they will affect the behaviour of Hermes for all chains listed in its configuration. Here is how the configuration file should look like in order to disable scanning altogether. @@ -103,7 +103,7 @@ enabled = false # ... -[mode.connnections] +[mode.connections] enabled = false # ... diff --git a/guide/src/documentation/forwarding/legacy_test.md b/guide/src/documentation/forwarding/legacy_test.md index 7e28ba9fad..8f7999155d 100644 --- a/guide/src/documentation/forwarding/legacy_test.md +++ b/guide/src/documentation/forwarding/legacy_test.md @@ -201,7 +201,7 @@ gaiad version --log_level error --long | head -n4 - wallet1 (cosmos1csdnmydggcyvjd7z8l64z9lpdgmgyr4v7hw5r8) ``` -3. (Optional) Check the balance of the wallets before transfering tokens: +3. (Optional) Check the balance of the wallets before transferring tokens: ```shell {{#template ../../templates/commands/hermes/keys/balance_1.md CHAIN_ID=ibc-0 OPTIONS= --all}} diff --git a/guide/src/documentation/forwarding/test.md b/guide/src/documentation/forwarding/test.md index bf33df7e21..01ebd2562c 100644 --- a/guide/src/documentation/forwarding/test.md +++ b/guide/src/documentation/forwarding/test.md @@ -201,7 +201,7 @@ gaiad version --log_level error --long | head -n4 - wallet1 (cosmos1csdnmydggcyvjd7z8l64z9lpdgmgyr4v7hw5r8) ``` -3. (Optional) Check the balance of the wallets before transfering tokens: +3. (Optional) Check the balance of the wallets before transferring tokens: ```shell {{#template ../../templates/commands/hermes/keys/balance_1.md CHAIN_ID=ibc-0 OPTIONS= --all}} diff --git a/guide/src/tutorials/production/start-relaying.md b/guide/src/tutorials/production/start-relaying.md index 38df477571..90b7e4c6b7 100644 --- a/guide/src/tutorials/production/start-relaying.md +++ b/guide/src/tutorials/production/start-relaying.md @@ -33,7 +33,7 @@ Finally, Hermes is designed to relay without any intervention, however, you migh ## Next steps -Visit the [Telemetry](../../documentation/telemetry/index.md) section to learn how to use the metrics and the [Avanced](../../advanced/index.md) section to learn about Hermes' features and general guidelines for troubleshooting. +Visit the [Telemetry](../../documentation/telemetry/index.md) section to learn how to use the metrics and the [Advanced](../../advanced/index.md) section to learn about Hermes' features and general guidelines for troubleshooting. You can also learn more about [Grafana's features](https://grafana.com/tutorials/grafana-fundamentals/) and learn how to create a [Grafana Managed Alert](https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-grafana-managed-rule/). diff --git a/tools/integration-test/src/tests/clear_packet.rs b/tools/integration-test/src/tests/clear_packet.rs index 5837dd13fe..5bff304825 100644 --- a/tools/integration-test/src/tests/clear_packet.rs +++ b/tools/integration-test/src/tests/clear_packet.rs @@ -96,7 +96,7 @@ impl BinaryChannelTest for ClearPacketTest { sleep(Duration::from_secs(1)); - // Spawn the supervisor only after the first IBC trasnfer + // Spawn the supervisor only after the first IBC transfer relayer.with_supervisor(|| { sleep(Duration::from_secs(1)); diff --git a/tools/integration-test/src/tests/connection_delay.rs b/tools/integration-test/src/tests/connection_delay.rs index db73cfe7ee..d39da949da 100644 --- a/tools/integration-test/src/tests/connection_delay.rs +++ b/tools/integration-test/src/tests/connection_delay.rs @@ -90,7 +90,7 @@ impl BinaryChannelTest for ConnectionDelayTest { assert_gt( &format!( - "Expect IBC transfer to only be successfull after {}s", + "Expect IBC transfer to only be successful after {}s", CONNECTION_DELAY.as_secs() ), &(time2 - time1).try_into().unwrap(), diff --git a/tools/integration-test/src/tests/denom_trace.rs b/tools/integration-test/src/tests/denom_trace.rs index 5c53a22f1a..695efe2876 100644 --- a/tools/integration-test/src/tests/denom_trace.rs +++ b/tools/integration-test/src/tests/denom_trace.rs @@ -11,7 +11,7 @@ pub struct IbcDenomTraceTest; impl TestOverrides for IbcDenomTraceTest {} /// In order to test the denom_trace at first transfer IBC tokens from Chain A -/// to Chain B, and then retrieving the trace hash of the transfered tokens. +/// to Chain B, and then retrieving the trace hash of the transferred tokens. /// The trace hash is used to query the denom_trace and the result is verified. impl BinaryChannelTest for IbcDenomTraceTest { fn run( diff --git a/tools/integration-test/src/tests/forward/forward_transfer.rs b/tools/integration-test/src/tests/forward/forward_transfer.rs index 3447a02171..4830ee43b6 100644 --- a/tools/integration-test/src/tests/forward/forward_transfer.rs +++ b/tools/integration-test/src/tests/forward/forward_transfer.rs @@ -5,7 +5,7 @@ //! //! - The `MisspelledMemoFieldsIbcForwardTransferTest` tests the case where the //! fields inside the memo are misspelled: -//! - Misspelled `forward`: The intemediary chain will not understand the transfer +//! - Misspelled `forward`: The intermediary chain will not understand the transfer //! must be forwarded, and will thus keep the tokens. //! - Misspelled `receiver`: The intermediary chain will not find the receiver field //! and will thus refund the sender. @@ -383,7 +383,7 @@ impl NaryChannelTest<3> for MisspelledMemoFieldsIbcForwardTransferTest { )?; info!( - "check that only the sender lost {} tokens and the intemediary chain received {} tokens", + "check that only the sender lost {} tokens and the intermediary chain received {} tokens", a_to_c_amount, a_to_c_amount ); diff --git a/tools/test-framework/src/bootstrap/binary/chain.rs b/tools/test-framework/src/bootstrap/binary/chain.rs index 1e5e461266..365c079e8c 100644 --- a/tools/test-framework/src/bootstrap/binary/chain.rs +++ b/tools/test-framework/src/bootstrap/binary/chain.rs @@ -165,7 +165,7 @@ pub fn pad_client_ids( [`FullNode`]. The function accepts a proxy type `Seed` that should be unique - accross multiple calls so that the returned [`ChainHandle`] + across multiple calls so that the returned [`ChainHandle`] have a unique type. For example, the following test should fail to compile: diff --git a/tools/test-framework/src/bootstrap/nary/channel.rs b/tools/test-framework/src/bootstrap/nary/channel.rs index e2d2697b88..a954c23ed7 100644 --- a/tools/test-framework/src/bootstrap/nary/channel.rs +++ b/tools/test-framework/src/bootstrap/nary/channel.rs @@ -1,5 +1,5 @@ /*! - Functions for bootstrapping N-ary number of chanels. + Functions for bootstrapping N-ary number of channels. */ use core::convert::TryInto; @@ -100,7 +100,7 @@ pub fn bootstrap_channels_with_connections` becomes a unique chain diff --git a/tools/test-framework/src/relayer/transfer.rs b/tools/test-framework/src/relayer/transfer.rs index c767d24d36..26595051a5 100644 --- a/tools/test-framework/src/relayer/transfer.rs +++ b/tools/test-framework/src/relayer/transfer.rs @@ -72,7 +72,7 @@ pub fn build_transfer_message( for testing. During test, all chains should have the same local clock. We are also not really interested in setting a timeout for most tests, so we just put an approximate 1 minute timeout as the timeout - field is compulsary, and we want to avoid IBC timeout on CI. + field is compulsory, and we want to avoid IBC timeout on CI. The other reason we do not allow precise timeout to be specified is because it requires accessing the counterparty chain to query for diff --git a/tools/test-framework/src/types/binary/chains.rs b/tools/test-framework/src/types/binary/chains.rs index 1f00577603..f195866e17 100644 --- a/tools/test-framework/src/types/binary/chains.rs +++ b/tools/test-framework/src/types/binary/chains.rs @@ -159,7 +159,7 @@ impl ExportEnv for ConnectedChains( } Ok(Err(e)) => { if hang_on_fail { - error!("test failure occured with HANG_ON_FAIL=1, suspending the test to allow debugging: {:?}", + error!("test failure occurred with HANG_ON_FAIL=1, suspending the test to allow debugging: {:?}", e); suspend() } else { - error!("test failure occured. set HANG_ON_FAIL=1 to suspend the test on failure for debugging: {:?}", + error!("test failure occurred. set HANG_ON_FAIL=1 to suspend the test on failure for debugging: {:?}", e); Err(e) From ec819e4c37c6f287845ee3ecde1c0767af51cd6b Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 22 Dec 2023 11:38:31 +0100 Subject: [PATCH 4/7] Remove TLA type checker workflow --- .github/workflows/specs.yml | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 .github/workflows/specs.yml diff --git a/.github/workflows/specs.yml b/.github/workflows/specs.yml deleted file mode 100644 index 1e06c174a5..0000000000 --- a/.github/workflows/specs.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: TLA+ Specs -on: - pull_request: - paths: - - docs/spec/tla/** - push: - branches: master - paths: - - docs/specs/tla/** - -# Cancel previous runs of this workflow when a new commit is added to the PR, branch or tag -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - typecheck-specs: - runs-on: ubuntu-latest - container: apalache/mc:0.15.2 - env: - working-directory: docs/spec/tla - steps: - - uses: actions/checkout@v4 - - name: IBC Core - run: apalache-mc typecheck IBCCore.tla | grep -F 'Type checker [OK]' - working-directory: ${{env.working-directory}}/ibc-core - - name: Fungible Token Transfer - run: apalache-mc typecheck IBCTokenTransfer.tla | grep -F 'Type checker [OK]' - working-directory: ${{env.working-directory}}/fungible-token-transfer - - name: ICS 02 Client / Single Chain - run: apalache-mc typecheck ICS02SingleChainEnvironment.tla | grep -F 'Type checker [OK]' - working-directory: ${{env.working-directory}}/client - - name: ICS 02 Client / Two Chains - run: apalache-mc typecheck ICS02TwoChainsEnvironment.tla | grep -F 'Type checker [OK]' - working-directory: ${{env.working-directory}}/client From 68d9f789a6b398656a2ab5424ecfcbf3cd7894e8 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 22 Dec 2023 11:40:55 +0100 Subject: [PATCH 5/7] Undo wrong typo fixes --- .github/codespell/words.txt | 2 ++ crates/relayer-types/src/core/ics02_client/trust_threshold.rs | 2 +- crates/relayer-types/src/serializers.rs | 2 +- crates/relayer/src/config/error.rs | 2 +- crates/relayer/src/config/filter.rs | 2 +- crates/relayer/src/config/proof_specs.rs | 4 ++-- crates/relayer/src/rest/error.rs | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/codespell/words.txt b/.github/codespell/words.txt index 71be76b0fc..d15ff15549 100644 --- a/.github/codespell/words.txt +++ b/.github/codespell/words.txt @@ -1,2 +1,4 @@ crate shs +ser +numer diff --git a/crates/relayer-types/src/core/ics02_client/trust_threshold.rs b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs index f2afbb315c..b2183c6f98 100644 --- a/crates/relayer-types/src/core/ics02_client/trust_threshold.rs +++ b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs @@ -66,7 +66,7 @@ impl TrustThreshold { /// The numerator of the fraction underlying this trust threshold. pub fn numerator(&self) -> u64 { - *self.0.number() + *self.0.numer() } /// The denominator of the fraction underlying this trust threshold. diff --git a/crates/relayer-types/src/serializers.rs b/crates/relayer-types/src/serializers.rs index 505f8557fa..da3cce68d1 100644 --- a/crates/relayer-types/src/serializers.rs +++ b/crates/relayer-types/src/serializers.rs @@ -1,4 +1,4 @@ -use serde::set::{Serialize, Serializer}; +use serde::ser::{Serialize, Serializer}; use subtle_encoding::{Encoding, Hex}; pub fn ser_hex_upper(data: T, serializer: S) -> Result diff --git a/crates/relayer/src/config/error.rs b/crates/relayer/src/config/error.rs index f26547629a..d2827f33c6 100644 --- a/crates/relayer/src/config/error.rs +++ b/crates/relayer/src/config/error.rs @@ -43,7 +43,7 @@ define_error! { |e| { format!("invalid compatibility mode: '{}' (supported: {})", e.compat_mode, e.valide_modes) }, Encode - [ TraceError ] + [ TraceError ] |_| { "invalid configuration" }, WrongType diff --git a/crates/relayer/src/config/filter.rs b/crates/relayer/src/config/filter.rs index 3c7c28e402..9733671b0c 100644 --- a/crates/relayer/src/config/filter.rs +++ b/crates/relayer/src/config/filter.rs @@ -199,7 +199,7 @@ impl Serialize for ChannelFilters { where S: Serializer, { - use serde::set::SerializeSeq; + use serde::ser::SerializeSeq; struct Pair<'a> { a: &'a FilterPattern, diff --git a/crates/relayer/src/config/proof_specs.rs b/crates/relayer/src/config/proof_specs.rs index 74b436dd2a..d7c7f80cce 100644 --- a/crates/relayer/src/config/proof_specs.rs +++ b/crates/relayer/src/config/proof_specs.rs @@ -2,7 +2,7 @@ use core::fmt; use ibc_relayer_types::core::ics23_commitment::specs::ProofSpecs; -use serde::{de, set, Deserializer, Serializer}; +use serde::{de, ser, Deserializer, Serializer}; pub fn serialize( proof_specs: &Option, @@ -10,7 +10,7 @@ pub fn serialize( ) -> Result { match proof_specs { Some(proof_specs) => { - let json_str = serde_json::to_string_pretty(proof_specs).map_err(set::Error::custom)?; + let json_str = serde_json::to_string_pretty(proof_specs).map_err(ser::Error::custom)?; serializer.serialize_some(&json_str) } None => serializer.serialize_none(), diff --git a/crates/relayer/src/rest/error.rs b/crates/relayer/src/rest/error.rs index c2e273f19f..f74ed10746 100644 --- a/crates/relayer/src/rest/error.rs +++ b/crates/relayer/src/rest/error.rs @@ -1,4 +1,4 @@ -use serde::set::{Serialize, SerializeMap, Serializer}; +use serde::ser::{Serialize, SerializeMap, Serializer}; use thiserror::Error; use ibc_relayer_types::core::ics24_host::{error::ValidationErrorDetail, identifier::ChainId}; From 92552c2cfff9eb6b1b0e0686256a5293e4f6bd3c Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Wed, 3 Jan 2024 10:03:31 +0100 Subject: [PATCH 6/7] Increase timeout when asserting if a channel is eventually open in tests --- tools/test-framework/src/relayer/channel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test-framework/src/relayer/channel.rs b/tools/test-framework/src/relayer/channel.rs index 29f19c9c6c..391a3b10f7 100644 --- a/tools/test-framework/src/relayer/channel.rs +++ b/tools/test-framework/src/relayer/channel.rs @@ -216,7 +216,7 @@ pub fn assert_eventually_channel_established Date: Wed, 3 Jan 2024 10:19:27 +0100 Subject: [PATCH 7/7] Fix clippy errors --- .../relayer-types/src/applications/ics31_icq/events.rs | 2 +- .../src/core/ics02_client/msgs/create_client.rs | 2 +- crates/relayer-types/src/core/ics23_commitment/merkle.rs | 9 +++++++-- crates/relayer/src/event/source/websocket/extract.rs | 2 +- crates/relayer/src/link/relay_path.rs | 2 +- crates/relayer/src/util/pretty.rs | 2 +- crates/relayer/src/worker/cross_chain_query.rs | 2 +- tools/integration-test/src/tests/client_settings.rs | 5 ++--- 8 files changed, 15 insertions(+), 11 deletions(-) diff --git a/crates/relayer-types/src/applications/ics31_icq/events.rs b/crates/relayer-types/src/applications/ics31_icq/events.rs index 307e38f1d2..739fecedba 100644 --- a/crates/relayer-types/src/applications/ics31_icq/events.rs +++ b/crates/relayer-types/src/applications/ics31_icq/events.rs @@ -101,7 +101,7 @@ fn fetch_first_element_from_events( let res = block_events .get(key) .ok_or_else(|| Error::event(format!("attribute not found for key: {key}")))? - .get(0) + .first() .ok_or_else(|| { Error::event(format!( "element at position 0, of attribute with key `{key}`, not found" diff --git a/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs b/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs index de26fde320..078bce2d31 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs @@ -95,7 +95,7 @@ mod tests { let msg = MsgCreateClient::new( tm_client_state, - TmConsensusState::try_from(tm_header).unwrap().into(), + TmConsensusState::from(tm_header).into(), signer, ) .unwrap(); diff --git a/crates/relayer-types/src/core/ics23_commitment/merkle.rs b/crates/relayer-types/src/core/ics23_commitment/merkle.rs index fb7642b319..64704c8bb2 100644 --- a/crates/relayer-types/src/core/ics23_commitment/merkle.rs +++ b/crates/relayer-types/src/core/ics23_commitment/merkle.rs @@ -138,8 +138,13 @@ impl MerkleProof { } // verify the absence of key in lowest subtree - let proof = self.proofs.get(0).ok_or_else(Error::invalid_merkle_proof)?; - let spec = ics23_specs.get(0).ok_or_else(Error::invalid_merkle_proof)?; + let proof = self + .proofs + .first() + .ok_or_else(Error::invalid_merkle_proof)?; + let spec = ics23_specs + .first() + .ok_or_else(Error::invalid_merkle_proof)?; // keys are represented from root-to-leaf let key = keys .key_path diff --git a/crates/relayer/src/event/source/websocket/extract.rs b/crates/relayer/src/event/source/websocket/extract.rs index ad8db55b6a..18f6bfa07a 100644 --- a/crates/relayer/src/event/source/websocket/extract.rs +++ b/crates/relayer/src/event/source/websocket/extract.rs @@ -171,7 +171,7 @@ pub fn extract_events( if matches!(ibc_event, IbcEvent::SendPacket(_)) { // Should be the same as the hash of tx_result.tx? if let Some(hash) = - events.get("tx.hash").and_then(|values| values.get(0)) + events.get("tx.hash").and_then(|values| values.first()) { tracing::trace!(event = "SendPacket", "tx hash: {}", hash); } diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 46bcf9ac46..df23940a91 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -513,7 +513,7 @@ impl RelayPath { .entered(); let input = events.events(); - let src_height = match input.get(0) { + let src_height = match input.first() { None => return Ok((None, None)), Some(ev) => ev.height, }; diff --git a/crates/relayer/src/util/pretty.rs b/crates/relayer/src/util/pretty.rs index 4ab24b4ba6..0b433bd289 100644 --- a/crates/relayer/src/util/pretty.rs +++ b/crates/relayer/src/util/pretty.rs @@ -111,7 +111,7 @@ pub struct PrettyFee<'a>(pub &'a Fee); impl Display for PrettyFee<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { - let amount = match self.0.amount.get(0) { + let amount = match self.0.amount.first() { Some(coin) => format!("{}{}", coin.amount, coin.denom), None => "".to_string(), }; diff --git a/crates/relayer/src/worker/cross_chain_query.rs b/crates/relayer/src/worker/cross_chain_query.rs index 96aaa633e2..811bb14b36 100644 --- a/crates/relayer/src/worker/cross_chain_query.rs +++ b/crates/relayer/src/worker/cross_chain_query.rs @@ -100,7 +100,7 @@ fn handle_cross_chain_query( let target_height = Height::new( chain_b_handle.id().version(), - cross_chain_query_responses.get(0).unwrap().height as u64, + cross_chain_query_responses.first().unwrap().height as u64, ) .map_err(|_| TaskError::Fatal(RunError::query()))? .increment(); diff --git a/tools/integration-test/src/tests/client_settings.rs b/tools/integration-test/src/tests/client_settings.rs index 2bc7ee02a3..bfd18ae66d 100644 --- a/tools/integration-test/src/tests/client_settings.rs +++ b/tools/integration-test/src/tests/client_settings.rs @@ -33,8 +33,7 @@ impl TestOverrides for ClientDefaultsTest { chain_config_a.clock_drift = Duration::from_secs(3); chain_config_a.max_block_time = Duration::from_secs(5); chain_config_a.trusting_period = Some(Duration::from_secs(120_000)); - chain_config_a.trust_threshold = - TrustThreshold::new(13, 23).unwrap().try_into().unwrap(); + chain_config_a.trust_threshold = TrustThreshold::new(13, 23).unwrap().into(); } } @@ -43,7 +42,7 @@ impl TestOverrides for ClientDefaultsTest { chain_config_b.clock_drift = Duration::from_secs(6); chain_config_b.max_block_time = Duration::from_secs(15); chain_config_b.trusting_period = Some(Duration::from_secs(340_000)); - chain_config_b.trust_threshold = TrustThreshold::TWO_THIRDS.try_into().unwrap(); + chain_config_b.trust_threshold = TrustThreshold::TWO_THIRDS.into(); } } }