From 47732520c687b6bbca93081c75c2881eb3bc67c0 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 9 Aug 2024 11:54:23 +0200 Subject: [PATCH] chore: Fix all typos --- CHANGELOG.md | 10 +++++----- docs/architecture/adr-002-light-client-adr-index.md | 2 +- docs/spec/lightclient/detection/detection.md | 2 +- docs/spec/lightclient/verification/verification.md | 2 +- docs/spec/tendermint-fork-cases/README.md | 2 +- .../tendermint-fork-cases/TendermintAcc_004_draft.tla | 2 +- light-client-detector/src/detect.rs | 2 +- light-client-detector/src/evidence.rs | 2 +- light-client-verifier/src/operations/voting_power.rs | 2 +- light-client/src/light_client.rs | 2 +- pbt-gen/src/time.rs | 4 ++-- proto/src/prost/v0_34/tendermint.crypto.rs | 2 +- proto/src/prost/v0_34/tendermint.types.rs | 2 +- proto/src/prost/v0_37/tendermint.crypto.rs | 2 +- proto/src/prost/v0_37/tendermint.types.rs | 2 +- proto/src/prost/v0_38/tendermint.abci.rs | 2 +- proto/src/prost/v0_38/tendermint.crypto.rs | 2 +- proto/src/prost/v0_38/tendermint.state.rs | 2 +- tendermint/src/merkle/proof.rs | 2 +- tendermint/src/vote/sign_vote.rs | 2 +- testgen/src/tester.rs | 4 ++-- 21 files changed, 27 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index beff85438..804234f6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -110,7 +110,7 @@ Additionally, this release fixes a couple of issues with the `serde`-based deser *April 25th, 2024* -This release brings substantial performance improvements to the voting power computation within the light client, improves the handling of misformed blocks (eg. with empty `last_commit` on non-first block) when decoding them from Protobuf or RPC responses, and adds missing `serde` derives on some Protobuf definitions. +This release brings substantial performance improvements to the voting power computation within the light client, improves the handling of malformed blocks (eg. with empty `last_commit` on non-first block) when decoding them from Protobuf or RPC responses, and adds missing `serde` derives on some Protobuf definitions. This release also technically contains a breaking change in `tendermint-proto`, but this should not impact normal use of the library, as the `ToPrimitive` impl that was removed on `BlockIdFlag` trait did not provide any additional functionality. @@ -153,7 +153,7 @@ This release also technically contains a breaking change in `tendermint-proto`, ### IMPROVEMENTS -- `[tendermint]` Allow misformed blocks (eg. with empty `last_commit` +- `[tendermint]` Allow malformed blocks (eg. with empty `last_commit` on non-first block) when decoding them from Protobuf or RPC responses ([\#1403](https://github.com/informalsystems/tendermint-rs/issues/1403)) - `[tendermint]` Check `index ≤ i32::MAX` invariant when converting `usize` @@ -309,7 +309,7 @@ CometBFT data types are serialized and deserialized. - `[tendermint-proto]` In the `Deserialize` impls derived for `v*::types::ValidatorSet`, the `total_voting_power` field value is retrieved when present. -- `[tendermint-proto]` Add serialziation helper module +- `[tendermint-proto]` Add serialization helper module `serializers::from_str_allow_null`. Use it to allow the `proposed_priority` field value of null in the deserialization of `v*::types::Validator`. - Corrected custom serializer helpers to consistently produce the format @@ -342,8 +342,8 @@ are exposed to the client. * Change the `abci::Request` and `abci::Response` reexports to use the enums defined in `v0_38`. - `[tendermint]` Define version-specific categorized request/response enums: - `ConsensusRequest`, `MempoolRequest`, `InfoRequest`, `ShapshotRequest`, - `ConsensusResponse`, `MempoolResponse`, `InfoResponse`, `ShapshotResponse`, + `ConsensusRequest`, `MempoolRequest`, `InfoRequest`, `SnapshotRequest`, + `ConsensusResponse`, `MempoolResponse`, `InfoResponse`, `SnapshotResponse`, in each of the `v0_*::abci` modules, so that the variants are trimmed to the requests/responses used by the respective protocol version. Reexport the types from `v0_38::abci` as aliases for these names in the diff --git a/docs/architecture/adr-002-light-client-adr-index.md b/docs/architecture/adr-002-light-client-adr-index.md index cbac2a2d4..8733c304d 100644 --- a/docs/architecture/adr-002-light-client-adr-index.md +++ b/docs/architecture/adr-002-light-client-adr-index.md @@ -30,7 +30,7 @@ the core verification library to verify this data, and updates its state accordi It also makes requests to other full nodes to detect and report on forks. That said, as much as possible, we would like the implementation here to be -reusable for the IBC protocol, which supports communiction between blockchains. +reusable for the IBC protocol, which supports communication between blockchains. In this case, instead of making RPC requests, IBC-enabled blockchains receive the relevant data in transactions and verify it using the same core verification library. Thus implementations should abstract over the source of data as necessary. diff --git a/docs/spec/lightclient/detection/detection.md b/docs/spec/lightclient/detection/detection.md index 7149c886a..f31837077 100644 --- a/docs/spec/lightclient/detection/detection.md +++ b/docs/spec/lightclient/detection/detection.md @@ -36,7 +36,7 @@ sample is chosen at random, this adds a level of probabilistic reasoning.) If conflicting headers are found, they are evidence that can be used for punishing processes. -In this document we will focus onn strengthening the light client, and +In this document we will focus on strengthening the light client, and leave other uses of the detection mechanism (e.g., when run on a full node) to the future. diff --git a/docs/spec/lightclient/verification/verification.md b/docs/spec/lightclient/verification/verification.md index b1920422b..be0e533cb 100644 --- a/docs/spec/lightclient/verification/verification.md +++ b/docs/spec/lightclient/verification/verification.md @@ -557,7 +557,7 @@ func (ls LightStore) LatestVerified() LightBlock #### **[LCV-FUNC-UPDATE.1]**: ```go -func (ls LightStore) Update(lightBlock LightBlock, verfiedState VerifiedState) +func (ls LightStore) Update(lightBlock LightBlock, verifiedState VerifiedState) ``` - Expected postcondition - The state of the LightBlock is set to *verifiedState*. diff --git a/docs/spec/tendermint-fork-cases/README.md b/docs/spec/tendermint-fork-cases/README.md index c3fd89f1d..952c741c1 100644 --- a/docs/spec/tendermint-fork-cases/README.md +++ b/docs/spec/tendermint-fork-cases/README.md @@ -8,7 +8,7 @@ - this specification focuses on safety, so timeouts are modelled with with non-determinism - - the proposer function is non-determinstic, no fairness is assumed + - the proposer function is non-deterministic, no fairness is assumed - the messages by the faulty processes are injected right in the initial states diff --git a/docs/spec/tendermint-fork-cases/TendermintAcc_004_draft.tla b/docs/spec/tendermint-fork-cases/TendermintAcc_004_draft.tla index bb214bf9b..5fafa6a30 100644 --- a/docs/spec/tendermint-fork-cases/TendermintAcc_004_draft.tla +++ b/docs/spec/tendermint-fork-cases/TendermintAcc_004_draft.tla @@ -8,7 +8,7 @@ - this specification focuses on safety, so timeouts are modelled with non-determinism - - the proposer function is non-determinstic, no fairness is assumed + - the proposer function is non-deterministic, no fairness is assumed - the messages by the faulty processes are injected right in the initial states diff --git a/light-client-detector/src/detect.rs b/light-client-detector/src/detect.rs index 6f4e7c030..52c7aed05 100644 --- a/light-client-detector/src/detect.rs +++ b/light-client-detector/src/detect.rs @@ -111,7 +111,7 @@ where } } -/// An error that arised when comparing a header from the primary with a header from a witness +/// An error that arose when comparing a header from the primary with a header from a witness /// with [`compare_new_header_with_witness`]. #[derive(Debug)] pub enum CompareError { diff --git a/light-client-detector/src/evidence.rs b/light-client-detector/src/evidence.rs index 717bc71b0..9c7bcfae1 100644 --- a/light-client-detector/src/evidence.rs +++ b/light-client-detector/src/evidence.rs @@ -46,7 +46,7 @@ pub fn make_evidence( } } -/// Take a trusted header and match it againt a conflicting header +/// Take a trusted header and match it against a conflicting header /// to determine whether the conflicting header was the product of a valid state transition /// or not. If it is then all the deterministic fields of the header should be the same. /// If not, it is an invalid header and constitutes a lunatic attack. diff --git a/light-client-verifier/src/operations/voting_power.rs b/light-client-verifier/src/operations/voting_power.rs index 8feba60f2..cb10f2d8e 100644 --- a/light-client-verifier/src/operations/voting_power.rs +++ b/light-client-verifier/src/operations/voting_power.rs @@ -149,7 +149,7 @@ pub trait VotingPowerCalculator: Send + Sync { /// validator sets. /// /// This is equivalent to calling [`Self::voting_power_in`] on each set - /// separately but may be more optimised. Implementators are encouraged to + /// separately but may be more optimised. Implementers are encouraged to /// write a properly optimised method which avoids checking the same /// signature twice but for a simple unoptimised implementation the /// following works: diff --git a/light-client/src/light_client.rs b/light-client/src/light_client.rs index eabca1750..9403d876c 100644 --- a/light-client/src/light_client.rs +++ b/light-client/src/light_client.rs @@ -340,7 +340,7 @@ impl LightClient { // `latest` and `current` are linked together by `last_block_id`, // therefore it is not relevant which we verified first. - // For consistency, we say that `latest` was verifed using + // For consistency, we say that `latest` was verified using // `current` so that the trace is always pointing down the chain. state.light_store.insert(current.clone(), Status::Trusted); state.light_store.insert(latest.clone(), Status::Trusted); diff --git a/pbt-gen/src/time.rs b/pbt-gen/src/time.rs index 19e22bdd1..e5235cb88 100644 --- a/pbt-gen/src/time.rs +++ b/pbt-gen/src/time.rs @@ -66,7 +66,7 @@ fn num_days_in_month(year: i32, month: u8) -> u8 { } prop_compose! { - /// An abitrary [`OffsetDateTime`], offset in UTC, + /// An arbitrary [`OffsetDateTime`], offset in UTC, /// that is between the given `min` and `max`. /// /// # Examples @@ -150,7 +150,7 @@ prop_compose! { } prop_compose! { - /// An abitrary [`UtcOffset`]. + /// An arbitrary [`UtcOffset`]. pub fn arb_utc_offset() ( off in prop_oneof![ diff --git a/proto/src/prost/v0_34/tendermint.crypto.rs b/proto/src/prost/v0_34/tendermint.crypto.rs index b62f77775..a38516db3 100644 --- a/proto/src/prost/v0_34/tendermint.crypto.rs +++ b/proto/src/prost/v0_34/tendermint.crypto.rs @@ -37,7 +37,7 @@ pub struct DominoOp { pub output: ::prost::alloc::string::String, } /// ProofOp defines an operation used for calculating Merkle root -/// The data could be arbitrary format, providing nessecary data +/// The data could be arbitrary format, providing necessary data /// for example neighbouring node hash #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/proto/src/prost/v0_34/tendermint.types.rs b/proto/src/prost/v0_34/tendermint.types.rs index 09aade6a2..3d3db80f5 100644 --- a/proto/src/prost/v0_34/tendermint.types.rs +++ b/proto/src/prost/v0_34/tendermint.types.rs @@ -271,7 +271,7 @@ pub struct TxProof { #[prost(message, optional, tag = "3")] pub proof: ::core::option::Option, } -/// BlockIdFlag indicates which BlcokID the signature is for +/// BlockIdFlag indicates which BlockID the signature is for #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum BlockIdFlag { diff --git a/proto/src/prost/v0_37/tendermint.crypto.rs b/proto/src/prost/v0_37/tendermint.crypto.rs index b62f77775..a38516db3 100644 --- a/proto/src/prost/v0_37/tendermint.crypto.rs +++ b/proto/src/prost/v0_37/tendermint.crypto.rs @@ -37,7 +37,7 @@ pub struct DominoOp { pub output: ::prost::alloc::string::String, } /// ProofOp defines an operation used for calculating Merkle root -/// The data could be arbitrary format, providing nessecary data +/// The data could be arbitrary format, providing necessary data /// for example neighbouring node hash #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/proto/src/prost/v0_37/tendermint.types.rs b/proto/src/prost/v0_37/tendermint.types.rs index a34889656..4cc1e41e3 100644 --- a/proto/src/prost/v0_37/tendermint.types.rs +++ b/proto/src/prost/v0_37/tendermint.types.rs @@ -271,7 +271,7 @@ pub struct TxProof { #[prost(message, optional, tag = "3")] pub proof: ::core::option::Option, } -/// BlockIdFlag indicates which BlcokID the signature is for +/// BlockIdFlag indicates which BlockID the signature is for #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum BlockIdFlag { diff --git a/proto/src/prost/v0_38/tendermint.abci.rs b/proto/src/prost/v0_38/tendermint.abci.rs index e97cd43c9..02479a7fa 100644 --- a/proto/src/prost/v0_38/tendermint.abci.rs +++ b/proto/src/prost/v0_38/tendermint.abci.rs @@ -702,7 +702,7 @@ pub mod response_verify_vote_extension { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseFinalizeBlock { - /// set of block events emmitted as part of executing the block + /// set of block events emitted as part of executing the block #[prost(message, repeated, tag = "1")] pub events: ::prost::alloc::vec::Vec, /// the result of executing each transaction including the events diff --git a/proto/src/prost/v0_38/tendermint.crypto.rs b/proto/src/prost/v0_38/tendermint.crypto.rs index b62f77775..a38516db3 100644 --- a/proto/src/prost/v0_38/tendermint.crypto.rs +++ b/proto/src/prost/v0_38/tendermint.crypto.rs @@ -37,7 +37,7 @@ pub struct DominoOp { pub output: ::prost::alloc::string::String, } /// ProofOp defines an operation used for calculating Merkle root -/// The data could be arbitrary format, providing nessecary data +/// The data could be arbitrary format, providing necessary data /// for example neighbouring node hash #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/proto/src/prost/v0_38/tendermint.state.rs b/proto/src/prost/v0_38/tendermint.state.rs index a286f0155..4d3a412cf 100644 --- a/proto/src/prost/v0_38/tendermint.state.rs +++ b/proto/src/prost/v0_38/tendermint.state.rs @@ -1,7 +1,7 @@ // This file is @generated by prost-build. /// LegacyABCIResponses retains the responses /// of the legacy ABCI calls during block processing. -/// Note ReponseDeliverTx is renamed to ExecTxResult but they are semantically the same +/// Note ResponseDeliverTx is renamed to ExecTxResult but they are semantically the same /// Kept for backwards compatibility for versions prior to v0.38 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/tendermint/src/merkle/proof.rs b/tendermint/src/merkle/proof.rs index 903c1471c..bd2e723d5 100644 --- a/tendermint/src/merkle/proof.rs +++ b/tendermint/src/merkle/proof.rs @@ -150,7 +150,7 @@ mod test { "ops": [ { "type": "iavl:v", - "key": "Y29uc2Vuc3VzU3RhdGUvaWJjb25lY2xpZW50LzIy", + "key": "Y29uc2Vuc3VzU3RhdGUvaWJjb25lY2xpZW50LzIt", "data": "8QEK7gEKKAgIEAwYHCIgG9RAkJgHlxNjmyzOW6bUAidhiRSja0x6+GXCVENPG1oKKAgGEAUYFyIgwRns+dJvjf1Zk2BaFrXz8inPbvYHB7xx2HCy9ima5f8KKAgEEAMYFyogOr8EGajEV6fG5fzJ2fAAvVMgRLhdMJTzCPlogl9rxlIKKAgCEAIYFyIgcjzX/a+2bFbnNldpawQqZ+kYhIwz5r4wCUzuu1IFW04aRAoeY29uc2Vuc3VzU3RhdGUvaWJjb25lY2xpZW50LzIyEiAZ1uuG60K4NHJZZMuS9QX6o4eEhica5jIHYwflRiYkDBgX" }, { diff --git a/tendermint/src/vote/sign_vote.rs b/tendermint/src/vote/sign_vote.rs index 2077634ec..c814c87a2 100644 --- a/tendermint/src/vote/sign_vote.rs +++ b/tendermint/src/vote/sign_vote.rs @@ -423,7 +423,7 @@ mod tests { } #[test] - fn test_vote_rountrip_with_sig() { + fn test_vote_roundtrip_with_sig() { let dt = datetime!(2017-12-25 03:00:01.234 UTC); let vote = Vote { validator_address: AccountId::try_from(vec![ diff --git a/testgen/src/tester.rs b/testgen/src/tester.rs index 6639f8efd..c3053e98a 100644 --- a/testgen/src/tester.rs +++ b/testgen/src/tester.rs @@ -378,7 +378,7 @@ impl Tester { tests } - pub fn unparseable_tests(&self) -> Vec { + pub fn unparsable_tests(&self) -> Vec { let mut tests = Vec::new(); if let Some(results) = self.results.get("") { for (path, res) in results { @@ -522,7 +522,7 @@ impl Tester { print(&format!(" {path}")) } } - let tests = self.unparseable_tests(); + let tests = self.unparsable_tests(); if !tests.is_empty() { do_panic = true; print("\nUnparseable tests: ");