Skip to content

Commit

Permalink
fix typos in all packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jochem-brouwer committed Aug 14, 2024
1 parent b70ae4d commit eb53ed5
Show file tree
Hide file tree
Showing 179 changed files with 437 additions and 360 deletions.
23 changes: 21 additions & 2 deletions config/cspell-ts.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"language": "en-US",
"ignoreRegExpList": ["/0x[0-9A-Fa-f]+/"],
"ignoreRegExpList": ["/0x[0-9A-Fa-f]+/", "@scure"],
"overrides": [
{
"filename": "**/packages/devp2p/**",
"ignoreWords": ["pirl", "ubiq", "gwhale", "prichain", "zfill"]
},
{
"filename": "**/packages/ethash/**",
"ignoreWords": ["epoc", "cmix"]
}
],
"words": [
"Hardfork",
"hardfork",
Expand Down Expand Up @@ -563,6 +573,15 @@
"fixturehd",
"hdnode",
"testpassword",
"wrongtestpassword"
"wrongtestpassword",
"keybyte",
"unstub",
"unmock",
"unjustifiedly",
"uncompression",
"dedicatedly",
"EVMBLS",
"EVMBN",
"EVMONEs"
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"checkNpmVersion": "./scripts/check-npm-version.sh",
"clean": "./config/cli/clean-root.sh",
"cspell": "npm run cspell:ts && npm run cspell:md",
"cspell:ts": "npx cspell --gitignore -e ./packages/ethereum-tests -c ./config/cspell-ts.json \"./packages/**/*.ts\"",
"cspell:ts": "npx cspell --gitignore -e \"./packages/ethereum-tests\" -e \"./packages/wallet/test\" -c ./config/cspell-ts.json \"./packages/**/*.ts\" --show-suggestions",
"cspell:md": "npx cspell --gitignore -e ./packages/ethereum-tests -c ./config/cspell-md.json \"./packages/**/*.md\"",
"docs:build": "npm run docs:build --workspaces --if-present",
"e2e:inject": "node ./scripts/e2e-inject-resolutions.js",
Expand Down
1 change: 1 addition & 0 deletions packages/block/src/from-beacon-payload.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// cspell:ignore breq
import { bigIntToHex } from '@ethereumjs/util'

import type { ExecutionPayload } from './types.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/block/src/header/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ export class BlockHeader {
rawItems.push(this.withdrawalsRoot!)
}

// in kaunstinen 2 verkle is scheduled after withdrawals, will eventually be post deneb hopefully
// in kaustinen 2 verkle is scheduled after withdrawals, will eventually be post deneb hopefully
if (this.common.isActivatedEIP(6800)) {
// execution witness is not mandatory part of the the block so nothing to push here
// but keep this comment segment for clarity regarding the same and move it according as per the
Expand Down
1 change: 1 addition & 0 deletions packages/block/src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// cspell:ignore accum
import { RLP } from '@ethereumjs/rlp'
import { Trie } from '@ethereumjs/trie'
import { BlobEIP4844Transaction } from '@ethereumjs/tx'
Expand Down
2 changes: 1 addition & 1 deletion packages/block/src/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const paramsBlock: ParamsDict = {
difficultyBombDelay: 3000000, // the amount of blocks to delay the difficulty bomb with
},
/**
. * Constantinope HF Meta EIP
. * Constantinople HF Meta EIP
. */
1013: {
// pow
Expand Down
4 changes: 2 additions & 2 deletions packages/block/test/block.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
paramsBlock,
} from '../src/index.js'

import * as testDataGenesis from './testdata/genesishashestest.json'
import * as testDataGenesis from './testdata/genesisHashesTest.json'
import * as testDataFromRpcGoerli from './testdata/testdata-from-rpc-goerli.json'
import * as testDataPreLondon2 from './testdata/testdata_pre-london-2.json'
import * as testDataPreLondon from './testdata/testdata_pre-london.json'
Expand Down Expand Up @@ -299,7 +299,7 @@ describe('[Block]: block functions', () => {
)
await checkThrowsAsync(block.validateData(false, false), 'invalid uncle hash')

// Verkle withness
// Verkle witness
const common = new Common({ chain: Mainnet, eips: [6800], hardfork: Hardfork.Cancun })
// Note: `executionWitness: undefined` will still initialize an execution witness in the block
// So, only testing for `null` here
Expand Down
2 changes: 1 addition & 1 deletion packages/block/test/clique.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('[Header]: Clique PoA Functionality', () => {
},
undefined,
undefined,
'cliqueEpochTransitionSigners() -> should throw on non-epch block',
'cliqueEpochTransitionSigners() -> should throw on non-epoch block',
)

header = createBlockHeader({ number: 60000, extraData: new Uint8Array(137) }, { common })
Expand Down
2 changes: 1 addition & 1 deletion packages/block/test/eip4844block.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ describe('transaction validation tests', () => {
.getTransactionsValidationErrors()
.join(' ')
.includes('exceed maximum blob gas per block'),
'tx erros includes correct error message when too many blobs in a block',
'tx errors includes correct error message when too many blobs in a block',
)
})
})
Expand Down
6 changes: 3 additions & 3 deletions packages/block/test/eip4895block.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ common.hardforkBlock = function (hardfork: string | undefined) {

describe('EIP4895 tests', () => {
it('should correctly generate withdrawalsRoot', async () => {
// get withdwalsArray
// get withdrawalsArray
const gethBlockBytesArray = RLP.decode(hexToBytes(`0x${gethWithdrawals8BlockRlp}`))
const withdrawals = (gethBlockBytesArray[3] as WithdrawalBytes[]).map((wa) =>
Withdrawal.fromValuesArray(wa),
)
assert.equal(withdrawals.length, 8, '8 withdrawals should have been found')
const gethWitdrawalsRoot = (gethBlockBytesArray[0] as Uint8Array[])[16] as Uint8Array
const gethWithdrawalsRoot = (gethBlockBytesArray[0] as Uint8Array[])[16] as Uint8Array
assert.deepEqual(
await genWithdrawalsTrieRoot(withdrawals),
gethWitdrawalsRoot,
gethWithdrawalsRoot,
'withdrawalsRoot should be valid',
)
})
Expand Down
4 changes: 2 additions & 2 deletions packages/block/test/from-beacon-payload.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('[fromExecutionPayloadJson]: 4844 devnet 5', () => {
commonJson.config = { ...commonJson.config, chainId: 4844001005 }
const network = 'sharding'
common = createCommonFromGethGenesis(commonJson, { chain: network, customCrypto: { kzg } })
// safely change chainId without modifying undelying json
// safely change chainId without modifying underlying json

common.setHardfork(Hardfork.Cancun)
})
Expand Down Expand Up @@ -86,7 +86,7 @@ describe('[fromExecutionPayloadJson]: 4844 devnet 5', () => {
describe('[fromExecutionPayloadJson]: kaustinen', () => {
const network = 'kaustinen'

// safely change chainId without modifying undelying json
// safely change chainId without modifying underlying json
const common = createCommonFromGethGenesis(testnetVerkleKaustinen, {
chain: network,
eips: [6800],
Expand Down
1 change: 1 addition & 0 deletions packages/block/test/from-rpc.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// cspell:ignore wtxns wtxs wotxns
import { Common, Goerli, Hardfork, Mainnet } from '@ethereumjs/common'
import { bytesToHex, equalsBytes, hexToBytes, randomBytes } from '@ethereumjs/util'
import { assert, describe, it } from 'vitest'
Expand Down
1 change: 1 addition & 0 deletions packages/block/test/header.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// cspell:ignore NOTURN
import { Common, Goerli, Hardfork, Mainnet } from '@ethereumjs/common'
import { RLP } from '@ethereumjs/rlp'
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/block/test/mergeBlock.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('[Header]: Casper PoS / The Merge Functionality', () => {
}
})

it('EIP-4399: prevRando should return mixHash value', () => {
it('EIP-4399: prevRandao should return mixHash value', () => {
const mixHash = new Uint8Array(32).fill(3)
let block = createBlock({ header: { mixHash } }, { common })
assert.ok(
Expand Down
11 changes: 6 additions & 5 deletions packages/blockchain/src/blockchain.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// cspell:ignore NOTURN
import { Block, BlockHeader, createBlock } from '@ethereumjs/block'
import { Common, ConsensusAlgorithm, ConsensusType, Hardfork, Mainnet } from '@ethereumjs/common'
import {
Expand Down Expand Up @@ -42,9 +43,9 @@ import type { BigIntLike, DB, DBObject, GenesisState } from '@ethereumjs/util'
* of block headers or blocks with support for reorgs and the ability to provide
* custom DB backends.
*
* By default consensus validation is not provided since with the swith to
* By default consensus validation is not provided since with the switch to
* Proof-of-Stake consensus is validated by the Ethereum consensus layer.
* If consensus validation is desired for Etash or Clique blockchains the
* If consensus validation is desired for Ethash or Clique blockchains the
* optional `consensusDict` option can be used to pass in validation objects.
*/
export class Blockchain implements BlockchainInterface {
Expand Down Expand Up @@ -453,7 +454,7 @@ export class Blockchain implements BlockchainInterface {

await this.consensus?.newBlock(block, commonAncestor, ancestorHeaders)
} catch (e) {
// restore head to the previouly sane state
// restore head to the previously sane state
this._heads = oldHeads
this._headHeaderHash = oldHeadHeaderHash
this._headBlockHash = oldHeadBlockHash
Expand Down Expand Up @@ -940,7 +941,7 @@ export class Blockchain implements BlockchainInterface {
} finally {
if (releaseLockOnCallback === true) {
await this._lock.acquire()
// If lock was released check if reorg occured
// If lock was released check if reorg occurred
const nextBlockMayBeReorged = await this.getBlock(nextBlockNumber).catch(
(_e) => null,
)
Expand Down Expand Up @@ -1271,7 +1272,7 @@ export class Blockchain implements BlockchainInterface {
}
if (common.consensusType() === 'poa') {
if (common.genesis().extraData) {
// Ensure exta data is populated from genesis data if provided
// Ensure extra data is populated from genesis data if provided
header.extraData = common.genesis().extraData
} else {
// Add required extraData (32 bytes vanity + 65 bytes filled with zeroes
Expand Down
3 changes: 2 additions & 1 deletion packages/blockchain/src/consensus/clique.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// cspell:ignore NOTURN addrs
import {
cliqueEpochTransitionSigners,
cliqueIsEpochTransition,
Expand Down Expand Up @@ -120,7 +121,7 @@ export class CliqueConsensus implements Consensus {

/**
*
* @param param dictionary containin a {@link Blockchain} object
* @param param dictionary containing a {@link Blockchain} object
*
* Note: this method must be called before consensus checks are used or type errors will occur
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/blockchain/src/db/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const NUM_SUFFIX = utf8ToBytes('n')
/**
* blockHashPrefix + hash -> number
*/
const BLOCK_HASH_PEFIX = utf8ToBytes('H')
const BLOCK_HASH_PREFIX = utf8ToBytes('H')

/**
* bodyPrefix + number + hash -> block body
Expand All @@ -55,7 +55,7 @@ const bodyKey = (n: bigint, hash: Uint8Array) => concatBytes(BODY_PREFIX, bytesB

const numberToHashKey = (n: bigint) => concatBytes(HEADER_PREFIX, bytesBE8(n), NUM_SUFFIX)

const hashToNumberKey = (hash: Uint8Array) => concatBytes(BLOCK_HASH_PEFIX, hash)
const hashToNumberKey = (hash: Uint8Array) => concatBytes(BLOCK_HASH_PREFIX, hash)

/**
* @hidden
Expand Down
2 changes: 1 addition & 1 deletion packages/blockchain/src/db/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class DBManager {
let body = await this.getBody(hash, number)

// be backward compatible where we didn't use to store a body with no txs, uncles, withdrawals
// otherwise the body is never partially stored and if we have some body, its in entirity
// otherwise the body is never partially stored and if we have some body, its in entirety
if (body === undefined) {
body = [[], []] as BlockBodyBytes
// Do extra validations on the header since we are assuming empty transactions and uncles
Expand Down
4 changes: 2 additions & 2 deletions packages/blockchain/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export interface BlockchainOptions extends GenesisOptions {

/**
* Validate the consensus with the respective consensus implementation passed
* to `consensusDict` (see respective option) `CapserConsensus` (which effectively
* to `consensusDict` (see respective option) `CasperConsensus` (which effectively
* does nothing) is available by default.
*
* For the build-in validation classes the following validations take place.
Expand All @@ -191,7 +191,7 @@ export interface BlockchainOptions extends GenesisOptions {
*
* Since consensus validation moved to the Ethereum consensus layer with Proof-of-Stake
* consensus is not validated by default. For `ConsensusAlgorithm.Ethash` and
* `ConsensusAlgorith.Clique` consensus validation can be activated by passing in the
* `ConsensusAlgorithm.Clique` consensus validation can be activated by passing in the
* respective consensus validation objects `EthashConsensus` or `CliqueConsensus`.
*
* ```ts
Expand Down
1 change: 1 addition & 0 deletions packages/blockchain/test/clique.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// cspell:ignore NOTURN deauth unforked
import {
cliqueEpochTransitionSigners,
createBlock,
Expand Down
2 changes: 1 addition & 1 deletion packages/blockchain/test/customConsensus.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Optional consensus parameter in blockchain constructor', () => {
})

describe('Custom consensus validation rules', () => {
it('should validat custom consensus rules', async () => {
it('should validate custom consensus rules', async () => {
const common = new Common({ chain: testnet, hardfork: Hardfork.Chainstart })
const blockchain = await createBlockchain({ common, validateConsensus: true, consensusDict })
const block = createBlock(
Expand Down
3 changes: 2 additions & 1 deletion packages/blockchain/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// cspell:ignore staletest
import {
createBlock,
createBlockFromRLPSerializedBlock,
Expand Down Expand Up @@ -537,7 +538,7 @@ describe('blockchain test', () => {
await blockchain.putHeader(block2Header)
try {
await blockchain.getBlock(BigInt(2))
assert.fail('block should not be constucted')
assert.fail('block should not be constructed')
} catch (e: any) {
assert.equal(
e.message,
Expand Down
3 changes: 2 additions & 1 deletion packages/client/archive/libp2p/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// cspell:ignore ppeer pnode pserver
import { Blockchain } from '@ethereumjs/blockchain'
import { Chain, Common } from '@ethereumjs/common'
import debug from 'debug'
Expand Down Expand Up @@ -72,7 +73,7 @@ export async function createClient(args: any) {
})
config.events.setMaxListeners(50)
const chainDB = new Level<string | Uint8Array, string | Uint8Array>(
`${datadir}/${common.chainName()}`
`${datadir}/${common.chainName()}`,
)

const blockchain = await createBlockchain({
Expand Down
1 change: 1 addition & 0 deletions packages/client/archive/libp2p/libp2pnode.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// cspell:ignore MPLEX Muxer
/**
* Libp2p Bundle
* @memberof module:net/peer
Expand Down
1 change: 1 addition & 0 deletions packages/client/archive/libp2p/net/peer/libp2pnode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@ts-nocheck
// cspell:ignore MPLEX Muxer
/**
* Libp2p Bundle
* @memberof module:net/peer
Expand Down
11 changes: 6 additions & 5 deletions packages/client/archive/libp2p/net/peer/libp2ppeer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@ts-nocheck
// cspell:ignore psender pnode muxed muxer
import { multiaddr } from '@multiformats/multiaddr'

import { Peer } from '../../../src/net/peer/peer'
Expand Down Expand Up @@ -31,7 +32,7 @@ export interface Libp2pPeerOptions extends Omit<PeerOptions, 'address' | 'transp
*
* const chain = await Chain.create()
* const protocols = [new EthProtocol({ chain })]
* const id = 'QmWYhkpLFDhQBwHCMSWzEebbJ5JzXWBKLJxjEuiL8wGzUu'
* const id = 'QmWYhkpLFDhQBwHCMSWzEebbJ5JzXWBKLJxjEuiL8wGzUu' // cspell:disable-line
* const multiaddrs = [multiaddr('/ip4/192.0.2.1/tcp/12345')]
*
* new Libp2pPeer({ id, multiaddrs, protocols })
Expand Down Expand Up @@ -88,13 +89,13 @@ export class Libp2pPeer extends Peer {
/**
* Adds protocols to the peer given a libp2p node and peerId or multiaddr
* @param node libp2p node
* @param peer libp2p peerId or mutliaddr
* @param peer libp2p peerId or multiaddr
* @param server server that initiated connection
*/
async bindProtocols(
node: Libp2pNode,
peer: PeerId | Multiaddr,
server?: Libp2pServer
server?: Libp2pServer,
): Promise<void> {
await Promise.all(
this.protocols.map(async (p) => {
Expand All @@ -106,10 +107,10 @@ export class Libp2pPeer extends Peer {
} catch (err: any) {
const peerInfo = isPeerId(peer) ? `id=${peer.toB58String()}` : `multiaddr=${peer}`
this.config.logger.debug(
`Peer doesn't support protocol=${protocol} ${peerInfo} ${err.stack}`
`Peer doesn't support protocol=${protocol} ${peerInfo} ${err.stack}`,
)
}
})
}),
)
this.server = server
this.connected = true
Expand Down
1 change: 1 addition & 0 deletions packages/client/archive/libp2p/net/server/libp2pserver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@ts-nocheck
// cspell:ignore pnode addrs
// eslint-disable-next-line implicit-dependencies/no-implicit, import/no-extraneous-dependencies
import { keys } from 'libp2p-crypto'
import { multiaddr } from '@multiformats/multiaddr'
Expand Down
6 changes: 3 additions & 3 deletions packages/client/bin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ const args: ClientOpts = yargs
})
.option('isSingleNode', {
describe:
'To run client in single node configuration without need to discover the sync height from peer. Particularly useful in test configurations. This flag is automically activated in the "dev" mode',
'To run client in single node configuration without need to discover the sync height from peer. Particularly useful in test configurations. This flag is automatically activated in the "dev" mode',
boolean: true,
})
.option('vmProfileBlocks', {
Expand Down Expand Up @@ -460,7 +460,7 @@ const args: ClientOpts = yargs
})
.option('engineNewpayloadMaxExecute', {
describe:
'Number of unexecuted blocks (including ancestors) that can be blockingly executed in engine`s new payload (if required and possible) to determine the validity of the block',
'Number of unexecuted blocks (including ancestors) that can be executed per-block in engine`s new payload (if required and possible) to determine the validity of the block',
number: true,
})
.option('skipEngineExec', {
Expand All @@ -470,7 +470,7 @@ const args: ClientOpts = yargs
})
.option('ignoreStatelessInvalidExecs', {
describe:
'Ignore stateless execution failures and keep moving the vm execution along using execution witnesses available in block (verkle). Sets/overrides --statelessVerkle=true and --engineNewpayloadMaxExecute=0 to prevent engine newPayload direct block execution where block execution faliures may stall the CL client. Useful for debugging the verkle. The invalid blocks will be stored in dataDir/network/invalidPayloads which one may use later for debugging',
'Ignore stateless execution failures and keep moving the vm execution along using execution witnesses available in block (verkle). Sets/overrides --statelessVerkle=true and --engineNewpayloadMaxExecute=0 to prevent engine newPayload direct block execution where block execution failures may stall the CL client. Useful for debugging the verkle. The invalid blocks will be stored in dataDir/network/invalidPayloads which one may use later for debugging',
boolean: true,
hidden: true,
})
Expand Down
Loading

0 comments on commit eb53ed5

Please sign in to comment.