diff --git a/.codespell/.codespellrc b/.codespell/.codespellrc new file mode 100644 index 0000000000..b5065253a3 --- /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 \ No newline at end of file diff --git a/.codespell/wordlist.txt b/.codespell/wordlist.txt new file mode 100644 index 0000000000..1a22196e02 --- /dev/null +++ b/.codespell/wordlist.txt @@ -0,0 +1 @@ +crate \ No newline at end of file diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..6aa68d12cc --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,30 @@ +# A Github action that using codespell to check spell. +# .codespell/.codespellrc is a config file. +# .codespell/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('**/*.py') }} + restore-keys: ${{ runner.os }}-pip- + + - name: Install Codespell + run: sudo pip install codespell==2.2.5 + + - name: Spell check + run: codespell --config=./.codespell/.codespellrc diff --git a/design/bridge/bridge_design.md b/design/bridge/bridge_design.md index ef5a40ce03..8ffc2f3b65 100644 --- a/design/bridge/bridge_design.md +++ b/design/bridge/bridge_design.md @@ -214,7 +214,7 @@ When publishing a message on the Ten L2, storing the message will have a direct **Assumption: Ten DAO** will vote and set the following properties: * `fixedMessageStoringCost` - this is the gas cost for storing the fixed-size properties of the message -* `dynamicCostPerByte` - this is the gas cost per byte for storing the dinamically sized data - `bytes payload`, `bytes topic` +* `dynamicCostPerByte` - this is the gas cost per byte for storing the dynamically sized data - `bytes payload`, `bytes topic` > **_NOTE:_** This whole section might change based on the outcome of the Ten fees & rewards design. It only outlines a potential solution. diff --git a/design/scratchpad/Design_escape_hatch.md b/design/scratchpad/Design_escape_hatch.md index 48c33dd699..2e3b5d4dd1 100644 --- a/design/scratchpad/Design_escape_hatch.md +++ b/design/scratchpad/Design_escape_hatch.md @@ -44,12 +44,12 @@ This hash is the root hash of the Patricia Merkle State of that asset. When the escape mode is triggered, the bridge contract will load up the roots from the latest rollup, and will start accepting user requests. -Each user request must be a Merkle proof where the leafs are ``(account,balance)`` with a valid chain to the root of tha asset. +Each user request must be a Merkle proof where the leaves are ``(account,balance)`` with a valid chain to the root of tha asset. The bridge will be happy to release that amount to the same account after verifying the merkle proof. *Note that this means that the request doesn't have to be signed because the balance is credited to the same account as in the L2* -Any user who knows the acount and the balance for a certain asset, should be able to just create a transaction (maybe with the help of some tooling), and +Any user who knows the account and the balance for a certain asset, should be able to just create a transaction (maybe with the help of some tooling), and retrieve their funds. *Note that the state root hashes should reflect the state after the withdrawal instructions from the rollup header.* diff --git a/design/ux/Ten_Gateway.md b/design/ux/Ten_Gateway.md index 5a2a4b1c00..303325f1bd 100644 --- a/design/ux/Ten_Gateway.md +++ b/design/ux/Ten_Gateway.md @@ -10,7 +10,7 @@ The TG will be a [Confidential Web Service](https://medium.com/p/983a2a67fc08), The current WE is designed to be used by a single user holding multiple addresses across potentially multiple wallets. -The TG must support mutiple users, each with multiple addresses. It can be seen as offering a WE per user. +The TG must support multiple users, each with multiple addresses. It can be seen as offering a WE per user. The Ten node has no concept of "User". It only authenticates based on the "blockchain address". It expects to be supplied with a signed viewing key per address, so that it can respond encrypted with that VK. @@ -190,14 +190,14 @@ After signing it will submit to the server ## Multitenancy -The curent WE is single-tenant. It assumes that all registered blockchain addresses belong to the same user. +The current WE is single-tenant. It assumes that all registered blockchain addresses belong to the same user. The TG will keep a many-to-one relationship between addresses and users. It will have multiple users, each with multiple addresses. Each request to the TG (except "/join") must have the "u" query parameter. The first thing, the WE will lookup the encryption token and then operate in "Wallet Extension" mode, after loading all addresses. -Note that the system considers the realm of an encryption token as completely independent. Multiple users could register the same addrss, +Note that the system considers the realm of an encryption token as completely independent. Multiple users could register the same address, if they somehow control the spending key. It shouldn't matter since they have different encryption tokens diff --git a/design/ux/user_data_incentives.md b/design/ux/user_data_incentives.md index d9495edc7a..b1f03e79f0 100644 --- a/design/ux/user_data_incentives.md +++ b/design/ux/user_data_incentives.md @@ -102,7 +102,7 @@ This wrapper will then be gossiped to the other nodes accompanied by the signed ##### Outstanding problems to solve -Problem 1: a malicious or malfunctioning wallet extension could submit the same transction wrapped for multiple nodes. +Problem 1: a malicious or malfunctioning wallet extension could submit the same transaction wrapped for multiple nodes. This is not a major problem because the incentives to do this are not large Problem 2: how to include the transactions in the rollup. diff --git a/go/common/gethencoding/geth_encoding.go b/go/common/gethencoding/geth_encoding.go index be0d26d165..9fa110eab9 100644 --- a/go/common/gethencoding/geth_encoding.go +++ b/go/common/gethencoding/geth_encoding.go @@ -133,7 +133,7 @@ func ExtractAddress(param interface{}) (*gethcommon.Address, error) { paramStr, ok := param.(string) if !ok { - return nil, fmt.Errorf("unexpectd address value") + return nil, fmt.Errorf("unexpected address value") } if len(strings.TrimSpace(paramStr)) == 0 { diff --git a/go/common/log/logformat.go b/go/common/log/logformat.go index f83107ca26..8579684ac8 100644 --- a/go/common/log/logformat.go +++ b/go/common/log/logformat.go @@ -40,7 +40,7 @@ var locationTrims = []string{ // should append the log locations too when printing entries. var locationEnabled atomic.Bool -// locationLength is the maxmimum path length encountered, which all logs are +// locationLength is the maximum path length encountered, which all logs are // padded to aid in alignment. var locationLength atomic.Uint32 diff --git a/go/common/measure/stopwatch.go b/go/common/measure/stopwatch.go index 219a051754..bab8a99696 100644 --- a/go/common/measure/stopwatch.go +++ b/go/common/measure/stopwatch.go @@ -9,7 +9,7 @@ type Stopwatch struct { // NewStopwatch creates a stopwatch that simply holds starting time. // The idea behind its usage is to have its String() function redirect to // the function that measures elapsed time since its creation in order to plug it into -// defered logger calls. +// deferred logger calls. func NewStopwatch() *Stopwatch { return &Stopwatch{ start: time.Now(), diff --git a/integration/erc20contract/libs/openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol b/integration/erc20contract/libs/openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol index 09484f7b50..ee709899be 100644 --- a/integration/erc20contract/libs/openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol +++ b/integration/erc20contract/libs/openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol @@ -147,7 +147,7 @@ abstract contract ERC4626 is ERC20, IERC4626 { * @dev Internal conversion function (from assets to shares) with support for rounding direction. * * Will revert if assets > 0, totalSupply > 0 and totalAssets = 0. That corresponds to a case where any asset - * would represent an infinite amout of shares. + * would represent an infinite amount of shares. */ function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256 shares) { uint256 supply = totalSupply(); @@ -182,7 +182,7 @@ abstract contract ERC4626 is ERC20, IERC4626 { // calls the vault, which is assumed not malicious. // // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the - // assets are transfered and before the shares are minted, which is a valid state. + // assets are transferred and before the shares are minted, which is a valid state. // slither-disable-next-line reentrancy-no-eth SafeERC20.safeTransferFrom(_asset, caller, address(this), assets); _mint(receiver, shares); @@ -209,7 +209,7 @@ abstract contract ERC4626 is ERC20, IERC4626 { // calls the vault, which is assumed not malicious. // // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the - // shares are burned and after the assets are transfered, which is a valid state. + // shares are burned and after the assets are transferred, which is a valid state. _burn(owner, shares); SafeERC20.safeTransfer(_asset, receiver, assets); diff --git a/integration/networktest/actions/traffic_actions.go b/integration/networktest/actions/traffic_actions.go index a5082b75ed..920ae06b83 100644 --- a/integration/networktest/actions/traffic_actions.go +++ b/integration/networktest/actions/traffic_actions.go @@ -51,7 +51,7 @@ func (p *parallelFundsTransferTraffic) Run(ctx context.Context, network networkt } allUsersActionSeries = append(allUsersActionSeries, NamedSeries(fmt.Sprintf("native transfers - user %d", i), userActionSeries...)) } - // create a parallel action for the user serieses and then delegate running to that action + // create a parallel action for the user series and then delegate running to that action p.parallelAction = NamedParallel(p.String(), allUsersActionSeries...) return p.parallelAction.Run(ctx, network) } diff --git a/integration/obscurogateway/tengateway_test.go b/integration/obscurogateway/tengateway_test.go index 380e598be7..d223ff1bdb 100644 --- a/integration/obscurogateway/tengateway_test.go +++ b/integration/obscurogateway/tengateway_test.go @@ -583,7 +583,7 @@ func testClosingConnectionWhileSubscribed(t *testing.T, httpURL, wsURL string, w // Close the websocket connection and make sure nothing breaks, but user does not receive events user.WSClient.Close() - // make an action that will emmit events + // make an action that will emit events _, err = integrationCommon.InteractWithSmartContract(user.HTTPClient, user.Wallets[0], eventsContractABI, "setMessage2", "foo", contractReceipt.ContractAddress) require.NoError(t, err) // but with closed connection we don't receive any logs @@ -594,7 +594,7 @@ func testClosingConnectionWhileSubscribed(t *testing.T, httpURL, wsURL string, w require.NoError(t, err) user.WSClient = wsClient - // make an action that will emmit events again + // make an action that will emit events again _, err = integrationCommon.InteractWithSmartContract(user.HTTPClient, user.Wallets[0], eventsContractABI, "setMessage2", "foo", contractReceipt.ContractAddress) require.NoError(t, err) diff --git a/integration/smartcontract/pk_test.go b/integration/smartcontract/pk_test.go index c6ae24a3d7..0d3f91c581 100644 --- a/integration/smartcontract/pk_test.go +++ b/integration/smartcontract/pk_test.go @@ -84,7 +84,7 @@ func TestRetrieve(t *testing.T) { if !bytes.Equal(pubKeyABytes, recoveredPub) { t.Errorf("unexpected pub keys. got: %s, expected: %s", recoveredPub, pubKeyABytes) } - // recovered Pubkey yeilds the same address + // recovered Pubkey yields the same address recoveredAddr := crypto.PubkeyToAddress(*recoveredPubKey) if !bytes.Equal(addrA.Bytes(), recoveredAddr.Bytes()) { t.Errorf("unexpected addresses Got %s, expected: %s", addrA.Hex(), recoveredAddr.Hex()) diff --git a/tools/walletextension/test/utils.go b/tools/walletextension/test/utils.go index 7c5d2420cd..213e0e5c8f 100644 --- a/tools/walletextension/test/utils.go +++ b/tools/walletextension/test/utils.go @@ -123,7 +123,7 @@ func makeHTTPEthJSONReqWithPath(port int, path string) []byte { return makeRequestHTTP(fmt.Sprintf("http://%s:%d/%s", common.Localhost, port, path), reqBody) } -// Makes an Ethereum JSON RPC request over HTTP and returns the response body with userID query paremeter. +// Makes an Ethereum JSON RPC request over HTTP and returns the response body with userID query parameter. func makeHTTPEthJSONReqWithUserID(port int, method string, params interface{}, userID string) []byte { //nolint: unparam reqBody := prepareRequestBody(method, params) return makeRequestHTTP(fmt.Sprintf("http://%s:%d/v1/?token=%s", common.Localhost, port, userID), reqBody)