diff --git a/.codespell/.codespellrc b/.codespell/.codespellrc new file mode 100644 index 0000000000..2590d26463 --- /dev/null +++ b/.codespell/.codespellrc @@ -0,0 +1,5 @@ +[codespell] +skip = .git,node_modules,yarn.lock,Cargo.lock +count = +quiet-level = 3 +ignore-words = ./.codespell/wordlist.txt diff --git a/.codespell/requirements.txt b/.codespell/requirements.txt new file mode 100644 index 0000000000..571daf3b9d --- /dev/null +++ b/.codespell/requirements.txt @@ -0,0 +1 @@ +codespell==2.2.5 \ No newline at end of file diff --git a/.codespell/wordlist.txt b/.codespell/wordlist.txt new file mode 100644 index 0000000000..0c22f82eb8 --- /dev/null +++ b/.codespell/wordlist.txt @@ -0,0 +1,2 @@ +crate +receipient diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..0220c6b92a --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,30 @@ +# A Github action that using codespell to check spell. +# .codespellrc/.codespellrc is a config file. +# .codespellrc/wordlist.txt is a list of words that will ignore word checks. +# More details please check the following link: +# https://github.com/codespell-project/codespell + +name: Codespell + +on: pull_request + +jobs: + codespell: + runs-on: ubuntu-latest + + steps: + - name: Checkout the repository + uses: actions/checkout@v4 + + - name: pip cache + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: ${{ runner.os }}-pip- + + - name: Install prerequisites + run: sudo pip install -r ./.codespellrc/requirements.txt + + - name: Spell check + run: codespell --config=./.codespellrc/.codespellrc \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 270af8975d..ba3cf6fa57 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -11,9 +11,9 @@ This CoC applies to all members of the Hyperlane Network's community including, 1. Never harass or bully anyone. Not verbally, not physically, not sexually. Harassment will not be tolerated. 2. Never discrimnate on the basis of personal characteristics or group membership. 3. Treat your fellow contributors with respect, fairness, and professionalism, especially in situations of high pressure. -4. Seek, offer, and accept objective critism of yours and others work, strive to acknowledge the contributions of others. +4. Seek, offer, and accept objective criticism of yours and others work, strive to acknowledge the contributions of others. 5. Be transparent and honest about your qualifications and any potential conflicts of interest. Transparency is a key tenant of the Hyperlane project and we expect it from all contributors. -6. Bring an open and curious mind, the Hyperlane project is designed to enable developers to express their curiousity, experiment, and build things we couldn't have imagined ourselves. +6. Bring an open and curious mind, the Hyperlane project is designed to enable developers to express their curiosity, experiment, and build things we couldn't have imagined ourselves. 7. Stay on track - Do your best to avoid off-topic discussion and make sure you are posting to the correct channel and repositories. Distractions are costly and it is far too easy for work to go off track. 8. Step down properly - Think of your fellow contributors when you step down from the project. Contributors of open-source projects come and go. It is crucial that when you leave the project or reduce your contribution significantly you do so in a way that minimizes disruption and keeps continuity in mind. Concretely this means telling your fellow contributors you are leaving and taking the proper steps to enable a smooth transition for other contributors to pick up where you left off. 9. Respect the privacy of others, and take extreme care to protect confidential data when you are exposed to it. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e838ba957b..2bbfb8b3f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing to Hyperlane -We'd love for you to contribue to Hyperlane! Here are the guidelines to follow when contributing: +We'd love for you to contribute to Hyperlane! Here are the guidelines to follow when contributing: - [Code of Conduct](#coc) - [Questions and Problems](#question) diff --git a/rust/chains/hyperlane-cosmos/src/trait_builder.rs b/rust/chains/hyperlane-cosmos/src/trait_builder.rs index 1bb3627b9d..23078f3e5e 100644 --- a/rust/chains/hyperlane-cosmos/src/trait_builder.rs +++ b/rust/chains/hyperlane-cosmos/src/trait_builder.rs @@ -15,7 +15,7 @@ pub struct ConnectionConf { chain_id: String, /// The human readable address prefix for the chains using bech32. bech32_prefix: String, - /// Canoncial Assets Denom + /// Canonical Assets Denom canonical_asset: String, /// The gas price set by the cosmos-sdk validator. Note that this represents the /// minimum price set by the validator. diff --git a/rust/hyperlane-base/src/contract_sync/cursors/sequence_aware/backward.rs b/rust/hyperlane-base/src/contract_sync/cursors/sequence_aware/backward.rs index 3dcbf7aa17..790c9f3f0f 100644 --- a/rust/hyperlane-base/src/contract_sync/cursors/sequence_aware/backward.rs +++ b/rust/hyperlane-base/src/contract_sync/cursors/sequence_aware/backward.rs @@ -640,7 +640,7 @@ mod test { let expected_range = 900..=1000; assert_eq!(range, expected_range); - // Update the cursor with some paritally bogus logs: + // Update the cursor with some partially bogus logs: // - Three logs of sequence 99, i.e. duplicated // - A log at sequence 100, which was already indexed and should be ignored cursor diff --git a/rust/hyperlane-base/src/contract_sync/cursors/sequence_aware/forward.rs b/rust/hyperlane-base/src/contract_sync/cursors/sequence_aware/forward.rs index 97b34aa40c..d97d69e87f 100644 --- a/rust/hyperlane-base/src/contract_sync/cursors/sequence_aware/forward.rs +++ b/rust/hyperlane-base/src/contract_sync/cursors/sequence_aware/forward.rs @@ -926,7 +926,7 @@ pub(crate) mod test { let expected_range = 90..=100; assert_eq!(range, expected_range); - // Update the cursor with some paritally bogus logs: + // Update the cursor with some partially bogus logs: // - A log at sequence 4, which was already indexed and should be ignored // - Three logs of sequence 5, i.e. duplicated // - A log at sequence 6, which is unexpected, but tolerated nonetheless diff --git a/rust/hyperlane-base/src/types/gcs_storage.rs b/rust/hyperlane-base/src/types/gcs_storage.rs index ebd1589a4f..fbe5c34963 100644 --- a/rust/hyperlane-base/src/types/gcs_storage.rs +++ b/rust/hyperlane-base/src/types/gcs_storage.rs @@ -97,7 +97,7 @@ impl GcsStorageClientBuilder { } impl GcsStorageClient { - // convinience formatter + // convenience formatter fn get_checkpoint_key(index: u32) -> String { format!("checkpoint_{index}_with_id.json") } diff --git a/rust/hyperlane-core/src/accumulator/merkle.rs b/rust/hyperlane-core/src/accumulator/merkle.rs index a9df396823..895b182350 100644 --- a/rust/hyperlane-core/src/accumulator/merkle.rs +++ b/rust/hyperlane-core/src/accumulator/merkle.rs @@ -14,7 +14,7 @@ use crate::{ // - remove ring dependency // In accordance with its license terms, the apache2 license is reproduced below -// Can't initialize this using `lazy_static` because of a constaint in Solana: static variables cannot be writable. +// Can't initialize this using `lazy_static` because of a constraint in Solana: static variables cannot be writable. // See the following links for more info: // https://stackoverflow.com/questions/70630344/failed-to-deploy-my-solana-smart-contract // https://docs.solana.com/developing/on-chain-programs/limitations#static-writable-data @@ -474,7 +474,7 @@ mod tests { let leaf_b11 = H256::from([0xDD; 32]); tree.push_leaf(leaf_b11, depth) - .expect("Pushing in outtermost leaf failed"); + .expect("Pushing in outermost leaf failed"); let expected_tree = MerkleTree::create(&[leaf_b00, leaf_b01, leaf_b10, leaf_b11], depth); assert_eq!(tree.hash(), expected_tree.hash()); diff --git a/rust/hyperlane-core/src/config/str_or_int.rs b/rust/hyperlane-core/src/config/str_or_int.rs index cdb2ee2f70..242d983360 100644 --- a/rust/hyperlane-core/src/config/str_or_int.rs +++ b/rust/hyperlane-core/src/config/str_or_int.rs @@ -107,7 +107,7 @@ pub enum StrOrIntParseError { /// The provided integer does not match the type requirements. #[error("Provided number is an invalid integer: {0}")] InvalidInt(#[from] TryFromIntError), - /// Some other error occured. + /// Some other error occurred. #[error("Could not parse integer: {0}")] Other(String), } diff --git a/rust/hyperlane-core/src/rpc_clients/fallback.rs b/rust/hyperlane-core/src/rpc_clients/fallback.rs index 6f75cbc4c8..38d2668937 100644 --- a/rust/hyperlane-core/src/rpc_clients/fallback.rs +++ b/rust/hyperlane-core/src/rpc_clients/fallback.rs @@ -234,7 +234,7 @@ impl FallbackProviderBuilder { } /// Only used for testing purposes. - /// TODO: Move tests into this crate to control the visiblity with conditional compilation. + /// TODO: Move tests into this crate to control the visibility with conditional compilation. pub fn with_max_block_time(mut self, max_block_time: Duration) -> Self { self.max_block_time = max_block_time; self diff --git a/rust/hyperlane-core/src/traits/validator_announce.rs b/rust/hyperlane-core/src/traits/validator_announce.rs index 91ad55abfb..b8f672218a 100644 --- a/rust/hyperlane-core/src/traits/validator_announce.rs +++ b/rust/hyperlane-core/src/traits/validator_announce.rs @@ -24,6 +24,6 @@ pub trait ValidatorAnnounce: HyperlaneContract + Send + Sync + Debug { ) -> ChainResult; /// Returns the number of additional tokens needed to pay for the announce - /// transaction. Return `None` if the needed tokens canno tbe determined. + /// transaction. Return `None` if the needed tokens canno the determined. async fn announce_tokens_needed(&self, announcement: SignedType) -> Option; } diff --git a/rust/sealevel/programs/mailbox/src/processor.rs b/rust/sealevel/programs/mailbox/src/processor.rs index 9d4e133960..ce4797b39b 100644 --- a/rust/sealevel/programs/mailbox/src/processor.rs +++ b/rust/sealevel/programs/mailbox/src/processor.rs @@ -377,7 +377,7 @@ fn inbox_process( .map_err(|e| ProgramError::BorshIoError(e.to_string()))?; // Now call into the recipient program with the verified message! - let handle_intruction = Instruction::new_with_bytes( + let handle_instruction = Instruction::new_with_bytes( recipient_program_id, &MessageRecipientInstruction::Handle(HandleInstruction::new( message.origin, @@ -388,7 +388,7 @@ fn inbox_process( recipient_account_metas, ); invoke_signed( - &handle_intruction, + &handle_instruction, &recipient_infos, &[mailbox_process_authority_pda_seeds!( &recipient_program_id, diff --git a/solidity/contracts/isms/ccip-read/AbstractCcipReadIsm.sol b/solidity/contracts/isms/ccip-read/AbstractCcipReadIsm.sol index ca5de0a62a..df6da22c73 100644 --- a/solidity/contracts/isms/ccip-read/AbstractCcipReadIsm.sol +++ b/solidity/contracts/isms/ccip-read/AbstractCcipReadIsm.sol @@ -12,7 +12,7 @@ import {AbstractMultisigIsm} from "../multisig/AbstractMultisigIsm.sol"; * @title AbstractCcipReadIsm * @notice An ISM that allows arbitrary payloads to be submitted and verified on chain * @dev https://eips.ethereum.org/EIPS/eip-3668 - * @dev The AbstractCcipReadIsm provided by Hyperlane is left intentially minimalist as + * @dev The AbstractCcipReadIsm provided by Hyperlane is left intentionally minimalist as * the range of applications that could be supported by a CcipReadIsm are so broad. However * there are few things to note when building a custom CcipReadIsm. * diff --git a/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol b/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol index 2f9caf8a3f..fc10ac8629 100644 --- a/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol +++ b/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol @@ -27,7 +27,7 @@ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Ini /** * @title AbstractMessageIdAuthorizedIsm - * @notice Uses external verfication options to verify interchain messages which need a authorized caller + * @notice Uses external verification options to verify interchain messages which need a authorized caller */ abstract contract AbstractMessageIdAuthorizedIsm is IInterchainSecurityModule, diff --git a/solidity/contracts/token/extensions/HypNativeScaled.sol b/solidity/contracts/token/extensions/HypNativeScaled.sol index 34b1e3ce45..53018c4a75 100644 --- a/solidity/contracts/token/extensions/HypNativeScaled.sol +++ b/solidity/contracts/token/extensions/HypNativeScaled.sol @@ -34,7 +34,7 @@ contract HypNativeScaled is HypNative { } /** - * @dev Sends scaled `_amount` (multipled by `scale`) to `_recipient`. + * @dev Sends scaled `_amount` (multiplied by `scale`) to `_recipient`. * @inheritdoc TokenRouter */ function _transferTo( diff --git a/solidity/contracts/token/libs/FastTokenRouter.sol b/solidity/contracts/token/libs/FastTokenRouter.sol index 6b30cdf1de..f9b24ede84 100644 --- a/solidity/contracts/token/libs/FastTokenRouter.sol +++ b/solidity/contracts/token/libs/FastTokenRouter.sol @@ -56,7 +56,7 @@ abstract contract FastTokenRouter is TokenRouter { /** * @dev allows an external user to full an unfilled fast transfer order. - * @param _recipient The recepient of the wrapped token on base chain. + * @param _recipient The recipient of the wrapped token on base chain. * @param _amount The amount of wrapped tokens that is being bridged. * @param _fastFee The fee the bridging entity will pay. * @param _fastTransferId Id assigned on the remote chain to uniquely identify the transfer. @@ -82,7 +82,7 @@ abstract contract FastTokenRouter is TokenRouter { filledFastTransfers[filledFastTransfersKey] = msg.sender; - _fastRecieveFrom(msg.sender, _amount - _fastFee); + _fastReciveFrom(msg.sender, _amount - _fastFee); _fastTransferTo(_recipient, _amount - _fastFee); } @@ -126,13 +126,13 @@ abstract contract FastTokenRouter is TokenRouter { uint256 _fastFee, uint256 _fastTransferId ) internal virtual returns (bytes memory) { - _fastRecieveFrom(msg.sender, _amount); + _fastReciveFrom(msg.sender, _amount); return abi.encode(_fastFee, _fastTransferId); } /** - * @dev returns an address that indicates who should recieve the bridged tokens. - * @dev if _fastFees was inlcuded and someone filled the order before the mailbox made the contract call, the filler gets the funds. + * @dev returns an address that indicates who should receive the bridged tokens. + * @dev if _fastFees was included and someone filled the order before the mailbox made the contract call, the filler gets the funds. */ function _getTokenRecipient( address _recipient, @@ -201,7 +201,7 @@ abstract contract FastTokenRouter is TokenRouter { * @dev Should collect `amount` of tokens from `_sender`. * @dev The implementation is delegated. */ - function _fastRecieveFrom( + function _fastReciveFrom( address _sender, uint256 _amount ) internal virtual; diff --git a/solidity/test/LiquidityLayerRouter.t.sol b/solidity/test/LiquidityLayerRouter.t.sol index fcf3437ed8..410f9c82df 100644 --- a/solidity/test/LiquidityLayerRouter.t.sol +++ b/solidity/test/LiquidityLayerRouter.t.sol @@ -134,7 +134,7 @@ contract LiquidityLayerRouterTest is Test { // ==== dispatchWithTokens ==== - function testDispatchWithTokensRevertsWithUnkownBridgeAdapter() public { + function testDispatchWithTokensRevertsWithUnknownBridgeAdapter() public { vm.expectRevert("No adapter found for bridge"); originLiquidityLayerRouter.dispatchWithTokens( destinationDomain, diff --git a/solidity/test/isms/OPStackIsm.t.sol b/solidity/test/isms/OPStackIsm.t.sol index 3066d7bda7..75b72f812d 100644 --- a/solidity/test/isms/OPStackIsm.t.sol +++ b/solidity/test/isms/OPStackIsm.t.sol @@ -270,7 +270,7 @@ contract OPStackIsmTest is Test { vm.selectFork(optimismFork); - // needs to be called by the cannonical messenger on Optimism + // needs to be called by the canonical messenger on Optimism vm.expectRevert(NotCrossChainCall.selector); opISM.verifyMessageId(messageId); diff --git a/solidity/test/middleware/liquidity-layer/PortalAdapter.t.sol b/solidity/test/middleware/liquidity-layer/PortalAdapter.t.sol index 656fd66bea..de13a86e00 100644 --- a/solidity/test/middleware/liquidity-layer/PortalAdapter.t.sol +++ b/solidity/test/middleware/liquidity-layer/PortalAdapter.t.sol @@ -60,7 +60,7 @@ contract PortalAdapterTest is Test { function testAdapter(uint256 amount) public { // Transfers of 0 are invalid vm.assume(amount > 0); - // Calls MockPortalBridge with the right paramters + // Calls MockPortalBridge with the right parameters vm.expectCall( address(portalBridge), abi.encodeCall( diff --git a/solidity/test/token/HypNativeScaled.t.sol b/solidity/test/token/HypNativeScaled.t.sol index 09865606af..2f219d8860 100644 --- a/solidity/test/token/HypNativeScaled.t.sol +++ b/solidity/test/token/HypNativeScaled.t.sol @@ -118,7 +118,7 @@ contract HypNativeScaledTest is Test { environment.processNextPendingMessage(); } - function test_tranferRemote(uint256 amount) public { + function test_transferRemote(uint256 amount) public { vm.assume(amount <= mintAmount); uint256 nativeValue = amount * (10 ** nativeDecimals); diff --git a/typescript/ccip-server/src/server.ts b/typescript/ccip-server/src/server.ts index ddd2fa330d..0f69c499f4 100644 --- a/typescript/ccip-server/src/server.ts +++ b/typescript/ccip-server/src/server.ts @@ -4,7 +4,7 @@ import { ProofsServiceAbi } from './abis/ProofsServiceAbi'; import * as config from './config'; import { ProofsService } from './services/ProofsService'; -// Initalize Services +// Initialize Services const proofsService = new ProofsService( config.LIGHT_CLIENT_ADDR, config.RPC_ADDRESS, @@ -14,7 +14,7 @@ const proofsService = new ProofsService( config.SUCCINCT_API_KEY, ); -// Initalize Server and add Service handlers +// Initialize Server and add Service handlers const server = new Server(); server.add(ProofsServiceAbi, [ diff --git a/typescript/ccip-server/src/services/LightClientService.ts b/typescript/ccip-server/src/services/LightClientService.ts index 3d5238b94b..f3aae5b097 100644 --- a/typescript/ccip-server/src/services/LightClientService.ts +++ b/typescript/ccip-server/src/services/LightClientService.ts @@ -34,7 +34,7 @@ class LightClientService { } /** - * Calculates the slot given a timestamp, and the LightClient's configured Genesis Time and Secods Per Slot + * Calculates the slot given a timestamp, and the LightClient's configured Genesis Time and Seconds Per Slot * @param timestamp timestamp to calculate slot with */ async calculateSlot(timestamp: bigint): Promise { diff --git a/typescript/infra/src/infrastructure/external-secrets/helm/README.md b/typescript/infra/src/infrastructure/external-secrets/helm/README.md index 34c36446f2..bfef095591 100644 --- a/typescript/infra/src/infrastructure/external-secrets/helm/README.md +++ b/typescript/infra/src/infrastructure/external-secrets/helm/README.md @@ -26,6 +26,6 @@ Regardless, workload identities are a more attractive long-term option, and movi ## What is external-secrets? -The [documentation](https://external-secrets.io/v0.4.4/) is the best source. In short, it allows Kuberenetes Secrets to get their secrets from an external secret provided (like GCP's Secret Manager), all without a developer/deployer needing to touch the secrets themselves. +The [documentation](https://external-secrets.io/v0.4.4/) is the best source. In short, it allows Kubernetes Secrets to get their secrets from an external secret provided (like GCP's Secret Manager), all without a developer/deployer needing to touch the secrets themselves. The general idea is there are `SecretStore`s (or `ClusterSecretStore`s, which are the cluster-wide version), that specify how the cluster can authenticate with the external secret provider. `ExternalSecret`s can then be specified in "application" infrastructure, which allow developers to specify a template for a Secret that will be created using the secret values from the external provider (& using the credentials from the SecretStore). diff --git a/typescript/sdk/src/core/CoreDeployer.hardhat-test.ts b/typescript/sdk/src/core/CoreDeployer.hardhat-test.ts index 8bcc44d20f..153524436b 100644 --- a/typescript/sdk/src/core/CoreDeployer.hardhat-test.ts +++ b/typescript/sdk/src/core/CoreDeployer.hardhat-test.ts @@ -146,7 +146,7 @@ describe('core', async () => { sinon.restore(); // restore normal deployer behavior and test3 will be deployed const result = await deployer.deploy(coreConfig); expect(result).to.have.keys(['test1', 'test2', 'test3']); - // Each test network key has entries about the other test networks, whre ISM details are stored. + // Each test network key has entries about the other test networks, where ISM details are stored. // With this exception, the keys should be the same, so we check the intersections for equality. const testnetKeysIntersection = Object.keys(result.test1).filter( (key) => diff --git a/typescript/sdk/src/core/HyperlaneCoreChecker.ts b/typescript/sdk/src/core/HyperlaneCoreChecker.ts index b1e3fabd67..355f661b6a 100644 --- a/typescript/sdk/src/core/HyperlaneCoreChecker.ts +++ b/typescript/sdk/src/core/HyperlaneCoreChecker.ts @@ -120,8 +120,8 @@ export class HyperlaneCoreChecker extends HyperlaneAppChecker< ], (bytecode) => // This is obviously super janky but basically we are searching - // for the ocurrences of localDomain in the bytecode and remove - // that to compare, but some coincidental ocurrences of + // for the occurrences of localDomain in the bytecode and remove + // that to compare, but some coincidental occurrences of // localDomain in the bytecode should be not be removed which // are just done via an offset guard bytecode diff --git a/typescript/sdk/src/deploy/verify/ContractVerifier.ts b/typescript/sdk/src/deploy/verify/ContractVerifier.ts index ea9fda3161..e3810b66c4 100644 --- a/typescript/sdk/src/deploy/verify/ContractVerifier.ts +++ b/typescript/sdk/src/deploy/verify/ContractVerifier.ts @@ -241,7 +241,7 @@ export class ContractVerifier { contractname: `${sourceName}:${input.name}`, contractaddress: input.address, // TYPO IS ENFORCED BY API - constructorArguements: strip0x(input.constructorArguments ?? ''), + constructorArguments: strip0x(input.constructorArguments ?? ''), ...this.compilerOptions, }; diff --git a/typescript/sdk/src/deploy/verify/types.ts b/typescript/sdk/src/deploy/verify/types.ts index 442ad5e370..77ad92f2c9 100644 --- a/typescript/sdk/src/deploy/verify/types.ts +++ b/typescript/sdk/src/deploy/verify/types.ts @@ -78,7 +78,7 @@ export type FormOptions = contractaddress: string; sourceCode: string; contractname: string; - constructorArguements?: string; // TYPO IS ENFORCED BY API + constructorArguments?: string; // TYPO IS ENFORCED BY API } : Action extends ExplorerApiActions.MARK_PROXY ? {