Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .codespell/.codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
skip = .git,node_modules,yarn.lock,Cargo.lock
count =
quiet-level = 3
ignore-words = ./.codespell/wordlist.txt
1 change: 1 addition & 0 deletions .codespell/wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
crate
30 changes: 30 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion design/bridge/bridge_design.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions design/scratchpad/Design_escape_hatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down
6 changes: 3 additions & 3 deletions design/ux/Ten_Gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion design/ux/user_data_incentives.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion go/common/gethencoding/geth_encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion go/common/log/logformat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion go/common/measure/stopwatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion integration/networktest/actions/traffic_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions integration/obscurogateway/tengateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion integration/smartcontract/pk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion tools/walletextension/test/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down