diff --git a/.github/workflows/cspell.yml b/.github/workflows/cspell.yml new file mode 100644 index 0000000000..9fb463b5f5 --- /dev/null +++ b/.github/workflows/cspell.yml @@ -0,0 +1,25 @@ +name: Spell check (cspell) +on: + push: + branches: [master, develop] + tags: ['*'] + pull_request: + types: [opened, reopened, synchronize] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + run-spellcheck-cspell: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'npm' + + - run: npm run cspell diff --git a/.gitignore b/.gitignore index 4616e4fc08..f6a429995e 100644 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,6 @@ stats.html ## Vitest __snapshots__ + +# CSpell +.cspellcache \ No newline at end of file diff --git a/config/cspell-md.json b/config/cspell-md.json new file mode 100644 index 0000000000..a00979bf8d --- /dev/null +++ b/config/cspell-md.json @@ -0,0 +1,318 @@ +{ + "language": "en-US", + "ignoreRegExpList": ["/0x[0-9A-Fa-f]+/"], + "words": [ + "Dencun", + "Hardfork", + "acolytec", + "hardfork", + "Holesky", + "MCOPY", + "SELFDESTRUCT", + "BLOBBASEFEE", + "keccak", + "Verkle", + "devnet", + "devp2p", + "hardforks", + "renamings", + "chainsafe", + "secp256k1", + "eips", + "extradata", + "devnets", + "tada", + "statemanager", + "ethash", + "NOTURN", + "subclassing", + "Randao", + "PREVRANDAO", + "Ghorbanian", + "merkle", + "backports", + "behaviour", + "Ethash", + "Chainstart", + "Promisification", + "promisified", + "chainstart", + "callbackify", + "vpulim", + "chaindata", + "leveldb", + "Gitter", + "ethjs", + "ruleset", + "polkadot", + "stabilizations", + "holesky", + "newpayload", + "bootnodes", + "bootnode", + "vmexecution", + "sszify", + "libp2p", + "forkchoice", + "blockhash", + "Dockerfiles", + "blockfetcher", + "txpool", + "subchain", + "enode", + "unpadded", + "Ints", + "reverseblockfetcher", + "forkhash", + "Logvinov", + "Taunas", + "helprpc", + "loglevel", + "Logfile", + "prefund", + "Yolov", + "Calaveras", + "Vinay", + "Pulim", + "Rlpx", + "rlpx", + "hiveview", + "Prysm", + "prysm", + "prysmctl", + "datadir", + "jwtsecret", + "rustup", + "DATADIR", + "maxpeers", + "syncmode", + "nodiscover", + "sealhash", + "Nethermind", + "Merkle", + "ethpandaops", + "Teku", + "prefunded", + "etherbase", + "findneighbour", + "testnetworks", + "testnests", + "DATAFEE", + "MULTIPEER", + "syncpeer", + "Beaconsync", + "datadirs", + "NETWORKID", + "ELCLIENT", + "beaconsync", + "testvectors", + "Snapsync", + "snapsync", + "beaconchain", + "VZWK", + "Rwlk", + "USVGK", + "Kmhd", + "EAAAEAIAAAAAAAAAI", + "Ahtu", + "NBHJMH", + "Nwgi", + "multiaddrs", + "teku", + "nethermind", + "besu", + "Forkid", + "initcode", + "erigon", + "Lvmc", + "DATAHASH", + "BLOBHASH", + "timebased", + "Renamings", + "Authcall", + "Tyneway", + "SLOAD", + "SSTORE", + "calaveras", + "yolov", + "BASEFEE", + "EIPs", + "Forkhash", + "Forkhashes", + "AUTHCALL", + "Kademlia", + "forkid", + "scure", + "paulmillr", + "Neighbours", + "neighbour", + "ecies", + "RLPX", + "BOOTNODES", + "Kbucket", + "datagram", + "UDPPORT", + "TCPPORT", + "ECIES", + "Neighbour", + "findneighbours", + "pydevp", + "mkcache", + "ethashjs", + "validblock", + "rustbn", + "Preimage", + "verkle", + "Preimages", + "modexp", + "roninjin", + "kchojn", + "ripemd", + "Jochem", + "JUMPDEST", + "MLOAD", + "MSTORE", + "KECCAK", + "TLOAD", + "TSTORE", + "Initcode", + "bnadd", + "bnmul", + "fulltext", + "eventemitter", + "Codesize", + "BLOCKHASH", + "selfdestruct", + "jochem", + "brouwer", + "alcuadrado", + "Checkpointing", + "checkpointing", + "MODEXP", + "RIPEMD", + "Rebalance", + "Sina", + "Promisified", + "ecmul", + "Stateroot", + "hotfixing", + "EXTCODEHASH", + "mattdean", + "digicatapult", + "rmeissner", + "jwasinger", + "Agusx", + "Holger", + "danjm", + "whymarrh", + "seesemichaelj", + "axic", + "totalgas", + "RETURNDATA", + "STATICCALL", + "sstore", + "CALLCODE", + "Mgas", + "wemeetagain", + "Schtroumpf", + "holgerd", + "rbtree", + "sdsl", + "vitalik", + "Vitalik", + "Kaustinen", + "faustbrian", + "bmark", + "samlior", + "checkpointed", + "retwrite", + "maindb", + "memdown", + "Rocheleau", + "Vitalik's", + "LMDB", + "lmdb", + "flamegraph", + "thislog", + "thatlog", + "otherlog", + "sublog", + "myscript", + "behaviours", + "unhashed", + "xghi", + "gregthegreek", + "danksharding", + "ecsign", + "Unpadded", + "talentlessguy", + "Nomic", + "unpad", + "Keccak", + "prebuilds", + "keccakjs", + "retesteth", + "testdata", + "Statetest", + "jsontrace", + "nomemory", + "statetest", + "pyethereum", + "evmlab", + "holiman", + "flamegraphs", + "testpath", + "TESTPATH", + "RETESTETH", + "thirdparty", + "hdkey", + "jackalope", + "Libray", + "explcit", + "ricmoo", + "scryptsy", + "randombytes", + "ICAP", + "cryptocoinjs", + "xpub", + "xpriv", + "Thirdparty", + "icap", + "ethereumhdkey", + "dklen", + "hmac", + "Beregszaszi", + "mfornet", + "blockfill", + "Heydiho", + "bazel", + "tlsv", + "lcli", + "extip", + "unauditability", + "ized", + "`scanf`", + "tomonari", + "dryajov", + "dgram", + "krzkaczor", + "libotony", + "xvfb", + "alextsg", + "Merkling", + "ledgerhq", + "accountprivate", + "accountimport", + "echash", + "pubkey", + "unpublish", + "poap", + "nycrc", + "gitpkg", + "multiaddress", + "triggerable", + "MCLBLS", + "heartedly", + "beaconroot" + ] +} diff --git a/config/cspell-ts.json b/config/cspell-ts.json new file mode 100644 index 0000000000..4b95f2ab9d --- /dev/null +++ b/config/cspell-ts.json @@ -0,0 +1,599 @@ +{ + "language": "en-US", + "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", + "Chainstart", + "ethash", + "KECCAK", + "keccak", + "Verkle", + "verkle", + "maxblob", + "Randao", + "hardforks", + "ecsign", + "extradata", + "randao", + "Unpadded", + "Ethash", + "blocktime", + "timebomb", + "prestate", + "testdata", + "eips", + "chainstart", + "Besu", + "devnet", + "Kaustinen", + "kaustinen", + "premerge", + "txns", + "blockdata", + "Mockchain", + "HARDFORK", + "BLOCKHASH", + "checkpointed", + "headerchain", + "Merkle", + "cornercase", + "Deauthorizations", + "Deauthorizing", + "deauthorized", + "Deauthorize", + "checkpointing", + "Holesky", + "holesky", + "newblock", + "newheader", + "libp2p", + "multiaddrs", + "bootnode", + "bootnodes", + "Multiaddrs", + "peerpool", + "ethprotocol", + "flowcontrol", + "lesprotocol", + "fullethereumservice", + "lightethereumservice", + "fullsync", + "lightsync", + "loglevel", + "datadir", + "DATADIR", + "syncmode", + "Libp", + "chainsafe", + "Multiaddr", + "multiformats", + "multiaddr", + "Websockets", + "websockets", + "Bootnodes", + "secp256k1", + "Polkadot", + "polkadot", + "helprpc", + "SYNCMODE", + "LIGHTSERV", + "enode", + "discport", + "MAXPERREQUEST", + "MAXFETCHERJOBS", + "MINPEERS", + "MAXPEERS", + "DNSADDR", + "reexecuting", + "DEBUGCODE", + "findneighbour", + "prefunded", + "etherbase", + "merkle", + "Newpayload", + "lightserv", + "txpool", + "Devnet", + "prefund", + "recid", + "prefunding", + "mockserver", + "jwtsecret", + "pkey", + "qheap", + "leveldown", + "devp2p", + "Rlpx", + "backstep", + "subchains", + "subchain", + "Subchain", + "unsynced", + "forkchoice", + "preimages", + "Preimages", + "MAXFETCHERREQUESTS", + "BACKSTEP", + "SUBCHAIN", + "NEWPAYLOAD", + "snapstate", + "vmexecution", + "lightchain", + "leveldb", + "preimage", + "Preimage", + "bitvector", + "MCLBLS", + "statemanager", + "rustbn", + "resetted", + "stateroot", + "backstepping", + "urlnopad", + "bubbleup", + "bubbledown", + "payloadid", + "blobsbundles", + "blockhash", + "rlpxpeer", + "handshaked", + "Devp", + "rlpx", + "Reinitiating", + "tablesize", + "peertablesize", + "snapprotocol", + "typeguard", + "boundprotocol", + "rlpxsender", + "rlpxserver", + "ECIES", + "Neighbours", + "Forkchoice", + "FORKCHOICE", + "errormsg", + "snapsync", + "newpayloadv", + "vmhead", + "sethead", + "statebuild", + "safeblock", + "prio", + "Keccak", + "accountfetcher", + "Snapsync", + "headstate", + "syncer", + "syncedchain", + "lastfilled", + "lastexecuted", + "lastfetched", + "lastvalid", + "lastsynced", + "lastchain", + "inited", + "Initing", + "unfinalized", + "canonicality", + "tailparent", + "Backstepped", + "Unfinalized", + "stepback", + "vmlog", + "snapprogress", + "trienodes", + "minblob", + "basefee", + "sendobject", + "broadcasterrors", + "knownpeers", + "sendobjects", + "handledadds", + "handlederrors", + "handledobject", + "successfuladds", + "failedadds", + "syncable", + "bytecodefetcher", + "storagefetcher", + "trienodefetcher", + "trienode", + "reqs", + "SNAPSYNC", + "rerequest", + "Receivedhash", + "blockfetcherbase", + "blockfetcher", + "CODEHASH", + "bytecodes", + "headerfetcher", + "reverseblockfetcher", + "multiaccount", + "slotset", + "hashset", + "proofset", + "sdsl", + "subtrie", + "beaconsync", + "reinited", + "syncability", + "ethjs", + "matchip", + "withengine", + "withoutengine", + "engineonly", + "enrtree", + "Hardforks", + "restopped", + "keyid", + "mockchain", + "pushable", + "mocksender", + "Pushable", + "mockpeer", + "simutils", + "codehash", + "nodeinfo", + "postmerge", + "newpayload", + "testvectors", + "statediffs", + "feerecipient", + "Testvectors", + "rpctestnet", + "blockopt", + "TXINDEX", + "badhex", + "checksummed", + "invalidlength", + "blockhashes", + "chainid", + "txes", + "DATAFEE", + "kzgs", + "iszero", + "staticcall", + "mload", + "multipeer", + "startnetwork", + "NETWORKID", + "MULTIPEER", + "snapfetcher", + "sidechain", + "wasmecrecover", + "forkhash", + "besu", + "EIPs", + "SWAPN", + "DUPN", + "BASEFEE", + "initcode", + "PREVRANDAO", + "MCOPY", + "JUMPF", + "SELFDESTRUCT", + "triggerable", + "RETURNDATASIZE", + "RETURNDATACOPY", + "STATICCALL", + "BLOBBASEFEE", + "regenesis", + "SSTORE", + "danksharding", + "selfdestruct", + "pectra", + "Checkpointing", + "typesafe", + "epochlength", + "Sstore", + "sstore", + "forkhashes", + "BOOTNODES", + "CLIENTID", + "snappyjs", + "uncompress", + "sscanf", + "scanf", + "unpadded", + "kbucket", + "banlist", + "neighbour", + "findneighbours", + "KBUCKET", + "unstrict", + "neighbours", + "typedata", + "sighash", + "hashdata", + "hashfn", + "ecies", + "ekey", + "Neighbour", + "ethdisco", + "findnode", + "misformatted", + "dpts", + "rlpxs", + "RLPXs", + "RLPX", + "peername", + "Comfortability", + "bitstream", + "Ecies", + "Testdata", + "mkcache", + "validblock", + "mixhashes", + "newdata", + "SDIV", + "SMOD", + "ADDMOD", + "MULMOD", + "SIGNEXTEND", + "ISZERO", + "CALLVALUE", + "CALLDATALOAD", + "CALLDATASIZE", + "CALLDATACOPY", + "CODESIZE", + "CODECOPY", + "EXTCODECOPY", + "EXTCODEHASH", + "CHAINID", + "SELFBALANCE", + "BLOBAHASH", + "MLOAD", + "MSTORE", + "SLOAD", + "JUMPI", + "MSIZE", + "JUMPDEST", + "TLOAD", + "TSTORE", + "DATALOAD", + "DATALOADN", + "DATASIZE", + "DATACOPY", + "RJUMP", + "RJUMPI", + "RJUMPV", + "CALLF", + "RETF", + "EOFCREATE", + "RETURNCONTRACT", + "CALLCODE", + "DELEGATECALL", + "RETURNDATALOAD", + "EXTCALL", + "EXTDELEGATECALL", + "EXTSTATICCALL", + "Initmode", + "subcontainers", + "initmode", + "subcontainer", + "Subcontainers", + "rjump", + "callf", + "jumpf", + "Retf", + "Extcall", + "extcall", + "EOFBYTES", + "EOFHASH", + "RJUMPing", + "delegatecall", + "INITCODE", + "Codestore", + "Codesize", + "COOG", + "Accessfee", + "CODESTORE", + "BEGINSUB", + "RETURNSUB", + "JUMPSUB", + "jumpdest", + "beginsub", + "codechunk", + "jumpsub", + "Selfdestruct", + "eofcreate", + "RIPEMD", + "journaling", + "BLOBHASH", + "coldaccountaccess", + "warmstorageread", + "coldsload", + "sstorenoop", + "Sload", + "jumptable", + "VERKLE", + "Toaddress", + "sload", + "zeroness", + "ripemd", + "sdiv", + "smod", + "addmod", + "mulmod", + "signextend", + "callvalue", + "calldataload", + "calldatasize", + "calldatacopy", + "codesize", + "codecopy", + "extcodecopy", + "mstore", + "jumpi", + "msize", + "callcode", + "prevrandao", + "modexp", + "Gquaddivisor", + "returndatasize", + "returndatacopy", + "extcodehash", + "selfbalance", + "dupn", + "swapn", + "tstore", + "tload", + "rjumpi", + "rjumpv", + "retf", + "blobhash", + "mcopy", + "extdelegatecall", + "extstaticcall", + "returndataload", + "dataload", + "dataloadn", + "datasize", + "datacopy", + "blobbasefee", + "returncontract", + "MODEXP", + "ECADD", + "ecadd", + "ECMUL", + "ecmul", + "ECPAIRING", + "ecpairing", + "BADARGS", + "Jochem", + "MAPFPTOG", + "MAPFP", + "IRTF", + "Nethermind", + "unnormalized", + "Pippenger's", + "Exponentiate", + "Zcash", + "ECPAIR", + "behaviour", + "unpad", + "returndata", + "RETURNDATA", + "multiexp", + "mclbls", + "sstores", + "blobgas", + "rlptest", + "vitalik", + "Vitalik", + "pedersen", + "ZEROVALUE", + "unaccessed", + "poststate", + "downleveled", + "codehashes", + "misbehaviour", + "blocktag", + "downleveling", + "lmdb", + "LMDB", + "trietest", + "dbkey", + "unhashed", + "KEYBYTES", + "Keybytes", + "unmatching", + "keyvals", + "checkroot", + "noderef", + "SECP", + "startgas", + "Vitalik's", + "txbytes", + "chunkify", + "reserialized", + "withdrawalsto", + "leafnode", + "lastblockhash", + "bitvectors", + "nethermind", + "sgas", + "dgas", + "Mgas", + "beaconroot", + "predeploy", + "Predeploy", + "ommers", + "BLOCKHASHes", + "ommer", + "Ommer", + "nibling", + "Nibling", + "totalblob", + "rlpd", + "staticcalls", + "PREBALANCE", + "Blockhash", + "selfdestructs", + "Beaconroot", + "blockroot", + "CALLDATACOPYs", + "BROOT", + "broot", + "Blockroot", + "selfdestructed", + "statelessly", + "Pkey", + "alcuadrado", + "retesteth", + "tomergeatdiff", + "shanghaitocancunattime", + "cancuntopragueattime", + "jsontrace", + "alltests", + "postconditions", + "hdkey", + "thirdparty", + "keysize", + "ciphertext", + "userid", + "cipherparams", + "encseed", + "ethaddr", + "btcaddr", + "icap", + "ICAP", + "fixtureseed", + "fixturehd", + "hdnode", + "testpassword", + "wrongtestpassword", + "keybyte", + "unstub", + "unmock", + "unjustifiedly", + "uncompression", + "dedicatedly", + "EVMBLS", + "EVMBN", + "EVMONEs", + "INTURN", + "NOTURN", + "Andras", + "Radics", + "Fedor", + "Indutny", + "Kademlia", + "Slominski", + "patarapolw", + "nickdodson", + "Kintsugi", + "deauthorization" + ] +} diff --git a/package-lock.json b/package-lock.json index 9b04819001..e0acd5abf0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "@vitest/coverage-v8": "^v2.0.0-beta.1", "@vitest/ui": "^v2.0.0-beta.12", "c8": "7.12.0", + "cspell": "^8.13.3", "embedme": "1.22.1", "eslint": "8.57.0", "eslint-config-prettier": "^9.1.0", @@ -477,6 +478,471 @@ "node": ">=0.1.90" } }, + "node_modules/@cspell/cspell-bundled-dicts": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.13.3.tgz", + "integrity": "sha512-OfCxUBMyayxKyeDaUZG3LQpiyH8MFUbg9nbIZCGh2x8U6N0fHaP9uR6R+gPzdi/bJp32Kr+RC/Yebojd+AQCGA==", + "dev": true, + "dependencies": { + "@cspell/dict-ada": "^4.0.2", + "@cspell/dict-aws": "^4.0.3", + "@cspell/dict-bash": "^4.1.3", + "@cspell/dict-companies": "^3.1.4", + "@cspell/dict-cpp": "^5.1.12", + "@cspell/dict-cryptocurrencies": "^5.0.0", + "@cspell/dict-csharp": "^4.0.2", + "@cspell/dict-css": "^4.0.12", + "@cspell/dict-dart": "^2.0.3", + "@cspell/dict-django": "^4.1.0", + "@cspell/dict-docker": "^1.1.7", + "@cspell/dict-dotnet": "^5.0.2", + "@cspell/dict-elixir": "^4.0.3", + "@cspell/dict-en_us": "^4.3.23", + "@cspell/dict-en-common-misspellings": "^2.0.4", + "@cspell/dict-en-gb": "1.1.33", + "@cspell/dict-filetypes": "^3.0.4", + "@cspell/dict-fonts": "^4.0.0", + "@cspell/dict-fsharp": "^1.0.1", + "@cspell/dict-fullstack": "^3.2.0", + "@cspell/dict-gaming-terms": "^1.0.5", + "@cspell/dict-git": "^3.0.0", + "@cspell/dict-golang": "^6.0.9", + "@cspell/dict-google": "^1.0.1", + "@cspell/dict-haskell": "^4.0.1", + "@cspell/dict-html": "^4.0.5", + "@cspell/dict-html-symbol-entities": "^4.0.0", + "@cspell/dict-java": "^5.0.7", + "@cspell/dict-julia": "^1.0.1", + "@cspell/dict-k8s": "^1.0.6", + "@cspell/dict-latex": "^4.0.0", + "@cspell/dict-lorem-ipsum": "^4.0.0", + "@cspell/dict-lua": "^4.0.3", + "@cspell/dict-makefile": "^1.0.0", + "@cspell/dict-monkeyc": "^1.0.6", + "@cspell/dict-node": "^5.0.1", + "@cspell/dict-npm": "^5.0.18", + "@cspell/dict-php": "^4.0.8", + "@cspell/dict-powershell": "^5.0.5", + "@cspell/dict-public-licenses": "^2.0.7", + "@cspell/dict-python": "^4.2.4", + "@cspell/dict-r": "^2.0.1", + "@cspell/dict-ruby": "^5.0.2", + "@cspell/dict-rust": "^4.0.5", + "@cspell/dict-scala": "^5.0.3", + "@cspell/dict-software-terms": "^4.0.6", + "@cspell/dict-sql": "^2.1.5", + "@cspell/dict-svelte": "^1.0.2", + "@cspell/dict-swift": "^2.0.1", + "@cspell/dict-terraform": "^1.0.0", + "@cspell/dict-typescript": "^3.1.6", + "@cspell/dict-vue": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-json-reporter": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.13.3.tgz", + "integrity": "sha512-QrHxWkm0cfD+rTjFOxm5lpE4+wBANDzMIM8NOeQC6v8Dc1L8PUkm6hF6CsEv2tKmuwvdVr+jy6GilDMkPXalCg==", + "dev": true, + "dependencies": { + "@cspell/cspell-types": "8.13.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-pipe": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.13.3.tgz", + "integrity": "sha512-6a9Zd+fDltgXoJ0fosWqEMx0UdXBXZ7iakhslMNPRmv7GhVAoHBoIXzMVilOE4kYT2Mh/9NM/QW/NbNEpneZIQ==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-resolver": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.13.3.tgz", + "integrity": "sha512-vlwtMTEWsPPtWfktzT75eGQ0n+0M+9kN+89eSvUUYdCfvY9XAS6z+bTmhS2ULJgntgWtX6gUjABQK0PYYVedOg==", + "dev": true, + "dependencies": { + "global-directory": "^4.0.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-service-bus": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.13.3.tgz", + "integrity": "sha512-mFkeWXwGQSDxRiN6Kez77GaMNGNgG7T6o9UE42jyXEgf/bLJTpefbUy4fY5pU3p2mA0eoMzmnJX8l+TC5YJpbA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-types": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.13.3.tgz", + "integrity": "sha512-lA5GbhLOL6FlKCWNMbooRFgNGfTsM6NJnHz60+EEN7XD9OgpFc7w+MBcK4aHsVCxcrIvnejIc8xQDqPnrdmN3w==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/dict-ada": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.2.tgz", + "integrity": "sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==", + "dev": true + }, + "node_modules/@cspell/dict-aws": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.3.tgz", + "integrity": "sha512-0C0RQ4EM29fH0tIYv+EgDQEum0QI6OrmjENC9u98pB8UcnYxGG/SqinuPxo+TgcEuInj0Q73MsBpJ1l5xUnrsw==", + "dev": true + }, + "node_modules/@cspell/dict-bash": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.3.tgz", + "integrity": "sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw==", + "dev": true + }, + "node_modules/@cspell/dict-companies": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.4.tgz", + "integrity": "sha512-y9e0amzEK36EiiKx3VAA+SHQJPpf2Qv5cCt5eTUSggpTkiFkCh6gRKQ97rVlrKh5GJrqinDwYIJtTsxuh2vy2Q==", + "dev": true + }, + "node_modules/@cspell/dict-cpp": { + "version": "5.1.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.12.tgz", + "integrity": "sha512-6lXLOFIa+k/qBcu0bjaE/Kc6v3sh9VhsDOXD1Dalm3zgd0QIMjp5XBmkpSdCAK3pWCPV0Se7ysVLDfCea1BuXg==", + "dev": true + }, + "node_modules/@cspell/dict-cryptocurrencies": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.0.tgz", + "integrity": "sha512-Z4ARIw5+bvmShL+4ZrhDzGhnc9znaAGHOEMaB/GURdS/jdoreEDY34wdN0NtdLHDO5KO7GduZnZyqGdRoiSmYA==", + "dev": true + }, + "node_modules/@cspell/dict-csharp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.2.tgz", + "integrity": "sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g==", + "dev": true + }, + "node_modules/@cspell/dict-css": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.13.tgz", + "integrity": "sha512-WfOQkqlAJTo8eIQeztaH0N0P+iF5hsJVKFuhy4jmARPISy8Efcv8QXk2/IVbmjJH0/ZV7dKRdnY5JFVXuVz37g==", + "dev": true + }, + "node_modules/@cspell/dict-dart": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.0.3.tgz", + "integrity": "sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw==", + "dev": true + }, + "node_modules/@cspell/dict-data-science": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.1.tgz", + "integrity": "sha512-xeutkzK0eBe+LFXOFU2kJeAYO6IuFUc1g7iRLr7HeCmlC4rsdGclwGHh61KmttL3+YHQytYStxaRBdGAXWC8Lw==", + "dev": true + }, + "node_modules/@cspell/dict-django": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.0.tgz", + "integrity": "sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w==", + "dev": true + }, + "node_modules/@cspell/dict-docker": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.7.tgz", + "integrity": "sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A==", + "dev": true + }, + "node_modules/@cspell/dict-dotnet": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.2.tgz", + "integrity": "sha512-UD/pO2A2zia/YZJ8Kck/F6YyDSpCMq0YvItpd4YbtDVzPREfTZ48FjZsbYi4Jhzwfvc6o8R56JusAE58P+4sNQ==", + "dev": true + }, + "node_modules/@cspell/dict-elixir": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.3.tgz", + "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==", + "dev": true + }, + "node_modules/@cspell/dict-en_us": { + "version": "4.3.23", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.23.tgz", + "integrity": "sha512-l0SoEQBsi3zDSl3OuL4/apBkxjuj4hLIg/oy6+gZ7LWh03rKdF6VNtSZNXWAmMY+pmb1cGA3ouleTiJIglbsIg==", + "dev": true + }, + "node_modules/@cspell/dict-en-common-misspellings": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.4.tgz", + "integrity": "sha512-lvOiRjV/FG4pAGZL3PN2GCVHSTCE92cwhfLGGkOsQtxSmef6WCHfHwp9auafkBlX0yFQSKDfq6/TlpQbjbJBtQ==", + "dev": true + }, + "node_modules/@cspell/dict-en-gb": { + "version": "1.1.33", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz", + "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==", + "dev": true + }, + "node_modules/@cspell/dict-filetypes": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.4.tgz", + "integrity": "sha512-IBi8eIVdykoGgIv5wQhOURi5lmCNJq0we6DvqKoPQJHthXbgsuO1qrHSiUVydMiQl/XvcnUWTMeAlVUlUClnVg==", + "dev": true + }, + "node_modules/@cspell/dict-fonts": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz", + "integrity": "sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q==", + "dev": true + }, + "node_modules/@cspell/dict-fsharp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.0.1.tgz", + "integrity": "sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ==", + "dev": true + }, + "node_modules/@cspell/dict-fullstack": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.0.tgz", + "integrity": "sha512-sIGQwU6G3rLTo+nx0GKyirR5dQSFeTIzFTOrURw51ISf+jKG9a3OmvsVtc2OANfvEAOLOC9Wfd8WYhmsO8KRDQ==", + "dev": true + }, + "node_modules/@cspell/dict-gaming-terms": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.5.tgz", + "integrity": "sha512-C3riccZDD3d9caJQQs1+MPfrUrQ+0KHdlj9iUR1QD92FgTOF6UxoBpvHUUZ9YSezslcmpFQK4xQQ5FUGS7uWfw==", + "dev": true + }, + "node_modules/@cspell/dict-git": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.0.tgz", + "integrity": "sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw==", + "dev": true + }, + "node_modules/@cspell/dict-golang": { + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.9.tgz", + "integrity": "sha512-etDt2WQauyEQDA+qPS5QtkYTb2I9l5IfQftAllVoB1aOrT6bxxpHvMEpJ0Hsn/vezxrCqa/BmtUbRxllIxIuSg==", + "dev": true + }, + "node_modules/@cspell/dict-google": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.1.tgz", + "integrity": "sha512-dQr4M3n95uOhtloNSgB9tYYGXGGEGEykkFyRtfcp5pFuEecYUa0BSgtlGKx9RXVtJtKgR+yFT/a5uQSlt8WjqQ==", + "dev": true + }, + "node_modules/@cspell/dict-haskell": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.1.tgz", + "integrity": "sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ==", + "dev": true + }, + "node_modules/@cspell/dict-html": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.5.tgz", + "integrity": "sha512-p0brEnRybzSSWi8sGbuVEf7jSTDmXPx7XhQUb5bgG6b54uj+Z0Qf0V2n8b/LWwIPJNd1GygaO9l8k3HTCy1h4w==", + "dev": true + }, + "node_modules/@cspell/dict-html-symbol-entities": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.0.tgz", + "integrity": "sha512-HGRu+48ErJjoweR5IbcixxETRewrBb0uxQBd6xFGcxbEYCX8CnQFTAmKI5xNaIt2PKaZiJH3ijodGSqbKdsxhw==", + "dev": true + }, + "node_modules/@cspell/dict-java": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.7.tgz", + "integrity": "sha512-ejQ9iJXYIq7R09BScU2y5OUGrSqwcD+J5mHFOKbduuQ5s/Eh/duz45KOzykeMLI6KHPVxhBKpUPBWIsfewECpQ==", + "dev": true + }, + "node_modules/@cspell/dict-julia": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-julia/-/dict-julia-1.0.1.tgz", + "integrity": "sha512-4JsCLCRhhLMLiaHpmR7zHFjj1qOauzDI5ZzCNQS31TUMfsOo26jAKDfo0jljFAKgw5M2fEG7sKr8IlPpQAYrmQ==", + "dev": true + }, + "node_modules/@cspell/dict-k8s": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.6.tgz", + "integrity": "sha512-srhVDtwrd799uxMpsPOQqeDJY+gEocgZpoK06EFrb4GRYGhv7lXo9Fb+xQMyQytzOW9dw4DNOEck++nacDuymg==", + "dev": true + }, + "node_modules/@cspell/dict-latex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.0.tgz", + "integrity": "sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ==", + "dev": true + }, + "node_modules/@cspell/dict-lorem-ipsum": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz", + "integrity": "sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw==", + "dev": true + }, + "node_modules/@cspell/dict-lua": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.3.tgz", + "integrity": "sha512-lDHKjsrrbqPaea13+G9s0rtXjMO06gPXPYRjRYawbNmo4E/e3XFfVzeci3OQDQNDmf2cPOwt9Ef5lu2lDmwfJg==", + "dev": true + }, + "node_modules/@cspell/dict-makefile": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.0.tgz", + "integrity": "sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ==", + "dev": true + }, + "node_modules/@cspell/dict-monkeyc": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.6.tgz", + "integrity": "sha512-oO8ZDu/FtZ55aq9Mb67HtaCnsLn59xvhO/t2mLLTHAp667hJFxpp7bCtr2zOrR1NELzFXmKln/2lw/PvxMSvrA==", + "dev": true + }, + "node_modules/@cspell/dict-node": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.1.tgz", + "integrity": "sha512-lax/jGz9h3Dv83v8LHa5G0bf6wm8YVRMzbjJPG/9rp7cAGPtdrga+XANFq+B7bY5+jiSA3zvj10LUFCFjnnCCg==", + "dev": true + }, + "node_modules/@cspell/dict-npm": { + "version": "5.0.18", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.18.tgz", + "integrity": "sha512-weMTyxWpzz19q4wv9n183BtFvdD5fCjtze+bFKpl+4rO/YlPhHL2cXLAeexJz/VDSBecwX4ybTZYoknd1h2J4w==", + "dev": true + }, + "node_modules/@cspell/dict-php": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.8.tgz", + "integrity": "sha512-TBw3won4MCBQ2wdu7kvgOCR3dY2Tb+LJHgDUpuquy3WnzGiSDJ4AVelrZdE1xu7mjFJUr4q48aB21YT5uQqPZA==", + "dev": true + }, + "node_modules/@cspell/dict-powershell": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.5.tgz", + "integrity": "sha512-3JVyvMoDJesAATYGOxcUWPbQPUvpZmkinV3m8HL1w1RrjeMVXXuK7U1jhopSneBtLhkU+9HKFwgh9l9xL9mY2Q==", + "dev": true + }, + "node_modules/@cspell/dict-public-licenses": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.7.tgz", + "integrity": "sha512-KlBXuGcN3LE7tQi/GEqKiDewWGGuopiAD0zRK1QilOx5Co8XAvs044gk4MNIQftc8r0nHeUI+irJKLGcR36DIQ==", + "dev": true + }, + "node_modules/@cspell/dict-python": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.4.tgz", + "integrity": "sha512-sCtLBqMreb+8zRW2bXvFsfSnRUVU6IFm4mT6Dc4xbz0YajprbaPPh/kOUTw5IJRP8Uh+FFb7Xp2iH03CNWRq/A==", + "dev": true, + "dependencies": { + "@cspell/dict-data-science": "^2.0.1" + } + }, + "node_modules/@cspell/dict-r": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.0.1.tgz", + "integrity": "sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA==", + "dev": true + }, + "node_modules/@cspell/dict-ruby": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.2.tgz", + "integrity": "sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g==", + "dev": true + }, + "node_modules/@cspell/dict-rust": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.5.tgz", + "integrity": "sha512-DIvlPRDemjKQy8rCqftAgGNZxY5Bg+Ps7qAIJjxkSjmMETyDgl0KTVuaJPt7EK4jJt6uCZ4ILy96npsHDPwoXA==", + "dev": true + }, + "node_modules/@cspell/dict-scala": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.3.tgz", + "integrity": "sha512-4yGb4AInT99rqprxVNT9TYb1YSpq58Owzq7zi3ZS5T0u899Y4VsxsBiOgHnQ/4W+ygi+sp+oqef8w8nABR2lkg==", + "dev": true + }, + "node_modules/@cspell/dict-software-terms": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.0.6.tgz", + "integrity": "sha512-UDhUzNSf7GN529a0Ip9hlSoGbpscz0YlUYBEJmZBXi8otpkrbCJqs50T74Ppd+SWqNil04De8urv4af2c6SY5Q==", + "dev": true + }, + "node_modules/@cspell/dict-sql": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.5.tgz", + "integrity": "sha512-FmxanytHXss7GAWAXmgaxl3icTCW7YxlimyOSPNfm+njqeUDjw3kEv4mFNDDObBJv8Ec5AWCbUDkWIpkE3IpKg==", + "dev": true + }, + "node_modules/@cspell/dict-svelte": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.2.tgz", + "integrity": "sha512-rPJmnn/GsDs0btNvrRBciOhngKV98yZ9SHmg8qI6HLS8hZKvcXc0LMsf9LLuMK1TmS2+WQFAan6qeqg6bBxL2Q==", + "dev": true + }, + "node_modules/@cspell/dict-swift": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.1.tgz", + "integrity": "sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw==", + "dev": true + }, + "node_modules/@cspell/dict-terraform": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.0.0.tgz", + "integrity": "sha512-Ak+vy4HP/bOgzf06BAMC30+ZvL9mzv21xLM2XtfnBLTDJGdxlk/nK0U6QT8VfFLqJ0ZZSpyOxGsUebWDCTr/zQ==", + "dev": true + }, + "node_modules/@cspell/dict-typescript": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.6.tgz", + "integrity": "sha512-1beC6O4P/j23VuxX+i0+F7XqPVc3hhiAzGJHEKqnWf5cWAXQtg0xz3xQJ5MvYx2a7iLaSa+lu7+05vG9UHyu9Q==", + "dev": true + }, + "node_modules/@cspell/dict-vue": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.0.tgz", + "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==", + "dev": true + }, + "node_modules/@cspell/dynamic-import": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.13.3.tgz", + "integrity": "sha512-YN83CFWnMkt9B0q0RBadfEoptUaDRqBikh8b91MOQ0haEnUo6t57j4jAaLnbIEP4ynzMhgruWFKpIC/QaEtCuA==", + "dev": true, + "dependencies": { + "import-meta-resolve": "^4.1.0" + }, + "engines": { + "node": ">=18.0" + } + }, + "node_modules/@cspell/strong-weak-map": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.13.3.tgz", + "integrity": "sha512-/QYUEthesPuDarOHa6kcWKJmVq0HIotjPrmAWQ5QpH+dDik1Qin4G/9QdnWX75ueR4DC4WFjBNBU14C4TVSwHQ==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/url": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.13.3.tgz", + "integrity": "sha512-hsxoTnZHwtdR2x9QEE6yfDBB1LUwAj67o1GyKTvI8A2OE/AfzAttirZs+9sxgOGWoBdTOxM9sMLtqB3SxtDB3A==", + "dev": true, + "engines": { + "node": ">=18.0" + } + }, "node_modules/@dabh/diagnostics": { "version": "2.0.3", "license": "MIT", @@ -2646,6 +3112,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-timsort": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "dev": true + }, "node_modules/array-union": { "version": "2.1.0", "dev": true, @@ -3307,6 +3779,33 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chalk-template": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-1.1.0.tgz", + "integrity": "sha512-T2VJbcDuZQ0Tb2EWwSotMPJjgpy1/tGee1BTpUNsGZ/qgNjV2t7Mvu+d4600U564nbLesN1x2dPL+xii174Ekg==", + "dev": true, + "dependencies": { + "chalk": "^5.2.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/chalk/chalk-template?sponsor=1" + } + }, + "node_modules/chalk-template/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/check-error": { "version": "2.1.1", "dev": true, @@ -3347,6 +3846,43 @@ "node": ">=6" } }, + "node_modules/clear-module": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz", + "integrity": "sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==", + "dev": true, + "dependencies": { + "parent-module": "^2.0.0", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clear-module/node_modules/parent-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", + "integrity": "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==", + "dev": true, + "dependencies": { + "callsites": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/clear-module/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/cli-cursor": { "version": "3.1.0", "dev": true, @@ -3483,6 +4019,22 @@ "node": ">= 6" } }, + "node_modules/comment-json": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.5.tgz", + "integrity": "sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==", + "dev": true, + "dependencies": { + "array-timsort": "^1.0.3", + "core-util-is": "^1.0.3", + "esprima": "^4.0.1", + "has-own-prop": "^2.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/commondir": { "version": "1.0.1", "dev": true, @@ -3632,6 +4184,262 @@ "node": "*" } }, + "node_modules/cspell": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.13.3.tgz", + "integrity": "sha512-2wv4Eby7g8wDB553fI8IoZjyitoKrD2kmtdeoYUN2EjVs3RMpIOver3fL+0VaFAaN0uLfAoeAAIB5xJEakvZYQ==", + "dev": true, + "dependencies": { + "@cspell/cspell-json-reporter": "8.13.3", + "@cspell/cspell-pipe": "8.13.3", + "@cspell/cspell-types": "8.13.3", + "@cspell/dynamic-import": "8.13.3", + "@cspell/url": "8.13.3", + "chalk": "^5.3.0", + "chalk-template": "^1.1.0", + "commander": "^12.1.0", + "cspell-dictionary": "8.13.3", + "cspell-gitignore": "8.13.3", + "cspell-glob": "8.13.3", + "cspell-io": "8.13.3", + "cspell-lib": "8.13.3", + "fast-glob": "^3.3.2", + "fast-json-stable-stringify": "^2.1.0", + "file-entry-cache": "^9.0.0", + "get-stdin": "^9.0.0", + "semver": "^7.6.3", + "strip-ansi": "^7.1.0" + }, + "bin": { + "cspell": "bin.mjs", + "cspell-esm": "bin.mjs" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/streetsidesoftware/cspell?sponsor=1" + } + }, + "node_modules/cspell-config-lib": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.13.3.tgz", + "integrity": "sha512-dzVdar8Kenwxho0PnUxOxwjUvyFYn6Q9mQAMHcQNXQrvo32bdpoF+oNtWC/5FfrQgUgyl19CVQ607bRigYWoOQ==", + "dev": true, + "dependencies": { + "@cspell/cspell-types": "8.13.3", + "comment-json": "^4.2.5", + "yaml": "^2.5.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-dictionary": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.13.3.tgz", + "integrity": "sha512-DQ3Tee7LIoy+9Mu52ht32O/MNBZ6i4iUeSTY2sMDDwogno3361BLRyfEjyiYNo3Fqf0Pcnt5MqY2DqIhrF/H/Q==", + "dev": true, + "dependencies": { + "@cspell/cspell-pipe": "8.13.3", + "@cspell/cspell-types": "8.13.3", + "cspell-trie-lib": "8.13.3", + "fast-equals": "^5.0.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-gitignore": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.13.3.tgz", + "integrity": "sha512-0OZXuP33CXV4P95ySHGNqhq3VR5RaLwpyo0nGvLHOjPm3mCsQSjURLBKHvyQ3r2M7LWsGV1Xc81FfTx30FBZLg==", + "dev": true, + "dependencies": { + "@cspell/url": "8.13.3", + "cspell-glob": "8.13.3", + "cspell-io": "8.13.3", + "find-up-simple": "^1.0.0" + }, + "bin": { + "cspell-gitignore": "bin.mjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-glob": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.13.3.tgz", + "integrity": "sha512-+jGIMYyKDLmoOJIxNPXRdI7utcvw+9FMSmj1ApIdEff5dCkehi0gtzK4H7orXGYEvRdKQvfaXiyduVi79rXsZQ==", + "dev": true, + "dependencies": { + "@cspell/url": "8.13.3", + "micromatch": "^4.0.7" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-grammar": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.13.3.tgz", + "integrity": "sha512-xPSgKk9HY5EsI8lkMPC9hiZCeAUs+RY/IVliUBW1xEicAJhP4RZIGRdIwtDNNJGwKfNXazjqYhcS4LS0q7xPAQ==", + "dev": true, + "dependencies": { + "@cspell/cspell-pipe": "8.13.3", + "@cspell/cspell-types": "8.13.3" + }, + "bin": { + "cspell-grammar": "bin.mjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-io": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.13.3.tgz", + "integrity": "sha512-AeMIkz7+4VuJaPKO/v1pUpyUSOOTyLOAfzeTRRAXEt+KRKOUe36MyUmBMza6gzNcX2yD04VgJukRL408TY9ntw==", + "dev": true, + "dependencies": { + "@cspell/cspell-service-bus": "8.13.3", + "@cspell/url": "8.13.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-lib": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.13.3.tgz", + "integrity": "sha512-aEqxIILeqDtNoCa47/oSl5c926b50ue3PobYs4usn0Ymf0434RopCP+DCGsF7BPtog4j4XWnEmvkcJs57DYWDg==", + "dev": true, + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.13.3", + "@cspell/cspell-pipe": "8.13.3", + "@cspell/cspell-resolver": "8.13.3", + "@cspell/cspell-types": "8.13.3", + "@cspell/dynamic-import": "8.13.3", + "@cspell/strong-weak-map": "8.13.3", + "@cspell/url": "8.13.3", + "clear-module": "^4.1.2", + "comment-json": "^4.2.5", + "cspell-config-lib": "8.13.3", + "cspell-dictionary": "8.13.3", + "cspell-glob": "8.13.3", + "cspell-grammar": "8.13.3", + "cspell-io": "8.13.3", + "cspell-trie-lib": "8.13.3", + "env-paths": "^3.0.0", + "fast-equals": "^5.0.1", + "gensequence": "^7.0.0", + "import-fresh": "^3.3.0", + "resolve-from": "^5.0.0", + "vscode-languageserver-textdocument": "^1.0.12", + "vscode-uri": "^3.0.8", + "xdg-basedir": "^5.1.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-lib/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cspell-trie-lib": { + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.13.3.tgz", + "integrity": "sha512-Z0iLGi9HI+Vf+WhVVeru6dYgQdtaYCKWRlc1SayLfAZhw9BcjrXL8KTXDfAfv/lUgnRu6xwP1isLlDNZECsKVQ==", + "dev": true, + "dependencies": { + "@cspell/cspell-pipe": "8.13.3", + "@cspell/cspell-types": "8.13.3", + "gensequence": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/cspell/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cspell/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell/node_modules/file-entry-cache": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.0.0.tgz", + "integrity": "sha512-6MgEugi8p2tiUhqO7GnPsmbCCzj0YRCwwaTbpGRyKZesjRSzkqkAE9fPp7V2yMs5hwfgbQLgdvSSkGNg1s5Uvw==", + "dev": true, + "dependencies": { + "flat-cache": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell/node_modules/flat-cache": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-5.0.0.tgz", + "integrity": "sha512-JrqFmyUl2PnPi1OvLyTVHnQvwQ0S+e6lGSwu8OkAZlSaNIZciTY2H/cOOROxsBA1m/LZNHDsqAgDZt6akWcjsQ==", + "dev": true, + "dependencies": { + "flatted": "^3.3.1", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/damerau-levenshtein": { "version": "1.0.8", "dev": true, @@ -4057,6 +4865,18 @@ "node": ">=10" } }, + "node_modules/env-paths": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", + "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/es-abstract": { "version": "1.23.3", "dev": true, @@ -5570,6 +6390,15 @@ "dev": true, "license": "Apache-2.0" }, + "node_modules/fast-equals": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz", + "integrity": "sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/fast-fifo": { "version": "1.3.2", "dev": true, @@ -5806,6 +6635,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/find-up-simple": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", + "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/findup": { "version": "0.1.5", "dev": true, @@ -5948,6 +6789,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gensequence": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-7.0.0.tgz", + "integrity": "sha512-47Frx13aZh01afHJTB3zTtKIlFI6vWY+MYCN9Qpew6i52rfKjnhCF/l1YlC8UmEMvvntZZ6z4PiCcmyuedR2aQ==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "dev": true, @@ -6001,6 +6851,18 @@ "node": ">=8.0.0" } }, + "node_modules/get-stdin": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz", + "integrity": "sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-stream": { "version": "6.0.1", "dev": true, @@ -6084,6 +6946,21 @@ "node": ">=10.13.0" } }, + "node_modules/global-directory": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", + "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", + "dev": true, + "dependencies": { + "ini": "4.1.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/globals": { "version": "13.24.0", "dev": true, @@ -6218,6 +7095,15 @@ "node": ">=8" } }, + "node_modules/has-own-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", + "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/has-property-descriptors": { "version": "1.0.2", "license": "MIT", @@ -6392,6 +7278,8 @@ }, "node_modules/ieee754": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "funding": [ { "type": "github", @@ -6405,8 +7293,7 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "BSD-3-Clause" + ] }, "node_modules/ignore": { "version": "5.3.2", @@ -6431,6 +7318,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/import-meta-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", + "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "dev": true, @@ -6460,6 +7357,15 @@ "version": "2.0.4", "license": "ISC" }, + "node_modules/ini": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/internal-slot": { "version": "1.0.7", "dev": true, @@ -9307,6 +10213,15 @@ "node": ">=4" } }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, "node_modules/require-directory": { "version": "2.1.1", "license": "MIT", @@ -9677,6 +10592,8 @@ }, "node_modules/semver": { "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, "license": "ISC", "bin": { @@ -11920,6 +12837,12 @@ "dev": true, "license": "MIT" }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", + "dev": true + }, "node_modules/vscode-oniguruma": { "version": "1.7.0", "dev": true, @@ -11927,8 +12850,15 @@ }, "node_modules/vscode-textmate": { "version": "5.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", + "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", + "dev": true + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==", + "dev": true }, "node_modules/weak-lru-cache": { "version": "1.2.2", @@ -12239,6 +13169,18 @@ } } }, + "node_modules/xdg-basedir": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", + "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/xtend": { "version": "4.0.2", "dev": true, @@ -12261,6 +13203,8 @@ }, "node_modules/yaml": { "version": "2.5.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", + "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", "dev": true, "license": "ISC", "bin": { diff --git a/package.json b/package.json index b0e228226a..284355ab03 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,9 @@ "scripts": { "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\" -e \"./packages/wallet/test\" -e \"./packages/client/archive\" -c ./config/cspell-ts.json \"./packages/**/*.ts\" --cache --show-suggestions --show-context", + "cspell:md": "npx cspell --gitignore -e \"./packages/ethereum-tests\" -e \"./packages/client/withdrawals-testnet/**\" -e \"./packages/**/docs\" -c ./config/cspell-md.json \"**.md\" --cache --show-suggestions --show-context", "docs:build": "npm run docs:build --workspaces --if-present", "e2e:inject": "node ./scripts/e2e-inject-resolutions.js", "e2e:publish": "./scripts/e2e-publish.sh", @@ -34,6 +37,7 @@ "@vitest/coverage-v8": "^v2.0.0-beta.1", "@vitest/ui": "^v2.0.0-beta.12", "c8": "7.12.0", + "cspell": "^8.13.3", "embedme": "1.22.1", "eslint": "8.57.0", "eslint-config-prettier": "^9.1.0", diff --git a/packages/block/CHANGELOG.md b/packages/block/CHANGELOG.md index f2dc4d8ec0..6424716c49 100644 --- a/packages/block/CHANGELOG.md +++ b/packages/block/CHANGELOG.md @@ -312,7 +312,7 @@ While you could use our libraries in the browser libraries before, there had bee WE HAVE ELIMINATED ALL OF THEM. -The largest two undertakings: First: we have rewritten all (half) of our API and elimited the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went throuh our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. +The largest two undertakings: First: we have rewritten all (half) of our API and eliminated the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went through our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. Together with some few other modifications this now allows to run each (maybe adding an asterisk for client and devp2p) of our libraries directly in the browser - more or less without any modifications - see the `examples/browser.html` file in each package folder for an easy to set up example. @@ -636,11 +636,11 @@ common.setForkHashes(genesisHash) ### New RPC and Ethers Static Constructors -Two new static constructos have been added to the library, see PR [#2315](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2315) `Block.fromEthersProvider()` allows for an easy instantiation of a `Block` object using an [Ethers](https://ethers.io) provider connecting e.g. to a local node or a service provider like Infura. The `Block.fromRPC()` static constructor can be used for a straight-forward block instantiation if the block data is coming from an RPC request. This static constructor replaces the old standalong `blockFromRPC()` method which is now marked as `deprecated`. +Two new static constructors have been added to the library, see PR [#2315](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2315) `Block.fromEthersProvider()` allows for an easy instantiation of a `Block` object using an [Ethers](https://ethers.io) provider connecting e.g. to a local node or a service provider like Infura. The `Block.fromRPC()` static constructor can be used for a straight-forward block instantiation if the block data is coming from an RPC request. This static constructor replaces the old standalone `blockFromRPC()` method which is now marked as `deprecated`. ### Other Changes and Fixes -- Adressed several typing issues in the `blockFromRPC()` method, PR [#2302](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2302) +- Addressed several typing issues in the `blockFromRPC()` method, PR [#2302](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2302) ## 4.0.0 - 2022-09-06 @@ -707,7 +707,7 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely dissalows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). @@ -715,7 +715,7 @@ Now every import is a named import and we think the long term benefits will very #### Common Library Import Updates -Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all accross our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. +Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all across our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. So Common import and usage is changing from: @@ -923,7 +923,7 @@ invalid transaction trie (block number=1 hash=0xe074b7b8d725c4000f278ae55cedbc76 The extended errors give substantial more object and chain context and should ease debugging. -**Potentially breaking**: Attention! If you do react on errors in your code and do exact errror matching (`error.message === 'invalid transaction trie'`) things will break. Please make sure to do error comparisons with something like `error.message.includes('invalid transaction trie')` instead. This should generally be the pattern used for all error message comparisions and is assured to be future proof on all error messages (we won't change the core text in non-breaking releases). +**Potentially breaking**: Attention! If you do react on errors in your code and do exact error matching (`error.message === 'invalid transaction trie'`) things will break. Please make sure to do error comparisons with something like `error.message.includes('invalid transaction trie')` instead. This should generally be the pattern used for all error message comparisons and is assured to be future proof on all error messages (we won't change the core text in non-breaking releases). ### Other Changes @@ -944,7 +944,7 @@ This release comes with experimental support for the Merge HF as defined in [EIP #### PoS Block Instantiation -Proof-of-Stake compatible execution blocks come with its own set of header field simplifications and associated validation rules. The difficuly is set to `0` since not relevant any more, just to name an example. For a full list of changes see `EIP-3675`. +Proof-of-Stake compatible execution blocks come with its own set of header field simplifications and associated validation rules. The difficulty is set to `0` since not relevant any more, just to name an example. For a full list of changes see `EIP-3675`. You can instantiate a Merge/PoS block like this: @@ -1176,7 +1176,7 @@ const valuesArray = header.raw() BlockHeader.fromValuesArray(valuesArray) ``` -Generally internal types representing block header values are now closer to their domain representation (number, difficulty, gasLimit) instead of having everthing represented as a `Buffer`. +Generally internal types representing block header values are now closer to their domain representation (number, difficulty, gasLimit) instead of having everything represented as a `Buffer`. **Block Class** @@ -1190,9 +1190,9 @@ Learn more about the full API in the [docs](./docs/README.md). #### Immutability -The returned block is now frozen and immutable. To work with a maliable block, copy it with `const fakeBlock = Object.create(block)`. +The returned block is now frozen and immutable. To work with a mutable block, copy it with `const fakeBlock = Object.create(block)`. -If you need `Block` mutability - e.g. because you want to subclass `Block` and modifiy its behavior - there is a `freeze` option to prevent the `Object.freeze()` call on initialization, see PR [#941](https://github.com/ethereumjs/ethereumjs-monorepo/pull/941). +If you need `Block` mutability - e.g. because you want to subclass `Block` and modify its behavior - there is a `freeze` option to prevent the `Object.freeze()` call on initialization, see PR [#941](https://github.com/ethereumjs/ethereumjs-monorepo/pull/941). #### Promise-based API @@ -1239,13 +1239,13 @@ On the `Block` library new corresponding methods have been added which both oper **Breaking:** The default HF on the library has been updated from `petersburg` to `istanbul`, see PR [#906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/906). -The HF setting is now automatically taken from the HF set for `Common.DEAULT_HARDFORK`, see PR [#863](https://github.com/ethereumjs/ethereumjs-monorepo/pull/863). +The HF setting is now automatically taken from the HF set for `Common.DEFAULT_HARDFORK`, see PR [#863](https://github.com/ethereumjs/ethereumjs-monorepo/pull/863). ### Dual ES5 and ES2017 Builds We significantly updated our internal tool and CI setup along the work on PR [#913](https://github.com/ethereumjs/ethereumjs-monorepo/pull/913) with an update to `ESLint` from `TSLint` for code linting and formatting and the introduction of a new build setup. -Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes @@ -1385,7 +1385,7 @@ BlockHeader.fromValuesArray(valuesArray) ``` Generally internal types representing block header values are now closer to their domain representation -(number, difficulty, gasLimit) instead of having everthing represented as a `Buffer`. +(number, difficulty, gasLimit) instead of having everything represented as a `Buffer`. **Block Class** @@ -1399,7 +1399,7 @@ Learn more about the full API in the [docs](./docs/README.md). #### Immutability -The returned block is now frozen and immutable. To work with a maliable block, copy it with `const fakeBlock = Object.create(block)`. +The returned block is now frozen and immutable. To work with a mutable block, copy it with `const fakeBlock = Object.create(block)`. #### Promise-based API @@ -1445,7 +1445,7 @@ as an input parameter. ### New Default Hardfork **Breaking:** The default HF on the library has been updated from `petersburg` to `istanbul`, see PR [#906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/906). -The HF setting is now automatically taken from the HF set for `Common.DEAULT_HARDFORK`, +The HF setting is now automatically taken from the HF set for `Common.DEFAULT_HARDFORK`, see PR [#863](https://github.com/ethereumjs/ethereumjs-monorepo/pull/863). ### Dual ES5 and ES2017 Builds @@ -1457,7 +1457,7 @@ for code linting and formatting and the introduction of a new build setup. Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result -in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes diff --git a/packages/block/src/from-beacon-payload.ts b/packages/block/src/from-beacon-payload.ts index ec9c4d275f..6a213d9e93 100644 --- a/packages/block/src/from-beacon-payload.ts +++ b/packages/block/src/from-beacon-payload.ts @@ -156,27 +156,29 @@ export function executionPayloadFromBeaconPayload(payload: BeaconPayloadJson): E // requests if (payload.deposit_requests !== undefined && payload.deposit_requests !== null) { - executionPayload.depositRequests = payload.deposit_requests.map((breq) => ({ - pubkey: breq.pubkey, - withdrawalCredentials: breq.withdrawal_credentials, - amount: breq.amount, - signature: breq.signature, - index: breq.index, + executionPayload.depositRequests = payload.deposit_requests.map((beaconRequest) => ({ + pubkey: beaconRequest.pubkey, + withdrawalCredentials: beaconRequest.withdrawal_credentials, + amount: beaconRequest.amount, + signature: beaconRequest.signature, + index: beaconRequest.index, })) } if (payload.withdrawal_requests !== undefined && payload.withdrawal_requests !== null) { - executionPayload.withdrawalRequests = payload.withdrawal_requests.map((breq) => ({ - sourceAddress: breq.source_address, - validatorPubkey: breq.validator_pubkey, - amount: breq.amount, + executionPayload.withdrawalRequests = payload.withdrawal_requests.map((beaconRequest) => ({ + sourceAddress: beaconRequest.source_address, + validatorPubkey: beaconRequest.validator_pubkey, + amount: beaconRequest.amount, })) } if (payload.consolidation_requests !== undefined && payload.consolidation_requests !== null) { - executionPayload.consolidationRequests = payload.consolidation_requests.map((breq) => ({ - sourceAddress: breq.source_address, - sourcePubkey: breq.source_pubkey, - targetPubkey: breq.target_pubkey, - })) + executionPayload.consolidationRequests = payload.consolidation_requests.map( + (beaconRequest) => ({ + sourceAddress: beaconRequest.source_address, + sourcePubkey: beaconRequest.source_pubkey, + targetPubkey: beaconRequest.target_pubkey, + }), + ) } if (payload.execution_witness !== undefined && payload.execution_witness !== null) { diff --git a/packages/block/src/header/header.ts b/packages/block/src/header/header.ts index c3cdeb9123..f5afcfaedf 100644 --- a/packages/block/src/header/header.ts +++ b/packages/block/src/header/header.ts @@ -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 diff --git a/packages/block/src/helpers.ts b/packages/block/src/helpers.ts index 0f2db507d9..79538dd20d 100644 --- a/packages/block/src/helpers.ts +++ b/packages/block/src/helpers.ts @@ -109,10 +109,10 @@ export const getNumBlobs = (transactions: TypedTransaction[]) => { export const fakeExponential = (factor: bigint, numerator: bigint, denominator: bigint) => { let i = BIGINT_1 let output = BIGINT_0 - let numerator_accum = factor * denominator - while (numerator_accum > BIGINT_0) { - output += numerator_accum - numerator_accum = (numerator_accum * numerator) / (denominator * i) + let numerator_accumulator = factor * denominator + while (numerator_accumulator > BIGINT_0) { + output += numerator_accumulator + numerator_accumulator = (numerator_accumulator * numerator) / (denominator * i) i++ } diff --git a/packages/block/src/params.ts b/packages/block/src/params.ts index 94472f0eba..d4277f3329 100644 --- a/packages/block/src/params.ts +++ b/packages/block/src/params.ts @@ -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 diff --git a/packages/block/test/block.spec.ts b/packages/block/test/block.spec.ts index e75feda9dc..b830005b7f 100644 --- a/packages/block/test/block.spec.ts +++ b/packages/block/test/block.spec.ts @@ -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' @@ -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 diff --git a/packages/block/test/clique.spec.ts b/packages/block/test/clique.spec.ts index 4f55dcac8d..a170d42c80 100644 --- a/packages/block/test/clique.spec.ts +++ b/packages/block/test/clique.spec.ts @@ -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 }) diff --git a/packages/block/test/eip4844block.spec.ts b/packages/block/test/eip4844block.spec.ts index a7b3ba9608..a81c55dd0f 100644 --- a/packages/block/test/eip4844block.spec.ts +++ b/packages/block/test/eip4844block.spec.ts @@ -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', ) }) }) diff --git a/packages/block/test/eip4895block.spec.ts b/packages/block/test/eip4895block.spec.ts index 4be6264c65..13e7835363 100644 --- a/packages/block/test/eip4895block.spec.ts +++ b/packages/block/test/eip4895block.spec.ts @@ -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', ) }) diff --git a/packages/block/test/from-beacon-payload.spec.ts b/packages/block/test/from-beacon-payload.spec.ts index 1d78598650..f634235ea7 100644 --- a/packages/block/test/from-beacon-payload.spec.ts +++ b/packages/block/test/from-beacon-payload.spec.ts @@ -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) }) @@ -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], diff --git a/packages/block/test/from-rpc.spec.ts b/packages/block/test/from-rpc.spec.ts index 2659fdee52..950cdbec25 100644 --- a/packages/block/test/from-rpc.spec.ts +++ b/packages/block/test/from-rpc.spec.ts @@ -11,9 +11,9 @@ import { import * as alchemy14151203 from './testdata/alchemy14151203.json' import * as infuraGoerliBlock10536893 from './testdata/infura-goerli-block-10536893.json' import * as infura15571241woTxs from './testdata/infura15571241.json' -import * as infura15571241wTxs from './testdata/infura15571241wtxns.json' -import * as infura2000004woTxs from './testdata/infura2000004wotxns.json' -import * as infura2000004wTxs from './testdata/infura2000004wtxs.json' +import * as infura15571241wTxs from './testdata/infura15571241wtxns.json' // cspell:disable-line +import * as infura2000004woTxs from './testdata/infura2000004wotxns.json' // cspell:disable-line +import * as infura2000004wTxs from './testdata/infura2000004wtxs.json' // cspell:disable-line import * as blockDataDifficultyAsInteger from './testdata/testdata-from-rpc-difficulty-as-integer.json' import * as testDataFromRpcGoerliLondon from './testdata/testdata-from-rpc-goerli-london.json' import * as blockDataWithUncles from './testdata/testdata-from-rpc-with-uncles.json' @@ -168,7 +168,7 @@ describe('[fromRPC] - Alchemy/Infura API block responses', () => { it('should correctly parse a cancun block over rpc', () => { const common = new Common({ chain: Goerli, hardfork: Hardfork.Cancun }) - const block = blockHeaderFromRpc(infuraGoerliBlock10536893 as JsonRpcBlock, { common }) + const block = blockHeaderFromRpc(infuraGoerliBlock10536893 as JsonRpcBlock, { common }) // cspell:disable-line const hash = hexToBytes(infuraGoerliBlock10536893.hash as PrefixedHexString) assert.ok(equalsBytes(block.hash(), hash)) }) @@ -184,7 +184,7 @@ describe('[fromJsonRpcProvider]', () => { global.fetch = async (_url: string, req: any) => { const json = JSON.parse(req.body) if (json.params[0] === '0x1850b014065b23d804ecf71a8a4691d076ca87c2e6fb8fe81ee20a4d8e884c24') { - const txData = await import(`./testdata/infura15571241wtxns.json`) + const txData = await import(`./testdata/infura15571241wtxns.json`) // cspell:disable-line return { ok: true, status: 200, diff --git a/packages/block/test/mergeBlock.spec.ts b/packages/block/test/mergeBlock.spec.ts index ab323cf499..ccc7a6f8bd 100644 --- a/packages/block/test/mergeBlock.spec.ts +++ b/packages/block/test/mergeBlock.spec.ts @@ -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( diff --git a/packages/block/test/testdata/genesishashestest.json b/packages/block/test/testdata/genesisHashesTest.json similarity index 100% rename from packages/block/test/testdata/genesishashestest.json rename to packages/block/test/testdata/genesisHashesTest.json diff --git a/packages/blockchain/CHANGELOG.md b/packages/blockchain/CHANGELOG.md index 78dde08dc6..7daea0dbec 100644 --- a/packages/blockchain/CHANGELOG.md +++ b/packages/blockchain/CHANGELOG.md @@ -151,7 +151,7 @@ While you could use our libraries in the browser libraries before, there had bee WE HAVE ELIMINATED ALL OF THEM. -The largest two undertakings: First: we have rewritten all (half) of our API and elimited the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went throuh our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. +The largest two undertakings: First: we have rewritten all (half) of our API and eliminated the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went through our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. Together with some few other modifications this now allows to run each (maybe adding an asterisk for client and devp2p) of our libraries directly in the browser - more or less without any modifications - see the `examples/browser.html` file in each package folder for an easy to set up example. @@ -276,7 +276,7 @@ Please therefore check you code base on updating and ensure that values you are - Breaking: `Blockchain._common` property has been renamed to `Blockchain.common`, PR [#2857](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2857) - Fixed clique signer reorg scenario, PR [#2610](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2610) - Fix handling of nested uint8Arrays in JSON in DB, PR [#2666](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2666) -- Save iterator head to last successfuly executed even on errors, PR [#2680](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2680) +- Save iterator head to last successfully executed even on errors, PR [#2680](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2680) ## 6.2.2 - 2023-04-20 @@ -321,7 +321,7 @@ So the Blockchain interface was - falsely - claiming that there would be the pos We now fixed this by removing the `null` from the interface return values - see PR [#2524](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2524), after exploring the other way around as well (and the reverting), see PR [#2516](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2516). -While this might lead to breaking code constallations on the TypeScript level if this `null` value is picked up we felt this is the right thing to do since this divergence would otherwise continue to "trick" people into assuming and dealing with `null` values for non-existing-block assumptions in their code and continue to produce eventual bugs (we actually fell over this ourselves). +While this might lead to breaking code constellations on the TypeScript level if this `null` value is picked up we felt this is the right thing to do since this divergence would otherwise continue to "trick" people into assuming and dealing with `null` values for non-existing-block assumptions in their code and continue to produce eventual bugs (we actually fell over this ourselves). A bit on the verge of breaking vs. bug fixing, sorry if you are eventually affected, but we just can't do a single breaking release update for a fix on that level. @@ -434,7 +434,7 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely dissalows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). @@ -442,7 +442,7 @@ Now every import is a named import and we think the long term benefits will very #### Common Library Import Updates -Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all accross our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. +Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all across our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. So Common import and usage is changing from: @@ -476,7 +476,7 @@ import { Blockchain } from '@ethereumjs/blockchain' ## Blockchain Consensus Option -The Blockchain library now has a new optional `consensus` constructor options parameter which can be used to pass in a customized or own consensus class respectively implementation, e.g. a modfifed Ethash version or a Clique implementation with adopted parameters or the like, see PR [#2002](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2002) to get a grasp on the integration. +The Blockchain library now has a new optional `consensus` constructor options parameter which can be used to pass in a customized or own consensus class respectively implementation, e.g. a modified Ethash version or a Clique implementation with adopted parameters or the like, see PR [#2002](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2002) to get a grasp on the integration. ## Other Changes @@ -562,7 +562,7 @@ The following methods have been taken out of the `Block` package and moved into - `BlockHeader.validateDifficulty()`, `BlockHeader.validateCliqueDifficulty()` -> `Blockchain.consensus.validateDifficulty()` - `Block.validateUncles()` -> to `Blockchain`, kept private (let us know if you need to call into the functionality) -### New File Structue +### New File Structure The file structure of the package has been reworked and aligned with other libraries, see PR [#1986](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1986). There is now a dedicated `blockchain.ts` file for the main source code. The `index.ts` is now re-exporting the `Blockchain` class and `Consensus` implementations as well as the `BlockchainInterface` interface, the `BlockchainOptions` dictionary and types from a dedicated `types.ts` file. @@ -759,13 +759,13 @@ Genesis handling has been reworked to now be safer and reduce the risk of wiping ### Removed deprecated `validate` option -The deprecated `validate` option has been removed, please use `valdiateBlock` and `validatePow` for options when instantiating a new `Blockchain`. +The deprecated `validate` option has been removed, please use `validateBlock` and `validatePow` for options when instantiating a new `Blockchain`. ### Dual ES5 and ES2017 Builds We significantly updated our internal tool and CI setup along the work on PR [#913](https://github.com/ethereumjs/ethereumjs-monorepo/pull/913) with an update to `ESLint` from `TSLint` for code linting and formatting and the introduction of a new build setup. -Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes @@ -884,7 +884,7 @@ const blockchain = new Blockchain({ common }) ### Removed deprecated `validate` option -The deprecated `validate` option has been removed, please use `valdiateBlock` and `validatePow` for options when instantiating a new `Blockchain`. +The deprecated `validate` option has been removed, please use `validateBlock` and `validatePow` for options when instantiating a new `Blockchain`. ### Dual ES5 and ES2017 Builds @@ -895,7 +895,7 @@ for code linting and formatting and the introduction of a new build setup. Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result -in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes diff --git a/packages/blockchain/README.md b/packages/blockchain/README.md index 1bae18a2b3..b3f67525da 100644 --- a/packages/blockchain/README.md +++ b/packages/blockchain/README.md @@ -182,7 +182,7 @@ The blockchain library now allows for blob transactions to be validated and incl ### EIP-7685 Requests Support -This libary supports blocks including the following [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685) requests: +This library supports blocks including the following [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685) requests: - [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110) - Deposit Requests (`v7.3.0`+) - [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002) - Withdrawal Requests (`v7.3.0`+) diff --git a/packages/blockchain/src/blockchain.ts b/packages/blockchain/src/blockchain.ts index a50b1bf933..89db94edda 100644 --- a/packages/blockchain/src/blockchain.ts +++ b/packages/blockchain/src/blockchain.ts @@ -42,9 +42,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 { @@ -453,7 +453,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 @@ -940,7 +940,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, ) @@ -1271,7 +1271,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 diff --git a/packages/blockchain/src/consensus/clique.ts b/packages/blockchain/src/consensus/clique.ts index dc7af67ea9..c7d78cbf8c 100644 --- a/packages/blockchain/src/consensus/clique.ts +++ b/packages/blockchain/src/consensus/clique.ts @@ -120,7 +120,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 */ @@ -547,8 +547,8 @@ export class CliqueConsensus implements Consensus { const states = RLP.decode(signerStates as Uint8Array) as [Uint8Array, Uint8Array[]] return states.map((state) => { const blockNum = bytesToBigInt(state[0] as Uint8Array) - const addrs = (state[1]).map((bytes: Uint8Array) => new Address(bytes)) - return [blockNum, addrs] + const addresses = (state[1]).map((bytes: Uint8Array) => new Address(bytes)) + return [blockNum, addresses] }) as CliqueLatestSignerStates } diff --git a/packages/blockchain/src/db/constants.ts b/packages/blockchain/src/db/constants.ts index a7936b804f..5b365937ac 100644 --- a/packages/blockchain/src/db/constants.ts +++ b/packages/blockchain/src/db/constants.ts @@ -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 @@ -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 diff --git a/packages/blockchain/src/db/manager.ts b/packages/blockchain/src/db/manager.ts index bca9cee717..42f826c464 100644 --- a/packages/blockchain/src/db/manager.ts +++ b/packages/blockchain/src/db/manager.ts @@ -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 diff --git a/packages/blockchain/src/types.ts b/packages/blockchain/src/types.ts index c46debba28..0eee200bf8 100644 --- a/packages/blockchain/src/types.ts +++ b/packages/blockchain/src/types.ts @@ -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. @@ -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 diff --git a/packages/blockchain/test/clique.spec.ts b/packages/blockchain/test/clique.spec.ts index f4307ac872..08effb50b7 100644 --- a/packages/blockchain/test/clique.spec.ts +++ b/packages/blockchain/test/clique.spec.ts @@ -535,7 +535,7 @@ describe('Clique: Initialization', () => { blocks[blocks.length - 1].header.number + BigInt(1), ), [A.address, B.address], - 'deauth votes', + 'deauthorized votes', ) }) @@ -555,7 +555,7 @@ describe('Clique: Initialization', () => { ) }) - it('Clique Voting: Changes reaching consensus out of bounds (via a deauth) execute on touch', async () => { + it('Clique Voting: Changes reaching consensus out of bounds (via a deauthorization) execute on touch', async () => { const { blocks, blockchain } = await initWithSigners([A, B, C, D]) await addNextBlock(blockchain, blocks, A, [C, false]) await addNextBlock(blockchain, blocks, B) @@ -577,7 +577,7 @@ describe('Clique: Initialization', () => { ) }) - it('Clique Voting: Changes reaching consensus out of bounds (via a deauth) may go out of consensus on first touch', async () => { + it('Clique Voting: Changes reaching consensus out of bounds (via a deauthorization) may go out of consensus on first touch', async () => { const { blocks, blockchain } = await initWithSigners([A, B, C, D]) await addNextBlock(blockchain, blocks, A, [C, false]) await addNextBlock(blockchain, blocks, B) @@ -802,7 +802,7 @@ describe('clique: reorgs', () => { const { blocks, blockchain } = await initWithSigners([A, B]) const genesis = blocks[0] await addNextBlock(blockchain, blocks, A, [C, true]) - const headBlockUnforked = await addNextBlock(blockchain, blocks, B, [C, true]) + const headBlockNotForked = await addNextBlock(blockchain, blocks, B, [C, true]) assert.deepEqual( (blockchain.consensus as CliqueConsensus).cliqueActiveSigners( blocks[blocks.length - 1].header.number + BigInt(1), @@ -810,7 +810,7 @@ describe('clique: reorgs', () => { [A.address, B.address, C.address], 'address C added to signers', ) - assert.deepEqual((await blockchain.getCanonicalHeadBlock()).hash(), headBlockUnforked.hash()) + assert.deepEqual((await blockchain.getCanonicalHeadBlock()).hash(), headBlockNotForked.hash()) await addNextBlockReorg(blockchain, blocks, genesis, B) const headBlock = await addNextBlock(blockchain, blocks, A) assert.deepEqual((await blockchain.getCanonicalHeadBlock()).hash(), headBlock.hash()) @@ -852,7 +852,7 @@ describe('clique: reorgs', () => { await addNextBlock(blockchain, blocks, A, [C, true], undefined, common) await addNextBlock(blockchain, blocks, B, [C, true], undefined, common) await addNextBlock(blockchain, blocks, A, undefined, undefined, common) - const headBlockUnforked = await addNextBlock( + const headBlockNotForked = await addNextBlock( blockchain, blocks, B, @@ -867,7 +867,7 @@ describe('clique: reorgs', () => { [A.address, B.address, C.address], 'address C added to signers' ) - assert.deepEqual((await blockchain.getCanonicalHeadBlock()).hash(), headBlockUnforked.hash()) + assert.deepEqual((await blockchain.getCanonicalHeadBlock()).hash(), headBlockNotForked.hash()) await addNextBlockReorg(blockchain, blocks, genesis, B, undefined, undefined, common) await addNextBlock(blockchain, blocks, A, undefined, undefined, common) diff --git a/packages/blockchain/test/customConsensus.spec.ts b/packages/blockchain/test/customConsensus.spec.ts index 5865eb33eb..19083ade27 100644 --- a/packages/blockchain/test/customConsensus.spec.ts +++ b/packages/blockchain/test/customConsensus.spec.ts @@ -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( diff --git a/packages/blockchain/test/index.spec.ts b/packages/blockchain/test/index.spec.ts index 508358cd5a..e93de60cb3 100644 --- a/packages/blockchain/test/index.spec.ts +++ b/packages/blockchain/test/index.spec.ts @@ -444,11 +444,11 @@ describe('blockchain test', () => { calcDifficultyFromHeader: blocks[14].header, }) - blockchain._heads['staletest'] = blockchain._headHeaderHash + blockchain._heads['staleTest'] = blockchain._headHeaderHash await blockchain.putHeader(forkHeader) - assert.deepEqual(blockchain._heads['staletest'], blocks[14].hash(), 'should update stale head') + assert.deepEqual(blockchain._heads['staleTest'], blocks[14].hash(), 'should update stale head') assert.deepEqual(blockchain._headBlockHash, blocks[14].hash(), 'should update stale headBlock') }) @@ -469,11 +469,11 @@ describe('blockchain test', () => { calcDifficultyFromHeader: blocks[14].header, }) - blockchain._heads['staletest'] = blockchain._headHeaderHash + blockchain._heads['staleTest'] = blockchain._headHeaderHash await blockchain.putHeader(forkHeader) - assert.deepEqual(blockchain._heads['staletest'], blocks[14].hash(), 'should update stale head') + assert.deepEqual(blockchain._heads['staleTest'], blocks[14].hash(), 'should update stale head') assert.deepEqual(blockchain._headBlockHash, blocks[14].hash(), 'should update stale headBlock') await blockchain.delBlock(forkHeader.hash()) @@ -537,7 +537,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, diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index 7c6ceff4d8..4aeffdba21 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -25,7 +25,7 @@ This release comes with some RPC improvements as well as various updates to catc ### Other Features - Integrates support for [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) EOA code transactions (outdated) (see tx library for full documentation), see PR [#3470](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3470) -- New `--startExectionFrom` and `--startExecution` CLI options, PR [#3269](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3269) +- New `--startExecutionFrom` and `--startExecution` CLI options, PR [#3269](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3269) - Add `eth_blobBaseFee` RPC endpoint, PR [#3436](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3436) - Add support for `pending` in `eth_getTransactionCount` RPC method, PR [#3415](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3415) - Add support for multiple sources of rlp blocks when loading with `--loadBlocksFromRlp`, PR [#3442](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3442) @@ -87,7 +87,7 @@ Note that while HF timestamp switches for all testnets are included, a mainnet H ### WASM Crypto Support -With this release the client uses WASM by default for all crypto related operations like hashing or signature verification, see PR [#3192](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3192). As a WASM crypto library [@polkadot/wasm-crypto](https://github.com/polkadot-js/wasm/tree/master/packages/wasm-crypto) is being used and WASM comes into play in the EVM for hashing opcodes and precompiles, block and tx hashing and ECDSA signature verfication down to trie key hashing and all hashing and signature functionality in the devp2p layer. +With this release the client uses WASM by default for all crypto related operations like hashing or signature verification, see PR [#3192](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3192). As a WASM crypto library [@polkadot/wasm-crypto](https://github.com/polkadot-js/wasm/tree/master/packages/wasm-crypto) is being used and WASM comes into play in the EVM for hashing opcodes and precompiles, block and tx hashing and ECDSA signature verification down to trie key hashing and all hashing and signature functionality in the devp2p layer. This makes up for a significantly lighter and sped-up client experience regarding both block execution and sync times. @@ -134,7 +134,7 @@ Following spec updates included: - Additional `EIP-4788` updates (address + modulus), PR [#3068](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3068) - Update the beacon block root contract address, PR [#3003](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3003) - Fix `newPayloadV2` having `PayloadV3` params, PR [#2954](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2954) -- Include parent beacon block root for proposal payload uniquness, PR [#2967](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2967) +- Include parent beacon block root for proposal payload uniqueness, PR [#2967](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2967) - Fixes for new engine api method validations for hive pr-834, PR [#2973](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2973) - Track and respond to invalid blocks in engine api and other hive engine-cancun fixes, PR [#3077](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3077) - Make the newpayload execution of big blocks non blocking, PR [#3076](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3076) @@ -154,7 +154,7 @@ Both changes together should increase client sync performance by 30% or more. ### New Post-Merge UX Experience -We have gone through the complete post-Merge beacon sync process and reworked the client output along, see PR [#3085](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3085) and some follow-up PRs. It is now substantially easier to follow the different stages of the sync process (backfilling, forwardfilling & execution, following the chain) and track the overall sync progress. Holesky with its newly initialized state is a great testbed to see the new client capabilities in practice! 🤩 +We have gone through the complete post-Merge beacon sync process and reworked the client output along, see PR [#3085](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3085) and some follow-up PRs. It is now substantially easier to follow the different stages of the sync process (backfilling, forward filling & execution, following the chain) and track the overall sync progress. Holesky with its newly initialized state is a great testbed to see the new client capabilities in practice! 🤩 ### Block/Tx Profiling @@ -170,7 +170,7 @@ A new more fine-tuned discovery `discV4` mechanism has been integrated along PR - Decouple skeleton from beacon sync, PR [#3028](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3028) - Fix canonical reset of the chain by the skeleton, PR [#3078](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3078) - Skeleton reorg head fixes, PR [#3085](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3085) -- Fixes regarding beacon sync, vmexecution and further log improvs, PR [#3094](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3094) +- Fixes regarding beacon sync, vmexecution and further log improvements, PR [#3094](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3094) - Various rebase and sync related improvements along PR [#3031](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3031) ### Other Features @@ -298,7 +298,7 @@ ethereumjs --network=sepolia - Change withdrawal amount representation from Wei to Gwei, PR [#2483](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2483) - Fix forkchoiceUpdateV2 shanghai, PR [#2502](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2502) - Engine-api-validators, newPayloadV2 and newPayloadV3 updates, PR [#2504](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2504) -- Add new shanghai engine apis (getCapabilties, getPayloadBodiesByHashV1, getPayloadBodiesByRangeV1), PR [#2509](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2509) +- Add new shanghai engine apis (getCapabilities, getPayloadBodiesByHashV1, getPayloadBodiesByRangeV1), PR [#2509](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2509) - getPayloadBodiesByRange fixes, PR [#2518](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2518) - Changes engine_forkchoiceUpdatedV2 withdrawals parameter to `optional` to ensure we return the correct error message if a preShanghai payload is sent, PR [#2533](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2533) @@ -382,9 +382,9 @@ The Client is now ready to work with hardforks triggered by timestamp, which wil - Enhanced skeleton sync to process batches of new payloads and fcUs, PR [#2309](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2309) - Various tx pool fixes, PR [#2382](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2382) - Fixed skeleton reset scenario when head announced before subchain 0 tail, PR [#2408](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2408) -- Handle genesis and genesis extention properly for skeleton, PR [#2420](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2420) +- Handle genesis and genesis extension properly for skeleton, PR [#2420](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2420) - Fixed enode to ip4 and write the same to disk, PR [#2407](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2407) -- Fixed sendTransactions peer loop and enchance txpool logs, PR [#2412](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2412) +- Fixed sendTransactions peer loop and exchange txpool logs, PR [#2412](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2412) - Used unpadded int/bigint to buffer in net protocols (bug), PR [#2409](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2409) - Fixed handling of post-merge genesis blocks, PR [#2427](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2427) - Fixed logic bug in txPool.validate, PR [#2441](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2441) @@ -452,7 +452,7 @@ This is the first client release which works with the next generation EthereumJS ### DB Format Changes -Note that DB format has changed along with this release and it is therefore necessary to delete the old chain and state data directories. If this is causing you substantial hazzle please ask in our monorepo or Discord server on a migration script. While this will cause us some extra work it might actually be possible to provide one if there is some demand. +Note that DB format has changed along with this release and it is therefore necessary to delete the old chain and state data directories. If this is causing you substantial hassle please ask in our monorepo or Discord server on a migration script. While this will cause us some extra work it might actually be possible to provide one if there is some demand. ## Default Receipt Saving @@ -460,7 +460,7 @@ With the transition to PoS chains running the client in a CL/EL setup the activa Since the EthereumJS client is still mainly used in not-that-much-grown testnets and environments (so the additional disk space requirements are not that grave) we have therefore decided to turn the respective option `--saveReceipts` on by default, see PR [#2040](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2040). -You can use `--saveReceipts=false` if you would rather want to deactive again. +You can use `--saveReceipts=false` if you would rather want to deactivate again. ### Other Changes @@ -486,7 +486,7 @@ See PR [#1878](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1878) for ### TxPool Validation -With this release our tx pool grows into a still simple but full-grown and base-feature-complete pool by adding all sorts of validation checks to ensure validity with consensus, see PR [#1852](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1852). This is another substantial step towards fullfilling the requirements for acting as an active block-producing client in an Ethereum network. Validation checks - like e.g. "tx nonce is greater than sender's current nonce" - are now run early on when a tx is send via RPC `eth_sendRawTransaction` and feedback (and eventual rejection of the tx) is provided at the point of submission. This allows for building valid blocks when acting as a block producer. +With this release our tx pool grows into a still simple but full-grown and base-feature-complete pool by adding all sorts of validation checks to ensure validity with consensus, see PR [#1852](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1852). This is another substantial step towards fulfilling the requirements for acting as an active block-producing client in an Ethereum network. Validation checks - like e.g. "tx nonce is greater than sender's current nonce" - are now run early on when a tx is send via RPC `eth_sendRawTransaction` and feedback (and eventual rejection of the tx) is provided at the point of submission. This allows for building valid blocks when acting as a block producer. ### Fixes diff --git a/packages/client/DESIGN.md b/packages/client/DESIGN.md index 22f797c100..8056aff1d8 100644 --- a/packages/client/DESIGN.md +++ b/packages/client/DESIGN.md @@ -60,7 +60,7 @@ to help contributors better understand how the project is organized. and `removed` events when new peers are added and removed and also emit the `message` event whenever any of the peers in the pool emit a message. Each `Service` has an associated `PeerPool` and they are used primarily by `Synchronizer`s to help with blockchain synchronization. - `Synchronizer` Subclasses of this class implements a specific blockchain synchronization strategy. They - also make use of subclasses of the `Fetcher` class that help fetch headers and bodies from pool peers. The fetchers internally make use of streams to handle things like queuing and backpressure. + also make use of subclasses of the `Fetcher` class that help fetch headers and bodies from pool peers. The fetchers internally make use of streams to handle things like queuing and back pressure. - `FullSynchronizer` [**In Progress**] Implements full syncing of the blockchain - `LightSynchronizer` [**In Progress**] Implements light syncing of the blockchain - `Handler` Subclasses of this class implements a protocol message handler. Handlers respond to incoming requests from peers. diff --git a/packages/client/README.md b/packages/client/README.md index 0557861cd0..487ae47962 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -71,7 +71,7 @@ A Docker image is built nightly from the current master branch and can be retrie docker pull ethpandaops/ethereumjs:master ``` -Alternatively, an image from the most recent stable releast can be accessed via: +Alternatively, an image from the most recent stable release can be accessed via: ```sh docker pull ethpandaops/ethereumjs:stable diff --git a/packages/client/archive/libp2p/index.ts b/packages/client/archive/libp2p/index.ts index f7c1b46164..fb1dc945a5 100644 --- a/packages/client/archive/libp2p/index.ts +++ b/packages/client/archive/libp2p/index.ts @@ -1,3 +1,4 @@ +// cspell:ignore ppeer pnode pserver import { Blockchain } from '@ethereumjs/blockchain' import { Chain, Common } from '@ethereumjs/common' import debug from 'debug' @@ -72,7 +73,7 @@ export async function createClient(args: any) { }) config.events.setMaxListeners(50) const chainDB = new Level( - `${datadir}/${common.chainName()}` + `${datadir}/${common.chainName()}`, ) const blockchain = await createBlockchain({ diff --git a/packages/client/archive/libp2p/libp2pnode.ts b/packages/client/archive/libp2p/libp2pnode.ts index 2e532234fa..01903c52ef 100644 --- a/packages/client/archive/libp2p/libp2pnode.ts +++ b/packages/client/archive/libp2p/libp2pnode.ts @@ -1,3 +1,4 @@ +// cspell:ignore MPLEX Muxer /** * Libp2p Bundle * @memberof module:net/peer diff --git a/packages/client/archive/libp2p/net/peer/libp2pnode.ts b/packages/client/archive/libp2p/net/peer/libp2pnode.ts index 125ffe71f2..34c85539e3 100644 --- a/packages/client/archive/libp2p/net/peer/libp2pnode.ts +++ b/packages/client/archive/libp2p/net/peer/libp2pnode.ts @@ -1,4 +1,5 @@ //@ts-nocheck +// cspell:ignore MPLEX Muxer /** * Libp2p Bundle * @memberof module:net/peer diff --git a/packages/client/archive/libp2p/net/peer/libp2ppeer.ts b/packages/client/archive/libp2p/net/peer/libp2ppeer.ts index b6f3ff5543..8f89e78781 100644 --- a/packages/client/archive/libp2p/net/peer/libp2ppeer.ts +++ b/packages/client/archive/libp2p/net/peer/libp2ppeer.ts @@ -1,4 +1,5 @@ //@ts-nocheck +// cspell:ignore psender pnode muxed muxer import { multiaddr } from '@multiformats/multiaddr' import { Peer } from '../../../src/net/peer/peer' @@ -31,7 +32,7 @@ export interface Libp2pPeerOptions extends Omit { await Promise.all( this.protocols.map(async (p) => { @@ -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 diff --git a/packages/client/archive/libp2p/net/server/libp2pserver.ts b/packages/client/archive/libp2p/net/server/libp2pserver.ts index 89d46e3129..d283563e65 100644 --- a/packages/client/archive/libp2p/net/server/libp2pserver.ts +++ b/packages/client/archive/libp2p/net/server/libp2pserver.ts @@ -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' diff --git a/packages/client/bin/cli.ts b/packages/client/bin/cli.ts index 5d7a6a4885..b07643b535 100755 --- a/packages/client/bin/cli.ts +++ b/packages/client/bin/cli.ts @@ -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', { @@ -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', { @@ -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, }) diff --git a/packages/client/src/config.ts b/packages/client/src/config.ts index e35e017b84..1887149b31 100644 --- a/packages/client/src/config.ts +++ b/packages/client/src/config.ts @@ -276,7 +276,7 @@ export interface ConfigOptions { /** * If there is a reorg, this is a safe distance from which - * to try to refetch and refeed the blocks. + * to try to refetch and re-feed the blocks. */ safeReorgDistance?: number @@ -386,7 +386,7 @@ export class Config { public static readonly SYNCED_STATE_REMOVAL_PERIOD = 60000 // engine new payload calls can come in batch of 64, keeping 128 as the lookup factor - public static readonly ENGINE_PARENTLOOKUP_MAX_DEPTH = 128 + public static readonly ENGINE_PARENT_LOOKUP_MAX_DEPTH = 128 public static readonly ENGINE_NEWPAYLOAD_MAX_EXECUTE = 2 public static readonly ENGINE_NEWPAYLOAD_MAX_TXS_EXECUTE = 200 public static readonly SNAP_AVAILABILITY_DEPTH = BigInt(128) @@ -454,7 +454,7 @@ export class Config { public readonly initialVerkleStateRoot: Uint8Array public synchronized: boolean - public lastsyncronized?: boolean + public lastSynchronized?: boolean /** lastSyncDate in ms */ public lastSyncDate: number /** Best known block height */ @@ -527,7 +527,7 @@ export class Config { this.syncedStateRemovalPeriod = options.syncedStateRemovalPeriod ?? Config.SYNCED_STATE_REMOVAL_PERIOD this.engineParentLookupMaxDepth = - options.engineParentLookupMaxDepth ?? Config.ENGINE_PARENTLOOKUP_MAX_DEPTH + options.engineParentLookupMaxDepth ?? Config.ENGINE_PARENT_LOOKUP_MAX_DEPTH this.engineNewpayloadMaxExecute = options.engineNewpayloadMaxExecute ?? Config.ENGINE_NEWPAYLOAD_MAX_EXECUTE this.engineNewpayloadMaxTxsExecute = @@ -628,7 +628,7 @@ export class Config { } } - if (this.synchronized !== this.lastsyncronized) { + if (this.synchronized !== this.lastSynchronized) { this.logger.debug( `Client synchronized=${this.synchronized}${ latest !== null && latest !== undefined ? ' height=' + latest.number : '' @@ -636,7 +636,7 @@ export class Config { (Date.now() - this.lastSyncDate) / 1000 } secs ago`, ) - this.lastsyncronized = this.synchronized + this.lastSynchronized = this.synchronized } } diff --git a/packages/client/src/execution/vmexecution.ts b/packages/client/src/execution/vmexecution.ts index 460b049a83..203910a504 100644 --- a/packages/client/src/execution/vmexecution.ts +++ b/packages/client/src/execution/vmexecution.ts @@ -585,7 +585,7 @@ export class VMExecution extends Execution { * @param loop Whether to continue iterating until vm head equals chain head (default: true) * @returns number of blocks executed */ - async run(loop = true, runOnlybatched = false): Promise { + async run(loop = true, runOnlyBatched = false): Promise { if (this.running || !this.started || !this.config.execution || this.config.shutdown) return 0 return this.runWithLock(async () => { @@ -625,8 +625,8 @@ export class VMExecution extends Execution { while ( this.started && !this.config.shutdown && - (!runOnlybatched || - (runOnlybatched && + (!runOnlyBatched || + (runOnlyBatched && canonicalHead.header.number - startHeadBlock.header.number >= BigInt(this.config.numBlocksPerIteration))) && (numExecuted === undefined || @@ -751,7 +751,7 @@ export class VMExecution extends Execution { parentState = block.header.stateRoot } catch (error: any) { // only marked the block as invalid if it was an actual execution error - // for e.g. absense of executionWitness doesn't make a block invalid + // for e.g. absence of executionWitness doesn't make a block invalid if (!`${error.message}`.includes('Invalid executionWitness=null')) { errorBlock = block } diff --git a/packages/client/src/ext/jwt-simple.ts b/packages/client/src/ext/jwt-simple.ts index a33be6c7dc..42972be434 100644 --- a/packages/client/src/ext/jwt-simple.ts +++ b/packages/client/src/ext/jwt-simple.ts @@ -7,7 +7,7 @@ * module dependencies */ import { bytesToUtf8, utf8ToBytes } from '@ethereumjs/util' -import { base64url, base64urlnopad } from '@scure/base' +import { base64url, base64urlnopad } from '@scure/base' // cspell:disable-line import crypto from 'crypto' /** diff --git a/packages/client/src/net/server/rlpxserver.ts b/packages/client/src/net/server/rlpxserver.ts index f041ff7a5c..1b02ce48c5 100644 --- a/packages/client/src/net/server/rlpxserver.ts +++ b/packages/client/src/net/server/rlpxserver.ts @@ -72,11 +72,11 @@ export class RlpxServer extends Server { 'go1.6', 'go1.7', 'quorum', - 'pirl', - 'ubiq', - 'gmc', - 'gwhale', - 'prichain', + 'pirl', // cspell:disable-line + 'ubiq', // cspell:disable-line + 'gmc', // cspell:disable-line + 'gwhale', // cspell:disable-line + 'prichain', // cspell:disable-line ] } diff --git a/packages/client/src/rpc/index.ts b/packages/client/src/rpc/index.ts index 58ddd1972e..ced41f3981 100644 --- a/packages/client/src/rpc/index.ts +++ b/packages/client/src/rpc/index.ts @@ -42,8 +42,8 @@ export class RPCManager { if (!this._config.saveReceipts && saveReceiptsMethods.includes(methodName)) { continue } - const concatedMethodName = `${modName.toLowerCase()}_${methodName}` - methods[concatedMethodName] = mod[methodName].bind((...params: any[]) => { + const concatenatedMethodName = `${modName.toLowerCase()}_${methodName}` + methods[concatenatedMethodName] = mod[methodName].bind((...params: any[]) => { try { mod(...params) } catch (error: any) { diff --git a/packages/client/src/rpc/modules/admin.ts b/packages/client/src/rpc/modules/admin.ts index 589665af2c..34460f785c 100644 --- a/packages/client/src/rpc/modules/admin.ts +++ b/packages/client/src/rpc/modules/admin.ts @@ -75,7 +75,7 @@ export class Admin { * @returns an array of objects containing information about peers (including id, eth protocol versions supported, client name, etc.) */ async peers() { - const peers = this._client.services.filter((serv) => serv.name === 'eth')[0]?.pool + const peers = this._client.services.filter((service) => service.name === 'eth')[0]?.pool .peers as RlpxPeer[] return peers?.map((peer) => { diff --git a/packages/client/src/rpc/modules/engine/engine.ts b/packages/client/src/rpc/modules/engine/engine.ts index e99c5e450a..47d9abe161 100644 --- a/packages/client/src/rpc/modules/engine/engine.ts +++ b/packages/client/src/rpc/modules/engine/engine.ts @@ -678,7 +678,7 @@ export class Engine { this.chain.config.engineNewpayloadMaxTxsExecute }) executionBusy=${this.execution.running}`, ) - // determind status to be returned depending on if block could extend chain or not + // determined status to be returned depending on if block could extend chain or not const status = optimisticLookup === true ? Status.SYNCING : Status.ACCEPTED const response = { status, latestValidHash: null, validationError: null } return response diff --git a/packages/client/src/rpc/modules/engine/util/getPayload.ts b/packages/client/src/rpc/modules/engine/util/getPayload.ts index 9cad1d79fb..18da12f188 100644 --- a/packages/client/src/rpc/modules/engine/util/getPayload.ts +++ b/packages/client/src/rpc/modules/engine/util/getPayload.ts @@ -21,7 +21,7 @@ export const blockToExecutionPayload = (block: Block, value: bigint, bundle?: Bl } : undefined - // ethereumjs doesnot provide any transaction censoring detection (yet) to suggest + // ethereumjs does not provide any transaction censoring detection (yet) to suggest // overriding builder/mev-boost blocks const shouldOverrideBuilder = false return { executionPayload, blockValue: bigIntToHex(value), blobsBundle, shouldOverrideBuilder } diff --git a/packages/client/src/rpc/validation.ts b/packages/client/src/rpc/validation.ts index 4b150cdc85..cc929dfe4e 100644 --- a/packages/client/src/rpc/validation.ts +++ b/packages/client/src/rpc/validation.ts @@ -379,7 +379,7 @@ export const validators = { }, /** - * validator to ensure required withdawal fields are present, and checks for valid address and hex values + * validator to ensure required withdrawal fields are present, and checks for valid address and hex values * for the other quantity based fields * @param requiredFields array of required fields * @returns validator function with params: @@ -677,7 +677,7 @@ export const validators = { /** * Verification of rewardPercentiles array * - * description: A monotonically increasing list of percentile values. For each block in the requested range, the transactions will be sorted in ascending order by effective tip per gas and the coresponding effective tip for the percentile will be determined, accounting for gas consumed. + * description: A monotonically increasing list of percentile values. For each block in the requested range, the transactions will be sorted in ascending order by effective tip per gas and the corresponding effective tip for the percentile will be determined, accounting for gas consumed. * type: array * items: rewardPercentile value * diff --git a/packages/client/src/service/skeleton.ts b/packages/client/src/service/skeleton.ts index 346dfe407e..859a6454b3 100644 --- a/packages/client/src/service/skeleton.ts +++ b/packages/client/src/service/skeleton.ts @@ -131,9 +131,9 @@ export class Skeleton extends MetaDBManager { public safeBlock?: Block public finalizedBlock?: Block - // to track if we have cl FCUs close to the clockhead + // to track if we have cl FCUs close to the clock head synchronized = false - private lastsyncronized = false + private lastSynchronized = false private lastSyncDate = 0 constructor(opts: MetaDBManagerOptions) { @@ -233,7 +233,7 @@ export class Skeleton extends MetaDBManager { return this.started > 0 } - async isLastAnnoucement(): Promise { + async isLastAnnouncement(): Promise { const subchain0 = this.status.progress.subchains[0] if (subchain0 !== undefined) { return this.getBlock(subchain0.head + BIGINT_1) !== undefined @@ -392,12 +392,12 @@ export class Skeleton extends MetaDBManager { * @params head - The block being attempted as a new head * @params force - Flag to indicate if this is just a check of worthiness or a actually new head * @params init - Flag this is the first time since the beacon sync start to perform additional tasks - * @params reorgthrow - Flag to indicate if we would actually like to throw if there is a reorg + * @params reorgThrow - Flag to indicate if we would actually like to throw if there is a reorg * instead of just returning the boolean * * @returns True if the head (will) cause a reorg in the canonical skeleton subchain */ - async setHead(head: Block, force = true, init = false, reorgthrow = false): Promise { + async setHead(head: Block, force = true, init = false, reorgThrow = false): Promise { if ( this.config.syncTargetHeight === undefined || this.config.syncTargetHeight < head.header.number @@ -455,21 +455,21 @@ export class Skeleton extends MetaDBManager { parent.header.number < subchain.tail ) { // truncate subchain 0 before inserting a new chain so that this chain can be merged into new - // one without issues if the opportunity arrises + // one without issues if the opportunity arises if ( subchain !== undefined && this.status.linked && this.status.canonicalHeadReset === false && this.chain.blocks.height >= subchain.tail ) { - const trucateTailToNumber = this.chain.blocks.height + BIGINT_1 - const trucateTailTo = - trucateTailToNumber <= subchain.head - ? await this.getBlock(trucateTailToNumber, true) + const truncateTailToNumber = this.chain.blocks.height + BIGINT_1 + const truncateTailTo = + truncateTailToNumber <= subchain.head + ? await this.getBlock(truncateTailToNumber, true) : undefined - if (trucateTailTo !== undefined) { - subchain.tail = trucateTailTo.header.number - subchain.next = trucateTailTo.header.parentHash + if (truncateTailTo !== undefined) { + subchain.tail = truncateTailTo.header.number + subchain.next = truncateTailTo.header.parentHash this.config.logger.info( `Truncated subchain0 with head=${subchain.head} to a new tail=${ subchain.tail @@ -478,7 +478,7 @@ export class Skeleton extends MetaDBManager { } else { // clear out this subchain this.config.logger.info( - `Dropping subchain0 with head=${subchain.head} before overlaying a new subchain as trucateTailToNumber=${trucateTailToNumber} block not available `, + `Dropping subchain0 with head=${subchain.head} before overlaying a new subchain as truncateTailToNumber=${truncateTailToNumber} block not available `, ) this.status.progress.subchains.splice(0, 1) } @@ -514,13 +514,13 @@ export class Skeleton extends MetaDBManager { !this.status.canonicalHeadReset && this.chain.blocks.height >= subchain.tail ) { - let trucateTailTo - const trucateTailToNumber = this.chain.blocks.height + BIGINT_1 - if (trucateTailToNumber < head.header.number) { - trucateTailTo = await this.getBlock(trucateTailToNumber, true) + let truncateTailTo + const truncateTailToNumber = this.chain.blocks.height + BIGINT_1 + if (truncateTailToNumber < head.header.number) { + truncateTailTo = await this.getBlock(truncateTailToNumber, true) } - if (trucateTailTo === undefined) { + if (truncateTailTo === undefined) { subchain.tail = head.header.number subchain.next = head.header.parentHash // reset canonical head, don't change linked status because parent was @@ -534,8 +534,8 @@ export class Skeleton extends MetaDBManager { }`, ) } else { - subchain.tail = trucateTailTo.header.number - subchain.next = trucateTailTo.header.parentHash + subchain.tail = truncateTailTo.header.number + subchain.next = truncateTailTo.header.parentHash // just reset tail and no need to modify linked status this.config.logger.info( `Truncated subchain with head=${subchain.head} to a new tail=${ @@ -577,7 +577,7 @@ export class Skeleton extends MetaDBManager { // Earlier we were throwing on reorg, essentially for the purposes for killing the reverse fetcher // but it can be handled properly in the calling fn without erroring - if (reorg && reorgthrow) { + if (reorg && reorgThrow) { if (force) { throw errSyncReorged } else { @@ -636,7 +636,7 @@ export class Skeleton extends MetaDBManager { } } - if (this.synchronized !== this.lastsyncronized) { + if (this.synchronized !== this.lastSynchronized) { this.config.logger.debug( `Cl (skeleton) synchronized=${this.synchronized}${ latest !== null && latest !== undefined ? ' height=' + latest.number : '' @@ -644,7 +644,7 @@ export class Skeleton extends MetaDBManager { (Date.now() - this.lastSyncDate) / 1000 } secs ago`, ) - this.lastsyncronized = this.synchronized + this.lastSynchronized = this.synchronized } } @@ -804,7 +804,7 @@ export class Skeleton extends MetaDBManager { // blocks if there are executed blocks to fill with. This blocking causes it to not interfere // with the setHead mechanism. This is however a hack and a better solution needs to be devised // to handle it blockchain level as because of async nature of new payloads and fcUs and the skeleton - // there is always a chance for uncordinated put blocks unless they are all cordinated through skeleton + // there is always a chance for uncoordinated put blocks unless they are all coordinated through skeleton // which might also be a valid await this.blockingFillWithCutoff(this.chain.config.engineParentLookupMaxDepth) @@ -840,13 +840,13 @@ export class Skeleton extends MetaDBManager { /** * Setup the skeleton to init sync with head * @params head - The block with which we want to init the skeleton head - * @params reorgthrow - If we would like the function to throw instead of silently + * @params reorgThrow - If we would like the function to throw instead of silently * return if there is reorg of the skeleton head * * @returns True if the skeleton was reorged trying to init else false */ - async initSync(head: Block, reorgthrow = false): Promise { - return this.setHead(head, true, true, reorgthrow) + async initSync(head: Block, reorgThrow = false): Promise { + return this.setHead(head, true, true, reorgThrow) } /** @@ -1183,7 +1183,7 @@ export class Skeleton extends MetaDBManager { canonicalHead = newHead await this.chain.resetCanonicalHead(canonicalHead) } - // update in lock so as to not conflict/overwrite sethead/putblock updates + // update in lock so as to not conflict/overwrite setHead/putBlock updates await this.runWithLock(async () => { this.status.canonicalHeadReset = false }) @@ -1231,7 +1231,7 @@ export class Skeleton extends MetaDBManager { // chain height has to be <= block number as we will skip putting this block as it might currently // cause chain reset. This can happen if any other async process added a batch of blocks like // execution's setHead. If that caused this chain to be not canonical anymore than the next - // putblocks should fail causing the fill to exit with skeleton stepback + // putBlocks should fail causing the fill to exit with skeleton stepback if (this.chain.blocks.height <= block.header.number) { try { numBlocksInserted = await this.chain.putBlocks([block], true) @@ -1823,7 +1823,7 @@ export class Skeleton extends MetaDBManager { subchains, // linked intToBytes(this.status.linked ? 1 : 0), - // canonocalHeadReset + // canonicalHeadReset intToBytes(this.status.canonicalHeadReset ? 1 : 0), // safe and finalized bigIntToBytes(this.status.safe), diff --git a/packages/client/src/service/txpool.ts b/packages/client/src/service/txpool.ts index 9c0d3e6209..ec9dba5412 100644 --- a/packages/client/src/service/txpool.ts +++ b/packages/client/src/service/txpool.ts @@ -884,7 +884,7 @@ export class TxPool { broadcasterrors += sendobjects.filter((sendobject) => sendobject.error !== undefined).length knownpeers++ } - // Get avergae + // Get average if (knownpeers > 0) { broadcasts = broadcasts / knownpeers broadcasterrors = broadcasterrors / knownpeers diff --git a/packages/client/src/sync/fetcher/accountfetcher.ts b/packages/client/src/sync/fetcher/accountfetcher.ts index dcd5a22879..197aae3659 100644 --- a/packages/client/src/sync/fetcher/accountfetcher.ts +++ b/packages/client/src/sync/fetcher/accountfetcher.ts @@ -26,7 +26,7 @@ import { ByteCodeFetcher } from './bytecodefetcher.js' import { Fetcher } from './fetcher.js' import { StorageFetcher } from './storagefetcher.js' import { TrieNodeFetcher } from './trienodefetcher.js' -import { getInitFecherDoneFlags } from './types.js' +import { getInitFetcherDoneFlags } from './types.js' import type { Peer } from '../../net/peer/index.js' import type { AccountData } from '../../net/protocol/snapprotocol.js' @@ -90,7 +90,7 @@ export class AccountFetcher extends Fetcher */ constructor(options: AccountFetcherOptions) { super(options) - this.fetcherDoneFlags = options.fetcherDoneFlags ?? getInitFecherDoneFlags() + this.fetcherDoneFlags = options.fetcherDoneFlags ?? getInitFetcherDoneFlags() this.root = options.root this.first = options.first @@ -546,7 +546,7 @@ export class AccountFetcher extends Fetcher * remaining items apart from the tasks it pushes in the queue * * Divides the full 256-bit range of hashes into ranges of @maxAccountRange - * size and turnes each range into a task for the fetcher + * size and turns each range into a task for the fetcher */ tasks(first = this.first, count = this.count, maxTasks = this.config.maxFetcherJobs): JobTask[] { diff --git a/packages/client/src/sync/fetcher/bytecodefetcher.ts b/packages/client/src/sync/fetcher/bytecodefetcher.ts index d2f5c8207c..a5868d92e9 100644 --- a/packages/client/src/sync/fetcher/bytecodefetcher.ts +++ b/packages/client/src/sync/fetcher/bytecodefetcher.ts @@ -10,7 +10,7 @@ import debug from 'debug' import { keccak256 } from 'ethereum-cryptography/keccak' import { Fetcher } from './fetcher.js' -import { getInitFecherDoneFlags } from './types.js' +import { getInitFetcherDoneFlags } from './types.js' import type { Peer } from '../../net/peer/index.js' import type { FetcherOptions } from './fetcher.js' @@ -55,7 +55,7 @@ export class ByteCodeFetcher extends Fetcher super(options) this.hashes = options.hashes ?? [] this.stateManager = options.stateManager ?? new DefaultStateManager() - this.fetcherDoneFlags = options.fetcherDoneFlags ?? getInitFecherDoneFlags() + this.fetcherDoneFlags = options.fetcherDoneFlags ?? getInitFetcherDoneFlags() this.fetcherDoneFlags.byteCodeFetcher.count = BigInt(this.hashes.length) this.codeDB = this.stateManager['_getCodeDB']() @@ -113,7 +113,7 @@ export class ByteCodeFetcher extends Fetcher // While results are in the same order as requested hashes but there could be gaps/misses in the results // if the node doesn't has the bytecode. We need an index to move forward through the hashes which are - // absent in the receieved responses + // absent in the received responses let requestedHashIndex = 0 for (let i = 0; i < rangeResult.codes.length; i++) { const receivedCode = rangeResult.codes[i] @@ -187,7 +187,7 @@ export class ByteCodeFetcher extends Fetcher } await this.codeDB.batch(ops as BatchDBOp[]) this.fetcherDoneFlags.byteCodeFetcher.first += BigInt(codeHashToByteCode.size) - // no idea why first starts exceeding count, may be because of missed hashesh thing, so resort to this + // no idea why first starts exceeding count, may be because of missed hashes thing, so resort to this // weird method of tracking the count this.fetcherDoneFlags.byteCodeFetcher.count = this.fetcherDoneFlags.byteCodeFetcher.first + BigInt(this.hashes.length) @@ -208,7 +208,7 @@ export class ByteCodeFetcher extends Fetcher */ enqueueByByteCodeRequestList(byteCodeRequestList: Uint8Array[]) { this.hashes.push(...byteCodeRequestList) - // no idea why first starts exceeding count, may be because of missed hashesh thing, so resort to this + // no idea why first starts exceeding count, may be because of missed hashes thing, so resort to this // weird method of tracking the count this.fetcherDoneFlags.byteCodeFetcher.count = this.fetcherDoneFlags.byteCodeFetcher.first + BigInt(this.hashes.length) diff --git a/packages/client/src/sync/fetcher/storagefetcher.ts b/packages/client/src/sync/fetcher/storagefetcher.ts index e7009401a4..2dfb3fda22 100644 --- a/packages/client/src/sync/fetcher/storagefetcher.ts +++ b/packages/client/src/sync/fetcher/storagefetcher.ts @@ -17,7 +17,7 @@ import debugDefault from 'debug' import { keccak256 } from 'ethereum-cryptography/keccak' import { Fetcher } from './fetcher.js' -import { getInitFecherDoneFlags } from './types.js' +import { getInitFetcherDoneFlags } from './types.js' import type { Peer } from '../../net/peer/index.js' import type { StorageData } from '../../net/protocol/snapprotocol.js' @@ -89,7 +89,7 @@ export class StorageFetcher extends Fetcher 0) { this.debug('Single account request is being initiated') storageRequest = this.fragmentedRequests.shift() - whereFirstwas = storageRequest!.first + whereFirstWas = storageRequest!.first startedWith = storageRequest!.first myFirst = storageRequest!.first myCount = storageRequest!.count @@ -602,7 +602,7 @@ export class StorageFetcher extends Fetcher constructor(options: TrieNodeFetcherOptions) { super(options) this.root = options.root - this.fetcherDoneFlags = options.fetcherDoneFlags ?? getInitFecherDoneFlags() + this.fetcherDoneFlags = options.fetcherDoneFlags ?? getInitFetcherDoneFlags() this.pathToNodeRequestData = new OrderedMap() this.requestedNodeToPath = new Map() this.fetchedAccountNodes = new Map() @@ -169,7 +169,7 @@ export class TrieNodeFetcher extends Fetcher try { // While results are in the same order as requested hashes but there could be gaps/misses in the results // if the node doesn't has all of the requested trie nodes. We need an index to move forward through the hashes which are - // absent in the receieved responses + // absent in the received responses const receivedNodes: Uint8Array[] = [] for (let i = 0; i < rangeResult.nodes.length; i++) { const receivedNode = rangeResult.nodes[i] @@ -331,7 +331,7 @@ export class TrieNodeFetcher extends Fetcher this.pathToNodeRequestData.eraseElementByKey(pathString) } - // for an initial implementation, just put nodes into trie and see if root maches stateRoot + // for an initial implementation, just put nodes into trie and see if root matches stateRoot if (this.pathToNodeRequestData.length === 0) { this.debug('All requests for current heal phase have been filled') const ops: BatchDBOp[] = [] diff --git a/packages/client/src/sync/fetcher/types.ts b/packages/client/src/sync/fetcher/types.ts index 8004360450..db348db0fb 100644 --- a/packages/client/src/sync/fetcher/types.ts +++ b/packages/client/src/sync/fetcher/types.ts @@ -43,7 +43,7 @@ export type SnapFetcherDoneFlags = { stateRoot?: Uint8Array } -export function getInitFecherDoneFlags(): SnapFetcherDoneFlags { +export function getInitFetcherDoneFlags(): SnapFetcherDoneFlags { return { done: false, syncing: false, diff --git a/packages/client/src/sync/snapsync.ts b/packages/client/src/sync/snapsync.ts index 97ae243777..529bd59a0a 100644 --- a/packages/client/src/sync/snapsync.ts +++ b/packages/client/src/sync/snapsync.ts @@ -4,7 +4,7 @@ import { Event } from '../types.js' import { short } from '../util/index.js' import { AccountFetcher } from './fetcher/index.js' -import { getInitFecherDoneFlags } from './fetcher/types.js' +import { getInitFetcherDoneFlags } from './fetcher/types.js' import { Synchronizer } from './sync.js' import type { VMExecution } from '../execution/index.js' @@ -26,7 +26,7 @@ export class SnapSynchronizer extends Synchronizer { public running = false skeleton?: Skeleton private execution: VMExecution - readonly fetcherDoneFlags: SnapFetcherDoneFlags = getInitFecherDoneFlags() + readonly fetcherDoneFlags: SnapFetcherDoneFlags = getInitFetcherDoneFlags() constructor(options: SnapSynchronizerOptions) { super(options) diff --git a/packages/client/src/util/parse.ts b/packages/client/src/util/parse.ts index 061f0157ae..a62f8c26d8 100644 --- a/packages/client/src/util/parse.ts +++ b/packages/client/src/util/parse.ts @@ -59,7 +59,7 @@ export function parseMultiaddrs(input: MultiaddrLike): Multiaddr[] { const { ip6, port } = matchip6.groups! return multiaddr(`/ip6/${ip6}/tcp/${port}`) } - // parse using WHATWG URL API + // parse using WHATWG URL API // cspell:disable-line const { hostname: ip, port } = new URL(s) if (ip && port) { return multiaddr(`/ip4/${ip}/tcp/${port}`) diff --git a/packages/client/test/logging.spec.ts b/packages/client/test/logging.spec.ts index b5542e9e56..84438dc59f 100644 --- a/packages/client/test/logging.spec.ts +++ b/packages/client/test/logging.spec.ts @@ -44,7 +44,7 @@ describe('[Logging]', () => { }) as any assert.equal( message, - 'test \x1B[38;2;0;128;0mkey\x1B[39m=value ', + 'test \x1B[38;2;0;128;0mkey\x1B[39m=value ', // cspell:disable-line 'key=value pairs should be colorized', ) }) diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index e00a129d3b..ec11116b48 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -327,7 +327,7 @@ describe('assembleBlocks() -> with multiple txs, properly ordered by gasPrice an ;(vm.blockchain as any)._validateConsensus = false chain.putBlocks = (blocks: Block[]) => { - it('sholud be properly orded by gasPrice and nonce', () => { + it('should be properly ordered by gasPrice and nonce', () => { const msg = 'txs in block should be properly ordered by gasPrice and nonce' const expectedOrder = [txB01, txA01, txA02, txA03] for (const [index, tx] of expectedOrder.entries()) { @@ -382,7 +382,7 @@ describe('assembleBlocks() -> with saveReceipts', async () => { ;(vm.blockchain as any)._validateConsensus = false chain.putBlocks = async (blocks: Block[]) => { - it('should be properly orded by gasPrice and nonce', async () => { + it('should be properly ordered by gasPrice and nonce', async () => { const msg = 'txs in block should be properly ordered by gasPrice and nonce' const expectedOrder = [txB01, txA01, txA02, txA03] for (const [index, tx] of expectedOrder.entries()) { diff --git a/packages/client/test/miner/pendingBlock.spec.ts b/packages/client/test/miner/pendingBlock.spec.ts index 9008483750..f7ab2b5633 100644 --- a/packages/client/test/miner/pendingBlock.spec.ts +++ b/packages/client/test/miner/pendingBlock.spec.ts @@ -215,7 +215,7 @@ describe('[PendingBlock]', async () => { it('should stop adding txs when block is full', async () => { const { txPool } = setup() - // set gas limit low so that can accomodate 2 txs + // set gas limit low so that can accommodate, 2 txs const prevGasLimit = common['_chainParams'].genesis.gasLimit common['_chainParams'].genesis.gasLimit = 50000 diff --git a/packages/client/test/net/protocol/snapprotocol.spec.ts b/packages/client/test/net/protocol/snapprotocol.spec.ts index 43b30fda1f..1fe6ac8759 100644 --- a/packages/client/test/net/protocol/snapprotocol.spec.ts +++ b/packages/client/test/net/protocol/snapprotocol.spec.ts @@ -153,7 +153,7 @@ describe('[SnapProtocol]', () => { assert.ok(equalsBytes(accountFull[3], KECCAK256_NULL), 'codeHash should be KECCAK256_NULL') // Lets encode fullData as it should be encoded in slim format and upon decoding - // we shpuld get slim format + // we should get slim format const slimPayload = pFull.encode( pFull.messages.filter((message) => message.name === 'AccountRange')[0], fullData, diff --git a/packages/client/test/rpc/engine/forkchoiceUpdatedV1.spec.ts b/packages/client/test/rpc/engine/forkchoiceUpdatedV1.spec.ts index 3fe206b853..735ec5a708 100644 --- a/packages/client/test/rpc/engine/forkchoiceUpdatedV1.spec.ts +++ b/packages/client/test/rpc/engine/forkchoiceUpdatedV1.spec.ts @@ -70,7 +70,7 @@ describe(method, () => { const invalidForkChoiceState = { ...validForkChoiceState, - finalizedBlockHash: '0xinvalid', + finalizedBlockHash: '0xinvalid', // cspell:disable-line } const res = await rpc.request(method, [invalidForkChoiceState, validPayloadAttributes]) assert.equal(res.error.code, INVALID_PARAMS) diff --git a/packages/client/test/rpc/engine/getPayloadV3.spec.ts b/packages/client/test/rpc/engine/getPayloadV3.spec.ts index 35aa080b5e..e300aa19d6 100644 --- a/packages/client/test/rpc/engine/getPayloadV3.spec.ts +++ b/packages/client/test/rpc/engine/getPayloadV3.spec.ts @@ -119,7 +119,7 @@ describe(method, () => { '0x8c71ad199a3dda94de6a1c31cc50a26b1f03a8a4924e9ea3fd7420c6411cac42', 'built expected block', ) - assert.equal(executionPayload.excessBlobGas, '0x0', 'correct execess blob gas') + assert.equal(executionPayload.excessBlobGas, '0x0', 'correct excess blob gas') assert.equal(executionPayload.blobGasUsed, '0x20000', 'correct blob gas used') const { commitments, proofs, blobs } = blobsBundle assert.ok( diff --git a/packages/client/test/rpc/engine/kaustinen6.spec.ts b/packages/client/test/rpc/engine/kaustinen6.spec.ts index 4b7dab2c55..4a5e6310ab 100644 --- a/packages/client/test/rpc/engine/kaustinen6.spec.ts +++ b/packages/client/test/rpc/engine/kaustinen6.spec.ts @@ -32,7 +32,7 @@ const genesisVerkleBlockHash = '0x3fe165c03e7a77d1e3759362ebeeb16fd964cb411ce11f * a. On the saved blocks, comma separated (were produced for kaustinen4 ) * `TEST_SAVED_NUMBERS=353,368,374,467 npx vitest run test/rpc/engine/kaustinen5.spec.ts` * b. Geth produced testvectors (were produced for kaustinen5) - * `TEST_GETH_VEC_DIR=test/testdata/gethk5vecs DEBUG=ethjs,vm:*,evm:*,statemanager:verkle* npx vitest run test/rpc/engine/kaustinen6.spec.ts` + * `TEST_GETH_VEC_DIR=test/testdata/gethk5vecs DEBUG=ethjs,vm:*,evm:*,statemanager:verkle* npx vitest run test/rpc/engine/kaustinen6.spec.ts` // cspell:disable-line */ const originalValidate = (BlockHeader as any).prototype._consensusFormatValidation @@ -146,10 +146,10 @@ describe(`valid verkle network setup`, async () => { if (process.env.TEST_GETH_VEC_DIR !== undefined) { // eslint-disable-next-line @typescript-eslint/no-use-before-define - const gethVecs = await loadGethVectors(process.env.TEST_GETH_VEC_DIR, { common }) - let parent = gethVecs[0] - for (let i = 1; i < gethVecs.length; i++) { - const execute = gethVecs[i] + const gethVectors = await loadGethVectors(process.env.TEST_GETH_VEC_DIR, { common }) + let parent = gethVectors[0] + for (let i = 1; i < gethVectors.length; i++) { + const execute = gethVectors[i] it(`run geth vector: ${execute.blockNumber}`, async (context) => { await runBlock({ common, chain, rpc }, { parent, execute }, false, context) parent = execute diff --git a/packages/client/test/rpc/engine/newPayloadV3.spec.ts b/packages/client/test/rpc/engine/newPayloadV3.spec.ts index 75303d7629..71355bd200 100644 --- a/packages/client/test/rpc/engine/newPayloadV3.spec.ts +++ b/packages/client/test/rpc/engine/newPayloadV3.spec.ts @@ -33,7 +33,7 @@ describe(`${method}: call with executionPayloadV3`, () => { }) it('valid data', async () => { - // get the genesis json with late enougt date with respect to block data in batchBlocks + // get the genesis json with late enough date with respect to block data in batchBlocks const cancunTime = 1689945325 // deep copy json and add shanghai and cancun to genesis to avoid contamination const cancunJson = JSON.parse(JSON.stringify(genesisJSON)) @@ -71,7 +71,7 @@ describe(`${method}: call with executionPayloadV3`, () => { }) it('fcU and verify that no errors occur on new payload', async () => { - // get the genesis json with late enougt date with respect to block data in batchBlocks + // get the genesis json with late enough date with respect to block data in batchBlocks const cancunTime = 1689945325 // deep copy json and add shanghai and cancun to genesis to avoid contamination const cancunJson = JSON.parse(JSON.stringify(genesisJSON)) diff --git a/packages/client/test/rpc/engine/preimages.spec.ts b/packages/client/test/rpc/engine/preimages.spec.ts index d85891fc08..5b6b8d19b9 100644 --- a/packages/client/test/rpc/engine/preimages.spec.ts +++ b/packages/client/test/rpc/engine/preimages.spec.ts @@ -137,7 +137,7 @@ describe(`valid verkle network setup`, async () => { // and for block1 are coded to return no withdrawals // // third consideration is for feerecipient which are added here as random - // coinbase addrs + // coinbase addresses const testCases = [ { name: 'block 1 no txs', diff --git a/packages/client/test/rpc/engine/withdrawals.spec.ts b/packages/client/test/rpc/engine/withdrawals.spec.ts index e46f000c89..768ca0deb4 100644 --- a/packages/client/test/rpc/engine/withdrawals.spec.ts +++ b/packages/client/test/rpc/engine/withdrawals.spec.ts @@ -110,7 +110,7 @@ for (const { name, withdrawals, withdrawalsRoot, gethBlockRlp } of testCases) { assert.equal( withdrawalsRoot, computedWithdrawalsRoot, - 'withdrawalsRoot compuation should match', + 'withdrawalsRoot computation should match', ) const { server } = await setupChain(genesisJSON, 'post-merge', { engine: true }) const rpc = getRpcClient(server) diff --git a/packages/client/test/rpc/eth/getTransactionByBlockHashAndIndex.spec.ts b/packages/client/test/rpc/eth/getTransactionByBlockHashAndIndex.spec.ts index 7feabc0fd3..05ee246b57 100644 --- a/packages/client/test/rpc/eth/getTransactionByBlockHashAndIndex.spec.ts +++ b/packages/client/test/rpc/eth/getTransactionByBlockHashAndIndex.spec.ts @@ -88,7 +88,7 @@ describe(method, async () => { const { rpc } = await baseSetup() const mockBlockHash = '0x572856aae9a653012a7df7aeb56bfb7fe77f5bcb4b69fd971c04e989f6ccf9b1' - const mockTxIndex = 'INVALIDA_TXINDEX' + const mockTxIndex = 'INVALID_TXINDEX' const res = await rpc.request(method, [mockBlockHash, mockTxIndex]) assert.equal(res.error.code, INVALID_PARAMS) diff --git a/packages/client/test/rpc/validation.spec.ts b/packages/client/test/rpc/validation.spec.ts index 932f37bf3b..5b62da0cb7 100644 --- a/packages/client/test/rpc/validation.spec.ts +++ b/packages/client/test/rpc/validation.spec.ts @@ -301,9 +301,9 @@ describe(prefix, () => { assert.ok(validatorResult(validators.blockOption(['0x01'], 0))) // invalid - assert.notOk(validatorResult(validators.blockOption(['lates'], 0))) - assert.notOk(validatorResult(validators.blockOption(['arliest'], 0))) - assert.notOk(validatorResult(validators.blockOption(['pendin'], 0))) + assert.notOk(validatorResult(validators.blockOption(['lates'], 0))) // cspell:disable-line + assert.notOk(validatorResult(validators.blockOption(['arliest'], 0))) // cspell:disable-line + assert.notOk(validatorResult(validators.blockOption(['pendin'], 0))) // cspell:disable-line assert.notOk(validatorResult(validators.blockOption(['0'], 0))) assert.notOk(validatorResult(validators.blockOption(['00'], 0))) assert.notOk(validatorResult(validators.blockOption(['1'], 0))) @@ -327,7 +327,7 @@ describe(prefix, () => { assert.notOk(validatorResult(validators.bool(['true'], 0))) assert.notOk(validatorResult(validators.bool(['false'], 0))) assert.notOk(validatorResult(validators.bool(['tru'], 0))) - assert.notOk(validatorResult(validators.bool(['fals'], 0))) + assert.notOk(validatorResult(validators.bool(['fals'], 0))) // cspell:disable-line }) it('hex', () => { diff --git a/packages/client/test/service/fullethereumservice.spec.ts b/packages/client/test/service/fullethereumservice.spec.ts index 151220534f..de3551196e 100644 --- a/packages/client/test/service/fullethereumservice.spec.ts +++ b/packages/client/test/service/fullethereumservice.spec.ts @@ -96,7 +96,7 @@ describe('should open', async () => { expect(service.synchronizer!.open).toBeCalled() expect(server.addProtocols).toBeCalled() service.config.events.on(Event.SYNC_SYNCHRONIZED, () => { - it('should syncronize', () => { + it('should synchronize', () => { assert.ok('synchronized') }) }) @@ -217,7 +217,7 @@ describe('should ban peer for sending NewBlock/NewBlockHashes after merge', asyn chain.config.chainCommon.setHardfork(Hardfork.Paris) const service = new FullEthereumService({ config, chain }) service.pool.ban = () => { - it('should ban peeer', () => { + it('should ban peer', () => { assert.ok(true, 'banned peer when NewBlock/NewBlockHashes announced after Merge') }) } @@ -292,7 +292,7 @@ describe('should handle NewPooledTransactionHashes', async () => { const service = new FullEthereumService({ config, chain }) service.txPool.handleAnnouncedTxHashes = async (msg, _peer, _pool) => { it('should handle NewPooledTransactionHashes', () => { - assert.deepEqual(msg[0], hexToBytes('0xabcd'), 'handled NewPooledTransactionhashes') + assert.deepEqual(msg[0], hexToBytes('0xabcd'), 'handled NewPooledTransactionHashes') }) } diff --git a/packages/client/test/service/lightethereumservice.spec.ts b/packages/client/test/service/lightethereumservice.spec.ts index ede731051b..8d7bfc0206 100644 --- a/packages/client/test/service/lightethereumservice.spec.ts +++ b/packages/client/test/service/lightethereumservice.spec.ts @@ -60,7 +60,7 @@ describe('should open', async () => { expect(server.addProtocols).toBeCalled() }) service.config.events.on(Event.SYNC_SYNCHRONIZED, () => { - it('should syncronize', () => { + it('should synchronize', () => { assert.ok(true, 'synchronized') }) }) diff --git a/packages/client/test/sim/4844-blobpost.md b/packages/client/test/sim/4844-blobpost.md index 2237e2d558..efc8030e87 100644 --- a/packages/client/test/sim/4844-blobpost.md +++ b/packages/client/test/sim/4844-blobpost.md @@ -24,4 +24,4 @@ currently it posts 2 txs, but that can be modified with another env variable `NU You can manipulate the fees for the txs using env variables in the following way (for e.g. to replace a low fee stuck tx): -`GAS_LIMIT=0xffffff MAX_FEE=1000000000 MAX_PRIORITY=100000000 MAX_DATAFEE=100000000 RIVATE_KEY=ae557af4ceefda559c924516cabf029bedc36b68109bf8d6183fe96e04121f4e RPC_URL=https://rpc.lodestar-ethereumjs-1.srv.4844-devnet-5.ethpandaops.io npm run tape -- test/sim/4844devnet5.spec.ts` +`GAS_LIMIT=0xffffff MAX_FEE=1000000000 MAX_PRIORITY=100000000 MAX_DATAFEE=100000000 PRIVATE_KEY=ae557af4ceefda559c924516cabf029bedc36b68109bf8d6183fe96e04121f4e RPC_URL=https://rpc.lodestar-ethereumjs-1.srv.4844-devnet-5.ethpandaops.io npm run tape -- test/sim/4844devnet5.spec.ts` diff --git a/packages/client/test/sim/4844-blobpost.spec.ts b/packages/client/test/sim/4844-blobpost.spec.ts index 68c41c4ec5..3282cfccff 100644 --- a/packages/client/test/sim/4844-blobpost.spec.ts +++ b/packages/client/test/sim/4844-blobpost.spec.ts @@ -36,7 +36,7 @@ console.log({ sender, rpcUrl, chainId, numTxs }) const network = 'sharding' const shardingJson = require(`./configs/${network}.json`) -// safely change chainId without modifying undelying json +// safely change chainId without modifying underlying json const commonJson = { ...shardingJson } commonJson.config = { ...commonJson.config, chainId } const common = createCommonFromGethGenesis(commonJson, { chain: network }) diff --git a/packages/client/test/sim/simutils.ts b/packages/client/test/sim/simutils.ts index 90f444ab32..89cf821779 100644 --- a/packages/client/test/sim/simutils.ts +++ b/packages/client/test/sim/simutils.ts @@ -240,10 +240,10 @@ export function runNetwork( throw Error('network is killed before end of test') } console.log('Killing network process', runProc.pid) - execSync(`pkill -15 -P ${runProc.pid}`) + execSync(`pkill -15 -P ${runProc.pid}`) // cspell:disable-line pkill if (peerRunProc !== undefined) { console.log('Killing peer network process', peerRunProc.pid) - execSync(`pkill -15 -P ${peerRunProc.pid}`) + execSync(`pkill -15 -P ${peerRunProc.pid}`) // cspell:disable-line pkill } // Wait for the P2P to be offline await waitForELOffline() @@ -608,7 +608,7 @@ export async function setupEngineUpdateRelay(client: EthereumClient, peerBeaconU } } -// To minimise noise on the spec run, selective filteration is applied to let the important events +// To minimize noise on the spec run, selective filtering is applied to let the important events // of the testnet log to show up in the spec log export const filterKeywords = [ 'warn', diff --git a/packages/client/test/sim/txGenerator.ts b/packages/client/test/sim/txGenerator.ts index ad59fc28d1..f59a64b267 100644 --- a/packages/client/test/sim/txGenerator.ts +++ b/packages/client/test/sim/txGenerator.ts @@ -29,12 +29,12 @@ const sender = createAddressFromPrivateKey(pkey) const kzg = await loadKZG() function get_padded(data: any, blobs_len: number) { - const pdata = new Uint8Array(blobs_len * USEFUL_BYTES_PER_BLOB) - const datalen = (data as Uint8Array).byteLength - pdata.fill(data, 0, datalen) + const pData = new Uint8Array(blobs_len * USEFUL_BYTES_PER_BLOB) + const dataLen = (data as Uint8Array).byteLength + pData.fill(data, 0, dataLen) // TODO: if data already fits in a pad, then ka-boom - pdata[datalen] = 0x80 - return pdata + pData[dataLen] = 0x80 + return pData } function get_blob(data: any) { @@ -61,11 +61,11 @@ function get_blobs(data: any) { const blobs_len = Math.ceil(len / USEFUL_BYTES_PER_BLOB) - const pdata = get_padded(data, blobs_len) + const pData = get_padded(data, blobs_len) const blobs: Uint8Array[] = [] for (let i = 0; i < blobs_len; i++) { - const chunk = pdata.subarray(i * USEFUL_BYTES_PER_BLOB, (i + 1) * USEFUL_BYTES_PER_BLOB) + const chunk = pData.subarray(i * USEFUL_BYTES_PER_BLOB, (i + 1) * USEFUL_BYTES_PER_BLOB) const blob = get_blob(chunk) blobs.push(blob) } diff --git a/packages/client/test/sync/skeleton.spec.ts b/packages/client/test/sync/skeleton.spec.ts index e3edb0a0c6..a26853cfa8 100644 --- a/packages/client/test/sync/skeleton.spec.ts +++ b/packages/client/test/sync/skeleton.spec.ts @@ -736,7 +736,7 @@ describe('[Skeleton] / setHead', async () => { { common, setHardfork: true }, ) - // lets jump ahead and add the block 81 and 71 with annoucements and trigger tryTailBackfill + // lets jump ahead and add the block 81 and 71 with announcements and trigger tryTailBackfill await skeleton.forkchoiceUpdate(block91) assert.equal(skeleton['status'].progress.subchains.length, 1, '1 subchain with older dropped') assert.equal( diff --git a/packages/client/test/sync/txpool.spec.ts b/packages/client/test/sync/txpool.spec.ts index 2adab3d5af..b93d5e2f25 100644 --- a/packages/client/test/sync/txpool.spec.ts +++ b/packages/client/test/sync/txpool.spec.ts @@ -450,7 +450,7 @@ describe('[TxPool]', async () => { const poolContent = pool.pool.get(address)! assert.equal(poolContent.length, 1, 'only one tx') assert.deepEqual(poolContent[0].tx.hash(), txA01.hash(), 'only later-added tx') - // Another attempt to add tx which should not be broadcased to peer2 + // Another attempt to add tx which should not be broadcasted to peer2 await pool.handleAnnouncedTxHashes([txA01.hash()], peer, peerPool) assert.equal(sentToPeer2, 1, 'no new broadcast attempt to the peer') // Just to enhance logging coverage, assign peerPool for stats collection diff --git a/packages/client/test/util/parse.spec.ts b/packages/client/test/util/parse.spec.ts index 5069c7dbc6..a0ac847f96 100644 --- a/packages/client/test/util/parse.spec.ts +++ b/packages/client/test/util/parse.spec.ts @@ -23,9 +23,9 @@ describe('[Util/Parse]', () => { ) assert.deepEqual( parseMultiaddrs( - '/ip4/1.1.1.2/tcp/50508/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa', + '/ip4/1.1.1.2/tcp/50508/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa', // cspell:disable-line ), - [multiaddr('/ip4/1.1.1.2/tcp/50508/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa')], + [multiaddr('/ip4/1.1.1.2/tcp/50508/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa')], // cspell:disable-line 'parse multiaddr with peer id', ) assert.deepEqual( diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md index 9f62741271..27cef87e72 100644 --- a/packages/common/CHANGELOG.md +++ b/packages/common/CHANGELOG.md @@ -220,7 +220,7 @@ While you could use our libraries in the browser libraries before, there had bee WE HAVE ELIMINATED ALL OF THEM. -The largest two undertakings: First: we have rewritten all (half) of our API and elimited the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went throuh our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. +The largest two undertakings: First: we have rewritten all (half) of our API and eliminated the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went through our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. Together with some few other modifications this now allows to run each (maybe adding an asterisk for client and devp2p) of our libraries directly in the browser - more or less without any modifications - see the `examples/browser.html` file in each package folder for an easy to set up example. @@ -490,7 +490,7 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). @@ -498,7 +498,7 @@ Now every import is a named import and we think the long term benefits will very #### Import Updates -Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all accross our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. +Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all across our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. So Common import and usage is changing from: @@ -621,9 +621,9 @@ Following methods have been removed accordingly: #### Type Changes -There are a few new types e.g. for configuration files (e.g. `CliqueConfig`) to get rid of some last `any` types in the package, see PR [#1906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1906). Eventually related problems should be seen early on in your TypeScript setup though and it should also be possile to easily attribute and fix. +There are a few new types e.g. for configuration files (e.g. `CliqueConfig`) to get rid of some last `any` types in the package, see PR [#1906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1906). Eventually related problems should be seen early on in your TypeScript setup though and it should also be possible to easily attribute and fix. -#### New File Structue +#### New File Structure The file structure of the package has been aligned with other libraries and there is now a dedicated `common.ts` file for the main source code with `index.ts` re-exporting functionality and types, see PR [#1915](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1915). Some misplaced types have been moved to `types.ts` and enums (like `Chain` or `Hardfork`) have been (internally) moved to an `enum.ts` file. You should generally use the root import from `index.ts`, if you are not doing and some imports broke this should be easily fixable though. @@ -633,7 +633,7 @@ We have completely refactored all our genesis (block) handling and moved the cod The most imminent benefit from this is a **dramatically reduced bundle size for the library, going down from a packed ~9 MB to something about 50 KB (!)**. -**Breaking:** See if you use `Common` genesis state functionality, e.g. by accessing pre-defined state with the `genesisState()` function (now removed) or by adding custom state with the `customChain` constructor (genesis-extended data format removed) and see description for `Block` and `Blockchain` breaking releases for context and how to replace the functionality. There are now also no `stateRoot` and `hash` configuration paramters in the `JSON` chain files any more, inclusion was a blocker for a clean refactor and this also wasn't compatible with the Geth genesis file format (these values can be calculated on an upper-library level). So you should remove these from your (custom) chain config files as well. +**Breaking:** See if you use `Common` genesis state functionality, e.g. by accessing pre-defined state with the `genesisState()` function (now removed) or by adding custom state with the `customChain` constructor (genesis-extended data format removed) and see description for `Block` and `Blockchain` breaking releases for context and how to replace the functionality. There are now also no `stateRoot` and `hash` configuration parameters in the `JSON` chain files any more, inclusion was a blocker for a clean refactor and this also wasn't compatible with the Geth genesis file format (these values can be calculated on an upper-library level). So you should remove these from your (custom) chain config files as well. ### Other Changes @@ -769,7 +769,7 @@ To allow a HF switch by total difficulty (TD) - which is planned for the Merge - There is a new `hardforkTD(hardfork?: string | Hardfork): BN | null` function to get the TD value for a HF switch (so primarily: for the `merge` HF) if a total difficulty HF switch is configured. -### Improved Typing for Hardfork, Chain and Genesis releated API Calls +### Improved Typing for Hardfork, Chain and Genesis related API Calls In the Common library all functionality returning hardfork, chain or genesis parameters has previously been under-typed respectively just returned `any` in most cases. This has been improved along PR [#1480](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1480) and is now finding its way into a release. @@ -809,7 +809,7 @@ If you have got left over type 1. `dao` HF inclusions in your custom chain files This release integrates the `london` HF blocks for all networks including `mainnet` and is therefore the first release with finalized London HF support. -### Reworked Custom Chain Instantation / Supported Custom Chains (Polygon / Arbitrum / xDaiChain) +### Reworked Custom Chain Instantiation / Supported Custom Chains (Polygon / Arbitrum / xDaiChain) This release introduces a new `Common.custom()` static constructor which replaces the now deprecated `Common.forCustomChain()` constructor and allows for an easier instantiation of a Common instance with somewhat adopted chain parameters, with the main use case to adopt on instantiating with a deviating chain ID. Instantiating a custom common instance with its own chain ID and inheriting all other parameters from `mainnet` can now be as easily done as: @@ -872,7 +872,7 @@ Common now supports settings for the following additional EIPs: - [EIP-3541](https://eips.ethereum.org/EIPS/eip-3541): Reject new contracts starting with the 0xEF byte, PR [#1240](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1240) - [EIP-3554](https://eips.ethereum.org/EIPS/eip-3554): Difficulty Bomb Delay to December 2021 (only PoW networks), PR [#1245](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1245) -All new EIPs have their dedicated EIP configuration file and can also be activated spearately with the `eips` parameter (and the so-created `common` instance can then e.g. be used within the VM): +All new EIPs have their dedicated EIP configuration file and can also be activated separately with the `eips` parameter (and the so-created `common` instance can then e.g. be used within the VM): ```ts import Common from '@ethereumjs/common' @@ -1065,7 +1065,7 @@ Gas fees for all hardforks up to `MuirGlacier` are now completely present within There is a new `Common.forkHash()` method returning pre-calculated Forkhash values or alternatively use the internal `Common._calcForkHash()` implementation to calculate a forkhash on the fly. -Forkhashes are used to uniquely identify a set of hardforks passed to be able to better differentiate between different dedicated chains. This is used for the `Eth/64` devp2p protocol update and specificed in [EIP-2124](https://eips.ethereum.org/EIPS/eip-2124) to help improve the devp2p networking stack. +Forkhashes are used to uniquely identify a set of hardforks passed to be able to better differentiate between different dedicated chains. This is used for the `Eth/64` devp2p protocol update and specified in [EIP-2124](https://eips.ethereum.org/EIPS/eip-2124) to help improve the devp2p networking stack. ### New Block/Hardfork related Utility Functions @@ -1086,7 +1086,7 @@ Current default hardfork is set to `istanbul`, PR [#906](https://github.com/ethe We significantly updated our internal tool and CI setup along the work on PR [#913](https://github.com/ethereumjs/ethereumjs-monorepo/pull/913) with an update to `ESLint` from `TSLint` for code linting and formatting and the introduction of a new build setup. -Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes @@ -1171,7 +1171,7 @@ Gas fees for all hardforks up to `MuirGlacier` are now completely present within There is a new `Common.forkHash()` method returning pre-calculated Forkhash values or alternatively use the internal `Common._calcForkHash()` implementation to calculate a forkhash on the fly. -Forkhashes are used to uniquely identify a set of hardforks passed to be able to better differentiate between different dedicated chains. This is used for the `Eth/64` devp2p protocol update and specificed in [EIP-2124](https://eips.ethereum.org/EIPS/eip-2124) to help improve the devp2p networking stack. +Forkhashes are used to uniquely identify a set of hardforks passed to be able to better differentiate between different dedicated chains. This is used for the `Eth/64` devp2p protocol update and specified in [EIP-2124](https://eips.ethereum.org/EIPS/eip-2124) to help improve the devp2p networking stack. ### New Block/Hardfork related Utility Functions @@ -1197,7 +1197,7 @@ for code linting and formatting and the introduction of a new build setup. Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result -in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes diff --git a/packages/common/README.md b/packages/common/README.md index d0cad1bd89..79abe06cb6 100644 --- a/packages/common/README.md +++ b/packages/common/README.md @@ -80,13 +80,13 @@ console.log(`EIP 4844 is active -- ${c.isActivatedEIP(4844)}`) ### Custom Cryptography Primitives (WASM) All EthereumJS packages use cryptographic primitives from the audited `ethereum-cryptography` library by default. -These primitves, including `keccak256`, `sha256`, and elliptic curve signature methods, are all written in native +These primitives, including `keccak256`, `sha256`, and elliptic curve signature methods, are all written in native Javascript and therefore have the potential downside of being less performant than alternative cryptography modules written in other languages and then compiled to WASM. If cryptography performance is a bottleneck in your usage of the EthereumJS libraries, you can provide your own primitives to the `Common` constructor and they will be used in place of the defaults. Depending on how your preferred primitives are implemented, you may need to write wrapper methods around them so they conform to the interface exposed by the [`common.customCrypto` property](./src/types.ts). -See the implementation of this in the [`@etheruemjs/client`](../client/bin/cli.ts#L810) using `@polkadot/wasm-crypto` +See the implementation of this in the [`@ethereumjs/client`](../client/bin/cli.ts#L810) using `@polkadot/wasm-crypto` for an example of how this is done for each available cryptographic primitive. Note: replacing native JS crypto primitives with WASM based libraries comes with new security assumptions (additional external dependencies, unauditability of WASM code). It is therefore recommended to evaluate your usage context before applying! @@ -121,7 +121,7 @@ main() The KZG library used for EIP-4844 Blob Transactions is initialized by `common` under the `common.customCrypto` property and is then used throughout the `Ethereumjs` stack wherever KZG cryptography is required. Below is an example of how -to initalize (assuming you are using the `c-kzg` package as your KZG cryptography library). +to initialize (assuming you are using the `c-kzg` package as your KZG cryptography library). ```ts // ./examples/initKzg.ts @@ -362,7 +362,7 @@ library supported: - `byzantium` (`Hardfork.Byzantium`) - `constantinople` (`Hardfork.Constantinople`) - `petersburg` (`Hardfork.Petersburg`) (aka `constantinopleFix`, apply together with `constantinople`) -- `istanbul` (`Hardfork.Instanbul`) +- `istanbul` (`Hardfork.Istanbul`) - `muirGlacier` (`Hardfork.MuirGlacier`) - `berlin` (`Hardfork.Berlin`) (since `v2.2.0`) - `london` (`Hardfork.London`) (since `v2.4.0`) diff --git a/packages/common/src/common.ts b/packages/common/src/common.ts index 2a19008654..7b598ae1ba 100644 --- a/packages/common/src/common.ts +++ b/packages/common/src/common.ts @@ -87,7 +87,7 @@ export class Common { /** * Update the internal Common EIP params set. Existing values - * will get preserved unless there is a new value for a paramter + * will get preserved unless there is a new value for a parameter * provided with params. * * Example Format: @@ -157,7 +157,7 @@ export class Common { } /** - * Returns the hardfork either based on block numer (older HFs) or + * Returns the hardfork either based on block number (older HFs) or * timestamp (Shanghai upwards). * * @param Opts Block number or timestamp @@ -240,7 +240,7 @@ export class Common { } /** - * Sets a new hardfork either based on block numer (older HFs) or + * Sets a new hardfork either based on block number (older HFs) or * timestamp (Shanghai upwards). * * @param Opts Block number or timestamp diff --git a/packages/common/src/eips.ts b/packages/common/src/eips.ts index bb0072c46f..091fae9ce4 100644 --- a/packages/common/src/eips.ts +++ b/packages/common/src/eips.ts @@ -35,7 +35,7 @@ export const eipsDict: EIPsDict = { minimumHardfork: Hardfork.SpuriousDragon, }, /** - * Constantinope HF Meta EIP + * Constantinople HF Meta EIP */ 1013: { minimumHardfork: Hardfork.Constantinople, diff --git a/packages/common/src/interfaces.ts b/packages/common/src/interfaces.ts index f8c224e38f..03f189b57e 100644 --- a/packages/common/src/interfaces.ts +++ b/packages/common/src/interfaces.ts @@ -145,7 +145,7 @@ export interface StateManagerInterface { * Extra Functionality * * Optional non-essential methods, these methods should always be guarded - * on usage (check for existance) + * on usage (check for existence) */ // Client RPC getProof?(address: Address, storageSlots: Uint8Array[]): Promise diff --git a/packages/common/src/utils.ts b/packages/common/src/utils.ts index 090591a69a..5061ecd520 100644 --- a/packages/common/src/utils.ts +++ b/packages/common/src/utils.ts @@ -115,10 +115,10 @@ function parseGethParams(json: any) { type: 'poa', algorithm: 'clique', clique: { - // The recent geth genesis seems to be using blockperiodseconds + // The recent geth genesis seems to be using blockperiodseconds // cspell:disable-line // and epochlength for clique specification // see: https://hackmd.io/PqZgMpnkSWCWv5joJoFymQ - period: config.clique.period ?? config.clique.blockperiodseconds, + period: config.clique.period ?? config.clique.blockperiodseconds, // cspell:disable-line epoch: config.clique.epoch ?? config.clique.epochlength, }, } diff --git a/packages/common/test/chains.spec.ts b/packages/common/test/chains.spec.ts index a96ca4e951..d7ad6e6b98 100644 --- a/packages/common/test/chains.spec.ts +++ b/packages/common/test/chains.spec.ts @@ -47,7 +47,7 @@ describe('[Common/Chains]: Initialization / Chain params', () => { it('Should handle initialization errors', () => { const f = function () { - new Common({ chain: Mainnet, hardfork: 'hardforknotexisting' }) + new Common({ chain: Mainnet, hardfork: 'hardforkNotExisting' }) } const msg = 'should throw an exception on non-existing hardfork' assert.throws(f, /not supported$/, undefined, msg) // eslint-disable-line no-new diff --git a/packages/common/test/data/paramsTest.ts b/packages/common/test/data/paramsTest.ts index b6121c1b65..367c2e3c78 100644 --- a/packages/common/test/data/paramsTest.ts +++ b/packages/common/test/data/paramsTest.ts @@ -18,7 +18,7 @@ export const paramsTest: ParamsDict = { minerReward: '3000000000000000000', // the amount a miner get rewarded for mining a block }, /** -. * Constantinope HF Meta EIP +. * Constantinople HF Meta EIP . */ 1013: { // gasPrices diff --git a/packages/common/test/hardforks.spec.ts b/packages/common/test/hardforks.spec.ts index fa929bd752..3e37ec5e3c 100644 --- a/packages/common/test/hardforks.spec.ts +++ b/packages/common/test/hardforks.spec.ts @@ -293,8 +293,8 @@ describe('[Common]: Hardfork logic', () => { istanbulBlock: 0, muirGlacierBlock: 0, berlinBlock: 0, - yolov2Block: 0, - yolov3Block: 0, + yolov2Block: 0, // cspell:disable-line + yolov3Block: 0, // cspell:disable-line londonBlock: 0, mergeForkBlock: 0, terminalTotalDifficulty: 0, @@ -318,7 +318,7 @@ describe('[Common]: Hardfork logic', () => { const zeroCommonShanghaiFork = zeroCommon.forkHash(Hardfork.Shanghai, genesisHash) const zeroCommonCancunFork = zeroCommon.forkHash(Hardfork.Shanghai, genesisHash) - // Ensure that Shangai fork + Cancun fork have equal forkhash + // Ensure that Shanghai fork + Cancun fork have equal forkhash assert.equal(zeroCommonShanghaiFork, zeroCommonCancunFork) // Set the cancun time to the genesis block time (this should not change the forkHash) diff --git a/packages/common/test/params.spec.ts b/packages/common/test/params.spec.ts index 9e0b913c7d..5d2e086877 100644 --- a/packages/common/test/params.spec.ts +++ b/packages/common/test/params.spec.ts @@ -4,7 +4,7 @@ import { Common, Hardfork, Mainnet } from '../src/index.js' import { paramsTest } from './data/paramsTest.js' -describe('[Common]: Parameter instantion / params option / Updates', () => { +describe('[Common]: Parameter instantiation / params option / Updates', () => { it('Param option', () => { const c = new Common({ chain: Mainnet, params: paramsTest }) let msg = 'Should also work with parameters passed with params option' @@ -46,7 +46,7 @@ describe('[Common]: Parameter access for param(), paramByHardfork()', () => { assert.equal(c.param('ecAddGas'), BigInt(150), msg) assert.throws(() => { - c.paramByHardfork('notexistingvalue', 'byzantium') + c.paramByHardfork('notExistingValue', 'byzantium') }) /* @@ -115,10 +115,10 @@ describe('[Common]: Parameter access for param(), paramByHardfork()', () => { const c = new Common({ chain: Mainnet, params: paramsTest }) assert.throws(() => { - c.paramByEIP('notexistingvalue', 1559) + c.paramByEIP('notExistingValue', 1559) }) assert.throws(() => { - c.paramByEIP('notexistingvalue', 2537) + c.paramByEIP('notExistingValue', 2537) }) const UNSUPPORTED_EIP = 1000000 diff --git a/packages/common/test/utils.spec.ts b/packages/common/test/utils.spec.ts index 7dff0e0a39..f9a9e2a8da 100644 --- a/packages/common/test/utils.spec.ts +++ b/packages/common/test/utils.spec.ts @@ -89,7 +89,7 @@ describe('[Utils/Parse]', () => { ) }) - it('should correctly parse deposit contract adddress', async () => { + it('should correctly parse deposit contract address', async () => { // clone json out to not have side effects const customJson = JSON.parse(JSON.stringify(postMergeHardforkJSON)) Object.assign(customJson.config, { diff --git a/packages/devp2p/CHANGELOG.md b/packages/devp2p/CHANGELOG.md index 0d87820eda..c15c99b400 100644 --- a/packages/devp2p/CHANGELOG.md +++ b/packages/devp2p/CHANGELOG.md @@ -93,7 +93,7 @@ While you could use our libraries in the browser libraries before, there had bee WE HAVE ELIMINATED ALL OF THEM. -The largest two undertakings: First: we have rewritten all (half) of our API and elimited the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went throuh our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. +The largest two undertakings: First: we have rewritten all (half) of our API and eliminated the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went through our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. Together with some few other modifications this now allows to run each (maybe adding an asterisk for client and devp2p) of our libraries directly in the browser - more or less without any modifications - see the `examples/browser.html` file in each package folder for an easy to set up example. @@ -316,7 +316,7 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). @@ -324,7 +324,7 @@ Now every import is a named import and we think the long term benefits will very #### Common Library Import Updates -Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all accross our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. +Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all across our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. So Common import and usage is changing from: @@ -468,7 +468,7 @@ DNS discovery can be activated in the `DPT` module with the `shouldGetDnsPeers` - `maxPeers`, `dpt`, and `listenPort` are now optional in `RLPxOptions`, PR [#1019](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1019) - New `DPTOptions` interface, `DPT` type improvements, PR [#1029](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1029) - Improved `RLPx` disconnect reason debug output, PR [#1031](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1031) -- `LES`: unifiy `ETH` and `LES` `sendMessage()` signature by somewhat change payload semantics and pass in `reqId` along, PR [#1087](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1087) +- `LES`: unify `ETH` and `LES` `sendMessage()` signature by somewhat change payload semantics and pass in `reqId` along, PR [#1087](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1087) - `RLPx`: limit connection refill debug logging to a restarted interval log message to not bloat logging too much, PR [#1087](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1087) ### Connection Reliability / Bug Fixes diff --git a/packages/devp2p/README.md b/packages/devp2p/README.md index a9c7269b8d..7021acefeb 100644 --- a/packages/devp2p/README.md +++ b/packages/devp2p/README.md @@ -172,7 +172,7 @@ import { hexToBytes } from '@ethereumjs/util' const main = async () => { const common = new Common({ chain: Chain.Mainnet }) const PRIVATE_KEY = hexToBytes( - '0xed6df2d4b7e82d105538e4a1279925a16a84e772243e80a561e1b201f2e78220' + '0xed6df2d4b7e82d105538e4a1279925a16a84e772243e80a561e1b201f2e78220', ) const rlpx = new RLPx(PRIVATE_KEY, { maxPeers: 25, @@ -541,7 +541,7 @@ The following is a list of major implementations of the `devp2p` stack in other - Python: [pydevp2p](https://github.com/ethereum/pydevp2p) - Go: [Go Ethereum](https://github.com/ethereum/go-ethereum/tree/master/p2p) -- Elixir: [Exthereum](https://github.com/exthereum/exth_crypto) +- Elixir: [Exthereum](https://github.com/exthereum/exth_crypto) ### Links diff --git a/packages/devp2p/src/dns/dns.ts b/packages/devp2p/src/dns/dns.ts index ac526b30c1..2b0ad7226a 100644 --- a/packages/devp2p/src/dns/dns.ts +++ b/packages/devp2p/src/dns/dns.ts @@ -129,7 +129,7 @@ export class DNS { * * @param {string[]} branches * @param {SearchContext} context - * @return {String} subdomian + * @return {String} subdomain */ private _selectRandomPath(branches: string[], context: SearchContext): string { // Identify domains already visited in this traversal of the DNS tree. diff --git a/packages/devp2p/src/dns/enr.ts b/packages/devp2p/src/dns/enr.ts index 43ad937c35..52bea14b9e 100644 --- a/packages/devp2p/src/dns/enr.ts +++ b/packages/devp2p/src/dns/enr.ts @@ -100,7 +100,7 @@ export class ENR { if (!root.startsWith(this.ROOT_PREFIX)) throw new Error(`ENR root entry must start with '${this.ROOT_PREFIX}'`) - const rootVals = sscanf( + const rootValues = sscanf( root, `${this.ROOT_PREFIX}v1 e=%s l=%s seq=%d sig=%s`, 'eRoot', @@ -109,10 +109,10 @@ export class ENR { 'signature', ) as ENRRootValues - if (!rootVals.eRoot) throw new Error("Could not parse 'e' value from ENR root entry") - if (!rootVals.lRoot) throw new Error("Could not parse 'l' value from ENR root entry") - if (!rootVals.seq) throw new Error("Could not parse 'seq' value from ENR root entry") - if (!rootVals.signature) throw new Error("Could not parse 'sig' value from ENR root entry") + if (!rootValues.eRoot) throw new Error("Could not parse 'e' value from ENR root entry") + if (!rootValues.lRoot) throw new Error("Could not parse 'l' value from ENR root entry") + if (!rootValues.seq) throw new Error("Could not parse 'seq' value from ENR root entry") + if (!rootValues.signature) throw new Error("Could not parse 'sig' value from ENR root entry") const decodedPublicKey = [...base32.decode(publicKey + '===').values()] @@ -122,7 +122,7 @@ export class ENR { const signedComponent = root.split(' sig')[0] const signedComponentBytes = utf8ToBytes(signedComponent) const signatureBytes = Uint8Array.from( - [...base64url.decode(rootVals.signature + '=').values()].slice(0, 64), + [...base64url.decode(rootValues.signature + '=').values()].slice(0, 64), ) const keyBytes = Uint8Array.from(decodedPublicKey) @@ -135,7 +135,7 @@ export class ENR { if (!isVerified) throw new Error('Unable to verify ENR root signature') - return rootVals.eRoot + return rootValues.eRoot } /** @@ -150,17 +150,17 @@ export class ENR { if (!tree.startsWith(this.TREE_PREFIX)) throw new Error(`ENR tree entry must start with '${this.TREE_PREFIX}'`) - const treeVals = sscanf( + const treeValues = sscanf( tree, `${this.TREE_PREFIX}//%s@%s`, 'publicKey', 'domain', ) as ENRTreeValues - if (!treeVals.publicKey) throw new Error('Could not parse public key from ENR tree entry') - if (!treeVals.domain) throw new Error('Could not parse domain from ENR tree entry') + if (!treeValues.publicKey) throw new Error('Could not parse public key from ENR tree entry') + if (!treeValues.domain) throw new Error('Could not parse domain from ENR tree entry') - return treeVals + return treeValues } /** diff --git a/packages/devp2p/src/dpt/server.ts b/packages/devp2p/src/dpt/server.ts index 73b3c16076..3fea7d07a7 100644 --- a/packages/devp2p/src/dpt/server.ts +++ b/packages/devp2p/src/dpt/server.ts @@ -90,8 +90,8 @@ export class Server { async ping(peer: PeerInfo): Promise { this._isAliveCheck() - const rckey = `${peer.address}:${peer.udpPort}` - const promise = this._requestsCache.get(rckey) + const rcKey = `${peer.address}:${peer.udpPort}` + const promise = this._requestsCache.get(rcKey) if (promise !== undefined) return promise const hash = this._send(peer, 'ping', { @@ -101,12 +101,12 @@ export class Server { }) const deferred = createDeferred() - const rkey = bytesToUnprefixedHex(hash) - this._requests.set(rkey, { + const rKey = bytesToUnprefixedHex(hash) + this._requests.set(rKey, { peer, deferred, timeoutId: setTimeout(() => { - if (this._requests.get(rkey) !== undefined) { + if (this._requests.get(rKey) !== undefined) { if (this.DEBUG) { this._debug( `ping timeout: ${peer.address}:${peer.udpPort} ${ @@ -114,14 +114,14 @@ export class Server { }`, ) } - this._requests.delete(rkey) + this._requests.delete(rKey) deferred.reject(new Error(`Timeout error: ping ${peer.address}:${peer.udpPort}`)) } else { return deferred.promise } }, this._timeout), }) - this._requestsCache.set(rckey, deferred.promise) + this._requestsCache.set(rcKey, deferred.promise) return deferred.promise } @@ -189,10 +189,10 @@ export class Server { } case 'pong': { - const rkey = bytesToUnprefixedHex(info.data.hash) - const request = this._requests.get(rkey) + const rKey = bytesToUnprefixedHex(info.data.hash) + const request = this._requests.get(rKey) if (request !== undefined) { - this._requests.delete(rkey) + this._requests.delete(rKey) request.deferred.resolve({ id: peerId, address: request.peer.address, diff --git a/packages/devp2p/src/ext/kbucket.ts b/packages/devp2p/src/ext/kbucket.ts index 38f25eeab2..de33f2824f 100644 --- a/packages/devp2p/src/ext/kbucket.ts +++ b/packages/devp2p/src/ext/kbucket.ts @@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE. // TODO: Also internalize types from Definitely Typed at some point // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/266eae5148c535e6b41fe5d0adb2ad23f302bc8a/types/k-bucket/index.d.ts#L4 -// (side note: this was once done by tomonari-t dedicatedly for this library +// (side note: this was once done by tomonari-t dedicatedly for this library // cspell:disable-line // (please nevertheless include the original license reference)) import { equalsBytes, randomBytes } from '@ethereumjs/util' @@ -38,12 +38,12 @@ import { EventEmitter } from 'events' import type { Contact, KBucketOptions, PeerInfo } from '../types.js' function createNode() { - return { contacts: [], dontSplit: false, left: null, right: null } + return { contacts: [], noSplit: false, left: null, right: null } } type KBucketNode = { contacts: Contact[] | null - dontSplit: boolean + noSplit: boolean left: KBucketNode | null right: KBucketNode | null } @@ -149,12 +149,12 @@ export class KBucket { } // the bucket is full - if (node.dontSplit) { + if (node.noSplit) { // we are not allowed to split the bucket // we need to ping the first this._numberOfNodesToPing // in order to determine if they are alive // only if one of the pinged nodes does not respond, can the new contact - // be added (this prevents DoS flodding with new invalid contacts) + // be added (this prevents DoS flooding with new invalid contacts) this.events.emit('ping', node.contacts.slice(0, this._numberOfNodesToPing), contact) return this } @@ -339,10 +339,10 @@ export class KBucket { // don't split the "far away" node // we check where the local node would end up and mark the other one as - // "dontSplit" (i.e. "far away") + // "noSplit" (i.e. "far away") const detNode = this._determineNode(node, this._localNodeId, bitIndex) const otherNode = node.left === detNode ? node.right : node.left - otherNode.dontSplit = true + otherNode.noSplit = true } /** diff --git a/packages/devp2p/src/rlpx/ecies.ts b/packages/devp2p/src/rlpx/ecies.ts index fd59b7af8e..c688cbbead 100644 --- a/packages/devp2p/src/rlpx/ecies.ts +++ b/packages/devp2p/src/rlpx/ecies.ts @@ -108,7 +108,7 @@ export class ECIES { const x = ecdhX(this._remotePublicKey, privateKey) const key = concatKDF(x, 32) const ekey = key.subarray(0, 16) // encryption key - const mkey = crypto.createHash('sha256').update(key.subarray(16, 32)).digest() // MAC key + const mKey = crypto.createHash('sha256').update(key.subarray(16, 32)).digest() // MAC key // encrypt const IV = getRandomBytesSync(16) @@ -121,7 +121,7 @@ export class ECIES { sharedMacData = Uint8Array.from([]) } const tag = Uint8Array.from( - crypto.createHmac('sha256', mkey).update(concatBytes(dataIV, sharedMacData)).digest(), + crypto.createHmac('sha256', mKey).update(concatBytes(dataIV, sharedMacData)).digest(), ) const publicKey = secp256k1.getPublicKey(privateKey, false) @@ -144,14 +144,14 @@ export class ECIES { const x = ecdhX(publicKey, this._privateKey) const key = concatKDF(x, 32) const ekey = key.subarray(0, 16) // encryption key - const mkey = Uint8Array.from(crypto.createHash('sha256').update(key.subarray(16, 32)).digest()) // MAC key + const mKey = Uint8Array.from(crypto.createHash('sha256').update(key.subarray(16, 32)).digest()) // MAC key // check the tag if (!sharedMacData) { sharedMacData = Uint8Array.from([]) } const _tag = crypto - .createHmac('sha256', mkey) + .createHmac('sha256', mKey) .update(concatBytes(dataIV, sharedMacData)) .digest() assertEq(_tag, tag, 'should have valid tag', debug) @@ -237,7 +237,7 @@ export class ECIES { let signature = null let recoveryId = null - let heid = null + let heId = null let remotePublicKey = null let nonce = null @@ -246,7 +246,7 @@ export class ECIES { signature = decrypted.subarray(0, 64) recoveryId = decrypted[64] - heid = decrypted.subarray(65, 97) // 32 bytes + heId = decrypted.subarray(65, 97) // 32 bytes remotePublicKey = id2pk(decrypted.subarray(97, 161)) nonce = decrypted.subarray(161, 193) } else { @@ -277,10 +277,10 @@ export class ECIES { if (this._remoteEphemeralPublicKey === null) return this._ephemeralSharedSecret = ecdhX(this._remoteEphemeralPublicKey, this._ephemeralPrivateKey) - if (heid !== null && this._remoteEphemeralPublicKey !== null) { + if (heId !== null && this._remoteEphemeralPublicKey !== null) { assertEq( this._keccakFunction(pk2id(this._remoteEphemeralPublicKey)), - heid, + heId, 'the hash of the ephemeral key should match', debug, ) diff --git a/packages/devp2p/src/rlpx/rlpx.ts b/packages/devp2p/src/rlpx/rlpx.ts index 7e5f49a158..00454c1980 100644 --- a/packages/devp2p/src/rlpx/rlpx.ts +++ b/packages/devp2p/src/rlpx/rlpx.ts @@ -112,8 +112,8 @@ export class RLPx { this._peers = new Map() this._peersQueue = [] this._peersLRU = new LRUCache({ max: 25000 }) - const REFILL_INTERVALL = 10000 // 10 sec * 1000 - const refillIntervalSubdivided = Math.floor(REFILL_INTERVALL / 10) + const REFILL_INTERVAL = 10000 // 10 sec * 1000 + const refillIntervalSubdivided = Math.floor(REFILL_INTERVAL / 10) this._refillIntervalId = setInterval(() => this._refillConnections(), refillIntervalSubdivided) this._keccakFunction = options.common?.customCrypto.keccak256 ?? keccak256 diff --git a/packages/devp2p/test/dns.spec.ts b/packages/devp2p/test/dns.spec.ts index 70bdb3d018..ff20fd020d 100644 --- a/packages/devp2p/test/dns.spec.ts +++ b/packages/devp2p/test/dns.spec.ts @@ -20,6 +20,7 @@ describe('DNS', () => { } const host = 'nodes.example.org' + // cspell:disable const rootDomain = 'JORXBYVVM7AEKETX5DGXW44EAY' const branchDomainA = 'D2SNLTAGWNQ34NTQTPHNZDECFU' const branchDomainB = 'D3SNLTAGWNQ34NTQTPHNZDECFU' @@ -27,6 +28,7 @@ describe('DNS', () => { const branchDomainD = 'D5SNLTAGWNQ34NTQTPHNZDECFU' const partialBranchA = 'AAAA' const partialBranchB = 'BBBB' + // cspell:enable const singleBranch = `enrtree-branch:${branchDomainA}` const doubleBranch = `enrtree-branch:${branchDomainA},${branchDomainB}` const multiComponentBranch = [ @@ -153,7 +155,7 @@ describe('DNS', () => { }) describe('DNS: (integration)', () => { - const publicKey = 'AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE' + const publicKey = 'AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE' // cspell:disable-line const goerliDNS = 'all.goerli.ethdisco.net' const enrTree = `enrtree://${publicKey}@${goerliDNS}` const ipTestRegex = /^\d+\.\d+\.\d+\.\d+$/ // e.g 123.44.55.77 diff --git a/packages/devp2p/test/enr.spec.ts b/packages/devp2p/test/enr.spec.ts index 60b1858740..9882a41137 100644 --- a/packages/devp2p/test/enr.spec.ts +++ b/packages/devp2p/test/enr.spec.ts @@ -10,7 +10,7 @@ describe('ENR tests', () => { // Root DNS entries it('ENR (root): should parse and verify and DNS root entry', () => { const subdomain = ENR.parseAndVerifyRoot(dns.enrRoot, dns.publicKey) - assert.equal(subdomain, 'JORXBYVVM7AEKETX5DGXW44EAY', 'returns correct subdomain') + assert.equal(subdomain, 'JORXBYVVM7AEKETX5DGXW44EAY', 'returns correct subdomain') // cspell:disable-line }) it('ENR (root): should error if DNS root entry is mis-prefixed', () => { @@ -79,9 +79,11 @@ describe('ENR tests', () => { // Branch entries it('ENR (branch): should parse and verify a single component DNS branch entry', () => { const expected = [ + // cspell:disable 'D2SNLTAGWNQ34NTQTPHNZDECFU', '67BLTJEU5R2D5S3B4QKJSBRFCY', 'A2HDMZBB4JIU53VTEGC4TG6P4A', + // cspell:enable ] const branches = ENR.parseBranch(dns.enrBranch) diff --git a/packages/ethash/CHANGELOG.md b/packages/ethash/CHANGELOG.md index 464f316b23..c47b127690 100644 --- a/packages/ethash/CHANGELOG.md +++ b/packages/ethash/CHANGELOG.md @@ -42,7 +42,7 @@ While you could use our libraries in the browser libraries before, there had bee WE HAVE ELIMINATED ALL OF THEM. -The largest two undertakings: First: we have rewritten all (half) of our API and elimited the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went throuh our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. +The largest two undertakings: First: we have rewritten all (half) of our API and eliminated the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went through our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. Together with some few other modifications this now allows to run each (maybe adding an asterisk for client and devp2p) of our libraries directly in the browser - more or less without any modifications - see the `examples/browser.html` file in each package folder for an easy to set up example. @@ -178,7 +178,7 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). @@ -186,7 +186,7 @@ Now every import is a named import and we think the long term benefits will very #### Common Library Import Updates -Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all accross our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. +Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all across our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. So Common import and usage is changing from: @@ -331,7 +331,7 @@ See `Ethash` [README](https://github.com/ethereumjs/ethereumjs-monorepo/tree/mas We significantly updated our internal tool and CI setup along the work on PR [#913](https://github.com/ethereumjs/ethereumjs-monorepo/pull/913) with an update to `ESLint` from `TSLint` for code linting and formatting and the introduction of a new build setup. -Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes @@ -394,7 +394,7 @@ for code linting and formatting and the introduction of a new build setup. Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result -in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index d24c8d91a4..1abb3d322f 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -61,7 +61,7 @@ An update to this release is therefore strongly recommended even if other fixes ### New EVM.create() Async Static Constructor -This is an in-between breaking release on both the EVM and VM packages due to a problematic top level await() discovery in the underlying `rustbn-wasm` library (see issue [#10](https://github.com/ethereumjs/rustbn-wasm/issues/10)) generally affecting the compatiblity of our libraries. +This is an in-between breaking release on both the EVM and VM packages due to a problematic top level await() discovery in the underlying `rustbn-wasm` library (see issue [#10](https://github.com/ethereumjs/rustbn-wasm/issues/10)) generally affecting the compatibility of our libraries. The `EVM` direct constructor initialization with `new EVM()` now has been deprecated and replaced by an async static `create()` constructor, as it is already done in various other libraries in the EthereumJS monorepo, see PRs [#3304](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3304/) and [#3315](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3315). @@ -121,7 +121,7 @@ Since this fits well also to be placed here relatively prominently for awareness ## 2.2.1 - 2024-02-08 -- Hotfix release moving the `@ethereumjs/verkle` dependency for `@ethereumjs/statemanager` from a peer dependency to the main dependencis (note that this decision might be temporary) +- Hotfix release moving the `@ethereumjs/verkle` dependency for `@ethereumjs/statemanager` from a peer dependency to the main dependencies (note that this decision might be temporary) ## 2.2.0 - 2024-02-08 @@ -239,7 +239,7 @@ While you could use our libraries in the browser libraries before, there had bee WE HAVE ELIMINATED ALL OF THEM. -The largest two undertakings: First: we have rewritten all (half) of our API and elimited the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went throuh our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. +The largest two undertakings: First: we have rewritten all (half) of our API and eliminated the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went through our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. Together with some few other modifications this now allows to run each (maybe adding an asterisk for client and devp2p) of our libraries directly in the browser - more or less without any modifications - see the `examples/browser.html` file in each package folder for an easy to set up example. @@ -522,7 +522,7 @@ The EVM now integrates a new point evaluation precompile at address `0x14` to "v ### Bug Fixes and Other Changes - Gas cost fixes for `EIP-3860` (experimental), PR [#2397](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2397) -- More correctly timed `nonce` updates to avoid certain consensus-critical `nonce`/`account` update constallations. PR [#2404](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2404) +- More correctly timed `nonce` updates to avoid certain consensus-critical `nonce`/`account` update constellations. PR [#2404](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2404) - Fixed chainstart/Frontier mainnet bug, PR [#2439](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2439) - EVM memory expansion performance optimizations, PR [#2405](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2405) - `EIP-4895` beacon chain withdrawals support (see `@ethereumjs/vm` for full documentation), PRs [#2353](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2353) and [#2401](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2401) @@ -565,7 +565,7 @@ common.setForkHashes(genesisHash) Along some deeper investigation of build errors related to the usage of the `async-eventemitter` package we finally decided to completely switch to a new async event emitter package for VM/EVM events, see PR [#2303](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2303). The old [async-eventemitter](https://github.com/ahultgren/async-eventemitter) package hasn't been updated for several years and the new [eventemitter2](https://github.com/EventEmitter2/EventEmitter2) package is more modern and maintained as well as substantially more used and therefore a future-proof choice for an async event emitter library to build the VM/EVM event emitting system upon. -The significant parts of the API of both the old and the new libraries are the same and the switch shouldn't cause too much hazzle for people upgrading. In case you nevertheless stumble upon upgrading problems regarding the event emitter package switch please feel free to open an issue, we'll be there to assist you on the upgrade! +The significant parts of the API of both the old and the new libraries are the same and the switch shouldn't cause too much hassle for people upgrading. In case you nevertheless stumble upon upgrading problems regarding the event emitter package switch please feel free to open an issue, we'll be there to assist you on the upgrade! ### Other Changes and Fixes @@ -598,7 +598,7 @@ This is the biggest EVM change in this release. The inheritance structure of the This allows for an easier typing of the `EVM` and makes the core EVM class leaner and not overloaded with various other partly unused properties. The new `events` property is optional. -Usage code of events needs to be slighly adopted and updated from: +Usage code of events needs to be slightly adopted and updated from: ```ts evm.on('step', (e) => { @@ -647,7 +647,7 @@ const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) - Ensure EVM runs when nonce is 0, PR [#2054](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2054) - EVM/VM instantiation fixes, PR [#2078](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2078) -- Moved `@types/async-eventemitter` from devDependencis to dependencies, PR [#2077](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2077) +- Moved `@types/async-eventemitter` from devDependencies to dependencies, PR [#2077](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2077) - Added additional exports `EvmErrorMessage`, `ExecResult`, `InterpreterStep`, `Message`, PR [#2063](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2063) ## 1.0.0-beta.2 - 2022-07-15 @@ -656,7 +656,7 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). @@ -664,7 +664,7 @@ Now every import is a named import and we think the long term benefits will very #### Common Library Import Updates -Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all accross our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. +Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all across our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. So Common import and usage is changing from: @@ -906,7 +906,7 @@ Note that state in the VM is not activated by default (this also goes for accoun ### L2 Support: Custom Opcodes Option -There is now a new option `customOpcodes` for the VM which allows to add custom opcodes to the VM, see PR [#1705](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1705). This should be useful for L2s and other EVM based side chains if they come with a slighly different opcode set for bytecode execution. +There is now a new option `customOpcodes` for the VM which allows to add custom opcodes to the VM, see PR [#1705](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1705). This should be useful for L2s and other EVM based side chains if they come with a slightly different opcode set for bytecode execution. New opcodes can be passed in with its own logic function and an additional function for gas calculation. Additionally the new option allows for overwriting and/or deleting existing opcodes. @@ -993,7 +993,7 @@ invalid receiptTrie (vm hf=berlin -> block number=1 hash=0x8e368301586b53e30c58d The extended errors give substantial more object and chain context and should ease debugging. -**Potentially breaking**: Attention! If you do react on errors in your code and do exact errror matching (`error.message === 'invalid transaction trie'`) things will break. Please make sure to do error comparisons with something like `error.message.includes('invalid transaction trie')` instead. This should generally be the pattern used for all error message comparisions and is assured to be future proof on all error messages (we won't change the core text in non-breaking releases). +**Potentially breaking**: Attention! If you do react on errors in your code and do exact error matching (`error.message === 'invalid transaction trie'`) things will break. Please make sure to do error comparisons with something like `error.message.includes('invalid transaction trie')` instead. This should generally be the pattern used for all error message comparisons and is assured to be future proof on all error messages (we won't change the core text in non-breaking releases). ### Other Changes @@ -1112,7 +1112,7 @@ There is a new EVM Object Format (EOF) in preparation which will allow to valida ### StateManager: Preserve State History -This VM release bumps the `merkle-patricia-tree` dependeny to `v4.2.0`, which is used as a datastore for the default `StateManager` implementation. The new MPT version switches to a default behavior to not delete any trie nodes on checkpoint commits, which has implications on the `StateManager.commit()` function which internally calls the MPT commit. This allows to go back to older trie states by setting a new (old) state root with `StateManager.setStateRoot()`. The trie state is now guaranteed to still be consistent and complete, which has not been the case before and lead to erraneous behaviour in certain usage scenarios (e.g. reported by HardHat). +This VM release bumps the `merkle-patricia-tree` dependency to `v4.2.0`, which is used as a datastore for the default `StateManager` implementation. The new MPT version switches to a default behavior to not delete any trie nodes on checkpoint commits, which has implications on the `StateManager.commit()` function which internally calls the MPT commit. This allows to go back to older trie states by setting a new (old) state root with `StateManager.setStateRoot()`. The trie state is now guaranteed to still be consistent and complete, which has not been the case before and lead to erroneous behaviour in certain usage scenarios (e.g. reported by HardHat). See PR [#1262](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1262) @@ -1133,7 +1133,7 @@ See PR [#1168](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1168) ## 5.3.2 - 2021-04-12 -This is a hot-fix performance release, removing the `debug` functionality from PR [#1080](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1080) and follow-up PRs. While highly useful for debugging, this feature side-introduced a siginficant reduction in VM performance which went along unnoticed. For now we will remove since upstream dependencies are awaiting a new release before the `Belin` HF happening. We will try to re-introduce in a performance friendly manner in some subsequent release (we cannot promise on that though). +This is a hot-fix performance release, removing the `debug` functionality from PR [#1080](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1080) and follow-up PRs. While highly useful for debugging, this feature side-introduced a significant reduction in VM performance which went along unnoticed. For now we will remove since upstream dependencies are awaiting a new release before the `Berlin` HF happening. We will try to re-introduce in a performance friendly manner in some subsequent release (we cannot promise on that though). See PR [#1198](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1198). @@ -1247,7 +1247,7 @@ If you are using this library in conjunction with other EthereumJS libraries mak ### Other Features - `{ stateRoot, gasUsed, logsBloom, receiptRoot }` have been added to `RunBlockResult` and will be emitted with `afterBlock`, PR [#853](https://github.com/ethereumjs/ethereumjs-monorepo/pull/853) -- Added `vm:eei:gas` EEI gas debug looger, PR [#1124](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1124) +- Added `vm:eei:gas` EEI gas debug logger, PR [#1124](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1124) ### Other Fixes @@ -1374,7 +1374,7 @@ const common = new Common({ chain: 'mainnet', hardfork: 'spuriousDragon' }) const vm = new VM({ common }) ``` -**Breaking**: The default HF from the VM has been updated from `petersburg` to `istanbul`. The HF setting is now automatically taken from the HF set for `Common.DEAULT_HARDFORK`, see PR [#906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/906). +**Breaking**: The default HF from the VM has been updated from `petersburg` to `istanbul`. The HF setting is now automatically taken from the HF set for `Common.DEFAULT_HARDFORK`, see PR [#906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/906). **Breaking**: Please note that the options to directly pass in `chain` and `hardfork` strings have been removed to simplify the API. Providing a `Common` instance is now the only way to change the chain setup, see PR [#863](https://github.com/ethereumjs/ethereumjs-monorepo/pull/863) @@ -1427,7 +1427,7 @@ The Util package also introduces a new [Address class](https://github.com/ethere We significantly updated our internal tool and CI setup along the work on PR [#913](https://github.com/ethereumjs/ethereumjs-monorepo/pull/913) with an update to `ESLint` from `TSLint` for code linting and formatting and the introduction of a new build setup. -Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes @@ -1528,7 +1528,7 @@ const vm = new VM({ common }) ``` **Breaking**: The default HF from the VM has been updated from `petersburg` to `istanbul`. -The HF setting is now automatically taken from the HF set for `Common.DEAULT_HARDFORK`, +The HF setting is now automatically taken from the HF set for `Common.DEFAULT_HARDFORK`, see PR [#906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/906). **Breaking**: Please note that the options to directly pass in @@ -1617,7 +1617,7 @@ for code linting and formatting and the introduction of a new build setup. Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result -in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes @@ -1910,7 +1910,7 @@ These will be the main release notes for the `v4` feature updates, subsequent `beta` releases and the final release will just publish the delta changes and point here for reference. -Breaking changes in the release notes are preeceeded with `[BREAKING]`, do a +Breaking changes in the release notes are preceded with `[BREAKING]`, do a search for an overview. The outstanding work of [@s1na](https://github.com/s1na) has to be mentioned @@ -2316,7 +2316,7 @@ The `StateManager` (`lib/stateManager.js`) - providing a high-level interface to This comes along with larger refactoring work throughout more-or-less the whole code base and the `StateManager` now completely encapsulates the trie structure and the cache backend used, see issue [#268](https://github.com/ethereumjs/ethereumjs-monorepo/issues/268) and associated PRs for reference. This will make it much easier in the future to bring along an own state manager serving special needs (optimized for memory and performance, run on mobile,...) by e.g. using a different trie implementation, cache or underlying storage or database backend. -We plan to completely separate the currently still integrated state manager into its own repository in one of the next releases, this will then be a breaking `v3.0.0` release. Discussion around a finalized interface (we might e.g. drop all genesis-releated methods respectively methods implemented in the `DefaultStateManager`) is still ongoing and you are very much invited to jump in and articulate your needs, just take e.g. the issue mentioned above as an entry point. +We plan to completely separate the currently still integrated state manager into its own repository in one of the next releases, this will then be a breaking `v3.0.0` release. Discussion around a finalized interface (we might e.g. drop all genesis-related methods respectively methods implemented in the `DefaultStateManager`) is still ongoing and you are very much invited to jump in and articulate your needs, just take e.g. the issue mentioned above as an entry point. Change related to the new `StateManager` interface: @@ -2382,7 +2382,7 @@ making the start being introduced in the `v2.4.0` release. Since both the scope of the `Constantinople` hardfork as well as the state of at least some of the EIPs to be included are not yet finalized, this is only meant for `EXPERIMENTAL` purposes, e.g. for developer -tools to give users early access and make themself familiar with dedicated features. +tools to give users early access and make themselves familiar with dedicated features. Once scope and EIPs from `Constantinople` are final we will target a `v2.5.0` release which will officially introduce `Constantinople` support with all the changes bundled together. @@ -2399,7 +2399,7 @@ All the changes from this release: **FEATURES/FUNCTIONALITY** - Improved chain and fork support, see PR [#304](https://github.com/ethereumjs/ethereumjs-monorepo/pull/304) -- Support for the `Constantinople` bitwise shifiting instructions `SHL`, `SHR` and `SAR`, see PR [#251](https://github.com/ethereumjs/ethereumjs-monorepo/pull/251) +- Support for the `Constantinople` bitwise shifting instructions `SHL`, `SHR` and `SAR`, see PR [#251](https://github.com/ethereumjs/ethereumjs-monorepo/pull/251) - New `newContract` event which can be used to do interrupting tasks on contract/address creation, see PR [#306](https://github.com/ethereumjs/ethereumjs-monorepo/pull/306) - Alignment of behavior of bloom filter hashing to go along with mainnet compatible clients _BREAKING_, see PR [#295](https://github.com/ethereumjs/ethereumjs-monorepo/pull/295) diff --git a/packages/evm/README.md b/packages/evm/README.md index 3045606161..fa08770458 100644 --- a/packages/evm/README.md +++ b/packages/evm/README.md @@ -473,7 +473,7 @@ Note that this is nevertheless a very theoretical value but pretty valuable for Another note: profiler results for at least some opcodes are heavily distorted, first to mention the `SSTORE` opcode where the major "cost" occurs after block execution on checkpoint commit, which is not taken into account by the profiler. -Generally all results should rather encourage and need "self thinking" 😋 and are not suited to be blindedly taken over without a deeper understanding/grasping of the underlying measurement conditions. +Generally all results should rather encourage and need "self thinking" 😋 and are not suited to be blindly taken over without a deeper understanding/grasping of the underlying measurement conditions. Happy EVM Profiling! 🎉 🤩 diff --git a/packages/evm/scripts/eofContainerValidator.ts b/packages/evm/scripts/eofContainerValidator.ts index a1265db084..7a15bf0076 100644 --- a/packages/evm/scripts/eofContainerValidator.ts +++ b/packages/evm/scripts/eofContainerValidator.ts @@ -8,7 +8,7 @@ import { createEVM, validateEOF } from '../src/index.js' * This script reads hex strings (either prefixed or non-prefixed with 0x) from stdin * It tries to validate the EOF container, if it is valid, it will print "OK" * If there is a validation error, it will print "err: " - * If the input is emtpy, the program will exit + * If the input is empty, the program will exit */ const common = new Common({ chain: Mainnet }) diff --git a/packages/evm/src/eof/errors.ts b/packages/evm/src/eof/errors.ts index 2d3c3773ce..e3182f1c97 100644 --- a/packages/evm/src/eof/errors.ts +++ b/packages/evm/src/eof/errors.ts @@ -52,7 +52,7 @@ export enum EOFError { // Dangling Bytes DanglingBytes = 'got dangling bytes in body', - // Code verifcation + // Code verification InvalidOpcode = 'invalid opcode', InvalidTerminator = 'invalid terminating opcode', OpcodeIntermediatesOOB = 'invalid opcode: intermediates out-of-bounds', diff --git a/packages/evm/src/evm.ts b/packages/evm/src/evm.ts index d76a7024f9..15b0e8fc85 100644 --- a/packages/evm/src/evm.ts +++ b/packages/evm/src/evm.ts @@ -303,13 +303,13 @@ export class EVM implements EVMInterface { if (gasLimit < BIGINT_0) { if (this.DEBUG) { debugGas( - `Proof of absense access charged(${absenceProofAccessGas}) caused OOG (-> ${gasLimit})`, + `Proof of absence access charged(${absenceProofAccessGas}) caused OOG (-> ${gasLimit})`, ) } return { execResult: OOGResult(message.gasLimit) } } else { if (this.DEBUG) { - debugGas(`Proof of absense access used (${absenceProofAccessGas} gas (-> ${gasLimit}))`) + debugGas(`Proof of absence access used (${absenceProofAccessGas} gas (-> ${gasLimit}))`) } } } diff --git a/packages/evm/src/interpreter.ts b/packages/evm/src/interpreter.ts index 0a0b153cbf..6b8a3362c4 100644 --- a/packages/evm/src/interpreter.ts +++ b/packages/evm/src/interpreter.ts @@ -274,7 +274,9 @@ export class Interpreter { opCode = this._runState.code[programCounter] // Only run the jump destination analysis if `code` actually contains a JUMP/JUMPI/JUMPSUB opcode if (opCode === 0x56 || opCode === 0x57 || opCode === 0x5e) { - const { jumps, pushes, opcodesCached } = this._getValidJumpDests(this._runState.code) + const { jumps, pushes, opcodesCached } = this._getValidJumpDestinations( + this._runState.code, + ) this._runState.validJumps = jumps this._runState.cachedPushes = pushes this._runState.shouldDoJumpAnalysis = false @@ -287,7 +289,7 @@ export class Interpreter { } // if its an invalid opcode with verkle activated, then check if its because of a missing code - // chunk in the witness, and throw appropriate error to distinguish from an actual invalid opcod + // chunk in the witness, and throw appropriate error to distinguish from an actual invalid opcode if ( opCode === 0xfe && this.common.isActivatedEIP(6800) && @@ -493,7 +495,7 @@ export class Interpreter { } // Returns all valid jump and jumpsub destinations. - _getValidJumpDests(code: Uint8Array) { + _getValidJumpDestinations(code: Uint8Array) { const jumps = new Uint8Array(code.length).fill(0) const pushes: { [pc: number]: bigint } = {} @@ -527,13 +529,13 @@ export class Interpreter { useGas(amount: bigint, context?: string | Opcode): void { this._runState.gasLeft -= amount if (this._evm.DEBUG) { - let tstr = '' + let tempString = '' if (typeof context === 'string') { - tstr = context + ': ' + tempString = context + ': ' } else if (context !== undefined) { - tstr = `${context.name} fee: ` + tempString = `${context.name} fee: ` } - debugGas(`${tstr}used ${amount} gas (-> ${this._runState.gasLeft})`) + debugGas(`${tempString}used ${amount} gas (-> ${this._runState.gasLeft})`) } if (this._runState.gasLeft < BIGINT_0) { this._runState.gasLeft = BIGINT_0 diff --git a/packages/evm/src/opcodes/util.ts b/packages/evm/src/opcodes/util.ts index 6d474143be..1dec494e1e 100644 --- a/packages/evm/src/opcodes/util.ts +++ b/packages/evm/src/opcodes/util.ts @@ -173,9 +173,9 @@ export function subMemUsage(runState: RunState, offset: bigint, length: bigint, const words = newMemoryWordCount const fee = common.param('memoryGas') - const quadCoeff = common.param('quadCoeffDivGas') + const quadCoefficient = common.param('quadCoefficientDivGas') // words * 3 + words ^2 / 512 - let cost = words * fee + (words * words) / quadCoeff + let cost = words * fee + (words * words) / quadCoefficient if (cost > runState.highestMemCost) { const currentHighestMemCost = runState.highestMemCost diff --git a/packages/evm/src/params.ts b/packages/evm/src/params.ts index fc30de4968..27a607511f 100644 --- a/packages/evm/src/params.ts +++ b/packages/evm/src/params.ts @@ -24,11 +24,11 @@ export const paramsEVM: ParamsDict = { createGas: 32000, // Base fee of the CREATE opcode callGas: 40, // Base fee of the CALL opcode callStipendGas: 2300, // Free gas given at beginning of call - callValueTransferGas: 9000, // Paid for CALL when the value transfor is non-zero + callValueTransferGas: 9000, // Paid for CALL when the value transfer is non-zero callNewAccountGas: 25000, // Paid for CALL when the destination address didn't exist prior selfdestructRefundGas: 24000, // Refunded following a selfdestruct operation memoryGas: 3, // Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL - quadCoeffDivGas: 512, // Divisor for the quadratic particle of the memory cost equation + quadCoefficientDivGas: 512, // Divisor for the quadratic particle of the memory cost equation createDataGas: 200, // copyGas: 3, // Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added ecRecoverGas: 3000, @@ -96,7 +96,7 @@ export const paramsEVM: ParamsDict = { returnGas: 0, // Base fee of the RETURN opcode invalidGas: 0, // Base fee of the INVALID opcode selfdestructGas: 0, // Base fee of the SELFDESTRUCT opcode - prevrandaoGas: 0, // TODO: these below 0-gas additons might also point to non-clean implementations in the code base + prevrandaoGas: 0, // TODO: these below 0-gas additions might also point to non-clean implementations in the code base // evm stackLimit: 1024, // Maximum size of VM stack allowed callCreateDepth: 1024, // Maximum depth of call/create stack @@ -147,7 +147,7 @@ export const paramsEVM: ParamsDict = { returndatacopyGas: 3, // Base fee of the RETURNDATACOPY opcode }, /** -. * Constantinope HF Meta EIP +. * Constantinople HF Meta EIP . */ 1013: { // gasPrices diff --git a/packages/evm/src/precompiles/05-modexp.ts b/packages/evm/src/precompiles/05-modexp.ts index e0411a474c..c472a19fed 100644 --- a/packages/evm/src/precompiles/05-modexp.ts +++ b/packages/evm/src/precompiles/05-modexp.ts @@ -31,7 +31,7 @@ const BIGINT_199680 = BigInt(199680) const maxInt = BigInt(Number.MAX_SAFE_INTEGER) const maxSize = BigInt(2147483647) // @ethereumjs/util setLengthRight limitation -function multComplexity(x: bigint): bigint { +function multiplicationComplexity(x: bigint): bigint { let fac1 let fac2 if (x <= BIGINT_64) { @@ -49,7 +49,7 @@ function multComplexity(x: bigint): bigint { } } -function multComplexityEIP2565(x: bigint): bigint { +function multiplicationComplexityEIP2565(x: bigint): bigint { const words = (x + BIGINT_7) / BIGINT_8 return words * words } @@ -89,7 +89,7 @@ function getAdjustedExponentLength(data: Uint8Array): bigint { return adjustedExpLen } -export function expmod(a: bigint, power: bigint, modulo: bigint) { +export function expMod(a: bigint, power: bigint, modulo: bigint) { if (power === BIGINT_0) { return BIGINT_1 % modulo } @@ -129,9 +129,9 @@ export function precompile05(opts: PrecompileInput): ExecResult { const mEnd = mStart + mLen if (!opts.common.isActivatedEIP(2565)) { - gasUsed = (adjustedELen * multComplexity(maxLen)) / Gquaddivisor + gasUsed = (adjustedELen * multiplicationComplexity(maxLen)) / Gquaddivisor } else { - gasUsed = (adjustedELen * multComplexityEIP2565(maxLen)) / Gquaddivisor + gasUsed = (adjustedELen * multiplicationComplexityEIP2565(maxLen)) / Gquaddivisor if (gasUsed < BIGINT_200) { gasUsed = BIGINT_200 } @@ -180,7 +180,7 @@ export function precompile05(opts: PrecompileInput): ExecResult { if (M === BIGINT_0) { R = new Uint8Array() } else { - R = expmod(B, E, M) + R = expMod(B, E, M) if (R === BIGINT_0) { R = new Uint8Array() } else { diff --git a/packages/evm/src/precompiles/0d-bls12-g1msm.ts b/packages/evm/src/precompiles/0d-bls12-g1msm.ts index 257265cb27..44e667f693 100644 --- a/packages/evm/src/precompiles/0d-bls12-g1msm.ts +++ b/packages/evm/src/precompiles/0d-bls12-g1msm.ts @@ -18,7 +18,7 @@ export async function precompile0d(opts: PrecompileInput): Promise { if (opts._debug !== undefined) { opts._debug(`BLS12G1MSM (0x0d) failed: Empty input`) } - return EvmErrorResult(new EvmError(ERROR.BLS_12_381_INPUT_EMPTY), opts.gasLimit) // follow Geths implementation + return EvmErrorResult(new EvmError(ERROR.BLS_12_381_INPUT_EMPTY), opts.gasLimit) // follow Geth's implementation } // TODO: Double-check respectively confirm that this order is really correct that the gas check diff --git a/packages/evm/src/precompiles/10-bls12-g2msm.ts b/packages/evm/src/precompiles/10-bls12-g2msm.ts index f637959f38..d62d0d0c52 100644 --- a/packages/evm/src/precompiles/10-bls12-g2msm.ts +++ b/packages/evm/src/precompiles/10-bls12-g2msm.ts @@ -16,7 +16,7 @@ export async function precompile10(opts: PrecompileInput): Promise { if (opts._debug !== undefined) { opts._debug(`BLS12G2MSM (0x10) failed: Empty input`) } - return EvmErrorResult(new EvmError(ERROR.BLS_12_381_INPUT_EMPTY), opts.gasLimit) // follow Geths implementation + return EvmErrorResult(new EvmError(ERROR.BLS_12_381_INPUT_EMPTY), opts.gasLimit) // follow Geth's implementation } const numPairs = Math.floor(opts.data.length / 288) diff --git a/packages/evm/src/precompiles/bls12_381/noble.ts b/packages/evm/src/precompiles/bls12_381/noble.ts index 31737d5d40..0742095477 100644 --- a/packages/evm/src/precompiles/bls12_381/noble.ts +++ b/packages/evm/src/precompiles/bls12_381/noble.ts @@ -67,7 +67,7 @@ function BLS12_381_FromG1Point(input: AffinePoint): Uint8Array { * @returns Noble G2 point */ function BLS12_381_ToG2Point(input: Uint8Array): any { - // TODO: remove any type, temporary fix due to conflicing @noble/curves versions + // TODO: remove any type, temporary fix due to conflicting @noble/curves versions if (equalsBytes(input, BLS_G2_INFINITY_POINT_BYTES)) { return bls12_381.G2.ProjectivePoint.ZERO } @@ -111,10 +111,10 @@ function BLS12_381_ToFrPoint(input: Uint8Array): bigint { // It should be nevertheless validated if this is (fully) correct, // especially if ">" or ">=" should be applied. // - // Unfortunately the skalar in both test vectors is significantly + // Unfortunately the scalar in both test vectors is significantly // greater than the ORDER threshold, here are th values from both tests: // - // Skalar / Order + // Scalar / Order // 69732848789442042582239751384143889712113271203482973843852656394296700715236n // 52435875175126190479447740508185965837690552500527637822603658699938581184513n // @@ -143,7 +143,7 @@ function BLS12_381_ToFpPoint(fpCoordinate: Uint8Array) { } function BLS12_381_ToFp2Point(fpXCoordinate: Uint8Array, fpYCoordinate: Uint8Array): any { - // TODO: remove any type, temporary fix due to conflicing @noble/curves versions + // TODO: remove any type, temporary fix due to conflicting @noble/curves versions // check if the coordinates are in the field if (bytesToBigInt(fpXCoordinate) >= BLS_FIELD_MODULUS) { throw new EvmError(ERROR.BLS_12_381_FP_NOT_IN_FIELD) @@ -180,12 +180,12 @@ export class NobleBLS implements EVMBLSInterface { mulG1(input: Uint8Array): Uint8Array { // convert input to G1 points, add them, and convert the output to a Uint8Array. const p = BLS12_381_ToG1Point(input.subarray(0, BLS_G1_POINT_BYTE_LENGTH)) - const skalar = BLS12_381_ToFrPoint(input.subarray(BLS_G1_POINT_BYTE_LENGTH, 160)) + const scalar = BLS12_381_ToFrPoint(input.subarray(BLS_G1_POINT_BYTE_LENGTH, 160)) - if (skalar === BIGINT_0) { + if (scalar === BIGINT_0) { return BLS_G1_INFINITY_POINT_BYTES } - const result = p.multiply(skalar) + const result = p.multiply(scalar) return BLS12_381_FromG1Point(result) } @@ -203,12 +203,12 @@ export class NobleBLS implements EVMBLSInterface { mulG2(input: Uint8Array): Uint8Array { // convert input to G2 point/Fr point, add them, and convert the output to a Uint8Array. const p = BLS12_381_ToG2Point(input.subarray(0, BLS_G2_POINT_BYTE_LENGTH)) - const skalar = BLS12_381_ToFrPoint(input.subarray(BLS_G2_POINT_BYTE_LENGTH, 288)) + const scalar = BLS12_381_ToFrPoint(input.subarray(BLS_G2_POINT_BYTE_LENGTH, 288)) - if (skalar === BIGINT_0) { + if (scalar === BIGINT_0) { return BLS_G2_INFINITY_POINT_BYTES } - const result = p.multiply(skalar) + const result = p.multiply(scalar) return BLS12_381_FromG2Point(result) } diff --git a/packages/evm/src/precompiles/bn254/noble.ts b/packages/evm/src/precompiles/bn254/noble.ts index 5f3396602d..6ebe092f00 100644 --- a/packages/evm/src/precompiles/bn254/noble.ts +++ b/packages/evm/src/precompiles/bn254/noble.ts @@ -69,7 +69,7 @@ function toFrPoint(input: Uint8Array): bigint { * @returns Noble G2 point */ function toG2Point(input: Uint8Array): any { - // TODO: remove any type, temporary fix due to conflicing @noble/curves versions + // TODO: remove any type, temporary fix due to conflicting @noble/curves versions if (equalsBytes(input, G2_INFINITY_POINT_BYTES)) { return bn254.G2.ProjectivePoint.ZERO } diff --git a/packages/evm/src/stack.ts b/packages/evm/src/stack.ts index e2ab7e964f..d8ff351cb2 100644 --- a/packages/evm/src/stack.ts +++ b/packages/evm/src/stack.ts @@ -38,7 +38,7 @@ export class Stack { // Length is checked above, so pop shouldn't return undefined // First decrease current length, then read the item and return it // Note: this does thus not delete the item from the internal array - // However, the length is decreased, so it is not accessible to external observors + // However, the length is decreased, so it is not accessible to external observers return this._store[--this._len] } diff --git a/packages/evm/test/customPrecompiles.spec.ts b/packages/evm/test/customPrecompiles.spec.ts index 7829d6e670..e74f13a39a 100644 --- a/packages/evm/test/customPrecompiles.spec.ts +++ b/packages/evm/test/customPrecompiles.spec.ts @@ -145,7 +145,7 @@ describe('EVM -> custom precompiles', () => { 'restored sha precompile - gas correct', ) }) - it('shold copy custom precompiles', async () => { + it('should copy custom precompiles', async () => { const evm = await createEVM({ customPrecompiles: [ { diff --git a/packages/evm/test/eips/eip-3860.spec.ts b/packages/evm/test/eips/eip-3860.spec.ts index 557e479190..09a38485c1 100644 --- a/packages/evm/test/eips/eip-3860.spec.ts +++ b/packages/evm/test/eips/eip-3860.spec.ts @@ -164,7 +164,7 @@ describe('EIP 3860 tests', () => { const result = await evm.runCall(runCallArgs) assert.ok( result.execResult.exceptionError === undefined, - 'succesfully created a contract with data size > MAX_INITCODE_SIZE and allowUnlimitedInitCodeSize active', + 'successfully created a contract with data size > MAX_INITCODE_SIZE and allowUnlimitedInitCodeSize active', ) }) @@ -194,7 +194,7 @@ describe('EIP 3860 tests', () => { // Attempts to create a contract of X size // (the initcode of this contract is just zeros, so STOP opcode // It stores the topmost stack item of this CREATE(2) at slot 0 - // This is either the contract address if it was succesful, or 0 in case of error + // This is either the contract address if it was successful, or 0 in case of error const factoryCode = hexToBytes(`0x600060003560006000${code}600055`) await evm.stateManager.putCode(contractFactory, factoryCode) diff --git a/packages/evm/test/precompiles/05-modexp.spec.ts b/packages/evm/test/precompiles/05-modexp.spec.ts index ade2fb356d..e9dc5edf4f 100644 --- a/packages/evm/test/precompiles/05-modexp.spec.ts +++ b/packages/evm/test/precompiles/05-modexp.spec.ts @@ -35,8 +35,8 @@ describe('Precompiles: MODEXP', () => { common, _EVM: evm, }) - const oput = bytesToHex(result.returnValue) - assert.equal(oput, expect) + const output = bytesToHex(result.returnValue) + assert.equal(output, expect) }) } diff --git a/packages/evm/test/runCall.spec.ts b/packages/evm/test/runCall.spec.ts index 7fd3cbfaee..9e3571ba8c 100644 --- a/packages/evm/test/runCall.spec.ts +++ b/packages/evm/test/runCall.spec.ts @@ -695,7 +695,7 @@ describe('RunCall tests', () => { ['f1', 36600 + 7 * 3, '0x01'], // 36600 is CALL fee + 7 * 3 gas for 7 PUSH opcodes ['f2', 11600 + 7 * 3, '0x01'], // 11600 is CALLCODE fee + 7 * 3 gas for 7 PUSH opcodes ]) { - // Code to either CALL or CALLCODE into AACC empty contract, with value 1 + // Code to either CALL or CALLCODE into AACC empty contract, with value 1 // cspell:disable-line // If enough gas is provided, then since nonzero value is sent, the gas limit // in the call(coded) contract will get the "bonus gas" stipend of 2300 // Previously, we added this gas stipend to the current gas available (which is wrong) @@ -717,7 +717,7 @@ describe('RunCall tests', () => { const gasLimit = gas.toString(16).padStart(4, '0') /*** - * Bytecode for AAAB contract (used to call contract AAAA and stores result of call execution) + * Bytecode for AAAB contract (used to call contract AAAA and stores result of call execution) // cspell:disable-line * PUSH1 0x00 * DUP1 * DUP1 diff --git a/packages/rlp/CHANGELOG.md b/packages/rlp/CHANGELOG.md index 2913d88f09..089651ab8a 100644 --- a/packages/rlp/CHANGELOG.md +++ b/packages/rlp/CHANGELOG.md @@ -10,7 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ### 10-30x Decode Speedup -The `RLP.decode()` method has been optimized (thanks @wemeetagain for the contribution! ❤️) which results in a reproduceable 10-30x speedup for JS native decoding 🎉, see PR [#3243](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3243). +The `RLP.decode()` method has been optimized (thanks @wemeetagain for the contribution! ❤️) which results in a reproducible 10-30x speedup for JS native decoding 🎉, see PR [#3243](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3243). ### Self-Contained (and Working 🙂) README Examples @@ -110,7 +110,7 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). diff --git a/packages/rlp/src/index.ts b/packages/rlp/src/index.ts index 7d9527bc18..175b6f89b4 100644 --- a/packages/rlp/src/index.ts +++ b/packages/rlp/src/index.ts @@ -98,7 +98,7 @@ export function decode(input: Input, stream = false): Uint8Array | NestedUint8Ar /** Decode an input with RLP */ function _decode(input: Uint8Array): Decoded { - let length: number, llength: number, data: Uint8Array, innerRemainder: Uint8Array, d: Decoded + let length: number, lLength: number, data: Uint8Array, innerRemainder: Uint8Array, d: Decoded const decoded = [] const firstByte = input[0] @@ -131,19 +131,19 @@ function _decode(input: Uint8Array): Decoded { } else if (firstByte <= 0xbf) { // string is greater than 55 bytes long. A single byte with the value (0xb7 plus the length of the length), // followed by the length, followed by the string - llength = firstByte - 0xb6 - if (input.length - 1 < llength) { + lLength = firstByte - 0xb6 + if (input.length - 1 < lLength) { throw new Error('invalid RLP: not enough bytes for string length') } - length = decodeLength(safeSlice(input, 1, llength)) + length = decodeLength(safeSlice(input, 1, lLength)) if (length <= 55) { throw new Error('invalid RLP: expected string length to be greater than 55') } - data = safeSlice(input, llength, length + llength) + data = safeSlice(input, lLength, length + lLength) return { data, - remainder: input.subarray(length + llength), + remainder: input.subarray(length + lLength), } } else if (firstByte <= 0xf7) { // a list between 0-55 bytes long @@ -161,17 +161,17 @@ function _decode(input: Uint8Array): Decoded { } } else { // a list over 55 bytes long - llength = firstByte - 0xf6 - length = decodeLength(safeSlice(input, 1, llength)) + lLength = firstByte - 0xf6 + length = decodeLength(safeSlice(input, 1, lLength)) if (length < 56) { throw new Error('invalid RLP: encoded list too short') } - const totalLength = llength + length + const totalLength = lLength + length if (totalLength > input.length) { throw new Error('invalid RLP: total length is larger than the data') } - innerRemainder = safeSlice(input, llength, totalLength) + innerRemainder = safeSlice(input, lLength, totalLength) while (innerRemainder.length) { d = _decode(innerRemainder) diff --git a/packages/rlp/test/dataTypes.spec.ts b/packages/rlp/test/dataTypes.spec.ts index ff95ecb621..20105c0563 100644 --- a/packages/rlp/test/dataTypes.spec.ts +++ b/packages/rlp/test/dataTypes.spec.ts @@ -11,7 +11,7 @@ describe('invalid RLPs', () => { // prettier-ignore { input: Uint8Array.from([239, 191, 189, 239, 191, 189, 239, 191, 189, 239, 191, 189, 239, 191, 189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 239, 191, 189, 29, 239, 191, 189, 77, 239, 191, 189, 239, 191, 189, 239, 191, 189, 93, 122, 239, 191, 189, 239, 191, 189, 239, 191, 189, 103, 239, 191, 189, 239, 191, 189, 239, 191, 189, 26, 239, 191, 189, 18, 69, 27, 239, 191, 189, 239, 191, 189, 116, 19, 239, 191, 189, 239, 191, 189, 66, 239, 191, 189, 64, 212, 147, 71, 239, 191, 189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 239, 191, 189, 11, 222, 155, 122, 54, 42, 194, 169, 239, 191, 189, 70, 239, 191, 189, 72, 239, 191, 189, 239, 191, 189, 54, 53, 239, 191, 189, 100, 73, 239, 191, 189, 55, 239, 191, 189, 239, 191, 189, 59, 1, 239, 191, 189, 109, 239, 191, 189, 239, 191, 189, 93, 239, 191, 189, 208, 128, 239, 191, 189, 239, 191, 189, 0, 239, 191, 189, 239, 191, 189, 239, 191, 189, 15, 66, 64, 239, 191, 189, 239, 191, 189, 239, 191, 189, 239, 191, 189, 4, 239, 191, 189, 79, 103, 239, 191, 189, 85, 239, 191, 189, 239, 191, 189, 239, 191, 189, 74, 239, 191, 189, 239, 191, 189, 239, 191, 189, 239, 191, 189, 54, 239, 191, 189, 239, 191, 189, 239, 191, 189, 239, 191, 189, 239, 191, 189, 83, 239, 191, 189, 14, 239, 191, 189, 239, 191, 189, 239, 191, 189, 4, 63, 239, 191, 189, 63, 239, 191, 189, 41, 239, 191, 189, 239, 191, 189, 239, 191, 189, 67, 28, 239, 191, 189, 239, 191, 189, 11, 239, 191, 189, 31, 239, 191, 189, 239, 191, 189, 104, 96, 100, 239, 191, 189, 239, 191, 189, 12, 239, 191, 189, 239, 191, 189, 206, 152, 239, 191, 189, 239, 191, 189, 31, 112, 111, 239, 191, 189, 239, 191, 189, 65, 239, 191, 189, 41, 239, 191, 189, 239, 191, 189, 53, 84, 11, 239, 191, 189, 239, 191, 189, 12, 102, 24, 12, 42, 105, 109, 239, 191, 189, 58, 239, 191, 189, 4, 239, 191, 189, 104, 82, 9, 239, 191, 189, 6, 66, 91, 43, 38, 102, 117, 239, 191, 189, 105, 239, 191, 189, 239, 191, 189, 239, 191, 189, 89, 127, 239, 191, 189, 114]) }, { - input: hexToBytes('efdebd'), + input: hexToBytes('efdebd'), // cspell:disable-line msg: 'invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds', }, { @@ -19,7 +19,7 @@ describe('invalid RLPs', () => { msg: 'invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds', }, { - input: hexToBytes('efdebdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), + input: hexToBytes('efdebdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), // cspell:disable-line msg: 'invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds', }, ] @@ -57,7 +57,7 @@ describe('RLP encoding (string)', () => { it('length of string >55 should return 0xb7+len(len(data)) plus len(data) plus data', () => { const encodedLongString = RLP.encode( - 'zoo255zoo255zzzzzzzzzzzzssssssssssssssssssssssssssssssssssssssssssssss', + 'zoo255zoo255zzzzzzzzzzzzssssssssssssssssssssssssssssssssssssssssssssss', // cspell:disable-line ) assert.deepEqual(72, encodedLongString.length) assert.deepEqual(encodedLongString[0], 184) @@ -83,7 +83,7 @@ describe('RLP encoding (list)', () => { 'dog', 'god', 'cat', - 'zoo255zoo255zzzzzzzzzzzzssssssssssssssssssssssssssssssssssssssssssssss', + 'zoo255zoo255zzzzzzzzzzzzssssssssssssssssssssssssssssssssssssssssssssss', // cspell:disable-line ] const encodedArrayOfStrings = RLP.encode(data) const str = bytesToUtf8(encodedArrayOfStrings) @@ -92,7 +92,7 @@ describe('RLP encoding (list)', () => { } // Verified with Geth's RLPDump const expected = hexToBytes( - 'f85483646f6783676f6483636174b8467a6f6f3235357a6f6f3235357a7a7a7a7a7a7a7a7a7a7a7a73737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373', + 'f85483646f6783676f6483636174b8467a6f6f3235357a6f6f3235357a7a7a7a7a7a7a7a7a7a7a7a73737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373', // cspell:disable-line ) assert.deepEqual(encodedArrayOfStrings, expected) }) diff --git a/packages/rlp/test/invalid.spec.ts b/packages/rlp/test/invalid.spec.ts index be0280dbf9..ed107b8026 100644 --- a/packages/rlp/test/invalid.spec.ts +++ b/packages/rlp/test/invalid.spec.ts @@ -27,7 +27,7 @@ describe('invalid tests', () => { it('should pass long string sanity check test', function () { // long string invalid test; string length > 55 const longBufferTest = RLP.encode( - 'zoo255zoo255zzzzzzzzzzzzssssssssssssssssssssssssssssssssssssssssssssss', + 'zoo255zoo255zzzzzzzzzzzzssssssssssssssssssssssssssssssssssssssssssssss', // cspell:disable-line ) // sanity checks assert.ok(longBufferTest[0] > 0xb7) @@ -47,7 +47,7 @@ describe('invalid tests', () => { // The tests below are taken from Geth // https://github.com/ethereum/go-ethereum/blob/99be62a9b16fd7b3d1e2e17f1e571d3bef34f122/rlp/decode_test.go -// Not all tests were taken; some which throw due to type errors in Geth are ran against Geth's RLPdump to +// Not all tests were taken; some which throw due to type errors in Geth are ran against Geth's RLPDump to // see if there is a decode error or not. In both cases, the test is converted to either reflect the // expected value, or if the test is invalid, it is added as error test case @@ -63,13 +63,13 @@ const invalidGethCases: string[] = [ 'F90000', 'F90055', 'FA0002FFFF', - 'BFFFFFFFFFFFFFFFFFFF', + 'BFFFFFFFFFFFFFFFFFFF', // cspell:disable-line 'C801', 'CD04040404FFFFFFFFFFFFFFFFFF0303', 'C40102030401', 'C4010203048180', '81', - 'BFFFFFFFFFFFFFFF', + 'BFFFFFFFFFFFFFFF', // cspell:disable-line 'C801', 'c330f9c030f93030ce3030303030303030bd303030303030', '8105', diff --git a/packages/statemanager/CHANGELOG.md b/packages/statemanager/CHANGELOG.md index 64d53faf01..06e8da8576 100644 --- a/packages/statemanager/CHANGELOG.md +++ b/packages/statemanager/CHANGELOG.md @@ -75,7 +75,7 @@ Since this fits well also to be placed here relatively prominently for awareness ## 2.2.2 - 2024-02-08 -- Hotfix release moving the `@ethereumjs/verkle` dependency from a peer dependency to the main dependencis (note that this decision might be temporary) +- Hotfix release moving the `@ethereumjs/verkle` dependency from a peer dependency to the main dependencies (note that this decision might be temporary) ## 2.2.1 - 2024-02-08 @@ -122,7 +122,7 @@ This release introduces a new code cache implementation, see PR [#3022](https:// The new cache is substantially more robust towards various type of revert-based attacks and grows a more-used cache over time, since never-applied values are consecutively sorted out. -### Peformance Option to store Storage Keys with Prefix +### Performance Option to store Storage Keys with Prefix This release introduces a new option `prefixStorageTrieKeys` which triggers the underlying trie to store storage key values with a prefix based on the account address, see PR [#3023](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3023). This significantly increases performance for consecutive storage accesses for the same account on especially larger tries, since trie node accesses get noticeably faster when performed by the underlying key-value store since values are stored close to each other. @@ -162,7 +162,7 @@ While you could use our libraries in the browser libraries before, there had bee WE HAVE ELIMINATED ALL OF THEM. -The largest two undertakings: First: we have rewritten all (half) of our API and elimited the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went throuh our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. +The largest two undertakings: First: we have rewritten all (half) of our API and eliminated the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went through our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. Together with some few other modifications this now allows to run each (maybe adding an asterisk for client and devp2p) of our libraries directly in the browser - more or less without any modifications - see the `examples/browser.html` file in each package folder for an easy to set up example. @@ -397,7 +397,7 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). @@ -405,7 +405,7 @@ Now every import is a named import and we think the long term benefits will very #### Common Library Import Updates -Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all accross our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. +Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all across our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. So Common import and usage is changing from: diff --git a/packages/statemanager/README.md b/packages/statemanager/README.md index 85e194be10..e25fa65294 100644 --- a/packages/statemanager/README.md +++ b/packages/statemanager/README.md @@ -56,7 +56,7 @@ const main = async () => { console.log( `Account at address ${address.toString()} has balance ${ (await stateManager.getAccount(address))?.balance - }` + }`, ) } main() @@ -116,10 +116,10 @@ const main = async () => { const contractAddress = new Address(hexToBytes('0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b')) const byteCode = hexToBytes('0x67ffffffffffffffff600160006000fb') const storageKey1 = hexToBytes( - '0x0000000000000000000000000000000000000000000000000000000000000001' + '0x0000000000000000000000000000000000000000000000000000000000000001', ) const storageKey2 = hexToBytes( - '0x0000000000000000000000000000000000000000000000000000000000000002' + '0x0000000000000000000000000000000000000000000000000000000000000002', ) const storageValue1 = hexToBytes('0x01') const storageValue2 = hexToBytes('0x02') @@ -137,11 +137,11 @@ const main = async () => { console.log(await partialStateManager.getContractCode(contractAddress)) // contract bytecode is not included in proof console.log( await partialStateManager.getContractStorage(contractAddress, storageKey1), - storageValue1 + storageValue1, ) // should match console.log( await partialStateManager.getContractStorage(contractAddress, storageKey2), - storageValue2 + storageValue2, ) // should match const accountFromNewSM = await partialStateManager.getAccount(contractAddress) @@ -188,7 +188,7 @@ main() ##### Instantiating the EVM -In order to have an EVM instance that supports the BLOCKHASH opcode (which requires access to block history), you must instantiate both the `RPCStateManager` and the `RpcBlockChain` and use that when initalizing your EVM instance as below: +In order to have an EVM instance that supports the BLOCKHASH opcode (which requires access to block history), you must instantiate both the `RPCStateManager` and the `RpcBlockChain` and use that when initializing your EVM instance as below: ```ts // ./examples/evm.ts diff --git a/packages/statemanager/src/cache/account.ts b/packages/statemanager/src/cache/account.ts index 9837178873..48548209d7 100644 --- a/packages/statemanager/src/cache/account.ts +++ b/packages/statemanager/src/cache/account.ts @@ -135,7 +135,7 @@ export class AccountCache extends Cache { }) } - this._stats.dels += 1 + this._stats.deletions += 1 } /** @@ -252,7 +252,7 @@ export class AccountCache extends Cache { reads: 0, hits: 0, writes: 0, - dels: 0, + deletions: 0, } } return stats diff --git a/packages/statemanager/src/cache/cache.ts b/packages/statemanager/src/cache/cache.ts index d80c338a2a..ec98619df1 100644 --- a/packages/statemanager/src/cache/cache.ts +++ b/packages/statemanager/src/cache/cache.ts @@ -12,7 +12,7 @@ export class Cache { reads: 0, hits: 0, writes: 0, - dels: 0, + deletions: 0, } /** diff --git a/packages/statemanager/src/cache/code.ts b/packages/statemanager/src/cache/code.ts index 3aaeb25db8..da05629f47 100644 --- a/packages/statemanager/src/cache/code.ts +++ b/packages/statemanager/src/cache/code.ts @@ -133,7 +133,7 @@ export class CodeCache extends Cache { }) } - this._stats.dels += 1 + this._stats.deletions += 1 } /** @@ -252,7 +252,7 @@ export class CodeCache extends Cache { reads: 0, hits: 0, writes: 0, - dels: 0, + deletions: 0, } } return stats diff --git a/packages/statemanager/src/cache/storage.ts b/packages/statemanager/src/cache/storage.ts index 345e74ad3b..d8dcf1759e 100644 --- a/packages/statemanager/src/cache/storage.ts +++ b/packages/statemanager/src/cache/storage.ts @@ -165,7 +165,7 @@ export class StorageCache extends Cache { this._orderedMapCache!.setElement(addressHex, storageMap) } - this._stats.dels += 1 + this._stats.deletions += 1 } /** @@ -274,7 +274,7 @@ export class StorageCache extends Cache { // Go through diffMap from the pre-commit checkpoint height. // 1. Iterate through all state pre states // 2. If state pre-state is not in the new (lower) height diff map, take pre commit pre state value - // 3. If state is in new map, take this one, since this superseeds subsequent changes + // 3. If state is in new map, take this one, since this supersedes subsequent changes for (const entry of higherHeightDiffMap.entries()) { const addressHex = entry[0] const higherHeightStorageDiff = entry[1] @@ -329,7 +329,7 @@ export class StorageCache extends Cache { reads: 0, hits: 0, writes: 0, - dels: 0, + deletions: 0, } } return stats diff --git a/packages/statemanager/src/statelessVerkleStateManager.ts b/packages/statemanager/src/statelessVerkleStateManager.ts index 0b19a3bad6..c6603ae295 100644 --- a/packages/statemanager/src/statelessVerkleStateManager.ts +++ b/packages/statemanager/src/statelessVerkleStateManager.ts @@ -448,7 +448,7 @@ export class StatelessVerkleStateManager implements StateManagerInterface { balance: typeof balanceRaw === 'string' ? bytesToBigInt(hexToBytes(balanceRaw), true) : null, nonce: typeof nonceRaw === 'string' ? bytesToBigInt(hexToBytes(nonceRaw), true) : null, codeHash: typeof codeHashRaw === 'string' ? hexToBytes(codeHashRaw) : null, - // if codeSizeRaw is null, it means account didnt exist or it was EOA either way codeSize is 0 + // if codeSizeRaw is null, it means account didn't exist or it was EOA either way codeSize is 0 // if codeSizeRaw is undefined, then we pass in null which in our context of partial account means // not specified codeSize: diff --git a/packages/statemanager/test/rpcStateManager.spec.ts b/packages/statemanager/test/rpcStateManager.spec.ts index 7fd540609d..53b09fee27 100644 --- a/packages/statemanager/test/rpcStateManager.spec.ts +++ b/packages/statemanager/test/rpcStateManager.spec.ts @@ -90,40 +90,40 @@ describe('RPC State Manager API tests', () => { assert.ok(state.getAccount(vitalikDotEth) !== undefined, 'vitalik.eth does exist') - const UNIerc20ContractAddress = createAddressFromString( + const UniswapERC20ContractAddress = createAddressFromString( '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', ) - const UNIContractCode = await state.getCode(UNIerc20ContractAddress) + const UNIContractCode = await state.getCode(UniswapERC20ContractAddress) assert.ok(UNIContractCode.length > 0, 'was able to retrieve UNI contract code') - await state.putCode(UNIerc20ContractAddress, UNIContractCode) + await state.putCode(UniswapERC20ContractAddress, UNIContractCode) assert.ok( - state['_caches'].code?.get(UNIerc20ContractAddress) !== undefined, + state['_caches'].code?.get(UniswapERC20ContractAddress) !== undefined, 'UNI ERC20 contract code was found in cache', ) const storageSlot = await state.getStorage( - UNIerc20ContractAddress, + UniswapERC20ContractAddress, setLengthLeft(bigIntToBytes(1n), 32), ) assert.ok(storageSlot.length > 0, 'was able to retrieve storage slot 1 for the UNI contract') await expect(async () => { - await state.getStorage(UNIerc20ContractAddress, setLengthLeft(bigIntToBytes(1n), 31)) + await state.getStorage(UniswapERC20ContractAddress, setLengthLeft(bigIntToBytes(1n), 31)) }).rejects.toThrowError('Storage key must be 32 bytes long') await state.putStorage( - UNIerc20ContractAddress, + UniswapERC20ContractAddress, setLengthLeft(bigIntToBytes(2n), 32), utf8ToBytes('abcd'), ) const slotValue = await state.getStorage( - UNIerc20ContractAddress, + UniswapERC20ContractAddress, setLengthLeft(bigIntToBytes(2n), 32), ) assert.ok(equalsBytes(slotValue, utf8ToBytes('abcd')), 'should retrieve slot 2 value') - const dumpedStorage = await state.dumpStorage(UNIerc20ContractAddress) + const dumpedStorage = await state.dumpStorage(UniswapERC20ContractAddress) assert.deepEqual(dumpedStorage, { [bytesToUnprefixedHex(setLengthLeft(bigIntToBytes(1n), 32))]: '0xabcd', [bytesToUnprefixedHex(setLengthLeft(bigIntToBytes(2n), 32))]: bytesToHex(utf8ToBytes('abcd')), @@ -131,13 +131,13 @@ describe('RPC State Manager API tests', () => { const spy = vi.spyOn(state, 'getAccountFromProvider') spy.mockImplementation(() => { - throw new Error('shouldnt call me') + throw new Error("shouldn't call me") }) await state.checkpoint() await state.putStorage( - UNIerc20ContractAddress, + UniswapERC20ContractAddress, setLengthLeft(bigIntToBytes(2n), 32), new Uint8Array(0), ) @@ -161,7 +161,7 @@ describe('RPC State Manager API tests', () => { } const deletedSlot = await state.getStorage( - UNIerc20ContractAddress, + UniswapERC20ContractAddress, setLengthLeft(bigIntToBytes(2n), 32), ) @@ -180,7 +180,7 @@ describe('RPC State Manager API tests', () => { ) const deletedSlotAfterRevert = await state.getStorage( - UNIerc20ContractAddress, + UniswapERC20ContractAddress, setLengthLeft(bigIntToBytes(2n), 32), ) @@ -190,14 +190,14 @@ describe('RPC State Manager API tests', () => { 'slot deleted since last checkpoint should exist in storage cache after revert', ) - const cacheStorage = await state.dumpStorage(UNIerc20ContractAddress) + const cacheStorage = await state.dumpStorage(UniswapERC20ContractAddress) assert.equal( 2, Object.keys(cacheStorage).length, 'should have 2 storage slots in cache before clear', ) - await state.clearStorage(UNIerc20ContractAddress) - const clearedStorage = await state.dumpStorage(UNIerc20ContractAddress) + await state.clearStorage(UniswapERC20ContractAddress) + const clearedStorage = await state.dumpStorage(UniswapERC20ContractAddress) assert.deepEqual({}, clearedStorage, 'storage cache should be empty after clear') try { @@ -211,7 +211,7 @@ describe('RPC State Manager API tests', () => { } assert.equal( - state['_caches'].account?.get(UNIerc20ContractAddress), + state['_caches'].account?.get(UniswapERC20ContractAddress), undefined, 'should not have any code for contract after cache is reverted', ) diff --git a/packages/trie/CHANGELOG.md b/packages/trie/CHANGELOG.md index d7544fb9b9..322e3f3e0d 100644 --- a/packages/trie/CHANGELOG.md +++ b/packages/trie/CHANGELOG.md @@ -86,7 +86,7 @@ See [Debugging](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/pa - New parameter `skipKeyTransform` (default: `false`) for Trie `put()`, `del()` and `batch()` method to allow to pass in already hashed keys, PR [#2950](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2950) - New `keyPrefix` option tries to store node keys with a static prefix (used upstream in the `statemanager` package to speed to storage trie reads), PR [#3023](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3023) -- Peformance: `findPath()` optimizations, PR [#3066](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3066) +- Performance: `findPath()` optimizations, PR [#3066](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3066) - Make `null` available as type option for `put()` method value, PR [#3020](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3020) - Allow partial trie options for `shallowCopy()` (e.g. for a more flexible cache configuration for the trie copy), PR [#3063](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3063) - Use `lock` class from `@ethereumjs/util`, PR [#3109](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3109) @@ -131,7 +131,7 @@ While you could use our libraries in the browser libraries before, there had bee WE HAVE ELIMINATED ALL OF THEM. -The largest two undertakings: First: we have rewritten all (half) of our API and elimited the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went throuh our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. +The largest two undertakings: First: we have rewritten all (half) of our API and eliminated the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went through our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. Together with some few other modifications this now allows to run each (maybe adding an asterisk for client and devp2p) of our libraries directly in the browser - more or less without any modifications - see the `examples/browser.html` file in each package folder for an easy to set up example. @@ -371,11 +371,11 @@ See our [Upgrade Guide](https://github.com/ethereumjs/ethereumjs-monorepo/blob/m Beta 3 release for the upcoming breaking release round on the [EthereumJS monorepo](https://github.com/ethereumjs/ethereumjs-monorepo) libraries, see the Beta 1 release notes for the main long change set description as well as the Beta 2 release notes for notes on some additional changes ([CHANGELOG](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/devp2p/CHANGELOG.md)). -### Root Hash Persistance +### Root Hash Persistence The trie library now comes with a new constructor option `useRootPersistence` (note that the option has been called `persistRoot` up to Beta 3) which is disabled by default but allows to persist state root updates along write operations directly in the DB and therefore omits the need to manually set to a new state root, see PR [#2071](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2071) and PR [#2123](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2123), thanks to @faustbrian for the contribution! ❤️ -To activate root hash persistance you can set the `useRootPersistence` option on instantiation: +To activate root hash persistence you can set the `useRootPersistence` option on instantiation: ```ts import { Trie, LevelDB } from '@ethereumjs/trie' @@ -397,13 +397,13 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). Now every import is a named import and we think the long term benefits will very much outweigh the one-time hassle of some import adoptions. -So if you use the Trie library together with other EthereumJS libraries check if the respetive imports need an update. +So if you use the Trie library together with other EthereumJS libraries check if the respective imports need an update. ## Custom Hash Function @@ -496,7 +496,7 @@ Because of the upgrade, any `level` implementation compliant with the `abstract- ### API Changes -Options for the Trie constructor are now also taken in as an options dict like in the other EthereumJS libaries. This makes it easier to add additional options in the future, see PR [#1874](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1874). +Options for the Trie constructor are now also taken in as an options dict like in the other EthereumJS libraries. This makes it easier to add additional options in the future, see PR [#1874](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1874). Check your Trie instantiations and see if you use constructor options. In this case you need to update to the new format: diff --git a/packages/trie/benchmarks/suite.ts b/packages/trie/benchmarks/suite.ts index bcb68e9f4a..5b679ce116 100644 --- a/packages/trie/benchmarks/suite.ts +++ b/packages/trie/benchmarks/suite.ts @@ -1,6 +1,6 @@ import { keccak256 } from 'ethereum-cryptography/keccak.js' // @ts-ignore - package has no types... -import { run, mark, logMem } from 'micro-bmark' +import { run, mark, logMem } from 'micro-bmark' // cspell:disable-line import { Trie } from '../dist/cjs/index.js' import { keys } from './keys' diff --git a/packages/trie/examples/logDemo.ts b/packages/trie/examples/logDemo.ts index 2356ab047e..2aa5bdee21 100644 --- a/packages/trie/examples/logDemo.ts +++ b/packages/trie/examples/logDemo.ts @@ -1,12 +1,12 @@ /** - * Run with DEBUG=ethjs,trie:* to see debug log ouput + * Run with DEBUG=ethjs,trie:* to see debug log output */ import { Trie, createMerkleProof, verifyMerkleProof } from '@ethereumjs/trie' import { utf8ToBytes } from '@ethereumjs/util' const trie_entries: [string, string | null][] = [ ['do', 'verb'], - ['ether', 'wookiedoo'], + ['ether', 'wookiedoo'], // cspell:disable-line ['horse', 'stallion'], ['shaman', 'horse'], ['doge', 'coin'], diff --git a/packages/trie/examples/merkle_patricia_trees/README.md b/packages/trie/examples/merkle_patricia_trees/README.md index b41bf52ba1..ff801ce3d6 100644 --- a/packages/trie/examples/merkle_patricia_trees/README.md +++ b/packages/trie/examples/merkle_patricia_trees/README.md @@ -662,7 +662,7 @@ Now let's suppose that I'm provided with various pieces of information, some tha Now, I'm getting conflicting information from two other shady sources: - Marie claims that: _That branch node contains another branch, representing key-value pair "testKey000A": "testValueA"_ -- John claims that: _That branch node contains another branch, representing key-value pairs "testKey000z": "testValuez"._ +- John claims that: _That branch node contains another branch, representing key-value pairs "testKey000z": "testValues"._ How can I determine who's telling the truth? Simple: by computing the branch node hash for each possibility, and comparing them with our trusted branch node hash! @@ -673,7 +673,7 @@ How can I determine who's telling the truth? Simple: by computing the branch nod await trie2.put(utf8ToBytes('testKey'), utf8ToBytes('testValue')) await trie2.put(utf8ToBytes('testKey0001'), utf8ToBytes('testValue1')) - await trie2.put(utf8ToBytes('testKey000z'), utf8ToBytes('testValuez')) + await trie2.put(utf8ToBytes('testKey000z'), utf8ToBytes('testValues')) const temp1 = await trie1.findPath(utf8ToBytes('testKey')) const temp2 = await trie2.findPath(utf8ToBytes('testKey')) diff --git a/packages/trie/scripts/view.ts b/packages/trie/scripts/view.ts index 5d2f600027..ee4e48d487 100644 --- a/packages/trie/scripts/view.ts +++ b/packages/trie/scripts/view.ts @@ -9,8 +9,8 @@ import { _walkTrie } from './asyncWalk.js' import type { TrieNode } from '../types.js' import type { Debugger } from 'debug' -const debug = _debug('trieview') -const delimeters = { +const debug = _debug('trieview') // cspell:disable-line +const delimiters = { 0: debug.extend(''), 1: debug.extend('::'), 2: debug.extend('::::'), @@ -18,12 +18,12 @@ const delimeters = { 4: debug.extend('::::::::'), 5: debug.extend('::::::::::'), } as const -type Delimeter = keyof typeof delimeters -const delimiter = (level: Delimeter): void => { - delimeters[level]('-'.repeat(50 - level * 2)) +type Delimiter = keyof typeof delimiters +const delimiter = (level: Delimiter): void => { + delimiters[level]('-'.repeat(50 - level * 2)) } const tNode = ['br', 'lf', 'ex', 'rt', 'nl', 'pf', 'vl'] as const -type TNode = typeof tNode[number] +type TNode = (typeof tNode)[number] const debugN = (type: TNode, d?: Debugger) => { d = d ?? debug const nodeDebuggers = { @@ -43,10 +43,10 @@ function getNodeType(node: TrieNode): TNode { return node instanceof BranchNode ? 'br' : node instanceof ExtensionNode - ? 'ex' - : node instanceof LeafNode - ? 'lf' - : 'nl' + ? 'ex' + : node instanceof LeafNode + ? 'lf' + : 'nl' } function logNode(trie: Trie, node: TrieNode, currentKey: number[]): void { @@ -56,8 +56,8 @@ function logNode(trie: Trie, node: TrieNode, currentKey: number[]): void { debugN('rt').extend(type)( `{ 0x${bytesToHex((trie as any).hash(node.serialize())).slice( 0, - 12 - )}... } ---- \uD83D\uDCA5 \u211B \u2134 \u2134 \u0164 \u0147 \u2134 \u0221 \u2211 \u2737` + 12, + )}... } ---- \uD83D\uDCA5 \u211B \u2134 \u2134 \u0164 \u0147 \u2134 \u0221 \u2211 \u2737`, ) } else { debugN(type)(`{ 0x${bytesToHex((trie as any).hash(node.serialize())).slice(0, 12)}... } ----`) diff --git a/packages/trie/src/proof/range.ts b/packages/trie/src/proof/range.ts index ff8f62b201..a3699989fc 100644 --- a/packages/trie/src/proof/range.ts +++ b/packages/trie/src/proof/range.ts @@ -277,7 +277,7 @@ async function unsetInternal(trie: Trie, left: Nibbles, right: Nibbles): Promise return false } else if (node instanceof BranchNode) { - // Unset all internal nodes in the forkpoint + // Unset all internal nodes in the forkPoint for (let i = left[pos] + 1; i < right[pos]; i++) { node.setBranch(i, null) } diff --git a/packages/trie/src/trie.ts b/packages/trie/src/trie.ts index c64609007c..9914d46af1 100644 --- a/packages/trie/src/trie.ts +++ b/packages/trie/src/trie.ts @@ -236,7 +236,7 @@ export class Trie { if (val === null || equalsBytes(val, value) === false) { // All items of the stack are going to change. // (This is the path from the root node to wherever it needs to insert nodes) - // The items change, because the leaf value is updated, thus all keyhashes in the + // The items change, because the leaf value is updated, thus all keyHashes in the // stack should be updated as well, so that it points to the right key/value pairs of the path const deleteHashes = stack.map((e) => this.hash(e.serialize())) ops = deleteHashes.map((deletedHash) => { @@ -257,7 +257,7 @@ export class Trie { // then update await this._updateNode(appliedKey, value, remaining, stack) if (this._opts.useNodePruning) { - // Only after updating the node we can delete the keyhashes + // Only after updating the node we can delete the keyHashes await this._db.batch(ops) } } @@ -281,7 +281,7 @@ export class Trie { // Only delete if the `key` currently has any value if (this._opts.useNodePruning && node !== null) { const deleteHashes = stack.map((e) => this.hash(e.serialize())) - // Just as with `put`, the stack items all will have their keyhashes updated + // Just as with `put`, the stack items all will have their keyHashes updated // So after deleting the node, one can safely delete these from the DB ops = deleteHashes.map((deletedHash) => { @@ -301,7 +301,7 @@ export class Trie { await this._deleteNode(appliedKey, stack) } if (this._opts.useNodePruning) { - // Only after deleting the node it is possible to delete the keyhashes + // Only after deleting the node it is possible to delete the keyHashes await this._db.batch(ops) } await this.persistRoot() @@ -736,7 +736,7 @@ export class Trie { // However, this violates the trie spec; this should be converted in either an ExtensionNode // Or a LeafNode // Since this branch is deleted, one can thus also delete this branch from the DB - // So add this to the `opStack` and mark the keyhash to be deleted + // So add this to the `opStack` and mark the keyHash to be deleted if (this._opts.useNodePruning) { // If the branchNode has length < 32, it will be a RawNode (Uint8Array[]) instead of a Uint8Array // In that case, we need to serialize and hash it into a Uint8Array, otherwise the operation will throw @@ -848,9 +848,9 @@ export class Trie { * @example * const ops = [ * { type: 'del', key: Uint8Array.from('father') } - * , { type: 'put', key: Uint8Array.from('name'), value: Uint8Array.from('Yuri Irsenovich Kim') } + * , { type: 'put', key: Uint8Array.from('name'), value: Uint8Array.from('Yuri Irsenovich Kim') } // cspell:disable-line * , { type: 'put', key: Uint8Array.from('dob'), value: Uint8Array.from('16 February 1941') } - * , { type: 'put', key: Uint8Array.from('spouse'), value: Uint8Array.from('Kim Young-sook') } + * , { type: 'put', key: Uint8Array.from('spouse'), value: Uint8Array.from('Kim Young-sook') } // cspell:disable-line * , { type: 'put', key: Uint8Array.from('occupation'), value: Uint8Array.from('Clown') } * ] * await trie.batch(ops) diff --git a/packages/trie/src/util/encoding.ts b/packages/trie/src/util/encoding.ts index 1e0708ec75..8e6234b80d 100644 --- a/packages/trie/src/util/encoding.ts +++ b/packages/trie/src/util/encoding.ts @@ -129,12 +129,12 @@ export const nibbleTypeToByteType = (arr: Nibbles): Uint8Array => { * @returns Nibble typed nibble array */ export const byteTypeToNibbleType = (key: Uint8Array): Nibbles => { - const bkey = toBytes(key) + const bKey = toBytes(key) const nibbles = [] as Nibbles - for (let i = 0; i < bkey.length; i++) { + for (let i = 0; i < bKey.length; i++) { const q = i - nibbles[q] = bkey[i] % 16 + nibbles[q] = bKey[i] % 16 } return nibbles @@ -164,13 +164,13 @@ export const mergeAndFormatKeyPaths = (pathStrings: string[]) => { let paths: string[] = [] let i = 0 while (i < pathStrings.length) { - const outterPathString = pathStrings[i]!.split('/') - const outterAccountPath = outterPathString[0] - const outterStoragePath = outterPathString[1] + const outerPathString = pathStrings[i]!.split('/') + const outerAccountPath = outerPathString[0] + const outerStoragePath = outerPathString[1] - paths.push(outterAccountPath) - if (outterStoragePath !== undefined) { - paths.push(outterStoragePath) + paths.push(outerAccountPath) + if (outerStoragePath !== undefined) { + paths.push(outerStoragePath) } let j = ++i @@ -179,7 +179,7 @@ export const mergeAndFormatKeyPaths = (pathStrings: string[]) => { const innerAccountPath = innerPathString[0] const innerStoragePath = innerPathString[1] - if (innerAccountPath === outterAccountPath) { + if (innerAccountPath === outerAccountPath) { paths.push(innerStoragePath) } else { ret.push(paths) diff --git a/packages/trie/src/util/nibbles.ts b/packages/trie/src/util/nibbles.ts index 9bc473f310..15ec98bf7e 100644 --- a/packages/trie/src/util/nibbles.ts +++ b/packages/trie/src/util/nibbles.ts @@ -8,14 +8,14 @@ import type { Nibbles } from '../types.js' * @param key */ export function bytesToNibbles(key: Uint8Array): Nibbles { - const bkey = toBytes(key) + const bKey = toBytes(key) const nibbles = [] as Nibbles - for (let i = 0; i < bkey.length; i++) { + for (let i = 0; i < bKey.length; i++) { let q = i * 2 - nibbles[q] = bkey[i] >> 4 + nibbles[q] = bKey[i] >> 4 ++q - nibbles[q] = bkey[i] % 16 + nibbles[q] = bKey[i] % 16 } return nibbles diff --git a/packages/trie/test/official.spec.ts b/packages/trie/test/official.spec.ts index d70f921067..a8581d4108 100644 --- a/packages/trie/test/official.spec.ts +++ b/packages/trie/test/official.spec.ts @@ -3,7 +3,7 @@ import { assert, describe, it } from 'vitest' import { Trie } from '../src/index.js' -import trieAnyOrderTests from './fixtures/trieanyorder.json' +import trieAnyOrderTests from './fixtures/trieanyorder.json' // cspell:disable-line import trieTests from './fixtures/trietest.json' describe('official tests', () => { diff --git a/packages/trie/test/proof.spec.ts b/packages/trie/test/proof.spec.ts index ae972ac733..99455e0569 100644 --- a/packages/trie/test/proof.spec.ts +++ b/packages/trie/test/proof.spec.ts @@ -15,12 +15,12 @@ describe('simple merkle proofs generation and verification', () => { const trie = new Trie() await trie.put(utf8ToBytes('key1aa'), utf8ToBytes('0123456789012345678901234567890123456789xx')) - await trie.put(utf8ToBytes('key2bb'), utf8ToBytes('aval2')) - await trie.put(utf8ToBytes('key3cc'), utf8ToBytes('aval3')) + await trie.put(utf8ToBytes('key2bb'), utf8ToBytes('aVal2')) + await trie.put(utf8ToBytes('key3cc'), utf8ToBytes('aVal3')) let proof = await createMerkleProof(trie, utf8ToBytes('key2bb')) let val = await verifyTrieProof(utf8ToBytes('key2bb'), proof) - assert.equal(bytesToUtf8(val!), 'aval2') + assert.equal(bytesToUtf8(val!), 'aVal2') proof = await createMerkleProof(trie, utf8ToBytes('key1aa')) val = await verifyTrieProof(utf8ToBytes('key1aa'), proof) @@ -32,18 +32,18 @@ describe('simple merkle proofs generation and verification', () => { // traversing into `key22` would touch all the same nodes as traversing into `key2` assert.equal(val, null, 'Expected value at a random key to be null') - let myKey = utf8ToBytes('anyrandomkey') + let myKey = utf8ToBytes('anyRandomKey') proof = await createMerkleProof(trie, myKey) val = await verifyTrieProof(myKey, proof) assert.equal(val, null, 'Expected value to be null') - myKey = utf8ToBytes('anothergarbagekey') // should generate a valid proof of null + myKey = utf8ToBytes('anotherGarbageKey') // should generate a valid proof of null proof = await createMerkleProof(trie, myKey) proof.push(utf8ToBytes('123456')) // extra nodes are just ignored val = await verifyTrieProof(myKey, proof) assert.equal(val, null, 'Expected value to be null') - await trie.put(utf8ToBytes('another'), utf8ToBytes('3498h4riuhgwe')) + await trie.put(utf8ToBytes('another'), utf8ToBytes('3498h4riuhgwe')) // cspell:disable-line // to fail our proof we can request a proof for one key proof = await createMerkleProof(trie, utf8ToBytes('another')) @@ -67,12 +67,12 @@ describe('simple merkle proofs generation and verification', () => { // test an invalid exclusion proof by creating // a valid exclusion proof then making it non-null - myKey = utf8ToBytes('anyrandomkey') + myKey = utf8ToBytes('anyRandomKey') proof = await createMerkleProof(trie, myKey) val = await verifyTrieProof(myKey, proof) assert.equal(val, null, 'Expected value to be null') // now make the key non-null so the exclusion proof becomes invalid - await trie.put(myKey, utf8ToBytes('thisisavalue')) + await trie.put(myKey, utf8ToBytes('thisIsaValue')) try { await createTrieFromProof(proof, { root: trie.root() }) assert.fail(`expected error: 'The provided proof does not have the expected trie root'`) @@ -112,9 +112,9 @@ describe('simple merkle proofs generation and verification', () => { utf8ToBytes('key1'), utf8ToBytes('0123456789012345678901234567890123456789Very_Long'), ) - await trie.put(utf8ToBytes('key2bb'), utf8ToBytes('aval3')) + await trie.put(utf8ToBytes('key2bb'), utf8ToBytes('aVal3')) await trie.put(utf8ToBytes('key2'), utf8ToBytes('short')) - await trie.put(utf8ToBytes('key3cc'), utf8ToBytes('aval3')) + await trie.put(utf8ToBytes('key3cc'), utf8ToBytes('aVal3')) await trie.put(utf8ToBytes('key3'), utf8ToBytes('1234567890123456789012345678901')) let proof = await createMerkleProof(trie, utf8ToBytes('key1')) @@ -170,14 +170,14 @@ describe('simple merkle proofs generation and verification', () => { const newTrie = await createTrieFromProof(proof, { useKeyHashing: true }) const trieValue = await newTrie.get(key) - assert.ok(equalsBytes(trieValue!, encodedValue), 'trie value sucessfully copied') + assert.ok(equalsBytes(trieValue!, encodedValue), 'trie value successfully copied') assert.ok(equalsBytes(trie.root(), newTrie.root()), 'root set correctly') const proof2 = await createMerkleProof(trie, key2) await updateTrieFromMerkleProof(newTrie, proof2) const trieValue2 = await newTrie.get(key2) - assert.ok(equalsBytes(trieValue2!, encodedValue2), 'trie value succesfully updated') + assert.ok(equalsBytes(trieValue2!, encodedValue2), 'trie value successfully updated') assert.ok(equalsBytes(trie.root(), newTrie.root()), 'root set correctly') const trieValue3 = await newTrie.get(key3) @@ -209,7 +209,7 @@ describe('simple merkle proofs generation and verification', () => { const updatedNewSafeValue = await newTrie.get(safeKey) assert.ok( equalsBytes(updatedNewSafeValue!, safeValue), - 'succesfully set the trie to the new root and got the correct value', + 'successfully set the trie to the new root and got the correct value', ) }) }) diff --git a/packages/trie/test/proof/range.spec.ts b/packages/trie/test/proof/range.spec.ts index 4fa8eaa74c..ba6fde5d9c 100644 --- a/packages/trie/test/proof/range.spec.ts +++ b/packages/trie/test/proof/range.spec.ts @@ -83,7 +83,7 @@ async function verify( startKey?: Uint8Array, endKey?: Uint8Array, keys?: Uint8Array[], - vals?: Uint8Array[], + values?: Uint8Array[], ) { startKey = startKey ?? entries[start][0] endKey = endKey ?? entries[end][0] @@ -93,7 +93,7 @@ async function verify( startKey, endKey, keys ?? targetRange.map(([key]) => key), - vals ?? targetRange.map(([, val]) => val), + values ?? targetRange.map(([, val]) => val), [...(await createMerkleProof(trie, startKey)), ...(await createMerkleProof(trie, endKey))], ) } diff --git a/packages/trie/test/trie/checkpoint.spec.ts b/packages/trie/test/trie/checkpoint.spec.ts index aac6de1dfb..85ee293b10 100644 --- a/packages/trie/test/trie/checkpoint.spec.ts +++ b/packages/trie/test/trie/checkpoint.spec.ts @@ -208,7 +208,7 @@ describe('testing checkpoints', () => { const KEY = utf8ToBytes('last_block_height') const KEY_ROOT = keccak256(ROOT_DB_KEY) - // Initialise State + // Initialize State const CommittedState = await createTrie({ useKeyHashing: true, useNodePruning: true, diff --git a/packages/trie/test/trie/secure.spec.ts b/packages/trie/test/trie/secure.spec.ts index eade5ecabe..228f4d7b87 100644 --- a/packages/trie/test/trie/secure.spec.ts +++ b/packages/trie/test/trie/secure.spec.ts @@ -61,7 +61,7 @@ describe('SecureTrie proof', () => { it('read back data written with hashed key', async () => { const trie = new Trie({ useKeyHashing: true, db: new MapDB() }) - // skip key transformation if the key is already hashed like data recieved in snapsync + // skip key transformation if the key is already hashed like data received in snapsync await trie.put(keccak256(utf8ToBytes('key1aa')), utf8ToBytes('01234'), true) const val = await trie.get(utf8ToBytes('key1aa')) diff --git a/packages/trie/test/util/encodingUtils.spec.ts b/packages/trie/test/util/encodingUtils.spec.ts index d647c47929..ba30a5120e 100644 --- a/packages/trie/test/util/encodingUtils.spec.ts +++ b/packages/trie/test/util/encodingUtils.spec.ts @@ -69,7 +69,7 @@ describe('encoding', () => { }) it('should return the correct hex-encoded key in "hex" encoding', () => { - const path = 'aabbcc' + const path = 'aabbcc' // cspell:disable-line const extension: Nibbles = [10, 11, 12] const result = pathToHexKey(path, extension, 'hex') diff --git a/packages/trie/test/util/log.spec.ts b/packages/trie/test/util/log.spec.ts index be4e7157b4..0131defbcd 100644 --- a/packages/trie/test/util/log.spec.ts +++ b/packages/trie/test/util/log.spec.ts @@ -7,7 +7,7 @@ import { Trie } from '../../src/trie.js' describe('Run Trie script with DEBUG enabled', async () => { const trie_entries: [string, string | null][] = [ ['do', 'verb'], - ['ether', 'wookiedoo'], + ['ether', 'wookiedoo'], // cspell:disable-line ['doge', 'coin'], ['ether', null], ['dog', 'puppy'], diff --git a/packages/tx/CHANGELOG.md b/packages/tx/CHANGELOG.md index 1f9b942c87..c6003555d1 100644 --- a/packages/tx/CHANGELOG.md +++ b/packages/tx/CHANGELOG.md @@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) This release introduces support for a non-final version of [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) EOA code transactions, see PR [#3470](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3470). This tx type allows to run code in the context of an EOA and therefore extend the functionality which can be "reached" from respectively integrated into the scope of an otherwise limited EOA account. -The following is a simple example how to use an `EOACodeEIP7702Transaction` with one autorization list item: +The following is a simple example how to use an `EOACodeEIP7702Transaction` with one authorization list item: ```ts // ./examples/EOACodeTx.ts @@ -205,7 +205,7 @@ While you could use our libraries in the browser libraries before, there had bee WE HAVE ELIMINATED ALL OF THEM. -The largest two undertakings: First: we have rewritten all (half) of our API and elimited the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went throuh our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. +The largest two undertakings: First: we have rewritten all (half) of our API and eliminated the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went through our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. Together with some few other modifications this now allows to run each (maybe adding an asterisk for client and devp2p) of our libraries directly in the browser - more or less without any modifications - see the `examples/browser.html` file in each package folder for an easy to set up example. @@ -590,7 +590,7 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). @@ -598,7 +598,7 @@ Now every import is a named import and we think the long term benefits will very #### Common Library Import Updates -Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all accross our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. +Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all across our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. So Common import and usage is changing from: @@ -779,7 +779,7 @@ Invalid Signature: s-values greater than secp256k1n/2 are considered invalid (tx The extended errors give substantial more object and chain context and should ease debugging. -**Potentially breaking**: Attention! If you do react on errors in your code and do exact errror matching (`error.message === 'invalid transaction trie'`) things will break. Please make sure to do error comparisons with something like `error.message.includes('invalid transaction trie')` instead. This should generally be the pattern used for all error message comparisions and is assured to be future proof on all error messages (we won't change the core text in non-breaking releases). +**Potentially breaking**: Attention! If you do react on errors in your code and do exact error matching (`error.message === 'invalid transaction trie'`) things will break. Please make sure to do error comparisons with something like `error.message.includes('invalid transaction trie')` instead. This should generally be the pattern used for all error message comparisons and is assured to be future proof on all error messages (we won't change the core text in non-breaking releases). ## Other Changes @@ -861,7 +861,7 @@ if (tx.supports(Capability.EIP2930AccessLists)) { The following capabilities are currently supported: ```ts -enum Capabilitiy { +enum Capability { EIP155ReplayProtection: 155, // Only for legacy txs EIP1559FeeMarket: 1559, EIP2718TypedTransaction: 2718, // Use for a typed-tx-or-not switch @@ -1141,9 +1141,9 @@ Learn more about the full API in the [docs](./docs/README.md). #### Immutability -The returned transaction is now frozen and immutable. To work with a maliable transaction, copy it with `const fakeTx = Object.create(tx)`. For security reasons it is highly recommended to stay in a freezed `Transaction` context on usage. +The returned transaction is now frozen and immutable. To work with a mutable transaction, copy it with `const fakeTx = Object.create(tx)`. For security reasons it is highly recommended to stay in a freezed `Transaction` context on usage. -If you need `Transaction` mutability - e.g. because you want to subclass `Transaction` and modifiy its behavior - there is a `freeze` option to prevent the `Object.freeze()` call on initialization, see PR [#941](https://github.com/ethereumjs/ethereumjs-monorepo/pull/941). +If you need `Transaction` mutability - e.g. because you want to subclass `Transaction` and modify its behavior - there is a `freeze` option to prevent the `Object.freeze()` call on initialization, see PR [#941](https://github.com/ethereumjs/ethereumjs-monorepo/pull/941). #### from @@ -1155,19 +1155,19 @@ Getting a message to sign has been changed from calling `tx.hash(false)` to `tx. #### Fake Transaction -The `FakeTransaction` class was removed since its functionality can now be implemented with less code. To create a fake tansaction for use in e.g. `VM.runTx()` overwrite `getSenderAddress` with your own `Address`. See a full example in the section in the [README](./README.md#fake-transaction). +The `FakeTransaction` class was removed since its functionality can now be implemented with less code. To create a fake transaction for use in e.g. `VM.runTx()` overwrite `getSenderAddress` with your own `Address`. See a full example in the section in the [README](./README.md#fake-transaction). ### New Default Hardfork **Breaking:** The default HF on the library has been updated from `petersburg` to `istanbul`, see PR [#906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/906). -The HF setting is now automatically taken from the HF set for `Common.DEAULT_HARDFORK`, see PR [#863](https://github.com/ethereumjs/ethereumjs-monorepo/pull/863). +The HF setting is now automatically taken from the HF set for `Common.DEFAULT_HARDFORK`, see PR [#863](https://github.com/ethereumjs/ethereumjs-monorepo/pull/863). ### Dual ES5 and ES2017 Builds We significantly updated our internal tool and CI setup along the work on PR [#913](https://github.com/ethereumjs/ethereumjs-monorepo/pull/913) with an update to `ESLint` from `TSLint` for code linting and formatting and the introduction of a new build setup. -Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes @@ -1254,7 +1254,7 @@ Learn more about the full API in the [docs](./docs/README.md). #### Immutability -The returned transaction is now frozen and immutable. To work with a maliable transaction, copy it with `const fakeTx = Object.create(tx)`. +The returned transaction is now frozen and immutable. To work with a mutable transaction, copy it with `const fakeTx = Object.create(tx)`. #### from @@ -1266,12 +1266,12 @@ Getting a message to sign has been changed from calling `tx.hash(false)` to `tx. #### Fake Transaction -The `FakeTransaction` class was removed since its functionality can now be implemented with less code. To create a fake tansaction for use in e.g. `VM.runTx()` overwrite `getSenderAddress` with your own `Address`. See a full example in the section in the [README](./README.md#fake-transaction). +The `FakeTransaction` class was removed since its functionality can now be implemented with less code. To create a fake transaction for use in e.g. `VM.runTx()` overwrite `getSenderAddress` with your own `Address`. See a full example in the section in the [README](./README.md#fake-transaction). ### New Default Hardfork **Breaking:** The default HF on the library has been updated from `petersburg` to `istanbul`, see PR [#906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/906). -The HF setting is now automatically taken from the HF set for `Common.DEAULT_HARDFORK`, +The HF setting is now automatically taken from the HF set for `Common.DEFAULT_HARDFORK`, see PR [#863](https://github.com/ethereumjs/ethereumjs-monorepo/pull/863). ### Dual ES5 and ES2017 Builds @@ -1283,7 +1283,7 @@ for code linting and formatting and the introduction of a new build setup. Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result -in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes @@ -1379,7 +1379,7 @@ see PRs [#153](https://github.com/ethereumjs/ethereumjs-tx/pull/153), [#147](https://github.com/ethereumjs/ethereumjs-tx/pull/147) and [#143](https://github.com/ethereumjs/ethereumjs-tx/pull/143). -This comes with some changes in how different `v` values passed on instantation +This comes with some changes in how different `v` values passed on instantiation or changed on runtime are handled: - The constructor throws if the `v` value is present, indicates that `EIP-155` @@ -1402,7 +1402,7 @@ pre-`Spurious Dragon` hardfork option. ## [1.3.6] - 2018-07-02 -- Fixes issue [#108](https://github.com/ethereumjs/ethereumjs-tx/issues/108) with the `FakeTransaction.hash()` function by reverting the introduced signature handling changes in Fake transaction hash creation from PR [#94](https://github.com/ethereumjs/ethereumjs-tx/pull/94) introduced in `v1.3.5`. The signature is now again only created and added to the hash when `from` address is set and `from` is not defaulting to the zero adress any more, see PR [#110](https://github.com/ethereumjs/ethereumjs-tx/pull/110) +- Fixes issue [#108](https://github.com/ethereumjs/ethereumjs-tx/issues/108) with the `FakeTransaction.hash()` function by reverting the introduced signature handling changes in Fake transaction hash creation from PR [#94](https://github.com/ethereumjs/ethereumjs-tx/pull/94) introduced in `v1.3.5`. The signature is now again only created and added to the hash when `from` address is set and `from` is not defaulting to the zero address any more, see PR [#110](https://github.com/ethereumjs/ethereumjs-tx/pull/110) - Added additional tests to cover issue described above [1.3.6]: https://github.com/ethereumjs/ethereumjs-monorepo/compare/%40ethereumjs%2Ftx%401.3.5...%40ethereumjs%2Ftx%401.3.6 diff --git a/packages/tx/README.md b/packages/tx/README.md index 8d683e6199..d4c96f2f07 100644 --- a/packages/tx/README.md +++ b/packages/tx/README.md @@ -214,9 +214,9 @@ console.log(bytesToHex(tx.hash())) // 0x6f9ef69ccb1de1aea64e511efd6542541008ced3 - Activation: `prague` (or per EIP setting) - Type: `4` -This library suppports a non-final version of [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) starting with `v5.4.0`. This tx type allows to run code in the context of an EOA and therefore extend the functionality which can be "reached" from respectively integrated into the scope of an otherwise limited EOA account. +This library supports a non-final version of [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) starting with `v5.4.0`. This tx type allows to run code in the context of an EOA and therefore extend the functionality which can be "reached" from respectively integrated into the scope of an otherwise limited EOA account. -The following is a simple example how to use an `EOACodeEIP7702Transaction` with one autorization list item: +The following is a simple example how to use an `EOACodeEIP7702Transaction` with one authorization list item: ```ts // ./examples/EOACodeTx.ts @@ -349,7 +349,7 @@ import { Capability, EIP1559CompatibleTx, TransactionFactory } from '@ethereumjs const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) -const txData = { type: 2, maxFeePerGas: BigInt(20) } // Creates an EIP-1559 compatible transac +const txData = { type: 2, maxFeePerGas: BigInt(20) } // Creates an EIP-1559 compatible transaction const tx = TransactionFactory.fromTxData(txData, { common }) if (tx.supports(Capability.EIP1559FeeMarket)) { diff --git a/packages/tx/examples/transactions.ts b/packages/tx/examples/transactions.ts index 8d7509bde3..34d3a4e0fa 100644 --- a/packages/tx/examples/transactions.ts +++ b/packages/tx/examples/transactions.ts @@ -22,7 +22,7 @@ const privateKey = hexToBytes('0xe331b6d69882b4cb4ea581d88e0b604039a3de5967688d3 const signedTx = tx.sign(privateKey) // We have a signed transaction. -// Now for it to be fully fundable the account that we signed it with needs to have a certain amount of wei in to. +// In order to send the transaction, the account that we signed it with needs to have a certain amount of wei in to. // To see how much this account needs we can use the getUpfrontCost() method. const feeCost = signedTx.getUpfrontCost() console.log('Total Amount of wei needed:' + feeCost.toString()) diff --git a/packages/tx/examples/txFactory.ts b/packages/tx/examples/txFactory.ts index 3030469732..9929712363 100644 --- a/packages/tx/examples/txFactory.ts +++ b/packages/tx/examples/txFactory.ts @@ -5,7 +5,7 @@ import type { EIP1559CompatibleTx } from '@ethereumjs/tx' const common = new Common({ chain: Mainnet, hardfork: Hardfork.London }) -const txData = { type: 2, maxFeePerGas: BigInt(20) } // Creates an EIP-1559 compatible transac +const txData = { type: 2, maxFeePerGas: BigInt(20) } // Creates an EIP-1559 compatible transaction const tx = createTxFromTxData(txData, { common }) if (tx.supports(Capability.EIP1559FeeMarket)) { diff --git a/packages/tx/src/4844/constructors.ts b/packages/tx/src/4844/constructors.ts index 179bea572d..34fdb22ece 100644 --- a/packages/tx/src/4844/constructors.ts +++ b/packages/tx/src/4844/constructors.ts @@ -68,8 +68,8 @@ const validateBlobTransactionNetworkWrapper = ( * Notes: * - `chainId` will be set automatically if not provided * - All parameters are optional and have some basic default values - * - `blobs` cannot be supplied as well as `kzgCommittments`, `blobVersionedHashes`, `kzgProofs` - * - If `blobs` is passed in, `kzgCommittments`, `blobVersionedHashes`, `kzgProofs` will be derived by the constructor + * - `blobs` cannot be supplied as well as `kzgCommitments`, `blobVersionedHashes`, `kzgProofs` + * - If `blobs` is passed in, `kzgCommitments`, `blobVersionedHashes`, `kzgProofs` will be derived by the constructor */ export function createBlob4844Tx(txData: TxData, opts?: TxOptions) { if (opts?.common?.customCrypto?.kzg === undefined) { diff --git a/packages/tx/test/eip3860.spec.ts b/packages/tx/test/eip3860.spec.ts index d954fc2538..a9c1ab0df7 100644 --- a/packages/tx/test/eip3860.spec.ts +++ b/packages/tx/test/eip3860.spec.ts @@ -91,12 +91,12 @@ describe('[EIP3860 tests]', () => { { data, type: txType }, { common, allowUnlimitedInitCodeSize: true }, ) - const eip3860DeactivedTx = createTxFromTxData( + const eip3860DeactivatedTx = createTxFromTxData( { data, type: txType }, { common, allowUnlimitedInitCodeSize: false }, ) assert.ok( - eip3860ActiveTx.getDataGas() === eip3860DeactivedTx.getDataGas(), + eip3860ActiveTx.getDataGas() === eip3860DeactivatedTx.getDataGas(), 'charged initcode analysis gas', ) } diff --git a/packages/tx/test/eip4844.spec.ts b/packages/tx/test/eip4844.spec.ts index 219cb9e341..7a31570cdb 100644 --- a/packages/tx/test/eip4844.spec.ts +++ b/packages/tx/test/eip4844.spec.ts @@ -529,7 +529,7 @@ describe('Network wrapper tests', () => { }), 'commitment for blob at index 0 does not match versionedHash', undefined, - 'throws when versioned hashes dont match kzg commitments', + "throws when versioned hashes don't match kzg commitments", ) }) }) diff --git a/packages/tx/test/fromRpc.spec.ts b/packages/tx/test/fromRpc.spec.ts index ae4c1c3fbd..05786b983f 100644 --- a/packages/tx/test/fromRpc.spec.ts +++ b/packages/tx/test/fromRpc.spec.ts @@ -76,11 +76,15 @@ describe('[normalizeTxParams]', () => { const normedTx = normalizeTxParams(rpcTx) const tx = createTxFromTxData(normedTx) assert.equal(normedTx.gasLimit, 21000n, 'correctly converted "gas" to "gasLimit"') - assert.equal(bytesToHex(tx.hash()), rpcTx.hash, 'converted normed tx data to transaction objec') + assert.equal( + bytesToHex(tx.hash()), + rpcTx.hash, + 'converted normed tx data to transaction object', + ) }) }) -describe('fromRPC: interpret v/r/s vals of 0x0 as undefined for Optimism system txs', () => { +describe('fromRPC: interpret v/r/s values of 0x0 as undefined for Optimism system txs', () => { it('should work', async () => { for (const txType of txTypes) { ;(optimismTx as any).type = txType diff --git a/packages/tx/test/legacy.spec.ts b/packages/tx/test/legacy.spec.ts index 0200784d20..c9253deadb 100644 --- a/packages/tx/test/legacy.spec.ts +++ b/packages/tx/test/legacy.spec.ts @@ -17,7 +17,7 @@ import { createLegacyTxFromRLP, } from '../src/index.js' -import txFixturesEip155 from './json/ttTransactionTestEip155VitaliksTests.json' +import txFixturesEip155 from './json/ttTransactionTestEip155VitaliksTests.json' // cspell:disable-line import txFixtures from './json/txs.json' import type { TransactionType, TxData, TypedTransaction } from '../src/index.js' @@ -62,7 +62,7 @@ describe('[Transaction]', () => { const nonEIP2930Common = new Common({ chain: Mainnet, hardfork: Hardfork.Istanbul }) assert.ok( createLegacyTx({}, { common: nonEIP2930Common }), - 'should initialize on a pre-Berlin Harfork (EIP-2930 not activated)', + 'should initialize on a pre-Berlin Hardfork (EIP-2930 not activated)', ) let common = new Common({ chain: Goerli }) const txData = txFixtures[3].raw.map((rawTxData) => hexToBytes(rawTxData as PrefixedHexString)) diff --git a/packages/tx/test/types.ts b/packages/tx/test/types.ts index c37d36a18b..d0974b38a7 100644 --- a/packages/tx/test/types.ts +++ b/packages/tx/test/types.ts @@ -26,8 +26,10 @@ export interface TxData { s: string } -// The type of each entry from ./ttTransactionTestEip155VitaliksTests.json +// The type of each entry from ./ttTransactionTestEip155VitaliksTests.json // cspell:disable-line +// cspell:disable export interface VitaliksTestsDataEntry { + // cspell:enable blocknumber: string hash: string rlp: string @@ -52,8 +54,8 @@ export type ForksData = { export type OfficialTransactionTestData = { _info: { comment: string - filledwith: string - lllcversion: string + filledwith: string // cspell:disable-line + lllcversion: string // cspell:disable-line source: string sourceHash: string } diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index 8c521fe337..98fbb516db 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -27,7 +27,7 @@ console.log(`Partial account with nonce=${account.nonce} and balance=${account.b This release introduces a new `requests` module (see PRs [#3372](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3372), [#3393](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3393), [#3398](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3398) and [#3477](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3477)) with various type and an abstract base class for [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685) general purpose execution layer requests to the CL (Prague hardfork) as well as concrete implementations for the currently supported request types: - [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110): `DepositRequest` (Prague Hardfork) -- [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002): `WithdrawawlRequest` (Prague Hardfork) +- [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002): `WithdrawalRequest` (Prague Hardfork) - [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251): `ConsolidationRequest` (Prague Hardfork) These request types are mainly used within the [@ethereumjs/block](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/block) library where applied usage instructions are provided in the README. @@ -77,7 +77,7 @@ This release contains various fixes and spec updates related to the Dencun (Dene ### Other Changes -- Performance: New reoccurringly used BigInt constants (`BIGINT_0`, `BIGINT_32`, `BIGINT_2EXP96`,...) in the `bytes` module for reusage along performance optimizations, PR [#3050](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3050) +- Performance: New BigInt constants (`BIGINT_0`, `BIGINT_32`, `BIGINT_2EXP96`,...) in the `bytes` module for re-usage along performance optimizations, PR [#3050](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3050) - Performance: `bytesToBigInt()` performance optimization for 1-byte bytes, PR [#3054](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3054) - Fix a bug in `fromUtf8()`, PR [#3112](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3112) @@ -101,7 +101,7 @@ While you could use our libraries in the browser libraries before, there had bee WE HAVE ELIMINATED ALL OF THEM. -The largest two undertakings: First: we have rewritten all (half) of our API and elimited the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went throuh our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. +The largest two undertakings: First: we have rewritten all (half) of our API and eliminated the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went through our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. Together with some few other modifications this now allows to run each (maybe adding an asterisk for client and devp2p) of our libraries directly in the browser - more or less without any modifications - see the `examples/browser.html` file in each package folder for an easy to set up example. @@ -167,7 +167,7 @@ new Address() Address.fromPublicKey(pubKey: Uint8Array): Address Address.fromPrivateKey(privateKey: Uint8Array): Address Address.generate2(from: Address, salt: Uint8Array, initCode: Uint8Array): Address -Adress.toBytes // old: Address.toBuffer() +Address.toBytes // old: Address.toBuffer() // bytes // All Buffer related functionality removed, do "Buffer" search @@ -224,7 +224,7 @@ We have converted existing Buffer conversion methods to Uint8Array conversion me - New `GWEI_TO_WEI` constant in a newly created `units` module, PR [#2483](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2483) - Change withdrawal amount representation from Wei to Gwei (see EIP-4895 PR [#6325](https://github.com/ethereum/EIPs/pull/6325)) in `withdrawal` module `Withdrawal` class, PR [#2483](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2483) ) -- Added `@chainsafe/ssz` dependency, new prepartory `ssz` container module, PR [#2488](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2488) +- Added `@chainsafe/ssz` dependency, new preparatory `ssz` container module, PR [#2488](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2488) - Use literal value instead of formula for `MAX_INTEGER_BIGINT`, PR [#2536](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2536) ## 8.0.3 - 2022-12-09 @@ -273,7 +273,7 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). @@ -441,7 +441,7 @@ See: PR [#1517](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1517) We significantly updated our internal tool and CI setup along the work on PR [#913](https://github.com/ethereumjs/ethereumjs-monorepo/pull/913) with an update to `ESLint` from `TSLint` for code linting and formatting and the introduction of a new build setup. -Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. #### Included Source Files @@ -468,7 +468,7 @@ Function signatures for methods in `address` and `signature` are therefore expan All function signatures are still taking in a `number` input for backwards-compatibility reasons. If you use one of the following functions to implement generic use cases in your library where the chain ID is not yet known it is recommended to updated to one of the other input types (with plain `Buffer` likely be the most future-proof). Note that on some functions this changes the return value as well. -- `account`: `toChecksumAddresss(hexAddress: string, eip1191ChainId?: number): string` +- `account`: `toChecksumAddress(hexAddress: string, eip1191ChainId?: number): string` - -> `toChecksumAddress = function(hexAddress: string, eip1191ChainId?: BNLike): string` - `account`: `isValidChecksumAddress(hexAddress: string, eip1191ChainId?: number)` - -> `isValidChecksumAddress(hexAddress: string, eip1191ChainId?: BNLike)` @@ -488,7 +488,7 @@ Along there is a new `toType()` helper function which can be used to easily conv ## [7.0.8] - 2021-02-01 -- New `Address.equals(address: Address)` function for easier address equality comparions, PR [#285](https://github.com/ethereumjs/ethereumjs-util/pull/285) +- New `Address.equals(address: Address)` function for easier address equality comparisons, PR [#285](https://github.com/ethereumjs/ethereumjs-util/pull/285) - Fixed a bug in `fromRpcSig()` in the `signature` module not working correctly for chain IDs greater than 110, PR [#287](https://github.com/ethereumjs/ethereumjs-util/pull/287) [7.0.8]: https://github.com/ethereumjs/ethereumjs-util/compare/v7.0.7...v7.0.8 @@ -655,14 +655,14 @@ Changes to the API have been discussed in Issue [#172](https://github.com/ethereumjs/ethereumjs-util/issues/172) and are guided by the principles of: -- Make the API more typestrict +- Make the API more type-strict - Be less ambiguous regarding accepted values - Avoid implicit type conversions - Be more explicit on wrong input (just: throw) While the implemented changes come with some additional need for manual type conversions depending on the usage context, they should finally lead to -cleaner usage patterns on the cosuming side and a more predictable, robust and +cleaner usage patterns on the consuming side and a more predictable, robust and less error-prone control flow. Some note: for methods where `Buffer` usage is now enforced you can use the @@ -700,7 +700,7 @@ and `Buffer` inputs are now enforced: #### Bytes Module -##### Typestrict Methods and Type-Explicit Method Split-Up +##### Type-strict Methods and Type-Explicit Method Split-Up PR: [#244](https://github.com/ethereumjs/ethereumjs-util/pull/244) @@ -714,7 +714,7 @@ PR: [#244](https://github.com/ethereumjs/ethereumjs-util/pull/244) #### Hash Module -##### Typestrict Methods and Type-Explicit Method Split-Up +##### Type-strict Methods and Type-Explicit Method Split-Up PR [#247](https://github.com/ethereumjs/ethereumjs-util/pull/247) @@ -749,10 +749,10 @@ The following methods are now `Buffer`-only: PR [#228](https://github.com/ethereumjs/ethereumjs-util/pull/228) - Updated `BN.js` library re-export from `4.x` to `5.x`, PR [#249], https://github.com/ethereumjs/ethereumjs-util/pull/249 -- Removed `secp2561` re-export (use methods provided or import directly), +- Removed `secp256k1` re-export (use methods provided or import directly), PR [#228](https://github.com/ethereumjs/ethereumjs-util/pull/228) -### Cryto Library Updates: Keccak, secp2561 +### Crypto Library Updates: Keccak, secp256k1 `Keccak` dependency has been updated from `2.1.0` to `3.0.0`. This version comes with prebuilds for Linux, MacOS and Windows so most users won't need @@ -761,7 +761,7 @@ to have `node-gyp` run on installation. The version update also brings in feature compatibility with newer Node.js versions. -The `secp2561` ECDSA dependency has been updated from `3.0.1` to `4.0.1`. +The `secp256k1` ECDSA dependency has been updated from `3.0.1` to `4.0.1`. ### Developer Improvements @@ -922,7 +922,7 @@ see PR [#170](https://github.com/ethereumjs/ethereumjs-util/pull/170). ## [5.1.1] - 2017-02-10 - Use hex utils from `ethjs-util` -- Move secp vars into functions +- Move secp256k1 vars into functions - Dependency updates [5.1.1]: https://github.com/ethereumjs/ethereumjs-util/compare/v5.1.0...v5.1.1 diff --git a/packages/util/README.md b/packages/util/README.md index 467aa8341d..63ff8bdf8b 100644 --- a/packages/util/README.md +++ b/packages/util/README.md @@ -145,8 +145,8 @@ Simple map DB implementation using the `DB` interface (see above). Module with various type and an abstract base class for [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685) general purpose execution layer requests to the CL (Prague hardfork) as well as concrete implementations for the currently supported request types: -- [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110): `DepositRequest` (Prague Harfork) -- [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002): `WithdrawawlRequest` (Prague Hardfork) +- [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110): `DepositRequest` (Prague Hardfork) +- [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002): `WithdrawalRequest` (Prague Hardfork) - [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251): `ConsolidationRequest` (Prague Hardfork) These request types are mainly used within the [@ethereumjs/block](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/block) library where applied usage instructions are provided in the README. diff --git a/packages/util/examples/signature.ts b/packages/util/examples/signature.ts index 2ff0a1a4c2..2c3faf77f9 100644 --- a/packages/util/examples/signature.ts +++ b/packages/util/examples/signature.ts @@ -2,11 +2,11 @@ import { bytesToHex, ecrecover, hexToBytes } from '@ethereumjs/util' const chainId = BigInt(3) // Ropsten -const echash = hexToBytes('0x82ff40c0a986c6a5cfad4ddf4c3aa6996f1a7837f9c398e17e5de5cbd5a12b28') +const ecHash = hexToBytes('0x82ff40c0a986c6a5cfad4ddf4c3aa6996f1a7837f9c398e17e5de5cbd5a12b28') const r = hexToBytes('0x99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9') const s = hexToBytes('0x129ff05af364204442bdb53ab6f18a99ab48acc9326fa689f228040429e3ca66') const v = BigInt(41) -const pubkey = ecrecover(echash, v, r, s, chainId) +const pubkey = ecrecover(ecHash, v, r, s, chainId) console.log(`Recovered public key ${bytesToHex(pubkey)} from valid signature values`) diff --git a/packages/util/src/blobs.ts b/packages/util/src/blobs.ts index 1aec3aeb5c..71c98f895e 100644 --- a/packages/util/src/blobs.ts +++ b/packages/util/src/blobs.ts @@ -15,10 +15,10 @@ const MAX_USEFUL_BYTES_PER_TX = USEFUL_BYTES_PER_BLOB * MAX_BLOBS_PER_TX - 1 const BLOB_SIZE = BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB function get_padded(data: Uint8Array, blobs_len: number): Uint8Array { - const pdata = new Uint8Array(blobs_len * USEFUL_BYTES_PER_BLOB).fill(0) - pdata.set(data) - pdata[data.byteLength] = 0x80 - return pdata + const pData = new Uint8Array(blobs_len * USEFUL_BYTES_PER_BLOB).fill(0) + pData.set(data) + pData[data.byteLength] = 0x80 + return pData } function get_blob(data: Uint8Array): Uint8Array { @@ -44,11 +44,11 @@ export const getBlobs = (input: string) => { const blobs_len = Math.ceil(len / USEFUL_BYTES_PER_BLOB) - const pdata = get_padded(data, blobs_len) + const pData = get_padded(data, blobs_len) const blobs: Uint8Array[] = [] for (let i = 0; i < blobs_len; i++) { - const chunk = pdata.subarray(i * USEFUL_BYTES_PER_BLOB, (i + 1) * USEFUL_BYTES_PER_BLOB) + const chunk = pData.subarray(i * USEFUL_BYTES_PER_BLOB, (i + 1) * USEFUL_BYTES_PER_BLOB) const blob = get_blob(chunk) blobs.push(blob) } diff --git a/packages/util/src/bytes.ts b/packages/util/src/bytes.ts index 543540323a..7bc047c55f 100644 --- a/packages/util/src/bytes.ts +++ b/packages/util/src/bytes.ts @@ -5,7 +5,7 @@ import { bytesToHex as _bytesToUnprefixedHex } from 'ethereum-cryptography/utils import { assertIsArray, assertIsBytes, assertIsHexString } from './helpers.js' import { isHexString, padToEven, stripHexPrefix } from './internal.js' -import type { PrefixedHexString, TransformabletoBytes } from './types.js' +import type { PrefixedHexString, TransformableToBytes } from './types.js' const BIGINT_0 = BigInt(0) @@ -272,7 +272,7 @@ export type ToBytesInputTypes = | bigint | Uint8Array | number[] - | TransformabletoBytes + | TransformableToBytes | null | undefined @@ -473,7 +473,7 @@ export const randomBytes = (length: number): Uint8Array => { /** * This mirrors the functionality of the `ethereum-cryptography` export except - * it skips the check to validate that every element of `arrays` is indead a `uint8Array` + * it skips the check to validate that every element of `arrays` is indeed a `uint8Array` * Can give small performance gains on large arrays * @param {Uint8Array[]} arrays an array of Uint8Arrays * @returns {Uint8Array} one Uint8Array with all the elements of the original set diff --git a/packages/util/src/kzg.ts b/packages/util/src/kzg.ts index 256d2e35a4..a2d91301d7 100644 --- a/packages/util/src/kzg.ts +++ b/packages/util/src/kzg.ts @@ -25,7 +25,7 @@ export interface Kzg { /** * @deprecated This initialization method is deprecated since trusted setup loading is done directly in the reference KZG library - * initialization or should othewise be assured independently before KZG libary usage. + * initialization or should otherwise be assured independently before KZG library usage. * * @param kzgLib a KZG implementation (defaults to c-kzg) * @param a dictionary of trusted setup options diff --git a/packages/util/src/types.ts b/packages/util/src/types.ts index 2cc0df8f9c..f9bc736eb7 100644 --- a/packages/util/src/types.ts +++ b/packages/util/src/types.ts @@ -17,7 +17,7 @@ export type BytesLike = | number[] | number | bigint - | TransformabletoBytes + | TransformableToBytes | PrefixedHexString /* @@ -30,7 +30,7 @@ export type PrefixedHexString = `0x${string}` */ export type AddressLike = Address | Uint8Array | PrefixedHexString -export interface TransformabletoBytes { +export interface TransformableToBytes { toBytes?(): Uint8Array } diff --git a/packages/util/src/verkle.ts b/packages/util/src/verkle.ts index 7f6e2dc3cf..8be738518c 100644 --- a/packages/util/src/verkle.ts +++ b/packages/util/src/verkle.ts @@ -37,7 +37,7 @@ export interface VerkleCrypto { /** * @dev Returns the 31-bytes verkle tree stem for a given address and tree index. * @dev Assumes that the verkle node width = 256 - * @param ffi The verkle ffi object from verkle-crypotography-wasm. + * @param ffi The verkle ffi object from verkle-cryptography-wasm. * @param address The address to generate the tree key for. * @param treeIndex The index of the tree to generate the key for. Defaults to 0. * @return The 31-bytes verkle tree stem as a Uint8Array. @@ -63,7 +63,7 @@ export function getVerkleStem( /** * Verifies that the executionWitness is valid for the given prestateRoot. - * @param ffi The verkle ffi object from verkle-crypotography-wasm. + * @param ffi The verkle ffi object from verkle-cryptography-wasm. * @param prestateRoot The prestateRoot matching the executionWitness. * @param executionWitness The verkle execution witness. * @returns {boolean} Whether or not the executionWitness belongs to the prestateRoot. diff --git a/packages/util/src/withdrawal.ts b/packages/util/src/withdrawal.ts index d8f2a133e7..daa2e53f10 100644 --- a/packages/util/src/withdrawal.ts +++ b/packages/util/src/withdrawal.ts @@ -43,7 +43,7 @@ export class Withdrawal { public readonly validatorIndex: bigint, public readonly address: Address, /** - * withdrawal amount in Gwei to match the CL repesentation and eventually ssz withdrawalsRoot + * withdrawal amount in Gwei to match the CL representation and eventually ssz withdrawalsRoot */ public readonly amount: bigint, ) {} diff --git a/packages/util/test/account.spec.ts b/packages/util/test/account.spec.ts index b9ef96541d..ac15005be7 100644 --- a/packages/util/test/account.spec.ts +++ b/packages/util/test/account.spec.ts @@ -278,13 +278,13 @@ describe('Utility Functions', () => { ) assert.ok( isValidPublic(pubKey, true), - "shouldn't fail on SEC1 key wt.testh sant.testize enabled", + "shouldn't fail on SEC1 key wt.testh sant.testize enabled", // cspell:disable-line ) pubKey = hexToBytes( '0x023a443d8381a6798a70c6ff9304bdc8cb0163c23211d11628fae52ef9e0dca11a001cf066d56a8156fc201cd5df8a36ef694eecd258903fca7086c1fae7441e1d', ) - assert.notOk(isValidPublic(pubKey), 'should fail wt.testh an invalid SEC1 public key') + assert.notOk(isValidPublic(pubKey), 'should fail wt.testh an invalid SEC1 public key') // cspell:disable-line pubKey = hexToBytes('0x03fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f') assert.notOk(isValidPublic(pubKey), 'should fail an invalid 33-byte public key') @@ -302,13 +302,13 @@ describe('Utility Functions', () => { pubKey = hexToBytes('0x033a443d8381a6798a70c6ff9304bdc8cb0163c23211d11628fae52ef9e0dca11a') assert.ok( isValidPublic(pubKey, true), - 'should work wt.testh compressed keys wt.testh sant.testize enabled', + 'should work wt.testh compressed keys wt.testh sant.testize enabled', // cspell:disable-line ) pubKey = hexToBytes( '0x043a443d8381a6798a70c6ff9304bdc8cb0163c23211d11628fae52ef9e0dca11a001cf066d56a8156fc201cd5df8a36ef694eecd258903fca7086c1fae7441e1d', ) - assert.ok(isValidPublic(pubKey, true), 'should work wt.testh sant.testize enabled') + assert.ok(isValidPublic(pubKey, true), 'should work wt.testh sant.testize enabled') // cspell:disable-line pubKey = hexToBytes( '0x3a443d8381a6798a70c6ff9304bdc8cb0163c23211d11628fae52ef9e0dca11a001cf066d56a8156fc201cd5df8a36ef694eecd258903fca7086c1fae7441e1d', @@ -340,7 +340,7 @@ describe('Utility Functions', () => { ), ), pubKey, - 'should work wt.testh an Ethereum public key', + 'should work wt.testh an Ethereum public key', // cspell:disable-line ) assert.equal( @@ -352,7 +352,7 @@ describe('Utility Functions', () => { ), ), pubKey, - 'should work wt.testh uncompressed SEC1 keys', + 'should work wt.testh uncompressed SEC1 keys', // cspell:disable-line ) assert.equal( @@ -362,7 +362,7 @@ describe('Utility Functions', () => { ), ), pubKey, - 'should work wt.testh compressed SEC1 keys', + 'should work wt.testh compressed SEC1 keys', // cspell:disable-line ) assert.throws( @@ -498,7 +498,9 @@ describe('Utility Functions', () => { ) }) + // cspell:disable it('generateAddress wt.testh nonce 0 (special case)', () => { + // cspell:enable const addr = generateAddress(toBytes('0x990ccf8a0de58091c028d6ff76bb235ee67c1c39'), toBytes(0)) assert.equal( bytesToHex(addr), @@ -507,7 +509,9 @@ describe('Utility Functions', () => { ) }) + // cspell:disable it('generateAddress wt.testh non-buffer inputs', () => { + // cspell:enable assert.throws( function () { generateAddress( @@ -602,7 +606,7 @@ describe('Utility Functions', () => { '0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', ] - const eip1191ChecksummAddresses = { + const eip1191ChecksumAddresses = { 1: [ '0x88021160c5C792225E4E5452585947470010289d', '0x27b1FdB04752bBc536007a920D24ACB045561c26', @@ -651,7 +655,7 @@ describe('Utility Functions', () => { describe('EIP1191', () => { it('Should encode the example addresses correctly', () => { - for (const [chainId, addresses] of Object.entries(eip1191ChecksummAddresses)) { + for (const [chainId, addresses] of Object.entries(eip1191ChecksumAddresses)) { for (const addr of addresses) { assert.equal(toChecksumAddress(addr.toLowerCase(), Number(chainId)), addr) assert.equal( @@ -712,7 +716,7 @@ describe('Utility Functions', () => { describe('EIP1191', () => { it('Should return true for the example addresses', () => { - for (const [chainId, addresses] of Object.entries(eip1191ChecksummAddresses)) { + for (const [chainId, addresses] of Object.entries(eip1191ChecksumAddresses)) { for (const addr of addresses) { assert.ok(isValidChecksumAddress(addr, Number(chainId))) assert.ok(isValidChecksumAddress(addr, intToBytes(parseInt(chainId)))) @@ -734,7 +738,7 @@ describe('Utility Functions', () => { }) it('Should return false if the wrong chain id is used', () => { - for (const [chainId, addresses] of Object.entries(eip1191ChecksummAddresses)) { + for (const [chainId, addresses] of Object.entries(eip1191ChecksumAddresses)) { for (const addr of addresses) { assert.notOk(isValidChecksumAddress(addr, Number(chainId) + 1)) } diff --git a/packages/util/test/bytes.spec.ts b/packages/util/test/bytes.spec.ts index 8f41e56dea..7f9ece488f 100644 --- a/packages/util/test/bytes.spec.ts +++ b/packages/util/test/bytes.spec.ts @@ -261,7 +261,7 @@ describe('toBytes', () => { assert.throws(() => toBytes('0xR'), '0xR') }) - it('should convert a TransformabletoBytes like the Address class (i.e. provides a toBytes method)', () => { + it('should convert a TransformableToBytes like the Address class (i.e. provides a toBytes method)', () => { const str = '0x2f015c60e0be116b1f0cd534704db9c92118fb6a' const address = createAddressFromString(str) const addressBytes = toBytes(address) @@ -330,7 +330,7 @@ describe('validateNoLeadingZeroes', () => { const noLeadingZeroes = { a: toBytes('0x123'), } - const noleadingZeroBytes = { + const noLeadingZeroBytes = { a: toBytes('0x01'), } const leadingZeroBytes = { @@ -361,7 +361,7 @@ describe('validateNoLeadingZeroes', () => { 'does not throw when undefined passed in', ) assert.doesNotThrow( - () => validateNoLeadingZeroes(noleadingZeroBytes), + () => validateNoLeadingZeroes(noLeadingZeroBytes), 'does not throw when value has leading zero bytes', ) }) @@ -455,7 +455,7 @@ describe('hexToBytes', () => { it('should throw on invalid hex', () => { assert.throws(() => { - hexToBytes('0xinvalidhexstring') + hexToBytes('0xInvalidHexString') }) assert.throws(() => { hexToBytes('0xfz') diff --git a/packages/util/test/provider.spec.ts b/packages/util/test/provider.spec.ts index bd20df314a..5a8eb08f84 100644 --- a/packages/util/test/provider.spec.ts +++ b/packages/util/test/provider.spec.ts @@ -86,7 +86,7 @@ describe('fetchFromProvider', () => { vi.unstubAllGlobals() }) - it('handles the corner case of res.text() failing because of a network error not recieving the full response', async () => { + it('handles the corner case of res.text() failing because of a network error not receiving the full response', async () => { vi.stubGlobal('fetch', async (_url: string, _req: any) => { return { text: async () => { diff --git a/packages/util/test/signature.spec.ts b/packages/util/test/signature.spec.ts index 7e05c34295..4bd493ea24 100644 --- a/packages/util/test/signature.spec.ts +++ b/packages/util/test/signature.spec.ts @@ -15,13 +15,13 @@ import { utf8ToBytes, } from '../src/index.js' -const echash = hexToBytes('0x82ff40c0a986c6a5cfad4ddf4c3aa6996f1a7837f9c398e17e5de5cbd5a12b28') -const ecprivkey = hexToBytes('0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1') +const ecHash = hexToBytes('0x82ff40c0a986c6a5cfad4ddf4c3aa6996f1a7837f9c398e17e5de5cbd5a12b28') +const ecPrivKey = hexToBytes('0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1') const chainId = BigInt(3) // ropsten describe('ecsign', () => { it('should produce a signature', () => { - const sig = ecsign(echash, ecprivkey) + const sig = ecsign(ecHash, ecPrivKey) assert.deepEqual( sig.r, hexToBytes('0x99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9'), @@ -34,7 +34,7 @@ describe('ecsign', () => { }) it('should produce a signature for Ropsten testnet', () => { - const sig = ecsign(echash, ecprivkey, chainId) + const sig = ecsign(ecHash, ecPrivKey, chainId) assert.deepEqual( sig.r, hexToBytes('0x99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9'), @@ -54,7 +54,7 @@ describe('ecsign', () => { '0x129ff05af364204442bdb53ab6f18a99ab48acc9326fa689f228040429e3ca66', ) - const sig = ecsign(echash, ecprivkey, BigInt(150)) + const sig = ecsign(ecHash, ecPrivKey, BigInt(150)) assert.deepEqual(sig.r, expectedSigR) assert.deepEqual(sig.s, expectedSigS) assert.equal(sig.v, BigInt(150 * 2 + 35)) @@ -70,7 +70,7 @@ describe('ecsign', () => { ) const expectedSigV = BigInt('68361967398315795') - const sigBuffer = ecsign(echash, ecprivkey, bytesToBigInt(chainIDBuffer)) + const sigBuffer = ecsign(ecHash, ecPrivKey, bytesToBigInt(chainIDBuffer)) assert.deepEqual(sigBuffer.r, expectedSigR) assert.deepEqual(sigBuffer.s, expectedSigS) assert.equal(sigBuffer.v, expectedSigV) @@ -82,50 +82,50 @@ describe('ecrecover', () => { const r = hexToBytes('0x99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9') const s = hexToBytes('0x129ff05af364204442bdb53ab6f18a99ab48acc9326fa689f228040429e3ca66') const v = BigInt(27) - const pubkey = ecrecover(echash, v, r, s) - assert.deepEqual(pubkey, privateToPublic(ecprivkey)) + const pubkey = ecrecover(ecHash, v, r, s) + assert.deepEqual(pubkey, privateToPublic(ecPrivKey)) }) it('should recover a public key (chainId = 3)', () => { const r = hexToBytes('0x99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9') const s = hexToBytes('0x129ff05af364204442bdb53ab6f18a99ab48acc9326fa689f228040429e3ca66') const v = BigInt(41) - const pubkey = ecrecover(echash, v, r, s, chainId) - assert.deepEqual(pubkey, privateToPublic(ecprivkey)) + const pubkey = ecrecover(ecHash, v, r, s, chainId) + assert.deepEqual(pubkey, privateToPublic(ecPrivKey)) }) it('should recover a public key (chainId = 150)', () => { const chainId = BigInt(150) const r = hexToBytes('0x99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9') const s = hexToBytes('0x129ff05af364204442bdb53ab6f18a99ab48acc9326fa689f228040429e3ca66') const v = BigInt(chainId * BigInt(2) + BigInt(35)) - const pubkey = ecrecover(echash, v, r, s, chainId) - assert.deepEqual(pubkey, privateToPublic(ecprivkey)) + const pubkey = ecrecover(ecHash, v, r, s, chainId) + assert.deepEqual(pubkey, privateToPublic(ecPrivKey)) }) it('should recover a public key (v = 0)', () => { const r = hexToBytes('0x99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9') const s = hexToBytes('0x129ff05af364204442bdb53ab6f18a99ab48acc9326fa689f228040429e3ca66') const v = BigInt(0) - const pubkey = ecrecover(echash, v, r, s) - assert.deepEqual(pubkey, privateToPublic(ecprivkey)) + const pubkey = ecrecover(ecHash, v, r, s) + assert.deepEqual(pubkey, privateToPublic(ecPrivKey)) }) it('should fail on an invalid signature (v = 21)', () => { const r = hexToBytes('0x99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9') const s = hexToBytes('0x129ff05af364204442bdb53ab6f18a99ab48acc9326fa689f228040429e3ca66') assert.throws(function () { - ecrecover(echash, BigInt(21), r, s) + ecrecover(ecHash, BigInt(21), r, s) }) }) it('should fail on an invalid signature (v = 29)', () => { const r = hexToBytes('0x99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9') const s = hexToBytes('0x129ff05af364204442bdb53ab6f18a99ab48acc9326fa689f228040429e3ca66') assert.throws(function () { - ecrecover(echash, BigInt(29), r, s) + ecrecover(ecHash, BigInt(29), r, s) }) }) it('should fail on an invalid signature (swapped points)', () => { const r = hexToBytes('0x99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9') const s = hexToBytes('0x129ff05af364204442bdb53ab6f18a99ab48acc9326fa689f228040429e3ca66') assert.throws(function () { - ecrecover(echash, BigInt(27), s, r) + ecrecover(ecHash, BigInt(27), s, r) }) }) it('should return the right sender when using very high chain id / v values', () => { diff --git a/packages/util/test/withdrawal.spec.ts b/packages/util/test/withdrawal.spec.ts index b090ac361c..2aa7754164 100644 --- a/packages/util/test/withdrawal.spec.ts +++ b/packages/util/test/withdrawal.spec.ts @@ -78,10 +78,10 @@ describe('Withdrawal', () => { }) it('toBytesArray from withdrawalData', () => { - const withdrawalsDatatoBytesArr = withdrawalsGethVector.map((withdrawal) => + const withdrawalsDataToBytesArr = withdrawalsGethVector.map((withdrawal) => Withdrawal.toBytesArray(withdrawal as WithdrawalData), ) - const withdrawalsDataToRlp = bytesToHex(encode(withdrawalsDatatoBytesArr)) + const withdrawalsDataToRlp = bytesToHex(encode(withdrawalsDataToBytesArr)) assert.equal(gethWithdrawalsRlp, withdrawalsDataToRlp, 'The withdrawals to buffer should match') }) diff --git a/packages/verkle/src/node/leafNode.ts b/packages/verkle/src/node/leafNode.ts index ceac0b02f4..1ce9704681 100644 --- a/packages/verkle/src/node/leafNode.ts +++ b/packages/verkle/src/node/leafNode.ts @@ -127,7 +127,7 @@ export class LeafNode extends BaseVerkleNode { case VerkleLeafNodeValue.Untouched: return undefined case VerkleLeafNodeValue.Deleted: - // Return zeroes if a value is "deleted" (i.e. overwitten with zeroes) + // Return zeroes if a value is "deleted" (i.e. overwritten with zeroes) return new Uint8Array(32) default: return value diff --git a/packages/vm/CHANGELOG.md b/packages/vm/CHANGELOG.md index cf444f8344..a95a47bc95 100644 --- a/packages/vm/CHANGELOG.md +++ b/packages/vm/CHANGELOG.md @@ -16,7 +16,7 @@ These new request types will be activated with the `Prague` hardfork, see [@ethe ### EIP-2935 Serve Historical Block Hashes from State (Prague) -Starting with this release the VM supports [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) which stores the latest 256 block hashes in the storage of a system contract, see PR [#3475](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3475) as the major integrational PR (while work on this has already been done in previous PRs). +Starting with this release the VM supports [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) which stores the latest 8192 block hashes in the storage of a system contract, see PR [#3475](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3475) as the major integration PR (while work on this has already been done in previous PRs). This EIP will be activated along the Prague hardfork. Note that this EIP has no effect on the resolution of the `BLOCKHASH` opcode, which will be a separate activation taking place by the integration of [EIP-7709](https://eips.ethereum.org/EIPS/eip-7709) in the following Osaka hardfork. @@ -57,7 +57,7 @@ An update to this release is therefore strongly recommended even if other fixes ### New EVM.create() Async Static Constructor / Mandatory VM.create() Constructor -This is an in-between breaking release on both the EVM and VM packages due to a problematic top level await() discovery in the underlying `rustbn-wasm` library (see issue [#10](https://github.com/ethereumjs/rustbn-wasm/issues/10)) generally affecting the compatiblity of our libraries. +This is an in-between breaking release on both the EVM and VM packages due to a problematic top level await() discovery in the underlying `rustbn-wasm` library (see issue [#10](https://github.com/ethereumjs/rustbn-wasm/issues/10)) generally affecting the compatibility of our libraries. The `EVM` direct constructor initialization with `new EVM()` now has been deprecated and replaced by an async static `create()` constructor, as it is already done in various other libraries in the EthereumJS monorepo, see PRs [#3304](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3304/) and [#3315](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3315). If you pass in a custom `EVM` along your `VM` initialization you **need to update your EVM initialization**. @@ -116,7 +116,7 @@ Since this fits well also to be placed here relatively prominently for awareness ## 7.2.1 - 2024-02-08 -- Hotfix release moving the `@ethereumjs/verkle` dependency for `@ethereumjs/statemanager` from a peer dependency to the main dependencis (note that this decision might be temporary) +- Hotfix release moving the `@ethereumjs/verkle` dependency for `@ethereumjs/statemanager` from a peer dependency to the main dependencies (note that this decision might be temporary) ## 7.2.0 - 2023-02-01 @@ -223,7 +223,7 @@ While you could use our libraries in the browser libraries before, there had bee WE HAVE ELIMINATED ALL OF THEM. -The largest two undertakings: First: we have rewritten all (half) of our API and elimited the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went throuh our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. +The largest two undertakings: First: we have rewritten all (half) of our API and eliminated the usage of Node.js specific `Buffer` all over the place and have rewritten with using `Uint8Array` byte objects. Second: we went through our whole stack, rewrote imports and exports, replaced and updated dependencies all over and are now able to provide a hybrid CommonJS/ESM build, for all libraries. Both of these things are huge. Together with some few other modifications this now allows to run each (maybe adding an asterisk for client and devp2p) of our libraries directly in the browser - more or less without any modifications - see the `examples/browser.html` file in each package folder for an easy to set up example. @@ -329,7 +329,7 @@ The `0x44` (old `DIFFICULTY`) opcode - is now named `PREVRANDAO` - starting with Genesis state was huge and had previously been bundled with the `Blockchain` package with the burden going over to the VM, since `Blockchain` is a dependency. -With this release genesis state has been removed from `blockchain` and moved into its own auxiliary package [@ethereumjs/genesis](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/genesis), from which it can be included if needed (for most - especially VM - use cases it is not neceesary), see PR [#2844](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2844). +With this release genesis state has been removed from `blockchain` and moved into its own auxiliary package [@ethereumjs/genesis](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/genesis), from which it can be included if needed (for most - especially VM - use cases it is not necessary), see PR [#2844](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2844). This goes along with some changes in Blockchain and VM API: @@ -529,7 +529,7 @@ The VM library is now ready to work with hardforks triggered by timestamp, which ### Bug Fixes and Other Changes -- More correctly timed `nonce` updates in `VM.runTx()` to avoid certain consensus-critical `nonce`/`account` update constallations. PR [#2404](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2404) +- More correctly timed `nonce` updates in `VM.runTx()` to avoid certain consensus-critical `nonce`/`account` update constellations. PR [#2404](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2404) A reminder: This package does not contain the core EVM code any more. For EVM related bugfixes see the associated [@ethereumjs/evm](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/evm) `v1.2.3` release. @@ -594,7 +594,7 @@ This is the biggest VM change in this release. The inheritance structure of both This allows for an easier typing of the inner `EVM` and makes the core VM/EVM classes leaner and not overloaded with various other partly unused properties. The new `events` property is optional. -Usage code of events needs to be slighly adopted and updated from: +Usage code of events needs to be slightly adopted and updated from: ```ts vm.on('beforeBlock', (val) => { @@ -619,7 +619,7 @@ vm.evm.events!.on('step', (e) => { ### Other Changes - Made `touchAccount` of `VMState` public, PR [#2183](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2183) -- **Pontentially breaking:** Removed `common` option from underlying `StateManager`, PR [#2197](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2197) +- **Potentially breaking:** Removed `common` option from underlying `StateManager`, PR [#2197](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2197) - Reworked/adjusted underlying EVM `skipBalance` option semantics, PR [#2138](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2138) - Fixed an underlying EVM event signature typing bug, PR [#2184](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2184) @@ -665,7 +665,7 @@ Beta 2 release for the upcoming breaking release round on the [EthereumJS monore ### Removed Default Exports -The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all accross the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. +The change with the biggest effect on UX since the last Beta 1 releases is for sure that we have removed default exports all across the monorepo, see PR [#2018](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2018), we even now added a new linting rule that completely disallows using. Default exports were a common source of error and confusion when using our libraries in a CommonJS context, leading to issues like Issue [#978](https://github.com/ethereumjs/ethereumjs-monorepo/issues/978). @@ -673,7 +673,7 @@ Now every import is a named import and we think the long term benefits will very #### Common Library Import Updates -Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all accross our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. +Since our [@ethereumjs/common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) library is used all across our libraries for chain and HF instantiation this will likely be the one being the most prevalent regarding the need for some import updates. So Common import and usage is changing from: @@ -921,7 +921,7 @@ Note that state in the VM is not activated by default (this also goes for accoun ### L2 Support: Custom Opcodes Option -There is now a new option `customOpcodes` for the VM which allows to add custom opcodes to the VM, see PR [#1705](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1705). This should be useful for L2s and other EVM based side chains if they come with a slighly different opcode set for bytecode execution. +There is now a new option `customOpcodes` for the VM which allows to add custom opcodes to the VM, see PR [#1705](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1705). This should be useful for L2s and other EVM based side chains if they come with a slightly different opcode set for bytecode execution. New opcodes can be passed in with its own logic function and an additional function for gas calculation. Additionally the new option allows for overwriting and/or deleting existing opcodes. @@ -1008,7 +1008,7 @@ invalid receiptTrie (vm hf=berlin -> block number=1 hash=0x8e368301586b53e30c58d The extended errors give substantial more object and chain context and should ease debugging. -**Potentially breaking**: Attention! If you do react on errors in your code and do exact errror matching (`error.message === 'invalid transaction trie'`) things will break. Please make sure to do error comparisons with something like `error.message.includes('invalid transaction trie')` instead. This should generally be the pattern used for all error message comparisions and is assured to be future proof on all error messages (we won't change the core text in non-breaking releases). +**Potentially breaking**: Attention! If you do react on errors in your code and do exact error matching (`error.message === 'invalid transaction trie'`) things will break. Please make sure to do error comparisons with something like `error.message.includes('invalid transaction trie')` instead. This should generally be the pattern used for all error message comparisons and is assured to be future proof on all error messages (we won't change the core text in non-breaking releases). ### Other Changes @@ -1127,7 +1127,7 @@ There is a new EVM Object Format (EOF) in preparation which will allow to valida ### StateManager: Preserve State History -This VM release bumps the `merkle-patricia-tree` dependeny to `v4.2.0`, which is used as a datastore for the default `StateManager` implementation. The new MPT version switches to a default behavior to not delete any trie nodes on checkpoint commits, which has implications on the `StateManager.commit()` function which internally calls the MPT commit. This allows to go back to older trie states by setting a new (old) state root with `StateManager.setStateRoot()`. The trie state is now guaranteed to still be consistent and complete, which has not been the case before and lead to erraneous behaviour in certain usage scenarios (e.g. reported by HardHat). +This VM release bumps the `merkle-patricia-tree` dependency to `v4.2.0`, which is used as a datastore for the default `StateManager` implementation. The new MPT version switches to a default behavior to not delete any trie nodes on checkpoint commits, which has implications on the `StateManager.commit()` function which internally calls the MPT commit. This allows to go back to older trie states by setting a new (old) state root with `StateManager.setStateRoot()`. The trie state is now guaranteed to still be consistent and complete, which has not been the case before and lead to erroneous behaviour in certain usage scenarios (e.g. reported by HardHat). See PR [#1262](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1262) @@ -1148,7 +1148,7 @@ See PR [#1168](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1168) ## 5.3.2 - 2021-04-12 -This is a hot-fix performance release, removing the `debug` functionality from PR [#1080](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1080) and follow-up PRs. While highly useful for debugging, this feature side-introduced a siginficant reduction in VM performance which went along unnoticed. For now we will remove since upstream dependencies are awaiting a new release before the `Belin` HF happening. We will try to re-introduce in a performance friendly manner in some subsequent release (we cannot promise on that though). +This is a hot-fix performance release, removing the `debug` functionality from PR [#1080](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1080) and follow-up PRs. While highly useful for debugging, this feature side-introduced a significant reduction in VM performance which went along unnoticed. For now we will remove since upstream dependencies are awaiting a new release before the `Berlin` HF happening. We will try to re-introduce in a performance friendly manner in some subsequent release (we cannot promise on that though). See PR [#1198](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1198). @@ -1262,7 +1262,7 @@ If you are using this library in conjunction with other EthereumJS libraries mak ### Other Features - `{ stateRoot, gasUsed, logsBloom, receiptRoot }` have been added to `RunBlockResult` and will be emitted with `afterBlock`, PR [#853](https://github.com/ethereumjs/ethereumjs-monorepo/pull/853) -- Added `vm:eei:gas` EEI gas debug looger, PR [#1124](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1124) +- Added `vm:eei:gas` EEI gas debug logger, PR [#1124](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1124) ### Other Fixes @@ -1389,7 +1389,7 @@ const common = new Common({ chain: 'mainnet', hardfork: 'spuriousDragon' }) const vm = new VM({ common }) ``` -**Breaking**: The default HF from the VM has been updated from `petersburg` to `istanbul`. The HF setting is now automatically taken from the HF set for `Common.DEAULT_HARDFORK`, see PR [#906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/906). +**Breaking**: The default HF from the VM has been updated from `petersburg` to `istanbul`. The HF setting is now automatically taken from the HF set for `Common.DEFAULT_HARDFORK`, see PR [#906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/906). **Breaking**: Please note that the options to directly pass in `chain` and `hardfork` strings have been removed to simplify the API. Providing a `Common` instance is now the only way to change the chain setup, see PR [#863](https://github.com/ethereumjs/ethereumjs-monorepo/pull/863) @@ -1442,7 +1442,7 @@ The Util package also introduces a new [Address class](https://github.com/ethere We significantly updated our internal tool and CI setup along the work on PR [#913](https://github.com/ethereumjs/ethereumjs-monorepo/pull/913) with an update to `ESLint` from `TSLint` for code linting and formatting and the introduction of a new build setup. -Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes @@ -1543,7 +1543,7 @@ const vm = new VM({ common }) ``` **Breaking**: The default HF from the VM has been updated from `petersburg` to `istanbul`. -The HF setting is now automatically taken from the HF set for `Common.DEAULT_HARDFORK`, +The HF setting is now automatically taken from the HF set for `Common.DEFAULT_HARDFORK`, see PR [#906](https://github.com/ethereumjs/ethereumjs-monorepo/pull/906). **Breaking**: Please note that the options to directly pass in @@ -1632,7 +1632,7 @@ for code linting and formatting and the introduction of a new build setup. Packages now target `ES2017` for Node.js builds (the `main` entrypoint from `package.json`) and introduce a separate `ES5` build distributed along using the `browser` directive as an entrypoint, see PR [#921](https://github.com/ethereumjs/ethereumjs-monorepo/pull/921). This will result -in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a releated discussion. +in performance benefits for Node.js consumers, see [here](https://github.com/ethereumjs/merkle-patricia-tree/pull/117) for a related discussion. ### Other Changes @@ -1925,7 +1925,7 @@ These will be the main release notes for the `v4` feature updates, subsequent `beta` releases and the final release will just publish the delta changes and point here for reference. -Breaking changes in the release notes are preeceeded with `[BREAKING]`, do a +Breaking changes in the release notes are preceded with `[BREAKING]`, do a search for an overview. The outstanding work of [@s1na](https://github.com/s1na) has to be mentioned @@ -2331,7 +2331,7 @@ The `StateManager` (`lib/stateManager.js`) - providing a high-level interface to This comes along with larger refactoring work throughout more-or-less the whole code base and the `StateManager` now completely encapsulates the trie structure and the cache backend used, see issue [#268](https://github.com/ethereumjs/ethereumjs-monorepo/issues/268) and associated PRs for reference. This will make it much easier in the future to bring along an own state manager serving special needs (optimized for memory and performance, run on mobile,...) by e.g. using a different trie implementation, cache or underlying storage or database backend. -We plan to completely separate the currently still integrated state manager into its own repository in one of the next releases, this will then be a breaking `v3.0.0` release. Discussion around a finalized interface (we might e.g. drop all genesis-releated methods respectively methods implemented in the `DefaultStateManager`) is still ongoing and you are very much invited to jump in and articulate your needs, just take e.g. the issue mentioned above as an entry point. +We plan to completely separate the currently still integrated state manager into its own repository in one of the next releases, this will then be a breaking `v3.0.0` release. Discussion around a finalized interface (we might e.g. drop all genesis-related methods respectively methods implemented in the `DefaultStateManager`) is still ongoing and you are very much invited to jump in and articulate your needs, just take e.g. the issue mentioned above as an entry point. Change related to the new `StateManager` interface: @@ -2397,7 +2397,7 @@ making the start being introduced in the `v2.4.0` release. Since both the scope of the `Constantinople` hardfork as well as the state of at least some of the EIPs to be included are not yet finalized, this is only meant for `EXPERIMENTAL` purposes, e.g. for developer -tools to give users early access and make themself familiar with dedicated features. +tools to give users early access and make themselves familiar with dedicated features. Once scope and EIPs from `Constantinople` are final we will target a `v2.5.0` release which will officially introduce `Constantinople` support with all the changes bundled together. @@ -2414,7 +2414,7 @@ All the changes from this release: **FEATURES/FUNCTIONALITY** - Improved chain and fork support, see PR [#304](https://github.com/ethereumjs/ethereumjs-monorepo/pull/304) -- Support for the `Constantinople` bitwise shifiting instructions `SHL`, `SHR` and `SAR`, see PR [#251](https://github.com/ethereumjs/ethereumjs-monorepo/pull/251) +- Support for the `Constantinople` bitwise shifting instructions `SHL`, `SHR` and `SAR`, see PR [#251](https://github.com/ethereumjs/ethereumjs-monorepo/pull/251) - New `newContract` event which can be used to do interrupting tasks on contract/address creation, see PR [#306](https://github.com/ethereumjs/ethereumjs-monorepo/pull/306) - Alignment of behavior of bloom filter hashing to go along with mainnet compatible clients _BREAKING_, see PR [#295](https://github.com/ethereumjs/ethereumjs-monorepo/pull/295) diff --git a/packages/vm/README.md b/packages/vm/README.md index 7cca9d89b3..8809920c1e 100644 --- a/packages/vm/README.md +++ b/packages/vm/README.md @@ -223,7 +223,7 @@ const main = async () => { const vm = await VM.create({ common, setHardfork: true }) const block = Block.fromRPC(goerliBlock2, undefined, { common }) - const result = await vm.runBlock({ block, generate: true, skipHeaderValidation: true }) // we skip header validaiton since we are running a block without the full Ethereum history available + const result = await vm.runBlock({ block, generate: true, skipHeaderValidation: true }) // we skip header validation since we are running a block without the full Ethereum history available console.log(`The state root for Goerli block 2 is ${bytesToHex(result.stateRoot)}`) } @@ -326,7 +326,7 @@ Note: Things move fast with `EIP-7702` and the currently released implementation ### EIP-7685 Requests Support -This libary supports blocks including the following [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685) requests: +This library supports blocks including the following [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685) requests: - [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110) - Deposit Requests (`v7.3.0`+) - [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002) - Withdrawal Requests (`v7.3.0`+) @@ -334,7 +334,7 @@ This libary supports blocks including the following [EIP-7685](https://eips.ethe ### EIP-2935 Serve Historical Block Hashes from State (Prague) -Starting with `v8.1.0` the VM supports [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) which stores the latest 8192 block hashes in the storage of a system contract, see PR [#3475](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3475) as the major integrational PR (while work on this has already been done in previous PRs). +Starting with `v8.1.0` the VM supports [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) which stores the latest 8192 block hashes in the storage of a system contract, see PR [#3475](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3475) as the major integration PR (while work on this has already been done in previous PRs). This EIP will be activated along the Prague hardfork. Note that this EIP has no effect on the resolution of the `BLOCKHASH` opcode, which will be a separate activation taking place by the integration of [EIP-7709](https://eips.ethereum.org/EIPS/eip-7709) in the following Osaka hardfork. diff --git a/packages/vm/benchmarks/mockchain.ts b/packages/vm/benchmarks/mockchain.ts index fb413978d1..0318176c8a 100644 --- a/packages/vm/benchmarks/mockchain.ts +++ b/packages/vm/benchmarks/mockchain.ts @@ -9,10 +9,10 @@ export class Mockchain { async _init() {} getBlock(num: bigint): any { - const bhash = this._hashes[num.toString()] + const bHash = this._hashes[num.toString()] return { hash() { - return bhash + return bHash }, } } diff --git a/packages/vm/examples/helpers/tx-builder.ts b/packages/vm/examples/helpers/tx-builder.ts index c859cb3152..e0117c6680 100644 --- a/packages/vm/examples/helpers/tx-builder.ts +++ b/packages/vm/examples/helpers/tx-builder.ts @@ -1,4 +1,4 @@ -import { defaultAbiCoder as AbiCoder, Interface } from '@ethersproject/abi' +import { defaultAbiCoder as AbiCoder, Interface } from '@ethersproject/abi' // cspell:disable-line import type { LegacyTxData } from '@ethereumjs/tx' diff --git a/packages/vm/examples/run-solidity-contract.ts b/packages/vm/examples/run-solidity-contract.ts index 1f5e49680e..237b50c0fd 100644 --- a/packages/vm/examples/run-solidity-contract.ts +++ b/packages/vm/examples/run-solidity-contract.ts @@ -3,7 +3,7 @@ import { Common, Hardfork, Mainnet } from '@ethereumjs/common' import { createLegacyTx } from '@ethereumjs/tx' import { bytesToHex, createAddressFromPrivateKey, hexToBytes } from '@ethereumjs/util' import { VM, runTx } from '@ethereumjs/vm' -import { defaultAbiCoder as AbiCoder, Interface } from '@ethersproject/abi' +import { defaultAbiCoder as AbiCoder, Interface } from '@ethersproject/abi' // cspell:disable-line import { readFileSync } from 'fs' import path from 'path' import solc from 'solc' @@ -15,7 +15,7 @@ import { buildTransaction, encodeDeployment, encodeFunction } from './helpers/tx import type { Address } from '@ethereumjs/util' const INITIAL_GREETING = 'Hello, World!' -const SECOND_GREETING = 'Hola, Mundo!' +const SECOND_GREETING = 'Hola, Mundo!' // cspell:disable-line const common = new Common({ chain: Mainnet, hardfork: Hardfork.Istanbul }) const block = createBlock({ header: { extraData: new Uint8Array(97) } }, { common }) diff --git a/packages/vm/examples/runGoerliBlock.ts b/packages/vm/examples/runGoerliBlock.ts index 855ebd407b..ff97e13316 100644 --- a/packages/vm/examples/runGoerliBlock.ts +++ b/packages/vm/examples/runGoerliBlock.ts @@ -12,7 +12,7 @@ const main = async () => { const vm = await VM.create({ common, setHardfork: true }) const block = createBlockFromRPC(goerliBlock2, undefined, { common }) - const result = await runBlock(vm, { block, generate: true, skipHeaderValidation: true }) // we skip header validaiton since we are running a block without the full Ethereum history available + const result = await runBlock(vm, { block, generate: true, skipHeaderValidation: true }) // we skip header validation since we are running a block without the full Ethereum history available console.log(`The state root for Goerli block 2 is ${bytesToHex(result.stateRoot)}`) } diff --git a/packages/vm/src/buildBlock.ts b/packages/vm/src/buildBlock.ts index 255acdd643..5ce32f1ddb 100644 --- a/packages/vm/src/buildBlock.ts +++ b/packages/vm/src/buildBlock.ts @@ -62,7 +62,7 @@ export class BlockBuilder { blobGasUsed = BIGINT_0 /** * Value of the block, represented by the final transaction fees - * acruing to the miner. + * accruing to the miner. */ private _minerValue = BIGINT_0 diff --git a/packages/vm/src/emitEVMProfile.ts b/packages/vm/src/emitEVMProfile.ts index c06140ca3a..c60342f89b 100644 --- a/packages/vm/src/emitEVMProfile.ts +++ b/packages/vm/src/emitEVMProfile.ts @@ -56,7 +56,7 @@ export function emitEVMProfile(logs: EVMPerformanceLogOutput[], profileTitle: st return padStr(str, 0).length - 2 } - // Step one: calculate the length of each colum + // Step one: calculate the length of each column const colLength: number[] = [] for (const entry of logs) { diff --git a/packages/vm/src/params.ts b/packages/vm/src/params.ts index 3ee5fd980c..1d3a576b2c 100644 --- a/packages/vm/src/params.ts +++ b/packages/vm/src/params.ts @@ -20,7 +20,7 @@ export const paramsVM: ParamsDict = { minerReward: '3000000000000000000', // the amount a miner get rewarded for mining a block }, /** -. * Constantinope HF Meta EIP +. * Constantinople HF Meta EIP . */ 1013: { // pow @@ -61,7 +61,7 @@ export const paramsVM: ParamsDict = { . */ 4788: { // config - historicalRootsLength: 8191, // The modulo parameter of the beaconroot ring buffer in the beaconroot statefull precompile + historicalRootsLength: 8191, // The modulo parameter of the beaconroot ring buffer in the beaconroot stateful precompile }, /** * Ethereum state using a unified verkle tree (experimental) diff --git a/packages/vm/src/requests.ts b/packages/vm/src/requests.ts index 522d63f1f6..52baccb219 100644 --- a/packages/vm/src/requests.ts +++ b/packages/vm/src/requests.ts @@ -176,9 +176,9 @@ const accumulateDeposits = async ( // 5. Repeat steps 3-4 for each field const pubKeyIdx = bytesToInt(log[2].slice(0, 32)) const pubKeySize = bytesToInt(log[2].slice(pubKeyIdx, pubKeyIdx + 32)) - const withdrawalCredsIdx = bytesToInt(log[2].slice(32, 64)) - const withdrawalCredsSize = bytesToInt( - log[2].slice(withdrawalCredsIdx, withdrawalCredsIdx + 32), + const withdrawalCreditsIdx = bytesToInt(log[2].slice(32, 64)) + const withdrawalCreditsSize = bytesToInt( + log[2].slice(withdrawalCreditsIdx, withdrawalCreditsIdx + 32), ) const amountIdx = bytesToInt(log[2].slice(64, 96)) const amountSize = bytesToInt(log[2].slice(amountIdx, amountIdx + 32)) @@ -188,8 +188,8 @@ const accumulateDeposits = async ( const indexSize = bytesToInt(log[2].slice(indexIdx, indexIdx + 32)) const pubkey = log[2].slice(pubKeyIdx + 32, pubKeyIdx + 32 + pubKeySize) const withdrawalCredentials = log[2].slice( - withdrawalCredsIdx + 32, - withdrawalCredsIdx + 32 + withdrawalCredsSize, + withdrawalCreditsIdx + 32, + withdrawalCreditsIdx + 32 + withdrawalCreditsSize, ) const amountBytes = log[2].slice(amountIdx + 32, amountIdx + 32 + amountSize) const amountBytesBigEndian = new Uint8Array([ diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index 3c637932a6..f7e7b20aea 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -497,7 +497,7 @@ export async function accumulateParentBlockHash( const historyAddress = new Address(bigIntToAddressBytes(vm.common.param('historyStorageAddress'))) const historyServeWindow = vm.common.param('historyServeWindow') - // getAccount with historyAddress will throw error as witnesses are not bundeled + // getAccount with historyAddress will throw error as witnesses are not bundled // but we need to put account so as to query later for slot try { if ((await vm.stateManager.getAccount(historyAddress)) === undefined) { @@ -541,7 +541,7 @@ export async function accumulateParentBeaconBlockRoot(vm: VM, root: Uint8Array, /** * Note: (by Jochem) - * If we don't do vm (put account if undefined / non-existant), block runner crashes because the beacon root address does not exist + * If we don't do vm (put account if undefined / non-existent), block runner crashes because the beacon root address does not exist * vm is hence (for me) again a reason why it should /not/ throw if the address does not exist * All ethereum accounts have empty storage by default */ diff --git a/packages/vm/src/runTx.ts b/packages/vm/src/runTx.ts index 6e057b3388..f7432e1c37 100644 --- a/packages/vm/src/runTx.ts +++ b/packages/vm/src/runTx.ts @@ -425,7 +425,7 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise { const writtenAddresses = new Set() if (tx.supports(Capability.EIP7702EOACode)) { - // Add contract code for authroity tuples provided by EIP 7702 tx + // Add contract code for authority tuples provided by EIP 7702 tx const authorizationList = (tx).authorizationList const MAGIC = new Uint8Array([5]) for (let i = 0; i < authorizationList.length; i++) { diff --git a/packages/vm/src/types.ts b/packages/vm/src/types.ts index cb736c3a0c..3171143edf 100644 --- a/packages/vm/src/types.ts +++ b/packages/vm/src/types.ts @@ -64,7 +64,7 @@ export interface EIP4844BlobTxReceipt extends PostByzantiumTxReceipt { /** * blob gas price for block transaction was included in * - * Note: This valus is not included in the `receiptRLP` used for encoding the `receiptsRoot` in a block + * Note: This values is not included in the `receiptRLP` used for encoding the `receiptsRoot` in a block * and is only provided as part of receipt metadata. */ blobGasPrice: bigint diff --git a/packages/vm/src/vm.ts b/packages/vm/src/vm.ts index d523f1ac28..0b69e3dfe0 100644 --- a/packages/vm/src/vm.ts +++ b/packages/vm/src/vm.ts @@ -182,7 +182,7 @@ export class VM { * * Associated caches will be deleted and caches will be re-initialized for a more short-term focused * usage, being less memory intense (the statemanager caches will switch to using an ORDERED_MAP cache - * datastructure more suitable for short-term usage, the trie node LRU cache will not be activated at all). + * data structure more suitable for short-term usage, the trie node LRU cache will not be activated at all). * To fine-tune this behavior (if the shallow-copy-returned object has a longer life span e.g.) you can set * the `downlevelCaches` option to `false`. * diff --git a/packages/vm/test/api/EIPs/eip-2929.spec.ts b/packages/vm/test/api/EIPs/eip-2929.spec.ts index d5d1c8b59c..7982c8eb20 100644 --- a/packages/vm/test/api/EIPs/eip-2929.spec.ts +++ b/packages/vm/test/api/EIPs/eip-2929.spec.ts @@ -209,7 +209,7 @@ describe('EIP 2929: gas cost tests', () => { }) // Calls the `identity`-precompile (cheap), then calls an account (expensive) - // and `staticcall`s the sameaccount (cheap) + // and `staticcall`s the same account (cheap) it('should charge for pre-compiles and staticcalls correctly', async () => { const test = { code: '0x60008080808060046000f15060008080808060ff6000f15060008080808060ff6000fa5000', diff --git a/packages/vm/test/api/EIPs/eip-2935-historical-block-hashes.spec.ts b/packages/vm/test/api/EIPs/eip-2935-historical-block-hashes.spec.ts index 30ccd89911..4d20f65691 100644 --- a/packages/vm/test/api/EIPs/eip-2935-historical-block-hashes.spec.ts +++ b/packages/vm/test/api/EIPs/eip-2935-historical-block-hashes.spec.ts @@ -137,8 +137,8 @@ describe('EIP 2935: historical block hashes', () => { await vm.stateManager.putCode(historyAddress, contract2935Code) const result = await runTx(vm, { tx, block, skipHardForkValidation: true }) - const blockHashi = result.execResult.returnValue - return blockHashi + const blockHash = result.execResult.returnValue + return blockHash } it(`should validate the deployment tx`, async () => { @@ -264,7 +264,7 @@ describe('EIP 2935: historical block hashes', () => { block: lastBlock, }) - // contract will only have hashes between blocksActivation -1 and blocksToBuild -1 thresholded by + // contract will only have hashes between blocksActivation -1 and blocksToBuild -1 threshold by // historyServeWindow window if ( i >= blocksActivation - 1 && @@ -296,15 +296,15 @@ describe('EIP 2935: historical block hashes', () => { // should be able to resolve blockhash via contract code but from the blocksActivation -1 onwards for (const i of [blocksActivation - 1, blocksActivation, blocksToBuild - 1]) { - const blockHashi = await testBlockhashContract(vm, block, BigInt(i)) - const blocki = await blockchain.getBlock(i) - assert.ok(equalsBytes(blockHashi, blocki.hash())) + const blockHashI = await testBlockhashContract(vm, block, BigInt(i)) + const blockI = await blockchain.getBlock(i) + assert.ok(equalsBytes(blockHashI, blockI.hash())) } // should be able to return 0 if input >= current block for (const i of [blocksToBuild, blocksToBuild + 100]) { - const blockHashi = await testBlockhashContract(vm, block, BigInt(i)) - assert.ok(equalsBytes(blockHashi, setLengthLeft(bigIntToBytes(BigInt(0)), 32))) + const blockHashI = await testBlockhashContract(vm, block, BigInt(i)) + assert.ok(equalsBytes(blockHashI, setLengthLeft(bigIntToBytes(BigInt(0)), 32))) } }) } diff --git a/packages/vm/test/api/EIPs/eip-3198-BaseFee.spec.ts b/packages/vm/test/api/EIPs/eip-3198-BaseFee.spec.ts index eb5ef687e5..4199eb8702 100644 --- a/packages/vm/test/api/EIPs/eip-3198-BaseFee.spec.ts +++ b/packages/vm/test/api/EIPs/eip-3198-BaseFee.spec.ts @@ -81,9 +81,9 @@ describe('EIP3198 tests', () => { // Track stack let stack: any = [] - vm.evm.events!.on('step', (istep: InterpreterStep) => { - if (istep.opcode.name === 'STOP') { - stack = istep.stack + vm.evm.events!.on('step', (iStep: InterpreterStep) => { + if (iStep.opcode.name === 'STOP') { + stack = iStep.stack } }) diff --git a/packages/vm/test/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts b/packages/vm/test/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts index f92f729b1d..26d3472296 100644 --- a/packages/vm/test/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts +++ b/packages/vm/test/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts @@ -23,9 +23,9 @@ describe('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', () => { // Track stack let stack: any = [] - vm.evm.events!.on('step', (istep: InterpreterStep) => { - if (istep.opcode.name === 'STOP') { - stack = istep.stack + vm.evm.events!.on('step', (iStep: InterpreterStep) => { + if (iStep.opcode.name === 'STOP') { + stack = iStep.stack } }) diff --git a/packages/vm/test/api/EIPs/eip-4788-beaconroot.spec.ts b/packages/vm/test/api/EIPs/eip-4788-beaconroot.spec.ts index 9b784b8c2b..6fad3808e1 100644 --- a/packages/vm/test/api/EIPs/eip-4788-beaconroot.spec.ts +++ b/packages/vm/test/api/EIPs/eip-4788-beaconroot.spec.ts @@ -135,7 +135,7 @@ async function runBlockTest(input: { timestampBlock: bigint // Timestamp of the block (this is saved in the precompile) blockRoot: bigint // Blockroot of the block (also saved in the precompile) extLeft?: number // Extend length left of the input (defaults to 32) - extRight?: number // Extend lenght right of the input (defaults to 32) - happens after extendLeft + extRight?: number // Extend length right of the input (defaults to 32) - happens after extendLeft expRet: bigint // Expected return value expCallStatus: bigint // Expected call status (either 0 or 1) }) { diff --git a/packages/vm/test/api/EIPs/eip-4895-withdrawals.spec.ts b/packages/vm/test/api/EIPs/eip-4895-withdrawals.spec.ts index c58c0dddfc..55b4764425 100644 --- a/packages/vm/test/api/EIPs/eip-4895-withdrawals.spec.ts +++ b/packages/vm/test/api/EIPs/eip-4895-withdrawals.spec.ts @@ -127,7 +127,7 @@ describe('EIP4895 tests', () => { assert.deepEqual(zeros(0), slotValue, 'withdrawals do not invoke code') }) - it('EIP4895: state updation should exclude 0 amount updates', async () => { + it('EIP4895: state update should exclude 0 amount updates', async () => { const vm = await VM.create({ common }) await vm.stateManager.generateCanonicalGenesis!(parseGethGenesisState(genesisJSON)) diff --git a/packages/vm/test/api/EIPs/eip-7002.spec.ts b/packages/vm/test/api/EIPs/eip-7002.spec.ts index 58ed2e9c70..7850812765 100644 --- a/packages/vm/test/api/EIPs/eip-7002.spec.ts +++ b/packages/vm/test/api/EIPs/eip-7002.spec.ts @@ -131,7 +131,7 @@ describe('EIP-7002 tests', () => { // Ensure the requests are correct assert.ok(equalsBytes(sourceAddressRequest, tx.getSenderAddress().bytes)) assert.ok(equalsBytes(validatorPubkey, validatorPubkeyRequest)) - // the direct byte comparision fails because leading zeros have been stripped + // the direct byte comparison fails because leading zeros have been stripped // off the amountBytes because it was serialized in request from bigint assert.equal(bytesToBigInt(amountBytes), bytesToBigInt(amountRequest)) diff --git a/packages/vm/test/api/bloom.spec.ts b/packages/vm/test/api/bloom.spec.ts index 7c52154a50..a8fb7da60f 100644 --- a/packages/vm/test/api/bloom.spec.ts +++ b/packages/vm/test/api/bloom.spec.ts @@ -12,7 +12,7 @@ describe('bloom', () => { assert.deepEqual(b.bitvector, utils.zeros(byteSize), 'should be empty') }) - it('shouldnt initialize with invalid bitvector', () => { + it("shouldn't initialize with invalid bitvector", () => { assert.throws( () => new Bloom(utils.zeros(byteSize / 2)), /bitvectors must be 2048 bits long/, @@ -31,7 +31,7 @@ describe('bloom', () => { assert.isTrue(b.check(utf8ToBytes('value 2')), 'should contain string "value 2"') }) - it('check shouldnt be tautology', () => { + it("check shouldn't be tautology", () => { const b = new Bloom() assert.isFalse(b.check(utf8ToBytes('random value')), 'should not contain string "random value"') }) diff --git a/packages/vm/test/api/buildBlock.spec.ts b/packages/vm/test/api/buildBlock.spec.ts index ad99c2c235..2d2bba53f5 100644 --- a/packages/vm/test/api/buildBlock.spec.ts +++ b/packages/vm/test/api/buildBlock.spec.ts @@ -268,7 +268,7 @@ describe('BlockBuilder', () => { 'block should be in reverted status', ) } catch (error: any) { - assert.fail('shoud not throw') + assert.fail('should not throw') } blockBuilder = await buildBlock(vm, { parentBlock: genesisBlock }) @@ -289,7 +289,7 @@ describe('BlockBuilder', () => { 'block should be in reverted status', ) } catch (error: any) { - assert.fail('shoud not throw') + assert.fail('should not throw') } }) diff --git a/packages/vm/test/api/customChain.spec.ts b/packages/vm/test/api/customChain.spec.ts index c1fd066733..bec1b7ea3c 100644 --- a/packages/vm/test/api/customChain.spec.ts +++ b/packages/vm/test/api/customChain.spec.ts @@ -8,7 +8,7 @@ import { createAddressFromString, hexToBytes, } from '@ethereumjs/util' -import { Interface } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' // cspell:disable-line import { assert, describe, it } from 'vitest' import { runTx } from '../../src/index.js' diff --git a/packages/vm/test/api/index.spec.ts b/packages/vm/test/api/index.spec.ts index dcd8e2f107..57fd219792 100644 --- a/packages/vm/test/api/index.spec.ts +++ b/packages/vm/test/api/index.spec.ts @@ -76,26 +76,26 @@ describe('VM -> Default EVM / Custom EVM Opts', () => { it('Default EVM should use VM common', async () => { const common = new Common({ chain: Mainnet, hardfork: Hardfork.Byzantium }) const vm = await VM.create({ common }) - assert.equal((vm.evm as EVM).common.hardfork(), 'byzantium', 'use modfied HF from VM common') + assert.equal((vm.evm as EVM).common.hardfork(), 'byzantium', 'use modified HF from VM common') const copiedVM = await vm.shallowCopy() assert.equal( (copiedVM.evm as EVM).common.hardfork(), 'byzantium', - 'use modfied HF from VM common (for shallowCopied VM)', + 'use modified HF from VM common (for shallowCopied VM)', ) }) it('Default EVM should prefer common from evmOpts if provided (same logic for blockchain, statemanager)', async () => { const common = new Common({ chain: Mainnet, hardfork: Hardfork.Byzantium }) const vm = await VM.create({ evmOpts: { common } }) - assert.equal((vm.evm as EVM).common.hardfork(), 'byzantium', 'use modfied HF from evmOpts') + assert.equal((vm.evm as EVM).common.hardfork(), 'byzantium', 'use modified HF from evmOpts') const copiedVM = await vm.shallowCopy() assert.equal( (copiedVM.evm as EVM).common.hardfork(), 'byzantium', - 'use modfied HF from evmOpts (for shallowCopied VM)', + 'use modified HF from evmOpts (for shallowCopied VM)', ) }) }) diff --git a/packages/vm/test/api/muirGlacier/index.spec.ts b/packages/vm/test/api/muirGlacier/index.spec.ts index 4a53c90a55..cd55690e1e 100644 --- a/packages/vm/test/api/muirGlacier/index.spec.ts +++ b/packages/vm/test/api/muirGlacier/index.spec.ts @@ -5,7 +5,7 @@ import { assert, describe, it } from 'vitest' import { VM } from '../../../src/index.js' describe('General MuirGlacier VM tests', () => { - it('should accept muirGlacier harfork option for supported chains', async () => { + it('should accept muirGlacier hardfork option for supported chains', async () => { const common = new Common({ chain: Mainnet, hardfork: Hardfork.MuirGlacier }) const vm = await VM.create({ common }) assert.ok(vm.stateManager) diff --git a/packages/vm/test/api/tester/tester.config.spec.ts b/packages/vm/test/api/tester/tester.config.spec.ts index 7dea44a143..62ce7fb441 100644 --- a/packages/vm/test/api/tester/tester.config.spec.ts +++ b/packages/vm/test/api/tester/tester.config.spec.ts @@ -8,7 +8,7 @@ describe('test runner config tests', () => { const common = getCommon('byzantium') assert.ok(common.hardfork() === Hardfork.Byzantium) }) - it('should initialize common with the right hardfork uppercased', () => { + it('should initialize common with the right hardfork upper-cased', () => { let common = getCommon('Byzantium') assert.ok(common.hardfork() === Hardfork.Byzantium) common = getCommon('BYZANTIUM') diff --git a/packages/vm/test/api/utils.ts b/packages/vm/test/api/utils.ts index ebcea00bb4..a5418227d6 100644 --- a/packages/vm/test/api/utils.ts +++ b/packages/vm/test/api/utils.ts @@ -94,7 +94,7 @@ export function getTransaction( txParams['maxPriorityFeePerGas'] = BigInt(10) } else if (txType === TransactionType.BlobEIP4844) { if (common.customCrypto?.kzg === undefined) { - throw new Error('kzg instance required to instantiate blobg txs') + throw new Error('kzg instance required to instantiate blob txs') } txParams['gasPrice'] = undefined txParams['maxFeePerGas'] = BigInt(1000000000) diff --git a/packages/wallet/CHANGELOG.md b/packages/wallet/CHANGELOG.md index d155728a9b..fb6000e71d 100644 --- a/packages/wallet/CHANGELOG.md +++ b/packages/wallet/CHANGELOG.md @@ -52,7 +52,7 @@ The wallet library has now also been integrated into the EthereumJS monorepo, se ### Removed default Exports -All default exports for the libraries have been removed since these cause reoccuring import problems under certain build and usage conditions. +All default exports for the libraries have been removed since these cause reoccurring import problems under certain build and usage conditions. So imports needs to be updated as follows: @@ -231,7 +231,7 @@ See also: PR [#117](https://github.com/ethereumjs/ethereumjs-wallet/pull/117) - Updated `ethereumjs-util` dependency from `v6` to [v7.0.2](https://github.com/ethereumjs/ethereumjs-util/releases/tag/v7.0.2 (stricter types), PR [#126](https://github.com/ethereumjs/ethereumjs-wallet/pull/126) -- Refactored `Wallet.deciperBuffer()`, +- Refactored `Wallet.deciperBuffer()`, PR [#82](https://github.com/ethereumjs/ethereumjs-wallet/pull/82) #### Development & CI @@ -313,7 +313,7 @@ Change Summary: - Support HD keys using `cryptocoinjs/hdkey` - Ensure private keys are valid according to the curve -- Support instantation with public keys +- Support instantiation with public keys - Support importing BIP32 xpub/xpriv - Only support Ethereum keys internally, non-strict mode for importing compressed ones - Thirdparty API doc improvements diff --git a/packages/wallet/src/hdkey.ts b/packages/wallet/src/hdkey.ts index b4fddac7ea..ea3794f2cb 100644 --- a/packages/wallet/src/hdkey.ts +++ b/packages/wallet/src/hdkey.ts @@ -1,3 +1,4 @@ +// cspell:ignore xprv xpub import { mnemonicToSeedSync } from 'ethereum-cryptography/bip39/index.js' import { HDKey } from 'ethereum-cryptography/hdkey.js' diff --git a/packages/wallet/src/thirdparty.ts b/packages/wallet/src/thirdparty.ts index 756e3aae15..568ab0b1d6 100644 --- a/packages/wallet/src/thirdparty.ts +++ b/packages/wallet/src/thirdparty.ts @@ -1,3 +1,4 @@ +// cspell:ignore ivsize cryptojs import { bytesToUtf8, concatBytes, unprefixedHexToBytes, utf8ToBytes } from '@ethereumjs/util' import { base64 } from '@scure/base' import { decrypt } from 'ethereum-cryptography/aes.js' @@ -44,12 +45,12 @@ function mergeEvpKdfOptsWithDefaults(opts?: Partial): EvpKdfOpts { * * Algorithm form https://www.openssl.org/docs/manmaster/crypto/EVP_BytesToKey.html * - * FIXME: not optimised at all + * FIXME: not optimized at all */ function evp_kdf(data: Uint8Array, salt: Uint8Array, opts?: Partial) { const params = mergeEvpKdfOptsWithDefaults(opts) - // A single EVP iteration, returns `D_i`, where block equlas to `D_(i-1)` + // A single EVP iteration, returns `D_i`, where block equals to `D_(i-1)` function iter(block: Uint8Array) { if (params.digest !== 'md5') throw new Error('Only md5 is supported in evp_kdf') let hash = md5.create() diff --git a/packages/wallet/src/wallet.ts b/packages/wallet/src/wallet.ts index b49cb56c98..d3e5b391a2 100644 --- a/packages/wallet/src/wallet.ts +++ b/packages/wallet/src/wallet.ts @@ -1,3 +1,4 @@ +// cspell:ignore uuidv kdfparams dklen xprv xpub import { bytesToHex, bytesToUnprefixedHex, @@ -565,7 +566,7 @@ export class Wallet { } /** - * Returns an Etherem Version 3 Keystore Format object representing the wallet + * Returns an Ethereum Version 3 Keystore Format object representing the wallet * * @param password The password used to encrypt the Keystore. * @param opts The options for the keystore. See [its spec](https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition) for more info. @@ -633,7 +634,7 @@ export class Wallet { public getV3Filename(timestamp?: number): string { /* * We want a timestamp like 2016-03-15T17-11-33.007598288Z. Date formatting - * is a pain in Javascript, everbody knows that. We could use moment.js, + * is a pain in Javascript, everybody knows that. We could use moment.js, * but decide to do it manually in order to save space. * * toJSON() returns a pretty close version, so let's use it. It is not UTC though,