From a5fbda35722512ccc3d7f55361c91f0633caa3a1 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 2 Sep 2021 12:11:54 +0200 Subject: [PATCH 01/44] VM: Make CodeHashes have a DB prefix in StateManager (#1438) * vm: add codeHash db prefix to stateManager * vm: tests: make tests use StateManager instead of trie at utilization vm: tests: remove now passing test from skipTests * vm: fix tests / fix runBlock/runBlockchain tests * vm: tests: fix cleaning up untouched accounts in tests * vm -> StateManager: added comment on CODEHASH_PREFIX Co-authored-by: holgerd77 --- packages/vm/src/state/stateManager.ts | 16 ++++- packages/vm/tests/api/runBlock.spec.ts | 10 +-- packages/vm/tests/api/runBlockchain.spec.ts | 4 +- .../vm/tests/api/state/stateManager.spec.ts | 69 +++++++++++++++++++ packages/vm/tests/tester/config.ts | 1 - .../tester/runners/BlockchainTestsRunner.ts | 5 +- .../tester/runners/GeneralStateTestsRunner.ts | 3 +- packages/vm/tests/util.ts | 36 +++++----- 8 files changed, 116 insertions(+), 28 deletions(-) diff --git a/packages/vm/src/state/stateManager.ts b/packages/vm/src/state/stateManager.ts index 9142cc96bef..29a5e317c6a 100644 --- a/packages/vm/src/state/stateManager.ts +++ b/packages/vm/src/state/stateManager.ts @@ -36,6 +36,16 @@ export type Proof = { storageProof: StorageProof[] } +/** + * Prefix to distinguish between a contract deployed with code `0x80` + * and `RLP([])` (also having the value `0x80`). + * + * Otherwise the creation of the code hash for the `0x80` contract + * will be the same as the hash of the empty trie which leads to + * misbehaviour in the underyling trie library. + */ +const CODEHASH_PREFIX = Buffer.from('c') + /** * Options for constructing a {@link StateManager}. */ @@ -119,7 +129,8 @@ export default class DefaultStateManager extends BaseStateManager implements Sta return } - await this._trie.db.put(codeHash, value) + const key = Buffer.concat([CODEHASH_PREFIX, codeHash]) + await this._trie.db.put(key, value) const account = await this.getAccount(address) if (this.DEBUG) { @@ -140,7 +151,8 @@ export default class DefaultStateManager extends BaseStateManager implements Sta if (!account.isContract()) { return Buffer.alloc(0) } - const code = await this._trie.db.get(account.codeHash) + const key = Buffer.concat([CODEHASH_PREFIX, account.codeHash]) + const code = await this._trie.db.get(key) return code ?? Buffer.alloc(0) } diff --git a/packages/vm/tests/api/runBlock.spec.ts b/packages/vm/tests/api/runBlock.spec.ts index 8d835e6d754..ceffbddefec 100644 --- a/packages/vm/tests/api/runBlock.spec.ts +++ b/packages/vm/tests/api/runBlock.spec.ts @@ -29,7 +29,7 @@ tape('runBlock() -> successful API parameter usage', async (t) => { const block = Block.fromRLPSerializedBlock(blockRlp) //@ts-ignore - await setupPreConditions(vm.stateManager._trie, testData) + await setupPreConditions(vm.stateManager, testData) st.ok( //@ts-ignore @@ -55,7 +55,7 @@ tape('runBlock() -> successful API parameter usage', async (t) => { const testData = require('./testdata/uncleData.json') //@ts-ignore - await setupPreConditions(vm.stateManager._trie, testData) + await setupPreConditions(vm.stateManager, testData) const block1Rlp = testData.blocks[0].rlp const block1 = Block.fromRLPSerializedBlock(block1Rlp) @@ -264,7 +264,7 @@ tape('runBlock() -> runtime behavior', async (t) => { block1[0][12] = Buffer.from('dao-hard-fork') const block = Block.fromValuesArray(block1) // @ts-ignore - await setupPreConditions(vm.stateManager._trie, testData) + await setupPreConditions(vm.stateManager, testData) // fill two original DAO child-contracts with funds and the recovery account with funds in order to verify that the balance gets summed correctly const fundBalance1 = new BN(Buffer.from('1111', 'hex')) @@ -404,7 +404,7 @@ async function runWithHf(hardfork: string) { const block = Block.fromRLPSerializedBlock(blockRlp) // @ts-ignore - await setupPreConditions(vm.stateManager._trie, testData) + await setupPreConditions(vm.stateManager, testData) const res = await vm.runBlock({ block, @@ -449,7 +449,7 @@ tape('runBlock() -> tx types', async (t) => { } //@ts-ignore - await setupPreConditions(vm.stateManager._trie, testData) + await setupPreConditions(vm.stateManager, testData) const res = await vm.runBlock({ block, diff --git a/packages/vm/tests/api/runBlockchain.spec.ts b/packages/vm/tests/api/runBlockchain.spec.ts index b3ef2bb3044..fe32d0d2af3 100644 --- a/packages/vm/tests/api/runBlockchain.spec.ts +++ b/packages/vm/tests/api/runBlockchain.spec.ts @@ -71,7 +71,7 @@ tape('runBlockchain', (t) => { const head = await vm.blockchain.getHead() st.equal(head.hash().toString('hex'), testData.blocks[0].blockHeader.hash.slice(2)) - await setupPreConditions((vm.stateManager as DefaultStateManager)._trie, testData) + await setupPreConditions(vm.stateManager as DefaultStateManager, testData) vm.runBlock = async () => new Promise((resolve, reject) => reject(new Error('test'))) @@ -103,7 +103,7 @@ tape('runBlockchain', (t) => { const head = await vm.blockchain.getHead() st.equal(head.hash().toString('hex'), testData.blocks[0].blockHeader.hash.slice(2)) - await setupPreConditions((vm.stateManager as DefaultStateManager)._trie, testData) + await setupPreConditions(vm.stateManager as DefaultStateManager, testData) await vm.runBlockchain() diff --git a/packages/vm/tests/api/state/stateManager.spec.ts b/packages/vm/tests/api/state/stateManager.spec.ts index e1136f5de14..bd6db734f5b 100644 --- a/packages/vm/tests/api/state/stateManager.spec.ts +++ b/packages/vm/tests/api/state/stateManager.spec.ts @@ -289,6 +289,75 @@ tape('StateManager', (t) => { st.fail('Should have failed') st.end() }) + + t.test('should store codehashes using a prefix', async (st) => { + /* + This test is mostly an example of why a code prefix is necessary + I an address, we put two storage values. The preimage of the (storage trie) root hash is known + This preimage is used as codeHash + + NOTE: Currently, the only problem which this code prefix fixes, is putting 0x80 as contract code + -> This hashes to the empty trie node hash (0x80 = RLP([])), so keccak256(0x80) = empty trie node hash + -> Therefore, each empty state trie now points to 0x80, which is not a valid trie node, which crashes @ethereumjs/trie + */ + + // Setup + const stateManager = new DefaultStateManager() + const codeStateManager = new DefaultStateManager() + const address1 = new Address(Buffer.from('a94f5374fce5edbc8e2a8697c15331677e6ebf0b', 'hex')) + const key1 = Buffer.from('00'.repeat(32), 'hex') + const key2 = Buffer.from('00'.repeat(31) + '01', 'hex') + + await stateManager.putContractStorage(address1, key1, key2) + await stateManager.putContractStorage(address1, key2, key2) + const root = await stateManager.getStateRoot() + const rawNode = await stateManager._trie.db.get(root) + + await codeStateManager.putContractCode(address1, rawNode!) + + let codeSlot1 = await codeStateManager.getContractStorage(address1, key1) + let codeSlot2 = await codeStateManager.getContractStorage(address1, key2) + + st.ok(codeSlot1.length == 0, 'slot 0 is empty') + st.ok(codeSlot2.length == 0, 'slot 1 is empty') + + const code = await codeStateManager.getContractCode(address1) + st.ok(code.length > 0, 'code deposited correctly') + + const slot1 = await stateManager.getContractStorage(address1, key1) + const slot2 = await stateManager.getContractStorage(address1, key2) + + st.ok(slot1.length > 0, 'storage key0 deposited correctly') + st.ok(slot2.length > 0, 'storage key1 deposited correctly') + + let slotCode = await stateManager.getContractCode(address1) + st.ok(slotCode.length == 0, 'code cannot be loaded') + + // Checks by either setting state root to codeHash, or codeHash to stateRoot + // The knowledge of the tries should not change + let account = await stateManager.getAccount(address1) + account.codeHash = root + + await stateManager.putAccount(address1, account) + + slotCode = await stateManager.getContractCode(address1) + st.ok(slotCode.length == 0, 'code cannot be loaded') // This test fails if no code prefix is used + + account = await codeStateManager.getAccount(address1) + console.log(account.codeHash.toString('hex')) + console.log(root.toString('hex')) + account.stateRoot = root + + await codeStateManager.putAccount(address1, account) + + codeSlot1 = await codeStateManager.getContractStorage(address1, key1) + codeSlot2 = await codeStateManager.getContractStorage(address1, key2) + + st.ok(codeSlot1.length == 0, 'slot 0 is empty') + st.ok(codeSlot2.length == 0, 'slot 1 is empty') + + st.end() + }) }) tape('Original storage cache', async (t) => { diff --git a/packages/vm/tests/tester/config.ts b/packages/vm/tests/tester/config.ts index 9c29932bf7c..59d8f9c3993 100644 --- a/packages/vm/tests/tester/config.ts +++ b/packages/vm/tests/tester/config.ts @@ -17,7 +17,6 @@ export const DEFAULT_FORK_CONFIG = 'Istanbul' export const SKIP_BROKEN = [ 'ForkStressTest', // Only BlockchainTest, temporary till fixed (2020-05-23) 'ChainAtoChainB', // Only BlockchainTest, temporary, along expectException fixes (2020-05-23) - 'undefinedOpcodeFirstByte', // https://github.com/ethereumjs/ethereumjs-monorepo/issues/1271 (2021-05-26) // In these tests, we have access to two forked chains. Their total difficulty is equal. There are errors in the second chain, but we have no reason to execute this chain if the TD remains equal. 'blockChainFrontierWithLargerTDvsHomesteadBlockchain2_FrontierToHomesteadAt5', diff --git a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts index 5000957cf15..724099cdfb1 100644 --- a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts +++ b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts @@ -79,7 +79,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: await blockchain.initPromise // set up pre-state - await setupPreConditions(vm.stateManager._trie, testData) + await setupPreConditions(vm.stateManager, testData) t.ok(vm.stateManager._trie.root.equals(genesisBlock.header.stateRoot), 'correct pre stateRoot') @@ -178,6 +178,9 @@ export default async function runBlockchainTest(options: any, testData: any, t: return } } catch (error: any) { + if (options.debug) { + await verifyPostConditions(state, testData.postState, t) + } // caught an error, reduce block number currentBlock.isubn(1) await handleError(error, expectException) diff --git a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts index d48c7552e34..bee8908056e 100644 --- a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts +++ b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts @@ -71,7 +71,8 @@ async function runTestCase(options: any, testData: any, t: tape.Test) { const state = new Trie() const vm = new VM({ state, common }) - await setupPreConditions(vm.stateManager._trie, testData) + await setupPreConditions(vm.stateManager, testData) + let execInfo = '' let tx diff --git a/packages/vm/tests/util.ts b/packages/vm/tests/util.ts index 7dede49a5c8..ec97bebe50a 100644 --- a/packages/vm/tests/util.ts +++ b/packages/vm/tests/util.ts @@ -15,7 +15,9 @@ import { stripHexPrefix, setLengthLeft, toBuffer, + Address, } from 'ethereumjs-util' +import { DefaultStateManager } from '../src/state' export function dumpState(state: any, cb: Function) { function readAccounts(state: any) { @@ -305,44 +307,46 @@ export function makeBlockFromEnv(env: any, opts?: BlockOptions): Block { * @param state - the state DB/trie * @param testData - JSON from tests repo */ -export async function setupPreConditions(state: any, testData: any) { +export async function setupPreConditions(state: DefaultStateManager, testData: any) { await state.checkpoint() - for (const address of Object.keys(testData.pre)) { - const { nonce, balance, code, storage } = testData.pre[address] + for (const addressStr of Object.keys(testData.pre)) { + const { nonce, balance, code, storage } = testData.pre[addressStr] + + const addressBuf = format(addressStr) + const address = new Address(addressBuf) - const addressBuf = format(address) const codeBuf = format(code) const codeHash = keccak256(codeBuf) - const storageTrie = state.copy(false) - storageTrie.root = null - // Set contract storage for (const storageKey of Object.keys(storage)) { const valBN = new BN(format(storage[storageKey]), 16) if (valBN.isZero()) { continue } - const val = rlp.encode(valBN.toArrayLike(Buffer, 'be')) + const val = valBN.toArrayLike(Buffer, 'be') const key = setLengthLeft(format(storageKey), 32) - await storageTrie.put(key, val) + await state.putContractStorage(address, key, val) } - const stateRoot = storageTrie.root + // Put contract code + await state.putContractCode(address, codeBuf) + + const stateRoot = (await state.getAccount(address)).stateRoot - if (testData.exec && testData.exec.address === address) { - testData.root = storageTrie.root + if (testData.exec && testData.exec.address === addressStr) { + testData.root = stateRoot } - // Put contract code - await state.db.put(codeHash, codeBuf) - // Put account data const account = Account.fromAccountData({ nonce, balance, codeHash, stateRoot }) - await state.put(addressBuf, account.serialize()) + await state.putAccount(address, account) } await state.commit() + // Clear the touched stack, otherwise untouched accounts in the block which are empty (>= SpuriousDragon) + // will get deleted from the state, resulting in state trie errors + ;(state)._touched.clear() } /** From 10b66a3ff3bea7dc7913511f9da9ec019546f013 Mon Sep 17 00:00:00 2001 From: Steven Luscher Date: Tue, 18 Jan 2022 00:44:25 -0800 Subject: [PATCH 02/44] Util: Remove `assert` in favor of simply throwing `Errors` (#1638) Co-authored-by: steveluscher --- packages/util/package.json | 1 - packages/util/src/account.ts | 13 +++++++++---- packages/util/src/address.ts | 29 +++++++++++++++++++++-------- packages/util/src/object.ts | 15 ++++++--------- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/packages/util/package.json b/packages/util/package.json index 19cdd7820b9..455e769603e 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -44,7 +44,6 @@ "rlp": "^2.2.4" }, "devDependencies": { - "@types/assert": "^1.5.4", "@types/node": "^16.11.7", "@types/secp256k1": "^4.0.1", "@types/tape": "^4.13.2", diff --git a/packages/util/src/account.ts b/packages/util/src/account.ts index 549fd5b59d0..358e4ffe75c 100644 --- a/packages/util/src/account.ts +++ b/packages/util/src/account.ts @@ -1,4 +1,3 @@ -import assert from 'assert' import { BN, rlp } from './externals' import { privateKeyVerify, @@ -214,8 +213,12 @@ export const generateAddress2 = function (from: Buffer, salt: Buffer, initCode: assertIsBuffer(salt) assertIsBuffer(initCode) - assert(from.length === 20) - assert(salt.length === 32) + if (from.length !== 20) { + throw new Error('Expected from to be of length 20') + } + if (salt.length !== 32) { + throw new Error('Expected salt to be of length 32') + } const address = keccak256( Buffer.concat([Buffer.from('ff', 'hex'), from, salt, keccak256(initCode)]) @@ -262,7 +265,9 @@ export const pubToAddress = function (pubKey: Buffer, sanitize: boolean = false) if (sanitize && pubKey.length !== 64) { pubKey = Buffer.from(publicKeyConvert(pubKey, false).slice(1)) } - assert(pubKey.length === 64) + if (pubKey.length !== 64) { + throw new Error('Expected pubKey to be of length 64') + } // Only take the lower 160bits of the hash return keccak(pubKey).slice(-20) } diff --git a/packages/util/src/address.ts b/packages/util/src/address.ts index be333db432c..fc9b8d9d3df 100644 --- a/packages/util/src/address.ts +++ b/packages/util/src/address.ts @@ -1,4 +1,3 @@ -import assert from 'assert' import { BN } from './externals' import { toBuffer, zeros } from './bytes' import { @@ -13,7 +12,9 @@ export class Address { public readonly buf: Buffer constructor(buf: Buffer) { - assert(buf.length === 20, 'Invalid address length') + if (buf.length !== 20) { + throw new Error('Invalid address length') + } this.buf = buf } @@ -29,7 +30,9 @@ export class Address { * @param str - Hex-encoded address */ static fromString(str: string): Address { - assert(isValidAddress(str), 'Invalid address') + if (!isValidAddress(str)) { + throw new Error('Invalid address') + } return new Address(toBuffer(str)) } @@ -38,7 +41,9 @@ export class Address { * @param pubKey The two points of an uncompressed key */ static fromPublicKey(pubKey: Buffer): Address { - assert(Buffer.isBuffer(pubKey), 'Public key should be Buffer') + if (!Buffer.isBuffer(pubKey)) { + throw new Error('Public key should be Buffer') + } const buf = pubToAddress(pubKey) return new Address(buf) } @@ -48,7 +53,9 @@ export class Address { * @param privateKey A private key must be 256 bits wide */ static fromPrivateKey(privateKey: Buffer): Address { - assert(Buffer.isBuffer(privateKey), 'Private key should be Buffer') + if (!Buffer.isBuffer(privateKey)) { + throw new Error('Private key should be Buffer') + } const buf = privateToAddress(privateKey) return new Address(buf) } @@ -59,7 +66,9 @@ export class Address { * @param nonce The nonce of the from account */ static generate(from: Address, nonce: BN): Address { - assert(BN.isBN(nonce)) + if (!BN.isBN(nonce)) { + throw new Error('Expected nonce to be a BigNum') + } return new Address(generateAddress(from.buf, nonce.toArrayLike(Buffer))) } @@ -70,8 +79,12 @@ export class Address { * @param initCode The init code of the contract being created */ static generate2(from: Address, salt: Buffer, initCode: Buffer): Address { - assert(Buffer.isBuffer(salt)) - assert(Buffer.isBuffer(initCode)) + if (!Buffer.isBuffer(salt)) { + throw new Error('Expected salt to be a Buffer') + } + if (!Buffer.isBuffer(initCode)) { + throw new Error('Expected initCode to be a Buffer') + } return new Address(generateAddress2(from.buf, salt, initCode)) } diff --git a/packages/util/src/object.ts b/packages/util/src/object.ts index b21782fefba..aa6949309e5 100644 --- a/packages/util/src/object.ts +++ b/packages/util/src/object.ts @@ -1,4 +1,3 @@ -import assert from 'assert' import { stripHexPrefix } from './internal' import { rlp } from './externals' import { toBuffer, baToJSON, unpadBuffer } from './bytes' @@ -49,15 +48,13 @@ export const defineProperties = function (self: any, fields: any, data?: any) { if (field.allowLess && field.length) { v = unpadBuffer(v) - assert( - field.length >= v.length, - `The field ${field.name} must not have more ${field.length} bytes` - ) + if (field.length < v.length) { + throw new Error(`The field ${field.name} must not have more ${field.length} bytes`) + } } else if (!(field.allowZero && v.length === 0) && field.length) { - assert( - field.length === v.length, - `The field ${field.name} must have byte length of ${field.length}` - ) + if (field.length !== v.length) { + throw new Error(`The field ${field.name} must have byte length of ${field.length}`) + } } self.raw[i] = v From 5472158ddd425bf7c6fa545ade4004afb954484d Mon Sep 17 00:00:00 2001 From: emersonmacro <77563348+emersonmacro@users.noreply.github.com> Date: Fri, 21 Jan 2022 00:07:14 -0800 Subject: [PATCH 03/44] Common, VM: Remove unused HF options from Common, move supportedHardforks to VM (#1649) * common: remove onlySupported and onlyActive hf options * vm: move supportedHardforks option from common * common: remove supportedHardforks option * common: update README for supportedHardforks removal * vm: update README for supportedHardforks addition * common: cleanup in src/index.ts * vm: refactor supportedHardforks per PR feedback * common: remove _chooseHardfork method per PR feedback * vm: updated README per PR feedback * vm: supportedHardforks local variable, switch to enum --- packages/common/README.md | 12 --- packages/common/src/index.ts | 122 ++++-------------------- packages/common/tests/chains.spec.ts | 25 ----- packages/common/tests/hardforks.spec.ts | 50 +--------- packages/common/tests/params.spec.ts | 23 +---- packages/vm/src/index.ts | 47 +++++---- packages/vm/tests/api/index.spec.ts | 20 ++++ 7 files changed, 72 insertions(+), 227 deletions(-) diff --git a/packages/common/README.md b/packages/common/README.md index ca281382089..b8b02f96305 100644 --- a/packages/common/README.md +++ b/packages/common/README.md @@ -65,18 +65,6 @@ c.bootstrapNodes() // Array with current nodes c = new Common({ chain: 'mainnet', eips: [2537] }) ``` -If the initializing library only supports a certain range of `hardforks` you can use the `supportedHardforks` option to restrict hardfork access on the `Common` instance: - -```typescript -const c = new Common({ - chain: 'ropsten', - supportedHardforks: ['byzantium', 'constantinople', 'petersburg'], -}) -``` - -This will throw an error when a param is requested for an unsupported hardfork -to prevent unpredictable behavior. - For an improved developer experience, there are `Chain` and `Hardfork` enums available: ```typescript diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index 4c503f8ce00..cd841791e0b 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -103,10 +103,6 @@ interface BaseOpts { * Default: Hardfork.Istanbul */ hardfork?: string | Hardfork - /** - * Limit parameter returns to the given hardforks - */ - supportedHardforks?: Array /** * Selected EIPs which can be activated, please use an array for instantiation * (e.g. `eips: [ 2537, ]`) @@ -181,13 +177,6 @@ export interface CustomCommonOpts extends BaseOpts { baseChain?: string | number | Chain | BN } -interface hardforkOptions { - /** optional, only allow supported HFs (default: false) */ - onlySupported?: boolean - /** optional, only active HFs (default: false) */ - onlyActive?: boolean -} - /** * Common class to access chain and hardfork parameters and to provide * a unified and shared view on the network and hardfork state. @@ -201,7 +190,6 @@ export default class Common extends EventEmitter { private _chainParams: IChain private _hardfork: string | Hardfork - private _supportedHardforks: Array = [] private _eips: number[] = [] private _customChains: IChain[] | [IChain, GenesisState][] @@ -324,13 +312,11 @@ export default class Common extends EventEmitter { * chain params on. * @param customChainParams The custom parameters of the chain. * @param hardfork String identifier ('byzantium') for hardfork (optional) - * @param supportedHardforks Limit parameter returns to the given hardforks (optional) */ static forCustomChain( baseChain: string | number | Chain, customChainParams: Partial, - hardfork?: string | Hardfork, - supportedHardforks?: Array + hardfork?: string | Hardfork ): Common { const standardChainParams = Common._getChainParams(baseChain) @@ -340,7 +326,6 @@ export default class Common extends EventEmitter { ...customChainParams, }, hardfork: hardfork, - supportedHardforks: supportedHardforks, }) } @@ -392,9 +377,6 @@ export default class Common extends EventEmitter { } } this._hardfork = this.DEFAULT_HARDFORK - if (opts.supportedHardforks) { - this._supportedHardforks = opts.supportedHardforks - } if (opts.hardfork) { this.setHardfork(opts.hardfork) } @@ -447,9 +429,6 @@ export default class Common extends EventEmitter { * @param hardfork String identifier (e.g. 'byzantium') or {@link Hardfork} enum */ setHardfork(hardfork: string | Hardfork): void { - if (!this._isSupportedHardfork(hardfork)) { - throw new Error(`Hardfork ${hardfork} not set as supported in supportedHardforks`) - } let existing = false for (const hfChanges of HARDFORK_CHANGES) { if (hfChanges[0] === hardfork) { @@ -545,20 +524,6 @@ export default class Common extends EventEmitter { return hardfork } - /** - * Internal helper function to choose between hardfork set and hardfork provided as param - * @param hardfork Hardfork given to function as a parameter - * @returns Hardfork chosen to be used - */ - _chooseHardfork(hardfork?: string | Hardfork | null, onlySupported: boolean = true): string { - if (!hardfork) { - hardfork = this._hardfork - } else if (onlySupported && !this._isSupportedHardfork(hardfork)) { - throw new Error(`Hardfork ${hardfork} not set as supported in supportedHardforks`) - } - return hardfork - } - /** * Internal helper function, returns the params for the given hardfork for the chain set * @param hardfork Hardfork name @@ -572,22 +537,6 @@ export default class Common extends EventEmitter { throw new Error(`Hardfork ${hardfork} not defined for chain ${this.chainName()}`) } - /** - * Internal helper function to check if a hardfork is set to be supported by the library - * @param hardfork Hardfork name - * @returns True if hardfork is supported - */ - _isSupportedHardfork(hardfork: string | Hardfork | null): boolean { - if (this._supportedHardforks.length > 0) { - for (const supportedHf of this._supportedHardforks) { - if (hardfork === supportedHf) return true - } - } else { - return true - } - return false - } - /** * Sets the active EIPs * @param eips @@ -646,8 +595,6 @@ export default class Common extends EventEmitter { * @returns The value requested or `null` if not found */ paramByHardfork(topic: string, name: string, hardfork: string | Hardfork): any { - hardfork = this._chooseHardfork(hardfork) - let value = null for (const hfChanges of HARDFORK_CHANGES) { // EIP-referencing HF file (e.g. berlin.json) @@ -734,17 +681,11 @@ export default class Common extends EventEmitter { * Checks if set or provided hardfork is active on block number * @param hardfork Hardfork name or null (for HF set) * @param blockNumber - * @param opts Hardfork options (onlyActive unused) * @returns True if HF is active on block number */ - hardforkIsActiveOnBlock( - hardfork: string | Hardfork | null, - blockNumber: BNLike, - opts: hardforkOptions = {} - ): boolean { + hardforkIsActiveOnBlock(hardfork: string | Hardfork | null, blockNumber: BNLike): boolean { blockNumber = toType(blockNumber, TypeOutput.BN) - const onlySupported = opts.onlySupported ?? false - hardfork = this._chooseHardfork(hardfork, onlySupported) + hardfork = hardfork ?? this._hardfork const hfBlock = this.hardforkBlockBN(hardfork) if (hfBlock && blockNumber.gte(hfBlock)) { return true @@ -755,11 +696,10 @@ export default class Common extends EventEmitter { /** * Alias to hardforkIsActiveOnBlock when hardfork is set * @param blockNumber - * @param opts Hardfork options (onlyActive unused) * @returns True if HF is active on block number */ - activeOnBlock(blockNumber: BNLike, opts?: hardforkOptions): boolean { - return this.hardforkIsActiveOnBlock(null, blockNumber, opts) + activeOnBlock(blockNumber: BNLike): boolean { + return this.hardforkIsActiveOnBlock(null, blockNumber) } /** @@ -769,20 +709,9 @@ export default class Common extends EventEmitter { * @param opts Hardfork options * @returns True if HF1 gte HF2 */ - hardforkGteHardfork( - hardfork1: string | Hardfork | null, - hardfork2: string | Hardfork, - opts: hardforkOptions = {} - ): boolean { - const onlyActive = opts.onlyActive === undefined ? false : opts.onlyActive - hardfork1 = this._chooseHardfork(hardfork1, opts.onlySupported) - - let hardforks - if (onlyActive) { - hardforks = this.activeHardforks(null, opts) - } else { - hardforks = this.hardforks() - } + hardforkGteHardfork(hardfork1: string | Hardfork | null, hardfork2: string | Hardfork): boolean { + hardfork1 = hardfork1 ?? this._hardfork + const hardforks = this.hardforks() let posHf1 = -1, posHf2 = -1 @@ -798,25 +727,19 @@ export default class Common extends EventEmitter { /** * Alias to hardforkGteHardfork when hardfork is set * @param hardfork Hardfork name - * @param opts Hardfork options * @returns True if hardfork set is greater than hardfork provided */ - gteHardfork(hardfork: string | Hardfork, opts?: hardforkOptions): boolean { - return this.hardforkGteHardfork(null, hardfork, opts) + gteHardfork(hardfork: string | Hardfork): boolean { + return this.hardforkGteHardfork(null, hardfork) } /** * Checks if given or set hardfork is active on the chain * @param hardfork Hardfork name, optional if HF set - * @param opts Hardfork options (onlyActive unused) * @returns True if hardfork is active on the chain */ - hardforkIsActiveOnChain( - hardfork?: string | Hardfork | null, - opts: hardforkOptions = {} - ): boolean { - const onlySupported = opts.onlySupported ?? false - hardfork = this._chooseHardfork(hardfork, onlySupported) + hardforkIsActiveOnChain(hardfork?: string | Hardfork | null): boolean { + hardfork = hardfork ?? this._hardfork for (const hf of this.hardforks()) { if (hf['name'] === hardfork && hf['block'] !== null) return true } @@ -826,16 +749,14 @@ export default class Common extends EventEmitter { /** * Returns the active hardfork switches for the current chain * @param blockNumber up to block if provided, otherwise for the whole chain - * @param opts Hardfork options (onlyActive unused) * @return Array with hardfork arrays */ - activeHardforks(blockNumber?: BNLike | null, opts: hardforkOptions = {}): HardforkParams[] { + activeHardforks(blockNumber?: BNLike | null): HardforkParams[] { const activeHardforks: HardforkParams[] = [] const hfs = this.hardforks() for (const hf of hfs) { if (hf['block'] === null) continue if (blockNumber !== undefined && blockNumber !== null && blockNumber < hf['block']) break - if (opts.onlySupported && !this._isSupportedHardfork(hf['name'])) continue activeHardforks.push(hf) } @@ -845,11 +766,10 @@ export default class Common extends EventEmitter { /** * Returns the latest active hardfork name for chain or block or throws if unavailable * @param blockNumber up to block if provided, otherwise for the whole chain - * @param opts Hardfork options (onlyActive unused) * @return Hardfork name */ - activeHardfork(blockNumber?: BNLike | null, opts: hardforkOptions = {}): string { - const activeHardforks = this.activeHardforks(blockNumber, opts) + activeHardfork(blockNumber?: BNLike | null): string { + const activeHardforks = this.activeHardforks(blockNumber) if (activeHardforks.length > 0) { return activeHardforks[activeHardforks.length - 1]['name'] } else { @@ -874,7 +794,7 @@ export default class Common extends EventEmitter { * @returns Block number or null if unscheduled */ hardforkBlockBN(hardfork?: string | Hardfork): BN | null { - hardfork = this._chooseHardfork(hardfork, false) + hardfork = hardfork ?? this._hardfork const block = this._getHardfork(hardfork)['block'] if (block === undefined || block === null) { return null @@ -888,7 +808,7 @@ export default class Common extends EventEmitter { * @returns Total difficulty or null if no set */ hardforkTD(hardfork?: string | Hardfork): BN | null { - hardfork = this._chooseHardfork(hardfork, false) + hardfork = hardfork ?? this._hardfork const td = this._getHardfork(hardfork)['td'] if (td === undefined || td === null) { return null @@ -904,7 +824,7 @@ export default class Common extends EventEmitter { */ isHardforkBlock(blockNumber: BNLike, hardfork?: string | Hardfork): boolean { blockNumber = toType(blockNumber, TypeOutput.BN) - hardfork = this._chooseHardfork(hardfork, false) + hardfork = hardfork ?? this._hardfork const block = this.hardforkBlockBN(hardfork) return block ? block.eq(blockNumber) : false } @@ -926,7 +846,7 @@ export default class Common extends EventEmitter { * @returns Block number or null if not available */ nextHardforkBlockBN(hardfork?: string | Hardfork): BN | null { - hardfork = this._chooseHardfork(hardfork, false) + hardfork = hardfork ?? this._hardfork const hfBlock = this.hardforkBlockBN(hardfork) if (hfBlock === null) { return null @@ -950,7 +870,7 @@ export default class Common extends EventEmitter { */ isNextHardforkBlock(blockNumber: BNLike, hardfork?: string | Hardfork): boolean { blockNumber = toType(blockNumber, TypeOutput.BN) - hardfork = this._chooseHardfork(hardfork, false) + hardfork = hardfork ?? this._hardfork const nextHardforkBlock = this.nextHardforkBlockBN(hardfork) return nextHardforkBlock === null ? false : nextHardforkBlock.eq(blockNumber) @@ -994,7 +914,7 @@ export default class Common extends EventEmitter { * @param hardfork Hardfork name, optional if HF set */ forkHash(hardfork?: string | Hardfork) { - hardfork = this._chooseHardfork(hardfork, false) + hardfork = hardfork ?? this._hardfork const data = this._getHardfork(hardfork) if (data['block'] === null && data['td'] === undefined) { const msg = 'No fork hash calculation possible for future hardfork' diff --git a/packages/common/tests/chains.spec.ts b/packages/common/tests/chains.spec.ts index bb939dbda8f..63d74389743 100644 --- a/packages/common/tests/chains.spec.ts +++ b/packages/common/tests/chains.spec.ts @@ -16,7 +16,6 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { c.DEFAULT_HARDFORK, 'should set hardfork to hardfork set as DEFAULT_HARDFORK' ) - st.equal(c._isSupportedHardfork('constantinople'), true, 'should not restrict supported HFs') c = new Common({ chain: 1 }) st.equal(c.chainName(), 'mainnet', 'should initialize with chain Id') @@ -37,7 +36,6 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { c.DEFAULT_HARDFORK, 'should set hardfork to hardfork set as DEFAULT_HARDFORK' ) - st.equal(c._isSupportedHardfork('constantinople'), true, 'should not restrict supported HFs') st.end() }) @@ -59,19 +57,6 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { } ) - t.test('Should initialize with supportedHardforks provided', function (st: tape.Test) { - const c = new Common({ - chain: 'mainnet', - hardfork: 'byzantium', - supportedHardforks: ['byzantium', 'constantinople'], - }) - st.equal(c._isSupportedHardfork('byzantium'), true, 'should return true for supported HF') - const msg = 'should return false for unsupported HF' - st.equal(c._isSupportedHardfork('spuriousDragon'), false, msg) - - st.end() - }) - t.test('Should handle initialization errors', function (st: tape.Test) { let f = function () { new Common({ chain: 'chainnotexisting' }) @@ -85,16 +70,6 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { msg = 'should throw an exception on non-existing hardfork' st.throws(f, /not supported$/, msg) // eslint-disable-line no-new - f = function () { - new Common({ - chain: 'mainnet', - hardfork: 'spuriousDragon', - supportedHardforks: ['byzantium', 'constantinople'], - }) - } - msg = 'should throw an exception on conflicting active/supported HF params' - st.throws(f, /supportedHardforks$/, msg) // eslint-disable-line no-new - st.end() }) diff --git a/packages/common/tests/hardforks.spec.ts b/packages/common/tests/hardforks.spec.ts index 39aea7bc903..2a6e3cb5f20 100644 --- a/packages/common/tests/hardforks.spec.ts +++ b/packages/common/tests/hardforks.spec.ts @@ -164,20 +164,6 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { msg = 'should return 4 active hardforks for Ropsten up to block 10' st.equal(c.activeHardforks(10).length, 4, msg) - c = new Common({ - chain: Chain.Ropsten, - supportedHardforks: [Hardfork.SpuriousDragon, Hardfork.Byzantium, Hardfork.Constantinople], - }) - msg = 'should return 3 active HFs when restricted to supported HFs' - st.equal(c.activeHardforks(null, { onlySupported: true }).length, 3, msg) - - c = new Common({ - chain: Chain.Ropsten, - supportedHardforks: [Hardfork.SpuriousDragon, Hardfork.Byzantium, Hardfork.Dao], - }) - msg = 'should return 2 active HFs when restricted to supported HFs' - st.equal(c.activeHardforks(null, { onlySupported: true }).length, 2, msg) - c = new Common({ chain: Chain.Mainnet }) msg = 'should return correct number of active HFs for mainnet' st.equal(c.activeHardforks().length, 13, msg) @@ -201,13 +187,6 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { msg = 'should return spuriousDragon as latest active HF for Ropsten for block 10' st.equal(c.activeHardfork(10), Hardfork.SpuriousDragon, msg) - c = new Common({ - chain: Chain.Ropsten, - supportedHardforks: [Hardfork.TangerineWhistle, Hardfork.SpuriousDragon], - }) - msg = 'should return spuriousDragon as latest active HF for Ropsten with limited supported HFs' - st.equal(c.activeHardfork(null, { onlySupported: true }), Hardfork.SpuriousDragon, msg) - c = new Common({ chain: Chain.Rinkeby }) msg = 'should return correct latest active HF for Rinkeby' st.equal(c.activeHardfork(), Hardfork.London, msg) @@ -264,14 +243,8 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { let msg = 'Ropsten, constantinople >= byzantium (provided) -> true' st.equal(c.hardforkGteHardfork(Hardfork.Constantinople, Hardfork.Byzantium), true, msg) - msg = 'Ropsten, dao >= chainstart (provided), onlyActive -> false' - st.equal( - c.hardforkGteHardfork(Hardfork.Dao, Hardfork.Chainstart, { - onlyActive: true, - }), - false, - msg - ) + msg = 'Ropsten, dao >= chainstart (provided) -> false' + st.equal(c.hardforkGteHardfork(Hardfork.Dao, Hardfork.Chainstart), false, msg) msg = 'Ropsten, byzantium >= byzantium (provided) -> true' st.equal(c.hardforkGteHardfork(Hardfork.Byzantium, Hardfork.Byzantium), true, msg) @@ -286,9 +259,6 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { msg = 'Ropsten, byzantium (set) >= spuriousDragon -> true (alias function)' st.equal(c.gteHardfork(Hardfork.SpuriousDragon), true, msg) - msg = 'Ropsten, byzantium (set) >= spuriousDragon, onlyActive -> true' - st.equal(c.hardforkGteHardfork(null, Hardfork.SpuriousDragon, { onlyActive: true }), true, msg) - msg = 'Ropsten, byzantium (set) >= byzantium -> true' st.equal(c.hardforkGteHardfork(null, Hardfork.Byzantium), true, msg) @@ -320,26 +290,10 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { msg = 'should return false for a non-existing HF (provided) on Ropsten' st.equal(c.hardforkIsActiveOnChain('notexistinghardfork'), false, msg) - let f = function () { - c.hardforkIsActiveOnChain(Hardfork.SpuriousDragon, { onlySupported: true }) - } - msg = 'should not throw with unsupported Hf (provided) and onlySupported set to false' - st.doesNotThrow(f, /unsupported hardfork$/, msg) - c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) msg = 'should return true for byzantium (set) on Ropsten' st.equal(c.hardforkIsActiveOnChain(), true, msg) - c = new Common({ - chain: Chain.Ropsten, - supportedHardforks: [Hardfork.Byzantium, Hardfork.Constantinople], - }) - f = function () { - c.hardforkIsActiveOnChain(Hardfork.SpuriousDragon, { onlySupported: true }) - } - msg = 'should throw with unsupported Hf and onlySupported set to true' - st.throws(f, /not set as supported in supportedHardforks$/, msg) - st.end() }) diff --git a/packages/common/tests/params.spec.ts b/packages/common/tests/params.spec.ts index 4e27a234e80..8aa81eaefc0 100644 --- a/packages/common/tests/params.spec.ts +++ b/packages/common/tests/params.spec.ts @@ -32,34 +32,17 @@ tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: t }) t.test('Error cases for param(), paramByHardfork()', function (st: tape.Test) { - let c = new Common({ chain: Chain.Mainnet }) + const c = new Common({ chain: Chain.Mainnet }) - let f = function () { + const f = function () { c.paramByHardfork('gasPrizes', 'ecAdd', 'byzantium') } - let msg = 'Should throw when called with non-existing topic' + const msg = 'Should throw when called with non-existing topic' st.throws(f, /Topic gasPrizes not defined$/, msg) c.setHardfork(Hardfork.Byzantium) st.equal(c.param('gasPrices', 'ecAdd'), 500, 'Should return correct value for HF set in class') - c = new Common({ - chain: Chain.Mainnet, - hardfork: Hardfork.Byzantium, - supportedHardforks: [Hardfork.Byzantium, Hardfork.Constantinople], - }) - f = function () { - c.paramByHardfork('gasPrices', 'expByte', 'spuriousDragon') - } - msg = 'Should throw when calling param() with an unsupported hardfork' - st.throws(f, /supportedHardforks$/, msg) - - f = function () { - c.paramByBlock('gasPrices', 'expByte', 0) - } - msg = 'Should throw when calling paramByBlock() with an unsupported hardfork' - st.throws(f, /supportedHardforks$/, msg) - st.end() }) diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index e8093d05885..ab77bd888e6 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -268,27 +268,7 @@ export default class VM extends AsyncEventEmitter { this._common = opts.common } else { const DEFAULT_CHAIN = Chain.Mainnet - const supportedHardforks = [ - Hardfork.Chainstart, - Hardfork.Homestead, - Hardfork.Dao, - Hardfork.TangerineWhistle, - Hardfork.SpuriousDragon, - Hardfork.Byzantium, - Hardfork.Constantinople, - Hardfork.Petersburg, - Hardfork.Istanbul, - Hardfork.MuirGlacier, - Hardfork.Berlin, - Hardfork.London, - Hardfork.ArrowGlacier, - Hardfork.MergeForkIdTransition, - Hardfork.Merge, - ] - this._common = new Common({ - chain: DEFAULT_CHAIN, - supportedHardforks, - }) + this._common = new Common({ chain: DEFAULT_CHAIN }) } this._common.on('hardforkChanged', () => { this.getActiveOpcodes() @@ -299,6 +279,31 @@ export default class VM extends AsyncEventEmitter { this.getActiveOpcodes() this._precompiles = getActivePrecompiles(this._common, this._customPrecompiles) + const supportedHardforks = [ + Hardfork.Chainstart, + Hardfork.Homestead, + Hardfork.Dao, + Hardfork.TangerineWhistle, + Hardfork.SpuriousDragon, + Hardfork.Byzantium, + Hardfork.Constantinople, + Hardfork.Petersburg, + Hardfork.Istanbul, + Hardfork.MuirGlacier, + Hardfork.Berlin, + Hardfork.London, + Hardfork.ArrowGlacier, + ] + if (!supportedHardforks.includes(this._common.hardfork() as Hardfork)) { + throw new Error( + `Hardfork ${this._common.hardfork()} not set as supported in supportedHardforks` + ) + } + + // Set list of opcodes based on HF + // TODO: make this EIP-friendly + this._opcodes = getOpcodesForHF(this._common) + if (opts.stateManager) { this.stateManager = opts.stateManager } else { diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index c8fa4519191..c850d6505d5 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -65,6 +65,26 @@ tape('VM -> basic instantiation / boolean switches', (t) => { }) }) +tape('VM -> supportedHardforks', (t) => { + t.test('should throw when common is set to an unsupported hardfork', async (st) => { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Merge }) + try { + await VM.create({ common }) + st.fail('should have failed for unsupported hardfork') + } catch (e: any) { + st.ok(e.message.includes('supportedHardforks')) + } + st.end() + }) + + t.test('should succeed when common is set to a supported hardfork', async (st) => { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Byzantium }) + const vm = await VM.create({ common }) + st.equal(vm._common.hardfork(), Hardfork.Byzantium) + st.end() + }) +}) + tape('VM -> common (chain, HFs, EIPs)', (t) => { t.test('should accept a common object as option', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) From f5e63d1650b56334a9a196f8ac8a27554120af12 Mon Sep 17 00:00:00 2001 From: Scotty <66335769+ScottyPoi@users.noreply.github.com> Date: Tue, 8 Feb 2022 07:05:49 -0700 Subject: [PATCH 04/44] Common: method deprecations (new) (#1698) * common: delete deprecated hardforkBlock method * common: adapt tests to use hardforkBlockBN * common: delete deprecated nextHardforkBlock method * common/tests: rename nextHardforkBlock() calls to nextHardforkBlockBN() * common: adapt tests to use BN.eqn(number) * common: delete deprecated networkId() method * common: delete tests for networkId() * common: delete deprecated chainId() method * common: delete tests for .chainId() * delete deprecated forCustomChain meethod * common: delete forCustomChain() test * blockchain: switch forCustomChain to Common.custom * client: switch fromCustomChain to Common.custom * tx: switch forCustomChain to Common.custom * VM: switch forCustomChain to Common.custom * common: internalize _getInitializedChains() method * common: delete deprecaed chains/index.ts file * client: switch to Common._getInitializedChains * common: remove genesisStates/index.ts * common: remove test for genesisStates --- packages/blockchain/test/clique.spec.ts | 16 +-- packages/client/bin/cli.ts | 4 +- packages/client/test/miner/miner.spec.ts | 5 +- packages/common/src/chains/index.ts | 45 -------- packages/common/src/genesisStates/index.ts | 40 -------- packages/common/src/index.ts | 107 +++++++------------- packages/common/tests/chains.spec.ts | 4 - packages/common/tests/customChains.spec.ts | 40 +------- packages/common/tests/genesisStates.spec.ts | 25 ----- packages/common/tests/hardforks.spec.ts | 22 ++-- packages/tx/examples/custom-chain-tx.ts | 10 +- packages/tx/src/baseTransaction.ts | 5 +- packages/tx/test/typedTxsAndEIP2930.spec.ts | 5 +- packages/vm/tests/api/index.spec.ts | 20 ++-- packages/vm/tests/api/runBlock.spec.ts | 15 ++- packages/vm/tests/tester/config.ts | 8 +- packages/vm/tests/util.ts | 8 +- 17 files changed, 106 insertions(+), 273 deletions(-) delete mode 100644 packages/common/src/chains/index.ts delete mode 100644 packages/common/src/genesisStates/index.ts delete mode 100644 packages/common/tests/genesisStates.spec.ts diff --git a/packages/blockchain/test/clique.spec.ts b/packages/blockchain/test/clique.spec.ts index 3fa71bfb36e..afda60e9f59 100644 --- a/packages/blockchain/test/clique.spec.ts +++ b/packages/blockchain/test/clique.spec.ts @@ -534,8 +534,7 @@ tape('Clique: Initialization', (t) => { t.test( 'Clique Voting: Epoch transitions reset all votes to allow chain checkpointing', async (st) => { - const common = Common.forCustomChain( - 'rinkeby', + const common = Common.custom( { consensus: { type: ConsensusType.ProofOfAuthority, @@ -546,7 +545,10 @@ tape('Clique: Initialization', (t) => { }, }, }, - 'chainstart' + { + baseChain: Chain.Rinkeby, + hardfork: Hardfork.Chainstart, + } ) const { blocks, blockchain } = await initWithSigners([A, B], common) await addNextBlock(blockchain, blocks, A, [C, true], undefined, common) @@ -597,8 +599,7 @@ tape('Clique: Initialization', (t) => { t.test( 'Clique Voting: Recent signatures should not reset on checkpoint blocks imported in a batch', async (st) => { - const common = Common.forCustomChain( - 'rinkeby', + const common = Common.custom( { consensus: { type: ConsensusType.ProofOfAuthority, @@ -609,7 +610,10 @@ tape('Clique: Initialization', (t) => { }, }, }, - 'chainstart' + { + baseChain: Chain.Rinkeby, + hardfork: Hardfork.Chainstart, + } ) const { blocks, blockchain } = await initWithSigners([A, B, C], common) await addNextBlock(blockchain, blocks, A, undefined, undefined, common) diff --git a/packages/client/bin/cli.ts b/packages/client/bin/cli.ts index 220e0b3cd28..798629d67ba 100755 --- a/packages/client/bin/cli.ts +++ b/packages/client/bin/cli.ts @@ -8,7 +8,7 @@ import { existsSync } from 'fs' import { ensureDirSync, readFileSync, removeSync } from 'fs-extra' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { _getInitializedChains } from '@ethereumjs/common/dist/chains' -import { Address, toBuffer, BN } from 'ethereumjs-util' +import { Address, toBuffer } from 'ethereumjs-util' import { parseMultiaddrs, parseGenesisState, parseCustomParams } from '../lib/util' import EthereumClient from '../lib/client' import { Config, DataDirectory } from '../lib/config' @@ -22,7 +22,7 @@ const { hideBin } = require('yargs/helpers') type Account = [address: Address, privateKey: Buffer] -const networks = Object.entries(_getInitializedChains().names) +const networks = Object.entries(Common._getInitializedChains().names) let logger: Logger diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index 3e82bc5b5fc..02c9c05487f 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -209,7 +209,10 @@ tape('[Miner]', async (t) => { t.test('assembleBlocks() -> should not include tx under the baseFee', async (t) => { t.plan(1) const customChainParams = { hardforks: [{ name: 'london', block: 0 }] } - const common = Common.forCustomChain(CommonChain.Rinkeby, customChainParams, Hardfork.London) + const common = Common.custom(customChainParams, { + baseChain: CommonChain.Rinkeby, + hardfork: Hardfork.London, + }) const config = new Config({ transports: [], accounts, mine: true, common }) const chain = new FakeChain() as any const block = Block.fromBlockData({}, { common }) diff --git a/packages/common/src/chains/index.ts b/packages/common/src/chains/index.ts deleted file mode 100644 index b61c4e0fb14..00000000000 --- a/packages/common/src/chains/index.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Chain, chainsType } from './../types' -import mainnet from './mainnet.json' -import ropsten from './ropsten.json' -import rinkeby from './rinkeby.json' -import kovan from './kovan.json' -import goerli from './goerli.json' -import sepolia from './sepolia.json' - -/** - * @hidden - */ -export function _getInitializedChains(customChains?: Chain[]) { - const names: any = { - '1': 'mainnet', - '3': 'ropsten', - '4': 'rinkeby', - '42': 'kovan', - '5': 'goerli', - '11155111': 'sepolia', - } - const chains: any = { - mainnet, - ropsten, - rinkeby, - kovan, - goerli, - sepolia, - } - if (customChains) { - for (const chain of customChains) { - const name = chain.name - names[chain.chainId.toString()] = name - chains[name] = chain - } - } - - chains['names'] = names - return chains -} - -/** - * @deprecated this constant will be internalized (removed) - * on next major version update - */ -export const chains: chainsType = _getInitializedChains() diff --git a/packages/common/src/genesisStates/index.ts b/packages/common/src/genesisStates/index.ts deleted file mode 100644 index c170b0e1419..00000000000 --- a/packages/common/src/genesisStates/index.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { genesisStatesType } from './../types' - -const genesisStates: genesisStatesType = { - names: { - '1': 'mainnet', - '3': 'ropsten', - '4': 'rinkeby', - '42': 'kovan', - '5': 'goerli', - '11155111': 'sepolia', - }, - mainnet: require('./mainnet.json'), - ropsten: require('./ropsten.json'), - rinkeby: require('./rinkeby.json'), - kovan: require('./kovan.json'), - goerli: require('./goerli.json'), - sepolia: require('./sepolia.json'), -} - -/** - * Returns the genesis state by network ID - * @param id ID of the network (e.g. 1) - * @returns Dictionary with genesis accounts - * - * @deprecated use {@link Common.genesisState} instead - */ -export function genesisStateById(id: number): any { - return genesisStates[genesisStates['names'][id]] -} - -/** - * Returns the genesis state by network name - * @param name Name of the network (e.g. 'mainnet') - * @returns Dictionary with genesis accounts - * - * @deprecated use {@link Common.genesisState} instead - */ -export function genesisStateByName(name: string): any { - return genesisStates[name] -} diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index cd841791e0b..f9320f00dc3 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -1,7 +1,6 @@ import { EventEmitter } from 'events' import { buf as crc32Buffer } from 'crc-32' import { BN, BNLike, toType, TypeOutput, intToBuffer } from 'ethereumjs-util' -import { _getInitializedChains } from './chains' import { hardforks as HARDFORK_CHANGES } from './hardforks' import { EIPs } from './eips' import { @@ -11,6 +10,12 @@ import { GenesisState, Hardfork as HardforkParams, } from './types' +import mainnet from './chains/mainnet.json' +import ropsten from './chains/ropsten.json' +import rinkeby from './chains/rinkeby.json' +import kovan from './chains/kovan.json' +import goerli from './chains/goerli.json' +import sepolia from './chains/sepolia.json' export enum CustomChain { /** @@ -302,40 +307,13 @@ export default class Common extends EventEmitter { } } - /** - * Creates a {@link Common} object for a custom chain, based on a standard one. It uses all the `Chain` - * params from {@link baseChain} except the ones overridden in {@link customChainParams}. - * - * @deprecated Use {@link Common.custom} instead - * - * @param baseChain The name (`mainnet`) or id (`1`) of a standard chain used to base the custom - * chain params on. - * @param customChainParams The custom parameters of the chain. - * @param hardfork String identifier ('byzantium') for hardfork (optional) - */ - static forCustomChain( - baseChain: string | number | Chain, - customChainParams: Partial, - hardfork?: string | Hardfork - ): Common { - const standardChainParams = Common._getChainParams(baseChain) - - return new Common({ - chain: { - ...standardChainParams, - ...customChainParams, - }, - hardfork: hardfork, - }) - } - /** * Static method to determine if a {@link chainId} is supported as a standard chain * @param chainId BN id (`1`) of a standard chain * @returns boolean */ static isSupportedChainId(chainId: BN): boolean { - const initializedChains: any = _getInitializedChains() + const initializedChains: any = this._getInitializedChains() return Boolean(initializedChains['names'][chainId.toString()]) } @@ -343,7 +321,7 @@ export default class Common extends EventEmitter { chain: string | number | Chain | BN, customChains?: IChain[] ): IChain { - const initializedChains: any = _getInitializedChains(customChains) + const initializedChains: any = this._getInitializedChains(customChains) if (typeof chain === 'number' || BN.isBN(chain)) { chain = chain.toString() @@ -777,17 +755,6 @@ export default class Common extends EventEmitter { } } - /** - * Returns the hardfork change block for hardfork provided or set - * @param hardfork Hardfork name, optional if HF set - * @returns Block number or null if unscheduled - * @deprecated Please use {@link Common.hardforkBlockBN} for large number support - */ - hardforkBlock(hardfork?: string | Hardfork): number | null { - const block = this.hardforkBlockBN(hardfork) - return toType(block, TypeOutput.Number) - } - /** * Returns the hardfork change block for hardfork provided or set * @param hardfork Hardfork name, optional if HF set @@ -829,17 +796,6 @@ export default class Common extends EventEmitter { return block ? block.eq(blockNumber) : false } - /** - * Returns the change block for the next hardfork after the hardfork provided or set - * @param hardfork Hardfork name, optional if HF set - * @returns Block number or null if not available - * @deprecated Please use {@link Common.nextHardforkBlockBN} for large number support - */ - nextHardforkBlock(hardfork?: string | Hardfork): number | null { - const block = this.nextHardforkBlockBN(hardfork) - return toType(block, TypeOutput.Number) - } - /** * Returns the change block for the next hardfork after the hardfork provided or set * @param hardfork Hardfork name, optional if HF set @@ -1017,15 +973,6 @@ export default class Common extends EventEmitter { return this._hardfork } - /** - * Returns the Id of current chain - * @returns chain Id - * @deprecated Please use {@link Common.chainIdBN} for large number support - */ - chainId(): number { - return toType(this.chainIdBN(), TypeOutput.Number) - } - /** * Returns the Id of current chain * @returns chain Id @@ -1042,15 +989,6 @@ export default class Common extends EventEmitter { return this._chainParams['name'] } - /** - * Returns the Id of current network - * @returns network Id - * @deprecated Please use {@link Common.networkIdBN} for large number support - */ - networkId(): number { - return toType(this.networkIdBN(), TypeOutput.Number) - } - /** * Returns the Id of current network * @returns network Id @@ -1154,4 +1092,33 @@ export default class Common extends EventEmitter { copy.removeAllListeners() return copy } + + static _getInitializedChains(customChains?: IChain[]) { + const names: any = { + '1': 'mainnet', + '3': 'ropsten', + '4': 'rinkeby', + '42': 'kovan', + '5': 'goerli', + '11155111': 'sepolia', + } + const chains: any = { + mainnet, + ropsten, + rinkeby, + kovan, + goerli, + sepolia, + } + if (customChains) { + for (const chain of customChains) { + const name = chain.name + names[chain.chainId.toString()] = name + chains[name] = chain + } + } + + chains['names'] = names + return chains + } } diff --git a/packages/common/tests/chains.spec.ts b/packages/common/tests/chains.spec.ts index 63d74389743..4cd5a40aaa8 100644 --- a/packages/common/tests/chains.spec.ts +++ b/packages/common/tests/chains.spec.ts @@ -6,9 +6,7 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { t.test('Should initialize with chain provided', function (st: tape.Test) { let c = new Common({ chain: 'mainnet' }) st.equal(c.chainName(), 'mainnet', 'should initialize with chain name') - st.equal(c.chainId(), 1, 'should return correct chain Id') st.ok(c.chainIdBN().eqn(1), 'should return correct chain Id') - st.equal(c.networkId(), 1, 'should return correct network Id') st.ok(c.networkIdBN().eqn(1), 'should return correct network Id') st.equal(c.hardfork(), 'istanbul', 'should set hardfork to current default hardfork') st.equal( @@ -26,9 +24,7 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { t.test('Should initialize with chain provided by Chain enum', function (st: tape.Test) { const c = new Common({ chain: Chain.Mainnet }) st.equal(c.chainName(), 'mainnet', 'should initialize with chain name') - st.equal(c.chainId(), 1, 'should return correct chain Id') st.ok(c.chainIdBN().eqn(1), 'should return correct chain Id') - st.equal(c.networkId(), 1, 'should return correct network Id') st.ok(c.networkIdBN().eqn(1), 'should return correct network Id') st.equal(c.hardfork(), 'istanbul', 'should set hardfork to current default hardfork') st.equal( diff --git a/packages/common/tests/customChains.spec.ts b/packages/common/tests/customChains.spec.ts index 39f3290aee8..c7de31ca85a 100644 --- a/packages/common/tests/customChains.spec.ts +++ b/packages/common/tests/customChains.spec.ts @@ -13,9 +13,7 @@ tape('[Common]: Custom chains', function (t: tape.Test) { function (st: tape.Test) { const c = new Common({ chain: testnet, hardfork: Hardfork.Byzantium }) st.equal(c.chainName(), 'testnet', 'should initialize with chain name') - st.equal(c.chainId(), 12345, 'should return correct chain Id') st.ok(c.chainIdBN().eqn(12345), 'should return correct chain Id') - st.equal(c.networkId(), 12345, 'should return correct network Id') st.ok(c.networkIdBN().eqn(12345), 'should return correct network Id') st.equal( c.genesis().hash, @@ -54,9 +52,7 @@ tape('[Common]: Custom chains', function (t: tape.Test) { // From custom chain params st.equal(customChainCommon.chainName(), customChainParams.name) - st.equal(customChainCommon.chainId(), customChainParams.chainId) st.ok(customChainCommon.chainIdBN().eqn(customChainParams.chainId)) - st.equal(customChainCommon.networkId(), customChainParams.networkId) st.ok(customChainCommon.networkIdBN().eqn(customChainParams.networkId)) // Fallback params from mainnet @@ -118,34 +114,6 @@ tape('[Common]: Custom chains', function (t: tape.Test) { st.end() }) - t.test('forCustomChain() (deprecated) -> base functionality', function (st: tape.Test) { - const mainnetCommon = new Common({ chain: Chain.Mainnet }) - - const customChainParams = { name: 'custom', chainId: 123, networkId: 678 } - const customChainCommon = Common.forCustomChain( - 'mainnet', - customChainParams, - Hardfork.Byzantium - ) - - // From custom chain params - st.equal(customChainCommon.chainName(), customChainParams.name) - st.equal(customChainCommon.chainId(), customChainParams.chainId) - st.ok(customChainCommon.chainIdBN().eqn(customChainParams.chainId)) - st.equal(customChainCommon.networkId(), customChainParams.networkId) - st.ok(customChainCommon.networkIdBN().eqn(customChainParams.networkId)) - - // Fallback params from mainnet - st.equal(customChainCommon.genesis(), mainnetCommon.genesis()) - st.equal(customChainCommon.bootstrapNodes(), mainnetCommon.bootstrapNodes()) - st.equal(customChainCommon.hardforks(), mainnetCommon.hardforks()) - - // Set only to this Common - st.equal(customChainCommon.hardfork(), 'byzantium') - - st.end() - }) - t.test('customChains parameter: initialization exception', (st) => { try { new Common({ chain: testnet, customChains: [testnet] }) @@ -169,11 +137,11 @@ tape('[Common]: Custom chains', function (t: tape.Test) { customChains: [testnet], }) st.equal(c.chainName(), 'mainnet', 'customChains, chain set to supported chain') - st.equal(c.hardforkBlock(), 4370000, 'customChains, chain set to supported chain') + st.ok(c.hardforkBlockBN()!.eqn(4370000), 'customChains, chain set to supported chain') c.setChain('testnet') st.equal(c.chainName(), 'testnet', 'customChains, chain switched to custom chain') - st.equal(c.hardforkBlock(), 4, 'customChains, chain switched to custom chain') + st.ok(c.hardforkBlockBN()!.eqn(4), 'customChains, chain switched to custom chain') c = new Common({ chain: 'testnet', @@ -181,7 +149,7 @@ tape('[Common]: Custom chains', function (t: tape.Test) { customChains: [testnet], }) st.equal(c.chainName(), 'testnet', 'customChains, chain initialized with custom chain') - st.equal(c.hardforkBlock(), 4, 'customChains, chain initialized with custom chain') + st.ok(c.hardforkBlockBN()!.eqn(4), 'customChains, chain initialized with custom chain') st.deepEqual( c.genesisState(), {}, @@ -195,7 +163,7 @@ tape('[Common]: Custom chains', function (t: tape.Test) { customChains, }) st.equal(c.chainName(), 'testnet2', 'customChains, chain initialized with custom chain') - st.equal(c.hardforkBlock(), 10, 'customChains, chain initialized with custom chain') + st.ok(c.hardforkBlockBN()!.eqn(10), 'customChains, chain initialized with custom chain') c.setChain('testnet') st.equal(c.chainName(), 'testnet', 'customChains, should allow to switch custom chain') diff --git a/packages/common/tests/genesisStates.spec.ts b/packages/common/tests/genesisStates.spec.ts deleted file mode 100644 index 50c66d3b25a..00000000000 --- a/packages/common/tests/genesisStates.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import tape from 'tape' -import { genesisStateById, genesisStateByName } from '../src/genesisStates/' - -// This testfile is deprecated and can be removed along with the removal of the -// two genesis functions called in the tests -tape('[genesisStates]: Genesis state access [DEPRECATED]', function (t: tape.Test) { - t.test('Should be able to access by ID and name', function (st: tape.Test) { - let genesisState = genesisStateById(5) - st.equal( - genesisState['0x0000000000000000000000000000000000000008'], - '0x1', - 'Access by id (goerli)' - ) - - genesisState = genesisStateByName('goerli') - st.equal( - genesisState['0x0000000000000000000000000000000000000008'], - '0x1', - 'Access by name (goerli)' - ) - - st.comment('-----------------------------------------------------------------') - st.end() - }) -}) diff --git a/packages/common/tests/hardforks.spec.ts b/packages/common/tests/hardforks.spec.ts index 2a6e3cb5f20..eac4cf165d2 100644 --- a/packages/common/tests/hardforks.spec.ts +++ b/packages/common/tests/hardforks.spec.ts @@ -73,15 +73,15 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('hardforkBlock()', function (st: tape.Test) { let c = new Common({ chain: Chain.Ropsten }) let msg = 'should return the correct HF change block for byzantium (provided)' - st.equal(c.hardforkBlock(Hardfork.Byzantium), 1700000, msg) + st.ok(c.hardforkBlockBN(Hardfork.Byzantium)!.eqn(1700000), msg) c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) msg = 'should return the correct HF change block for byzantium (set)' - st.equal(c.hardforkBlock(), 1700000, msg) + st.ok(c.hardforkBlockBN()!.eqn(1700000), msg) c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Istanbul }) msg = 'should return the correct HF change block for istanbul (set)' - st.equal(c.hardforkBlock(), 6485846, msg) + st.ok(c.hardforkBlockBN()!.eqn(6485846), msg) st.end() }) @@ -108,22 +108,22 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { let c = new Common({ chain: Chain.Rinkeby, hardfork: Hardfork.Chainstart }) let msg = 'should work with HF set / return correct next HF block for chainstart (rinkeby: chainstart -> homestead)' - st.equal(c.nextHardforkBlock(), 1, msg) + st.ok(c.nextHardforkBlockBN()!.eqn(1), msg) msg = 'should correctly skip a HF where block is set to null (rinkeby: homestead -> (dao) -> tangerineWhistle)' - st.equal(c.nextHardforkBlock('homestead'), 2, msg) + st.ok(c.nextHardforkBlockBN('homestead')!.eqn(2), msg) msg = 'should return correct next HF (rinkeby: byzantium -> constantinople)' - st.equal(c.nextHardforkBlock(Hardfork.Byzantium), 3660663, msg) + st.ok(c.nextHardforkBlockBN(Hardfork.Byzantium)!.eqn(3660663), msg) msg = 'should return null if next HF is not available (rinkeby: london -> shanghai)' - st.equal(c.nextHardforkBlock(Hardfork.London), null, msg) + st.equal(c.nextHardforkBlockBN(Hardfork.London), null, msg) msg = 'should work correctly along the need to skip several forks (ropsten: chainstart -> (homestead) -> (dao) -> (tangerineWhistle) -> spuriousDragon)' c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Chainstart }) - st.equal(c.nextHardforkBlock(), 10, msg) + st.ok(c.nextHardforkBlockBN()!.eqn(10), msg) st.end() }) @@ -221,17 +221,17 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { st.end() }) - t.test('hardforkBlock() / hardforkBlockBN()', function (st: tape.Test) { + t.test('hardforkBlockBN()', function (st: tape.Test) { const c = new Common({ chain: Chain.Mainnet }) let msg = 'should return correct value' - st.equal(c.hardforkBlock(Hardfork.Berlin), 12244000, msg) + st.ok(c.hardforkBlockBN(Hardfork.Berlin)!.eqn(12244000), msg) st.ok(c.hardforkBlockBN(Hardfork.Berlin)!.eq(new BN(12244000)), msg) msg = 'should return null for unscheduled hardfork' // developer note: when Shanghai is set, // update this test to next unscheduled hardfork. - st.equal(c.hardforkBlock(Hardfork.Shanghai), null, msg) + st.equal(c.hardforkBlockBN(Hardfork.Shanghai), null, msg) st.equal(c.hardforkBlockBN(Hardfork.Shanghai), null, msg) st.equal(c.nextHardforkBlockBN(Hardfork.Shanghai), null, msg) diff --git a/packages/tx/examples/custom-chain-tx.ts b/packages/tx/examples/custom-chain-tx.ts index 6261f6c8b60..9885bad3f7c 100644 --- a/packages/tx/examples/custom-chain-tx.ts +++ b/packages/tx/examples/custom-chain-tx.ts @@ -6,15 +6,17 @@ import { Transaction } from '../src' // This custom network has the same params as mainnet, // except for name, chainId, and networkId, -// so we use the `Common.forCustomChain` method. -const customCommon = Common.forCustomChain( - 'mainnet', +// so we use the `Common.custom` method. +const customCommon = Common.custom( + { name: 'my-network', networkId: 123, chainId: 2134, }, - 'petersburg', + { + baseChain: 'mainnet', + hardfork: 'petersburg',} ) // We pass our custom Common object whenever we create a transaction diff --git a/packages/tx/src/baseTransaction.ts b/packages/tx/src/baseTransaction.ts index f9e07ce1f26..62ab142531e 100644 --- a/packages/tx/src/baseTransaction.ts +++ b/packages/tx/src/baseTransaction.ts @@ -366,14 +366,13 @@ export abstract class BaseTransaction { } else { // No Common, chain ID not supported by Common // -> Instantiate custom Common derived from DEFAULT_CHAIN - return Common.forCustomChain( - this.DEFAULT_CHAIN, + return Common.custom( { name: 'custom-chain', networkId: chainIdBN, chainId: chainIdBN, }, - this.DEFAULT_HARDFORK + { baseChain: this.DEFAULT_CHAIN, hardfork: this.DEFAULT_HARDFORK } ) } } diff --git a/packages/tx/test/typedTxsAndEIP2930.spec.ts b/packages/tx/test/typedTxsAndEIP2930.spec.ts index 17663b7a129..2a5c05c287c 100644 --- a/packages/tx/test/typedTxsAndEIP2930.spec.ts +++ b/packages/tx/test/typedTxsAndEIP2930.spec.ts @@ -511,7 +511,10 @@ tape('[AccessListEIP2930Transaction] -> Class Specific Tests', function (t) { chainId: txData.chainId, eips: [2718, 2929, 2930], } - const usedCommon = Common.forCustomChain('mainnet', customChainParams, 'berlin') + const usedCommon = Common.custom(customChainParams, { + baseChain: Chain.Mainnet, + hardfork: Hardfork.Berlin, + }) usedCommon.setEIPs([2718, 2929, 2930]) const expectedUnsignedRaw = Buffer.from( diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index c850d6505d5..a19787c8c65 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -124,17 +124,17 @@ tape('VM -> common (chain, HFs, EIPs)', (t) => { st.end() }) - t.test( - 'should accept a custom chain config (Common.forCustomChain() static constructor)', - async (st) => { - const customChainParams = { name: 'custom', chainId: 123, networkId: 678 } - const common = Common.forCustomChain('mainnet', customChainParams, 'byzantium') + t.test('should accept a custom chain config (Common.custom() static constructor)', async (st) => { + const customChainParams = { name: 'custom', chainId: 123, networkId: 678 } + const common = Common.custom(customChainParams, { + baseChain: 'mainnet', + hardfork: 'byzantium', + }) - const vm = await VM.create({ common }) - st.equal(vm._common, common) - st.end() - } - ) + const vm = await VM.create({ common }) + st.equal(vm._common, common) + st.end() + }) t.test( 'should accept a custom chain config (Common customChains constructor option)', diff --git a/packages/vm/tests/api/runBlock.spec.ts b/packages/vm/tests/api/runBlock.spec.ts index ceffbddefec..cebadb0bfe4 100644 --- a/packages/vm/tests/api/runBlock.spec.ts +++ b/packages/vm/tests/api/runBlock.spec.ts @@ -107,15 +107,12 @@ tape('runBlock() -> successful API parameter usage', async (t) => { await uncleRun(vm, st) }) - t.test( - 'PoW block, Common custom chain (Common.forCustomChain() static constructor)', - async (st) => { - const customChainParams = { name: 'custom', chainId: 123, networkId: 678 } - const common = Common.forCustomChain('mainnet', customChainParams, 'berlin') - const vm = setupVM({ common }) - await simpleRun(vm, st) - } - ) + t.test('PoW block, Common custom chain (Common.custom() static constructor)', async (st) => { + const customChainParams = { name: 'custom', chainId: 123, networkId: 678 } + const common = Common.custom(customChainParams, { baseChain: 'mainnet', hardfork: 'berlin' }) + const vm = setupVM({ common }) + await simpleRun(vm, st) + }) t.test('PoW block, Common custom chain (Common customChains constructor option)', async (st) => { const customChains = [testnet] diff --git a/packages/vm/tests/tester/config.ts b/packages/vm/tests/tester/config.ts index 59d8f9c3993..0b2ccdad9f6 100644 --- a/packages/vm/tests/tester/config.ts +++ b/packages/vm/tests/tester/config.ts @@ -341,12 +341,14 @@ export function getCommon(targetNetwork: string) { }) } } - return Common.forCustomChain( - 'mainnet', + return Common.custom( { hardforks: testHardforks, }, - transitionForks.startFork + { + baseChain: 'mainnet', + hardfork: transitionForks.startFork, + } ) } } diff --git a/packages/vm/tests/util.ts b/packages/vm/tests/util.ts index ec97bebe50a..f91efe3fa5b 100644 --- a/packages/vm/tests/util.ts +++ b/packages/vm/tests/util.ts @@ -396,12 +396,14 @@ export function getDAOCommon(activationBlock: number) { editedForks.push(fork) } } - const DAOCommon = Common.forCustomChain( - 'mainnet', + const DAOCommon = Common.custom( { hardforks: editedForks, }, - Hardfork.Dao + { + baseChain: 'mainnet', + hardfork: Hardfork.Dao, + } ) return DAOCommon } From d884e936cb6831784830448202101953a202c3a9 Mon Sep 17 00:00:00 2001 From: Scotty <66335769+ScottyPoi@users.noreply.github.com> Date: Fri, 11 Feb 2022 10:49:53 -0700 Subject: [PATCH 05/44] Common: Rename *BN methods to non-BN names (#1709) * common: rename nextHardforkBlockBN() to nextHardforkBlock() * common/tests: rename nextHardforkBlockBN() to nextHardforkBlock() * client: rename common.nextHardforkBlockBN() to common.nextHardforkBlock() * devp2p: rename common.nextHardforkBlockBN() to common.nextHardforkBlock() * common: rename hardforkBlockBN() to hardforkBlock() * common/tests: rename common.hardforkBlockBN() to common.hardforkBlock() * block: rename common.hardforkBlockBN() to common.hardforkBlock() * client: rename common.hardforkBlockBN() to common.hardforkBlock() * blockchain: rename common.hardforkBlockBN() to common.hardforkBlock() * devp2p: rename common.hardforkBlockBN() to common.hardforkBlock() * vm: rename common.hardforkBlockBN() to common.hardforkBlock() * common: rename chainIdBN() to chainId() * common/tests: rename common.chainIdBN() to common.chainId() * client: rename common.chainIdBN() to common.chainId() * blockchain: rename common.chainIdBN() to common.chainId() * devp2p: rename common.chainIdBN() to common.chainId() * tx: rename common.chainIdBN() to common.chainId() * vm: rename common.chainIdBN() to common.chainId() * common: rename networkIdBN() to networkId() * common/test: rename common.networkIdBN() to common.networkId() * client: rename common.networkIdBN() to common.networkId() * block: rename common.networkIdBN() to common.networkId() --- packages/block/src/header.ts | 10 +++---- packages/block/test/block.spec.ts | 2 +- packages/block/test/eip1559block.spec.ts | 2 +- packages/block/test/util.ts | 2 +- packages/blockchain/src/index.ts | 2 +- packages/blockchain/test/pos.spec.ts | 2 +- packages/client/lib/blockchain/chain.ts | 2 +- packages/client/lib/miner/miner.ts | 2 +- .../client/lib/net/protocol/lesprotocol.ts | 2 +- packages/client/lib/rpc/modules/eth.ts | 2 +- packages/client/lib/rpc/modules/net.ts | 2 +- .../test/rpc/eth/sendRawTransaction.spec.ts | 8 +++--- packages/common/src/index.ts | 16 +++++------ packages/common/tests/chains.spec.ts | 8 +++--- packages/common/tests/customChains.spec.ts | 20 ++++++------- packages/common/tests/hardforks.spec.ts | 28 +++++++++---------- packages/devp2p/src/protocol/eth.ts | 8 +++--- packages/devp2p/src/protocol/les.ts | 2 +- packages/tx/examples/custom-chain-tx.ts | 2 +- packages/tx/src/baseTransaction.ts | 2 +- packages/tx/src/eip1559Transaction.ts | 2 +- packages/tx/src/eip2930Transaction.ts | 2 +- packages/tx/src/legacyTransaction.ts | 14 +++++----- packages/tx/test/legacy.spec.ts | 14 +++++----- packages/tx/test/typedTxsAndEIP2930.spec.ts | 4 +-- packages/vm/src/evm/eei.ts | 2 +- packages/vm/src/runBlock.ts | 2 +- .../tests/api/EIPs/eip-1559-FeeMarket.spec.ts | 2 +- .../tests/api/EIPs/eip-3198-BaseFee.spec.ts | 2 +- packages/vm/tests/api/runTx.spec.ts | 2 +- packages/vm/tests/api/utils.ts | 2 +- 31 files changed, 86 insertions(+), 86 deletions(-) diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index ea52445b51d..371cdbf10d0 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -265,7 +265,7 @@ export class BlockHeader { if (this._common.isActivatedEIP(1559)) { if (baseFeePerGas === undefined) { - const londonHfBlock = this._common.hardforkBlockBN(Hardfork.London) + const londonHfBlock = this._common.hardforkBlock(Hardfork.London) const isInitialEIP1559Block = londonHfBlock && number.eq(londonHfBlock) if (isInitialEIP1559Block) { baseFeePerGas = new BN(this._common.param('gasConfig', 'initialBaseFee')) @@ -400,7 +400,7 @@ export class BlockHeader { if (nonce.length !== 8) { // Hack to check for Kovan due to non-standard nonce length (65 bytes) - if (this._common.networkIdBN().eqn(42)) { + if (this._common.networkId().eqn(42)) { if (nonce.length !== 65) { const msg = this._errorMsg( `nonce must be 65 bytes on kovan, received ${nonce.length} bytes` @@ -578,7 +578,7 @@ export class BlockHeader { let parentGasLimit = parentBlockHeader.gasLimit // EIP-1559: assume double the parent gas limit on fork block // to adopt to the new gas target centered logic - const londonHardforkBlock = this._common.hardforkBlockBN(Hardfork.London) + const londonHardforkBlock = this._common.hardforkBlock(Hardfork.London) if (londonHardforkBlock && this.number.eq(londonHardforkBlock)) { const elasticity = new BN(this._common.param('gasConfig', 'elasticityMultiplier')) parentGasLimit = parentGasLimit.mul(elasticity) @@ -728,7 +728,7 @@ export class BlockHeader { const msg = this._errorMsg('EIP1559 block has no base fee field') throw new Error(msg) } - const londonHfBlock = this._common.hardforkBlockBN(Hardfork.London) + const londonHfBlock = this._common.hardforkBlock(Hardfork.London) const isInitialEIP1559Block = londonHfBlock && this.number.eq(londonHfBlock) if (isInitialEIP1559Block) { const initialBaseFee = new BN(this._common.param('gasConfig', 'initialBaseFee')) @@ -1024,7 +1024,7 @@ export class BlockHeader { if (!this._common.hardforkIsActiveOnChain(Hardfork.Dao)) { return } - const DAOActivationBlock = this._common.hardforkBlockBN(Hardfork.Dao) + const DAOActivationBlock = this._common.hardforkBlock(Hardfork.Dao) if (!DAOActivationBlock || DAOActivationBlock.isZero() || this.number.lt(DAOActivationBlock)) { return } diff --git a/packages/block/test/block.spec.ts b/packages/block/test/block.spec.ts index b0cda5abd16..06373518fef 100644 --- a/packages/block/test/block.spec.ts +++ b/packages/block/test/block.spec.ts @@ -526,7 +526,7 @@ tape('[Block]: block functions', function (t) { const common = new Common({ chain: Chain.Mainnet }) common.setHardfork(Hardfork.Berlin) - const mainnetForkBlock = common.hardforkBlockBN(Hardfork.London) + const mainnetForkBlock = common.hardforkBlock(Hardfork.London) const rootBlock = Block.fromBlockData({ header: { number: mainnetForkBlock!.subn(3), diff --git a/packages/block/test/eip1559block.spec.ts b/packages/block/test/eip1559block.spec.ts index f2134f3593b..cbc3ddcd1a0 100644 --- a/packages/block/test/eip1559block.spec.ts +++ b/packages/block/test/eip1559block.spec.ts @@ -23,7 +23,7 @@ const genesis = Block.fromBlockData({}) // Small hack to hack in the activation block number // (Otherwise there would be need for a custom chain only for testing purposes) -common.hardforkBlockBN = function (hardfork: string | undefined) { +common.hardforkBlock = function (hardfork: string | undefined) { if (hardfork === 'london') { return new BN(1) } else if (hardfork === 'dao') { diff --git a/packages/block/test/util.ts b/packages/block/test/util.ts index 05465a1de35..22d6fb9531f 100644 --- a/packages/block/test/util.ts +++ b/packages/block/test/util.ts @@ -24,7 +24,7 @@ function createBlock( const number = parentBlock.header.number.addn(1) const timestamp = parentBlock.header.timestamp.addn(1) - const londonHfBlock = common.hardforkBlockBN(Hardfork.London) + const londonHfBlock = common.hardforkBlock(Hardfork.London) const baseFeePerGas = londonHfBlock && number.gt(londonHfBlock) ? parentBlock.header.calcNextBaseFee() : undefined diff --git a/packages/blockchain/src/index.ts b/packages/blockchain/src/index.ts index 01903a421a9..8e2ecd9e2ab 100644 --- a/packages/blockchain/src/index.ts +++ b/packages/blockchain/src/index.ts @@ -917,7 +917,7 @@ export default class Blockchain implements BlockchainInterface { const currentTd = { header: new BN(0), block: new BN(0) } let dbOps: DBOp[] = [] - if (!block._common.chainIdBN().eq(this._common.chainIdBN())) { + if (!block._common.chainId().eq(this._common.chainId())) { throw new Error('Chain mismatch while trying to put block or header') } diff --git a/packages/blockchain/test/pos.spec.ts b/packages/blockchain/test/pos.spec.ts index 046b07be4f8..2d605b2b0ac 100644 --- a/packages/blockchain/test/pos.spec.ts +++ b/packages/blockchain/test/pos.spec.ts @@ -7,7 +7,7 @@ import testnet from './testdata/testnet.json' const buildChain = async (blockchain: Blockchain, common: Common, height: number) => { const blocks: Block[] = [] - const londonBlockNumber = common.hardforkBlockBN('london')!.toNumber() + const londonBlockNumber = common.hardforkBlock('london')!.toNumber() const genesis = Block.genesis({}, { common }) blocks.push(genesis) diff --git a/packages/client/lib/blockchain/chain.ts b/packages/client/lib/blockchain/chain.ts index 62d0def62e3..50cef26058c 100644 --- a/packages/client/lib/blockchain/chain.ts +++ b/packages/client/lib/blockchain/chain.ts @@ -144,7 +144,7 @@ export class Chain { * Network ID */ get networkId(): BN { - return this.config.chainCommon.networkIdBN() + return this.config.chainCommon.networkId() } /** diff --git a/packages/client/lib/miner/miner.ts b/packages/client/lib/miner/miner.ts index 66166a0cb13..121d3b4e74a 100644 --- a/packages/client/lib/miner/miner.ts +++ b/packages/client/lib/miner/miner.ts @@ -220,7 +220,7 @@ export class Miner { } let baseFeePerGas - const londonHardforkBlock = this.config.chainCommon.hardforkBlockBN(Hardfork.London) + const londonHardforkBlock = this.config.chainCommon.hardforkBlock(Hardfork.London) const isInitialEIP1559Block = londonHardforkBlock && number.eq(londonHardforkBlock) if (isInitialEIP1559Block) { // Get baseFeePerGas from `paramByEIP` since 1559 not currently active on common diff --git a/packages/client/lib/net/protocol/lesprotocol.ts b/packages/client/lib/net/protocol/lesprotocol.ts index fbed3b9a070..50676ab1640 100644 --- a/packages/client/lib/net/protocol/lesprotocol.ts +++ b/packages/client/lib/net/protocol/lesprotocol.ts @@ -168,7 +168,7 @@ export class LesProtocol extends Protocol { } const forkHash = this.config.chainCommon.forkHash(this.config.chainCommon.hardfork()) - const nextFork = this.config.chainCommon.nextHardforkBlockBN(this.config.chainCommon.hardfork()) + const nextFork = this.config.chainCommon.nextHardforkBlock(this.config.chainCommon.hardfork()) const forkID = [ Buffer.from(forkHash.slice(2), 'hex'), nextFork ? nextFork.toArrayLike(Buffer) : Buffer.from([]), diff --git a/packages/client/lib/rpc/modules/eth.ts b/packages/client/lib/rpc/modules/eth.ts index 5d6a7a69138..b829325f93a 100644 --- a/packages/client/lib/rpc/modules/eth.ts +++ b/packages/client/lib/rpc/modules/eth.ts @@ -487,7 +487,7 @@ export class Eth { * @returns The chain ID. */ async chainId(_params = []) { - const chainId = this._chain.config.chainCommon.chainIdBN() + const chainId = this._chain.config.chainCommon.chainId() return bnToHex(chainId) } diff --git a/packages/client/lib/rpc/modules/net.ts b/packages/client/lib/rpc/modules/net.ts index b80b1b5292a..6596e8c63de 100644 --- a/packages/client/lib/rpc/modules/net.ts +++ b/packages/client/lib/rpc/modules/net.ts @@ -34,7 +34,7 @@ export class Net { * @param params An empty array */ version(_params = []) { - return this._chain.config.chainCommon.chainIdBN().toString() + return this._chain.config.chainCommon.chainId().toString() } /** diff --git a/packages/client/test/rpc/eth/sendRawTransaction.spec.ts b/packages/client/test/rpc/eth/sendRawTransaction.spec.ts index 8531f7dd29f..8833aea20e9 100644 --- a/packages/client/test/rpc/eth/sendRawTransaction.spec.ts +++ b/packages/client/test/rpc/eth/sendRawTransaction.spec.ts @@ -9,7 +9,7 @@ import { checkError } from '../util' const method = 'eth_sendRawTransaction' tape(`${method}: call with valid arguments`, async (t) => { - const syncTargetHeight = new Common({ chain: Chain.Mainnet }).hardforkBlockBN(Hardfork.London) + const syncTargetHeight = new Common({ chain: Chain.Mainnet }).hardforkBlock(Hardfork.London) const { server } = baseSetup({ syncTargetHeight, includeVM: true }) // Mainnet EIP-1559 tx @@ -44,7 +44,7 @@ tape(`${method}: call with sync target height not set yet`, async (t) => { }) tape(`${method}: call with invalid tx (wrong chain ID)`, async (t) => { - const syncTargetHeight = new Common({ chain: Chain.Mainnet }).hardforkBlockBN(Hardfork.London) + const syncTargetHeight = new Common({ chain: Chain.Mainnet }).hardforkBlock(Hardfork.London) const { server } = baseSetup({ syncTargetHeight, includeVM: true }) // Baikal EIP-1559 tx @@ -57,7 +57,7 @@ tape(`${method}: call with invalid tx (wrong chain ID)`, async (t) => { }) tape(`${method}: call with unsigned tx`, async (t) => { - const syncTargetHeight = new Common({ chain: Chain.Mainnet }).hardforkBlockBN(Hardfork.London) + const syncTargetHeight = new Common({ chain: Chain.Mainnet }).hardforkBlock(Hardfork.London) const { server } = baseSetup({ syncTargetHeight }) // Mainnet EIP-1559 tx @@ -79,7 +79,7 @@ tape(`${method}: call with unsigned tx`, async (t) => { }) tape(`${method}: call with no peers`, async (t) => { - const syncTargetHeight = new Common({ chain: Chain.Mainnet }).hardforkBlockBN(Hardfork.London) + const syncTargetHeight = new Common({ chain: Chain.Mainnet }).hardforkBlock(Hardfork.London) const { server } = baseSetup({ syncTargetHeight, includeVM: true, noPeers: true }) // Mainnet EIP-1559 tx diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index f9320f00dc3..46a7068f942 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -664,7 +664,7 @@ export default class Common extends EventEmitter { hardforkIsActiveOnBlock(hardfork: string | Hardfork | null, blockNumber: BNLike): boolean { blockNumber = toType(blockNumber, TypeOutput.BN) hardfork = hardfork ?? this._hardfork - const hfBlock = this.hardforkBlockBN(hardfork) + const hfBlock = this.hardforkBlock(hardfork) if (hfBlock && blockNumber.gte(hfBlock)) { return true } @@ -760,7 +760,7 @@ export default class Common extends EventEmitter { * @param hardfork Hardfork name, optional if HF set * @returns Block number or null if unscheduled */ - hardforkBlockBN(hardfork?: string | Hardfork): BN | null { + hardforkBlock(hardfork?: string | Hardfork): BN | null { hardfork = hardfork ?? this._hardfork const block = this._getHardfork(hardfork)['block'] if (block === undefined || block === null) { @@ -792,7 +792,7 @@ export default class Common extends EventEmitter { isHardforkBlock(blockNumber: BNLike, hardfork?: string | Hardfork): boolean { blockNumber = toType(blockNumber, TypeOutput.BN) hardfork = hardfork ?? this._hardfork - const block = this.hardforkBlockBN(hardfork) + const block = this.hardforkBlock(hardfork) return block ? block.eq(blockNumber) : false } @@ -801,9 +801,9 @@ export default class Common extends EventEmitter { * @param hardfork Hardfork name, optional if HF set * @returns Block number or null if not available */ - nextHardforkBlockBN(hardfork?: string | Hardfork): BN | null { + nextHardforkBlock(hardfork?: string | Hardfork): BN | null { hardfork = hardfork ?? this._hardfork - const hfBlock = this.hardforkBlockBN(hardfork) + const hfBlock = this.hardforkBlock(hardfork) if (hfBlock === null) { return null } @@ -827,7 +827,7 @@ export default class Common extends EventEmitter { isNextHardforkBlock(blockNumber: BNLike, hardfork?: string | Hardfork): boolean { blockNumber = toType(blockNumber, TypeOutput.BN) hardfork = hardfork ?? this._hardfork - const nextHardforkBlock = this.nextHardforkBlockBN(hardfork) + const nextHardforkBlock = this.nextHardforkBlock(hardfork) return nextHardforkBlock === null ? false : nextHardforkBlock.eq(blockNumber) } @@ -977,7 +977,7 @@ export default class Common extends EventEmitter { * Returns the Id of current chain * @returns chain Id */ - chainIdBN(): BN { + chainId(): BN { return new BN(this._chainParams['chainId']) } @@ -993,7 +993,7 @@ export default class Common extends EventEmitter { * Returns the Id of current network * @returns network Id */ - networkIdBN(): BN { + networkId(): BN { return new BN(this._chainParams['networkId']) } diff --git a/packages/common/tests/chains.spec.ts b/packages/common/tests/chains.spec.ts index 4cd5a40aaa8..a78db565dd0 100644 --- a/packages/common/tests/chains.spec.ts +++ b/packages/common/tests/chains.spec.ts @@ -6,8 +6,8 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { t.test('Should initialize with chain provided', function (st: tape.Test) { let c = new Common({ chain: 'mainnet' }) st.equal(c.chainName(), 'mainnet', 'should initialize with chain name') - st.ok(c.chainIdBN().eqn(1), 'should return correct chain Id') - st.ok(c.networkIdBN().eqn(1), 'should return correct network Id') + st.ok(c.chainId().eqn(1), 'should return correct chain Id') + st.ok(c.networkId().eqn(1), 'should return correct network Id') st.equal(c.hardfork(), 'istanbul', 'should set hardfork to current default hardfork') st.equal( c.hardfork(), @@ -24,8 +24,8 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { t.test('Should initialize with chain provided by Chain enum', function (st: tape.Test) { const c = new Common({ chain: Chain.Mainnet }) st.equal(c.chainName(), 'mainnet', 'should initialize with chain name') - st.ok(c.chainIdBN().eqn(1), 'should return correct chain Id') - st.ok(c.networkIdBN().eqn(1), 'should return correct network Id') + st.ok(c.chainId().eqn(1), 'should return correct chain Id') + st.ok(c.networkId().eqn(1), 'should return correct network Id') st.equal(c.hardfork(), 'istanbul', 'should set hardfork to current default hardfork') st.equal( c.hardfork(), diff --git a/packages/common/tests/customChains.spec.ts b/packages/common/tests/customChains.spec.ts index c7de31ca85a..7c31556b491 100644 --- a/packages/common/tests/customChains.spec.ts +++ b/packages/common/tests/customChains.spec.ts @@ -13,8 +13,8 @@ tape('[Common]: Custom chains', function (t: tape.Test) { function (st: tape.Test) { const c = new Common({ chain: testnet, hardfork: Hardfork.Byzantium }) st.equal(c.chainName(), 'testnet', 'should initialize with chain name') - st.ok(c.chainIdBN().eqn(12345), 'should return correct chain Id') - st.ok(c.networkIdBN().eqn(12345), 'should return correct network Id') + st.ok(c.chainId().eqn(12345), 'should return correct chain Id') + st.ok(c.networkId().eqn(12345), 'should return correct network Id') st.equal( c.genesis().hash, '0xaa00000000000000000000000000000000000000000000000000000000000000', @@ -52,8 +52,8 @@ tape('[Common]: Custom chains', function (t: tape.Test) { // From custom chain params st.equal(customChainCommon.chainName(), customChainParams.name) - st.ok(customChainCommon.chainIdBN().eqn(customChainParams.chainId)) - st.ok(customChainCommon.networkIdBN().eqn(customChainParams.networkId)) + st.ok(customChainCommon.chainId().eqn(customChainParams.chainId)) + st.ok(customChainCommon.networkId().eqn(customChainParams.networkId)) // Fallback params from mainnet st.equal(customChainCommon.genesis(), mainnetCommon.genesis()) @@ -68,12 +68,12 @@ tape('[Common]: Custom chains', function (t: tape.Test) { t.test('custom() -> behavior', function (st: tape.Test) { let common = Common.custom({ chainId: 123 }) - st.deepEqual(common.networkIdBN(), new BN(1), 'should default to mainnet base chain') + st.deepEqual(common.networkId(), new BN(1), 'should default to mainnet base chain') st.equal(common.chainName(), 'custom-chain', 'should set default custom chain name') common = Common.custom(CustomChain.PolygonMumbai) st.deepEqual( - common.networkIdBN(), + common.networkId(), new BN(80001), 'supported chain -> should initialize with correct chain ID' ) @@ -137,11 +137,11 @@ tape('[Common]: Custom chains', function (t: tape.Test) { customChains: [testnet], }) st.equal(c.chainName(), 'mainnet', 'customChains, chain set to supported chain') - st.ok(c.hardforkBlockBN()!.eqn(4370000), 'customChains, chain set to supported chain') + st.ok(c.hardforkBlock()!.eqn(4370000), 'customChains, chain set to supported chain') c.setChain('testnet') st.equal(c.chainName(), 'testnet', 'customChains, chain switched to custom chain') - st.ok(c.hardforkBlockBN()!.eqn(4), 'customChains, chain switched to custom chain') + st.ok(c.hardforkBlock()!.eqn(4), 'customChains, chain switched to custom chain') c = new Common({ chain: 'testnet', @@ -149,7 +149,7 @@ tape('[Common]: Custom chains', function (t: tape.Test) { customChains: [testnet], }) st.equal(c.chainName(), 'testnet', 'customChains, chain initialized with custom chain') - st.ok(c.hardforkBlockBN()!.eqn(4), 'customChains, chain initialized with custom chain') + st.ok(c.hardforkBlock()!.eqn(4), 'customChains, chain initialized with custom chain') st.deepEqual( c.genesisState(), {}, @@ -163,7 +163,7 @@ tape('[Common]: Custom chains', function (t: tape.Test) { customChains, }) st.equal(c.chainName(), 'testnet2', 'customChains, chain initialized with custom chain') - st.ok(c.hardforkBlockBN()!.eqn(10), 'customChains, chain initialized with custom chain') + st.ok(c.hardforkBlock()!.eqn(10), 'customChains, chain initialized with custom chain') c.setChain('testnet') st.equal(c.chainName(), 'testnet', 'customChains, should allow to switch custom chain') diff --git a/packages/common/tests/hardforks.spec.ts b/packages/common/tests/hardforks.spec.ts index eac4cf165d2..a7af1e906b8 100644 --- a/packages/common/tests/hardforks.spec.ts +++ b/packages/common/tests/hardforks.spec.ts @@ -73,15 +73,15 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('hardforkBlock()', function (st: tape.Test) { let c = new Common({ chain: Chain.Ropsten }) let msg = 'should return the correct HF change block for byzantium (provided)' - st.ok(c.hardforkBlockBN(Hardfork.Byzantium)!.eqn(1700000), msg) + st.ok(c.hardforkBlock(Hardfork.Byzantium)!.eqn(1700000), msg) c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) msg = 'should return the correct HF change block for byzantium (set)' - st.ok(c.hardforkBlockBN()!.eqn(1700000), msg) + st.ok(c.hardforkBlock()!.eqn(1700000), msg) c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Istanbul }) msg = 'should return the correct HF change block for istanbul (set)' - st.ok(c.hardforkBlockBN()!.eqn(6485846), msg) + st.ok(c.hardforkBlock()!.eqn(6485846), msg) st.end() }) @@ -108,22 +108,22 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { let c = new Common({ chain: Chain.Rinkeby, hardfork: Hardfork.Chainstart }) let msg = 'should work with HF set / return correct next HF block for chainstart (rinkeby: chainstart -> homestead)' - st.ok(c.nextHardforkBlockBN()!.eqn(1), msg) + st.ok(c.nextHardforkBlock()!.eqn(1), msg) msg = 'should correctly skip a HF where block is set to null (rinkeby: homestead -> (dao) -> tangerineWhistle)' - st.ok(c.nextHardforkBlockBN('homestead')!.eqn(2), msg) + st.ok(c.nextHardforkBlock('homestead')!.eqn(2), msg) msg = 'should return correct next HF (rinkeby: byzantium -> constantinople)' - st.ok(c.nextHardforkBlockBN(Hardfork.Byzantium)!.eqn(3660663), msg) + st.ok(c.nextHardforkBlock(Hardfork.Byzantium)!.eqn(3660663), msg) msg = 'should return null if next HF is not available (rinkeby: london -> shanghai)' - st.equal(c.nextHardforkBlockBN(Hardfork.London), null, msg) + st.equal(c.nextHardforkBlock(Hardfork.London), null, msg) msg = 'should work correctly along the need to skip several forks (ropsten: chainstart -> (homestead) -> (dao) -> (tangerineWhistle) -> spuriousDragon)' c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Chainstart }) - st.ok(c.nextHardforkBlockBN()!.eqn(10), msg) + st.ok(c.nextHardforkBlock()!.eqn(10), msg) st.end() }) @@ -221,19 +221,19 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { st.end() }) - t.test('hardforkBlockBN()', function (st: tape.Test) { + t.test('hardforkBlock()', function (st: tape.Test) { const c = new Common({ chain: Chain.Mainnet }) let msg = 'should return correct value' - st.ok(c.hardforkBlockBN(Hardfork.Berlin)!.eqn(12244000), msg) - st.ok(c.hardforkBlockBN(Hardfork.Berlin)!.eq(new BN(12244000)), msg) + st.ok(c.hardforkBlock(Hardfork.Berlin)!.eqn(12244000), msg) + st.ok(c.hardforkBlock(Hardfork.Berlin)!.eq(new BN(12244000)), msg) msg = 'should return null for unscheduled hardfork' // developer note: when Shanghai is set, // update this test to next unscheduled hardfork. - st.equal(c.hardforkBlockBN(Hardfork.Shanghai), null, msg) - st.equal(c.hardforkBlockBN(Hardfork.Shanghai), null, msg) - st.equal(c.nextHardforkBlockBN(Hardfork.Shanghai), null, msg) + st.equal(c.hardforkBlock(Hardfork.Shanghai), null, msg) + st.equal(c.hardforkBlock(Hardfork.Shanghai), null, msg) + st.equal(c.nextHardforkBlock(Hardfork.Shanghai), null, msg) st.end() }) diff --git a/packages/devp2p/src/protocol/eth.ts b/packages/devp2p/src/protocol/eth.ts index 2f8720cc4c2..df0434b362e 100644 --- a/packages/devp2p/src/protocol/eth.ts +++ b/packages/devp2p/src/protocol/eth.ts @@ -24,10 +24,10 @@ export class ETH extends Protocol { this._hardfork = c.hardfork() ? c.hardfork() : this._hardfork // Set latestBlock minimally to start block of fork to have some more // accurate basis if no latestBlock is provided along status send - this._latestBlock = c.hardforkBlockBN(this._hardfork) ?? new BN(0) + this._latestBlock = c.hardforkBlock(this._hardfork) ?? new BN(0) this._forkHash = c.forkHash(this._hardfork) // Next fork block number or 0 if none available - this._nextForkBlock = c.nextHardforkBlockBN(this._hardfork) ?? new BN(0) + this._nextForkBlock = c.nextHardforkBlock(this._hardfork) ?? new BN(0) } } @@ -120,7 +120,7 @@ export class ETH extends Protocol { } if (!c.hardforkGteHardfork(peerFork.name, this._hardfork)) { - const nextHardforkBlock = c.nextHardforkBlockBN(peerFork.name) + const nextHardforkBlock = c.nextHardforkBlock(peerFork.name) if (peerNextFork === null || !nextHardforkBlock || !nextHardforkBlock.eq(peerNextFork)) { const msg = 'Outdated fork status, remote needs software update' this.debug('STATUS', msg) @@ -214,7 +214,7 @@ export class ETH extends Protocol { if (this._status !== null) return this._status = [ int2buffer(this._version), - this._peer._common.chainIdBN().toArrayLike(Buffer), + this._peer._common.chainId().toArrayLike(Buffer), status.td, status.bestHash, status.genesisHash, diff --git a/packages/devp2p/src/protocol/les.ts b/packages/devp2p/src/protocol/les.ts index 2dfbe1aa1fd..a1b5345faeb 100644 --- a/packages/devp2p/src/protocol/les.ts +++ b/packages/devp2p/src/protocol/les.ts @@ -154,7 +154,7 @@ export class LES extends Protocol { status['announceType'] = int2buffer(DEFAULT_ANNOUNCE_TYPE) } status['protocolVersion'] = int2buffer(this._version) - status['networkId'] = this._peer._common.chainIdBN().toArrayLike(Buffer) + status['networkId'] = this._peer._common.chainId().toArrayLike(Buffer) this._status = status diff --git a/packages/tx/examples/custom-chain-tx.ts b/packages/tx/examples/custom-chain-tx.ts index 9885bad3f7c..bac237c4ce4 100644 --- a/packages/tx/examples/custom-chain-tx.ts +++ b/packages/tx/examples/custom-chain-tx.ts @@ -48,4 +48,4 @@ if (signedTx.validate() && signedTx.getSenderAddress().equals(address)) { console.log('Invalid signature') } -console.log("The transaction's chain id is: ", signedTx.common.chainIdBN().toString()) +console.log("The transaction's chain id is: ", signedTx.common.chainId().toString()) diff --git a/packages/tx/src/baseTransaction.ts b/packages/tx/src/baseTransaction.ts index 62ab142531e..10c7d651173 100644 --- a/packages/tx/src/baseTransaction.ts +++ b/packages/tx/src/baseTransaction.ts @@ -351,7 +351,7 @@ export abstract class BaseTransaction { if (chainId) { const chainIdBN = new BN(toBuffer(chainId)) if (common) { - if (!common.chainIdBN().eq(chainIdBN)) { + if (!common.chainId().eq(chainIdBN)) { const msg = this._errorMsg('The chain ID does not match the chain ID of Common') throw new Error(msg) } diff --git a/packages/tx/src/eip1559Transaction.ts b/packages/tx/src/eip1559Transaction.ts index 4a85dec630a..125767501d9 100644 --- a/packages/tx/src/eip1559Transaction.ts +++ b/packages/tx/src/eip1559Transaction.ts @@ -187,7 +187,7 @@ export default class FeeMarketEIP1559Transaction extends BaseTransaction { // instead of hashing only the first six elements (i.e. nonce, gasprice, startgas, to, value, data) // hash nine elements, with v replaced by CHAIN_ID, r = 0 and s = 0. const v = this.v! - const chainIdDoubled = this.common.chainIdBN().muln(2) + const chainIdDoubled = this.common.chainId().muln(2) // v and chain ID meet EIP-155 conditions if (v.eq(chainIdDoubled.addn(35)) || v.eq(chainIdDoubled.addn(36))) { @@ -197,7 +197,7 @@ export default class Transaction extends BaseTransaction { ] if (this.supports(Capability.EIP155ReplayProtection)) { - values.push(toBuffer(this.common.chainIdBN())) + values.push(toBuffer(this.common.chainId())) values.push(unpadBuffer(toBuffer(0))) values.push(unpadBuffer(toBuffer(0))) } @@ -322,7 +322,7 @@ export default class Transaction extends BaseTransaction { v!, bnToUnpaddedBuffer(r!), bnToUnpaddedBuffer(s!), - this.supports(Capability.EIP155ReplayProtection) ? this.common.chainIdBN() : undefined + this.supports(Capability.EIP155ReplayProtection) ? this.common.chainId() : undefined ) } catch (e: any) { const msg = this._errorMsg('Invalid Signature') @@ -336,7 +336,7 @@ export default class Transaction extends BaseTransaction { protected _processSignature(v: number, r: Buffer, s: Buffer) { const vBN = new BN(v) if (this.supports(Capability.EIP155ReplayProtection)) { - vBN.iadd(this.common.chainIdBN().muln(2).addn(8)) + vBN.iadd(this.common.chainId().muln(2).addn(8)) } const opts = { @@ -390,12 +390,12 @@ export default class Transaction extends BaseTransaction { !v.eqn(28) ) { if (common) { - const chainIdDoubled = common.chainIdBN().muln(2) + const chainIdDoubled = common.chainId().muln(2) const isValidEIP155V = v.eq(chainIdDoubled.addn(35)) || v.eq(chainIdDoubled.addn(36)) if (!isValidEIP155V) { throw new Error( - `Incompatible EIP155-based V ${v} and chain id ${common.chainIdBN()}. See the Common parameter of the Transaction constructor to set the chain id.` + `Incompatible EIP155-based V ${v} and chain id ${common.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.` ) } } else { @@ -434,7 +434,7 @@ export default class Transaction extends BaseTransaction { // If block.number >= 2,675,000 and v = CHAIN_ID * 2 + 35 or v = CHAIN_ID * 2 + 36, then when computing the hash of a transaction for purposes of signing or recovering, instead of hashing only the first six elements (i.e. nonce, gasprice, startgas, to, value, data), hash nine elements, with v replaced by CHAIN_ID, r = 0 and s = 0. const v = this.v! - const chainIdDoubled = this.common.chainIdBN().muln(2) + const chainIdDoubled = this.common.chainId().muln(2) const vAndChainIdMeetEIP155Conditions = v.eq(chainIdDoubled.addn(35)) || v.eq(chainIdDoubled.addn(36)) diff --git a/packages/tx/test/legacy.spec.ts b/packages/tx/test/legacy.spec.ts index 739a2fd3309..8839d64b6f8 100644 --- a/packages/tx/test/legacy.spec.ts +++ b/packages/tx/test/legacy.spec.ts @@ -55,28 +55,28 @@ tape('[Transaction]', function (t) { txData[6] = intToBuffer(45) // v with 0-parity and chain ID 5 let tx = Transaction.fromValuesArray(txData) st.ok( - tx.common.chainIdBN().eqn(5), + tx.common.chainId().eqn(5), 'should initialize Common with chain ID (supported) derived from v value (v with 0-parity)' ) txData[6] = intToBuffer(46) // v with 1-parity and chain ID 5 tx = Transaction.fromValuesArray(txData) st.ok( - tx.common.chainIdBN().eqn(5), + tx.common.chainId().eqn(5), 'should initialize Common with chain ID (supported) derived from v value (v with 1-parity)' ) txData[6] = intToBuffer(2033) // v with 0-parity and chain ID 999 tx = Transaction.fromValuesArray(txData) st.ok( - tx.common.chainIdBN().eqn(999), + tx.common.chainId().eqn(999), 'should initialize Common with chain ID (unsupported) derived from v value (v with 0-parity)' ) txData[6] = intToBuffer(2034) // v with 1-parity and chain ID 999 tx = Transaction.fromValuesArray(txData) st.ok( - tx.common.chainIdBN().eqn(999), + tx.common.chainId().eqn(999), 'should initialize Common with chain ID (unsupported) derived from v value (v with 1-parity)' ) st.end() @@ -113,7 +113,7 @@ tape('[Transaction]', function (t) { function (st) { let common = new Common({ chain: 42, hardfork: Hardfork.Petersburg }) let tx = Transaction.fromTxData({}, { common }) - st.ok(tx.common.chainIdBN().eqn(42)) + st.ok(tx.common.chainId().eqn(42)) const privKey = Buffer.from(txFixtures[0].privateKey, 'hex') tx = tx.sign(privKey) const serialized = tx.serialize() @@ -445,7 +445,7 @@ tape('[Transaction]', function (t) { t.test('sign(), verifySignature(): sign tx with chainId specified in params', function (st) { const common = new Common({ chain: 42, hardfork: Hardfork.Petersburg }) let tx = Transaction.fromTxData({}, { common }) - st.ok(tx.common.chainIdBN().eqn(42)) + st.ok(tx.common.chainId().eqn(42)) const privKey = Buffer.from(txFixtures[0].privateKey, 'hex') tx = tx.sign(privKey) @@ -454,7 +454,7 @@ tape('[Transaction]', function (t) { const reTx = Transaction.fromSerializedTx(serialized, { common }) st.equal(reTx.verifySignature(), true) - st.ok(reTx.common.chainIdBN().eqn(42)) + st.ok(reTx.common.chainId().eqn(42)) st.end() }) diff --git a/packages/tx/test/typedTxsAndEIP2930.spec.ts b/packages/tx/test/typedTxsAndEIP2930.spec.ts index 2a5c05c287c..6beaf89c125 100644 --- a/packages/tx/test/typedTxsAndEIP2930.spec.ts +++ b/packages/tx/test/typedTxsAndEIP2930.spec.ts @@ -57,7 +57,7 @@ tape( chainId: 5, }) t.ok( - tx.common.chainIdBN().eqn(5), + tx.common.chainId().eqn(5), 'should initialize Common with chain ID provided (supported chain ID)' ) @@ -65,7 +65,7 @@ tape( chainId: 99999, }) t.ok( - tx.common.chainIdBN().eqn(99999), + tx.common.chainId().eqn(99999), 'should initialize Common with chain ID provided (unsupported chain ID)' ) diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index cbd3860e0f9..ba47831f1d1 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -344,7 +344,7 @@ export default class EEI { * CHAINID opcode proposed in [EIP-1344](https://eips.ethereum.org/EIPS/eip-1344). */ getChainId(): BN { - return this._common.chainIdBN() + return this._common.chainId() } /** diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index 5728cceb44c..3834152c5d2 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -144,7 +144,7 @@ export default async function runBlock(this: VM, opts: RunBlockOpts): Promise runtime behavior', async (t) => { to: address, } if (txType.type === 1) { - txParams['chainId'] = common.chainIdBN() + txParams['chainId'] = common.chainId() txParams['accessList'] = [] txParams['type'] = txType.type } diff --git a/packages/vm/tests/api/utils.ts b/packages/vm/tests/api/utils.ts index b399fc57f40..4fe705e5c72 100644 --- a/packages/vm/tests/api/utils.ts +++ b/packages/vm/tests/api/utils.ts @@ -66,7 +66,7 @@ export function getTransaction( } if (txType === 1) { - txParams['chainId'] = common.chainIdBN() + txParams['chainId'] = common.chainId() txParams['accessList'] = [ { address: '0x0000000000000000000000000000000000000101', From 2662444810ca50038de9aed1f8bebe86c266e41c Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Mon, 21 Feb 2022 18:26:34 +0200 Subject: [PATCH 06/44] Upgrade ethereum-cryptography to 1.0. (#1714) --- packages/util/package.json | 3 +-- packages/util/src/account.ts | 30 ++++++++++++++++----------- packages/util/src/hash.ts | 33 ++++++++++++++++-------------- packages/util/src/signature.ts | 10 +++++---- packages/util/test/account.spec.ts | 33 ++++++++++++++++++++++-------- 5 files changed, 67 insertions(+), 42 deletions(-) diff --git a/packages/util/package.json b/packages/util/package.json index 455e769603e..d3a7c9a955f 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -39,8 +39,7 @@ "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", + "ethereum-cryptography": "^1.0.3", "rlp": "^2.2.4" }, "devDependencies": { diff --git a/packages/util/src/account.ts b/packages/util/src/account.ts index 358e4ffe75c..466fea90727 100644 --- a/packages/util/src/account.ts +++ b/packages/util/src/account.ts @@ -1,10 +1,5 @@ import { BN, rlp } from './externals' -import { - privateKeyVerify, - publicKeyCreate, - publicKeyVerify, - publicKeyConvert, -} from 'ethereum-cryptography/secp256k1' +import { Point, utils } from 'ethereum-cryptography/secp256k1' import { stripHexPrefix } from './internal' import { KECCAK256_RLP, KECCAK256_NULL } from './constants' import { zeros, bufferToHex, toBuffer } from './bytes' @@ -231,7 +226,7 @@ export const generateAddress2 = function (from: Buffer, salt: Buffer, initCode: * Checks if the private key satisfies the rules of the curve secp256k1. */ export const isValidPrivate = function (privateKey: Buffer): boolean { - return privateKeyVerify(privateKey) + return utils.isValidPrivateKey(privateKey) } /** @@ -244,14 +239,25 @@ export const isValidPublic = function (publicKey: Buffer, sanitize: boolean = fa assertIsBuffer(publicKey) if (publicKey.length === 64) { // Convert to SEC1 for secp256k1 - return publicKeyVerify(Buffer.concat([Buffer.from([4]), publicKey])) + // Automatically checks whether point is on curve + try { + Point.fromHex(Buffer.concat([Buffer.from([4]), publicKey])) + return true + } catch (e) { + return false + } } if (!sanitize) { return false } - return publicKeyVerify(publicKey) + try { + Point.fromHex(publicKey) + return true + } catch (e) { + return false + } } /** @@ -263,7 +269,7 @@ export const isValidPublic = function (publicKey: Buffer, sanitize: boolean = fa export const pubToAddress = function (pubKey: Buffer, sanitize: boolean = false): Buffer { assertIsBuffer(pubKey) if (sanitize && pubKey.length !== 64) { - pubKey = Buffer.from(publicKeyConvert(pubKey, false).slice(1)) + pubKey = Buffer.from(Point.fromHex(pubKey).toRawBytes(false).slice(1)) } if (pubKey.length !== 64) { throw new Error('Expected pubKey to be of length 64') @@ -280,7 +286,7 @@ export const publicToAddress = pubToAddress export const privateToPublic = function (privateKey: Buffer): Buffer { assertIsBuffer(privateKey) // skip the type flag and use the X, Y points - return Buffer.from(publicKeyCreate(privateKey, false)).slice(1) + return Buffer.from(Point.fromPrivateKey(privateKey).toRawBytes(false).slice(1)) } /** @@ -297,7 +303,7 @@ export const privateToAddress = function (privateKey: Buffer): Buffer { export const importPublic = function (publicKey: Buffer): Buffer { assertIsBuffer(publicKey) if (publicKey.length !== 64) { - publicKey = Buffer.from(publicKeyConvert(publicKey, false).slice(1)) + publicKey = Buffer.from(Point.fromHex(publicKey).toRawBytes(false).slice(1)) } return publicKey } diff --git a/packages/util/src/hash.ts b/packages/util/src/hash.ts index 1d417302b1c..31934faa46b 100644 --- a/packages/util/src/hash.ts +++ b/packages/util/src/hash.ts @@ -1,16 +1,11 @@ import { keccak224, keccak384, keccak256 as k256, keccak512 } from 'ethereum-cryptography/keccak' -const createHash = require('create-hash') +import { ripemd160 as rmd160 } from 'ethereum-cryptography/ripemd160' +import { sha256 as s256 } from 'ethereum-cryptography/sha256' import { rlp } from './externals' import { toBuffer, setLengthLeft } from './bytes' import { assertIsString, assertIsBuffer, assertIsArray, assertIsHexString } from './helpers' -/** - * Creates Keccak hash of a Buffer input - * @param a The input data (Buffer) - * @param bits (number = 256) The Keccak width - */ -export const keccak = function (a: Buffer, bits: number = 256): Buffer { - assertIsBuffer(a) +const _keccak = function (a: Buffer, bits: number): Uint8Array { switch (bits) { case 224: { return keccak224(a) @@ -29,6 +24,15 @@ export const keccak = function (a: Buffer, bits: number = 256): Buffer { } } } +/** + * Creates Keccak hash of a Buffer input + * @param a The input data (Buffer) + * @param bits (number = 256) The Keccak width + */ +export const keccak = function (a: Buffer, bits: number = 256): Buffer { + assertIsBuffer(a) + return toBuffer(_keccak(a, bits)) +} /** * Creates Keccak-256 hash of the input, alias for keccak(a, 256). @@ -73,9 +77,8 @@ export const keccakFromArray = function (a: number[], bits: number = 256) { * Creates SHA256 hash of an input. * @param a The input data (Buffer|Array|String) */ -const _sha256 = function (a: any): Buffer { - a = toBuffer(a) - return createHash('sha256').update(a).digest() +const _sha256 = function (a: Uint8Array): Buffer { + return toBuffer(s256(a)) } /** @@ -92,8 +95,8 @@ export const sha256 = function (a: Buffer): Buffer { * @param a The input data (string) */ export const sha256FromString = function (a: string): Buffer { - assertIsString(a) - return _sha256(a) + assertIsHexString(a) + return _sha256(toBuffer(a)) } /** @@ -102,7 +105,7 @@ export const sha256FromString = function (a: string): Buffer { */ export const sha256FromArray = function (a: number[]): Buffer { assertIsArray(a) - return _sha256(a) + return _sha256(Uint8Array.from(a)) } /** @@ -112,7 +115,7 @@ export const sha256FromArray = function (a: number[]): Buffer { */ const _ripemd160 = function (a: any, padded: boolean): Buffer { a = toBuffer(a) - const hash = createHash('rmd160').update(a).digest() + const hash = toBuffer(rmd160(a)) if (padded === true) { return setLengthLeft(hash, 32) } else { diff --git a/packages/util/src/signature.ts b/packages/util/src/signature.ts index aef0b12dcb0..ed1b09afbd3 100644 --- a/packages/util/src/signature.ts +++ b/packages/util/src/signature.ts @@ -1,4 +1,4 @@ -import { ecdsaSign, ecdsaRecover, publicKeyConvert } from 'ethereum-cryptography/secp256k1' +import { signSync, recoverPublicKey } from 'ethereum-cryptography/secp256k1' import { BN } from './externals' import { toBuffer, setLengthLeft, bufferToHex, bufferToInt } from './bytes' import { keccak } from './hash' @@ -23,7 +23,7 @@ export interface ECDSASignatureBuffer { export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId?: number): ECDSASignature export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId: BNLike): ECDSASignatureBuffer export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId: any): any { - const { signature, recid: recovery } = ecdsaSign(msgHash, privateKey) + const [signature, recovery] = signSync(msgHash, privateKey, { recovered: true, der: false }) const r = Buffer.from(signature.slice(0, 32)) const s = Buffer.from(signature.slice(32, 64)) @@ -35,6 +35,7 @@ export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId: any): any { 'The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)' ) } + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands const v = chainId ? recovery + (chainId * 2 + 35) : recovery + 27 return { r, s, v } } @@ -74,8 +75,9 @@ export const ecrecover = function ( if (!isValidSigRecovery(recovery)) { throw new Error('Invalid signature v value') } - const senderPubKey = ecdsaRecover(signature, recovery.toNumber(), msgHash) - return Buffer.from(publicKeyConvert(senderPubKey, false).slice(1)) + + const senderPubKey = recoverPublicKey(msgHash, signature, recovery.toNumber()) + return Buffer.from(senderPubKey.slice(1)) } /** diff --git a/packages/util/test/account.spec.ts b/packages/util/test/account.spec.ts index 34b0e5ad414..5524d74e7f1 100644 --- a/packages/util/test/account.spec.ts +++ b/packages/util/test/account.spec.ts @@ -183,19 +183,16 @@ tape('Utility Functions', function (t) { ) let tmp = '0011223344' - st.throws(function () { - isValidPrivate(Buffer.from(tmp, 'hex')) - }, 'should fail on short input') + st.notOk(isValidPrivate(Buffer.from(tmp, 'hex')), 'should fail on short input') tmp = '3a443d8381a6798a70c6ff9304bdc8cb0163c23211d11628fae52ef9e0dca11a001cf066d56a8156fc201cd5df8a36ef694eecd258903fca7086c1fae7441e1d' - st.throws(function () { - isValidPrivate(Buffer.from(tmp, 'hex')) - }, 'should fail on too big input') + st.notOk(isValidPrivate(Buffer.from(tmp, 'hex')), 'should fail on too big input') - st.throws(function () { - isValidPrivate(('WRONG_INPUT_TYPE') as Buffer) - }, 'should fail on wrong input type') + st.notOk( + isValidPrivate(('WRONG_INPUT_TYPE') as Buffer), + 'should fail on wrong input type' + ) tmp = '0000000000000000000000000000000000000000000000000000000000000000' st.notOk(isValidPrivate(Buffer.from(tmp, 'hex')), 'should fail on invalid curve (zero)') @@ -242,6 +239,24 @@ tape('Utility Functions', function (t) { ) st.notOk(isValidPublic(pubKey), 'should fail wt.testh an invalid SEC1 public key') + pubKey = Buffer.from( + '03fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f', + 'hex' + ) + st.notOk(isValidPublic(pubKey), 'should fail an invalid 33-byte public key') + + pubKey = Buffer.from( + 'fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0000000000000000000000000000000000000000000000000000000000000001', + 'hex' + ) + st.notOk(isValidPublic(pubKey), 'should fail an invalid 64-byte public key') + + pubKey = Buffer.from( + '04fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0000000000000000000000000000000000000000000000000000000000000001', + 'hex' + ) + st.notOk(isValidPublic(pubKey, true), 'should fail an invalid 65-byte public key') + pubKey = Buffer.from( '033a443d8381a6798a70c6ff9304bdc8cb0163c23211d11628fae52ef9e0dca11a', 'hex' From 8db625b77a9f4c55940f9a68d312f07d6328b8ea Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Tue, 22 Feb 2022 13:35:17 -0500 Subject: [PATCH 07/44] VM: Replace BN.js with bigints, Util helpers (#1671) * Replace BN.js with bigints in VM * Fix byteLength computation in EXP handler * Fix toTwos helper * Compute TWO_POWE256 using math instead of hex * Update packages/util/src/constants.ts Co-authored-by: Ryan Ghods * Remove unused variable * Fix exponent byte length calc * Fix exp overflow * Fix precompile bigint conversions * Fix more bigint conversions * Fix EXP opcode handler * Fix logic bug in signextend * vm/gas: fix EXTCODECOPY gas * vm/gas: fix sha256 gas * vm/gas: sha256 const -> let * vm: lint * vm/logic: fix sdiv/smod and fromTwos/toTwos * vm/logic: fix SIGNEXTEND * vm/logic: fix CALLDATALOAD padding * vm/logic: remove weird comment * Fix SAR opcode handler * Use bufferToBigInt in Push opcode handler * use bufferToBigInt everywhere * Fix missing bufferToBigInt import * Check for edge case in expmod * Ignore prettier * Update browser tsconfig to es2020 lib * Remove dup ES2020 targets * attempt to dedupe "target" and "lib" tsconfig values * Update karma config to target es2020 in parser * Various test fixes * Lint and BN fixes * Add bigint helpers to util * lint fixes * various bigint helper additions * Lint fixes * Fix bnToBigInt * Lint/test fixes * Switch Xn to BigInt(X) * lint * lint * More Xn to BigInt(X) moves Co-authored-by: Ryan Ghods Co-authored-by: Jochem Brouwer Co-authored-by: Jochem Brouwer --- config/eslint.js | 2 +- config/tsconfig.browser.json | 3 +- config/tsconfig.json | 4 +- packages/block/karma.conf.js | 3 + packages/blockchain/karma.conf.js | 3 + packages/client/karma.conf.js | 3 + packages/client/lib/miner/miner.ts | 6 +- packages/client/lib/rpc/modules/eth.ts | 4 +- .../client/test/rpc/eth/estimateGas.spec.ts | 2 +- .../client/test/rpc/eth/getBalance.spec.ts | 2 +- packages/client/tsconfig.browser.json | 1 - packages/client/tsconfig.prod.json | 1 - packages/common/karma.conf.js | 3 + packages/common/tsconfig.prod.json | 1 - packages/trie/karma.conf.js | 3 + packages/trie/tsconfig.browser.json | 5 +- packages/trie/tsconfig.json | 1 - packages/trie/tsconfig.prod.json | 2 - packages/tx/karma.conf.js | 3 + packages/util/src/bytes.ts | 18 + packages/util/src/constants.ts | 12 + packages/util/src/types.ts | 12 + packages/util/test/bytes.spec.ts | 14 + packages/util/test/constants.spec.ts | 6 + packages/util/test/types.spec.ts | 18 + packages/util/tsconfig.browser.json | 5 +- packages/util/tsconfig.json | 2 +- packages/util/tsconfig.prod.json | 2 +- packages/vm/benchmarks/util.ts | 4 +- packages/vm/karma.conf.js | 3 + packages/vm/src/buildBlock.ts | 20 +- packages/vm/src/evm/eei.ts | 166 +++++---- packages/vm/src/evm/evm.ts | 68 ++-- packages/vm/src/evm/interpreter.ts | 41 +-- packages/vm/src/evm/message.ts | 10 +- packages/vm/src/evm/opcodes/EIP1283.ts | 19 +- packages/vm/src/evm/opcodes/EIP2200.ts | 23 +- packages/vm/src/evm/opcodes/EIP2929.ts | 36 +- packages/vm/src/evm/opcodes/functions.ts | 333 +++++++++--------- packages/vm/src/evm/opcodes/gas.ts | 318 ++++++++--------- packages/vm/src/evm/opcodes/util.ts | 127 ++++--- .../vm/src/evm/precompiles/01-ecrecover.ts | 4 +- packages/vm/src/evm/precompiles/02-sha256.ts | 11 +- .../vm/src/evm/precompiles/03-ripemd160.ts | 11 +- .../vm/src/evm/precompiles/04-identity.ts | 10 +- packages/vm/src/evm/precompiles/05-modexp.ts | 137 +++---- packages/vm/src/evm/precompiles/06-ecadd.ts | 5 +- packages/vm/src/evm/precompiles/07-ecmul.ts | 5 +- .../vm/src/evm/precompiles/08-ecpairing.ts | 5 +- packages/vm/src/evm/precompiles/09-blake2f.ts | 7 +- .../vm/src/evm/precompiles/0a-bls12-g1add.ts | 5 +- .../vm/src/evm/precompiles/0b-bls12-g1mul.ts | 5 +- .../evm/precompiles/0c-bls12-g1multiexp.ts | 7 +- .../vm/src/evm/precompiles/0d-bls12-g2add.ts | 5 +- .../vm/src/evm/precompiles/0e-bls12-g2mul.ts | 5 +- .../evm/precompiles/0f-bls12-g2multiexp.ts | 7 +- .../src/evm/precompiles/10-bls12-pairing.ts | 9 +- .../evm/precompiles/11-bls12-map-fp-to-g1.ts | 5 +- .../evm/precompiles/12-bls12-map-fp2-to-g2.ts | 5 +- packages/vm/src/evm/precompiles/types.ts | 3 +- .../vm/src/evm/precompiles/util/bls12_381.ts | 13 +- packages/vm/src/evm/stack.ts | 24 +- packages/vm/src/evm/txContext.ts | 6 +- packages/vm/src/runBlock.ts | 56 +-- packages/vm/src/runCall.ts | 12 +- packages/vm/src/runCode.ts | 10 +- packages/vm/src/runTx.ts | 70 ++-- .../EIPs/eip-1283-net-gas-metering.spec.ts | 6 +- .../tests/api/EIPs/eip-1559-FeeMarket.spec.ts | 8 +- packages/vm/tests/api/EIPs/eip-2315.spec.ts | 3 +- .../vm/tests/api/EIPs/eip-2537-BLS.spec.ts | 16 +- .../api/EIPs/eip-2565-modexp-gas-cost.spec.ts | 8 +- packages/vm/tests/api/EIPs/eip-2929.spec.ts | 62 ++-- .../api/EIPs/eip-2930-accesslists.spec.ts | 8 +- .../tests/api/EIPs/eip-3198-BaseFee.spec.ts | 10 +- packages/vm/tests/api/EIPs/eip-3529.spec.ts | 43 ++- packages/vm/tests/api/EIPs/eip-3855.spec.ts | 23 +- packages/vm/tests/api/buildBlock.spec.ts | 8 +- .../api/evm/precompiles/06-ecadd.spec.ts | 5 +- .../api/evm/precompiles/07-ecmul.spec.ts | 5 +- .../api/evm/precompiles/08-ecpairing.spec.ts | 7 +- .../api/evm/precompiles/hardfork.spec.ts | 20 +- packages/vm/tests/api/evm/stack.spec.ts | 52 +-- .../vm/tests/api/istanbul/eip-1108.spec.ts | 15 +- .../vm/tests/api/istanbul/eip-1344.spec.ts | 2 +- .../vm/tests/api/istanbul/eip-152.spec.ts | 5 +- .../vm/tests/api/istanbul/eip-1884.spec.ts | 8 +- .../vm/tests/api/istanbul/eip-2200.spec.ts | 67 ++-- packages/vm/tests/api/runBlock.spec.ts | 24 +- packages/vm/tests/api/runCall.spec.ts | 62 ++-- packages/vm/tests/api/runCode.spec.ts | 9 +- packages/vm/tests/api/runTx.spec.ts | 47 ++- .../vm/tests/api/state/accountExists.spec.ts | 15 +- .../vm/tests/api/state/stateManager.spec.ts | 2 - .../tester/runners/BlockchainTestsRunner.ts | 10 +- .../tester/runners/GeneralStateTestsRunner.ts | 8 +- packages/vm/tsconfig.benchmarks.json | 1 - packages/vm/tsconfig.json | 2 +- packages/vm/tsconfig.prod.json | 1 - 99 files changed, 1231 insertions(+), 1082 deletions(-) diff --git a/config/eslint.js b/config/eslint.js index ba574442c62..bc4d661c1af 100644 --- a/config/eslint.js +++ b/config/eslint.js @@ -2,7 +2,7 @@ module.exports = { parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint', 'implicit-dependencies', 'prettier'], env: { - es6: true, + es2020: true, node: true, }, ignorePatterns: [ diff --git a/config/tsconfig.browser.json b/config/tsconfig.browser.json index db06cb81003..6b989e2fdb8 100644 --- a/config/tsconfig.browser.json +++ b/config/tsconfig.browser.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "target": "es5", - "lib": ["dom", "es5"] + "lib": ["dom", "ES2020"] } } diff --git a/config/tsconfig.json b/config/tsconfig.json index 72974100782..989b8b35269 100644 --- a/config/tsconfig.json +++ b/config/tsconfig.json @@ -11,7 +11,7 @@ "resolveJsonModule": true, "downlevelIteration": true, "strict": true, - "target": "ES2017", - "lib": ["es2018"] + "target": "es2020", + "lib": ["ES2020"] } } diff --git a/packages/block/karma.conf.js b/packages/block/karma.conf.js index 5674b6db1a2..56de7f34489 100644 --- a/packages/block/karma.conf.js +++ b/packages/block/karma.conf.js @@ -10,6 +10,9 @@ module.exports = function(config) { tsconfig: './tsconfig.json', bundlerOptions: { entrypoints: /\.spec\.ts$/, + acornOptions: { + ecmaVersion: 11 + } }, }, concurrency: 1, diff --git a/packages/blockchain/karma.conf.js b/packages/blockchain/karma.conf.js index 5674b6db1a2..56de7f34489 100644 --- a/packages/blockchain/karma.conf.js +++ b/packages/blockchain/karma.conf.js @@ -10,6 +10,9 @@ module.exports = function(config) { tsconfig: './tsconfig.json', bundlerOptions: { entrypoints: /\.spec\.ts$/, + acornOptions: { + ecmaVersion: 11 + } }, }, concurrency: 1, diff --git a/packages/client/karma.conf.js b/packages/client/karma.conf.js index 54c22d31b4e..10e4351656d 100644 --- a/packages/client/karma.conf.js +++ b/packages/client/karma.conf.js @@ -13,6 +13,9 @@ module.exports = function (config) { karmaTypescriptConfig: { bundlerOptions: { entrypoints: /\.spec\.ts$/, + acornOptions: { + ecmaVersion: 11 + }, resolve: { alias: { // Hotfix for `multiformats` client browser build error in Node 16, #1346, 2021-07-12 diff --git a/packages/client/lib/miner/miner.ts b/packages/client/lib/miner/miner.ts index 121d3b4e74a..3964347b7c1 100644 --- a/packages/client/lib/miner/miner.ts +++ b/packages/client/lib/miner/miner.ts @@ -270,11 +270,13 @@ export class Miner { await blockBuilder.addTransaction(txs[index]) } catch (error: any) { if (error.message === 'tx has a higher gas limit than the remaining gas in the block') { - if (blockBuilder.gasUsed.gt(gasLimit.subn(21000))) { + if (blockBuilder.gasUsed > BigInt(gasLimit.subn(21000).toString(10))) { // If block has less than 21000 gas remaining, consider it full blockFull = true this.config.logger.info( - `Miner: Assembled block full (gasLeft: ${gasLimit.sub(blockBuilder.gasUsed)})` + `Miner: Assembled block full (gasLeft: ${gasLimit.sub( + new BN(blockBuilder.gasUsed.toString(10)) + )})` ) } } else { diff --git a/packages/client/lib/rpc/modules/eth.ts b/packages/client/lib/rpc/modules/eth.ts index b829325f93a..ebc42e808f4 100644 --- a/packages/client/lib/rpc/modules/eth.ts +++ b/packages/client/lib/rpc/modules/eth.ts @@ -540,7 +540,7 @@ export class Eth { skipBalance: true, skipBlockGasLimitValidation: true, }) - return bnToHex(gasUsed) + return `0x${gasUsed.toString(16)}` } catch (error: any) { throw { code: INTERNAL_ERROR, @@ -778,7 +778,7 @@ export class Eth { const { gasUsed, createdAddress } = runBlockResult.results[txIndex] return jsonRpcReceipt( receipt, - gasUsed, + new BN(gasUsed.toString(10)), effectiveGasPrice, block, tx, diff --git a/packages/client/test/rpc/eth/estimateGas.spec.ts b/packages/client/test/rpc/eth/estimateGas.spec.ts index 5c0dc0ce9c8..7a5678d2d7c 100644 --- a/packages/client/test/rpc/eth/estimateGas.spec.ts +++ b/packages/client/test/rpc/eth/estimateGas.spec.ts @@ -88,7 +88,7 @@ tape(`${method}: call with valid arguments`, async (t) => { const req = params(method, [{ ...estimateTxData, gas: estimateTxData.gasLimit }, 'latest']) const expectRes = (res: any) => { const msg = 'should return the correct gas estimate' - t.equal(res.body.result, bnToHex(gasUsed), msg) + t.equal(res.body.result, '0x' + gasUsed.toString(16), msg) } await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/getBalance.spec.ts b/packages/client/test/rpc/eth/getBalance.spec.ts index 6b6d9b7b69b..ea6325897d0 100644 --- a/packages/client/test/rpc/eth/getBalance.spec.ts +++ b/packages/client/test/rpc/eth/getBalance.spec.ts @@ -50,7 +50,7 @@ tape(`${method}: ensure balance deducts after a tx`, async (t) => { const { amountSpent } = result.results[0] // verify balance is genesis amount minus amountSpent - const expectedNewBalance = genesisBalance.sub(amountSpent) + const expectedNewBalance = genesisBalance.sub(new BN(amountSpent.toString(10))) req = params(method, [address.toString(), 'latest']) expectRes = (res: any) => { const msg = 'should return the correct balance after a tx' diff --git a/packages/client/tsconfig.browser.json b/packages/client/tsconfig.browser.json index f99ce2bbebb..40534f6bddd 100644 --- a/packages/client/tsconfig.browser.json +++ b/packages/client/tsconfig.browser.json @@ -3,7 +3,6 @@ "include": ["browser/index.ts"], "exclude": ["lib/index.js"], "compilerOptions": { - "target": "ES2017", "outDir": "dist.browser", "typeRoots": ["node_modules/@types", "lib/@types"], } diff --git a/packages/client/tsconfig.prod.json b/packages/client/tsconfig.prod.json index e3cabd72ee4..cd62f7b86a6 100644 --- a/packages/client/tsconfig.prod.json +++ b/packages/client/tsconfig.prod.json @@ -3,7 +3,6 @@ "include": ["bin", "lib"], "compilerOptions": { "outDir": "dist", - "lib": ["es2018", "dom"], "typeRoots": ["node_modules/@types", "lib/@types"], }, "references": [ diff --git a/packages/common/karma.conf.js b/packages/common/karma.conf.js index 35a597daf29..83044570362 100644 --- a/packages/common/karma.conf.js +++ b/packages/common/karma.conf.js @@ -10,6 +10,9 @@ module.exports = function(config) { tsconfig: './tsconfig.json', bundlerOptions: { entrypoints: /\.spec\.ts$/, + acornOptions: { + ecmaVersion: 11 + } }, }, concurrency: 1, diff --git a/packages/common/tsconfig.prod.json b/packages/common/tsconfig.prod.json index e12cc588715..4f2491a1aa9 100644 --- a/packages/common/tsconfig.prod.json +++ b/packages/common/tsconfig.prod.json @@ -3,7 +3,6 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist", - "lib": ["dom"], "composite": true }, "include": ["src/**/*.ts", "src/**/*.json"], diff --git a/packages/trie/karma.conf.js b/packages/trie/karma.conf.js index aa906ad4bf0..f1d530dfe57 100644 --- a/packages/trie/karma.conf.js +++ b/packages/trie/karma.conf.js @@ -10,6 +10,9 @@ module.exports = function (config) { tsconfig: './tsconfig.json', bundlerOptions: { entrypoints: /\.spec\.ts$/, + acornOptions: { + ecmaVersion: 11 + } }, }, colors: true, diff --git a/packages/trie/tsconfig.browser.json b/packages/trie/tsconfig.browser.json index b4895dad561..9258535248e 100644 --- a/packages/trie/tsconfig.browser.json +++ b/packages/trie/tsconfig.browser.json @@ -1,9 +1,8 @@ { - "extends": "./tsconfig.prod.json", + "extends": "../../config/tsconfig.browser.json", + "include": ["src/**/*.ts"], "compilerOptions": { "outDir": "./dist.browser", - "target": "es5", - "lib": ["dom", "es5"] } } \ No newline at end of file diff --git a/packages/trie/tsconfig.json b/packages/trie/tsconfig.json index afab821994b..3ae5514e80b 100644 --- a/packages/trie/tsconfig.json +++ b/packages/trie/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../config/tsconfig.json", "compilerOptions": { "outDir": "./dist", - "lib": ["dom"], }, "include": ["src/**/*.ts", "test/*.spec.ts"] } diff --git a/packages/trie/tsconfig.prod.json b/packages/trie/tsconfig.prod.json index 9b7ba79e21e..497aaac6bdf 100644 --- a/packages/trie/tsconfig.prod.json +++ b/packages/trie/tsconfig.prod.json @@ -3,8 +3,6 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist", - "target": "ES2017", - "lib": ["dom"], "composite": true }, "include": ["src/**/*.ts"], diff --git a/packages/tx/karma.conf.js b/packages/tx/karma.conf.js index 86ec5e21d3b..e9bd0642038 100644 --- a/packages/tx/karma.conf.js +++ b/packages/tx/karma.conf.js @@ -12,6 +12,9 @@ module.exports = function (config) { tsconfig: './tsconfig.json', bundlerOptions: { entrypoints: /\.spec\.ts$/, + acornOptions: { + ecmaVersion: 11 + } }, }, browsers: ['FirefoxHeadless', 'ChromeHeadless'], diff --git a/packages/util/src/bytes.ts b/packages/util/src/bytes.ts index 0e8654c724f..3bc3d97b41c 100644 --- a/packages/util/src/bytes.ts +++ b/packages/util/src/bytes.ts @@ -332,3 +332,21 @@ export function bufArrToArr(arr: Buffer | NestedBufferArray): Uint8Array | Neste } return arr.map((a) => bufArrToArr(a)) } + +/** + * Converts a {@link Buffer} to a {@link bigint}` + */ +export function bufferToBigInt(buf: Buffer) { + const hex = bufferToHex(buf) + if (hex === '0x') { + return BigInt(0) + } + return BigInt(hex) +} + +/** + * Converts a {@link bigint} to a {@link Buffer} + */ +export function bigIntToBuffer(num: bigint) { + return toBuffer('0x' + num.toString(16)) +} diff --git a/packages/util/src/constants.ts b/packages/util/src/constants.ts index ae09019b940..20dc334dc6a 100644 --- a/packages/util/src/constants.ts +++ b/packages/util/src/constants.ts @@ -14,14 +14,26 @@ export const MAX_INTEGER = new BN( 16 ) +/** + * The max integer that the evm can handle (2^256-1) as a bigint + */ +export const MAX_INTEGER_BIGINT = BigInt(2) ** BigInt(256) - BigInt(1) + /** * 2^256 + * + * @deprecated bn.js constants are deprecated, please use the newly introduced bigint constants */ export const TWO_POW256 = new BN( '10000000000000000000000000000000000000000000000000000000000000000', 16 ) +/** + * 2^256 + */ +export const TWO_POW256_BIGINT = BigInt(2) ** BigInt(256) + /** * Keccak-256 hash of null */ diff --git a/packages/util/src/types.ts b/packages/util/src/types.ts index 3f84526559a..633dfe8362a 100644 --- a/packages/util/src/types.ts +++ b/packages/util/src/types.ts @@ -144,3 +144,15 @@ export function toType( return `0x${output.toString('hex')}` as TypeOutputReturnType[T] } } + +export const bnToBigInt = (bn: BN) => { + return BigInt(new BN(bn).toString(10)) +} + +export const bigIntToBN = (num: bigint) => { + return new BN(num.toString(10)) +} + +export const bigIntToHex = (num: bigint) => { + return '0x' + num.toString(16) +} diff --git a/packages/util/test/bytes.spec.ts b/packages/util/test/bytes.spec.ts index 31a63506f59..e8e1efef624 100644 --- a/packages/util/test/bytes.spec.ts +++ b/packages/util/test/bytes.spec.ts @@ -23,6 +23,8 @@ import { intToBuffer, intToHex, validateNoLeadingZeroes, + bufferToBigInt, + bigIntToBuffer, } from '../src' tape('zeros function', function (t) { @@ -443,3 +445,15 @@ tape('bufArrToArr', function (st) { st.deepEqual(bufArrToArr(bufArr), uint8Arr) st.end() }) + +tape('bufferToBigInt', (st) => { + const buf = toBuffer('0x123') + st.equal(BigInt(0x123), bufferToBigInt(buf)) + st.end() +}) + +tape('bigIntToBuffer', (st) => { + const num = BigInt(0x123) + st.deepEqual(toBuffer('0x123'), bigIntToBuffer(num)) + st.end() +}) diff --git a/packages/util/test/constants.spec.ts b/packages/util/test/constants.spec.ts index 4ee6ff30699..6fdae9ae19a 100644 --- a/packages/util/test/constants.spec.ts +++ b/packages/util/test/constants.spec.ts @@ -8,6 +8,7 @@ import { KECCAK256_RLP_ARRAY, KECCAK256_RLP_S, KECCAK256_RLP, + TWO_POW256_BIGINT, } from '../src' tape('constants', function (t) { @@ -22,6 +23,11 @@ tape('constants', function (t) { '10000000000000000000000000000000000000000000000000000000000000000' ) + st.equal( + TWO_POW256_BIGINT.toString(16), + '10000000000000000000000000000000000000000000000000000000000000000' + ) + st.equal(KECCAK256_NULL_S, 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470') st.equal( diff --git a/packages/util/test/types.spec.ts b/packages/util/test/types.spec.ts index eb9d31d2c28..ac1f62f5aaa 100644 --- a/packages/util/test/types.spec.ts +++ b/packages/util/test/types.spec.ts @@ -9,6 +9,9 @@ import { bnToHex, bnToUnpaddedBuffer, toBuffer, + bnToBigInt, + bigIntToBN, + bigIntToHex, } from '../src' tape('toType', function (t) { @@ -142,3 +145,18 @@ tape('bnToUnpaddedBuffer', function (t) { st.end() }) }) + +tape('bnToBigInt', (st) => { + st.equal(bnToBigInt(new BN(1)), BigInt(1)) + st.end() +}) + +tape('bigIntToBN', (st) => { + st.ok(bigIntToBN(BigInt(1)).eq(new BN(1))) + st.end() +}) + +tape('bigIntToHex', (st) => { + st.equal(bigIntToHex(BigInt(1)), '0x1') + st.end() +}) diff --git a/packages/util/tsconfig.browser.json b/packages/util/tsconfig.browser.json index b4895dad561..9258535248e 100644 --- a/packages/util/tsconfig.browser.json +++ b/packages/util/tsconfig.browser.json @@ -1,9 +1,8 @@ { - "extends": "./tsconfig.prod.json", + "extends": "../../config/tsconfig.browser.json", + "include": ["src/**/*.ts"], "compilerOptions": { "outDir": "./dist.browser", - "target": "es5", - "lib": ["dom", "es5"] } } \ No newline at end of file diff --git a/packages/util/tsconfig.json b/packages/util/tsconfig.json index ec77a108e23..35752954e26 100644 --- a/packages/util/tsconfig.json +++ b/packages/util/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../config/tsconfig.json", - "include": ["src/**/*.ts", "test/**/*.ts"] + "include": ["src/**/*.ts", "test/**/*.ts"], } diff --git a/packages/util/tsconfig.prod.json b/packages/util/tsconfig.prod.json index e6621a10738..7d60b7fdbfd 100644 --- a/packages/util/tsconfig.prod.json +++ b/packages/util/tsconfig.prod.json @@ -3,7 +3,7 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist", - "composite": true + "composite": true, }, "include": ["src/**/*.ts"] } diff --git a/packages/vm/benchmarks/util.ts b/packages/vm/benchmarks/util.ts index c66a04cb71a..c2b1b29efaf 100644 --- a/packages/vm/benchmarks/util.ts +++ b/packages/vm/benchmarks/util.ts @@ -1,4 +1,4 @@ -import { Account, Address, toBuffer, bufferToInt, BN } from 'ethereumjs-util' +import { Account, Address, toBuffer, bufferToInt, BN, bnToBigInt } from 'ethereumjs-util' import Common from '@ethereumjs/common' import { Block } from '@ethereumjs/block' import { StateManager, DefaultStateManager } from '../dist/state' @@ -100,7 +100,7 @@ export const verifyResult = (block: Block, result: RunBlockResult) => { if (!result.logsBloom.equals(block.header.logsBloom)) { throw new Error('invalid logsBloom') } - if (!block.header.gasUsed.eq(result.gasUsed)) { + if (!(bnToBigInt(block.header.gasUsed) === result.gasUsed)) { throw new Error('invalid gasUsed') } } diff --git a/packages/vm/karma.conf.js b/packages/vm/karma.conf.js index 55d03729eab..284832adede 100644 --- a/packages/vm/karma.conf.js +++ b/packages/vm/karma.conf.js @@ -23,6 +23,9 @@ module.exports = function (config) { tsconfig: './tsconfig.json', bundlerOptions: { entrypoints: /\.spec\.ts$/, + acornOptions: { + ecmaVersion: 11 + } }, }, diff --git a/packages/vm/src/buildBlock.ts b/packages/vm/src/buildBlock.ts index 106432ba855..15de3d24d68 100644 --- a/packages/vm/src/buildBlock.ts +++ b/packages/vm/src/buildBlock.ts @@ -1,4 +1,4 @@ -import { Address, BN, toBuffer, rlp } from 'ethereumjs-util' +import { Address, toBuffer, rlp, bnToBigInt, bigIntToBN, toType, TypeOutput } from 'ethereumjs-util' import { BaseTrie as Trie } from 'merkle-patricia-tree' import { Block, BlockOptions, HeaderData } from '@ethereumjs/block' import { ConsensusType } from '@ethereumjs/common' @@ -66,7 +66,7 @@ export class BlockBuilder { /** * The cumulative gas used by the transactions added to the block. */ - gasUsed = new BN(0) + gasUsed = BigInt(0) private readonly vm: VM private blockOpts: BuilderOpts @@ -136,11 +136,9 @@ export class BlockBuilder { * Calculates and returns the receiptTrie for the block. */ private async receiptTrie() { - const gasUsed = new BN(0) const receiptTrie = new Trie() for (const [i, txResult] of this.transactionResults.entries()) { const tx = this.transactions[i] - gasUsed.iadd(txResult.gasUsed) const encodedReceipt = encodeReceipt(tx, txResult.receipt) await receiptTrie.put(rlp.encode(i), encodedReceipt) } @@ -151,7 +149,7 @@ export class BlockBuilder { * Adds the block miner reward to the coinbase account. */ private async rewardMiner() { - const minerReward = new BN(this.vm._common.param('pow', 'minerReward')) + const minerReward = BigInt(this.vm._common.param('pow', 'minerReward')) const reward = calculateMinerReward(minerReward, 0) const coinbase = this.headerData.coinbase ? new Address(toBuffer(this.headerData.coinbase)) @@ -175,15 +173,15 @@ export class BlockBuilder { // According to the Yellow Paper, a transaction's gas limit // cannot be greater than the remaining gas in the block - const blockGasLimit = new BN(toBuffer(this.headerData.gasLimit)) - const blockGasRemaining = blockGasLimit.sub(this.gasUsed) - if (tx.gasLimit.gt(blockGasRemaining)) { + const blockGasLimit = bnToBigInt(toType(this.headerData.gasLimit, TypeOutput.BN)) + const blockGasRemaining = blockGasLimit - this.gasUsed + if (bnToBigInt(tx.gasLimit) > blockGasRemaining) { throw new Error('tx has a higher gas limit than the remaining gas in the block') } const header = { ...this.headerData, - gasUsed: this.gasUsed, + gasUsed: bigIntToBN(this.gasUsed), } const blockData = { header, transactions: this.transactions } const block = Block.fromBlockData(blockData, this.blockOpts) @@ -192,7 +190,7 @@ export class BlockBuilder { this.transactions.push(tx) this.transactionResults.push(result) - this.gasUsed.iadd(result.gasUsed) + this.gasUsed += result.gasUsed return result } @@ -232,7 +230,7 @@ export class BlockBuilder { const transactionsTrie = await this.transactionsTrie() const receiptTrie = await this.receiptTrie() const logsBloom = this.logsBloom() - const gasUsed = this.gasUsed + const gasUsed = bigIntToBN(this.gasUsed) const timestamp = this.headerData.timestamp ?? Math.round(Date.now() / 1000) const headerData = { diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index ba47831f1d1..3cd5c8fd2c4 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -1,5 +1,5 @@ import { debug as createDebugLogger } from 'debug' -import { Account, Address, BN, MAX_UINT64 } from 'ethereumjs-util' +import { Account, Address, BN, MAX_UINT64, bufferToBigInt, bnToBigInt } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { ConsensusAlgorithm } from '@ethereumjs/common' @@ -9,6 +9,7 @@ import Message from './message' import EVM, { EVMResult } from './evm' import { Log } from './types' import { TransientStorage } from '../state' +import { addressToBuffer } from './opcodes' const debugGas = createDebugLogger('vm:eei:gas') @@ -16,12 +17,6 @@ function trap(err: ERROR) { throw new VmError(err) } -const MASK_160 = new BN(1).shln(160).subn(1) -function addressToBuffer(address: BN) { - if (Buffer.isBuffer(address)) return address - return address.and(MASK_160).toArrayLike(Buffer, 'be', 20) -} - /** * Environment data which is made available to EVM bytecode. */ @@ -30,11 +25,11 @@ export interface Env { address: Address caller: Address callData: Buffer - callValue: BN + callValue: bigint code: Buffer isStatic: boolean depth: number - gasPrice: BN + gasPrice: bigint origin: Address block: Block contract: Account @@ -77,7 +72,7 @@ export default class EEI { state: StateManager, evm: EVM, common: Common, - gasLeft: BN, + gasLeft: bigint, transientStorage: TransientStorage ) { this._env = env @@ -100,13 +95,13 @@ export default class EEI { * @param context - Usage context for debugging * @throws if out of gas */ - useGas(amount: BN, context?: string): void { - this._gasLeft.isub(amount) + useGas(amount: bigint, context?: string): void { + this._gasLeft -= amount if (this._evm._vm.DEBUG) { debugGas(`${context ? context + ': ' : ''}used ${amount} gas (-> ${this._gasLeft})`) } - if (this._gasLeft.ltn(0)) { - this._gasLeft = new BN(0) + if (this._gasLeft < BigInt(0)) { + this._gasLeft = BigInt(0) trap(ERROR.OUT_OF_GAS) } } @@ -116,11 +111,11 @@ export default class EEI { * @param amount - Amount of gas refunded * @param context - Usage context for debugging */ - refundGas(amount: BN, context?: string): void { + refundGas(amount: bigint, context?: string): void { if (this._evm._vm.DEBUG) { debugGas(`${context ? context + ': ' : ''}refund ${amount} gas (-> ${this._evm._refund})`) } - this._evm._refund.iadd(amount) + this._evm._refund += amount } /** @@ -128,13 +123,13 @@ export default class EEI { * @param amount - Amount to subtract from gas refunds * @param context - Usage context for debugging */ - subRefund(amount: BN, context?: string): void { + subRefund(amount: bigint, context?: string): void { if (this._evm._vm.DEBUG) { debugGas(`${context ? context + ': ' : ''}sub gas refund ${amount} (-> ${this._evm._refund})`) } - this._evm._refund.isub(amount) - if (this._evm._refund.ltn(0)) { - this._evm._refund = new BN(0) + this._evm._refund -= amount + if (this._evm._refund < BigInt(0)) { + this._evm._refund = BigInt(0) trap(ERROR.REFUND_EXHAUSTED) } } @@ -143,11 +138,11 @@ export default class EEI { * Increments the internal gasLeft counter. Used for adding callStipend. * @param amount - Amount to add */ - addStipend(amount: BN): void { + addStipend(amount: bigint): void { if (this._evm._vm.DEBUG) { debugGas(`add stipend ${amount} (-> ${this._gasLeft})`) } - this._gasLeft.iadd(amount) + this._gasLeft += amount } /** @@ -161,38 +156,38 @@ export default class EEI { * Returns balance of the given account. * @param address - Address of account */ - async getExternalBalance(address: Address): Promise { + async getExternalBalance(address: Address): Promise { // shortcut if current account if (address.equals(this._env.address)) { - return this._env.contract.balance + return bnToBigInt(this._env.contract.balance) } // otherwise load account then return balance const account = await this._state.getAccount(address) - return account.balance + return bnToBigInt(account.balance) } /** * Returns balance of self. */ - getSelfBalance(): BN { - return this._env.contract.balance + getSelfBalance(): bigint { + return bnToBigInt(this._env.contract.balance) } /** * Returns caller address. This is the address of the account * that is directly responsible for this execution. */ - getCaller(): BN { - return new BN(this._env.caller.buf) + getCaller(): bigint { + return bufferToBigInt(this._env.caller.buf) } /** * Returns the deposited value by the instruction/transaction * responsible for this execution. */ - getCallValue(): BN { - return new BN(this._env.callValue) + getCallValue(): bigint { + return this._env.callValue } /** @@ -207,15 +202,15 @@ export default class EEI { * Returns size of input data in current environment. This pertains to the * input data passed with the message call instruction or transaction. */ - getCallDataSize(): BN { - return new BN(this._env.callData.length) + getCallDataSize(): bigint { + return BigInt(this._env.callData.length) } /** * Returns the size of code running in current environment. */ - getCodeSize(): BN { - return new BN(this._env.code.length) + getCodeSize(): bigint { + return BigInt(this._env.code.length) } /** @@ -236,17 +231,17 @@ export default class EEI { * Get size of an account’s code. * @param address - Address of account */ - async getExternalCodeSize(address: BN): Promise { + async getExternalCodeSize(address: bigint): Promise { const addr = new Address(addressToBuffer(address)) const code = await this._state.getContractCode(addr) - return new BN(code.length) + return BigInt(code.length) } /** * Returns code of an account. * @param address - Address of account */ - async getExternalCode(address: BN): Promise { + async getExternalCode(address: bigint): Promise { const addr = new Address(addressToBuffer(address)) return this._state.getContractCode(addr) } @@ -256,8 +251,8 @@ export default class EEI { * from the last executed call, callCode, callDelegate, callStatic or create. * Note: create only fills the return data buffer in case of a failure. */ - getReturnDataSize(): BN { - return new BN(this._lastReturned.length) + getReturnDataSize(): bigint { + return BigInt(this._lastReturned.length) } /** @@ -272,7 +267,7 @@ export default class EEI { /** * Returns price of gas in current environment. */ - getTxGasPrice(): BN { + getTxGasPrice(): bigint { return this._env.gasPrice } @@ -281,21 +276,21 @@ export default class EEI { * sender of original transaction; it is never an account with * non-empty associated code. */ - getTxOrigin(): BN { - return new BN(this._env.origin.buf) + getTxOrigin(): bigint { + return bufferToBigInt(this._env.origin.buf) } /** * Returns the block’s number. */ - getBlockNumber(): BN { - return this._env.block.header.number + getBlockNumber(): bigint { + return bnToBigInt(this._env.block.header.number) } /** * Returns the block's beneficiary address. */ - getBlockCoinbase(): BN { + getBlockCoinbase(): bigint { let coinbase: Address if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique) { // Backwards-compatibilty check @@ -308,21 +303,21 @@ export default class EEI { } else { coinbase = this._env.block.header.coinbase } - return new BN(coinbase.toBuffer()) + return bufferToBigInt(coinbase.toBuffer()) } /** * Returns the block's timestamp. */ - getBlockTimestamp(): BN { - return this._env.block.header.timestamp + getBlockTimestamp(): bigint { + return bnToBigInt(this._env.block.header.timestamp) } /** * Returns the block's difficulty. */ - getBlockDifficulty(): BN { - return this._env.block.header.difficulty + getBlockDifficulty(): bigint { + return bnToBigInt(this._env.block.header.difficulty) } /** @@ -335,37 +330,37 @@ export default class EEI { /** * Returns the block's gas limit. */ - getBlockGasLimit(): BN { - return this._env.block.header.gasLimit + getBlockGasLimit(): bigint { + return bnToBigInt(this._env.block.header.gasLimit) } /** * Returns the chain ID for current chain. Introduced for the * CHAINID opcode proposed in [EIP-1344](https://eips.ethereum.org/EIPS/eip-1344). */ - getChainId(): BN { - return this._common.chainId() + getChainId(): bigint { + return bnToBigInt(this._common.chainId()) } /** * Returns the Base Fee of the block as proposed in [EIP-3198](https;//eips.etheruem.org/EIPS/eip-3198) */ - getBlockBaseFee(): BN { + getBlockBaseFee(): bigint { const baseFee = this._env.block.header.baseFeePerGas if (baseFee === undefined) { // Sanity check throw new Error('Block has no Base Fee') } - return baseFee + return bnToBigInt(baseFee) } /** * Returns Gets the hash of one of the 256 most recent complete blocks. * @param num - Number of block */ - async getBlockHash(num: BN): Promise { - const block = await this._env.blockchain.getBlock(num) - return new BN(block.hash()) + async getBlockHash(num: bigint): Promise { + const block = await this._env.blockchain.getBlock(Number(num)) + return bufferToBigInt(block.hash()) } /** @@ -410,8 +405,8 @@ export default class EEI { /** * Returns the current gasCounter. */ - getGasLeft(): BN { - return this._gasLeft.clone() + getGasLeft(): bigint { + return this._gasLeft } /** @@ -446,7 +441,7 @@ export default class EEI { async _selfDestruct(toAddress: Address): Promise { // only add to refund if this is the first selfdestruct for the address if (!this._result.selfdestruct[this._env.address.buf.toString('hex')]) { - this.refundGas(new BN(this._common.param('gasPrices', 'selfdestructRefund'))) + this.refundGas(BigInt(this._common.param('gasPrices', 'selfdestructRefund'))) } this._result.selfdestruct[this._env.address.buf.toString('hex')] = toAddress.buf @@ -483,7 +478,7 @@ export default class EEI { /** * Sends a message with arbitrary data to a given address path. */ - async call(gasLimit: BN, address: Address, value: BN, data: Buffer): Promise { + async call(gasLimit: bigint, address: Address, value: bigint, data: Buffer): Promise { const msg = new Message({ caller: this._env.address, gasLimit, @@ -500,7 +495,7 @@ export default class EEI { /** * Message-call into this account with an alternative account's code. */ - async callCode(gasLimit: BN, address: Address, value: BN, data: Buffer): Promise { + async callCode(gasLimit: bigint, address: Address, value: bigint, data: Buffer): Promise { const msg = new Message({ caller: this._env.address, gasLimit, @@ -520,7 +515,12 @@ export default class EEI { * state modifications. This includes log, create, selfdestruct and call with * a non-zero value. */ - async callStatic(gasLimit: BN, address: Address, value: BN, data: Buffer): Promise { + async callStatic( + gasLimit: bigint, + address: Address, + value: bigint, + data: Buffer + ): Promise { const msg = new Message({ caller: this._env.address, gasLimit, @@ -538,7 +538,12 @@ export default class EEI { * Message-call into this account with an alternative account’s code, but * persisting the current values for sender and value. */ - async callDelegate(gasLimit: BN, address: Address, value: BN, data: Buffer): Promise { + async callDelegate( + gasLimit: bigint, + address: Address, + value: bigint, + data: Buffer + ): Promise { const msg = new Message({ caller: this._env.caller, gasLimit, @@ -554,7 +559,7 @@ export default class EEI { return this._baseCall(msg) } - async _baseCall(msg: Message): Promise { + async _baseCall(msg: Message): Promise { const selfdestruct = { ...this._result.selfdestruct } msg.selfdestruct = selfdestruct @@ -564,9 +569,9 @@ export default class EEI { // Check if account has enough ether and max depth not exceeded if ( this._env.depth >= this._common.param('vm', 'stackLimit') || - (msg.delegatecall !== true && this._env.contract.balance.lt(msg.value)) + (msg.delegatecall !== true && bnToBigInt(this._env.contract.balance) < msg.value) ) { - return new BN(0) + return BigInt(0) } const results = await this._evm.executeMessage(msg) @@ -600,7 +605,12 @@ export default class EEI { /** * Creates a new contract with a given value. */ - async create(gasLimit: BN, value: BN, data: Buffer, salt: Buffer | null = null): Promise { + async create( + gasLimit: bigint, + value: bigint, + data: Buffer, + salt: Buffer | null = null + ): Promise { const selfdestruct = { ...this._result.selfdestruct } const msg = new Message({ caller: this._env.address, @@ -618,14 +628,14 @@ export default class EEI { // Check if account has enough ether and max depth not exceeded if ( this._env.depth >= this._common.param('vm', 'stackLimit') || - (msg.delegatecall !== true && this._env.contract.balance.lt(msg.value)) + (msg.delegatecall !== true && bnToBigInt(this._env.contract.balance) < msg.value) ) { - return new BN(0) + return BigInt(0) } // EIP-2681 check if (this._env.contract.nonce.gte(MAX_UINT64)) { - return new BN(0) + return BigInt(0) } this._env.contract.nonce.iaddn(1) @@ -664,7 +674,7 @@ export default class EEI { this._env.contract = account if (results.createdAddress) { // push the created address to the stack - return new BN(results.createdAddress.buf) + return bufferToBigInt(results.createdAddress.buf) } } @@ -675,7 +685,7 @@ export default class EEI { * Creates a new contract with a given value. Generates * a deterministic address via CREATE2 rules. */ - async create2(gasLimit: BN, value: BN, data: Buffer, salt: Buffer): Promise { + async create2(gasLimit: bigint, value: bigint, data: Buffer, salt: Buffer): Promise { return this.create(gasLimit, value, data, salt) } @@ -699,9 +709,9 @@ export default class EEI { // This preserves the previous logic, but seems to contradict the EEI spec // https://github.com/ewasm/design/blob/38eeded28765f3e193e12881ea72a6ab807a3371/eth_interface.md if (results.execResult.exceptionError) { - return new BN(0) + return BigInt(0) } else { - return new BN(1) + return BigInt(1) } } } diff --git a/packages/vm/src/evm/evm.ts b/packages/vm/src/evm/evm.ts index f01e8cdb9ed..1bcd70efcdf 100644 --- a/packages/vm/src/evm/evm.ts +++ b/packages/vm/src/evm/evm.ts @@ -2,7 +2,7 @@ import { debug as createDebugLogger } from 'debug' import { Account, Address, - BN, + bigIntToBN, generateAddress, generateAddress2, KECCAK256_NULL, @@ -33,7 +33,7 @@ export interface EVMResult { /** * Amount of gas used by the transaction */ - gasUsed: BN + gasUsed: bigint /** * Address of created account durint transaction, if any */ @@ -56,11 +56,11 @@ export interface ExecResult { /** * Amount of gas left */ - gas?: BN + gas?: bigint /** * Amount of gas the code used to run */ - gasUsed: BN + gasUsed: bigint /** * Return value from the contract */ @@ -76,7 +76,7 @@ export interface ExecResult { /** * Total amount of gas to be refunded from all nested calls. */ - gasRefund?: BN + gasRefund?: bigint } export interface NewContractEvent { @@ -85,7 +85,7 @@ export interface NewContractEvent { code: Buffer } -export function OOGResult(gasLimit: BN): ExecResult { +export function OOGResult(gasLimit: bigint): ExecResult { return { returnValue: Buffer.alloc(0), gasUsed: gasLimit, @@ -93,7 +93,7 @@ export function OOGResult(gasLimit: BN): ExecResult { } } // CodeDeposit OOG Result -export function COOGResult(gasUsedCreateCode: BN): ExecResult { +export function COOGResult(gasUsedCreateCode: bigint): ExecResult { return { returnValue: Buffer.alloc(0), gasUsed: gasUsedCreateCode, @@ -101,7 +101,7 @@ export function COOGResult(gasUsedCreateCode: BN): ExecResult { } } -export function INVALID_BYTECODE_RESULT(gasLimit: BN): ExecResult { +export function INVALID_BYTECODE_RESULT(gasLimit: bigint): ExecResult { return { returnValue: Buffer.alloc(0), gasUsed: gasLimit, @@ -109,7 +109,7 @@ export function INVALID_BYTECODE_RESULT(gasLimit: BN): ExecResult { } } -export function INVALID_EOF_RESULT(gasLimit: BN): ExecResult { +export function INVALID_EOF_RESULT(gasLimit: bigint): ExecResult { return { returnValue: Buffer.alloc(0), gasUsed: gasLimit, @@ -117,7 +117,7 @@ export function INVALID_EOF_RESULT(gasLimit: BN): ExecResult { } } -export function VmErrorResult(error: VmError, gasUsed: BN): ExecResult { +export function VmErrorResult(error: VmError, gasUsed: bigint): ExecResult { return { returnValue: Buffer.alloc(0), gasUsed: gasUsed, @@ -139,7 +139,7 @@ export default class EVM { /** * Amount of gas to refund from deleting storage values */ - _refund: BN + _refund: bigint _transientStorage: TransientStorage constructor(vm: VM, txContext: TxContext, block: Block) { @@ -147,7 +147,7 @@ export default class EVM { this._state = this._vm.stateManager this._tx = txContext this._block = block - this._refund = new BN(0) + this._refund = BigInt(0) this._transientStorage = new TransientStorage() } @@ -164,7 +164,7 @@ export default class EVM { ;(this._state).addWarmedAddress((await this._generateAddress(message)).buf) } - const oldRefund = this._refund.clone() + const oldRefund = this._refund await this._state.checkpoint() this._transientStorage.checkpoint() @@ -203,7 +203,6 @@ export default class EVM { ) } const err = result.execResult.exceptionError - // This clause captures any error which happened during execution // If that is the case, then set the _refund tracker to the old refund value if (err) { @@ -212,7 +211,7 @@ export default class EVM { this._refund = oldRefund result.execResult.selfdestruct = {} } - result.execResult.gasRefund = this._refund.clone() + result.execResult.gasRefund = this._refund if (err) { if (this._vm._common.gteHardfork('homestead') || err.error != ERROR.CODESTORE_OUT_OF_GAS) { @@ -279,9 +278,9 @@ export default class EVM { } if (exit) { return { - gasUsed: new BN(0), + gasUsed: BigInt(0), execResult: { - gasUsed: new BN(0), + gasUsed: BigInt(0), exceptionError: errorMessage, // Only defined if addToBalance failed returnValue: Buffer.alloc(0), }, @@ -392,10 +391,10 @@ export default class EVM { } if (exit) { return { - gasUsed: new BN(0), + gasUsed: BigInt(0), createdAddress: message.to, execResult: { - gasUsed: new BN(0), + gasUsed: BigInt(0), exceptionError: errorMessage, // only defined if addToBalance failed returnValue: Buffer.alloc(0), }, @@ -409,12 +408,12 @@ export default class EVM { let result = await this.runInterpreter(message) // fee for size of the return value let totalGas = result.gasUsed - let returnFee = new BN(0) + let returnFee = BigInt(0) if (!result.exceptionError) { - returnFee = new BN(result.returnValue.length).imuln( - this._vm._common.param('gasPrices', 'createData') - ) - totalGas = totalGas.add(returnFee) + returnFee = + BigInt(result.returnValue.length) * + BigInt(this._vm._common.param('gasPrices', 'createData')) + totalGas = totalGas + returnFee if (this._vm.DEBUG) { debugGas(`Add return value size fee (${returnFee} to gas used (-> ${totalGas}))`) } @@ -432,10 +431,7 @@ export default class EVM { // If enough gas and allowed code size let CodestoreOOG = false - if ( - totalGas.lte(message.gasLimit) && - (this._vm._allowUnlimitedContractSize || allowedCodeSize) - ) { + if (totalGas <= message.gasLimit && (this._vm._allowUnlimitedContractSize || allowedCodeSize)) { if (this._vm._common.isActivatedEIP(3541) && result.returnValue[0] === eof.FORMAT) { if (!this._vm._common.isActivatedEIP(3540)) { result = { ...result, ...INVALID_BYTECODE_RESULT(message.gasLimit) } @@ -481,9 +477,9 @@ export default class EVM { if (this._vm.DEBUG) { debug(`Not enough gas or code size not allowed (Frontier)`) } - if (totalGas.sub(returnFee).lte(message.gasLimit)) { + if (totalGas - returnFee <= message.gasLimit) { // we cannot pay the code deposit fee (but the deposit code actually did run) - result = { ...result, ...COOGResult(totalGas.sub(returnFee)) } + result = { ...result, ...COOGResult(totalGas - returnFee) } CodestoreOOG = true } else { result = { ...result, ...OOGResult(message.gasLimit) } @@ -527,7 +523,7 @@ export default class EVM { address: message.to || Address.zero(), caller: message.caller || Address.zero(), callData: message.data || Buffer.from([0]), - callValue: message.value || new BN(0), + callValue: message.value || BigInt(0), code: message.code as Buffer, isStatic: message.isStatic || false, depth: message.depth || 0, @@ -542,7 +538,7 @@ export default class EVM { this._state, this, this._vm._common, - message.gasLimit.clone(), + message.gasLimit, this._transientStorage ) if (message.selfdestruct) { @@ -553,7 +549,7 @@ export default class EVM { const interpreterRes = await interpreter.run(message.code as Buffer, opts) let result = eei._result - let gasUsed = message.gasLimit.sub(eei._gasLeft) + let gasUsed = message.gasLimit - eei._gasLeft if (interpreterRes.exceptionError) { if ( interpreterRes.exceptionError.error !== ERROR.REVERT && @@ -598,7 +594,7 @@ export default class EVM { runPrecompile( code: PrecompileFunc, data: Buffer, - gasLimit: BN + gasLimit: bigint ): Promise | ExecResult { if (typeof code !== 'function') { throw new Error('Invalid precompile') @@ -640,7 +636,7 @@ export default class EVM { } async _reduceSenderBalance(account: Account, message: Message): Promise { - account.balance.isub(message.value) + account.balance.isub(bigIntToBN(message.value)) const result = this._state.putAccount(message.caller, account) if (this._vm.DEBUG) { debug(`Reduced sender (${message.caller}) balance (-> ${account.balance})`) @@ -649,7 +645,7 @@ export default class EVM { } async _addToBalance(toAccount: Account, message: Message): Promise { - const newBalance = toAccount.balance.add(message.value) + const newBalance = toAccount.balance.add(bigIntToBN(message.value)) if (newBalance.gt(MAX_INTEGER)) { throw new VmError(ERROR.VALUE_OVERFLOW) } diff --git a/packages/vm/src/evm/interpreter.ts b/packages/vm/src/evm/interpreter.ts index a1c0a73c11d..534d49d89b2 100644 --- a/packages/vm/src/evm/interpreter.ts +++ b/packages/vm/src/evm/interpreter.ts @@ -1,5 +1,5 @@ import { debug as createDebugLogger } from 'debug' -import { Account, Address, BN } from 'ethereumjs-util' +import { Account, Address, bigIntToHex, intToHex } from 'ethereumjs-util' import { StateManager } from '../state/index' import { ERROR, VmError } from '../exceptions' import Memory from './memory' @@ -16,8 +16,8 @@ export interface RunState { programCounter: number opCode: number memory: Memory - memoryWordCount: BN - highestMemCost: BN + memoryWordCount: bigint + highestMemCost: bigint stack: Stack returnStack: Stack code: Buffer @@ -25,7 +25,7 @@ export interface RunState { validJumps: Uint8Array // array of values where validJumps[index] has value 0 (default), 1 (jumpdest), 2 (beginsub) stateManager: StateManager eei: EEI - messageGasLimit?: BN // Cache value from `gas.ts` to save gas limit for a message call + messageGasLimit?: bigint // Cache value from `gas.ts` to save gas limit for a message call } export interface InterpreterResult { @@ -34,23 +34,23 @@ export interface InterpreterResult { } export interface InterpreterStep { + gasLeft: bigint + gasRefund: bigint + stateManager: StateManager + stack: bigint[] + returnStack: bigint[] pc: number + depth: number opcode: { name: string fee: number - dynamicFee?: BN + dynamicFee?: bigint isAsync: boolean } - gasLeft: BN - gasRefund: BN - stateManager: StateManager - stack: BN[] - returnStack: BN[] account: Account address: Address - depth: number memory: Buffer - memoryWordCount: BN + memoryWordCount: bigint codeAddress: Address } @@ -74,8 +74,8 @@ export default class Interpreter { programCounter: 0, opCode: 0xfe, // INVALID opcode memory: new Memory(), - memoryWordCount: new BN(0), - highestMemCost: new BN(0), + memoryWordCount: BigInt(0), + highestMemCost: BigInt(0), stack: new Stack(), returnStack: new Stack(1023), // 1023 return stack height limit per EIP 2315 spec code: Buffer.alloc(0), @@ -172,7 +172,7 @@ export default class Interpreter { async runStep(): Promise { const opInfo = this.lookupOpInfo(this._runState.opCode) - const gas = new BN(opInfo.fee) + let gas = BigInt(opInfo.fee) // clone the gas limit; call opcodes can add stipend, // which makes it seem like the gas left increases const gasLimitClone = this._eei.getGasLeft() @@ -181,7 +181,7 @@ export default class Interpreter { const dynamicGasHandler = this._vm._dynamicGasHandlers.get(this._runState.opCode)! // This function updates the gas BN in-place using `i*` methods // It needs the base fee, for correct gas limit calculation for the CALL opcodes - await dynamicGasHandler(this._runState, gas, this._vm._common) + gas = await dynamicGasHandler(this._runState, gas, this._vm._common) } if (this._vm.listenerCount('step') > 0 || this._vm.DEBUG) { @@ -202,6 +202,7 @@ export default class Interpreter { // Execute opcode handler const opFn = this.getOpHandler(opInfo) + if (opInfo.isAsync) { await (opFn as AsyncOpHandler).apply(null, [this._runState, this._vm._common]) } else { @@ -224,7 +225,7 @@ export default class Interpreter { return this._vm._opcodes.get(op) ?? this._vm._opcodes.get(0xfe) } - async _runStepHook(dynamicFee: BN, gasLeft: BN): Promise { + async _runStepHook(dynamicFee: bigint, gasLeft: bigint): Promise { const opcode = this.lookupOpInfo(this._runState.opCode) const eventObj: InterpreterStep = { pc: this._runState.programCounter, @@ -251,7 +252,7 @@ export default class Interpreter { // Create opTrace for debug functionality let hexStack = [] hexStack = eventObj.stack.map((item: any) => { - return '0x' + new BN(item).toString(16, 0) + return bigIntToHex(BigInt(item)) }) const name = eventObj.opcode.name @@ -259,8 +260,8 @@ export default class Interpreter { const opTrace = { pc: eventObj.pc, op: name, - gas: '0x' + eventObj.gasLeft.toString('hex'), - gasCost: '0x' + eventObj.opcode.fee.toString(16), + gas: bigIntToHex(eventObj.gasLeft), + gasCost: intToHex(eventObj.opcode.fee), stack: hexStack, depth: eventObj.depth, } diff --git a/packages/vm/src/evm/message.ts b/packages/vm/src/evm/message.ts index 85da7f5f045..7d938ef6e65 100644 --- a/packages/vm/src/evm/message.ts +++ b/packages/vm/src/evm/message.ts @@ -1,11 +1,11 @@ -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { PrecompileFunc } from './precompiles' export default class Message { to: Address - value: BN + value: bigint caller: Address - gasLimit: BN + gasLimit: bigint data: Buffer depth: number code: Buffer | PrecompileFunc @@ -18,7 +18,7 @@ export default class Message { constructor(opts: any) { this.to = opts.to - this.value = opts.value ? opts.value : new BN(0) + this.value = opts.value ? opts.value : BigInt(0) this.caller = opts.caller this.gasLimit = opts.gasLimit this.data = opts.data || Buffer.alloc(0) @@ -31,7 +31,7 @@ export default class Message { this.selfdestruct = opts.selfdestruct // TODO: Move from here this.delegatecall = opts.delegatecall || false - if (this.value.isNeg()) { + if (this.value < 0) { throw new Error(`value field cannot be negative, received ${this.value}`) } } diff --git a/packages/vm/src/evm/opcodes/EIP1283.ts b/packages/vm/src/evm/opcodes/EIP1283.ts index f4a6715b3ef..2967f0c9243 100644 --- a/packages/vm/src/evm/opcodes/EIP1283.ts +++ b/packages/vm/src/evm/opcodes/EIP1283.ts @@ -1,5 +1,4 @@ import Common from '@ethereumjs/common' -import { BN } from 'ethereumjs-util' import { RunState } from './../interpreter' /** @@ -20,24 +19,24 @@ export function updateSstoreGasEIP1283( ) { if (currentStorage.equals(value)) { // If current value equals new value (this is a no-op), 200 gas is deducted. - return new BN(common.param('gasPrices', 'netSstoreNoopGas')) + return BigInt(common.param('gasPrices', 'netSstoreNoopGas')) } // If current value does not equal new value if (originalStorage.equals(currentStorage)) { // If original value equals current value (this storage slot has not been changed by the current execution context) if (originalStorage.length === 0) { // If original value is 0, 20000 gas is deducted. - return new BN(common.param('gasPrices', 'netSstoreInitGas')) + return BigInt(common.param('gasPrices', 'netSstoreInitGas')) } if (value.length === 0) { // If new value is 0, add 15000 gas to refund counter. runState.eei.refundGas( - new BN(common.param('gasPrices', 'netSstoreClearRefund')), + BigInt(common.param('gasPrices', 'netSstoreClearRefund')), 'EIP-1283 -> netSstoreClearRefund' ) } // Otherwise, 5000 gas is deducted. - return new BN(common.param('gasPrices', 'netSstoreCleanGas')) + return BigInt(common.param('gasPrices', 'netSstoreCleanGas')) } // If original value does not equal current value (this storage slot is dirty), 200 gas is deducted. Apply both of the following clauses. if (originalStorage.length !== 0) { @@ -45,13 +44,13 @@ export function updateSstoreGasEIP1283( if (currentStorage.length === 0) { // If current value is 0 (also means that new value is not 0), remove 15000 gas from refund counter. We can prove that refund counter will never go below 0. runState.eei.subRefund( - new BN(common.param('gasPrices', 'netSstoreClearRefund')), + BigInt(common.param('gasPrices', 'netSstoreClearRefund')), 'EIP-1283 -> netSstoreClearRefund' ) } else if (value.length === 0) { // If new value is 0 (also means that current value is not 0), add 15000 gas to refund counter. runState.eei.refundGas( - new BN(common.param('gasPrices', 'netSstoreClearRefund')), + BigInt(common.param('gasPrices', 'netSstoreClearRefund')), 'EIP-1283 -> netSstoreClearRefund' ) } @@ -61,16 +60,16 @@ export function updateSstoreGasEIP1283( if (originalStorage.length === 0) { // If original value is 0, add 19800 gas to refund counter. runState.eei.refundGas( - new BN(common.param('gasPrices', 'netSstoreResetClearRefund')), + BigInt(common.param('gasPrices', 'netSstoreResetClearRefund')), 'EIP-1283 -> netSstoreResetClearRefund' ) } else { // Otherwise, add 4800 gas to refund counter. runState.eei.refundGas( - new BN(common.param('gasPrices', 'netSstoreResetRefund')), + BigInt(common.param('gasPrices', 'netSstoreResetRefund')), 'EIP-1283 -> netSstoreResetRefund' ) } } - return new BN(common.param('gasPrices', 'netSstoreDirtyGas')) + return BigInt(common.param('gasPrices', 'netSstoreDirtyGas')) } diff --git a/packages/vm/src/evm/opcodes/EIP2200.ts b/packages/vm/src/evm/opcodes/EIP2200.ts index 7fcdbccaf98..59a502eafd0 100644 --- a/packages/vm/src/evm/opcodes/EIP2200.ts +++ b/packages/vm/src/evm/opcodes/EIP2200.ts @@ -1,5 +1,4 @@ import Common from '@ethereumjs/common' -import { BN } from 'ethereumjs-util' import { RunState } from './../interpreter' import { ERROR } from '../../exceptions' import { adjustSstoreGasEIP2929 } from './EIP2929' @@ -23,41 +22,41 @@ export function updateSstoreGasEIP2200( common: Common ) { // Fail if not enough gas is left - if (runState.eei.getGasLeft().lten(common.param('gasPrices', 'sstoreSentryGasEIP2200'))) { + if (runState.eei.getGasLeft() <= BigInt(common.param('gasPrices', 'sstoreSentryGasEIP2200'))) { trap(ERROR.OUT_OF_GAS) } // Noop if (currentStorage.equals(value)) { - const sstoreNoopCost = new BN(common.param('gasPrices', 'sstoreNoopGasEIP2200')) + const sstoreNoopCost = BigInt(common.param('gasPrices', 'sstoreNoopGasEIP2200')) return adjustSstoreGasEIP2929(runState, key, sstoreNoopCost, 'noop', common) } if (originalStorage.equals(currentStorage)) { // Create slot if (originalStorage.length === 0) { - return new BN(common.param('gasPrices', 'sstoreInitGasEIP2200')) + return BigInt(common.param('gasPrices', 'sstoreInitGasEIP2200')) } // Delete slot if (value.length === 0) { runState.eei.refundGas( - new BN(common.param('gasPrices', 'sstoreClearRefundEIP2200')), + BigInt(common.param('gasPrices', 'sstoreClearRefundEIP2200')), 'EIP-2200 -> sstoreClearRefundEIP2200' ) } // Write existing slot - return new BN(common.param('gasPrices', 'sstoreCleanGasEIP2200')) + return BigInt(common.param('gasPrices', 'sstoreCleanGasEIP2200')) } if (originalStorage.length > 0) { if (currentStorage.length === 0) { // Recreate slot runState.eei.subRefund( - new BN(common.param('gasPrices', 'sstoreClearRefundEIP2200')), + BigInt(common.param('gasPrices', 'sstoreClearRefundEIP2200')), 'EIP-2200 -> sstoreClearRefundEIP2200' ) } else if (value.length === 0) { // Delete slot runState.eei.refundGas( - new BN(common.param('gasPrices', 'sstoreClearRefundEIP2200')), + BigInt(common.param('gasPrices', 'sstoreClearRefundEIP2200')), 'EIP-2200 -> sstoreClearRefundEIP2200' ) } @@ -65,20 +64,20 @@ export function updateSstoreGasEIP2200( if (originalStorage.equals(value)) { if (originalStorage.length === 0) { // Reset to original non-existent slot - const sstoreInitRefund = new BN(common.param('gasPrices', 'sstoreInitRefundEIP2200')) + const sstoreInitRefund = BigInt(common.param('gasPrices', 'sstoreInitRefundEIP2200')) runState.eei.refundGas( adjustSstoreGasEIP2929(runState, key, sstoreInitRefund, 'initRefund', common), 'EIP-2200 -> initRefund' ) } else { // Reset to original existing slot - const sstoreCleanRefund = new BN(common.param('gasPrices', 'sstoreCleanRefundEIP2200')) + const sstoreCleanRefund = BigInt(common.param('gasPrices', 'sstoreCleanRefundEIP2200')) runState.eei.refundGas( - adjustSstoreGasEIP2929(runState, key, sstoreCleanRefund, 'cleanRefund', common), + BigInt(adjustSstoreGasEIP2929(runState, key, sstoreCleanRefund, 'cleanRefund', common)), 'EIP-2200 -> cleanRefund' ) } } // Dirty update - return new BN(common.param('gasPrices', 'sstoreDirtyGasEIP2200')) + return BigInt(common.param('gasPrices', 'sstoreDirtyGasEIP2200')) } diff --git a/packages/vm/src/evm/opcodes/EIP2929.ts b/packages/vm/src/evm/opcodes/EIP2929.ts index b63a6e86813..c9780cc55fa 100644 --- a/packages/vm/src/evm/opcodes/EIP2929.ts +++ b/packages/vm/src/evm/opcodes/EIP2929.ts @@ -1,5 +1,5 @@ import Common from '@ethereumjs/common' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { EIP2929StateManager } from '../../state/interface' import { RunState } from './../interpreter' @@ -8,7 +8,7 @@ import { RunState } from './../interpreter' * Adjusts cost incurred for executing opcode based on whether address read * is warm/cold. (EIP 2929) * @param {RunState} runState - * @param {BN} address + * @param {Address} address * @param {Common} common * @param {Boolean} chargeGas (default: true) * @param {Boolean} isSelfdestruct (default: false) @@ -19,8 +19,8 @@ export function accessAddressEIP2929( common: Common, chargeGas = true, isSelfdestruct = false -): BN { - if (!common.isActivatedEIP(2929)) return new BN(0) +): bigint { + if (!common.isActivatedEIP(2929)) return BigInt(0) const stateManager = runState.stateManager as EIP2929StateManager const addressStr = address.buf @@ -32,13 +32,13 @@ export function accessAddressEIP2929( // CREATE, CREATE2 opcodes have the address warmed for free. // selfdestruct beneficiary address reads are charged an *additional* cold access if (chargeGas) { - return new BN(common.param('gasPrices', 'coldaccountaccess')) + return BigInt(common.param('gasPrices', 'coldaccountaccess')) } // Warm: (selfdestruct beneficiary address reads are not charged when warm) } else if (chargeGas && !isSelfdestruct) { - return new BN(common.param('gasPrices', 'warmstorageread')) + return BigInt(common.param('gasPrices', 'warmstorageread')) } - return new BN(0) + return BigInt(0) } /** @@ -54,8 +54,8 @@ export function accessStorageEIP2929( key: Buffer, isSstore: boolean, common: Common -): BN { - if (!common.isActivatedEIP(2929)) return new BN(0) +): bigint { + if (!common.isActivatedEIP(2929)) return BigInt(0) const stateManager = runState.stateManager as EIP2929StateManager const address = runState.eei.getAddress().buf @@ -64,11 +64,11 @@ export function accessStorageEIP2929( // Cold (SLOAD and SSTORE) if (slotIsCold) { stateManager.addWarmedStorage(address, key) - return new BN(common.param('gasPrices', 'coldsload')) + return BigInt(common.param('gasPrices', 'coldsload')) } else if (!isSstore) { - return new BN(common.param('gasPrices', 'warmstorageread')) + return BigInt(common.param('gasPrices', 'warmstorageread')) } - return new BN(0) + return BigInt(0) } /** @@ -84,25 +84,25 @@ export function accessStorageEIP2929( export function adjustSstoreGasEIP2929( runState: RunState, key: Buffer, - defaultCost: BN, + defaultCost: bigint, costName: string, common: Common -): BN { +): bigint { if (!common.isActivatedEIP(2929)) return defaultCost const stateManager = runState.stateManager as EIP2929StateManager const address = runState.eei.getAddress().buf - const warmRead = new BN(common.param('gasPrices', 'warmstorageread')) - const coldSload = new BN(common.param('gasPrices', 'coldsload')) + const warmRead = BigInt(common.param('gasPrices', 'warmstorageread')) + const coldSload = BigInt(common.param('gasPrices', 'coldsload')) if (stateManager.isWarmedStorage(address, key)) { switch (costName) { case 'noop': return warmRead case 'initRefund': - return new BN(common.param('gasPrices', 'sstoreInitGasEIP2200')).sub(warmRead) + return BigInt(common.param('gasPrices', 'sstoreInitGasEIP2200')) - warmRead case 'cleanRefund': - return new BN(common.param('gasPrices', 'sstoreReset')).sub(coldSload).sub(warmRead) + return BigInt(common.param('gasPrices', 'sstoreReset')) - coldSload - warmRead } } diff --git a/packages/vm/src/evm/opcodes/functions.ts b/packages/vm/src/evm/opcodes/functions.ts index a06d8fbfbfc..cabfea1fb85 100644 --- a/packages/vm/src/evm/opcodes/functions.ts +++ b/packages/vm/src/evm/opcodes/functions.ts @@ -1,12 +1,13 @@ import Common from '@ethereumjs/common' import { Address, - BN, keccak256, - setLengthRight, - TWO_POW256, - MAX_INTEGER, KECCAK256_NULL, + TWO_POW256_BIGINT, + MAX_INTEGER_BIGINT, + setLengthLeft, + bufferToBigInt, + bigIntToBuffer, } from 'ethereumjs-util' import { addressToBuffer, @@ -16,9 +17,13 @@ import { jumpSubIsValid, trap, writeCallOutput, + mod, + fromTwos, + toTwos, } from './util' import { ERROR } from '../../exceptions' import { RunState } from './../interpreter' +import { exponentation } from '.' export interface SyncOpHandler { (runState: RunState, common: Common): void @@ -44,7 +49,7 @@ export const handlers: Map = new Map([ 0x01, function (runState) { const [a, b] = runState.stack.popN(2) - const r = a.add(b).mod(TWO_POW256) + const r = mod(a + b, TWO_POW256_BIGINT) runState.stack.push(r) }, ], @@ -53,7 +58,7 @@ export const handlers: Map = new Map([ 0x02, function (runState) { const [a, b] = runState.stack.popN(2) - const r = a.mul(b).mod(TWO_POW256) + const r = mod(a * b, TWO_POW256_BIGINT) runState.stack.push(r) }, ], @@ -62,7 +67,7 @@ export const handlers: Map = new Map([ 0x03, function (runState) { const [a, b] = runState.stack.popN(2) - const r = a.sub(b).toTwos(256) + const r = mod(a - b, TWO_POW256_BIGINT) runState.stack.push(r) }, ], @@ -72,10 +77,10 @@ export const handlers: Map = new Map([ function (runState) { const [a, b] = runState.stack.popN(2) let r - if (b.isZero()) { - r = new BN(b) + if (b === BigInt(0)) { + r = BigInt(0) } else { - r = a.div(b) + r = mod(a / b, TWO_POW256_BIGINT) } runState.stack.push(r) }, @@ -84,14 +89,12 @@ export const handlers: Map = new Map([ [ 0x05, function (runState) { - let [a, b] = runState.stack.popN(2) + const [a, b] = runState.stack.popN(2) let r - if (b.isZero()) { - r = new BN(b) + if (b === BigInt(0)) { + r = BigInt(0) } else { - a = a.fromTwos(256) - b = b.fromTwos(256) - r = a.div(b).toTwos(256) + r = toTwos(fromTwos(a) / fromTwos(b)) } runState.stack.push(r) }, @@ -102,10 +105,10 @@ export const handlers: Map = new Map([ function (runState) { const [a, b] = runState.stack.popN(2) let r - if (b.isZero()) { - r = new BN(b) + if (b === BigInt(0)) { + r = b } else { - r = a.mod(b) + r = mod(a, b) } runState.stack.push(r) }, @@ -114,20 +117,14 @@ export const handlers: Map = new Map([ [ 0x07, function (runState) { - let [a, b] = runState.stack.popN(2) + const [a, b] = runState.stack.popN(2) let r - if (b.isZero()) { - r = new BN(b) + if (b === BigInt(0)) { + r = b } else { - a = a.fromTwos(256) - b = b.fromTwos(256) - r = a.abs().mod(b.abs()) - if (a.isNeg()) { - r = r.ineg() - } - r = r.toTwos(256) + r = fromTwos(a) % fromTwos(b) } - runState.stack.push(r) + runState.stack.push(toTwos(r)) }, ], // 0x08: ADDMOD @@ -136,10 +133,10 @@ export const handlers: Map = new Map([ function (runState) { const [a, b, c] = runState.stack.popN(3) let r - if (c.isZero()) { - r = new BN(c) + if (c === BigInt(0)) { + r = BigInt(0) } else { - r = a.add(b).mod(c) + r = mod(a + b, c) } runState.stack.push(r) }, @@ -150,10 +147,10 @@ export const handlers: Map = new Map([ function (runState) { const [a, b, c] = runState.stack.popN(3) let r - if (c.isZero()) { - r = new BN(c) + if (c === BigInt(0)) { + r = BigInt(0) } else { - r = a.mul(b).mod(c) + r = mod(a * b, c) } runState.stack.push(r) }, @@ -163,26 +160,27 @@ export const handlers: Map = new Map([ 0x0a, function (runState, common) { const [base, exponent] = runState.stack.popN(2) - if (exponent.isZero()) { - runState.stack.push(new BN(1)) + if (exponent === BigInt(0)) { + runState.stack.push(BigInt(1)) return } - const byteLength = exponent.byteLength() + let byteLength = exponent.toString(2).length / 8 + if (byteLength > Math.trunc(byteLength)) { + byteLength = Math.trunc(byteLength) + 1 + } if (byteLength < 1 || byteLength > 32) { trap(ERROR.OUT_OF_RANGE) } const gasPrice = common.param('gasPrices', 'expByte') - const amount = new BN(byteLength).muln(gasPrice) - runState.eei.useGas(amount, 'EXP opcode') + const amount = byteLength * gasPrice + runState.eei.useGas(BigInt(amount), 'EXP opcode') - if (base.isZero()) { - runState.stack.push(new BN(0)) + if (base === BigInt(0)) { + runState.stack.push(base) return } - const m = BN.red(TWO_POW256) - const redBase = base.toRed(m) - const r = redBase.redPow(exponent) - runState.stack.push(r.fromRed()) + const r = exponentation(base, exponent) + runState.stack.push(r) }, ], // 0x0b: SIGNEXTEND @@ -191,17 +189,14 @@ export const handlers: Map = new Map([ function (runState) { /* eslint-disable-next-line prefer-const */ let [k, val] = runState.stack.popN(2) - if (k.ltn(31)) { - const signBit = k.muln(8).iaddn(7).toNumber() - const mask = new BN(1).ishln(signBit).isubn(1) - if (val.testn(signBit)) { - val = val.or(mask.notn(256)) + if (k < BigInt(31)) { + const signBit = k * BigInt(8) + BigInt(7) + const mask = (BigInt(1) << signBit) - BigInt(1) + if ((val >> signBit) & BigInt(1)) { + val = val | BigInt.asUintN(256, ~mask) } else { - val = val.and(mask) + val = val & mask } - } else { - // return the same value - val = new BN(val) } runState.stack.push(val) }, @@ -212,7 +207,7 @@ export const handlers: Map = new Map([ 0x10, function (runState) { const [a, b] = runState.stack.popN(2) - const r = new BN(a.lt(b) ? 1 : 0) + const r = a < b ? BigInt(1) : BigInt(0) runState.stack.push(r) }, ], @@ -221,7 +216,7 @@ export const handlers: Map = new Map([ 0x11, function (runState) { const [a, b] = runState.stack.popN(2) - const r = new BN(a.gt(b) ? 1 : 0) + const r = a > b ? BigInt(1) : BigInt(0) runState.stack.push(r) }, ], @@ -230,7 +225,7 @@ export const handlers: Map = new Map([ 0x12, function (runState) { const [a, b] = runState.stack.popN(2) - const r = new BN(a.fromTwos(256).lt(b.fromTwos(256)) ? 1 : 0) + const r = fromTwos(a) < fromTwos(b) ? BigInt(1) : BigInt(0) runState.stack.push(r) }, ], @@ -239,7 +234,7 @@ export const handlers: Map = new Map([ 0x13, function (runState) { const [a, b] = runState.stack.popN(2) - const r = new BN(a.fromTwos(256).gt(b.fromTwos(256)) ? 1 : 0) + const r = fromTwos(a) > fromTwos(b) ? BigInt(1) : BigInt(0) runState.stack.push(r) }, ], @@ -248,7 +243,7 @@ export const handlers: Map = new Map([ 0x14, function (runState) { const [a, b] = runState.stack.popN(2) - const r = new BN(a.eq(b) ? 1 : 0) + const r = a === b ? BigInt(1) : BigInt(0) runState.stack.push(r) }, ], @@ -257,7 +252,7 @@ export const handlers: Map = new Map([ 0x15, function (runState) { const a = runState.stack.pop() - const r = new BN(a.isZero() ? 1 : 0) + const r = a === BigInt(0) ? BigInt(1) : BigInt(0) runState.stack.push(r) }, ], @@ -266,7 +261,7 @@ export const handlers: Map = new Map([ 0x16, function (runState) { const [a, b] = runState.stack.popN(2) - const r = a.and(b) + const r = a & b runState.stack.push(r) }, ], @@ -275,7 +270,7 @@ export const handlers: Map = new Map([ 0x17, function (runState) { const [a, b] = runState.stack.popN(2) - const r = a.or(b) + const r = a | b runState.stack.push(r) }, ], @@ -284,7 +279,7 @@ export const handlers: Map = new Map([ 0x18, function (runState) { const [a, b] = runState.stack.popN(2) - const r = a.xor(b) + const r = a ^ b runState.stack.push(r) }, ], @@ -293,7 +288,7 @@ export const handlers: Map = new Map([ 0x19, function (runState) { const a = runState.stack.pop() - const r = a.notn(256) + const r = BigInt.asUintN(256, ~a) runState.stack.push(r) }, ], @@ -302,12 +297,12 @@ export const handlers: Map = new Map([ 0x1a, function (runState) { const [pos, word] = runState.stack.popN(2) - if (pos.gten(32)) { - runState.stack.push(new BN(0)) + if (pos > BigInt(32)) { + runState.stack.push(BigInt(0)) return } - const r = new BN(word.shrn((31 - pos.toNumber()) * 8).andln(0xff)) + const r = (word >> ((BigInt(31) - pos) * BigInt(8))) & BigInt(0xff) runState.stack.push(r) }, ], @@ -316,12 +311,12 @@ export const handlers: Map = new Map([ 0x1b, function (runState) { const [a, b] = runState.stack.popN(2) - if (a.gten(256)) { - runState.stack.push(new BN(0)) + if (a > BigInt(256)) { + runState.stack.push(BigInt(0)) return } - const r = b.shln(a.toNumber()).iand(MAX_INTEGER) + const r = (b << a) & MAX_INTEGER_BIGINT runState.stack.push(r) }, ], @@ -330,12 +325,12 @@ export const handlers: Map = new Map([ 0x1c, function (runState) { const [a, b] = runState.stack.popN(2) - if (a.gten(256)) { - runState.stack.push(new BN(0)) + if (a > 256) { + runState.stack.push(BigInt(0)) return } - const r = b.shrn(a.toNumber()) + const r = b >> a runState.stack.push(r) }, ], @@ -346,22 +341,23 @@ export const handlers: Map = new Map([ const [a, b] = runState.stack.popN(2) let r - const isSigned = b.testn(255) - if (a.gten(256)) { + const bComp = BigInt.asIntN(256, b) + const isSigned = bComp < 0 + if (a > 256) { if (isSigned) { - r = new BN(MAX_INTEGER) + r = MAX_INTEGER_BIGINT } else { - r = new BN(0) + r = BigInt(0) } runState.stack.push(r) return } - const c = b.shrn(a.toNumber()) + const c = b >> a if (isSigned) { - const shiftedOutWidth = 255 - a.toNumber() - const mask = MAX_INTEGER.shrn(shiftedOutWidth).shln(shiftedOutWidth) - r = c.ior(mask) + const shiftedOutWidth = BigInt(255) - a + const mask = (MAX_INTEGER_BIGINT >> shiftedOutWidth) << shiftedOutWidth + r = c | mask } else { r = c } @@ -375,10 +371,10 @@ export const handlers: Map = new Map([ function (runState) { const [offset, length] = runState.stack.popN(2) let data = Buffer.alloc(0) - if (!length.isZero()) { - data = runState.memory.read(offset.toNumber(), length.toNumber()) + if (!(length === BigInt(0))) { + data = runState.memory.read(Number(offset), Number(length)) } - const r = new BN(keccak256(data)) + const r = bufferToBigInt(keccak256(data)) runState.stack.push(r) }, ], @@ -387,7 +383,7 @@ export const handlers: Map = new Map([ [ 0x30, function (runState) { - const address = new BN(runState.eei.getAddress().buf) + const address = bufferToBigInt(runState.eei.getAddress().buf) runState.stack.push(address) }, ], @@ -395,8 +391,8 @@ export const handlers: Map = new Map([ [ 0x31, async function (runState) { - const addressBN = runState.stack.pop() - const address = new Address(addressToBuffer(addressBN)) + const addressBigInt = runState.stack.pop() + const address = new Address(addressToBuffer(addressBigInt)) const balance = await runState.eei.getExternalBalance(address) runState.stack.push(balance) }, @@ -427,16 +423,18 @@ export const handlers: Map = new Map([ 0x35, function (runState) { const pos = runState.stack.pop() - if (pos.gt(runState.eei.getCallDataSize())) { - runState.stack.push(new BN(0)) + if (pos > runState.eei.getCallDataSize()) { + runState.stack.push(BigInt(0)) return } - const i = pos.toNumber() + const i = Number(pos) let loaded = runState.eei.getCallData().slice(i, i + 32) loaded = loaded.length ? loaded : Buffer.from([0]) - const r = new BN(setLengthRight(loaded, 32)) - + let r = bufferToBigInt(loaded) + if (loaded.length < 32) { + r = r << (BigInt(8) * BigInt(32 - loaded.length)) + } runState.stack.push(r) }, ], @@ -454,10 +452,10 @@ export const handlers: Map = new Map([ function (runState) { const [memOffset, dataOffset, dataLength] = runState.stack.popN(3) - if (!dataLength.eqn(0)) { + if (!(dataLength === BigInt(0))) { const data = getDataSlice(runState.eei.getCallData(), dataOffset, dataLength) - const memOffsetNum = memOffset.toNumber() - const dataLengthNum = dataLength.toNumber() + const memOffsetNum = Number(memOffset) + const dataLengthNum = Number(dataLength) runState.memory.extend(memOffsetNum, dataLengthNum) runState.memory.write(memOffsetNum, dataLengthNum, data) } @@ -476,10 +474,10 @@ export const handlers: Map = new Map([ function (runState) { const [memOffset, codeOffset, dataLength] = runState.stack.popN(3) - if (!dataLength.eqn(0)) { + if (!(dataLength === BigInt(0))) { const data = getDataSlice(runState.eei.getCode(), codeOffset, dataLength) - const memOffsetNum = memOffset.toNumber() - const lengthNum = dataLength.toNumber() + const memOffsetNum = Number(memOffset) + const lengthNum = Number(dataLength) runState.memory.extend(memOffsetNum, lengthNum) runState.memory.write(memOffsetNum, lengthNum, data) } @@ -489,8 +487,8 @@ export const handlers: Map = new Map([ [ 0x3b, async function (runState) { - const addressBN = runState.stack.pop() - const size = await runState.eei.getExternalCodeSize(addressBN) + const addressBigInt = runState.stack.pop() + const size = await runState.eei.getExternalCodeSize(addressBigInt) runState.stack.push(size) }, ], @@ -500,12 +498,12 @@ export const handlers: Map = new Map([ async function (runState) { const [addressBN, memOffset, codeOffset, dataLength] = runState.stack.popN(4) - if (!dataLength.eqn(0)) { + if (!(dataLength === BigInt(0))) { const code = await runState.eei.getExternalCode(addressBN) const data = getDataSlice(code, codeOffset, dataLength) - const memOffsetNum = memOffset.toNumber() - const lengthNum = dataLength.toNumber() + const memOffsetNum = Number(memOffset) + const lengthNum = Number(dataLength) runState.memory.extend(memOffsetNum, lengthNum) runState.memory.write(memOffsetNum, lengthNum, data) } @@ -515,21 +513,21 @@ export const handlers: Map = new Map([ [ 0x3f, async function (runState) { - const addressBN = runState.stack.pop() - const address = new Address(addressToBuffer(addressBN)) + const addressBigInt = runState.stack.pop() + const address = new Address(addressToBuffer(addressBigInt)) const empty = await runState.eei.isAccountEmpty(address) if (empty) { - runState.stack.push(new BN(0)) + runState.stack.push(BigInt(0)) return } - const code = await runState.eei.getExternalCode(addressBN) + const code = await runState.eei.getExternalCode(addressBigInt) if (code.length === 0) { - runState.stack.push(new BN(KECCAK256_NULL)) + runState.stack.push(bufferToBigInt(KECCAK256_NULL)) return } - runState.stack.push(new BN(keccak256(code))) + runState.stack.push(bufferToBigInt(keccak256(code))) }, ], // 0x3d: RETURNDATASIZE @@ -545,10 +543,10 @@ export const handlers: Map = new Map([ function (runState) { const [memOffset, returnDataOffset, dataLength] = runState.stack.popN(3) - if (!dataLength.eqn(0)) { + if (!(dataLength === BigInt(0))) { const data = getDataSlice(runState.eei.getReturnData(), returnDataOffset, dataLength) - const memOffsetNum = memOffset.toNumber() - const lengthNum = dataLength.toNumber() + const memOffsetNum = Number(memOffset) + const lengthNum = Number(dataLength) runState.memory.extend(memOffsetNum, lengthNum) runState.memory.write(memOffsetNum, lengthNum, data) } @@ -568,10 +566,10 @@ export const handlers: Map = new Map([ async function (runState) { const number = runState.stack.pop() - const diff = runState.eei.getBlockNumber().sub(number) + const diff = runState.eei.getBlockNumber() - number // block lookups must be within the past 256 blocks - if (diff.gtn(256) || diff.lten(0)) { - runState.stack.push(new BN(0)) + if (diff > BigInt(256) || diff <= BigInt(0)) { + runState.stack.push(BigInt(0)) return } @@ -652,8 +650,8 @@ export const handlers: Map = new Map([ 0x51, function (runState) { const pos = runState.stack.pop() - const word = runState.memory.read(pos.toNumber(), 32) - runState.stack.push(new BN(word)) + const word = runState.memory.read(Number(pos), 32) + runState.stack.push(bufferToBigInt(word)) }, ], // 0x52: MSTORE @@ -661,8 +659,8 @@ export const handlers: Map = new Map([ 0x52, function (runState) { const [offset, word] = runState.stack.popN(2) - const buf = word.toArrayLike(Buffer, 'be', 32) - const offsetNum = offset.toNumber() + const buf = setLengthLeft(bigIntToBuffer(word), 32) + const offsetNum = Number(offset) runState.memory.extend(offsetNum, 32) runState.memory.write(offsetNum, 32, buf) }, @@ -673,11 +671,8 @@ export const handlers: Map = new Map([ function (runState) { const [offset, byte] = runState.stack.popN(2) - // NOTE: we're using a 'trick' here to get the least significant byte - // NOTE: force cast necessary because `BN.andln` returns number but - // the types are wrong - const buf = Buffer.from([byte.andln(0xff) as unknown as number]) - const offsetNum = offset.toNumber() + const buf = bigIntToBuffer(byte & 0xffn) + const offsetNum = Number(offset) runState.memory.extend(offsetNum, 1) runState.memory.write(offsetNum, 1, buf) }, @@ -687,10 +682,10 @@ export const handlers: Map = new Map([ 0x54, async function (runState) { const key = runState.stack.pop() - const keyBuf = key.toArrayLike(Buffer, 'be', 32) + const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) const value = await runState.eei.storageLoad(keyBuf) - const valueBN = value.length ? new BN(value) : new BN(0) - runState.stack.push(valueBN) + const valueBigInt = value.length ? bufferToBigInt(value) : BigInt(0) + runState.stack.push(valueBigInt) }, ], // 0x55: SSTORE @@ -699,13 +694,13 @@ export const handlers: Map = new Map([ async function (runState) { const [key, val] = runState.stack.popN(2) - const keyBuf = key.toArrayLike(Buffer, 'be', 32) + const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) // NOTE: this should be the shortest representation let value - if (val.isZero()) { + if (val === BigInt(0)) { value = Buffer.from([]) } else { - value = val.toArrayLike(Buffer, 'be') + value = bigIntToBuffer(val) } await runState.eei.storageStore(keyBuf, value) @@ -716,11 +711,11 @@ export const handlers: Map = new Map([ 0x56, function (runState) { const dest = runState.stack.pop() - if (dest.gt(runState.eei.getCodeSize())) { + if (dest > runState.eei.getCodeSize()) { trap(ERROR.INVALID_JUMP + ' at ' + describeLocation(runState)) } - const destNum = dest.toNumber() + const destNum = Number(dest) if (!jumpIsValid(runState, destNum)) { trap(ERROR.INVALID_JUMP + ' at ' + describeLocation(runState)) @@ -734,12 +729,12 @@ export const handlers: Map = new Map([ 0x57, function (runState) { const [dest, cond] = runState.stack.popN(2) - if (!cond.isZero()) { - if (dest.gt(runState.eei.getCodeSize())) { + if (!(cond === BigInt(0))) { + if (dest > runState.eei.getCodeSize()) { trap(ERROR.INVALID_JUMP + ' at ' + describeLocation(runState)) } - const destNum = dest.toNumber() + const destNum = Number(dest) if (!jumpIsValid(runState, destNum)) { trap(ERROR.INVALID_JUMP + ' at ' + describeLocation(runState)) @@ -753,21 +748,21 @@ export const handlers: Map = new Map([ [ 0x58, function (runState) { - runState.stack.push(new BN(runState.programCounter - 1)) + runState.stack.push(BigInt(runState.programCounter - 1)) }, ], // 0x59: MSIZE [ 0x59, function (runState) { - runState.stack.push(runState.memoryWordCount.muln(32)) + runState.stack.push(runState.memoryWordCount * BigInt(32)) }, ], // 0x5a: GAS [ 0x5a, function (runState) { - runState.stack.push(new BN(runState.eei.getGasLeft())) + runState.stack.push(runState.eei.getGasLeft()) }, ], // 0x5b: JUMPDEST @@ -788,7 +783,7 @@ export const handlers: Map = new Map([ } const dest = runState.returnStack.pop() - runState.programCounter = dest.toNumber() + runState.programCounter = Number(dest) }, ], // 0x5e: JUMPSUB @@ -797,17 +792,17 @@ export const handlers: Map = new Map([ function (runState) { const dest = runState.stack.pop() - if (dest.gt(runState.eei.getCodeSize())) { + if (dest > runState.eei.getCodeSize()) { trap(ERROR.INVALID_JUMPSUB + ' at ' + describeLocation(runState)) } - const destNum = dest.toNumber() + const destNum = Number(dest) if (!jumpSubIsValid(runState, destNum)) { trap(ERROR.INVALID_JUMPSUB + ' at ' + describeLocation(runState)) } - runState.returnStack.push(new BN(runState.programCounter)) + runState.returnStack.push(BigInt(runState.programCounter)) runState.programCounter = destNum + 1 }, ], @@ -815,7 +810,7 @@ export const handlers: Map = new Map([ [ 0x5f, function (runState) { - runState.stack.push(new BN(0)) + runState.stack.push(BigInt(0)) }, ], // 0x60: PUSH @@ -829,8 +824,8 @@ export const handlers: Map = new Map([ ) { trap(ERROR.OUT_OF_RANGE) } - const loaded = new BN( - runState.code.slice(runState.programCounter, runState.programCounter + numToPush) + const loaded = bufferToBigInt( + runState.eei.getCode().slice(runState.programCounter, runState.programCounter + numToPush) ) runState.programCounter += numToPush runState.stack.push(loaded) @@ -861,13 +856,13 @@ export const handlers: Map = new Map([ const topicsCount = runState.opCode - 0xa0 const topics = runState.stack.popN(topicsCount) - const topicsBuf = topics.map(function (a: BN) { - return a.toArrayLike(Buffer, 'be', 32) + const topicsBuf = topics.map(function (a: bigint) { + return setLengthLeft(bigIntToBuffer(a), 32) }) let mem = Buffer.alloc(0) - if (!memLength.isZero()) { - mem = runState.memory.read(memOffset.toNumber(), memLength.toNumber()) + if (!(memLength === BigInt(0))) { + mem = runState.memory.read(Number(memOffset), Number(memLength)) } runState.eei.log(mem, topicsCount, topicsBuf) @@ -916,8 +911,8 @@ export const handlers: Map = new Map([ runState.messageGasLimit = undefined let data = Buffer.alloc(0) - if (!length.isZero()) { - data = runState.memory.read(offset.toNumber(), length.toNumber()) + if (!(length === BigInt(0))) { + data = runState.memory.read(Number(offset), Number(length)) } const ret = await runState.eei.create(gasLimit, value, data) @@ -938,15 +933,15 @@ export const handlers: Map = new Map([ runState.messageGasLimit = undefined let data = Buffer.alloc(0) - if (!length.isZero()) { - data = runState.memory.read(offset.toNumber(), length.toNumber()) + if (!(length === BigInt(0))) { + data = runState.memory.read(Number(offset), Number(length)) } const ret = await runState.eei.create2( gasLimit, value, data, - salt.toArrayLike(Buffer, 'be', 32) + setLengthLeft(bigIntToBuffer(salt), 32) ) runState.stack.push(ret) }, @@ -960,8 +955,8 @@ export const handlers: Map = new Map([ const toAddress = new Address(addressToBuffer(toAddr)) let data = Buffer.alloc(0) - if (!inLength.isZero()) { - data = runState.memory.read(inOffset.toNumber(), inLength.toNumber()) + if (!(inLength === BigInt(0))) { + data = runState.memory.read(Number(inOffset), Number(inLength)) } const gasLimit = runState.messageGasLimit! @@ -985,8 +980,8 @@ export const handlers: Map = new Map([ runState.messageGasLimit = undefined let data = Buffer.alloc(0) - if (!inLength.isZero()) { - data = runState.memory.read(inOffset.toNumber(), inLength.toNumber()) + if (!(inLength === BigInt(0))) { + data = runState.memory.read(Number(inOffset), Number(inLength)) } const ret = await runState.eei.callCode(gasLimit, toAddress, value, data) @@ -1005,8 +1000,8 @@ export const handlers: Map = new Map([ const toAddress = new Address(addressToBuffer(toAddr)) let data = Buffer.alloc(0) - if (!inLength.isZero()) { - data = runState.memory.read(inOffset.toNumber(), inLength.toNumber()) + if (!(inLength === BigInt(0))) { + data = runState.memory.read(Number(inOffset), Number(inLength)) } const gasLimit = runState.messageGasLimit! @@ -1022,7 +1017,7 @@ export const handlers: Map = new Map([ [ 0xfa, async function (runState) { - const value = new BN(0) + const value = BigInt(0) const [_currentGasLimit, toAddr, inOffset, inLength, outOffset, outLength] = runState.stack.popN(6) const toAddress = new Address(addressToBuffer(toAddr)) @@ -1031,8 +1026,8 @@ export const handlers: Map = new Map([ runState.messageGasLimit = undefined let data = Buffer.alloc(0) - if (!inLength.isZero()) { - data = runState.memory.read(inOffset.toNumber(), inLength.toNumber()) + if (!(inLength === BigInt(0))) { + data = runState.memory.read(Number(inOffset), Number(inLength)) } const ret = await runState.eei.callStatic(gasLimit, toAddress, value, data) @@ -1047,8 +1042,8 @@ export const handlers: Map = new Map([ function (runState) { const [offset, length] = runState.stack.popN(2) let returnData = Buffer.alloc(0) - if (!length.isZero()) { - returnData = runState.memory.read(offset.toNumber(), length.toNumber()) + if (!(length === BigInt(0))) { + returnData = runState.memory.read(Number(offset), Number(length)) } runState.eei.finish(returnData) }, @@ -1059,8 +1054,8 @@ export const handlers: Map = new Map([ function (runState) { const [offset, length] = runState.stack.popN(2) let returnData = Buffer.alloc(0) - if (!length.isZero()) { - returnData = runState.memory.read(offset.toNumber(), length.toNumber()) + if (!(length === BigInt(0))) { + returnData = runState.memory.read(Number(offset), Number(length)) } runState.eei.revert(returnData) }, diff --git a/packages/vm/src/evm/opcodes/gas.ts b/packages/vm/src/evm/opcodes/gas.ts index b8da5c3299f..b2553131b8a 100644 --- a/packages/vm/src/evm/opcodes/gas.ts +++ b/packages/vm/src/evm/opcodes/gas.ts @@ -7,7 +7,7 @@ import { trap, updateSstoreGas, } from '.' -import { Address, BN } from 'ethereumjs-util' +import { Address, bigIntToBuffer, setLengthLeft } from 'ethereumjs-util' import { ERROR } from '../../exceptions' import { RunState } from '../interpreter' import Common from '@ethereumjs/common' @@ -25,11 +25,11 @@ import { accessAddressEIP2929, accessStorageEIP2929 } from './EIP2929' // The gas BN is necessary, since the base fee needs to be included, // to calculate the max call gas for the call opcodes correctly. export interface AsyncDynamicGasHandler { - (runState: RunState, gas: BN, common: Common): Promise + (runState: RunState, gas: bigint, common: Common): Promise } export interface SyncDynamicGasHandler { - (runState: RunState, gas: BN, common: Common): void + (runState: RunState, gas: bigint, common: Common): bigint } export const dynamicGasHandlers: Map = @@ -37,198 +37,207 @@ export const dynamicGasHandlers: Map { + async function (runState, gas, common): Promise { const [offset, length] = runState.stack.peek(2) - gas.iadd(subMemUsage(runState, offset, length, common)) - gas.iadd(new BN(common.param('gasPrices', 'sha3Word')).imul(divCeil(length, new BN(32)))) + gas += subMemUsage(runState, offset, length, common) + gas += BigInt(common.param('gasPrices', 'sha3Word')) * divCeil(length, BigInt(32)) + return gas }, ], [ /* BALANCE */ 0x31, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { if (common.isActivatedEIP(2929)) { - const addressBN = runState.stack.peek()[0] - const address = new Address(addressToBuffer(addressBN)) - gas.iadd(accessAddressEIP2929(runState, address, common)) + const addressBigInt = runState.stack.peek()[0] + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) } + return gas }, ], [ /* CALLDATACOPY */ 0x37, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const [memOffset, _dataOffset, dataLength] = runState.stack.peek(3) - gas.iadd(subMemUsage(runState, memOffset, dataLength, common)) - if (!dataLength.eqn(0)) { - gas.iadd(new BN(common.param('gasPrices', 'copy')).imul(divCeil(dataLength, new BN(32)))) + gas += subMemUsage(runState, memOffset, dataLength, common) + if (!(dataLength === BigInt(0))) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) } + return gas }, ], [ /* CODECOPY */ 0x39, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const [memOffset, _codeOffset, dataLength] = runState.stack.peek(3) - gas.iadd(subMemUsage(runState, memOffset, dataLength, common)) - if (!dataLength.eqn(0)) { - gas.iadd(new BN(common.param('gasPrices', 'copy')).imul(divCeil(dataLength, new BN(32)))) + gas += subMemUsage(runState, memOffset, dataLength, common) + if (!(dataLength === BigInt(0))) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) } + return gas }, ], [ /* EXTCODESIZE */ 0x3b, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { if (common.isActivatedEIP(2929)) { - const addressBN = runState.stack.peek()[0] - const address = new Address(addressToBuffer(addressBN)) - gas.iadd(accessAddressEIP2929(runState, address, common)) + const addressBigInt = runState.stack.peek()[0] + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) } + return gas }, ], [ /* EXTCODECOPY */ 0x3c, - async function (runState, gas, common): Promise { - const [addressBN, memOffset, _codeOffset, dataLength] = runState.stack.peek(4) + async function (runState, gas, common): Promise { + const [addressBigInt, memOffset, _codeOffset, dataLength] = runState.stack.peek(4) - gas.iadd(subMemUsage(runState, memOffset, dataLength, common)) + gas += subMemUsage(runState, memOffset, dataLength, common) if (common.isActivatedEIP(2929)) { - const address = new Address(addressToBuffer(addressBN)) - gas.iadd(accessAddressEIP2929(runState, address, common)) + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) } - if (!dataLength.eqn(0)) { - gas.iadd(new BN(common.param('gasPrices', 'copy')).imul(divCeil(dataLength, new BN(32)))) + if (!(dataLength === BigInt(0))) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) } + return gas }, ], [ /* RETURNDATACOPY */ 0x3e, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const [memOffset, returnDataOffset, dataLength] = runState.stack.peek(3) - if (returnDataOffset.add(dataLength).gt(runState.eei.getReturnDataSize())) { + if (returnDataOffset + dataLength > runState.eei.getReturnDataSize()) { trap(ERROR.OUT_OF_GAS) } - gas.iadd(subMemUsage(runState, memOffset, dataLength, common)) + gas += subMemUsage(runState, memOffset, dataLength, common) - if (!dataLength.eqn(0)) { - gas.iadd(new BN(common.param('gasPrices', 'copy')).mul(divCeil(dataLength, new BN(32)))) + if (!(dataLength === BigInt(0))) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) } + return gas }, ], [ /* EXTCODEHASH */ 0x3f, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { if (common.isActivatedEIP(2929)) { - const addressBN = runState.stack.peek()[0] - const address = new Address(addressToBuffer(addressBN)) - gas.iadd(accessAddressEIP2929(runState, address, common)) + const addressBigInt = runState.stack.peek()[0] + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) } + return gas }, ], [ /* MLOAD */ 0x51, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const pos = runState.stack.peek()[0] - gas.iadd(subMemUsage(runState, pos, new BN(32), common)) + gas += subMemUsage(runState, pos, BigInt(32), common) + return gas }, ], [ /* MSTORE */ 0x52, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const offset = runState.stack.peek()[0] - gas.iadd(subMemUsage(runState, offset, new BN(32), common)) + gas += subMemUsage(runState, offset, BigInt(32), common) + return gas }, ], [ /* MSTORE8 */ 0x53, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const offset = runState.stack.peek()[0] - gas.iadd(subMemUsage(runState, offset, new BN(1), common)) + gas += subMemUsage(runState, offset, BigInt(1), common) + return gas }, ], [ /* SLOAD */ 0x54, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const key = runState.stack.peek()[0] - const keyBuf = key.toArrayLike(Buffer, 'be', 32) + const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) if (common.isActivatedEIP(2929)) { - gas.iadd(accessStorageEIP2929(runState, keyBuf, false, common)) + gas += accessStorageEIP2929(runState, keyBuf, false, common) } + return gas }, ], [ /* SSTORE */ 0x55, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { if (runState.eei.isStatic()) { trap(ERROR.STATIC_STATE_CHANGE) } const [key, val] = runState.stack.peek(2) - const keyBuf = key.toArrayLike(Buffer, 'be', 32) + const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) // NOTE: this should be the shortest representation let value - if (val.isZero()) { + if (val === BigInt(0)) { value = Buffer.from([]) } else { - value = val.toArrayLike(Buffer, 'be') + value = bigIntToBuffer(val) } // TODO: Replace getContractStorage with EEI method const currentStorage = setLengthLeftStorage(await runState.eei.storageLoad(keyBuf)) const originalStorage = setLengthLeftStorage(await runState.eei.storageLoad(keyBuf, true)) if (common.hardfork() === 'constantinople') { - gas.iadd( - updateSstoreGasEIP1283( - runState, - currentStorage, - originalStorage, - setLengthLeftStorage(value), - common - ) + gas += updateSstoreGasEIP1283( + runState, + currentStorage, + originalStorage, + setLengthLeftStorage(value), + common ) } else if (common.gteHardfork('istanbul')) { - gas.iadd( - updateSstoreGasEIP2200( - runState, - currentStorage, - originalStorage, - setLengthLeftStorage(value), - keyBuf, - common - ) + gas += updateSstoreGasEIP2200( + runState, + currentStorage, + originalStorage, + setLengthLeftStorage(value), + keyBuf, + common ) } else { - gas.iadd(updateSstoreGas(runState, currentStorage, setLengthLeftStorage(value), common)) + gas += updateSstoreGas(runState, currentStorage, setLengthLeftStorage(value), common) } if (common.isActivatedEIP(2929)) { // We have to do this after the Istanbul (EIP2200) checks. // Otherwise, we might run out of gas, due to "sentry check" of 2300 gas, // if we deduct extra gas first. - gas.iadd(accessStorageEIP2929(runState, keyBuf, true, common)) + gas += accessStorageEIP2929(runState, keyBuf, true, common) } + return gas }, ], [ /* LOG */ 0xa0, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { if (runState.eei.isStatic()) { trap(ERROR.STATIC_STATE_CHANGE) } @@ -241,256 +250,246 @@ export const dynamicGasHandlers: Map { + async function (runState, gas, common): Promise { if (runState.eei.isStatic()) { trap(ERROR.STATIC_STATE_CHANGE) } const [_value, offset, length] = runState.stack.peek(3) if (common.isActivatedEIP(2929)) { - gas.iadd(accessAddressEIP2929(runState, runState.eei.getAddress(), common, false)) + gas += accessAddressEIP2929(runState, runState.eei.getAddress(), common, false) } - gas.iadd(subMemUsage(runState, offset, length, common)) + gas += subMemUsage(runState, offset, length, common) - if (common.isActivatedEIP(3860)) { - // Meter initcode - const initCodeCost = new BN(common.param('gasPrices', 'initCodeWordCost')).imul( - length.addn(31).divn(32) - ) - gas.iadd(initCodeCost) - } - - let gasLimit = new BN(runState.eei.getGasLeft().isub(gas)) - gasLimit = maxCallGas(gasLimit.clone(), gasLimit.clone(), runState, common) + let gasLimit = BigInt(runState.eei.getGasLeft()) - gas + gasLimit = maxCallGas(gasLimit, gasLimit, runState, common) runState.messageGasLimit = gasLimit + return gas }, ], [ /* CALL */ 0xf1, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const [currentGasLimit, toAddr, value, inOffset, inLength, outOffset, outLength] = runState.stack.peek(7) const toAddress = new Address(addressToBuffer(toAddr)) - if (runState.eei.isStatic() && !value.isZero()) { + if (runState.eei.isStatic() && !(value === BigInt(0))) { trap(ERROR.STATIC_STATE_CHANGE) } - gas.iadd(subMemUsage(runState, inOffset, inLength, common)) - gas.iadd(subMemUsage(runState, outOffset, outLength, common)) + gas += subMemUsage(runState, inOffset, inLength, common) + gas += subMemUsage(runState, outOffset, outLength, common) if (common.isActivatedEIP(2929)) { - gas.iadd(accessAddressEIP2929(runState, toAddress, common)) + gas += accessAddressEIP2929(runState, toAddress, common) } - if (!value.isZero()) { - gas.iadd(new BN(common.param('gasPrices', 'callValueTransfer'))) + if (!(value === BigInt(0))) { + gas += BigInt(common.param('gasPrices', 'callValueTransfer')) } if (common.gteHardfork('spuriousDragon')) { // We are at or after Spurious Dragon // Call new account gas: account is DEAD and we transfer nonzero value - if ((await runState.eei.isAccountEmpty(toAddress)) && !value.isZero()) { - gas.iadd(new BN(common.param('gasPrices', 'callNewAccount'))) + if ((await runState.eei.isAccountEmpty(toAddress)) && !(value === BigInt(0))) { + gas += BigInt(common.param('gasPrices', 'callNewAccount')) } } else if (!(await runState.eei.accountExists(toAddress))) { // We are before Spurious Dragon and the account does not exist. // Call new account gas: account does not exist (it is not in the state trie, not even as an "empty" account) - gas.iadd(new BN(common.param('gasPrices', 'callNewAccount'))) + gas += BigInt(common.param('gasPrices', 'callNewAccount')) } - const gasLimit = maxCallGas( - currentGasLimit.clone(), - runState.eei.getGasLeft().isub(gas), + let gasLimit = maxCallGas( + currentGasLimit, + runState.eei.getGasLeft() - gas, runState, common ) // note that TangerineWhistle or later this cannot happen // (it could have ran out of gas prior to getting here though) - if (gasLimit.gt(runState.eei.getGasLeft().isub(gas))) { + if (gasLimit > runState.eei.getGasLeft() - gas) { trap(ERROR.OUT_OF_GAS) } - if (gas.gt(runState.eei.getGasLeft())) { + if (gas > runState.eei.getGasLeft()) { trap(ERROR.OUT_OF_GAS) } - if (!value.isZero()) { + if (!(value === BigInt(0))) { // TODO: Don't use private attr directly - runState.eei._gasLeft.iaddn(common.param('gasPrices', 'callStipend')) - gasLimit.iaddn(common.param('gasPrices', 'callStipend')) + runState.eei._gasLeft += BigInt(common.param('gasPrices', 'callStipend')) + gasLimit += BigInt(common.param('gasPrices', 'callStipend')) } runState.messageGasLimit = gasLimit + return gas }, ], [ /* CALLCODE */ 0xf2, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const [currentGasLimit, toAddr, value, inOffset, inLength, outOffset, outLength] = runState.stack.peek(7) - gas.iadd(subMemUsage(runState, inOffset, inLength, common)) - gas.iadd(subMemUsage(runState, outOffset, outLength, common)) + gas += subMemUsage(runState, inOffset, inLength, common) + gas += subMemUsage(runState, outOffset, outLength, common) if (common.isActivatedEIP(2929)) { const toAddress = new Address(addressToBuffer(toAddr)) - gas.iadd(accessAddressEIP2929(runState, toAddress, common)) + gas += accessAddressEIP2929(runState, toAddress, common) } - if (!value.isZero()) { - gas.iadd(new BN(common.param('gasPrices', 'callValueTransfer'))) + if (!(value === BigInt(0))) { + gas += BigInt(common.param('gasPrices', 'callValueTransfer')) } - const gasLimit = maxCallGas( - currentGasLimit.clone(), - runState.eei.getGasLeft().isub(gas), + let gasLimit = maxCallGas( + currentGasLimit, + runState.eei.getGasLeft() - gas, runState, common ) // note that TangerineWhistle or later this cannot happen // (it could have ran out of gas prior to getting here though) - if (gasLimit.gt(runState.eei.getGasLeft().isub(gas))) { + if (gasLimit > runState.eei.getGasLeft() - gas) { trap(ERROR.OUT_OF_GAS) } - if (!value.isZero()) { + if (!(value === BigInt(0))) { // TODO: Don't use private attr directly - runState.eei._gasLeft.iaddn(common.param('gasPrices', 'callStipend')) - gasLimit.iaddn(common.param('gasPrices', 'callStipend')) + runState.eei._gasLeft += BigInt(common.param('gasPrices', 'callStipend')) + gasLimit += BigInt(common.param('gasPrices', 'callStipend')) } runState.messageGasLimit = gasLimit + return gas }, ], [ /* RETURN */ 0xf3, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const [offset, length] = runState.stack.peek(2) - gas.iadd(subMemUsage(runState, offset, length, common)) + gas += subMemUsage(runState, offset, length, common) + return gas }, ], [ /* DELEGATECALL */ 0xf4, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const [currentGasLimit, toAddr, inOffset, inLength, outOffset, outLength] = runState.stack.peek(6) - gas.iadd(subMemUsage(runState, inOffset, inLength, common)) - gas.iadd(subMemUsage(runState, outOffset, outLength, common)) + gas += subMemUsage(runState, inOffset, inLength, common) + gas += subMemUsage(runState, outOffset, outLength, common) if (common.isActivatedEIP(2929)) { const toAddress = new Address(addressToBuffer(toAddr)) - gas.iadd(accessAddressEIP2929(runState, toAddress, common)) + gas += accessAddressEIP2929(runState, toAddress, common) } const gasLimit = maxCallGas( - currentGasLimit.clone(), - runState.eei.getGasLeft().isub(gas), + currentGasLimit, + runState.eei.getGasLeft() - gas, runState, common ) // note that TangerineWhistle or later this cannot happen // (it could have ran out of gas prior to getting here though) - if (gasLimit.gt(runState.eei.getGasLeft().isub(gas))) { + if (gasLimit > runState.eei.getGasLeft() - gas) { trap(ERROR.OUT_OF_GAS) } runState.messageGasLimit = gasLimit + return gas }, ], [ /* CREATE2 */ 0xf5, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { if (runState.eei.isStatic()) { trap(ERROR.STATIC_STATE_CHANGE) } const [_value, offset, length, _salt] = runState.stack.peek(4) - gas.iadd(subMemUsage(runState, offset, length, common)) + gas += subMemUsage(runState, offset, length, common) if (common.isActivatedEIP(2929)) { - gas.iadd(accessAddressEIP2929(runState, runState.eei.getAddress(), common, false)) - } - - gas.iadd(new BN(common.param('gasPrices', 'sha3Word')).imul(divCeil(length, new BN(32)))) - - if (common.isActivatedEIP(3860)) { - // Meter initcode - const initCodeCost = new BN(common.param('gasPrices', 'initCodeWordCost')).imul( - length.addn(31).divn(32) - ) - gas.iadd(initCodeCost) + gas += accessAddressEIP2929(runState, runState.eei.getAddress(), common, false) } - let gasLimit = new BN(runState.eei.getGasLeft().isub(gas)) - gasLimit = maxCallGas(gasLimit.clone(), gasLimit.clone(), runState, common) // CREATE2 is only available after TangerineWhistle (Constantinople introduced this opcode) + gas += BigInt(common.param('gasPrices', 'sha3Word')) * divCeil(length, BigInt(32)) + let gasLimit = runState.eei.getGasLeft() - gas + gasLimit = maxCallGas(gasLimit, gasLimit, runState, common) // CREATE2 is only available after TangerineWhistle (Constantinople introduced this opcode) runState.messageGasLimit = gasLimit + return gas }, ], [ /* STATICCALL */ 0xfa, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const [currentGasLimit, toAddr, inOffset, inLength, outOffset, outLength] = runState.stack.peek(6) - gas.iadd(subMemUsage(runState, inOffset, inLength, common)) - gas.iadd(subMemUsage(runState, outOffset, outLength, common)) + gas += subMemUsage(runState, inOffset, inLength, common) + gas += subMemUsage(runState, outOffset, outLength, common) if (common.isActivatedEIP(2929)) { const toAddress = new Address(addressToBuffer(toAddr)) - gas.iadd(accessAddressEIP2929(runState, toAddress, common)) + gas += accessAddressEIP2929(runState, toAddress, common) } const gasLimit = maxCallGas( - currentGasLimit.clone(), - runState.eei.getGasLeft().isub(gas), + currentGasLimit, + runState.eei.getGasLeft() - gas, runState, common ) // we set TangerineWhistle or later to true here, as STATICCALL was available from Byzantium (which is after TangerineWhistle) runState.messageGasLimit = gasLimit + return gas }, ], [ /* REVERT */ 0xfd, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { const [offset, length] = runState.stack.peek(2) - gas.iadd(subMemUsage(runState, offset, length, common)) + gas += subMemUsage(runState, offset, length, common) + return gas }, ], [ /* SELFDESTRUCT */ 0xff, - async function (runState, gas, common): Promise { + async function (runState, gas, common): Promise { if (runState.eei.isStatic()) { trap(ERROR.STATIC_STATE_CHANGE) } - const selfdestructToAddressBN = runState.stack.peek()[0] + const selfdestructToaddressBigInt = runState.stack.peek()[0] - const selfdestructToAddress = new Address(addressToBuffer(selfdestructToAddressBN)) + const selfdestructToAddress = new Address(addressToBuffer(selfdestructToaddressBigInt)) let deductGas = false if (common.gteHardfork('spuriousDragon')) { // EIP-161: State Trie Clearing const balance = await runState.eei.getExternalBalance(runState.eei.getAddress()) - if (balance.gtn(0)) { + if (balance > BigInt(0)) { // This technically checks if account is empty or non-existent // TODO: improve on the API here (EEI and StateManager) const empty = await runState.eei.isAccountEmpty(selfdestructToAddress) @@ -506,12 +505,13 @@ export const dynamicGasHandlers: Map len) { offset = len } - let end = offset.add(length) - if (end.gt(len)) { + let end = offset + length + if (end > len) { end = len } - data = data.slice(offset.toNumber(), end.toNumber()) + data = data.slice(Number(offset), Number(end)) // Right-pad with zeros to fill dataLength bytes - data = setLengthRight(data, length.toNumber()) + data = setLengthRight(data, Number(length)) return data } @@ -165,11 +165,16 @@ export function jumpSubIsValid(runState: RunState, dest: number): boolean { * @param {RunState} runState - the current runState * @param {Common} common - the common */ -export function maxCallGas(gasLimit: BN, gasLeft: BN, runState: RunState, common: Common): BN { +export function maxCallGas( + gasLimit: bigint, + gasLeft: bigint, + runState: RunState, + common: Common +): bigint { const isTangerineWhistleOrLater = common.gteHardfork('tangerineWhistle') if (isTangerineWhistleOrLater) { - const gasAllowed = gasLeft.sub(gasLeft.divn(64)) - return gasLimit.gt(gasAllowed) ? gasAllowed : gasLimit + const gasAllowed = gasLeft - gasLeft / BigInt(64) + return gasLimit > gasAllowed ? gasAllowed : gasLimit } else { return gasLimit } @@ -183,23 +188,23 @@ export function maxCallGas(gasLimit: BN, gasLeft: BN, runState: RunState, common * @param {BN} offset * @param {BN} length */ -export function subMemUsage(runState: RunState, offset: BN, length: BN, common: Common) { +export function subMemUsage(runState: RunState, offset: bigint, length: bigint, common: Common) { // YP (225): access with zero length will not extend the memory - if (length.isZero()) return new BN(0) + if (length === BigInt(0)) return BigInt(0) - const newMemoryWordCount = divCeil(offset.add(length), new BN(32)) - if (newMemoryWordCount.lte(runState.memoryWordCount)) return new BN(0) + const newMemoryWordCount = divCeil(offset + length, BigInt(32)) + if (newMemoryWordCount <= runState.memoryWordCount) return BigInt(0) const words = newMemoryWordCount - const fee = new BN(common.param('gasPrices', 'memory')) - const quadCoeff = new BN(common.param('gasPrices', 'quadCoeffDiv')) + const fee = BigInt(common.param('gasPrices', 'memory')) + const quadCoeff = BigInt(common.param('gasPrices', 'quadCoeffDiv')) // words * 3 + words ^2 / 512 - const cost = words.mul(fee).add(words.mul(words).div(quadCoeff)) + let cost = words * fee + (words * words) / quadCoeff - if (cost.gt(runState.highestMemCost)) { + if (cost > runState.highestMemCost) { const currentHighestMemCost = runState.highestMemCost - runState.highestMemCost = cost.clone() - cost.isub(currentHighestMemCost) + runState.highestMemCost = cost + cost -= currentHighestMemCost } runState.memoryWordCount = newMemoryWordCount @@ -214,15 +219,15 @@ export function subMemUsage(runState: RunState, offset: BN, length: BN, common: * @param {BN} outOffset * @param {BN} outLength */ -export function writeCallOutput(runState: RunState, outOffset: BN, outLength: BN) { +export function writeCallOutput(runState: RunState, outOffset: bigint, outLength: bigint) { const returnData = runState.eei.getReturnData() if (returnData.length > 0) { - const memOffset = outOffset.toNumber() - let dataLength = outLength.toNumber() - if (returnData.length < dataLength) { + const memOffset = Number(outOffset) + let dataLength = Number(outLength) + if (BigInt(returnData.length) < dataLength) { dataLength = returnData.length } - const data = getDataSlice(returnData, new BN(0), new BN(dataLength)) + const data = getDataSlice(returnData, BigInt(0), BigInt(dataLength)) runState.memory.extend(memOffset, dataLength) runState.memory.write(memOffset, dataLength, data) } @@ -239,16 +244,16 @@ export function updateSstoreGas( currentStorage: Buffer, value: Buffer, common: Common -): BN { +): bigint { if ( (value.length === 0 && currentStorage.length === 0) || (value.length > 0 && currentStorage.length > 0) ) { - const gas = new BN(common.param('gasPrices', 'sstoreReset')) + const gas = BigInt(common.param('gasPrices', 'sstoreReset')) return gas } else if (value.length === 0 && currentStorage.length > 0) { - const gas = new BN(common.param('gasPrices', 'sstoreReset')) - runState.eei.refundGas(new BN(common.param('gasPrices', 'sstoreRefund')), 'updateSstoreGas') + const gas = BigInt(common.param('gasPrices', 'sstoreReset')) + runState.eei.refundGas(BigInt(common.param('gasPrices', 'sstoreRefund')), 'updateSstoreGas') return gas } else { /* @@ -258,6 +263,42 @@ export function updateSstoreGas( -> Value is zero, but slot is nonzero Thus, the remaining case is where value is nonzero, but slot is zero, which is this clause */ - return new BN(common.param('gasPrices', 'sstoreSet')) + return BigInt(common.param('gasPrices', 'sstoreSet')) + } +} + +export function mod(a: bigint, b: bigint) { + let r = a % b + if (r < BigInt(0)) { + r = b + r + } + return r +} + +export function fromTwos(a: bigint) { + return BigInt.asIntN(256, a) +} + +export function toTwos(a: bigint) { + return BigInt.asUintN(256, a) +} + +export function abs(a: bigint) { + if (a > 0) { + return a + } + return a * BigInt(-1) +} + +const N = BigInt(115792089237316195423570985008687907853269984665640564039457584007913129639936) +export function exponentation(bas: bigint, exp: bigint) { + let t = BigInt(1) + while (exp > BigInt(0)) { + if (exp % BigInt(2) != BigInt(0)) { + t = (t * bas) % N + } + bas = (bas * bas) % N + exp = exp / BigInt(2) } + return t } diff --git a/packages/vm/src/evm/precompiles/01-ecrecover.ts b/packages/vm/src/evm/precompiles/01-ecrecover.ts index 0557210d456..c792867b573 100644 --- a/packages/vm/src/evm/precompiles/01-ecrecover.ts +++ b/packages/vm/src/evm/precompiles/01-ecrecover.ts @@ -6,9 +6,9 @@ const assert = require('assert') export default function (opts: PrecompileInput): ExecResult { assert(opts.data) - const gasUsed = new BN(opts._common.param('gasPrices', 'ecRecover')) + const gasUsed = BigInt(opts._common.param('gasPrices', 'ecRecover')) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/02-sha256.ts b/packages/vm/src/evm/precompiles/02-sha256.ts index dd9a049b880..6779547aec3 100644 --- a/packages/vm/src/evm/precompiles/02-sha256.ts +++ b/packages/vm/src/evm/precompiles/02-sha256.ts @@ -1,4 +1,4 @@ -import { sha256, BN } from 'ethereumjs-util' +import { sha256 } from 'ethereumjs-util' import { PrecompileInput } from './types' import { OOGResult, ExecResult } from '../evm' const assert = require('assert') @@ -8,12 +8,11 @@ export default function (opts: PrecompileInput): ExecResult { const data = opts.data - const gasUsed = new BN(opts._common.param('gasPrices', 'sha256')) - gasUsed.iadd( - new BN(opts._common.param('gasPrices', 'sha256Word')).imuln(Math.ceil(data.length / 32)) - ) + let gasUsed = BigInt(opts._common.param('gasPrices', 'sha256')) + gasUsed += + BigInt(opts._common.param('gasPrices', 'sha256Word')) * BigInt(Math.ceil(data.length / 32)) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/03-ripemd160.ts b/packages/vm/src/evm/precompiles/03-ripemd160.ts index 7817565f614..c979072e7af 100644 --- a/packages/vm/src/evm/precompiles/03-ripemd160.ts +++ b/packages/vm/src/evm/precompiles/03-ripemd160.ts @@ -1,4 +1,4 @@ -import { ripemd160, BN } from 'ethereumjs-util' +import { ripemd160 } from 'ethereumjs-util' import { PrecompileInput } from './types' import { OOGResult, ExecResult } from '../evm' const assert = require('assert') @@ -8,12 +8,11 @@ export default function (opts: PrecompileInput): ExecResult { const data = opts.data - const gasUsed = new BN(opts._common.param('gasPrices', 'ripemd160')) - gasUsed.iadd( - new BN(opts._common.param('gasPrices', 'ripemd160Word')).imuln(Math.ceil(data.length / 32)) - ) + let gasUsed = BigInt(opts._common.param('gasPrices', 'ripemd160')) + gasUsed += + BigInt(opts._common.param('gasPrices', 'ripemd160Word')) * BigInt(Math.ceil(data.length / 32)) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/04-identity.ts b/packages/vm/src/evm/precompiles/04-identity.ts index c9349d9e886..7890e3efca2 100644 --- a/packages/vm/src/evm/precompiles/04-identity.ts +++ b/packages/vm/src/evm/precompiles/04-identity.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { OOGResult, ExecResult } from '../evm' const assert = require('assert') @@ -8,12 +7,11 @@ export default function (opts: PrecompileInput): ExecResult { const data = opts.data - const gasUsed = new BN(opts._common.param('gasPrices', 'identity')) - gasUsed.iadd( - new BN(opts._common.param('gasPrices', 'identityWord')).imuln(Math.ceil(data.length / 32)) - ) + let gasUsed = BigInt(opts._common.param('gasPrices', 'identity')) + gasUsed += + BigInt(opts._common.param('gasPrices', 'identityWord')) * BigInt(Math.ceil(data.length / 32)) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/05-modexp.ts b/packages/vm/src/evm/precompiles/05-modexp.ts index ded027cb851..e64ab6c3c9a 100644 --- a/packages/vm/src/evm/precompiles/05-modexp.ts +++ b/packages/vm/src/evm/precompiles/05-modexp.ts @@ -1,74 +1,77 @@ -import { setLengthRight, BN } from 'ethereumjs-util' +import { setLengthRight, setLengthLeft, bufferToBigInt, bigIntToBuffer } from 'ethereumjs-util' import { PrecompileInput } from './types' import { OOGResult, ExecResult } from '../evm' const assert = require('assert') -function multComplexity(x: BN): BN { +function multComplexity(x: bigint): bigint { let fac1 let fac2 - if (x.lten(64)) { - return x.sqr() - } else if (x.lten(1024)) { + if (x <= BigInt(64)) { + return x ** BigInt(2) + } else if (x <= BigInt(1024)) { // return Math.floor(Math.pow(x, 2) / 4) + 96 * x - 3072 - fac1 = x.sqr().divn(4) - fac2 = x.muln(96) - return fac1.add(fac2).subn(3072) + fac1 = x ** BigInt(2) / BigInt(4) + fac2 = x * BigInt(96) + return fac1 + fac2 - BigInt(3072) } else { // return Math.floor(Math.pow(x, 2) / 16) + 480 * x - 199680 - fac1 = x.sqr().divn(16) - fac2 = x.muln(480) - return fac1.add(fac2).subn(199680) + fac1 = x ** BigInt(2) / BigInt(16) + fac2 = x * BigInt(480) + return fac1 + fac2 - BigInt(199680) } } -function multComplexityEIP2565(x: BN): BN { - const words = x.addn(7).divn(8) - return words.mul(words) +function multComplexityEIP2565(x: bigint): bigint { + const words = (x + BigInt(7)) / BigInt(8) + return words * words } -function getAdjustedExponentLength(data: Buffer): BN { +function getAdjustedExponentLength(data: Buffer): bigint { let expBytesStart try { - const baseLen = new BN(data.slice(0, 32)).toNumber() - expBytesStart = 96 + baseLen // 96 for base length, then exponent length, and modulus length, then baseLen for the base data, then exponent bytes start + const baseLen = bufferToBigInt(data.slice(0, 32)) + expBytesStart = 96 + Number(baseLen) // 96 for base length, then exponent length, and modulus length, then baseLen for the base data, then exponent bytes start } catch (e: any) { expBytesStart = Number.MAX_SAFE_INTEGER - 32 } - const expLen = new BN(data.slice(32, 64)) + const expLen = bufferToBigInt(data.slice(32, 64)) let firstExpBytes = Buffer.from(data.slice(expBytesStart, expBytesStart + 32)) // first word of the exponent data firstExpBytes = setLengthRight(firstExpBytes, 32) // reading past the data reads virtual zeros - let firstExpBN = new BN(firstExpBytes) + let firstExpBigInt = bufferToBigInt(firstExpBytes) let max32expLen = 0 - if (expLen.ltn(32)) { - max32expLen = 32 - expLen.toNumber() + if (expLen < BigInt(32)) { + max32expLen = 32 - Number(expLen) } - firstExpBN = firstExpBN.shrn(8 * Math.max(max32expLen, 0)) + firstExpBigInt = firstExpBigInt >> (BigInt(8) * BigInt(Math.max(max32expLen, 0))) let bitLen = -1 - while (firstExpBN.gtn(0)) { + while (firstExpBigInt > BigInt(0)) { bitLen = bitLen + 1 - firstExpBN = firstExpBN.ushrn(1) + firstExpBigInt = firstExpBigInt >> BigInt(1) } - let expLenMinus32OrZero = expLen.subn(32) - if (expLenMinus32OrZero.ltn(0)) { - expLenMinus32OrZero = new BN(0) + let expLenMinus32OrZero = expLen - BigInt(32) + if (expLenMinus32OrZero < BigInt(0)) { + expLenMinus32OrZero = BigInt(0) } - const eightTimesExpLenMinus32OrZero = expLenMinus32OrZero.muln(8) - const adjustedExpLen = eightTimesExpLenMinus32OrZero + const eightTimesExpLenMinus32OrZero = expLenMinus32OrZero * BigInt(8) + let adjustedExpLen = eightTimesExpLenMinus32OrZero if (bitLen > 0) { - adjustedExpLen.iaddn(bitLen) + adjustedExpLen += BigInt(bitLen) } return adjustedExpLen } -function expmod(B: BN, E: BN, M: BN): BN { - if (E.isZero()) return new BN(1).mod(M) - // Red asserts M > 1 - if (M.lten(1)) return new BN(0) - const red = BN.red(M) - const redB = B.toRed(red) - const res = redB.redPow(E) - return res.fromRed() +export function expmod(a: bigint, power: bigint, modulo: bigint) { + if (power === BigInt(0)) { + return BigInt(1) % modulo + } + let res = BigInt(1) + while (power > BigInt(0)) { + if (power & BigInt(1)) res = (res * a) % modulo + a = (a * a) % modulo + power >>= BigInt(1) + } + return res } export default function (opts: PrecompileInput): ExecResult { @@ -77,79 +80,79 @@ export default function (opts: PrecompileInput): ExecResult { const data = opts.data let adjustedELen = getAdjustedExponentLength(data) - if (adjustedELen.ltn(1)) { - adjustedELen = new BN(1) + if (adjustedELen < BigInt(1)) { + adjustedELen = BigInt(1) } - const bLen = new BN(data.slice(0, 32)) - const eLen = new BN(data.slice(32, 64)) - const mLen = new BN(data.slice(64, 96)) + const bLen = bufferToBigInt(data.slice(0, 32)) + const eLen = bufferToBigInt(data.slice(32, 64)) + const mLen = bufferToBigInt(data.slice(64, 96)) let maxLen = bLen - if (maxLen.lt(mLen)) { + if (maxLen < mLen) { maxLen = mLen } - const Gquaddivisor = opts._common.param('gasPrices', 'modexpGquaddivisor') + const Gquaddivisor = BigInt(opts._common.param('gasPrices', 'modexpGquaddivisor')) let gasUsed - const bStart = new BN(96) - const bEnd = bStart.add(bLen) + const bStart = BigInt(96) + const bEnd = bStart + bLen const eStart = bEnd - const eEnd = eStart.add(eLen) + const eEnd = eStart + eLen const mStart = eEnd - const mEnd = mStart.add(mLen) + const mEnd = mStart + mLen if (!opts._common.isActivatedEIP(2565)) { - gasUsed = adjustedELen.mul(multComplexity(maxLen)).divn(Gquaddivisor) + gasUsed = (adjustedELen * multComplexity(maxLen)) / Gquaddivisor } else { - gasUsed = adjustedELen.mul(multComplexityEIP2565(maxLen)).divn(Gquaddivisor) - if (gasUsed.ltn(200)) { - gasUsed = new BN(200) + gasUsed = (adjustedELen * multComplexityEIP2565(maxLen)) / Gquaddivisor + if (gasUsed < BigInt(200)) { + gasUsed = BigInt(200) } } - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } - if (bLen.isZero()) { + if (bLen === BigInt(0)) { return { gasUsed, - returnValue: new BN(0).toArrayLike(Buffer, 'be', mLen.toNumber()), + returnValue: setLengthLeft(bigIntToBuffer(BigInt(0)), Number(mLen)), } } - if (mLen.isZero()) { + if (mLen === BigInt(0)) { return { gasUsed, returnValue: Buffer.alloc(0), } } - const maxInt = new BN(Number.MAX_SAFE_INTEGER) - const maxSize = new BN(2147483647) // ethereumjs-util setLengthRight limitation + const maxInt = BigInt(Number.MAX_SAFE_INTEGER) + const maxSize = BigInt(2147483647) // ethereumjs-util setLengthRight limitation - if (bLen.gt(maxSize) || eLen.gt(maxSize) || mLen.gt(maxSize)) { + if (bLen > maxSize || eLen > maxSize || mLen > maxSize) { return OOGResult(opts.gasLimit) } - const B = new BN(setLengthRight(data.slice(bStart.toNumber(), bEnd.toNumber()), bLen.toNumber())) - const E = new BN(setLengthRight(data.slice(eStart.toNumber(), eEnd.toNumber()), eLen.toNumber())) - const M = new BN(setLengthRight(data.slice(mStart.toNumber(), mEnd.toNumber()), mLen.toNumber())) + const B = bufferToBigInt(setLengthRight(data.slice(Number(bStart), Number(bEnd)), Number(bLen))) + const E = bufferToBigInt(setLengthRight(data.slice(Number(eStart), Number(eEnd)), Number(eLen))) + const M = bufferToBigInt(setLengthRight(data.slice(Number(mStart), Number(mEnd)), Number(mLen))) - if (mEnd.gt(maxInt)) { + if (mEnd > maxInt) { return OOGResult(opts.gasLimit) } let R - if (M.isZero()) { - R = new BN(0) + if (M === BigInt(0)) { + R = BigInt(0) } else { R = expmod(B, E, M) } return { gasUsed, - returnValue: R.toArrayLike(Buffer, 'be', mLen.toNumber()), + returnValue: setLengthLeft(bigIntToBuffer(R), Number(mLen)), } } diff --git a/packages/vm/src/evm/precompiles/06-ecadd.ts b/packages/vm/src/evm/precompiles/06-ecadd.ts index e35aee99ad1..f1046ca5904 100644 --- a/packages/vm/src/evm/precompiles/06-ecadd.ts +++ b/packages/vm/src/evm/precompiles/06-ecadd.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { OOGResult, ExecResult } from '../evm' const assert = require('assert') @@ -9,8 +8,8 @@ export default function (opts: PrecompileInput): ExecResult { const inputData = opts.data - const gasUsed = new BN(opts._common.param('gasPrices', 'ecAdd')) - if (opts.gasLimit.lt(gasUsed)) { + const gasUsed = BigInt(opts._common.param('gasPrices', 'ecAdd')) + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/07-ecmul.ts b/packages/vm/src/evm/precompiles/07-ecmul.ts index 75cd7dbc974..e436315c638 100644 --- a/packages/vm/src/evm/precompiles/07-ecmul.ts +++ b/packages/vm/src/evm/precompiles/07-ecmul.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { OOGResult, ExecResult } from '../evm' const assert = require('assert') @@ -8,9 +7,9 @@ export default function (opts: PrecompileInput): ExecResult { assert(opts.data) const inputData = opts.data - const gasUsed = new BN(opts._common.param('gasPrices', 'ecMul')) + const gasUsed = BigInt(opts._common.param('gasPrices', 'ecMul')) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/08-ecpairing.ts b/packages/vm/src/evm/precompiles/08-ecpairing.ts index 57d0a641b76..f799f67847d 100644 --- a/packages/vm/src/evm/precompiles/08-ecpairing.ts +++ b/packages/vm/src/evm/precompiles/08-ecpairing.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { OOGResult, ExecResult } from '../evm' const assert = require('assert') @@ -10,12 +9,12 @@ export default function (opts: PrecompileInput): ExecResult { const inputData = opts.data // no need to care about non-divisible-by-192, because bn128.pairing will properly fail in that case const inputDataSize = Math.floor(inputData.length / 192) - const gasUsed = new BN( + const gasUsed = BigInt( opts._common.param('gasPrices', 'ecPairing') + inputDataSize * opts._common.param('gasPrices', 'ecPairingWord') ) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/09-blake2f.ts b/packages/vm/src/evm/precompiles/09-blake2f.ts index 075fd616704..3b044b6f5b9 100644 --- a/packages/vm/src/evm/precompiles/09-blake2f.ts +++ b/packages/vm/src/evm/precompiles/09-blake2f.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { OOGResult, ExecResult } from '../evm' import { VmError, ERROR } from '../../exceptions' @@ -182,9 +181,9 @@ export default function (opts: PrecompileInput): ExecResult { // final const f = lastByte === 1 - const gasUsed = new BN(opts._common.param('gasPrices', 'blake2Round')) - gasUsed.imul(new BN(rounds)) - if (opts.gasLimit.lt(gasUsed)) { + let gasUsed = BigInt(opts._common.param('gasPrices', 'blake2Round')) + gasUsed *= BigInt(rounds) + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts b/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts index bcc9a07b24a..c50230108b9 100644 --- a/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts +++ b/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { VmErrorResult, ExecResult, OOGResult } from '../evm' import { ERROR, VmError } from '../../exceptions' @@ -13,9 +12,9 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = new BN(opts._common.paramByEIP('gasPrices', 'Bls12381G1AddGas', 2537)) + const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G1AddGas', 2537)) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts b/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts index bdd9ab8e89f..7e2c445a08c 100644 --- a/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts +++ b/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { VmErrorResult, ExecResult, OOGResult } from '../evm' import { ERROR, VmError } from '../../exceptions' @@ -17,9 +16,9 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = new BN(opts._common.paramByEIP('gasPrices', 'Bls12381G1MulGas', 2537)) + const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G1MulGas', 2537)) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts b/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts index ebb939798d0..6f2cb1225a4 100644 --- a/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts +++ b/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { VmErrorResult, ExecResult, OOGResult } from '../evm' import { ERROR, VmError } from '../../exceptions' @@ -22,7 +21,7 @@ export default async function (opts: PrecompileInput): Promise { const numPairs = Math.floor(inputData.length / 160) - const gasUsedPerPair = new BN(opts._common.paramByEIP('gasPrices', 'Bls12381G1MulGas', 2537)) + const gasUsedPerPair = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G1MulGas', 2537)) const gasDiscountArray = opts._common.paramByEIP('gasPrices', 'Bls12381MultiExpGasDiscount', 2537) const gasDiscountMax = gasDiscountArray[gasDiscountArray.length - 1][1] let gasDiscountMultiplier @@ -37,9 +36,9 @@ export default async function (opts: PrecompileInput): Promise { gasDiscountMultiplier = gasDiscountMax } - const gasUsed = gasUsedPerPair.imuln(numPairs).imuln(gasDiscountMultiplier).idivn(1000) + const gasUsed = (gasUsedPerPair * BigInt(numPairs) * BigInt(gasDiscountMultiplier)) / BigInt(1000) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts b/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts index bea69fb3d8a..3bd46c77e81 100644 --- a/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts +++ b/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { VmErrorResult, ExecResult, OOGResult } from '../evm' import { ERROR, VmError } from '../../exceptions' @@ -13,9 +12,9 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = new BN(opts._common.paramByEIP('gasPrices', 'Bls12381G2AddGas', 2537)) + const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G2AddGas', 2537)) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts b/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts index 5d100d6aee6..0eb10e0ad53 100644 --- a/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts +++ b/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { VmErrorResult, ExecResult, OOGResult } from '../evm' import { ERROR, VmError } from '../../exceptions' @@ -17,9 +16,9 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = new BN(opts._common.paramByEIP('gasPrices', 'Bls12381G2MulGas', 2537)) + const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G2MulGas', 2537)) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts b/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts index 7454a59c7f8..79d3a762ad5 100644 --- a/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts +++ b/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { VmErrorResult, ExecResult, OOGResult } from '../evm' import { ERROR, VmError } from '../../exceptions' @@ -22,7 +21,7 @@ export default async function (opts: PrecompileInput): Promise { const numPairs = Math.floor(inputData.length / 288) - const gasUsedPerPair = new BN(opts._common.paramByEIP('gasPrices', 'Bls12381G2MulGas', 2537)) + const gasUsedPerPair = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G2MulGas', 2537)) const gasDiscountArray = opts._common.paramByEIP('gasPrices', 'Bls12381MultiExpGasDiscount', 2537) const gasDiscountMax = gasDiscountArray[gasDiscountArray.length - 1][1] let gasDiscountMultiplier @@ -37,9 +36,9 @@ export default async function (opts: PrecompileInput): Promise { gasDiscountMultiplier = gasDiscountMax } - const gasUsed = gasUsedPerPair.imuln(numPairs).imuln(gasDiscountMultiplier).idivn(1000) + const gasUsed = (gasUsedPerPair * BigInt(numPairs) * BigInt(gasDiscountMultiplier)) / BigInt(1000) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/10-bls12-pairing.ts b/packages/vm/src/evm/precompiles/10-bls12-pairing.ts index 066c3d59722..0a516dca389 100644 --- a/packages/vm/src/evm/precompiles/10-bls12-pairing.ts +++ b/packages/vm/src/evm/precompiles/10-bls12-pairing.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { VmErrorResult, ExecResult, OOGResult } from '../evm' import { ERROR, VmError } from '../../exceptions' @@ -15,22 +14,22 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data - const baseGas = new BN(opts._common.paramByEIP('gasPrices', 'Bls12381PairingBaseGas', 2537)) + const baseGas = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381PairingBaseGas', 2537)) if (inputData.length == 0) { return VmErrorResult(new VmError(ERROR.BLS_12_381_INPUT_EMPTY), opts.gasLimit) } - const gasUsedPerPair = new BN( + const gasUsedPerPair = BigInt( opts._common.paramByEIP('gasPrices', 'Bls12381PairingPerPairGas', 2537) ) - const gasUsed = baseGas.iadd(gasUsedPerPair.imul(new BN(Math.floor(inputData.length / 384)))) + const gasUsed = baseGas + gasUsedPerPair * BigInt(Math.floor(inputData.length / 384)) if (inputData.length % 384 != 0) { return VmErrorResult(new VmError(ERROR.BLS_12_381_INVALID_INPUT_LENGTH), opts.gasLimit) } - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts b/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts index 6debbb56a34..ab30545c853 100644 --- a/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts +++ b/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { VmErrorResult, ExecResult, OOGResult } from '../evm' import { ERROR, VmError } from '../../exceptions' @@ -13,9 +12,9 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = new BN(opts._common.paramByEIP('gasPrices', 'Bls12381MapG1Gas', 2537)) + const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381MapG1Gas', 2537)) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts b/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts index ec9ebd1ae5d..01748b6ae87 100644 --- a/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts +++ b/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { PrecompileInput } from './types' import { VmErrorResult, ExecResult, OOGResult } from '../evm' import { ERROR, VmError } from '../../exceptions' @@ -13,9 +12,9 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = new BN(opts._common.paramByEIP('gasPrices', 'Bls12381MapG2Gas', 2537)) + const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381MapG2Gas', 2537)) - if (opts.gasLimit.lt(gasUsed)) { + if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/types.ts b/packages/vm/src/evm/precompiles/types.ts index 89329958a7e..837d2d0c8f7 100644 --- a/packages/vm/src/evm/precompiles/types.ts +++ b/packages/vm/src/evm/precompiles/types.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import Common from '@ethereumjs/common' import { ExecResult } from '../evm' import VM from '../../index' @@ -9,7 +8,7 @@ export interface PrecompileFunc { export interface PrecompileInput { data: Buffer - gasLimit: BN + gasLimit: bigint _common: Common _VM: VM } diff --git a/packages/vm/src/evm/precompiles/util/bls12_381.ts b/packages/vm/src/evm/precompiles/util/bls12_381.ts index 9824a70f013..a9d5dbdc81d 100644 --- a/packages/vm/src/evm/precompiles/util/bls12_381.ts +++ b/packages/vm/src/evm/precompiles/util/bls12_381.ts @@ -1,10 +1,9 @@ -import { padToEven, BN } from 'ethereumjs-util' +import { padToEven, bufferToBigInt } from 'ethereumjs-util' import { VmError, ERROR } from '../../../exceptions' // base field modulus as described in the EIP -const fieldModulus = new BN( - '1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab', - 16 +const fieldModulus = BigInt( + '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab' ) // convert an input Buffer to a mcl G1 point @@ -159,7 +158,7 @@ function BLS12_381_ToFrPoint(input: Buffer, mcl: any): any { function BLS12_381_ToFpPoint(fpCoordinate: Buffer, mcl: any): any { // check if point is in field - if (new BN(fpCoordinate).gte(fieldModulus)) { + if (bufferToBigInt(fpCoordinate) >= fieldModulus) { throw new VmError(ERROR.BLS_12_381_FP_NOT_IN_FIELD) } @@ -175,10 +174,10 @@ function BLS12_381_ToFpPoint(fpCoordinate: Buffer, mcl: any): any { function BLS12_381_ToFp2Point(fpXCoordinate: Buffer, fpYCoordinate: Buffer, mcl: any): any { // check if the coordinates are in the field - if (new BN(fpXCoordinate).gte(fieldModulus)) { + if (bufferToBigInt(fpXCoordinate) >= fieldModulus) { throw new VmError(ERROR.BLS_12_381_FP_NOT_IN_FIELD) } - if (new BN(fpYCoordinate).gte(fieldModulus)) { + if (bufferToBigInt(fpYCoordinate) >= fieldModulus) { throw new VmError(ERROR.BLS_12_381_FP_NOT_IN_FIELD) } diff --git a/packages/vm/src/evm/stack.ts b/packages/vm/src/evm/stack.ts index 6b3613a12b0..75cfbed0412 100644 --- a/packages/vm/src/evm/stack.ts +++ b/packages/vm/src/evm/stack.ts @@ -1,11 +1,11 @@ -import { BN, MAX_INTEGER } from 'ethereumjs-util' +import { MAX_INTEGER_BIGINT } from 'ethereumjs-util' import { ERROR, VmError } from '../exceptions' /** * Implementation of the stack used in evm. */ export default class Stack { - _store: BN[] + _store: bigint[] _maxHeight: number constructor(maxHeight?: number) { @@ -17,12 +17,12 @@ export default class Stack { return this._store.length } - push(value: BN) { - if (!BN.isBN(value)) { + push(value: bigint) { + if (typeof value !== 'bigint') { throw new VmError(ERROR.INTERNAL_ERROR) } - if (value.gt(MAX_INTEGER)) { + if (value > MAX_INTEGER_BIGINT) { throw new VmError(ERROR.OUT_OF_RANGE) } @@ -33,7 +33,7 @@ export default class Stack { this._store.push(value) } - pop(): BN { + pop(): bigint { if (this._store.length < 1) { throw new VmError(ERROR.STACK_UNDERFLOW) } @@ -47,7 +47,7 @@ export default class Stack { * in returned array. * @param num - Number of items to pop */ - popN(num: number = 1): BN[] { + popN(num: number = 1): bigint[] { if (this._store.length < num) { throw new VmError(ERROR.STACK_UNDERFLOW) } @@ -64,8 +64,8 @@ export default class Stack { * @param num Number of items to return * @throws {@link ERROR.STACK_UNDERFLOW} */ - peek(num: number = 1): BN[] { - const peekArray: BN[] = [] + peek(num: number = 1): bigint[] { + const peekArray: bigint[] = [] for (let peek = 1; peek <= num; peek++) { const index = this._store.length - peek @@ -98,12 +98,16 @@ export default class Stack { * Pushes a copy of an item in the stack. * @param position - Index of item to be copied (1-indexed) */ + // I would say that we do not need this method any more + // since you can't copy a primitive data type + // Nevertheless not sure if we "loose" something here? + // Will keep commented out for now dup(position: number) { if (this._store.length < position) { throw new VmError(ERROR.STACK_UNDERFLOW) } const i = this._store.length - position - this.push(this._store[i].clone()) + this.push(this._store[i]) } } diff --git a/packages/vm/src/evm/txContext.ts b/packages/vm/src/evm/txContext.ts index 3d9b8aeceeb..ce48c167711 100644 --- a/packages/vm/src/evm/txContext.ts +++ b/packages/vm/src/evm/txContext.ts @@ -1,10 +1,10 @@ -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' export default class TxContext { - gasPrice: BN + gasPrice: bigint origin: Address - constructor(gasPrice: BN, origin: Address) { + constructor(gasPrice: bigint, origin: Address) { this.gasPrice = gasPrice this.origin = origin } diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index 3834152c5d2..2e12057fb09 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -1,6 +1,6 @@ import { debug as createDebugLogger } from 'debug' import { BaseTrie as Trie } from 'merkle-patricia-tree' -import { Account, Address, BN, intToBuffer, rlp } from 'ethereumjs-util' +import { Account, Address, bigIntToBN, BN, bnToBigInt, intToBuffer, rlp } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import { ConsensusType } from '@ethereumjs/common' import VM from './index' @@ -83,7 +83,7 @@ export interface RunBlockResult { /** * The gas used after executing the block */ - gasUsed: BN + gasUsed: bigint /** * The bloom filter of the LOGs (events) after executing the block */ @@ -191,7 +191,7 @@ export default async function runBlock(this: VM, opts: RunBlockOpts): Promise ${gasUsed})`) } @@ -390,11 +390,15 @@ async function assignBlockRewards(this: VM, block: Block): Promise { debug(`Assign block rewards`) } const state = this.stateManager - const minerReward = new BN(this._common.param('pow', 'minerReward')) + const minerReward = BigInt(this._common.param('pow', 'minerReward')) const ommers = block.uncleHeaders // Reward ommers for (const ommer of ommers) { - const reward = calculateOmmerReward(ommer.number, block.header.number, minerReward) + const reward = calculateOmmerReward( + bnToBigInt(ommer.number), + bnToBigInt(block.header.number), + minerReward + ) const account = await rewardAccount(state, ommer.coinbase, reward) if (this.DEBUG) { debug(`Add uncle reward ${reward} to account ${ommer.coinbase} (-> ${account.balance})`) @@ -408,30 +412,34 @@ async function assignBlockRewards(this: VM, block: Block): Promise { } } -function calculateOmmerReward(ommerBlockNumber: BN, blockNumber: BN, minerReward: BN): BN { - const heightDiff = blockNumber.sub(ommerBlockNumber) - let reward = new BN(8).sub(heightDiff).mul(minerReward.divn(8)) - if (reward.ltn(0)) { - reward = new BN(0) +function calculateOmmerReward( + ommerBlockNumber: bigint, + blockNumber: bigint, + minerReward: bigint +): bigint { + const heightDiff = blockNumber - ommerBlockNumber + let reward = ((BigInt(8) - heightDiff) * minerReward) / BigInt(8) + if (reward < BigInt(0)) { + reward = BigInt(0) } return reward } -export function calculateMinerReward(minerReward: BN, ommersNum: number): BN { +export function calculateMinerReward(minerReward: bigint, ommersNum: number): bigint { // calculate nibling reward - const niblingReward = minerReward.divn(32) - const totalNiblingReward = niblingReward.muln(ommersNum) - const reward = minerReward.add(totalNiblingReward) + const niblingReward = minerReward / BigInt(32) + const totalNiblingReward = niblingReward * BigInt(ommersNum) + const reward = minerReward + totalNiblingReward return reward } export async function rewardAccount( state: StateManager, address: Address, - reward: BN + reward: bigint ): Promise { const account = await state.getAccount(address) - account.balance.iadd(reward) + account.balance.iadd(bigIntToBN(reward)) await state.putAccount(address, account) return account } diff --git a/packages/vm/src/runCall.ts b/packages/vm/src/runCall.ts index 9f2451030e0..e62a92e4f51 100644 --- a/packages/vm/src/runCall.ts +++ b/packages/vm/src/runCall.ts @@ -1,4 +1,4 @@ -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import VM from './index' import TxContext from './evm/txContext' @@ -10,12 +10,12 @@ import { default as EVM, EVMResult } from './evm/evm' */ export interface RunCallOpts { block?: Block - gasPrice?: BN + gasPrice?: bigint origin?: Address caller?: Address - gasLimit?: BN + gasLimit?: bigint to?: Address - value?: BN + value?: bigint data?: Buffer /** * This is for CALLCODE where the code to load is different than the code from the `opts.to` address. @@ -36,13 +36,13 @@ export default function runCall(this: VM, opts: RunCallOpts): Promise const block = opts.block ?? Block.fromBlockData({}, { common: this._common }) const txContext = new TxContext( - opts.gasPrice ?? new BN(0), + opts.gasPrice ?? BigInt(0), opts.origin ?? opts.caller ?? Address.zero() ) const message = new Message({ caller: opts.caller ?? Address.zero(), - gasLimit: opts.gasLimit ?? new BN(0xffffff), + gasLimit: opts.gasLimit ?? BigInt(0xffffff), to: opts.to ?? undefined, value: opts.value, data: opts.data, diff --git a/packages/vm/src/runCode.ts b/packages/vm/src/runCode.ts index df78d929771..6a3adaebad2 100644 --- a/packages/vm/src/runCode.ts +++ b/packages/vm/src/runCode.ts @@ -11,7 +11,7 @@ from the stack, instead you should `copy` it first. item length then you must use `utils.pad(, 32)` first. */ -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import VM from './index' import TxContext from './evm/txContext' @@ -28,7 +28,7 @@ export interface RunCodeOpts { block?: Block evm?: EVM txContext?: TxContext - gasPrice?: BN + gasPrice?: bigint /** * The address where the call originated from. Defaults to the zero address. */ @@ -49,11 +49,11 @@ export interface RunCodeOpts { /** * Gas limit */ - gasLimit?: BN + gasLimit?: bigint /** * The value in ether that is being sent to `opt.address`. Defaults to `0` */ - value?: BN + value?: bigint depth?: number isStatic?: boolean selfdestruct?: { [k: string]: boolean } @@ -76,7 +76,7 @@ export default function runCode(this: VM, opts: RunCodeOpts): Promise { } // Validate gas limit against tx base fee (DataFee + TxFee + Creation Fee) - const txBaseFee = tx.getBaseFee() - const gasLimit = tx.gasLimit.clone() - if (gasLimit.lt(txBaseFee)) { + const txBaseFee = bnToBigInt(tx.getBaseFee()) + let gasLimit = bnToBigInt(tx.gasLimit) + if (gasLimit < txBaseFee) { const msg = _errorMsg('base fee exceeds gas limit', this, block, tx) throw new Error(msg) } - gasLimit.isub(txBaseFee) + gasLimit -= txBaseFee if (this.DEBUG) { debugGas(`Subtracting base fee (${txBaseFee}) from gasLimit (-> ${gasLimit})`) } @@ -364,10 +372,10 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { (tx as FeeMarketEIP1559Transaction).maxPriorityFeePerGas, (tx as FeeMarketEIP1559Transaction).maxFeePerGas.sub(baseFee) ) - gasPrice = inclusionFeePerGas.add(baseFee) + gasPrice = bnToBigInt(inclusionFeePerGas.add(baseFee)) } else { // Have to cast as legacy tx since EIP1559 tx does not have gas price - gasPrice = (tx).gasPrice + gasPrice = bnToBigInt((tx).gasPrice) if (this._common.isActivatedEIP(1559)) { const baseFee = block.header.baseFeePerGas! inclusionFeePerGas = (tx).gasPrice.sub(baseFee) @@ -376,8 +384,8 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { // Update from account's nonce and balance fromAccount.nonce.iaddn(1) - const txCost = tx.gasLimit.mul(gasPrice) - fromAccount.balance.isub(txCost) + const txCost = bnToBigInt(tx.gasLimit) * gasPrice + fromAccount.balance.isub(bigIntToBN(txCost)) await state.putAccount(caller, fromAccount) if (this.DEBUG) { debug( @@ -394,7 +402,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { caller, gasLimit, to, - value, + value: bnToBigInt(value), data, }) const evm = new EVM(this, txContext, block) @@ -428,19 +436,19 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { debug(`Generated tx bloom with logs=${results.execResult.logs?.length}`) } - // Calculate the total gas used - results.gasUsed.iadd(txBaseFee) + // Caculate the total gas used + results.gasUsed += txBaseFee if (this.DEBUG) { debugGas(`tx add baseFee ${txBaseFee} to gasUsed (-> ${results.gasUsed})`) } // Process any gas refund - let gasRefund = results.execResult.gasRefund ?? new BN(0) - const maxRefundQuotient = this._common.param('gasConfig', 'maxRefundQuotient') - if (!gasRefund.isZero()) { - const maxRefund = results.gasUsed.divn(maxRefundQuotient) - gasRefund = BN.min(gasRefund, maxRefund) - results.gasUsed.isub(gasRefund) + let gasRefund = results.execResult.gasRefund ?? BigInt(0) + const maxRefundQuotient = BigInt(this._common.param('gasConfig', 'maxRefundQuotient')) + if (!(gasRefund === BigInt(0))) { + const maxRefund = results.gasUsed / maxRefundQuotient + gasRefund = gasRefund < maxRefund ? gasRefund : maxRefund + results.gasUsed -= gasRefund if (this.DEBUG) { debug(`Subtract tx gasRefund (${gasRefund}) from gasUsed (-> ${results.gasUsed})`) } @@ -449,13 +457,13 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { debug(`No tx gasRefund`) } } - results.amountSpent = results.gasUsed.mul(gasPrice) + results.amountSpent = results.gasUsed * gasPrice // Update sender's balance fromAccount = await state.getAccount(caller) - const actualTxCost = results.gasUsed.mul(gasPrice) - const txCostDiff = txCost.sub(actualTxCost) - fromAccount.balance.iadd(txCostDiff) + const actualTxCost = results.gasUsed * gasPrice + const txCostDiff = txCost - actualTxCost + fromAccount.balance.iadd(bigIntToBN(txCostDiff)) await state.putAccount(caller, fromAccount) if (this.DEBUG) { debug( @@ -480,9 +488,9 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { const minerAccount = await state.getAccount(miner) // add the amount spent on gas to the miner's account if (this._common.isActivatedEIP(1559)) { - minerAccount.balance.iadd(results.gasUsed.mul(inclusionFeePerGas)) + minerAccount.balance.iadd(bigIntToBN(results.gasUsed).mul(inclusionFeePerGas)) } else { - minerAccount.balance.iadd(results.amountSpent) + minerAccount.balance.iadd(bigIntToBN(results.amountSpent)) } // Put the miner account into the state. If the balance of the miner account remains zero, note that @@ -510,7 +518,9 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { state.clearOriginalStorageCache() // Generate the tx receipt - const cumulativeGasUsed = (opts.blockGasUsed ?? block.header.gasUsed).add(results.gasUsed) + const gasUsed = opts.blockGasUsed ?? bnToBigInt(block.header.gasUsed) + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + const cumulativeGasUsed = gasUsed + results.gasUsed results.receipt = await generateTxReceipt.bind(this)(tx, results, cumulativeGasUsed) /** @@ -565,10 +575,10 @@ export async function generateTxReceipt( this: VM, tx: TypedTransaction, txResult: RunTxResult, - cumulativeGasUsed: BN + cumulativeGasUsed: bigint ): Promise { const baseReceipt: BaseTxReceipt = { - gasUsed: cumulativeGasUsed.toArrayLike(Buffer), + gasUsed: bigIntToBuffer(cumulativeGasUsed), bitvector: txResult.bloom.bitvector, logs: txResult.execResult.logs ?? [], } diff --git a/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts b/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts index d30890ed63b..6322e1c6f5a 100644 --- a/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts @@ -46,15 +46,15 @@ tape('Constantinople: EIP-1283', async (t) => { const runCallArgs = { caller, - gasLimit: new BN(0xffffffffff), + gasLimit: BigInt(0xffffffffff), to: addr, } try { const res = await vm.runCall(runCallArgs) st.assert(res.execResult.exceptionError === undefined) - st.assert(new BN(testCase.used).eq(res.gasUsed)) - st.assert(new BN(testCase.refund).eq(res.execResult.gasRefund!)) + st.assert(BigInt(testCase.used) === res.gasUsed) + st.assert(BigInt(testCase.refund) === res.execResult.gasRefund!) } catch (e: any) { st.fail(e.message) } diff --git a/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts b/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts index c92d2643674..82d855fe498 100644 --- a/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN, privateToAddress, setLengthLeft } from 'ethereumjs-util' +import { Address, bigIntToBN, BN, privateToAddress, setLengthLeft } from 'ethereumjs-util' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { @@ -98,7 +98,7 @@ tape('EIP1559 tests', (t) => { st.ok(miner.balance.eq(expectedMinerBalance), 'miner balance correct') account = await vm.stateManager.getAccount(sender) st.ok(account.balance.eq(expectedAccountBalance), 'account balance correct') - st.ok(results.amountSpent.eq(expectedCost), 'reported cost correct') + st.ok(bigIntToBN(results.amountSpent).eq(expectedCost), 'reported cost correct') const tx2 = new AccessListEIP2930Transaction( { @@ -129,7 +129,7 @@ tape('EIP1559 tests', (t) => { st.ok(miner.balance.eq(expectedMinerBalance), 'miner balance correct') account = await vm.stateManager.getAccount(sender) st.ok(account.balance.eq(expectedAccountBalance), 'account balance correct') - st.ok(results2.amountSpent.eq(expectedCost), 'reported cost correct') + st.ok(bigIntToBN(results2.amountSpent).eq(expectedCost), 'reported cost correct') const tx3 = new Transaction( { @@ -160,7 +160,7 @@ tape('EIP1559 tests', (t) => { st.ok(miner.balance.eq(expectedMinerBalance), 'miner balance correct') account = await vm.stateManager.getAccount(sender) st.ok(account.balance.eq(expectedAccountBalance), 'account balance correct') - st.ok(results3.amountSpent.eq(expectedCost), 'reported cost correct') + st.ok(bigIntToBN(results3.amountSpent).eq(expectedCost), 'reported cost correct') st.end() }) diff --git a/packages/vm/tests/api/EIPs/eip-2315.spec.ts b/packages/vm/tests/api/EIPs/eip-2315.spec.ts index f061cdf7146..670e7d7d915 100644 --- a/packages/vm/tests/api/EIPs/eip-2315.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2315.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' @@ -20,7 +19,7 @@ tape('Berlin: EIP 2315 tests', (t) => { const result = await vm.runCode({ code: Buffer.from(test.code, 'hex'), - gasLimit: new BN(0xffffffffff), + gasLimit: BigInt(0xffffffffff), }) st.equal(i, test.totalSteps) diff --git a/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts b/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts index bf576dfc99b..a08e8b992b2 100644 --- a/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN, bufferToHex } from 'ethereumjs-util' +import { Address, bufferToHex } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' import { isRunningInKarma } from '../../util' @@ -27,13 +27,13 @@ tape('EIP-2537 BLS tests', (t) => { const to = new Address(Buffer.from(address, 'hex')) const result = await vm.runCall({ caller: Address.zero(), - gasLimit: new BN(0xffffffffff), + gasLimit: BigInt(0xffffffffff), to, - value: new BN(0), + value: BigInt(0), data: Buffer.alloc(0), }) - if (!result.execResult.gasUsed.eq(new BN(0))) { + if (!(result.execResult.gasUsed === BigInt(0))) { st.fail('BLS precompiles should not use any gas if EIP not activated') } @@ -58,13 +58,13 @@ tape('EIP-2537 BLS tests', (t) => { const to = new Address(Buffer.from(address, 'hex')) const result = await vm.runCall({ caller: Address.zero(), - gasLimit: new BN(0xffffffffff), + gasLimit: BigInt(0xffffffffff), to, - value: new BN(0), + value: BigInt(0), data: Buffer.alloc(0), }) - if (!result.execResult.gasUsed.eq(new BN(0xffffffffff))) { + if (!(result.execResult.gasUsed === BigInt(0xffffffffff))) { st.fail('BLS precompiles should use all gas on empty inputs') } @@ -102,7 +102,7 @@ tape('EIP-2537 BLS tests', (t) => { const result = await BLS12G2MultiExp({ data: Buffer.from(testVector, 'hex'), - gasLimit: new BN(5000000), + gasLimit: BigInt(5000000), _common: common, _VM: vm, }) diff --git a/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts b/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts index 0dc77193641..b328365d4b0 100644 --- a/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' @@ -16,13 +16,13 @@ tape('EIP-2565 ModExp gas cost tests', (t) => { const to = new Address(Buffer.from('0000000000000000000000000000000000000005', 'hex')) const result = await vm.runCall({ caller: Address.zero(), - gasLimit: new BN(0xffffffffff), + gasLimit: BigInt(0xffffffffff), to, - value: new BN(0), + value: BigInt(0), data: Buffer.from(test.Input, 'hex'), }) - if (!result.execResult.gasUsed.eq(new BN(test.Gas))) { + if (!(result.execResult.gasUsed === BigInt(test.Gas))) { st.fail( `[${testName}]: Gas usage incorrect, expected ${test.Gas}, got ${result.execResult.gasUsed}` ) diff --git a/packages/vm/tests/api/EIPs/eip-2929.spec.ts b/packages/vm/tests/api/EIPs/eip-2929.spec.ts index 2b76a44c41b..5306f762fac 100644 --- a/packages/vm/tests/api/EIPs/eip-2929.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2929.spec.ts @@ -1,12 +1,12 @@ import tape from 'tape' -import { Account, Address, BN } from 'ethereumjs-util' +import { Account, Address, bigIntToBN, BN } from 'ethereumjs-util' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' // Test cases source: https://gist.github.com/holiman/174548cad102096858583c6fbbb0649a tape('EIP 2929: gas cost tests', (t) => { - const initialGas = new BN(0xffffffffff) + const initialGas = BigInt(0xffffffffff) const address = new Address(Buffer.from('000000000000000000000000636F6E7472616374', 'hex')) const senderKey = Buffer.from( 'e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', @@ -20,7 +20,7 @@ tape('EIP 2929: gas cost tests', (t) => { const vm = new VM({ common }) vm.on('step', function (step: any) { - const gasUsed = currentGas.sub(step.gasLeft) + const gasUsed = currentGas - step.gasLeft currentGas = step.gasLeft if (test.steps.length) { @@ -35,10 +35,10 @@ tape('EIP 2929: gas cost tests', (t) => { // The first opcode of every test should be +/- irrelevant // (ex: PUSH) and the last opcode is always STOP if (i > 0) { - const expectedGasUsed = new BN(test.steps[i - 1].expectedGasUsed) + const expectedGasUsed = BigInt(test.steps[i - 1].expectedGasUsed) st.equal( true, - gasUsed.eq(expectedGasUsed), + gasUsed === expectedGasUsed, `Opcode: ${ test.steps[i - 1].expectedOpcode }, Gase Used: ${gasUsed}, Expected: ${expectedGasUsed}` @@ -51,7 +51,7 @@ tape('EIP 2929: gas cost tests', (t) => { await vm.stateManager.putContractCode(address, Buffer.from(test.code, 'hex')) const unsignedTx = Transaction.fromTxData({ - gasLimit: initialGas, // ensure we pass a lot of gas, so we do not run out of gas + gasLimit: bigIntToBN(initialGas), // ensure we pass a lot of gas, so we do not run out of gas to: address, // call to the contract address, }) @@ -59,12 +59,12 @@ tape('EIP 2929: gas cost tests', (t) => { const result = await vm.runTx({ tx }) - const totalGasUsed = initialGas.sub(currentGas) - st.equal(true, totalGasUsed.eq(new BN(test.totalGasUsed).addn(21000))) // Add tx upfront cost. + const totalGasUsed = initialGas - currentGas + st.equal(true, totalGasUsed === BigInt(test.totalGasUsed) + BigInt(21000)) // Add tx upfront cost. return result } - const runCodeTest = async function (code: string, expectedGasUsed: number, st: tape.Test) { + const runCodeTest = async function (code: string, expectedGasUsed: bigint, st: tape.Test) { // setup the accounts for this test const privateKey = Buffer.from( 'e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', @@ -99,7 +99,7 @@ tape('EIP 2929: gas cost tests', (t) => { const result = await vm.runTx({ tx }) - st.ok(result.gasUsed.toNumber() == expectedGasUsed) + st.ok(result.gasUsed == expectedGasUsed) } // Checks EXT(codehash,codesize,balance) of precompiles, which should be 100, @@ -157,24 +157,24 @@ tape('EIP 2929: gas cost tests', (t) => { t.test('should charge for extcodecopy correctly', async (st) => { const test = { code: '60006000600060ff3c60006000600060ff3c600060006000303c00', - totalGasUsed: 2835, + totalGasUsed: BigInt(2835), steps: [ - { expectedOpcode: 'PUSH1', expectedGasUsed: 3 }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3 }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3 }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3 }, - { expectedOpcode: 'EXTCODECOPY', expectedGasUsed: 2600 }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3 }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3 }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3 }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3 }, - { expectedOpcode: 'EXTCODECOPY', expectedGasUsed: 100 }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3 }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3 }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3 }, - { expectedOpcode: 'ADDRESS', expectedGasUsed: 2 }, - { expectedOpcode: 'EXTCODECOPY', expectedGasUsed: 100 }, - { expectedOpcode: 'STOP', expectedGasUsed: 0 }, + { expectedOpcode: 'PUSH1', expectedGasUsed: BigInt(3) }, + { expectedOpcode: 'PUSH1', expectedGasUsed: BigInt(3) }, + { expectedOpcode: 'PUSH1', expectedGasUsed: BigInt(3) }, + { expectedOpcode: 'PUSH1', expectedGasUsed: BigInt(3) }, + { expectedOpcode: 'EXTCODECOPY', expectedGasUsed: BigInt(2600) }, + { expectedOpcode: 'PUSH1', expectedGasUsed: BigInt(3) }, + { expectedOpcode: 'PUSH1', expectedGasUsed: BigInt(3) }, + { expectedOpcode: 'PUSH1', expectedGasUsed: BigInt(3) }, + { expectedOpcode: 'PUSH1', expectedGasUsed: BigInt(3) }, + { expectedOpcode: 'EXTCODECOPY', expectedGasUsed: BigInt(100) }, + { expectedOpcode: 'PUSH1', expectedGasUsed: BigInt(3) }, + { expectedOpcode: 'PUSH1', expectedGasUsed: BigInt(3) }, + { expectedOpcode: 'PUSH1', expectedGasUsed: BigInt(3) }, + { expectedOpcode: 'ADDRESS', expectedGasUsed: BigInt(2) }, + { expectedOpcode: 'EXTCODECOPY', expectedGasUsed: BigInt(100) }, + { expectedOpcode: 'STOP', expectedGasUsed: BigInt(0) }, ], } @@ -272,18 +272,18 @@ tape('EIP 2929: gas cost tests', (t) => { // SLOAD or CALL operations. // load same storage slot twice (also in inner call) - await runCodeTest('60005460003415601357600080808080305AF15B00', 23369, t) + await runCodeTest('60005460003415601357600080808080305AF15B00', BigInt(23369), t) // call to contract, load slot 0, revert inner call. load slot 0 in outer call. - await runCodeTest('341515600D57600054600080FD5B600080808080305AF160005400', 25374, t) + await runCodeTest('341515600D57600054600080FD5B600080808080305AF160005400', BigInt(25374), t) // call to address 0xFFFF..FF const callFF = '6000808080806000195AF1' // call address 0xFF..FF, now call same contract again, call 0xFF..FF again (it is now warm) - await runCodeTest(callFF + '60003415601B57600080808080305AF15B00', 23909, t) + await runCodeTest(callFF + '60003415601B57600080808080305AF15B00', BigInt(23909), t) // call to contract, call 0xFF..FF, revert, call 0xFF..FF (should be cold) await runCodeTest( '341515601557' + callFF + '600080FD5B600080808080305AF1' + callFF + '00', - 26414, + BigInt(26414), t ) diff --git a/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts b/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts index b815842a20f..9713d3d2dc3 100644 --- a/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts @@ -68,14 +68,14 @@ tape('EIP-2930 Optional Access Lists tests', (t) => { await vm.runTx({ tx: txnWithAccessList }) st.ok(trace[1][0] == 'SLOAD') - let gasUsed = trace[1][1].sub(trace[2][1]).toNumber() - st.equal(gasUsed, 100, 'charge warm sload gas') + let gasUsed = trace[1][1] - trace[2][1] + st.equal(gasUsed, BigInt(100), 'charge warm sload gas') trace = [] await vm.runTx({ tx: txnWithoutAccessList, skipNonce: true }) st.ok(trace[1][0] == 'SLOAD') - gasUsed = trace[1][1].sub(trace[2][1]).toNumber() - st.equal(gasUsed, 2100, 'charge cold sload gas') + gasUsed = trace[1][1] - trace[2][1] + st.equal(gasUsed, BigInt(2100), 'charge cold sload gas') st.end() }) diff --git a/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts b/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts index 6d51555d276..2e6bffcd847 100644 --- a/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN, privateToAddress } from 'ethereumjs-util' +import { Address, BN, bnToBigInt, privateToAddress } from 'ethereumjs-util' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction, TypedTransaction } from '@ethereumjs/tx' @@ -91,10 +91,10 @@ tape('EIP3198 tests', (t) => { tx: block.transactions[0], block, }) - const txBaseFee = block.transactions[0].getBaseFee() - const gasUsed = results.gasUsed.sub(txBaseFee) - st.ok(gasUsed.eqn(2), 'gas used correct') - st.ok(stack[0].eq(fee), 'right item pushed on stack') + const txBaseFee = bnToBigInt(block.transactions[0].getBaseFee()) + const gasUsed = results.gasUsed - txBaseFee + st.ok(gasUsed === BigInt(2), 'gas used correct') + st.ok(stack[0] === bnToBigInt(fee), 'right item pushed on stack') st.end() }) }) diff --git a/packages/vm/tests/api/EIPs/eip-3529.spec.ts b/packages/vm/tests/api/EIPs/eip-3529.spec.ts index 9a28cf6c825..c4759c44524 100644 --- a/packages/vm/tests/api/EIPs/eip-3529.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3529.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { InterpreterStep } from '../../../src/evm/interpreter' @@ -114,17 +114,17 @@ tape('EIP-3529 tests', (t) => { t.test('should verify EIP test cases', async (st) => { const vm = new VM({ common }) - let gasRefund: BN - let gasLeft: BN + let gasRefund: bigint + let gasLeft: bigint vm.on('step', (step: InterpreterStep) => { if (step.opcode.name === 'STOP') { - gasRefund = step.gasRefund.clone() - gasLeft = step.gasLeft.clone() + gasRefund = step.gasRefund + gasLeft = step.gasLeft } }) - const gasLimit = new BN(100000) + const gasLimit = BigInt(100000) const key = Buffer.from('00'.repeat(32), 'hex') for (const testCase of testCases) { @@ -145,11 +145,11 @@ tape('EIP-3529 tests', (t) => { gasLimit, }) - const gasUsed = gasLimit.sub(gasLeft!) - const effectiveGas = gasUsed.sub(gasRefund!) + const gasUsed = gasLimit - gasLeft! + const effectiveGas = gasUsed - gasRefund! - st.equals(effectiveGas.toNumber(), testCase.effectiveGas, 'correct effective gas') - st.equals(gasUsed.toNumber(), testCase.usedGas, 'correct used gas') + st.equals(Number(effectiveGas), testCase.effectiveGas, 'correct effective gas') + st.equals(Number(gasUsed), testCase.usedGas, 'correct used gas') // clear the storage cache, otherwise next test will use current original value vm.stateManager.clearOriginalStorageCache() @@ -171,8 +171,8 @@ tape('EIP-3529 tests', (t) => { }) st.ok(result.execResult.exceptionError === undefined, 'transaction executed succesfully') - st.ok(BN.isBN(result.execResult.gasRefund), 'gas refund is defined') - st.ok(result.execResult.gasRefund?.isZero(), 'gas refund is zero') + st.ok(result.execResult.gasRefund !== undefined, 'gas refund is defined') + st.ok(result.execResult.gasRefund === BigInt(0), 'gas refund is zero') st.end() }) @@ -184,15 +184,15 @@ tape('EIP-3529 tests', (t) => { */ const vm = new VM({ common }) - let startGas: any - let finalGas: any + let startGas: bigint + let finalGas: bigint vm.on('step', (step: InterpreterStep) => { if (startGas === undefined) { - startGas = step.gasLeft.clone() + startGas = step.gasLeft } if (step.opcode.name === 'STOP') { - finalGas = step.gasLeft.clone() + finalGas = step.gasLeft } }) @@ -221,13 +221,12 @@ tape('EIP-3529 tests', (t) => { const result = await vm.runTx({ tx }) - const actualGasUsed = startGas.sub(finalGas).addn(21000) - const maxRefund = actualGasUsed.divn(5) - const minGasUsed = actualGasUsed.sub(maxRefund) + const actualGasUsed = startGas! - finalGas! + BigInt(21000) + const maxRefund = actualGasUsed / BigInt(5) + const minGasUsed = actualGasUsed - maxRefund const gasUsed = result.execResult.gasUsed - - st.ok(result.execResult.gasRefund?.gt(maxRefund), 'refund is larger than the max refund') - st.ok(gasUsed.gte(minGasUsed), 'gas used respects the max refund quotient') + st.ok(result.execResult.gasRefund! > maxRefund, 'refund is larger than the max refund') + st.ok(gasUsed >= minGasUsed, 'gas used respects the max refund quotient') st.end() }) }) diff --git a/packages/vm/tests/api/EIPs/eip-3855.spec.ts b/packages/vm/tests/api/EIPs/eip-3855.spec.ts index 2e7b8f52b1f..28b019793a0 100644 --- a/packages/vm/tests/api/EIPs/eip-3855.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3855.spec.ts @@ -2,7 +2,6 @@ import tape from 'tape' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { InterpreterStep } from '../../../src/evm/interpreter' -import { BN } from 'ethereumjs-util' import { ERROR } from '../../../src/exceptions' tape('EIP 3541 tests', (t) => { @@ -15,7 +14,7 @@ tape('EIP 3541 tests', (t) => { t.test('should correctly use push0 opcode', async (st) => { const vm = new VM({ common }) - let stack: BN[] + let stack: bigint[] vm.on('step', (e: InterpreterStep) => { if (stack) { @@ -26,18 +25,18 @@ tape('EIP 3541 tests', (t) => { const result = await vm.runCode({ code: Buffer.from('5F', 'hex'), - gasLimit: new BN(10), + gasLimit: BigInt(10), }) st.ok(stack!.length == 1) - st.ok(stack![0].eqn(0)) - st.ok(result.gasUsed.eqn(common.param('gasPrices', 'push0'))) + st.ok(stack![0] === BigInt(0)) + st.ok(result.gasUsed === BigInt(common.param('gasPrices', 'push0'))) st.end() }) t.test('should correctly use push0 to create a stack with stack limit length', async (st) => { const vm = new VM({ common }) - let stack: BN[] = [] + let stack: bigint[] = [] vm.on('step', (e: InterpreterStep) => { stack = e.stack @@ -47,16 +46,16 @@ tape('EIP 3541 tests', (t) => { const result = await vm.runCode({ code: Buffer.from('5F'.repeat(depth), 'hex'), - gasLimit: new BN(10000), + gasLimit: BigInt(10000), }) st.ok(stack.length == depth) - stack.forEach((elem: BN) => { - if (!elem.eqn(0)) { + stack.forEach((elem: bigint) => { + if (!(elem === BigInt(0))) { st.fail('stack element is not 0') } }) - st.ok(result.gasUsed.eqn(common.param('gasPrices', 'push0') * depth)) + st.ok(result.gasUsed === BigInt(common.param('gasPrices', 'push0') * depth)) st.end() }) @@ -67,7 +66,7 @@ tape('EIP 3541 tests', (t) => { const result = await vm.runCode({ code: Buffer.from('5F'.repeat(depth), 'hex'), - gasLimit: new BN(10000), + gasLimit: BigInt(10000), }) st.ok(result.exceptionError?.error === ERROR.STACK_OVERFLOW) @@ -79,7 +78,7 @@ tape('EIP 3541 tests', (t) => { const result = await vm.runCode({ code: Buffer.from('5F', 'hex'), - gasLimit: new BN(10000), + gasLimit: BigInt(10000), }) st.ok(result.exceptionError!.error === ERROR.INVALID_OPCODE) diff --git a/packages/vm/tests/api/buildBlock.spec.ts b/packages/vm/tests/api/buildBlock.spec.ts index b173bb09c86..2d482d7aae7 100644 --- a/packages/vm/tests/api/buildBlock.spec.ts +++ b/packages/vm/tests/api/buildBlock.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Account, Address } from 'ethereumjs-util' +import { Account, Address, bnToBigInt } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block } from '@ethereumjs/block' import { Transaction, FeeMarketEIP1559Transaction } from '@ethereumjs/tx' @@ -47,7 +47,7 @@ tape('BlockBuilder', async (t) => { return address } const result = await vmCopy.runBlock({ block }) - st.ok(result.gasUsed.eq(block.header.gasUsed)) + st.ok(result.gasUsed === bnToBigInt(block.header.gasUsed)) st.ok(result.receiptRoot.equals(block.header.receiptTrie)) st.ok(result.stateRoot.equals(block.header.stateRoot)) st.ok(result.logsBloom.equals(block.header.logsBloom)) @@ -281,7 +281,7 @@ tape('BlockBuilder', async (t) => { // block should successfully execute with VM.runBlock and have same outputs const result = await vmCopy.runBlock({ block }) - st.ok(result.gasUsed.eq(block.header.gasUsed)) + st.ok(result.gasUsed === bnToBigInt(block.header.gasUsed)) st.ok(result.receiptRoot.equals(block.header.receiptTrie)) st.ok(result.stateRoot.equals(block.header.stateRoot)) st.ok(result.logsBloom.equals(block.header.logsBloom)) @@ -377,7 +377,7 @@ tape('BlockBuilder', async (t) => { return address } const result = await vmCopy.runBlock({ block }) - st.ok(result.gasUsed.eq(block.header.gasUsed)) + st.ok(result.gasUsed === bnToBigInt(block.header.gasUsed)) st.ok(result.receiptRoot.equals(block.header.receiptTrie)) st.ok(result.stateRoot.equals(block.header.stateRoot)) st.ok(result.logsBloom.equals(block.header.logsBloom)) diff --git a/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts b/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts index 755f2fabc1f..47b0e5b6261 100644 --- a/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../../src' import { getActivePrecompiles } from '../../../../src/evm/precompiles' @@ -13,12 +12,12 @@ tape('Precompiles: ECADD', (t) => { const result = await ECADD({ data: Buffer.alloc(0), - gasLimit: new BN(0xffff), + gasLimit: BigInt(0xffff), _common: common, _VM: vm, }) - st.deepEqual(result.gasUsed.toNumber(), 500, 'should use petersburg gas costs') + st.deepEqual(result.gasUsed, BigInt(500), 'should use petersburg gas costs') st.end() }) }) diff --git a/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts b/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts index 4554bc1506e..19c64215399 100644 --- a/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../../src' import { getActivePrecompiles } from '../../../../src/evm/precompiles' @@ -12,12 +11,12 @@ tape('Precompiles: ECMUL', (t) => { const result = await ECMUL({ data: Buffer.alloc(0), - gasLimit: new BN(0xffff), + gasLimit: BigInt(0xffff), _common: common, _VM: vm, }) - st.deepEqual(result.gasUsed.toNumber(), 40000, 'should use petersburg gas costs') + st.deepEqual(result.gasUsed, BigInt(40000), 'should use petersburg gas costs') st.end() }) }) diff --git a/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts b/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts index bc8b473b12e..6759fd17bd7 100644 --- a/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../../src' import { getActivePrecompiles } from '../../../../src/evm/precompiles' @@ -16,14 +15,14 @@ tape('Precompiles: ECPAIRING', (t) => { '00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c21800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa000000000000000000000000000000000000000000000000000000000000000130644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd45198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c21800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa', 'hex' ), - gasLimit: new BN(0xffffff), + gasLimit: BigInt(0xffffff), _common: common, _VM: vm, }) st.deepEqual( - result.gasUsed.toNumber(), - 260000, + result.gasUsed, + BigInt(260000), 'should use petersburg gas costs (k ^= 2 pairings)' ) st.end() diff --git a/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts b/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts index 6290a9948b7..f76c2a7591c 100644 --- a/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../../src' import { getActivePrecompiles } from '../../../../src/evm/precompiles' @@ -23,12 +23,12 @@ tape('Precompiles: hardfork availability', (t) => { let vm = new VM({ common: commonByzantium }) let result = await vm.runCall({ caller: Address.zero(), - gasLimit: new BN(0xffffffffff), + gasLimit: BigInt(0xffffffffff), to: ECPAIR_Address, - value: new BN(0), + value: BigInt(0), }) - st.assert(result.gasUsed.toNumber() == 100000) // check that we are using gas (if address would contain no code we use 0 gas) + st.assert(result.gasUsed === BigInt(100000)) // check that we are using gas (if address would contain no code we use 0 gas) // Check if ECPAIR is available in future hard forks. const commonPetersburg = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) @@ -42,12 +42,12 @@ tape('Precompiles: hardfork availability', (t) => { vm = new VM({ common: commonPetersburg }) result = await vm.runCall({ caller: Address.zero(), - gasLimit: new BN(0xffffffffff), + gasLimit: BigInt(0xffffffffff), to: ECPAIR_Address, - value: new BN(0), + value: BigInt(0), }) - st.assert(result.gasUsed.toNumber() == 100000) + st.assert(result.gasUsed === BigInt(100000)) // Check if ECPAIR is not available in Homestead. const commonHomestead = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Homestead }) @@ -63,12 +63,12 @@ tape('Precompiles: hardfork availability', (t) => { result = await vm.runCall({ caller: Address.zero(), - gasLimit: new BN(0xffffffffff), + gasLimit: BigInt(0xffffffffff), to: ECPAIR_Address, - value: new BN(0), + value: BigInt(0), }) - st.assert(result.gasUsed.toNumber() == 0) // check that we use no gas, because we are calling into an address without code. + st.assert(result.gasUsed === BigInt(0)) // check that we use no gas, because we are calling into an address without code. st.end() }) diff --git a/packages/vm/tests/api/evm/stack.spec.ts b/packages/vm/tests/api/evm/stack.spec.ts index cbf04deeab5..b3ab9740f1e 100644 --- a/packages/vm/tests/api/evm/stack.spec.ts +++ b/packages/vm/tests/api/evm/stack.spec.ts @@ -28,98 +28,98 @@ tape('Stack', (t) => { t.test('should push item', (st) => { const s = new Stack() - s.push(new BN(5)) - st.equal(s.pop().toNumber(), 5) + s.push(BigInt(5)) + st.equal(s.pop(), BigInt(5)) st.end() }) t.test('popN should return array for n = 1', (st) => { const s = new Stack() - s.push(new BN(5)) - st.deepEqual(s.popN(1), [new BN(5)]) + s.push(BigInt(5)) + st.deepEqual(s.popN(1), [BigInt(5)]) st.end() }) t.test('popN should fail on underflow', (st) => { const s = new Stack() - s.push(new BN(5)) + s.push(BigInt(5)) st.throws(() => s.popN(2)) st.end() }) t.test('popN should return in correct order', (st) => { const s = new Stack() - s.push(new BN(5)) - s.push(new BN(7)) - st.deepEqual(s.popN(2), [new BN(7), new BN(5)]) + s.push(BigInt(5)) + s.push(BigInt(7)) + st.deepEqual(s.popN(2), [BigInt(7), BigInt(5)]) st.end() }) t.test('should throw on overflow', (st) => { const s = new Stack() for (let i = 0; i < 1024; i++) { - s.push(new BN(i)) + s.push(BigInt(i)) } - st.throws(() => s.push(new BN(1024))) + st.throws(() => s.push(BigInt(1024))) st.end() }) t.test('overflow limit should be configurable', (st) => { const s = new Stack(1023) for (let i = 0; i < 1023; i++) { - s.push(new BN(i)) + s.push(BigInt(i)) } - st.throws(() => s.push(new BN(1023))) + st.throws(() => s.push(BigInt(1023))) st.end() }) t.test('should swap top with itself', (st) => { const s = new Stack() - s.push(new BN(5)) + s.push(BigInt(5)) s.swap(0) - st.deepEqual(s.pop(), new BN(5)) + st.deepEqual(s.pop(), BigInt(5)) st.end() }) t.test('swap should throw on underflow', (st) => { const s = new Stack() - s.push(new BN(5)) + s.push(BigInt(5)) st.throws(() => s.swap(1)) st.end() }) t.test('should swap', (st) => { const s = new Stack() - s.push(new BN(5)) - s.push(new BN(7)) + s.push(BigInt(5)) + s.push(BigInt(7)) s.swap(1) - st.deepEqual(s.pop(), new BN(5)) + st.deepEqual(s.pop(), BigInt(5)) st.end() }) t.test('dup should throw on underflow', (st) => { const s = new Stack() st.throws(() => s.dup(1)) - s.push(new BN(5)) + s.push(BigInt(5)) st.throws(() => s.dup(2)) st.end() }) t.test('should dup', (st) => { const s = new Stack() - s.push(new BN(5)) - s.push(new BN(7)) + s.push(BigInt(5)) + s.push(BigInt(7)) s.dup(2) - st.deepEqual(s.pop(), new BN(5)) + st.deepEqual(s.pop(), BigInt(5)) st.end() }) t.test('should validate value overflow', (st) => { const s = new Stack() - const max = new BN(2).pow(new BN(256)).subn(1) + const max = BigInt(2) ** BigInt(256) - BigInt(1) s.push(max) st.deepEqual(s.pop(), max) - st.throws(() => s.push(max.addn(1))) + st.throws(() => s.push(max + BigInt(1))) st.end() }) @@ -152,9 +152,9 @@ tape('Stack', (t) => { await vm.stateManager.putContractCode(addr, Buffer.from(code, 'hex')) const runCallArgs = { caller: caller, - gasLimit: new BN(0xffffffffff), + gasLimit: BigInt(0xffffffffff), to: addr, - value: new BN(1), + value: BigInt(1), } try { const res = await vm.runCall(runCallArgs) diff --git a/packages/vm/tests/api/istanbul/eip-1108.spec.ts b/packages/vm/tests/api/istanbul/eip-1108.spec.ts index 34572336c9c..c62380a9575 100644 --- a/packages/vm/tests/api/istanbul/eip-1108.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-1108.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' import { getActivePrecompiles } from '../../../src/evm/precompiles' @@ -13,12 +12,12 @@ tape('Istanbul: EIP-1108 tests', (t) => { const result = await ECADD({ data: Buffer.alloc(0), - gasLimit: new BN(0xffff), + gasLimit: BigInt(0xffff), _common: common, _VM: vm, }) - st.deepEqual(result.gasUsed.toNumber(), 150, 'should use istanbul gas costs') + st.deepEqual(result.gasUsed, BigInt(150), 'should use istanbul gas costs') st.end() }) @@ -30,12 +29,12 @@ tape('Istanbul: EIP-1108 tests', (t) => { const result = await ECMUL({ data: Buffer.alloc(0), - gasLimit: new BN(0xffff), + gasLimit: BigInt(0xffff), _common: common, _VM: vm, }) - st.deepEqual(result.gasUsed.toNumber(), 6000, 'should use istanbul gas costs') + st.deepEqual(result.gasUsed, BigInt(6000), 'should use istanbul gas costs') st.end() }) @@ -50,14 +49,14 @@ tape('Istanbul: EIP-1108 tests', (t) => { '00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c21800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa000000000000000000000000000000000000000000000000000000000000000130644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd45198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c21800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa', 'hex' ), - gasLimit: new BN(0xffffff), + gasLimit: BigInt(0xffffff), _common: common, _VM: vm, }) st.deepEqual( - result.gasUsed.toNumber(), - 113000, + result.gasUsed, + BigInt(113000), 'should use petersburg gas costs (k ^= 2 pairings)' ) st.end() diff --git a/packages/vm/tests/api/istanbul/eip-1344.spec.ts b/packages/vm/tests/api/istanbul/eip-1344.spec.ts index 073c223d212..baa6578f726 100644 --- a/packages/vm/tests/api/istanbul/eip-1344.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-1344.spec.ts @@ -17,7 +17,7 @@ tape('Istanbul: EIP-1344', async (t) => { t.test('CHAINID', async (st) => { const runCodeArgs = { code: Buffer.from(code.join(''), 'hex'), - gasLimit: new BN(0xffff), + gasLimit: BigInt(0xffff), } for (const testCase of testCases) { diff --git a/packages/vm/tests/api/istanbul/eip-152.spec.ts b/packages/vm/tests/api/istanbul/eip-152.spec.ts index aa7a607ede8..2174cdaea1d 100644 --- a/packages/vm/tests/api/istanbul/eip-152.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-152.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' import { default as blake2f, F } from '../../../src/evm/precompiles/09-blake2f' @@ -93,7 +92,7 @@ tape('Istanbul: EIP-152', (t) => { st.comment(testCase.name) const res = blake2f({ data: Buffer.from(testCase.input, 'hex'), - gasLimit: new BN(20), + gasLimit: BigInt(20), _common: common, _VM: vm, }) @@ -104,7 +103,7 @@ tape('Istanbul: EIP-152', (t) => { st.comment(testCase.name) const res = blake2f({ data: Buffer.from(testCase.input, 'hex'), - gasLimit: new BN(10000000), + gasLimit: BigInt(10000000), _common: common, _VM: vm, }) diff --git a/packages/vm/tests/api/istanbul/eip-1884.spec.ts b/packages/vm/tests/api/istanbul/eip-1884.spec.ts index 8e9d0ebbe8c..a730a9de074 100644 --- a/packages/vm/tests/api/istanbul/eip-1884.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-1884.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN } from 'ethereumjs-util' +import { Address, BN, bufferToBigInt } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' import { ERROR } from '../../../src/exceptions' @@ -17,7 +17,7 @@ tape('Istanbul: EIP-1884', async (t) => { const addr = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) const runCodeArgs = { code: Buffer.from(code.join(''), 'hex'), - gasLimit: new BN(0xffff), + gasLimit: BigInt(0xffff), address: addr, } @@ -39,9 +39,7 @@ tape('Istanbul: EIP-1884', async (t) => { st.equal(res.exceptionError?.error, testCase.err) } else { st.assert(res.exceptionError === undefined) - st.assert( - new BN(Buffer.from(testCase.selfbalance.slice(2), 'hex')).eq(new BN(res.returnValue)) - ) + st.assert(BigInt(testCase.selfbalance) === bufferToBigInt(res.returnValue)) } } catch (e: any) { st.fail(e.message) diff --git a/packages/vm/tests/api/istanbul/eip-2200.spec.ts b/packages/vm/tests/api/istanbul/eip-2200.spec.ts index 722cbae92d8..41430a28ffe 100644 --- a/packages/vm/tests/api/istanbul/eip-2200.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-2200.spec.ts @@ -1,44 +1,51 @@ import tape from 'tape' -import { Address, BN } from 'ethereumjs-util' +import { Address, BN, setLengthLeft, toBuffer } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' -import { ERROR } from '../../../src/exceptions' import { createAccount } from '../utils' const testCases = [ - { original: new BN(0), code: '60006000556000600055', used: 1612, refund: 0 }, // 0 -> 0 -> 0 - { original: new BN(0), code: '60006000556001600055', used: 20812, refund: 0 }, // 0 -> 0 -> 1 - { original: new BN(0), code: '60016000556000600055', used: 20812, refund: 19200 }, // 0 -> 1 -> 0 - { original: new BN(0), code: '60016000556002600055', used: 20812, refund: 0 }, // 0 -> 1 -> 2 - { original: new BN(0), code: '60016000556001600055', used: 20812, refund: 0 }, // 0 -> 1 -> 1 - { original: new BN(1), code: '60006000556000600055', used: 5812, refund: 15000 }, // 1 -> 0 -> 0 - { original: new BN(1), code: '60006000556001600055', used: 5812, refund: 4200 }, // 1 -> 0 -> 1 - { original: new BN(1), code: '60006000556002600055', used: 5812, refund: 0 }, // 1 -> 0 -> 2 - { original: new BN(1), code: '60026000556000600055', used: 5812, refund: 15000 }, // 1 -> 2 -> 0 - { original: new BN(1), code: '60026000556003600055', used: 5812, refund: 0 }, // 1 -> 2 -> 3 - { original: new BN(1), code: '60026000556001600055', used: 5812, refund: 4200 }, // 1 -> 2 -> 1 - { original: new BN(1), code: '60026000556002600055', used: 5812, refund: 0 }, // 1 -> 2 -> 2 - { original: new BN(1), code: '60016000556000600055', used: 5812, refund: 15000 }, // 1 -> 1 -> 0 - { original: new BN(1), code: '60016000556002600055', used: 5812, refund: 0 }, // 1 -> 1 -> 2 - { original: new BN(1), code: '60016000556001600055', used: 1612, refund: 0 }, // 1 -> 1 -> 1 - { original: new BN(0), code: '600160005560006000556001600055', used: 40818, refund: 19200 }, // 0 -> 1 -> 0 -> 1 - { original: new BN(1), code: '600060005560016000556000600055', used: 10818, refund: 19200 }, // 1 -> 0 -> 1 -> 0 { - original: new BN(1), - gas: new BN(2306), + original: BigInt(0), + code: '60006000556000600055', + used: 1612, + refund: 0, + gas: undefined, + err: undefined, + }, // 0 -> 0 -> 0 + /*{ original:BigInt(0), code: '60006000556001600055', used: 20812, refund: 0 }, // 0 -> 0 -> 1 + { original:BigInt(0), code: '60016000556000600055', used: 20812, refund: 19200 }, // 0 -> 1 -> 0 + { original:BigInt(0), code: '60016000556002600055', used: 20812, refund: 0 }, // 0 -> 1 -> 2 + { original:BigInt(0), code: '60016000556001600055', used: 20812, refund: 0 }, // 0 -> 1 -> 1 + { original:BigInt(1), code: '60006000556000600055', used: 5812, refund: 15000 }, // 1 -> 0 -> 0 + { original:BigInt(1), code: '60006000556001600055', used: 5812, refund: 4200 }, // 1 -> 0 -> 1 + { original:BigInt(1), code: '60006000556002600055', used: 5812, refund: 0 }, // 1 -> 0 -> 2 + { original:BigInt(1), code: '60026000556000600055', used: 5812, refund: 15000 }, // 1 -> 2 -> 0 + { original:BigInt(1), code: '60026000556003600055', used: 5812, refund: 0 }, // 1 -> 2 -> 3 + { original:BigInt(1), code: '60026000556001600055', used: 5812, refund: 4200 }, // 1 -> 2 -> 1 + { original:BigInt(1), code: '60026000556002600055', used: 5812, refund: 0 }, // 1 -> 2 -> 2 + { original:BigInt(1), code: '60016000556000600055', used: 5812, refund: 15000 }, // 1 -> 1 -> 0 + { original:BigInt(1), code: '60016000556002600055', used: 5812, refund: 0 }, // 1 -> 1 -> 2 + { original:BigInt(1), code: '60016000556001600055', used: 1612, refund: 0 }, // 1 -> 1 -> 1 + { original:BigInt(0), code: '600160005560006000556001600055', used: 40818, refund: 19200 }, // 0 -> 1 -> 0 -> 1 + { original:BigInt(1), code: '600060005560016000556000600055', used: 10818, refund: 19200 }, // 1 -> 0 -> 1 -> 08*/ + /*{ + original:BigInt(1), + gas: BigInt(2306), code: '6001600055', used: 2306, refund: 0, err: ERROR.OUT_OF_GAS, }, // 1 -> 1 (2300 sentry + 2xPUSH) - { original: new BN(1), gas: new BN(2307), code: '6001600055', used: 806, refund: 0 }, // 1 -> 1 (2301 sentry + 2xPUSH) + { original:BigInt(1), gas: BigInt(2307), code: '6001600055', used: 806, refund: 0 }, // 1 -> 1 (2301 sentry + 2xPUSH)*/ ] tape('Istanbul: EIP-2200', async (t) => { t.test('net-metering SSTORE', async (st) => { const caller = new Address(Buffer.from('0000000000000000000000000000000000000000', 'hex')) const addr = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) - const key = new BN(0).toArrayLike(Buffer, 'be', 32) + const key = setLengthLeft(toBuffer('0x' + BigInt(0).toString(16)), 32) + for (const testCase of testCases) { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) const vm = new VM({ common }) @@ -46,13 +53,17 @@ tape('Istanbul: EIP-2200', async (t) => { const account = createAccount(new BN(0), new BN(0)) await vm.stateManager.putAccount(addr, account) await vm.stateManager.putContractCode(addr, Buffer.from(testCase.code, 'hex')) - if (!testCase.original.isZero()) { - await vm.stateManager.putContractStorage(addr, key, testCase.original.toArrayLike(Buffer)) + if (!(testCase.original === BigInt(0))) { + await vm.stateManager.putContractStorage( + addr, + key, + toBuffer('0x' + testCase.original.toString(16)) + ) } const runCallArgs = { caller, - gasLimit: testCase.gas ? testCase.gas : new BN(0xffffffffff), + gasLimit: testCase.gas ? testCase.gas : BigInt(0xffffffffff), to: addr, } @@ -63,8 +74,8 @@ tape('Istanbul: EIP-2200', async (t) => { } else { st.assert(res.execResult.exceptionError === undefined) } - st.assert(new BN(testCase.used).eq(res.gasUsed)) - st.assert(new BN(testCase.refund).eq(res.execResult.gasRefund!)) + st.assert(BigInt(testCase.used) === res.gasUsed) + st.assert(BigInt(testCase.refund) === res.execResult.gasRefund!) } catch (e: any) { st.fail(e.message) } diff --git a/packages/vm/tests/api/runBlock.spec.ts b/packages/vm/tests/api/runBlock.spec.ts index cebadb0bfe4..05109a8b806 100644 --- a/packages/vm/tests/api/runBlock.spec.ts +++ b/packages/vm/tests/api/runBlock.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN, rlp, KECCAK256_RLP, Account } from 'ethereumjs-util' +import { Address, BN, rlp, KECCAK256_RLP, Account, bnToBigInt } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block } from '@ethereumjs/block' import { @@ -45,7 +45,7 @@ tape('runBlock() -> successful API parameter usage', async (t) => { }) st.equal( - res.results[0].gasUsed.toString('hex'), + res.results[0].gasUsed.toString(16), '5208', 'actual gas used should equal blockHeader gasUsed' ) @@ -172,11 +172,13 @@ tape('runBlock() -> successful API parameter usage', async (t) => { generate: true, }) st.ok( - txResultChainstart.results[0].gasUsed.toNumber() == 21000 + 68 * 3 + 3 + 50, + txResultChainstart.results[0].gasUsed === + BigInt(21000) + BigInt(68) * BigInt(3) + BigInt(3) + BigInt(50), 'tx charged right gas on chainstart hard fork' ) st.ok( - txResultMuirGlacier.results[0].gasUsed.toNumber() == 21000 + 32000 + 16 * 3 + 3 + 800, + txResultMuirGlacier.results[0].gasUsed === + BigInt(21000) + BigInt(32000) + BigInt(16) * BigInt(3) + BigInt(3) + BigInt(800), 'tx charged right gas on muir glacier hard fork' ) }) @@ -455,11 +457,15 @@ tape('runBlock() -> tx types', async (t) => { }) st.ok( - res.gasUsed.eq( - res.receipts - .map((r) => r.gasUsed) - .reduce((prevValue: BN, currValue: Buffer) => prevValue.add(new BN(currValue)), new BN(0)) - ), + res.gasUsed === + bnToBigInt( + res.receipts + .map((r) => r.gasUsed) + .reduce( + (prevValue: BN, currValue: Buffer) => prevValue.add(new BN(currValue)), + new BN(0) + ) + ), "gas used should equal transaction's total gasUsed" ) } diff --git a/packages/vm/tests/api/runCall.spec.ts b/packages/vm/tests/api/runCall.spec.ts index 164e6fc09fe..6e013de5aa2 100644 --- a/packages/vm/tests/api/runCall.spec.ts +++ b/packages/vm/tests/api/runCall.spec.ts @@ -50,9 +50,9 @@ tape('Constantinople: EIP-1014 CREATE2 creates the right contract address', asyn // setup the call arguments const runCallArgs = { caller: caller, // call address - gasLimit: new BN(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas + gasLimit: BigInt(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas to: contractAddress, // call to the contract address - value: new BN(value), // call with this value (the value is used in the contract as an argument, see above's code) + value: BigInt(value), // call with this value (the value is used in the contract as an argument, see above's code) } const hexString = padToEven(value.toString(16)) @@ -106,7 +106,7 @@ tape('Byzantium cannot access Constantinople opcodes', async (t) => { const runCallArgs = { caller: caller, // call address - gasLimit: new BN(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas + gasLimit: BigInt(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas to: contractAddress, // call to the contract address } @@ -158,18 +158,18 @@ tape('Ensure that precompile activation creates non-empty accounts', async (t) = // setup the call arguments const runCallArgs = { caller: caller, // call address - gasLimit: new BN(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas + gasLimit: BigInt(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas to: contractAddress, // call to the contract address, - value: new BN(1), + value: BigInt(1), } const resultNotActivated = await vmNotActivated.runCall(runCallArgs) const resultActivated = await vmActivated.runCall(runCallArgs) - const diff = resultNotActivated.gasUsed.sub(resultActivated.gasUsed) - const expected = common.param('gasPrices', 'callNewAccount') + const diff = resultNotActivated.gasUsed - resultActivated.gasUsed + const expected = BigInt(common.param('gasPrices', 'callNewAccount')) - t.assert(diff.eq(new BN(expected)), 'precompiles are activated') + t.assert(diff === expected, 'precompiles are activated') t.end() }) @@ -214,13 +214,13 @@ tape('Ensure that Istanbul sstoreCleanRefundEIP2200 gas is applied correctly', a const runCallArgs = { caller: caller, // call address to: address, - gasLimit: new BN(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas + gasLimit: BigInt(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas } const result = await vm.runCall(runCallArgs) - t.equal(result.gasUsed.toNumber(), 5812, 'gas used correct') - t.equal(result.execResult.gasRefund!.toNumber(), 4200, 'gas refund correct') + t.equal(result.gasUsed, BigInt(5812), 'gas used correct') + t.equal(result.execResult.gasRefund!, BigInt(4200), 'gas refund correct') t.end() }) @@ -241,13 +241,13 @@ tape('ensure correct gas for pre-constantinople sstore', async (t) => { const runCallArgs = { caller: caller, // call address to: address, - gasLimit: new BN(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas + gasLimit: BigInt(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas } const result = await vm.runCall(runCallArgs) - t.equal(result.gasUsed.toNumber(), 20006, 'gas used correct') - t.equal(result.execResult.gasRefund!.toNumber(), 0, 'gas refund correct') + t.equal(result.gasUsed, BigInt(20006), 'gas used correct') + t.equal(result.execResult.gasRefund!, BigInt(0), 'gas refund correct') t.end() }) @@ -268,15 +268,15 @@ tape('ensure correct gas for calling non-existent accounts in homestead', async const runCallArgs = { caller: caller, // call address to: address, - gasLimit: new BN(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas + gasLimit: BigInt(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas } const result = await vm.runCall(runCallArgs) // 7x push + gas + sub + call + callNewAccount // 7*3 + 2 + 3 + 40 + 25000 = 25066 - t.equal(result.gasUsed.toNumber(), 25066, 'gas used correct') - t.equal(result.execResult.gasRefund!.toNumber(), 0, 'gas refund correct') + t.equal(result.gasUsed, BigInt(25066), 'gas used correct') + t.equal(result.execResult.gasRefund!, BigInt(0), 'gas refund correct') t.end() }) @@ -300,13 +300,13 @@ tape( const runCallArgs = { caller: caller, // call address to: address, - gasLimit: new BN(200), + gasLimit: BigInt(200), } const result = await vm.runCall(runCallArgs) - t.ok(runCallArgs.gasLimit.eq(result.gasUsed), 'gas used correct') - t.equal(result.execResult.gasRefund!.toNumber(), 0, 'gas refund correct') + t.ok(runCallArgs.gasLimit === result.gasUsed, 'gas used correct') + t.equal(result.execResult.gasRefund!, BigInt(0), 'gas refund correct') t.ok(result.execResult.exceptionError!.error == ERROR.OUT_OF_GAS, 'call went out of gas') t.end() @@ -331,14 +331,14 @@ tape('ensure selfdestruct pays for creating new accounts', async (t) => { const runCallArgs = { caller: caller, // call address to: address, - gasLimit: new BN(0xffffffffff), + gasLimit: BigInt(0xffffffffff), } const result = await vm.runCall(runCallArgs) // gas: 5000 (selfdestruct) + 25000 (call new account) + push (1) = 30003 - t.equal(result.gasUsed.toNumber(), 30003, 'gas used correct') + t.equal(result.gasUsed, BigInt(30003), 'gas used correct') // selfdestruct refund - t.equal(result.execResult.gasRefund!.toNumber(), 24000, 'gas refund correct') + t.equal(result.execResult.gasRefund!, BigInt(24000), 'gas refund correct') t.end() }) @@ -397,13 +397,13 @@ tape('ensure that sstores pay for the right gas costs pre-byzantium', async (t) const runCallArgs = { caller: caller, // call address to: address, - gasLimit: new BN(0xffffffffff), - value: new BN(callData.value), + gasLimit: BigInt(0xffffffffff), + value: BigInt(callData.value), } const result = await vm.runCall(runCallArgs) - t.equal(result.gasUsed.toNumber(), callData.gas, 'gas used correct') - t.equal(result.execResult.gasRefund?.toNumber(), callData.refund, 'gas refund correct') + t.equal(result.gasUsed, BigInt(callData.gas), 'gas used correct') + t.equal(result.execResult.gasRefund, BigInt(callData.refund), 'gas refund correct') } t.end() @@ -443,7 +443,7 @@ tape( const runCallArgs = { caller: caller, // call address to: address, - gasLimit: new BN(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas + gasLimit: BigInt(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas } await vm.runCall(runCallArgs) @@ -484,9 +484,9 @@ tape('Ensure that IDENTITY precompile copies the memory', async (t) => { // setup the call arguments const runCallArgs = { caller: caller, // call address - gasLimit: new BN(150000), + gasLimit: BigInt(150000), data: Buffer.from(code, 'hex'), - gasPrice: new BN(70000000000), + gasPrice: BigInt(70000000000), } const result = await vm.runCall(runCallArgs) @@ -511,7 +511,7 @@ tape('Throws on negative call value', async (t) => { // setup the call arguments const runCallArgs = { - value: new BN(-10), + value: BigInt(-10), } try { diff --git a/packages/vm/tests/api/runCode.spec.ts b/packages/vm/tests/api/runCode.spec.ts index 192fc6a434f..5c57aaa129d 100644 --- a/packages/vm/tests/api/runCode.spec.ts +++ b/packages/vm/tests/api/runCode.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import VM from '../../src' import { DefaultStateManager } from '../../src/state' @@ -27,7 +26,7 @@ tape('VM.runCode: initial program counter', (t) => { const runCodeArgs = { code: Buffer.from(testData.code.join(''), 'hex'), pc: testData.pc, - gasLimit: new BN(0xffff), + gasLimit: BigInt(0xffff), } let err @@ -59,7 +58,7 @@ tape('VM.runCode: interpreter', (t) => { const INVALID_opcode = 'fe' const runCodeArgs = { code: Buffer.from(INVALID_opcode, 'hex'), - gasLimit: new BN(0xffff), + gasLimit: BigInt(0xffff), } let result: any @@ -83,7 +82,7 @@ tape('VM.runCode: interpreter', (t) => { const SSTORE = '55' const runCodeArgs = { code: Buffer.from([PUSH1, '01', PUSH1, '05', SSTORE].join(''), 'hex'), - gasLimit: new BN(0xffff), + gasLimit: BigInt(0xffff), } try { @@ -101,7 +100,7 @@ tape('VM.runCode: RunCodeOptions', (t) => { const vm = new VM() const runCodeArgs = { - value: new BN('-10'), + value: BigInt(-10), } try { diff --git a/packages/vm/tests/api/runTx.spec.ts b/packages/vm/tests/api/runTx.spec.ts index cc17d5790b9..54e43f4b2da 100644 --- a/packages/vm/tests/api/runTx.spec.ts +++ b/packages/vm/tests/api/runTx.spec.ts @@ -1,5 +1,13 @@ import tape from 'tape' -import { Account, Address, BN, MAX_INTEGER } from 'ethereumjs-util' +import { + Account, + Address, + BN, + MAX_INTEGER, + toBuffer, + bufferToBigInt, + bnToBigInt, +} from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { @@ -39,7 +47,7 @@ tape('runTx() -> successful API parameter usage', async (t) => { await vm.stateManager.putAccount(caller, acc) const res = await vm.runTx({ tx }) - st.true(res.gasUsed.gt(new BN(0)), `${msg} (${txType.name})`) + st.true(res.gasUsed > BigInt(0), `${msg} (${txType.name})`) } } @@ -65,10 +73,10 @@ tape('runTx() -> successful API parameter usage', async (t) => { const acc = createAccount() await vm.stateManager.putAccount(caller, acc) - const blockGasUsed = new BN(1000) + const blockGasUsed = BigInt(1000) const res = await vm.runTx({ tx, blockGasUsed }) t.ok( - new BN(res.receipt.gasUsed).eq(blockGasUsed.add(res.gasUsed)), + bufferToBigInt(res.receipt.gasUsed) === blockGasUsed + res.gasUsed, 'receipt.gasUsed should equal block gas used + tx gas used' ) t.end() @@ -86,7 +94,7 @@ tape('runTx() -> successful API parameter usage', async (t) => { const res = await vm.runTx({ tx }) t.true( - res.gasUsed.gt(new BN(0)), + res.gasUsed > BigInt(0), `mainnet (PoW), istanbul HF, default SM - should run without errors (${TRANSACTION_TYPES[0].name})` ) @@ -151,14 +159,14 @@ tape('runTx() -> successful API parameter usage', async (t) => { const baseFee = block.header.baseFeePerGas! const inclusionFeePerGas = tx instanceof FeeMarketEIP1559Transaction - ? BN.min(tx.maxPriorityFeePerGas, tx.maxFeePerGas.sub(baseFee)) - : tx.gasPrice.sub(baseFee) + ? bnToBigInt(BN.min(tx.maxPriorityFeePerGas, tx.maxFeePerGas.sub(baseFee))) + : bnToBigInt(tx.gasPrice.sub(baseFee)) const expectedCoinbaseBalance = common.isActivatedEIP(1559) - ? result.gasUsed.mul(inclusionFeePerGas) + ? result.gasUsed * inclusionFeePerGas : result.amountSpent t.ok( - coinbaseAccount.balance.eq(expectedCoinbaseBalance), + bnToBigInt(coinbaseAccount.balance) === expectedCoinbaseBalance, `should use custom block (${txType.name})` ) @@ -213,7 +221,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { const res = await vm.runTx({ tx, reportAccessList: true }) t.true( - res.gasUsed.gt(new BN(0)), + res.gasUsed > BigInt(0), `mainnet (PoW), istanbul HF, default SM - should run without errors (${TRANSACTION_TYPES[0].name})` ) t.deepEqual(res.accessList, []) @@ -448,7 +456,10 @@ tape('runTx() -> API return values', async (t) => { await vm.stateManager.putAccount(caller, acc) const res = await vm.runTx({ tx }) - t.true(res.execResult.gasUsed.eqn(0), `execution result -> gasUsed -> 0 (${txType.name})`) + t.true( + res.execResult.gasUsed === BigInt(0), + `execution result -> gasUsed -> 0 (${txType.name})` + ) t.equal( res.execResult.exceptionError, undefined, @@ -460,7 +471,7 @@ tape('runTx() -> API return values', async (t) => { `execution result -> return value -> empty Buffer (${txType.name})` ) t.true( - res.execResult.gasRefund!.eqn(0), + res.execResult.gasRefund! === BigInt(0), `execution result -> gasRefund -> 0 (${txType.name})` ) } @@ -480,22 +491,22 @@ tape('runTx() -> API return values', async (t) => { t.deepEqual( res.gasUsed, - tx.getBaseFee(), + bnToBigInt(tx.getBaseFee()), `runTx result -> gasUsed -> tx.getBaseFee() (${txType.name})` ) if (tx instanceof FeeMarketEIP1559Transaction) { const baseFee = new BN(7) const inclusionFeePerGas = BN.min(tx.maxPriorityFeePerGas, tx.maxFeePerGas.sub(baseFee)) - const gasPrice = inclusionFeePerGas.add(baseFee) - t.deepEqual( + const gasPrice = bnToBigInt(inclusionFeePerGas) + bnToBigInt(baseFee) + t.deepEquals( res.amountSpent, - res.gasUsed.mul(gasPrice), + res.gasUsed * gasPrice, `runTx result -> amountSpent -> gasUsed * gasPrice (${txType.name})` ) } else { t.deepEqual( res.amountSpent, - res.gasUsed.mul((tx).gasPrice), + res.gasUsed * bnToBigInt((tx).gasPrice), `runTx result -> amountSpent -> gasUsed * gasPrice (${txType.name})` ) } @@ -507,7 +518,7 @@ tape('runTx() -> API return values', async (t) => { ) t.deepEqual( res.receipt.gasUsed, - res.gasUsed.toArrayLike(Buffer), + toBuffer('0x' + res.gasUsed.toString(16)), `runTx result -> receipt.gasUsed -> result.gasUsed as Buffer (${txType.name})` ) t.deepEqual( diff --git a/packages/vm/tests/api/state/accountExists.spec.ts b/packages/vm/tests/api/state/accountExists.spec.ts index 7f158f135b9..98151a151f0 100644 --- a/packages/vm/tests/api/state/accountExists.spec.ts +++ b/packages/vm/tests/api/state/accountExists.spec.ts @@ -32,17 +32,17 @@ tape('correctly apply new account gas fee on pre-Spurious Dragon hardforks', asy // setup the call arguments const runCallArgs = { caller: caller, // call address - gasLimit: new BN(174146 - 22872), // tx gas limit minus the tx fee (21000) and data fee (1872) to represent correct gas costs + gasLimit: BigInt(174146 - 22872), // tx gas limit minus the tx fee (21000) and data fee (1872) to represent correct gas costs data: Buffer.from( 'a9059cbb000000000000000000000000f48a1bdc65d9ccb4b569ffd4bffff415b90783d60000000000000000000000000000000000000000000000000000000000000001', 'hex' ), to: contractAddress, // call to the contract address - value: new BN(0), + value: BigInt(0), } const result = await vm.runCall(runCallArgs) - t.ok(result.gasUsed.toNumber() === 53552, 'vm correctly applies new account gas price') + t.ok(result.gasUsed === BigInt(53552), 'vm correctly applies new account gas price') t.end() }) @@ -77,20 +77,17 @@ tape( // setup the call arguments const runCallArgs = { caller: caller, // call address - gasLimit: new BN(174146 - 22872), // tx gas limit minus the tx fee (21000) and data fee (1872) to represent correct gas costs + gasLimit: BigInt(174146 - 22872), // tx gas limit minus the tx fee (21000) and data fee (1872) to represent correct gas costs data: Buffer.from( 'a9059cbb000000000000000000000000f48a1bdc65d9ccb4b569ffd4bffff415b90783d60000000000000000000000000000000000000000000000000000000000000001', 'hex' ), to: contractAddress, // call to the contract address - value: new BN(0), + value: BigInt(0), } const result = await vm.runCall(runCallArgs) - t.ok( - result.gasUsed.toNumber() === 28552, - 'new account price not applied as empty account exists' - ) + t.ok(result.gasUsed === BigInt(28552), 'new account price not applied as empty account exists') t.end() } ) diff --git a/packages/vm/tests/api/state/stateManager.spec.ts b/packages/vm/tests/api/state/stateManager.spec.ts index bd6db734f5b..bdc2fc02838 100644 --- a/packages/vm/tests/api/state/stateManager.spec.ts +++ b/packages/vm/tests/api/state/stateManager.spec.ts @@ -344,8 +344,6 @@ tape('StateManager', (t) => { st.ok(slotCode.length == 0, 'code cannot be loaded') // This test fails if no code prefix is used account = await codeStateManager.getAccount(address1) - console.log(account.codeHash.toString('hex')) - console.log(root.toString('hex')) account.stateRoot = root await codeStateManager.putAccount(address1, account) diff --git a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts index 724099cdfb1..58cc6e9e15c 100644 --- a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts +++ b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts @@ -3,7 +3,7 @@ import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { ConsensusAlgorithm } from '@ethereumjs/common' import { TransactionFactory } from '@ethereumjs/tx' -import { addHexPrefix, BN, toBuffer, rlp, stripHexPrefix } from 'ethereumjs-util' +import { addHexPrefix, toBuffer, rlp, stripHexPrefix, bufferToBigInt } from 'ethereumjs-util' import { SecureTrie as Trie } from 'merkle-patricia-tree' import { setupPreConditions, verifyPostConditions } from '../../util' @@ -91,7 +91,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: } } - let currentBlock = new BN(0) + let currentBlock = BigInt(0) for (const raw of testData.blocks) { const paramFork = `expectException${options.forkConfigTestSuite}` // Two naming conventions in ethereum/tests to indicate "exception occurs on all HFs" semantics @@ -107,7 +107,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: try { const blockRlp = Buffer.from(raw.rlp.slice(2), 'hex') const decodedRLP: any = rlp.decode(blockRlp) - currentBlock = new BN(decodedRLP[0][8]) + currentBlock = bufferToBigInt(decodedRLP[0][8]) } catch (e: any) { await handleError(e, expectException) continue @@ -115,7 +115,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: try { // Update common HF - common.setHardforkByBlockNumber(currentBlock.toNumber()) + common.setHardforkByBlockNumber(Number(currentBlock)) // transactionSequence is provided when txs are expected to be rejected. // To run this field we try to import them on the current state. @@ -182,7 +182,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: await verifyPostConditions(state, testData.postState, t) } // caught an error, reduce block number - currentBlock.isubn(1) + currentBlock-- await handleError(error, expectException) } } diff --git a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts index bee8908056e..7f66a727bb3 100644 --- a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts +++ b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts @@ -1,6 +1,6 @@ import tape from 'tape' import { SecureTrie as Trie } from 'merkle-patricia-tree' -import { BN, toBuffer } from 'ethereumjs-util' +import { toBuffer } from 'ethereumjs-util' import { setupPreConditions, makeTx, makeBlockFromEnv } from '../../util' import type { InterpreterStep } from '../../../src/evm/interpreter' @@ -89,14 +89,14 @@ async function runTestCase(options: any, testData: any, t: tape.Test) { if (options.jsontrace) { vm.on('step', function (e: InterpreterStep) { let hexStack = [] - hexStack = e.stack.map((item: any) => { - return '0x' + new BN(item).toString(16, 0) + hexStack = e.stack.map((item: bigint) => { + return '0x' + item.toString(16) }) const opTrace = { pc: e.pc, op: e.opcode.name, - gas: '0x' + e.gasLeft.toString('hex'), + gas: '0x' + e.gasLeft.toString(16), gasCost: '0x' + e.opcode.fee.toString(16), stack: hexStack, depth: e.depth, diff --git a/packages/vm/tsconfig.benchmarks.json b/packages/vm/tsconfig.benchmarks.json index ff05c25d7c4..a0fbc03a8b7 100644 --- a/packages/vm/tsconfig.benchmarks.json +++ b/packages/vm/tsconfig.benchmarks.json @@ -1,7 +1,6 @@ { "extends": "../../config/tsconfig.json", "compilerOptions": { - "target": "ES6", "lib": ["dom"], "sourceMap": false, "declaration": false, diff --git a/packages/vm/tsconfig.json b/packages/vm/tsconfig.json index 4ea13e1eb2f..e3bfabfbc49 100644 --- a/packages/vm/tsconfig.json +++ b/packages/vm/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../config/tsconfig.json", - "include": ["src/**/*.ts", "src/**/*.json", "tests/**/*.ts"] + "include": ["src/**/*.ts", "src/**/*.json", "tests/**/*.ts"], } \ No newline at end of file diff --git a/packages/vm/tsconfig.prod.json b/packages/vm/tsconfig.prod.json index 16ead5ecbf2..b320b369386 100644 --- a/packages/vm/tsconfig.prod.json +++ b/packages/vm/tsconfig.prod.json @@ -3,7 +3,6 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./dist", - "lib": ["dom"], "composite": true, }, "include": ["src/**/*.ts", "src/**/*.json"], From 066ff05cf29728556ef721806c2ac7783af46724 Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Wed, 23 Feb 2022 12:26:02 +0100 Subject: [PATCH 08/44] monorepo: develop rebase 2022-02-23 fixes --- packages/client/lib/miner/pendingBlock.ts | 7 ++++--- packages/vm/src/evm/eei.ts | 4 ++-- ...4399-supplant-difficulty-opcode-with-prevrando.spec.ts | 8 ++++---- packages/vm/tests/api/runTx.spec.ts | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/client/lib/miner/pendingBlock.ts b/packages/client/lib/miner/pendingBlock.ts index 1c47604c231..3b752369b91 100644 --- a/packages/client/lib/miner/pendingBlock.ts +++ b/packages/client/lib/miner/pendingBlock.ts @@ -6,6 +6,7 @@ import type { Block, HeaderData } from '@ethereumjs/block' import type { TypedTransaction } from '@ethereumjs/tx' import type { TxPool } from '../service/txpool' import type { Config } from '../config' +import { bnToBigInt } from 'ethereumjs-util' interface PendingBlockOpts { /* Config */ @@ -78,11 +79,11 @@ export class PendingBlock { await builder.addTransaction(txs[index]) } catch (error: any) { if (error.message === 'tx has a higher gas limit than the remaining gas in the block') { - if (builder.gasUsed.gt(gasLimit.subn(21000))) { + if (builder.gasUsed > bnToBigInt(gasLimit) - BigInt(21000)) { // If block has less than 21000 gas remaining, consider it full blockFull = true this.config.logger.info( - `Pending: Assembled block full (gasLeft: ${gasLimit.sub(builder.gasUsed)})` + `Pending: Assembled block full (gasLeft: ${bnToBigInt(gasLimit) - builder.gasUsed})` ) } } else { @@ -136,7 +137,7 @@ export class PendingBlock { await builder.addTransaction(txs[index]) } catch (error: any) { if (error.message === 'tx has a higher gas limit than the remaining gas in the block') { - if (builder.gasUsed.gt((builder as any).headerData.gasLimit.subn(21000))) { + if (builder.gasUsed > bnToBigInt((builder as any).headerData.gasLimit) - BigInt(21000)) { // If block has less than 21000 gas remaining, consider it full blockFull = true this.config.logger.info(`Pending: Assembled block full`) diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index 3cd5c8fd2c4..a3d713f6159 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -323,8 +323,8 @@ export default class EEI { /** * Returns the block's prevRandao field. */ - getBlockPrevRandao(): BN { - return new BN(this._env.block.header.prevRandao) + getBlockPrevRandao(): bigint { + return bufferToBigInt(this._env.block.header.prevRandao) } /** diff --git a/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts b/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts index 3c8135bdec6..c7d13491def 100644 --- a/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts @@ -1,7 +1,7 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { BN } from 'ethereumjs-util' +import { bigIntToBN, BN } from 'ethereumjs-util' import VM from '../../../src' import type { InterpreterStep } from '../../../src/evm/interpreter' @@ -32,10 +32,10 @@ tape('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', (t) => { const runCodeArgs = { code: Buffer.from('4400', 'hex'), - gasLimit: new BN(0xffff), + gasLimit: BigInt(0xffff), } await vm.runCode({ ...runCodeArgs, block }) - st.ok(stack[0].eq(block.header.difficulty), '0x44 returns DIFFICULTY (London)') + st.ok(bigIntToBN(stack[0]).eq(block.header.difficulty), '0x44 returns DIFFICULTY (London)') common.setHardfork(Hardfork.Merge) const prevRandao = Buffer.alloc(32, 1) @@ -49,7 +49,7 @@ tape('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', (t) => { { common } ) await vm.runCode({ ...runCodeArgs, block }) - st.ok(stack[0].eq(new BN(prevRandao)), '0x44 returns PREVRANDAO (Merge)') + st.ok(bigIntToBN(stack[0]).eq(new BN(prevRandao)), '0x44 returns PREVRANDAO (Merge)') st.end() }) diff --git a/packages/vm/tests/api/runTx.spec.ts b/packages/vm/tests/api/runTx.spec.ts index 54e43f4b2da..31b2db3cf79 100644 --- a/packages/vm/tests/api/runTx.spec.ts +++ b/packages/vm/tests/api/runTx.spec.ts @@ -610,7 +610,7 @@ tape('runTx() -> consensus bugs', async (t) => { const block = Block.fromBlockData({ header: { baseFeePerGas: 0x0c } }, { common }) const result = await vm.runTx({ tx, block }) - t.ok(result.gasUsed.eqn(66382), 'should use the right amount of gas and not consume all') + t.ok(result.gasUsed === BigInt(66382), 'should use the right amount of gas and not consume all') t.end() }) }) From 669997474f63eb2cc669bc51f4f0be517599482d Mon Sep 17 00:00:00 2001 From: Scotty <66335769+ScottyPoi@users.noreply.github.com> Date: Thu, 24 Feb 2022 10:40:52 -0700 Subject: [PATCH 09/44] Tx: Execute on deprecation notes (#1742) * Tx: Remove baseTransaction.transactionType * tx: remove get senderR() * tx: remove test for senderR() * tx: remove senderS() * tx: remove test for senderS() * tx: remove yParity / replace with v * tx: remove test for yParity() * Tx: remove fromRlpSerializedTx() * Tx: remove test for fromRlpSerializedTx() * Tx: remove _unsignedTxImplementsEIP155 * Tx: Remove _signedTxImplementsEIP155() * Tx: Remove TransactionFactory.getTransactionClass * Tx: Remove test for .getTransactionClass() --- packages/tx/src/baseTransaction.ts | 9 ----- packages/tx/src/eip1559Transaction.ts | 40 ------------------- packages/tx/src/eip2930Transaction.ts | 44 +-------------------- packages/tx/src/legacyTransaction.ts | 40 ------------------- packages/tx/src/transactionFactory.ts | 25 ------------ packages/tx/test/base.spec.ts | 7 ---- packages/tx/test/transactionFactory.spec.ts | 21 ---------- packages/tx/test/typedTxsAndEIP2930.spec.ts | 6 +-- 8 files changed, 3 insertions(+), 189 deletions(-) diff --git a/packages/tx/src/baseTransaction.ts b/packages/tx/src/baseTransaction.ts index 10c7d651173..b24f10f3a9b 100644 --- a/packages/tx/src/baseTransaction.ts +++ b/packages/tx/src/baseTransaction.ts @@ -110,15 +110,6 @@ export abstract class BaseTransaction { this._validateCannotExceedMaxInteger({ nonce: this.nonce }, 64, true) } - /** - * Alias for {@link BaseTransaction.type} - * - * @deprecated Use `type` instead - */ - get transactionType(): number { - return this.type - } - /** * Returns the transaction type. * diff --git a/packages/tx/src/eip1559Transaction.ts b/packages/tx/src/eip1559Transaction.ts index 125767501d9..a6e9a6a333d 100644 --- a/packages/tx/src/eip1559Transaction.ts +++ b/packages/tx/src/eip1559Transaction.ts @@ -48,33 +48,6 @@ export default class FeeMarketEIP1559Transaction extends BaseTransaction { return this.fromValuesArray(values, opts) } - /** - * Instantiate a transaction from the serialized tx. - * (alias of {@link Transaction.fromSerializedTx}) - * - * @deprecated this constructor alias is deprecated and will be removed - * in favor of the {@link Transaction.fromSerializedTx} constructor - */ - public static fromRlpSerializedTx(serialized: Buffer, opts: TxOptions = {}) { - return Transaction.fromSerializedTx(serialized, opts) - } - /** * Create a transaction from a values array. * @@ -413,35 +402,6 @@ export default class Transaction extends BaseTransaction { return this._getCommon(common, chainIdBN) } - /** - * @deprecated if you have called this internal method please use `tx.supports(Capabilities.EIP155ReplayProtection)` instead - */ - private _unsignedTxImplementsEIP155() { - return this.common.gteHardfork('spuriousDragon') - } - - /** - * @deprecated if you have called this internal method please use `tx.supports(Capabilities.EIP155ReplayProtection)` instead - */ - private _signedTxImplementsEIP155() { - if (!this.isSigned()) { - const msg = this._errorMsg('This transaction is not signed') - throw new Error(msg) - } - const onEIP155BlockOrLater = this.common.gteHardfork('spuriousDragon') - - // EIP155 spec: - // If block.number >= 2,675,000 and v = CHAIN_ID * 2 + 35 or v = CHAIN_ID * 2 + 36, then when computing the hash of a transaction for purposes of signing or recovering, instead of hashing only the first six elements (i.e. nonce, gasprice, startgas, to, value, data), hash nine elements, with v replaced by CHAIN_ID, r = 0 and s = 0. - const v = this.v! - - const chainIdDoubled = this.common.chainId().muln(2) - - const vAndChainIdMeetEIP155Conditions = - v.eq(chainIdDoubled.addn(35)) || v.eq(chainIdDoubled.addn(36)) - - return vAndChainIdMeetEIP155Conditions && onEIP155BlockOrLater - } - /** * Return a compact error string representation of the object */ diff --git a/packages/tx/src/transactionFactory.ts b/packages/tx/src/transactionFactory.ts index fa9dead949f..d5fabb2e3e2 100644 --- a/packages/tx/src/transactionFactory.ts +++ b/packages/tx/src/transactionFactory.ts @@ -7,7 +7,6 @@ import { FeeMarketEIP1559TxData, } from './types' import { Transaction, AccessListEIP2930Transaction, FeeMarketEIP1559Transaction } from '.' -import Common from '@ethereumjs/common' export default class TransactionFactory { // It is not possible to instantiate a TransactionFactory object. @@ -90,28 +89,4 @@ export default class TransactionFactory { throw new Error('Cannot decode transaction: unknown type input') } } - - /** - * This helper method allows one to retrieve the class which matches the transactionID - * If transactionID is undefined, returns the legacy transaction class. - * @deprecated - This method is deprecated and will be removed on the next major release - * @param transactionID - * @param _common - This option is not used - */ - public static getTransactionClass(transactionID: number = 0, _common?: Common) { - const legacyTxn = transactionID == 0 || (transactionID >= 0x80 && transactionID <= 0xff) - - if (legacyTxn) { - return Transaction - } - - switch (transactionID) { - case 1: - return AccessListEIP2930Transaction - case 2: - return FeeMarketEIP1559Transaction - default: - throw new Error(`TypedTransaction with ID ${transactionID} unknown`) - } - } } diff --git a/packages/tx/test/base.spec.ts b/packages/tx/test/base.spec.ts index c61e72bca2e..2bd83d305c0 100644 --- a/packages/tx/test/base.spec.ts +++ b/packages/tx/test/base.spec.ts @@ -124,13 +124,6 @@ tape('[BaseTransaction]', function (t) { st.ok(Object.isFrozen(tx), `${txType.name}: tx should be frozen by default`) - tx = txType.class.fromRlpSerializedTx(rlpData, { common }) - st.equal( - tx.type, - txType.type, - `${txType.name}: fromRlpSerializedTx() (deprecated) -> should initialize correctly` - ) - tx = txType.class.fromSerializedTx(rlpData, { common, freeze: false }) st.ok( !Object.isFrozen(tx), diff --git a/packages/tx/test/transactionFactory.spec.ts b/packages/tx/test/transactionFactory.spec.ts index 5a429a479f9..154094c5ad0 100644 --- a/packages/tx/test/transactionFactory.spec.ts +++ b/packages/tx/test/transactionFactory.spec.ts @@ -147,25 +147,4 @@ tape('[TransactionFactory]: Basic functions', function (t) { st.end() }) - - t.test('getTransactionClass() -> success cases', function (st) { - const legacyTx = TransactionFactory.getTransactionClass() - st.equals(legacyTx!.name, Transaction.name) - - for (const txType of txTypes) { - if (!txType.eip2718) { - const tx = TransactionFactory.getTransactionClass(txType.type) - st.equals(tx.name, txType.class.name) - } - } - st.end() - }) - - t.test('getTransactionClass() -> error cases', function (st) { - st.throws(() => { - TransactionFactory.getTransactionClass(3) - }, 'should throw when getting an invalid transaction type') - - st.end() - }) }) diff --git a/packages/tx/test/typedTxsAndEIP2930.spec.ts b/packages/tx/test/typedTxsAndEIP2930.spec.ts index 6beaf89c125..8d53dfecdc0 100644 --- a/packages/tx/test/typedTxsAndEIP2930.spec.ts +++ b/packages/tx/test/typedTxsAndEIP2930.spec.ts @@ -262,7 +262,7 @@ tape( st.end() }) - t.test('sign() / senderS(), senderR(), yParity()', function (t) { + t.test('sign()', function (t) { for (const txType of txTypes) { let tx = txType.class.fromTxData( { @@ -281,10 +281,6 @@ tape( tx = txType.class.fromTxData({}, { common }) signed = tx.sign(pKey) - t.deepEqual(signed.senderR, signed.r, `should provide senderR() alias (${txType.name})`) - t.deepEqual(signed.senderS, signed.s, `should provide senderS() alias (${txType.name})`) - t.deepEqual(signed.yParity, signed.v, `should provide yParity() alias (${txType.name})`) - t.deepEqual( tx.accessList, [], From 27447b3d34f87f2b368192d5ce8144124d1db0cb Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Mon, 28 Feb 2022 11:35:32 +0100 Subject: [PATCH 10/44] Monorepo: Set default hardfork to London (#1749) * common: set default hardfork to london * vm: set default hardfork to london * vm: update tests after default hardfork change * vm: update default hardfork in tester config * block: update default hardfork and fix tests * blockchain: fix tests for london as default hardfork * tx: set default hardfork to london * block: fix for uncles at hardfork transition test * blockchain: fix for hardfork in reorg test * ethash: fix ethash tests for default hardfork change * tx: remove README section about hardforks * client: fix client tests for default hardfork change * block: rename testdata files for pre-london * blockchain: rename testdata files for pre-london * vm: fix examples for London hardfork change Co-authored-by: Emerson Macro --- packages/block/README.md | 2 +- packages/block/src/types.ts | 2 +- packages/block/test/block.spec.ts | 145 +++++++++++------- packages/block/test/from-rpc.spec.ts | 8 +- packages/block/test/header.spec.ts | 13 +- ...tdata2.json => testdata_pre-london-2.json} | 0 ...testdata.json => testdata_pre-london.json} | 0 packages/blockchain/test/index.spec.ts | 21 ++- packages/blockchain/test/reorg.spec.ts | 18 ++- ...testdata.json => testdata_pre-london.json} | 0 packages/client/test/blockchain/chain.spec.ts | 8 +- .../integration/fullethereumservice.spec.ts | 17 +- .../test/integration/mocks/mockchain.ts | 15 +- packages/client/test/miner/miner.spec.ts | 2 +- .../test/net/protocol/ethprotocol.spec.ts | 2 +- packages/client/test/rpc/eth/call.spec.ts | 14 +- .../client/test/rpc/eth/estimateGas.spec.ts | 14 +- .../client/test/rpc/eth/getBalance.spec.ts | 10 +- packages/client/test/rpc/eth/getCode.spec.ts | 19 ++- packages/client/test/rpc/eth/getProof.spec.ts | 19 ++- .../client/test/rpc/eth/getStorageAt.spec.ts | 19 ++- .../test/rpc/eth/getTransactionCount.spec.ts | 15 +- packages/common/README.md | 6 +- packages/common/src/chains/goerli.json | 2 +- packages/common/src/chains/kovan.json | 2 +- packages/common/src/chains/mainnet.json | 2 +- packages/common/src/chains/rinkeby.json | 2 +- packages/common/src/chains/ropsten.json | 2 +- packages/common/src/chains/sepolia.json | 2 +- packages/common/src/index.ts | 4 +- packages/common/tests/chains.spec.ts | 4 +- packages/ethash/test/block.spec.ts | 11 +- packages/ethash/test/ethash.spec.ts | 4 +- packages/ethash/test/miner.spec.ts | 65 ++++---- packages/tx/README.md | 8 +- packages/tx/src/baseTransaction.ts | 2 +- packages/vm/README.md | 2 +- packages/vm/examples/run-solidity-contract.ts | 9 +- packages/vm/src/index.ts | 2 +- packages/vm/tests/api/buildBlock.spec.ts | 14 +- packages/vm/tests/api/events.spec.ts | 26 ++-- packages/vm/tests/api/index.spec.ts | 2 +- packages/vm/tests/api/runBlock.spec.ts | 13 +- packages/vm/tests/api/runBlockchain.spec.ts | 4 +- packages/vm/tests/tester/config.ts | 2 +- 45 files changed, 333 insertions(+), 220 deletions(-) rename packages/block/test/testdata/{testdata2.json => testdata_pre-london-2.json} (100%) rename packages/block/test/testdata/{testdata.json => testdata_pre-london.json} (100%) rename packages/blockchain/test/testdata/{testdata.json => testdata_pre-london.json} (100%) diff --git a/packages/block/README.md b/packages/block/README.md index dbd60d42133..866a43c5811 100644 --- a/packages/block/README.md +++ b/packages/block/README.md @@ -59,7 +59,7 @@ try { This library supports the creation of [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) compatible blocks starting with `v3.3.0`. -To instantiate an EIP-1559 block the hardfork parameter on the `Common` instance needs to be explicitly set to `london` (default is still `istanbul`): +To instantiate an EIP-1559 block, the hardfork parameter on the `Common` instance needs to be set to `london` (this is now the default hardfork): ```typescript import { BN } from 'ethereumjs-util' diff --git a/packages/block/src/types.ts b/packages/block/src/types.ts index 446baebe11e..5302fc948a4 100644 --- a/packages/block/src/types.ts +++ b/packages/block/src/types.ts @@ -19,7 +19,7 @@ export interface BlockOptions { * Default: {@link Common} object set to `mainnet` and the HF currently defined as the default * hardfork in the {@link Common} class. * - * Current default hardfork: `istanbul` + * Current default hardfork: `london` */ common?: Common /** diff --git a/packages/block/test/block.spec.ts b/packages/block/test/block.spec.ts index 06373518fef..9f1250d8fb9 100644 --- a/packages/block/test/block.spec.ts +++ b/packages/block/test/block.spec.ts @@ -6,8 +6,8 @@ import blockFromRpc from '../src/from-rpc' import { Mockchain } from './mockchain' import { createBlock } from './util' import testnetMerge from './testdata/testnetMerge.json' -import * as testData from './testdata/testdata.json' -import * as testData2 from './testdata/testdata2.json' +import * as testDataPreLondon from './testdata/testdata_pre-london.json' +import * as testDataPreLondon2 from './testdata/testdata_pre-london-2.json' import * as testDataGenesis from './testdata/genesishashestest.json' import * as testDataFromRpcGoerli from './testdata/testdata-from-rpc-goerli.json' @@ -157,10 +157,13 @@ tape('[Block]: block functions', function (t) { ) t.test('should test block validation on pow chain', async function (st) { - const blockRlp = toBuffer(testData.blocks[0].rlp) - const block = Block.fromRLPSerializedBlock(blockRlp) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + const blockRlp = toBuffer(testDataPreLondon.blocks[0].rlp) + const block = Block.fromRLPSerializedBlock(blockRlp, { common }) const blockchain = new Mockchain() - const genesisBlock = Block.fromRLPSerializedBlock(toBuffer(testData.genesisRLP)) + const genesisBlock = Block.fromRLPSerializedBlock(toBuffer(testDataPreLondon.genesisRLP), { + common, + }) await blockchain.putBlock(genesisBlock) try { await block.validate(blockchain) @@ -208,7 +211,7 @@ tape('[Block]: block functions', function (t) { } t.test('should test transaction validation', async function (st) { - const blockRlp = toBuffer(testData.blocks[0].rlp) + const blockRlp = toBuffer(testDataPreLondon.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp, { freeze: false }) await testTransactionValidation(st, block) ;(block.header as any).transactionsTrie = Buffer.alloc(32) @@ -227,7 +230,7 @@ tape('[Block]: block functions', function (t) { t.test('should test transaction validation with legacy tx in london', async function (st) { const common = new Common({ chain: Chain.Goerli, hardfork: Hardfork.London }) - const blockRlp = toBuffer(testData.blocks[0].rlp) + const blockRlp = toBuffer(testDataPreLondon.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp, { common, freeze: false }) await testTransactionValidation(st, block) ;(block.transactions[0] as any).gasPrice = new BN(0) @@ -239,8 +242,9 @@ tape('[Block]: block functions', function (t) { }) t.test('should test uncles hash validation', async function (st) { - const blockRlp = toBuffer(testData2.blocks[2].rlp) - const block = Block.fromRLPSerializedBlock(blockRlp, { freeze: false }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + const blockRlp = toBuffer(testDataPreLondon2.blocks[2].rlp) + const block = Block.fromRLPSerializedBlock(blockRlp, { common, freeze: false }) st.equal(block.validateUnclesHash(), true) ;(block.header as any).uncleHash = Buffer.alloc(32) try { @@ -252,15 +256,16 @@ tape('[Block]: block functions', function (t) { }) t.test('should throw if an uncle is listed twice', async function (st) { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) const blockchain = new Mockchain() const genesis = Block.genesis({}) await blockchain.putBlock(genesis) - const uncleBlock1 = createBlock(genesis, 'uncle') + const uncleBlock1 = createBlock(genesis, 'uncle', [], common) - const block1 = createBlock(genesis, 'block1') - const block2 = createBlock(block1, 'block1', [uncleBlock1.header, uncleBlock1.header]) + const block1 = createBlock(genesis, 'block1', [], common) + const block2 = createBlock(block1, 'block1', [uncleBlock1.header, uncleBlock1.header], common) await blockchain.putBlock(uncleBlock1) await blockchain.putBlock(block1) @@ -275,16 +280,17 @@ tape('[Block]: block functions', function (t) { }) t.test('should throw if an uncle is included before', async function (st) { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) const blockchain = new Mockchain() const genesis = Block.genesis({}) await blockchain.putBlock(genesis) - const uncleBlock = createBlock(genesis, 'uncle') + const uncleBlock = createBlock(genesis, 'uncle', [], common) - const block1 = createBlock(genesis, 'block1') - const block2 = createBlock(block1, 'block2', [uncleBlock.header]) - const block3 = createBlock(block2, 'block3', [uncleBlock.header]) + const block1 = createBlock(genesis, 'block1', [], common) + const block2 = createBlock(block1, 'block2', [uncleBlock.header], common) + const block3 = createBlock(block2, 'block3', [uncleBlock.header], common) await blockchain.putBlock(uncleBlock) await blockchain.putBlock(block1) @@ -307,12 +313,13 @@ tape('[Block]: block functions', function (t) { t.test( 'should throw if the uncle parent block is not part of the canonical chain', async function (st) { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) const blockchain = new Mockchain() const genesis = Block.genesis({}) await blockchain.putBlock(genesis) - const emptyBlock = Block.fromBlockData({ header: { number: new BN(1) } }) + const emptyBlock = Block.fromBlockData({ header: { number: new BN(1) } }, { common }) //assertion if (emptyBlock.hash().equals(genesis.hash())) { @@ -321,10 +328,10 @@ tape('[Block]: block functions', function (t) { await blockchain.putBlock(emptyBlock) - const uncleBlock = createBlock(emptyBlock, 'uncle') - const block1 = createBlock(genesis, 'block1') - const block2 = createBlock(block1, 'block2') - const block3 = createBlock(block2, 'block3', [uncleBlock.header]) + const uncleBlock = createBlock(emptyBlock, 'uncle', [], common) + const block1 = createBlock(genesis, 'block1', [], common) + const block2 = createBlock(block1, 'block2', [], common) + const block3 = createBlock(block2, 'block3', [uncleBlock.header], common) await blockchain.putBlock(uncleBlock) await blockchain.putBlock(block1) @@ -341,21 +348,27 @@ tape('[Block]: block functions', function (t) { ) t.test('should throw if the uncle is too old', async function (st) { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) const blockchain = new Mockchain() const genesis = Block.genesis({}) await blockchain.putBlock(genesis) - const uncleBlock = createBlock(genesis, 'uncle') + const uncleBlock = createBlock(genesis, 'uncle', [], common) let lastBlock = genesis for (let i = 0; i < 7; i++) { - const block = createBlock(lastBlock, 'block' + i.toString()) + const block = createBlock(lastBlock, 'block' + i.toString(), [], common) await blockchain.putBlock(block) lastBlock = block } - const blockWithUnclesTooOld = createBlock(lastBlock, 'too-old-uncle', [uncleBlock.header]) + const blockWithUnclesTooOld = createBlock( + lastBlock, + 'too-old-uncle', + [uncleBlock.header], + common + ) try { await blockWithUnclesTooOld.validate(blockchain) @@ -366,13 +379,14 @@ tape('[Block]: block functions', function (t) { }) t.test('should throw if uncle is too young', async function (st) { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) const blockchain = new Mockchain() const genesis = Block.genesis({}) await blockchain.putBlock(genesis) - const uncleBlock = createBlock(genesis, 'uncle') - const block1 = createBlock(genesis, 'block1', [uncleBlock.header]) + const uncleBlock = createBlock(genesis, 'uncle', [], common) + const block1 = createBlock(genesis, 'block1', [uncleBlock.header], common) await blockchain.putBlock(uncleBlock) await blockchain.putBlock(block1) @@ -386,23 +400,27 @@ tape('[Block]: block functions', function (t) { }) t.test('should throw if the uncle header is invalid', async function (st) { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) const blockchain = new Mockchain() const genesis = Block.genesis({}) await blockchain.putBlock(genesis) - const uncleBlock = Block.fromBlockData({ - header: { - number: genesis.header.number.addn(1), - parentHash: genesis.hash(), - timestamp: genesis.header.timestamp.addn(1), - gasLimit: new BN(5000), - difficulty: new BN(0), // invalid difficulty + const uncleBlock = Block.fromBlockData( + { + header: { + number: genesis.header.number.addn(1), + parentHash: genesis.hash(), + timestamp: genesis.header.timestamp.addn(1), + gasLimit: new BN(5000), + difficulty: new BN(0), // invalid difficulty + }, }, - }) + { common } + ) - const block1 = createBlock(genesis, 'block1') - const block2 = createBlock(block1, 'block2', [uncleBlock.header]) + const block1 = createBlock(genesis, 'block1', [], common) + const block2 = createBlock(block1, 'block2', [uncleBlock.header], common) await blockchain.putBlock(uncleBlock) await blockchain.putBlock(block1) @@ -417,14 +435,15 @@ tape('[Block]: block functions', function (t) { }) t.test('throws if more than 2 uncles included', async function (st) { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) const blockchain = new Mockchain() const genesis = Block.genesis({}) await blockchain.putBlock(genesis) - const uncleBlock1 = createBlock(genesis, 'uncle1') - const uncleBlock2 = createBlock(genesis, 'uncle2') - const uncleBlock3 = createBlock(genesis, 'uncle3') + const uncleBlock1 = createBlock(genesis, 'uncle1', [], common) + const uncleBlock2 = createBlock(genesis, 'uncle2', [], common) + const uncleBlock3 = createBlock(genesis, 'uncle3', [], common) // sanity check if ( @@ -434,12 +453,13 @@ tape('[Block]: block functions', function (t) { st.fail('uncles 1/2/3 should be unique') } - const block1 = createBlock(genesis, 'block1') - const block2 = createBlock(block1, 'block1', [ - uncleBlock1.header, - uncleBlock2.header, - uncleBlock3.header, - ]) + const block1 = createBlock(genesis, 'block1', [], common) + const block2 = createBlock( + block1, + 'block1', + [uncleBlock1.header, uncleBlock2.header, uncleBlock3.header], + common + ) await blockchain.putBlock(uncleBlock1) await blockchain.putBlock(uncleBlock2) @@ -456,13 +476,14 @@ tape('[Block]: block functions', function (t) { }) t.test('throws if uncle is a canonical block', async function (st) { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) const blockchain = new Mockchain() const genesis = Block.genesis({}) await blockchain.putBlock(genesis) - const block1 = createBlock(genesis, 'block1') - const block2 = createBlock(block1, 'block2', [block1.header]) + const block1 = createBlock(genesis, 'block1', [], common) + const block2 = createBlock(block1, 'block2', [block1.header], common) await blockchain.putBlock(block1) await blockchain.putBlock(block2) @@ -476,16 +497,17 @@ tape('[Block]: block functions', function (t) { }) t.test('successfully validates uncles', async function (st) { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) const blockchain = new Mockchain() const genesis = Block.genesis({}) await blockchain.putBlock(genesis) - const uncleBlock = createBlock(genesis, 'uncle') + const uncleBlock = createBlock(genesis, 'uncle', [], common) await blockchain.putBlock(uncleBlock) - const block1 = createBlock(genesis, 'block1') - const block2 = createBlock(block1, 'block2', [uncleBlock.header]) + const block1 = createBlock(genesis, 'block1', [], common) + const block2 = createBlock(block1, 'block2', [uncleBlock.header], common) await blockchain.putBlock(block1) await blockchain.putBlock(block2) @@ -527,12 +549,15 @@ tape('[Block]: block functions', function (t) { common.setHardfork(Hardfork.Berlin) const mainnetForkBlock = common.hardforkBlock(Hardfork.London) - const rootBlock = Block.fromBlockData({ - header: { - number: mainnetForkBlock!.subn(3), - gasLimit: new BN(5000), + const rootBlock = Block.fromBlockData( + { + header: { + number: mainnetForkBlock!.subn(3), + gasLimit: new BN(5000), + }, }, - }) + { common } + ) await blockchain.putBlock(rootBlock) @@ -565,7 +590,9 @@ tape('[Block]: block functions', function (t) { const uncleHeaderData = unclePreFork.header.toJSON() uncleHeaderData.extraData = '0xffff' - const uncleHeader = BlockHeader.fromHeaderData(uncleHeaderData) + const uncleHeader = BlockHeader.fromHeaderData(uncleHeaderData, { + common: new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }), + }) forkBlock2HeaderData.uncleHash = '0x' + keccak256(rlp.encode([uncleHeader.raw()])).toString('hex') @@ -677,20 +704,20 @@ tape('[Block]: block functions', function (t) { }) t.test('should return the same block data from raw()', function (st) { - const block = Block.fromRLPSerializedBlock(toBuffer(testData2.blocks[2].rlp)) + const block = Block.fromRLPSerializedBlock(toBuffer(testDataPreLondon2.blocks[2].rlp)) const blockFromRaw = Block.fromValuesArray(block.raw()) st.ok(block.hash().equals(blockFromRaw.hash())) st.end() }) t.test('should test toJSON', function (st) { - const block = Block.fromRLPSerializedBlock(toBuffer(testData2.blocks[2].rlp)) + const block = Block.fromRLPSerializedBlock(toBuffer(testDataPreLondon2.blocks[2].rlp)) st.equal(typeof block.toJSON(), 'object') st.end() }) t.test('DAO hardfork', function (st) { - const blockData: any = rlp.decode(testData2.blocks[0].rlp) + const blockData: any = rlp.decode(testDataPreLondon2.blocks[0].rlp) // Set block number from test block to mainnet DAO fork block 1920000 blockData[0][8] = Buffer.from('1D4C00', 'hex') diff --git a/packages/block/test/from-rpc.spec.ts b/packages/block/test/from-rpc.spec.ts index dd25dabc2dc..828eaa164e5 100644 --- a/packages/block/test/from-rpc.spec.ts +++ b/packages/block/test/from-rpc.spec.ts @@ -10,22 +10,24 @@ import * as uncleBlockData from './testdata/testdata-from-rpc-with-uncles_uncle- import * as testDataFromRpcGoerliLondon from './testdata/testdata-from-rpc-goerli-london.json' tape('[fromRPC]: block #2924874', function (t) { + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + t.test('should create a block with transactions with valid signatures', function (st) { - const block = blockFromRpc(blockData) + const block = blockFromRpc(blockData, [], { common }) const allValid = block.transactions.every((tx) => tx.verifySignature()) st.equal(allValid, true, 'all transaction signatures are valid') st.end() }) t.test('should create a block header with the correct hash', function (st) { - const block = blockHeaderFromRpc(blockData) + const block = blockHeaderFromRpc(blockData, { common }) const hash = Buffer.from(blockData.hash.slice(2), 'hex') st.ok(block.hash().equals(hash)) st.end() }) t.test('should create a block with uncles', function (st) { - const block = blockFromRpc(blockDataWithUncles, [uncleBlockData]) + const block = blockFromRpc(blockDataWithUncles, [uncleBlockData], { common }) st.ok(block.validateUnclesHash()) st.end() }) diff --git a/packages/block/test/header.spec.ts b/packages/block/test/header.spec.ts index bbafb99c472..761734526e4 100644 --- a/packages/block/test/header.spec.ts +++ b/packages/block/test/header.spec.ts @@ -5,7 +5,7 @@ import { BlockHeader } from '../src/header' import { Block } from '../src' import { Mockchain } from './mockchain' import { PoaMockchain } from './poaMockchain' -const testData = require('./testdata/testdata.json') +const testDataPreLondon = require('./testdata/testdata_pre-london.json') const blocksMainnet = require('./testdata/blocks_mainnet.json') const blocksGoerli = require('./testdata/blocks_goerli.json') @@ -262,12 +262,12 @@ tape('[Block]: Header functions', function (t) { }) t.test('header validation -> poa checks', async function (st) { - const headerData = testData.blocks[0].blockHeader + const headerData = testDataPreLondon.blocks[0].blockHeader - const common = new Common({ chain: Chain.Goerli }) + const common = new Common({ chain: Chain.Goerli, hardfork: Hardfork.Istanbul }) const blockchain = new Mockchain() - const block = Block.fromRLPSerializedBlock(testData.genesisRLP, { common }) + const block = Block.fromRLPSerializedBlock(testDataPreLondon.genesisRLP, { common }) await blockchain.putBlock(block) headerData.number = 1 @@ -348,7 +348,10 @@ tape('[Block]: Header functions', function (t) { '64bf9cc30328b0e42387b3c82c614e6386259136235e20c1357bd11cdee86993', 'hex' ) - const poaBlock = Block.fromRLPSerializedBlock(testData.genesisRLP, { common, cliqueSigner }) + const poaBlock = Block.fromRLPSerializedBlock(testDataPreLondon.genesisRLP, { + common, + cliqueSigner, + }) await poaBlockchain.putBlock(poaBlock) header = BlockHeader.fromHeaderData(headerData, { common, cliqueSigner }) diff --git a/packages/block/test/testdata/testdata2.json b/packages/block/test/testdata/testdata_pre-london-2.json similarity index 100% rename from packages/block/test/testdata/testdata2.json rename to packages/block/test/testdata/testdata_pre-london-2.json diff --git a/packages/block/test/testdata/testdata.json b/packages/block/test/testdata/testdata_pre-london.json similarity index 100% rename from packages/block/test/testdata/testdata.json rename to packages/block/test/testdata/testdata_pre-london.json diff --git a/packages/blockchain/test/index.spec.ts b/packages/blockchain/test/index.spec.ts index fb5e5cb405e..677c019669a 100644 --- a/packages/blockchain/test/index.spec.ts +++ b/packages/blockchain/test/index.spec.ts @@ -4,7 +4,7 @@ import { Block, BlockHeader, BlockOptions } from '@ethereumjs/block' import tape from 'tape' import Blockchain from '../src' import { generateBlockchain, generateBlocks, isConsecutive, createTestDB } from './util' -import * as testData from './testdata/testdata.json' +import * as testDataPreLondon from './testdata/testdata_pre-london.json' import blocksData from './testdata/blocks_mainnet.json' const level = require('level-mem') @@ -121,7 +121,7 @@ tape('blockchain test', (t) => { t.test('should add 12 blocks, one at a time', async (st) => { const blocks: Block[] = [] const gasLimit = 8000000 - const common = new Common({ chain: Chain.Ropsten }) + const common = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Istanbul }) const genesisBlock = Block.genesis({ header: { gasLimit } }, { common }) blocks.push(genesisBlock) @@ -167,14 +167,16 @@ tape('blockchain test', (t) => { t.test('should get block by number', async (st) => { const blocks: Block[] = [] const gasLimit = 8000000 + const common = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Istanbul }) - const genesisBlock = Block.genesis({ header: { gasLimit } }) + const genesisBlock = Block.genesis({ header: { gasLimit } }, { common }) blocks.push(genesisBlock) const blockchain = new Blockchain({ validateBlocks: true, validateConsensus: false, genesisBlock, + common, }) const blockData = { @@ -187,6 +189,7 @@ tape('blockchain test', (t) => { } const block = Block.fromBlockData(blockData, { calcDifficultyFromHeader: genesisBlock.header, + common, }) blocks.push(block) await blockchain.putBlock(block) @@ -670,9 +673,11 @@ tape('blockchain test', (t) => { }) t.test('should add block with body', async (st) => { - const genesisRlp = Buffer.from(testData.genesisRLP.slice(2), 'hex') + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + const genesisRlp = Buffer.from(testDataPreLondon.genesisRLP.slice(2), 'hex') const genesisBlock = Block.fromRLPSerializedBlock(genesisRlp, { initWithGenesisHeader: true, + common, }) const blockchain = new Blockchain({ validateBlocks: true, @@ -680,8 +685,8 @@ tape('blockchain test', (t) => { genesisBlock, }) - const blockRlp = Buffer.from(testData.blocks[0].rlp.slice(2), 'hex') - const block = Block.fromRLPSerializedBlock(blockRlp) + const blockRlp = Buffer.from(testDataPreLondon.blocks[0].rlp.slice(2), 'hex') + const block = Block.fromRLPSerializedBlock(blockRlp, { common }) await blockchain.putBlock(block) st.end() }) @@ -709,7 +714,8 @@ tape('blockchain test', (t) => { const db = level() const gasLimit = 8000000 - const genesisBlock = Block.genesis({ header: { gasLimit } }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + const genesisBlock = Block.genesis({ header: { gasLimit } }, { common }) let blockchain = new Blockchain({ db, validateBlocks: true, @@ -725,6 +731,7 @@ tape('blockchain test', (t) => { } const header = BlockHeader.fromHeaderData(headerData, { calcDifficultyFromHeader: genesisBlock.header, + common, }) await blockchain.putHeader(header) diff --git a/packages/blockchain/test/reorg.spec.ts b/packages/blockchain/test/reorg.spec.ts index ff7a0e8ca97..81ac8bc34a3 100644 --- a/packages/blockchain/test/reorg.spec.ts +++ b/packages/blockchain/test/reorg.spec.ts @@ -6,19 +6,21 @@ import Blockchain from '../src' import { CLIQUE_NONCE_AUTH } from '../src/clique' import { generateConsecutiveBlock } from './util' -const genesis = Block.fromBlockData({ - header: { - number: new BN(0), - difficulty: new BN(0x020000), - gasLimit: new BN(8000000), - }, -}) - tape('reorg tests', (t) => { t.test( 'should correctly reorg the chain if the total difficulty is higher on a lower block number than the current head block', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.MuirGlacier }) + const genesis = Block.fromBlockData( + { + header: { + number: new BN(0), + difficulty: new BN(0x020000), + gasLimit: new BN(8000000), + }, + }, + { common } + ) const blockchain = new Blockchain({ validateBlocks: true, validateConsensus: false, diff --git a/packages/blockchain/test/testdata/testdata.json b/packages/blockchain/test/testdata/testdata_pre-london.json similarity index 100% rename from packages/blockchain/test/testdata/testdata.json rename to packages/blockchain/test/testdata/testdata_pre-london.json diff --git a/packages/client/test/blockchain/chain.spec.ts b/packages/client/test/blockchain/chain.spec.ts index 61830d686f4..059cbfb094b 100644 --- a/packages/client/test/blockchain/chain.spec.ts +++ b/packages/client/test/blockchain/chain.spec.ts @@ -53,7 +53,9 @@ tape('[Chain]', (t) => { difficulty: new BN('abcdffff', 16), parentHash: chain.genesis.hash, } - const block = Block.fromBlockData({ header: headerData } as BlockData) + const block = Block.fromBlockData({ header: headerData } as BlockData, { + common: config.chainCommon, + }) t.equal(await chain.update(), false, 'skip update if not opened') t.equal(await chain.close(), false, 'skip close if not opened') @@ -126,7 +128,9 @@ tape('[Chain]', (t) => { difficulty: new BN('abcdffff', 16), parentHash: chain.genesis.hash, } - const block = Block.fromBlockData({ header: headerData } as BlockData) + const block = Block.fromBlockData({ header: headerData } as BlockData, { + common: config.chainCommon, + }) await chain.putBlocks([block]) t.equal(chain.blocks.td.toString(16), '4abcdffff', 'get chain.td') t.equal(chain.blocks.height.toString(10), '1', 'get chain.height') diff --git a/packages/client/test/integration/fullethereumservice.spec.ts b/packages/client/test/integration/fullethereumservice.spec.ts index 2ab29322748..af5d62b3863 100644 --- a/packages/client/test/integration/fullethereumservice.spec.ts +++ b/packages/client/test/integration/fullethereumservice.spec.ts @@ -10,11 +10,13 @@ import MockServer from './mocks/mockserver' import MockChain from './mocks/mockchain' import { destroy } from './util' +const config = new Config() + tape('[Integration:FullEthereumService]', async (t) => { async function setup(): Promise<[MockServer, FullEthereumService]> { - const config = new Config() const server = new MockServer({ config }) const blockchain = await Blockchain.create({ + common: config.chainCommon, validateBlocks: false, validateConsensus: false, }) @@ -60,12 +62,15 @@ tape('[Integration:FullEthereumService]', async (t) => { }) peer.eth!.send('NewBlockHashes', [[hash, new BN(2)]]) - const block = Block.fromBlockData({ - header: { - number: 1, - difficulty: 1, + const block = Block.fromBlockData( + { + header: { + number: 1, + difficulty: 1, + }, }, - }) + { common: config.chainCommon } + ) peer.eth!.send('NewBlock', [block, new BN(1)]) const txData = diff --git a/packages/client/test/integration/mocks/mockchain.ts b/packages/client/test/integration/mocks/mockchain.ts index edf17d811fc..5f62fda194b 100644 --- a/packages/client/test/integration/mocks/mockchain.ts +++ b/packages/client/test/integration/mocks/mockchain.ts @@ -24,13 +24,16 @@ export default class MockChain extends Chain { async build() { const blocks: Block[] = [] for (let number = 0; number < this.height; number++) { - const block = Block.fromBlockData({ - header: { - number: number + 1, - difficulty: 1, - parentHash: number ? blocks[number - 1].hash() : this.genesis.hash, + const block = Block.fromBlockData( + { + header: { + number: number + 1, + difficulty: 1, + parentHash: number ? blocks[number - 1].hash() : this.genesis.hash, + }, }, - }) + { common: this.config.chainCommon } + ) blocks.push(block) } await this.putBlocks(blocks) diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index 02c9c05487f..01b16f78ba1 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -421,7 +421,7 @@ tape('[Miner]', async (t) => { t.test('should handle mining ethash PoW', async (t) => { t.plan(1) - const common = new Common({ chain: CommonChain.Ropsten }) + const common = new Common({ chain: CommonChain.Ropsten, hardfork: Hardfork.Istanbul }) ;(common as any)._chainParams['genesis'].difficulty = 1 const config = new Config({ transports: [], accounts, mine: true, common }) const chain = new Chain({ config }) diff --git a/packages/client/test/net/protocol/ethprotocol.spec.ts b/packages/client/test/net/protocol/ethprotocol.spec.ts index fd174e695a0..3fc48d8297d 100644 --- a/packages/client/test/net/protocol/ethprotocol.spec.ts +++ b/packages/client/test/net/protocol/ethprotocol.spec.ts @@ -82,7 +82,7 @@ tape('[EthProtocol]', (t) => { const chain = new Chain({ config }) const p = new EthProtocol({ config, chain }) const td = new BN(100) - const block = Block.fromBlockData({}) + const block = Block.fromBlockData({}, { common: config.chainCommon }) const res = p.decode(p.messages.filter((message) => message.name === 'NewBlock')[0], [ block.raw(), td.toBuffer(), diff --git a/packages/client/test/rpc/eth/call.spec.ts b/packages/client/test/rpc/eth/call.spec.ts index c4e80fa8e8c..6f6b18acfa7 100644 --- a/packages/client/test/rpc/eth/call.spec.ts +++ b/packages/client/test/rpc/eth/call.spec.ts @@ -1,6 +1,7 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' import { Address, BN, bnToHex, bufferToHex } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' @@ -11,9 +12,14 @@ import type { FullEthereumService } from '../../../lib/service' const method = 'eth_call' tape(`${method}: call with valid arguments`, async (t) => { - const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + const blockchain = await Blockchain.create({ + common, + validateBlocks: false, + validateConsensus: false, + }) - const client = createClient({ blockchain, includeVM: true }) + const client = createClient({ blockchain, commonChain: common, includeVM: true }) const manager = createManager(client) const server = startRPC(manager.getMethods()) @@ -40,7 +46,7 @@ tape(`${method}: call with valid arguments`, async (t) => { // construct block with tx const gasLimit = 2000000 - const tx = Transaction.fromTxData({ gasLimit, data }, { freeze: false }) + const tx = Transaction.fromTxData({ gasLimit, data }, { common, freeze: false }) tx.getSenderAddress = () => { return address } @@ -53,7 +59,7 @@ tape(`${method}: call with valid arguments`, async (t) => { gasLimit, }, }, - { calcDifficultyFromHeader: parent } + { common, calcDifficultyFromHeader: parent } ) block.transactions[0] = tx diff --git a/packages/client/test/rpc/eth/estimateGas.spec.ts b/packages/client/test/rpc/eth/estimateGas.spec.ts index 7a5678d2d7c..adde17cb093 100644 --- a/packages/client/test/rpc/eth/estimateGas.spec.ts +++ b/packages/client/test/rpc/eth/estimateGas.spec.ts @@ -1,6 +1,7 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' import { Address, BN, bnToHex } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' @@ -11,9 +12,14 @@ import type { FullEthereumService } from '../../../lib/service' const method = 'eth_estimateGas' tape(`${method}: call with valid arguments`, async (t) => { - const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + const blockchain = await Blockchain.create({ + common, + validateBlocks: false, + validateConsensus: false, + }) - const client = createClient({ blockchain, includeVM: true }) + const client = createClient({ blockchain, commonChain: common, includeVM: true }) const manager = createManager(client) const server = startRPC(manager.getMethods()) @@ -41,7 +47,7 @@ tape(`${method}: call with valid arguments`, async (t) => { // construct block with tx const gasLimit = 2000000 - const tx = Transaction.fromTxData({ gasLimit, data }, { freeze: false }) + const tx = Transaction.fromTxData({ gasLimit, data }, { common, freeze: false }) tx.getSenderAddress = () => { return address } @@ -54,7 +60,7 @@ tape(`${method}: call with valid arguments`, async (t) => { gasLimit, }, }, - { calcDifficultyFromHeader: parent } + { common, calcDifficultyFromHeader: parent } ) block.transactions[0] = tx diff --git a/packages/client/test/rpc/eth/getBalance.spec.ts b/packages/client/test/rpc/eth/getBalance.spec.ts index ea6325897d0..0204d94fa7f 100644 --- a/packages/client/test/rpc/eth/getBalance.spec.ts +++ b/packages/client/test/rpc/eth/getBalance.spec.ts @@ -1,6 +1,7 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' import { Address, BN, toBuffer, bnToHex } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' @@ -11,9 +12,10 @@ import type { FullEthereumService } from '../../../lib/service' const method = 'eth_getBalance' tape(`${method}: ensure balance deducts after a tx`, async (t) => { - const blockchain = await Blockchain.create() + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + const blockchain = await Blockchain.create({ common }) - const client = createClient({ blockchain, includeVM: true }) + const client = createClient({ blockchain, commonChain: common, includeVM: true }) const manager = createManager(client) const server = startRPC(manager.getMethods()) @@ -39,11 +41,11 @@ tape(`${method}: ensure balance deducts after a tx`, async (t) => { await baseRequest(t, server, req, 200, expectRes, false) // construct block with tx - const tx = Transaction.fromTxData({ gasLimit: 53000 }, { freeze: false }) + const tx = Transaction.fromTxData({ gasLimit: 53000 }, { common, freeze: false }) tx.getSenderAddress = () => { return address } - const block = Block.fromBlockData() + const block = Block.fromBlockData({}, { common }) block.transactions[0] = tx const result = await vm.runBlock({ block, generate: true, skipBlockValidation: true }) diff --git a/packages/client/test/rpc/eth/getCode.spec.ts b/packages/client/test/rpc/eth/getCode.spec.ts index 397697a26de..48dfd0fa424 100644 --- a/packages/client/test/rpc/eth/getCode.spec.ts +++ b/packages/client/test/rpc/eth/getCode.spec.ts @@ -1,6 +1,7 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' import { Address, BN } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' @@ -10,10 +11,12 @@ import type { FullEthereumService } from '../../../lib/service' const method = 'eth_getCode' +const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + tape(`${method}: call with valid arguments`, async (t) => { - const blockchain = await Blockchain.create() + const blockchain = await Blockchain.create({ common }) - const client = createClient({ blockchain, includeVM: true }) + const client = createClient({ blockchain, commonChain: common, includeVM: true }) const manager = createManager(client) const server = startRPC(manager.getMethods()) @@ -35,9 +38,13 @@ tape(`${method}: call with valid arguments`, async (t) => { }) tape(`${method}: ensure returns correct code`, async (t) => { - const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false }) + const blockchain = await Blockchain.create({ + common, + validateBlocks: false, + validateConsensus: false, + }) - const client = createClient({ blockchain, includeVM: true }) + const client = createClient({ blockchain, commonChain: common, includeVM: true }) const manager = createManager(client) const server = startRPC(manager.getMethods()) @@ -56,7 +63,7 @@ tape(`${method}: ensure returns correct code`, async (t) => { // construct block with tx const gasLimit = 2000000 - const tx = Transaction.fromTxData({ gasLimit, data }, { freeze: false }) + const tx = Transaction.fromTxData({ gasLimit, data }, { common, freeze: false }) tx.getSenderAddress = () => { return address } @@ -69,7 +76,7 @@ tape(`${method}: ensure returns correct code`, async (t) => { gasLimit, }, }, - { calcDifficultyFromHeader: parent } + { common, calcDifficultyFromHeader: parent } ) block.transactions[0] = tx diff --git a/packages/client/test/rpc/eth/getProof.spec.ts b/packages/client/test/rpc/eth/getProof.spec.ts index 48d51fbad32..d4403239edc 100644 --- a/packages/client/test/rpc/eth/getProof.spec.ts +++ b/packages/client/test/rpc/eth/getProof.spec.ts @@ -1,6 +1,7 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' import { Address, BN, bnToHex } from 'ethereumjs-util' import { startRPC, createManager, createClient, params, baseRequest } from '../helpers' @@ -30,10 +31,16 @@ const expectedProof = { ], } +const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + tape(`${method}: call with valid arguments`, async (t) => { - const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false }) + const blockchain = await Blockchain.create({ + common, + validateBlocks: false, + validateConsensus: false, + }) - const client = createClient({ blockchain, includeVM: true }) + const client = createClient({ blockchain, commonChain: common, includeVM: true }) const manager = createManager(client) const server = startRPC(manager.getMethods()) @@ -63,7 +70,7 @@ tape(`${method}: call with valid arguments`, async (t) => { // construct block with tx const gasLimit = 2000000 - const tx = Transaction.fromTxData({ gasLimit, data }, { freeze: false }) + const tx = Transaction.fromTxData({ gasLimit, data }, { common, freeze: false }) tx.getSenderAddress = () => { return address } @@ -76,7 +83,7 @@ tape(`${method}: call with valid arguments`, async (t) => { gasLimit, }, }, - { calcDifficultyFromHeader: parent } + { common, calcDifficultyFromHeader: parent } ) block.transactions[0] = tx @@ -96,7 +103,7 @@ tape(`${method}: call with valid arguments`, async (t) => { gasLimit: bnToHex(new BN(530000)), nonce: 1, } - const storeTx = Transaction.fromTxData(storeTxData, { freeze: false }) + const storeTx = Transaction.fromTxData(storeTxData, { common, freeze: false }) storeTx.getSenderAddress = () => { return address } @@ -108,7 +115,7 @@ tape(`${method}: call with valid arguments`, async (t) => { gasLimit, }, }, - { calcDifficultyFromHeader: block.header } + { common, calcDifficultyFromHeader: block.header } ) block2.transactions[0] = storeTx diff --git a/packages/client/test/rpc/eth/getStorageAt.spec.ts b/packages/client/test/rpc/eth/getStorageAt.spec.ts index e22939c4de7..18de909d0d4 100644 --- a/packages/client/test/rpc/eth/getStorageAt.spec.ts +++ b/packages/client/test/rpc/eth/getStorageAt.spec.ts @@ -1,6 +1,7 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' import { Address, BN, bnToHex, bufferToHex, keccak } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' @@ -10,10 +11,16 @@ import type { FullEthereumService } from '../../../lib/service' const method = 'eth_getStorageAt' +const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + tape(`${method}: call with valid arguments`, async (t) => { - const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false }) + const blockchain = await Blockchain.create({ + common, + validateBlocks: false, + validateConsensus: false, + }) - const client = createClient({ blockchain, includeVM: true }) + const client = createClient({ blockchain, commonChain: common, includeVM: true }) const manager = createManager(client) const server = startRPC(manager.getMethods()) @@ -44,7 +51,7 @@ tape(`${method}: call with valid arguments`, async (t) => { // construct block with tx const gasLimit = 2000000 - const tx = Transaction.fromTxData({ gasLimit, data }, { freeze: false }) + const tx = Transaction.fromTxData({ gasLimit, data }, { common, freeze: false }) tx.getSenderAddress = () => { return address } @@ -57,7 +64,7 @@ tape(`${method}: call with valid arguments`, async (t) => { gasLimit, }, }, - { calcDifficultyFromHeader: parent } + { common, calcDifficultyFromHeader: parent } ) block.transactions[0] = tx @@ -77,7 +84,7 @@ tape(`${method}: call with valid arguments`, async (t) => { gasLimit: bnToHex(new BN(530000)), nonce: 1, } - const storeTx = Transaction.fromTxData(storeTxData, { freeze: false }) + const storeTx = Transaction.fromTxData(storeTxData, { common, freeze: false }) storeTx.getSenderAddress = () => { return address } @@ -89,7 +96,7 @@ tape(`${method}: call with valid arguments`, async (t) => { gasLimit, }, }, - { calcDifficultyFromHeader: block.header } + { common, calcDifficultyFromHeader: block.header } ) block2.transactions[0] = storeTx diff --git a/packages/client/test/rpc/eth/getTransactionCount.spec.ts b/packages/client/test/rpc/eth/getTransactionCount.spec.ts index 0e07106de2f..da5cc03dd0e 100644 --- a/packages/client/test/rpc/eth/getTransactionCount.spec.ts +++ b/packages/client/test/rpc/eth/getTransactionCount.spec.ts @@ -1,6 +1,7 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' import { Address } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' @@ -10,10 +11,16 @@ import type { FullEthereumService } from '../../../lib/service' const method = 'eth_getTransactionCount' +const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + tape(`${method}: call with valid arguments`, async (t) => { - const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false }) + const blockchain = await Blockchain.create({ + common, + validateBlocks: false, + validateConsensus: false, + }) - const client = createClient({ blockchain, includeVM: true }) + const client = createClient({ blockchain, commonChain: common, includeVM: true }) const manager = createManager(client) const server = startRPC(manager.getMethods()) @@ -37,7 +44,7 @@ tape(`${method}: call with valid arguments`, async (t) => { await baseRequest(t, server, req, 200, expectRes, false) // construct block with tx - const tx = Transaction.fromTxData({ gasLimit: 53000 }, { freeze: false }) + const tx = Transaction.fromTxData({ gasLimit: 53000 }, { common, freeze: false }) tx.getSenderAddress = () => { return address } @@ -50,7 +57,7 @@ tape(`${method}: call with valid arguments`, async (t) => { gasLimit: 2000000, }, }, - { calcDifficultyFromHeader: parent } + { common, calcDifficultyFromHeader: parent } ) block.transactions[0] = tx diff --git a/packages/common/README.md b/packages/common/README.md index b8b02f96305..61cdd034417 100644 --- a/packages/common/README.md +++ b/packages/common/README.md @@ -42,7 +42,7 @@ const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) If no hardfork is provided, the common is initialized with the default hardfork. -Current `DEFAULT_HARDFORK`: `istanbul` +Current `DEFAULT_HARDFORK`: `london` Here are some simple usage examples: @@ -276,10 +276,10 @@ library supported: - `byzantium` (`Hardfork.Byzantium`) - `constantinople` (`Hardfork.Constantinople`) - `petersburg` (`Hardfork.Petersburg`) (aka `constantinopleFix`, apply together with `constantinople`) -- `istanbul` (`Hardfork.Istanbul`) (`DEFAULT_HARDFORK` (`v2.0.0` release series)) +- `istanbul` (`Hardfork.Instanbul`) - `muirGlacier` (`Hardfork.MuirGlacier`) - `berlin` (`Hardfork.Berlin`) (since `v2.2.0`) -- `london` (`Hardfork.London`) (since `v2.4.0`) +- `london` (`Hardfork.London`) (`DEFAULT_HARDFORK`) (since `v2.4.0`) - `merge` (`Hardfork.Merge`) (since `v2.5.0`, `experimental`) ### Future Hardforks diff --git a/packages/common/src/chains/goerli.json b/packages/common/src/chains/goerli.json index be9181770d6..050f54658f1 100644 --- a/packages/common/src/chains/goerli.json +++ b/packages/common/src/chains/goerli.json @@ -2,7 +2,7 @@ "name": "goerli", "chainId": 5, "networkId": 5, - "defaultHardfork": "istanbul", + "defaultHardfork": "london", "consensus": { "type": "poa", "algorithm": "clique", diff --git a/packages/common/src/chains/kovan.json b/packages/common/src/chains/kovan.json index 006c41fcb92..c190b57de60 100644 --- a/packages/common/src/chains/kovan.json +++ b/packages/common/src/chains/kovan.json @@ -2,7 +2,7 @@ "name": "kovan", "chainId": 42, "networkId": 42, - "defaultHardfork": "istanbul", + "defaultHardfork": "london", "consensus": { "type": "poa", "algorithm": "aura", diff --git a/packages/common/src/chains/mainnet.json b/packages/common/src/chains/mainnet.json index 28bfe0a8066..85465f7eba0 100644 --- a/packages/common/src/chains/mainnet.json +++ b/packages/common/src/chains/mainnet.json @@ -2,7 +2,7 @@ "name": "mainnet", "chainId": 1, "networkId": 1, - "defaultHardfork": "istanbul", + "defaultHardfork": "london", "consensus": { "type": "pow", "algorithm": "ethash", diff --git a/packages/common/src/chains/rinkeby.json b/packages/common/src/chains/rinkeby.json index a74ae3c19dc..76ec32ed337 100644 --- a/packages/common/src/chains/rinkeby.json +++ b/packages/common/src/chains/rinkeby.json @@ -2,7 +2,7 @@ "name": "rinkeby", "chainId": 4, "networkId": 4, - "defaultHardfork": "istanbul", + "defaultHardfork": "london", "consensus": { "type": "poa", "algorithm": "clique", diff --git a/packages/common/src/chains/ropsten.json b/packages/common/src/chains/ropsten.json index bd529a438b4..6dc13fad080 100644 --- a/packages/common/src/chains/ropsten.json +++ b/packages/common/src/chains/ropsten.json @@ -2,7 +2,7 @@ "name": "ropsten", "chainId": 3, "networkId": 3, - "defaultHardfork": "istanbul", + "defaultHardfork": "london", "consensus": { "type": "pow", "algorithm": "ethash", diff --git a/packages/common/src/chains/sepolia.json b/packages/common/src/chains/sepolia.json index 79f3b914171..46a2752ab98 100644 --- a/packages/common/src/chains/sepolia.json +++ b/packages/common/src/chains/sepolia.json @@ -2,7 +2,7 @@ "name": "sepolia", "chainId": 11155111, "networkId": 11155111, - "defaultHardfork": "istanbul", + "defaultHardfork": "london", "consensus": { "type": "pow", "algorithm": "ethash", diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index 46a7068f942..004171170fd 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -105,7 +105,7 @@ interface BaseOpts { /** * String identifier ('byzantium') for hardfork or {@link Hardfork} enum. * - * Default: Hardfork.Istanbul + * Default: Hardfork.London */ hardfork?: string | Hardfork /** @@ -348,7 +348,7 @@ export default class Common extends EventEmitter { super() this._customChains = opts.customChains ?? [] this._chainParams = this.setChain(opts.chain) - this.DEFAULT_HARDFORK = this._chainParams.defaultHardfork ?? Hardfork.Istanbul + this.DEFAULT_HARDFORK = this._chainParams.defaultHardfork ?? Hardfork.London for (const hf of this._chainParams.hardforks) { if (!hf.forkHash) { hf.forkHash = this._calcForkHash(hf.name) diff --git a/packages/common/tests/chains.spec.ts b/packages/common/tests/chains.spec.ts index a78db565dd0..cdd6b66551d 100644 --- a/packages/common/tests/chains.spec.ts +++ b/packages/common/tests/chains.spec.ts @@ -8,7 +8,7 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { st.equal(c.chainName(), 'mainnet', 'should initialize with chain name') st.ok(c.chainId().eqn(1), 'should return correct chain Id') st.ok(c.networkId().eqn(1), 'should return correct network Id') - st.equal(c.hardfork(), 'istanbul', 'should set hardfork to current default hardfork') + st.equal(c.hardfork(), Hardfork.London, 'should set hardfork to current default hardfork') st.equal( c.hardfork(), c.DEFAULT_HARDFORK, @@ -26,7 +26,7 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { st.equal(c.chainName(), 'mainnet', 'should initialize with chain name') st.ok(c.chainId().eqn(1), 'should return correct chain Id') st.ok(c.networkId().eqn(1), 'should return correct network Id') - st.equal(c.hardfork(), 'istanbul', 'should set hardfork to current default hardfork') + st.equal(c.hardfork(), Hardfork.London, 'should set hardfork to current default hardfork') st.equal( c.hardfork(), c.DEFAULT_HARDFORK, diff --git a/packages/ethash/test/block.spec.ts b/packages/ethash/test/block.spec.ts index f57b208e8e6..fd79dc46a4d 100644 --- a/packages/ethash/test/block.spec.ts +++ b/packages/ethash/test/block.spec.ts @@ -1,5 +1,6 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import Ethash from '../src' const level = require('level-mem') @@ -10,23 +11,25 @@ const { validBlockRlp, invalidBlockRlp } = require('./ethash_block_rlp_tests.jso tape('Verify POW for valid and invalid blocks', async function (t) { const e = new Ethash(cacheDB) - const genesis = Block.genesis() + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) + + const genesis = Block.genesis(undefined, { common }) const genesisResult = await e.verifyPOW(genesis) t.ok(genesisResult, 'genesis block should be valid') const validRlp = Buffer.from(validBlockRlp, 'hex') - const validBlock = Block.fromRLPSerializedBlock(validRlp) + const validBlock = Block.fromRLPSerializedBlock(validRlp, { common }) const validBlockResult = await e.verifyPOW(validBlock) t.ok(validBlockResult, 'should be valid') const invalidRlp = Buffer.from(invalidBlockRlp, 'hex') - const invalidBlock = Block.fromRLPSerializedBlock(invalidRlp) + const invalidBlock = Block.fromRLPSerializedBlock(invalidRlp, { common }) const invalidBlockResult = await e.verifyPOW(invalidBlock) t.ok(!invalidBlockResult, 'should be invalid') const testData = require('./block_tests_data.json') const blockRlp = testData.blocks[0].rlp - const block = Block.fromRLPSerializedBlock(blockRlp) + const block = Block.fromRLPSerializedBlock(blockRlp, { common }) const uncleBlockResult = await e.verifyPOW(block) t.ok(uncleBlockResult, 'should be valid') t.end() diff --git a/packages/ethash/test/ethash.spec.ts b/packages/ethash/test/ethash.spec.ts index 9b3aee03709..c0e141c6e8f 100644 --- a/packages/ethash/test/ethash.spec.ts +++ b/packages/ethash/test/ethash.spec.ts @@ -1,4 +1,5 @@ import tape from 'tape' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import Ethash from '../src' import { getEpoc, getCacheSize, getFullSize } from '../src/util' import { BlockHeader } from '@ethereumjs/block' @@ -6,11 +7,12 @@ const powTests = require('./ethash_tests.json') const ethash = new Ethash() const tests = Object.keys(powTests) +const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) tape('POW tests', function (t) { tests.forEach(function (key) { const test = powTests[key] - const header = BlockHeader.fromRLPSerializedHeader(Buffer.from(test.header, 'hex'), {}) + const header = BlockHeader.fromRLPSerializedHeader(Buffer.from(test.header, 'hex'), { common }) const headerHash = ethash.headerHash(header.raw()) t.equal(headerHash.toString('hex'), test.header_hash, 'generate header hash') diff --git a/packages/ethash/test/miner.spec.ts b/packages/ethash/test/miner.spec.ts index fd8c4ecf7d4..653f2353639 100644 --- a/packages/ethash/test/miner.spec.ts +++ b/packages/ethash/test/miner.spec.ts @@ -2,20 +2,24 @@ import tape from 'tape' import { Block, BlockHeader } from '@ethereumjs/block' import Ethash from '../src' import { BN } from 'ethereumjs-util' -import Common from '@ethereumjs/common' +import Common, { Chain, Hardfork } from '@ethereumjs/common' const level = require('level-mem') const cacheDB = level() +const common = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Petersburg }) tape('Check if miner works as expected', async function (t) { const e = new Ethash(cacheDB) - const block = Block.fromBlockData({ - header: { - difficulty: new BN(100), - number: new BN(1), + const block = Block.fromBlockData( + { + header: { + difficulty: new BN(100), + number: new BN(1), + }, }, - }) + { common } + ) const invalidBlockResult = await e.verifyPOW(block) t.ok(!invalidBlockResult, 'should be invalid') @@ -29,14 +33,17 @@ tape('Check if miner works as expected', async function (t) { const solution = await miner.iterate(-1) - const validBlock = Block.fromBlockData({ - header: { - difficulty: block.header.difficulty, - number: block.header.number, - nonce: solution?.nonce, - mixHash: solution?.mixHash, + const validBlock = Block.fromBlockData( + { + header: { + difficulty: block.header.difficulty, + number: block.header.number, + nonce: solution?.nonce, + mixHash: solution?.mixHash, + }, }, - }) + { common } + ) const validBlockResult = await e.verifyPOW(validBlock) t.ok(validBlockResult, 'succesfully mined block') @@ -48,12 +55,15 @@ tape('Check if miner works as expected', async function (t) { tape('Check if it is possible to mine Blocks and BlockHeaders', async function (t) { const e = new Ethash(cacheDB) - const block = Block.fromBlockData({ - header: { - difficulty: new BN(100), - number: new BN(1), + const block = Block.fromBlockData( + { + header: { + difficulty: new BN(100), + number: new BN(1), + }, }, - }) + { common } + ) const miner = e.getMiner(block.header) const solution = await miner.mine(-1) @@ -71,12 +81,15 @@ tape('Check if it is possible to mine Blocks and BlockHeaders', async function ( tape('Check if it is possible to stop the miner', async function (t) { const e = new Ethash(cacheDB) - const block = Block.fromBlockData({ - header: { - difficulty: new BN(10000000000000), - number: new BN(1), + const block = Block.fromBlockData( + { + header: { + difficulty: new BN(10000000000000), + number: new BN(1), + }, }, - }) + { common } + ) const miner = e.getMiner(block.header) setTimeout(function () { @@ -103,8 +116,6 @@ tape('Check if it is possible to stop the miner', async function (t) { tape('Should keep common when mining blocks or headers', async function (t) { const e = new Ethash(cacheDB) - const common = new Common({ chain: 'ropsten', hardfork: 'petersburg' }) - const block = Block.fromBlockData( { header: { @@ -120,13 +131,13 @@ tape('Should keep common when mining blocks or headers', async function (t) { const miner = e.getMiner(block.header) const solution = await miner.mine(-1) - t.ok(solution._common.hardfork() === 'petersburg', 'hardfork did not change') + t.ok(solution._common.hardfork() === Hardfork.Petersburg, 'hardfork did not change') t.ok(solution._common.chainName() === 'ropsten', 'chain name did not change') const blockMiner = e.getMiner(block) const blockSolution = await blockMiner.mine(-1) - t.ok(blockSolution._common.hardfork() === 'petersburg', 'hardfork did not change') + t.ok(blockSolution._common.hardfork() === Hardfork.Petersburg, 'hardfork did not change') t.ok(blockSolution._common.chainName() === 'ropsten', 'chain name did not change') t.end() diff --git a/packages/tx/README.md b/packages/tx/README.md index 62e84a351aa..c6cd099bc08 100644 --- a/packages/tx/README.md +++ b/packages/tx/README.md @@ -35,7 +35,7 @@ All types of transaction objects are frozen with `Object.freeze()` which gives y The `Transaction` constructor receives a parameter of an [`@ethereumjs/common`](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common) object that lets you specify the chain and hardfork to be used. If there is no `Common` provided the chain ID provided as a paramter on typed tx or the chain ID derived from the `v` value on signed EIP-155 conforming legacy txs will be taken (introduced in `v3.2.1`). In other cases the chain defaults to `mainnet`. -Base default HF (determined by `Common`): `istanbul` +Base default HF (determined by `Common`): `london` Starting with `v3.2.1` the tx library now deviates from the default HF for typed tx using the following rule: "The default HF is the default HF from `Common` if the tx type is active on that HF. Otherwise it is set to the first greater HF where the tx is active." @@ -67,8 +67,6 @@ This library supports the following transaction types ([EIP-2718](https://eips.e - `AccessListEIP2930Transaction` ([EIP-2930](https://eips.ethereum.org/EIPS/eip-2930), optional access lists) - `Transaction`, the Ethereum standard tx up to `berlin`, now referred to as legacy txs with the introduction of tx types -Please note that up to `v3.2.0` you mandatorily had to use a `Common` instance for typed tx instantiation and set the `hardfork` in `Common` to minimally `berlin` (`EIP-2930`) respectively `london` (`EIP-1559`) to allow for typed tx instantiation, since the current `Common` release series v2 (tx type support introduced with `v2.2.0`) still defaults to `istanbul` for backwards-compatibility reasons (also see tx default HF section below). - #### Gas Fee Market Transactions (EIP-1559) - Class: `FeeMarketEIP1559Transaction` @@ -155,7 +153,7 @@ Legacy transaction are still valid transaction within Ethereum `mainnet` but wil See this [example script](./examples/transactions.ts) or the following code example on how to use. ```typescript -import Common, { Chain } from '@ethereumjs/common' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' const txParams = { @@ -167,7 +165,7 @@ const txParams = { data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057', } -const common = new Common({ chain: Chain.Mainnet }) +const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) const tx = Transaction.fromTxData(txParams, { common }) const privateKey = Buffer.from( diff --git a/packages/tx/src/baseTransaction.ts b/packages/tx/src/baseTransaction.ts index b24f10f3a9b..3a6af62de3b 100644 --- a/packages/tx/src/baseTransaction.ts +++ b/packages/tx/src/baseTransaction.ts @@ -80,7 +80,7 @@ export abstract class BaseTransaction { * * @hidden */ - protected DEFAULT_HARDFORK: string | Hardfork = Hardfork.Istanbul + protected DEFAULT_HARDFORK: string | Hardfork = Hardfork.London constructor(txData: TxData | AccessListEIP2930TxData | FeeMarketEIP1559TxData) { const { nonce, gasLimit, to, value, data, v, r, s, type } = txData diff --git a/packages/vm/README.md b/packages/vm/README.md index e023740d9ea..2ead52ecd29 100644 --- a/packages/vm/README.md +++ b/packages/vm/README.md @@ -119,7 +119,7 @@ Currently the following hardfork rules are supported: - `london` (`v5.4.0`+) - `arrowGlacier` (only `mainnet`) (`v5.6.0`+) -Default: `istanbul` (taken from `Common.DEFAULT_HARDFORK`) +Default: `london` (taken from `Common.DEFAULT_HARDFORK`) A specific hardfork VM ruleset can be activated by passing in the hardfork along the `Common` instance: diff --git a/packages/vm/examples/run-solidity-contract.ts b/packages/vm/examples/run-solidity-contract.ts index 9538bd45b85..b9557a05c99 100644 --- a/packages/vm/examples/run-solidity-contract.ts +++ b/packages/vm/examples/run-solidity-contract.ts @@ -3,6 +3,7 @@ import { join } from 'path' import { readFileSync } from 'fs' import { defaultAbiCoder as AbiCoder, Interface } from '@ethersproject/abi' import { Address } from 'ethereumjs-util' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' import VM from '..' import { buildTransaction, encodeDeployment, encodeFunction } from './helpers/tx-builder' @@ -12,6 +13,8 @@ const solc = require('solc') const INITIAL_GREETING = 'Hello, World!' const SECOND_GREETING = 'Hola, Mundo!' +const common = new Common({ chain: Chain.Rinkeby, hardfork: Hardfork.Istanbul }) + /** * This function creates the input for the Solidity compiler. * @@ -92,7 +95,7 @@ async function deployContract( nonce: await getAccountNonce(vm, senderPrivateKey), } - const tx = Transaction.fromTxData(buildTransaction(txData)).sign(senderPrivateKey) + const tx = Transaction.fromTxData(buildTransaction(txData), { common }).sign(senderPrivateKey) const deploymentResult = await vm.runTx({ tx }) @@ -120,7 +123,7 @@ async function setGreeting( nonce: await getAccountNonce(vm, senderPrivateKey), } - const tx = Transaction.fromTxData(buildTransaction(txData)).sign(senderPrivateKey) + const tx = Transaction.fromTxData(buildTransaction(txData), { common }).sign(senderPrivateKey) const setGreetingResult = await vm.runTx({ tx }) @@ -154,7 +157,7 @@ async function main() { 'hex' ) - const vm = new VM() + const vm = new VM({ common }) const accountAddress = Address.fromPrivateKey(accountPk) console.log('Account: ', accountAddress.toString()) diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index ab77bd888e6..841fae5d2f9 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -70,7 +70,7 @@ export interface VMOpts { * Default setup if no `Common` instance is provided: * * - `chain`: `mainnet` - * - `hardfork`: `istanbul` + * - `hardfork`: `london` * - `eips`: `[]` */ common?: Common diff --git a/packages/vm/tests/api/buildBlock.spec.ts b/packages/vm/tests/api/buildBlock.spec.ts index 2d482d7aae7..2073cacc702 100644 --- a/packages/vm/tests/api/buildBlock.spec.ts +++ b/packages/vm/tests/api/buildBlock.spec.ts @@ -9,7 +9,7 @@ import { setBalance } from './utils' tape('BlockBuilder', async (t) => { t.test('should build a valid block', async (st) => { - const common = new Common({ chain: Chain.Mainnet }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) const genesisBlock = Block.genesis({ header: { gasLimit: 50000 } }, { common }) const blockchain = await Blockchain.create({ genesisBlock, common, validateConsensus: false }) const vm = await VM.create({ common, blockchain }) @@ -55,7 +55,7 @@ tape('BlockBuilder', async (t) => { }) t.test('should throw if adding a transaction exceeds the block gas limit', async (st) => { - const common = new Common({ chain: Chain.Mainnet }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) const vm = await VM.create({ common }) const genesis = Block.genesis({}, { common }) @@ -81,7 +81,7 @@ tape('BlockBuilder', async (t) => { }) t.test('should revert the VM state if reverted', async (st) => { - const common = new Common({ chain: Chain.Mainnet }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) const genesisBlock = Block.genesis({ header: { gasLimit: 50000 } }, { common }) const blockchain = await Blockchain.create({ genesisBlock, common, validateConsensus: false }) const vm = await VM.create({ common, blockchain }) @@ -115,7 +115,7 @@ tape('BlockBuilder', async (t) => { }) t.test('should correctly seal a PoW block', async (st) => { - const common = new Common({ chain: Chain.Mainnet }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) const genesisBlock = Block.genesis({ header: { gasLimit: 50000 } }, { common }) const blockchain = await Blockchain.create({ genesisBlock, common, validateConsensus: false }) const vm = await VM.create({ common, blockchain }) @@ -164,7 +164,7 @@ tape('BlockBuilder', async (t) => { ), } - const common = new Common({ chain: Chain.Rinkeby }) + const common = new Common({ chain: Chain.Rinkeby, hardfork: Hardfork.Istanbul }) // extraData: [vanity, activeSigner, seal] const extraData = Buffer.concat([Buffer.alloc(32), signer.address.toBuffer(), Buffer.alloc(65)]) const cliqueSigner = signer.privateKey @@ -203,7 +203,7 @@ tape('BlockBuilder', async (t) => { }) t.test('should throw if block already built or reverted', async (st) => { - const common = new Common({ chain: Chain.Mainnet }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) const genesisBlock = Block.genesis({ header: { gasLimit: 50000 } }, { common }) const blockchain = await Blockchain.create({ genesisBlock, common, validateConsensus: false }) const vm = await VM.create({ common, blockchain }) @@ -266,7 +266,7 @@ tape('BlockBuilder', async (t) => { }) t.test('should build a block without any txs', async (st) => { - const common = new Common({ chain: Chain.Mainnet }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) const genesisBlock = Block.genesis({ header: { gasLimit: 50000 } }, { common }) const blockchain = await Blockchain.create({ genesisBlock, common, validateConsensus: false }) const vm = await VM.create({ common, blockchain }) diff --git a/packages/vm/tests/api/events.spec.ts b/packages/vm/tests/api/events.spec.ts index 66d2ab411e5..9ae2bd4fda1 100644 --- a/packages/vm/tests/api/events.spec.ts +++ b/packages/vm/tests/api/events.spec.ts @@ -1,6 +1,6 @@ import tape from 'tape' import { toBuffer, bufferToHex } from 'ethereumjs-util' -import { Transaction } from '@ethereumjs/tx' +import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' import { Block } from '@ethereumjs/block' import VM from '../../src/index' @@ -58,9 +58,9 @@ tape('VM events', (t) => { emitted = val }) - const tx = Transaction.fromTxData({ - gasPrice: 40000, + const tx = FeeMarketEIP1559Transaction.fromTxData({ gasLimit: 90000, + maxFeePerGas: 40000, to: '0x1111111111111111111111111111111111111111', }).sign(privKey) @@ -79,9 +79,9 @@ tape('VM events', (t) => { emitted = val }) - const tx = Transaction.fromTxData({ - gasPrice: 40000, + const tx = FeeMarketEIP1559Transaction.fromTxData({ gasLimit: 90000, + maxFeePerGas: 40000, to: '0x1111111111111111111111111111111111111111', value: 1, }).sign(privKey) @@ -101,9 +101,9 @@ tape('VM events', (t) => { emitted = val }) - const tx = Transaction.fromTxData({ - gasPrice: 40000, + const tx = FeeMarketEIP1559Transaction.fromTxData({ gasLimit: 90000, + maxFeePerGas: 40000, to: '0x1111111111111111111111111111111111111111', value: 1, }).sign(privKey) @@ -124,9 +124,9 @@ tape('VM events', (t) => { emitted = val }) - const tx = Transaction.fromTxData({ - gasPrice: 40000, + const tx = FeeMarketEIP1559Transaction.fromTxData({ gasLimit: 90000, + maxFeePerGas: 40000, to: '0x1111111111111111111111111111111111111111', value: 1, }).sign(privKey) @@ -149,9 +149,9 @@ tape('VM events', (t) => { // This is a deployment transaction that pushes 0x41 (i.e. ascii A) followed by 31 0s to // the stack, stores that in memory, and then returns the first byte from memory. // This deploys a contract which has a single byte of code, 0x41. - const tx = Transaction.fromTxData({ - gasPrice: 40000, + const tx = FeeMarketEIP1559Transaction.fromTxData({ gasLimit: 90000, + maxFeePerGas: 40000, data: '0x7f410000000000000000000000000000000000000000000000000000000000000060005260016000f3', }).sign(privKey) @@ -173,9 +173,9 @@ tape('VM events', (t) => { // This is a deployment transaction that pushes 0x41 (i.e. ascii A) followed by 31 0s to // the stack, stores that in memory, and then returns the first byte from memory. // This deploys a contract which has a single byte of code, 0x41. - const tx = Transaction.fromTxData({ - gasPrice: 40000, + const tx = FeeMarketEIP1559Transaction.fromTxData({ gasLimit: 90000, + maxFeePerGas: 40000, data: '0x7f410000000000000000000000000000000000000000000000000000000000000060005260016000f3', }).sign(privKey) diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index a19787c8c65..00e2b22968e 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -39,7 +39,7 @@ tape('VM -> basic instantiation / boolean switches', (t) => { KECCAK256_RLP, 'it has default trie' ) - st.equal(vm._common.hardfork(), 'istanbul', 'it has correct default HF') + st.equal(vm._common.hardfork(), Hardfork.London, 'it has correct default HF') st.end() }) diff --git a/packages/vm/tests/api/runBlock.spec.ts b/packages/vm/tests/api/runBlock.spec.ts index 05109a8b806..2163dae31f8 100644 --- a/packages/vm/tests/api/runBlock.spec.ts +++ b/packages/vm/tests/api/runBlock.spec.ts @@ -98,12 +98,12 @@ tape('runBlock() -> successful API parameter usage', async (t) => { } t.test('PoW block, unmodified options', async (st) => { - const vm = setupVM() + const vm = setupVM({ common }) await simpleRun(vm, st) }) t.test('Uncle blocks, compute uncle rewards', async (st) => { - const vm = setupVM() + const vm = setupVM({ common }) await uncleRun(vm, st) }) @@ -261,7 +261,7 @@ tape('runBlock() -> runtime behavior', async (t) => { const block1: any = rlp.decode(testData.blocks[0].rlp) // edit extra data of this block to "dao-hard-fork" block1[0][12] = Buffer.from('dao-hard-fork') - const block = Block.fromValuesArray(block1) + const block = Block.fromValuesArray(block1, { common }) // @ts-ignore await setupPreConditions(vm.stateManager, testData) @@ -306,7 +306,7 @@ tape('runBlock() -> runtime behavior', async (t) => { }) t.test('should allocate to correct clique beneficiary', async (t) => { - const common = new Common({ chain: Chain.Goerli }) + const common = new Common({ chain: Chain.Goerli, hardfork: Hardfork.Istanbul }) const vm = setupVM({ common }) const signer = { @@ -397,10 +397,11 @@ tape('should correctly reflect generated fields', async (t) => { }) async function runWithHf(hardfork: string) { - const vm = setupVM({ common: new Common({ chain: Chain.Mainnet, hardfork }) }) + const common = new Common({ chain: Chain.Mainnet, hardfork }) + const vm = setupVM({ common }) const blockRlp = testData.blocks[0].rlp - const block = Block.fromRLPSerializedBlock(blockRlp) + const block = Block.fromRLPSerializedBlock(blockRlp, { common }) // @ts-ignore await setupPreConditions(vm.stateManager, testData) diff --git a/packages/vm/tests/api/runBlockchain.spec.ts b/packages/vm/tests/api/runBlockchain.spec.ts index fe32d0d2af3..58f38b59582 100644 --- a/packages/vm/tests/api/runBlockchain.spec.ts +++ b/packages/vm/tests/api/runBlockchain.spec.ts @@ -55,7 +55,7 @@ tape('runBlockchain', (t) => { // TODO: test has been moved over from index.spec.ts, check for redundancy t.test('should run blockchain with mocked runBlock', async (st) => { - const common = new Common({ chain: Chain.Ropsten }) + const common = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Istanbul }) const genesisRlp = Buffer.from(testData.genesisRLP.slice(2), 'hex') const genesisBlock = Block.fromRLPSerializedBlock(genesisRlp, { common }) @@ -86,7 +86,7 @@ tape('runBlockchain', (t) => { // TODO: test has been moved over from index.spec.ts, check for redundancy t.test('should run blockchain with blocks', async (st) => { - const common = new Common({ chain: Chain.Ropsten }) + const common = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Istanbul }) const genesisRlp = toBuffer(testData.genesisRLP) const genesisBlock = Block.fromRLPSerializedBlock(genesisRlp, { common }) diff --git a/packages/vm/tests/tester/config.ts b/packages/vm/tests/tester/config.ts index 0b2ccdad9f6..23a1d2a7fee 100644 --- a/packages/vm/tests/tester/config.ts +++ b/packages/vm/tests/tester/config.ts @@ -9,7 +9,7 @@ export const DEFAULT_TESTS_PATH = path.resolve('../ethereum-tests') /** * Default hardfork rules to run tests against */ -export const DEFAULT_FORK_CONFIG = 'Istanbul' +export const DEFAULT_FORK_CONFIG = 'London' /** * Tests which should be fixed From 275dfc884908592625abb2fc1d0631a2cbee2389 Mon Sep 17 00:00:00 2001 From: emersonmacro <77563348+emersonmacro@users.noreply.github.com> Date: Mon, 28 Feb 2022 03:05:57 -0800 Subject: [PATCH 11/44] Block: deprecation tasks (#1752) --- packages/block/src/header.ts | 16 ---------------- packages/block/src/types.ts | 21 --------------------- packages/block/test/eip1559block.spec.ts | 2 +- 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index 371cdbf10d0..d94170f28c3 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -56,15 +56,6 @@ export class BlockHeader { hash: undefined, } - /** - * Backwards compatible alias for {@link BlockHeader.logsBloom} - * (planned to be removed in next major release) - * @deprecated - */ - get bloom() { - return this.logsBloom - } - /** * EIP-4399: After merge to PoS, `mixHash` supplanted as `prevRandao` * @@ -88,11 +79,6 @@ export class BlockHeader { * @param opts */ public static fromHeaderData(headerData: HeaderData = {}, opts: BlockOptions = {}) { - if (headerData.logsBloom === undefined && headerData.bloom !== undefined) { - // backwards compatible alias for deprecated `bloom` key renamed to `logsBloom` - // (planned to be removed in next major release) - headerData.logsBloom = headerData.bloom - } const { parentHash, uncleHash, @@ -990,9 +976,7 @@ export class BlockHeader { } if (this._common.isActivatedEIP(1559)) { jsonDict.baseFeePerGas = '0x' + this.baseFeePerGas!.toString('hex') - jsonDict.baseFee = '0x' + this.baseFeePerGas!.toString('hex') // deprecated alias, please use `baseFeePerGas`, will be removed in next major release } - jsonDict.bloom = jsonDict.logsBloom // deprecated alias, please use `logsBloom`, will be removed in next major release return jsonDict } diff --git a/packages/block/src/types.ts b/packages/block/src/types.ts index 5302fc948a4..541866294a3 100644 --- a/packages/block/src/types.ts +++ b/packages/block/src/types.ts @@ -99,14 +99,6 @@ export interface HeaderData { mixHash?: BufferLike nonce?: BufferLike baseFeePerGas?: BNLike - - /* - * Backwards compatible alias for {@link HeaderData.logsBloom} - * Will only be used if {@link HeaderData.logsBloom} is undefined - * (planned to be removed in next major release) - * @deprecated - */ - bloom?: BufferLike } /** @@ -162,19 +154,6 @@ export interface JsonHeader { mixHash?: string nonce?: string baseFeePerGas?: string - - /* - * Backwards compatible alias for {@link JsonHeader.baseFeePerGas} - * (planned to be removed in next major release) - * @deprecated - */ - baseFee?: string - /* - * Backwards compatible alias for {@link JsonHeader.logsBloom} - * (planned to be removed in next major release) - * @deprecated - */ - bloom?: BufferLike } export interface Blockchain { diff --git a/packages/block/test/eip1559block.spec.ts b/packages/block/test/eip1559block.spec.ts index cbc3ddcd1a0..f6eb13f2e9e 100644 --- a/packages/block/test/eip1559block.spec.ts +++ b/packages/block/test/eip1559block.spec.ts @@ -491,7 +491,7 @@ tape('EIP1559 tests', function (t) { common, } ) - st.equal(header.toJSON().baseFee, '0x5') + st.equal(header.toJSON().baseFeePerGas, '0x5') st.end() }) }) From e6c5692976219ab3d0c1cfc90206ee403d5b196e Mon Sep 17 00:00:00 2001 From: emersonmacro <77563348+emersonmacro@users.noreply.github.com> Date: Tue, 1 Mar 2022 01:16:59 -0800 Subject: [PATCH 12/44] Common, Block: remove and rename ambiguous active methods (#1753) * common: rename hardforkIsActiveOnChain to isIncludedHardfork * common: remove activeHardfork and activeHardforks * common: adapt _getHardfork, remove isIncludedHardfork * common: type fixes in forkHash --- packages/block/src/header.ts | 12 ++-- packages/block/test/block.spec.ts | 2 +- packages/common/src/index.ts | 69 +++++----------------- packages/common/tests/hardforks.spec.ts | 76 ++++--------------------- packages/common/tests/mergePOS.spec.ts | 5 ++ packages/common/tests/params.spec.ts | 5 ++ packages/vm/src/runBlock.ts | 6 +- 7 files changed, 41 insertions(+), 134 deletions(-) diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index d94170f28c3..ca2d627831f 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -447,7 +447,7 @@ export class BlockHeader { ) throw new Error(msg) } - const hardfork = this._getHardfork() + const hardfork = this._common.hardfork() const blockTs = this.timestamp const { timestamp: parentTs, difficulty: parentDif } = parentBlockHeader const minimumDifficulty = new BN( @@ -570,7 +570,7 @@ export class BlockHeader { parentGasLimit = parentGasLimit.mul(elasticity) } const gasLimit = this.gasLimit - const hardfork = this._getHardfork() + const hardfork = this._common.hardfork() const a = parentGasLimit.div( new BN(this._common.paramByHardfork('gasConfig', 'gasLimitBoundDivisor', hardfork)) @@ -607,7 +607,7 @@ export class BlockHeader { if (this.isGenesis()) { return } - const hardfork = this._getHardfork() + const hardfork = this._common.hardfork() // Consensus type dependent checks if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Ethash) { // PoW/Ethash @@ -980,10 +980,6 @@ export class BlockHeader { return jsonDict } - private _getHardfork(): string { - return this._common.hardfork() || this._common.activeHardfork(this.number.toNumber()) - } - private async _getHeaderByHash( blockchain: Blockchain, hash: Buffer @@ -1005,7 +1001,7 @@ export class BlockHeader { * activation block (see: https://blog.slock.it/hard-fork-specification-24b889e70703) */ private _validateDAOExtraData() { - if (!this._common.hardforkIsActiveOnChain(Hardfork.Dao)) { + if (!this._common.hardforkIsActiveOnBlock(Hardfork.Dao, this.number)) { return } const DAOActivationBlock = this._common.hardforkBlock(Hardfork.Dao) diff --git a/packages/block/test/block.spec.ts b/packages/block/test/block.spec.ts index 9f1250d8fb9..bdc5eed4139 100644 --- a/packages/block/test/block.spec.ts +++ b/packages/block/test/block.spec.ts @@ -17,7 +17,7 @@ import util from 'util' tape('[Block]: block functions', function (t) { t.test('should test block initialization', function (st) { - const common = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Chainstart }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) const genesis = Block.genesis({}, { common }) st.ok(genesis.hash().toString('hex'), 'block should initialize') diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index 004171170fd..017857579d5 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -505,14 +505,14 @@ export default class Common extends EventEmitter { /** * Internal helper function, returns the params for the given hardfork for the chain set * @param hardfork Hardfork name - * @returns Dictionary with hardfork params + * @returns Dictionary with hardfork params or null if hardfork not on chain */ - _getHardfork(hardfork: string | Hardfork): any { + _getHardfork(hardfork: string | Hardfork): HardforkParams | null { const hfs = this.hardforks() for (const hf of hfs) { if (hf['name'] === hardfork) return hf } - throw new Error(`Hardfork ${hardfork} not defined for chain ${this.chainName()}`) + return null } /** @@ -620,14 +620,15 @@ export default class Common extends EventEmitter { } /** - * Returns a parameter for the hardfork active on block number + * Returns a parameter for the hardfork active on block number or + * optional provided total difficulty (Merge HF) * @param topic Parameter topic * @param name Parameter name * @param blockNumber Block number + * @param td Total difficulty */ - paramByBlock(topic: string, name: string, blockNumber: BNLike): any { - const activeHfs = this.activeHardforks(blockNumber) - const hardfork = activeHfs[activeHfs.length - 1]['name'] + paramByBlock(topic: string, name: string, blockNumber: BNLike, td?: BNLike): any { + const hardfork = this.getHardforkByBlockNumber(blockNumber, td) return this.paramByHardfork(topic, name, hardfork) } @@ -711,50 +712,6 @@ export default class Common extends EventEmitter { return this.hardforkGteHardfork(null, hardfork) } - /** - * Checks if given or set hardfork is active on the chain - * @param hardfork Hardfork name, optional if HF set - * @returns True if hardfork is active on the chain - */ - hardforkIsActiveOnChain(hardfork?: string | Hardfork | null): boolean { - hardfork = hardfork ?? this._hardfork - for (const hf of this.hardforks()) { - if (hf['name'] === hardfork && hf['block'] !== null) return true - } - return false - } - - /** - * Returns the active hardfork switches for the current chain - * @param blockNumber up to block if provided, otherwise for the whole chain - * @return Array with hardfork arrays - */ - activeHardforks(blockNumber?: BNLike | null): HardforkParams[] { - const activeHardforks: HardforkParams[] = [] - const hfs = this.hardforks() - for (const hf of hfs) { - if (hf['block'] === null) continue - if (blockNumber !== undefined && blockNumber !== null && blockNumber < hf['block']) break - - activeHardforks.push(hf) - } - return activeHardforks - } - - /** - * Returns the latest active hardfork name for chain or block or throws if unavailable - * @param blockNumber up to block if provided, otherwise for the whole chain - * @return Hardfork name - */ - activeHardfork(blockNumber?: BNLike | null): string { - const activeHardforks = this.activeHardforks(blockNumber) - if (activeHardforks.length > 0) { - return activeHardforks[activeHardforks.length - 1]['name'] - } else { - throw new Error(`No (supported) active hardfork found`) - } - } - /** * Returns the hardfork change block for hardfork provided or set * @param hardfork Hardfork name, optional if HF set @@ -762,7 +719,7 @@ export default class Common extends EventEmitter { */ hardforkBlock(hardfork?: string | Hardfork): BN | null { hardfork = hardfork ?? this._hardfork - const block = this._getHardfork(hardfork)['block'] + const block = this._getHardfork(hardfork)?.['block'] if (block === undefined || block === null) { return null } @@ -776,7 +733,7 @@ export default class Common extends EventEmitter { */ hardforkTD(hardfork?: string | Hardfork): BN | null { hardfork = hardfork ?? this._hardfork - const td = this._getHardfork(hardfork)['td'] + const td = this._getHardfork(hardfork)?.['td'] if (td === undefined || td === null) { return null } @@ -869,14 +826,14 @@ export default class Common extends EventEmitter { * Returns an eth/64 compliant fork hash (EIP-2124) * @param hardfork Hardfork name, optional if HF set */ - forkHash(hardfork?: string | Hardfork) { + forkHash(hardfork?: string | Hardfork): string { hardfork = hardfork ?? this._hardfork const data = this._getHardfork(hardfork) - if (data['block'] === null && data['td'] === undefined) { + if (data === null || (data?.['block'] === null && data?.['td'] === undefined)) { const msg = 'No fork hash calculation possible for future hardfork' throw new Error(msg) } - if (data['forkHash'] !== undefined) { + if (data?.['forkHash'] !== null && data?.['forkHash'] !== undefined) { return data['forkHash'] } return this._calcForkHash(hardfork) diff --git a/packages/common/tests/hardforks.spec.ts b/packages/common/tests/hardforks.spec.ts index a7af1e906b8..9894a5fb338 100644 --- a/packages/common/tests/hardforks.spec.ts +++ b/packages/common/tests/hardforks.spec.ts @@ -75,6 +75,9 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { let msg = 'should return the correct HF change block for byzantium (provided)' st.ok(c.hardforkBlock(Hardfork.Byzantium)!.eqn(1700000), msg) + msg = 'should return null if HF does not exist on chain' + st.equal(c.hardforkBlock('thisHardforkDoesNotExist'), null, msg) + c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) msg = 'should return the correct HF change block for byzantium (set)' st.ok(c.hardforkBlock()!.eqn(1700000), msg) @@ -150,50 +153,6 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { st.end() }) - t.test('activeHardforks()', function (st: tape.Test) { - let c = new Common({ chain: Chain.Ropsten }) - let msg = 'should return correct number of active hardforks for Ropsten' - st.equal(c.activeHardforks().length, 11, msg) - - msg = 'should return the correct HF data for Ropsten' - st.equal(c.activeHardforks()[3]['name'], Hardfork.SpuriousDragon, msg) - - msg = 'should return 3 active hardforks for Ropsten up to block 9' - st.equal(c.activeHardforks(9).length, 3, msg) - - msg = 'should return 4 active hardforks for Ropsten up to block 10' - st.equal(c.activeHardforks(10).length, 4, msg) - - c = new Common({ chain: Chain.Mainnet }) - msg = 'should return correct number of active HFs for mainnet' - st.equal(c.activeHardforks().length, 13, msg) - - c = new Common({ chain: Chain.Rinkeby }) - msg = 'should return correct number of active HFs for rinkeby' - st.equal(c.activeHardforks().length, 10, msg) - - c = new Common({ chain: Chain.Goerli }) - msg = 'should return correct number of active HFs for goerli' - st.equal(c.activeHardforks().length, 10, msg) - - st.end() - }) - - t.test('activeHardfork()', function (st: tape.Test) { - let c = new Common({ chain: Chain.Ropsten }) - let msg = 'should return correct latest active HF for Ropsten' - st.equal(c.activeHardfork(), Hardfork.London, msg) - - msg = 'should return spuriousDragon as latest active HF for Ropsten for block 10' - st.equal(c.activeHardfork(10), Hardfork.SpuriousDragon, msg) - - c = new Common({ chain: Chain.Rinkeby }) - msg = 'should return correct latest active HF for Rinkeby' - st.equal(c.activeHardfork(), Hardfork.London, msg) - - st.end() - }) - t.test('hardforkIsActiveOnBlock() / activeOnBlock()', function (st: tape.Test) { let c = new Common({ chain: Chain.Ropsten }) let msg = 'Ropsten, byzantium (provided), 1700000 -> true' @@ -276,27 +235,6 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { st.end() }) - t.test('hardforkIsActiveOnChain()', function (st: tape.Test) { - let c = new Common({ chain: Chain.Ropsten }) - let msg = 'should return true for byzantium (provided) on Ropsten' - st.equal(c.hardforkIsActiveOnChain(Hardfork.Byzantium), true, msg) - - msg = 'should return false for dao (provided) on Ropsten' - st.equal(c.hardforkIsActiveOnChain(Hardfork.Dao), false, msg) - - msg = 'should return true for petersburg (provided) on Ropsten' - st.equal(c.hardforkIsActiveOnChain(Hardfork.Petersburg), true, msg) - - msg = 'should return false for a non-existing HF (provided) on Ropsten' - st.equal(c.hardforkIsActiveOnChain('notexistinghardfork'), false, msg) - - c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) - msg = 'should return true for byzantium (set) on Ropsten' - st.equal(c.hardforkIsActiveOnChain(), true, msg) - - st.end() - }) - t.test('_calcForkHash()', function (st: tape.Test) { let c = new Common({ chain: Chain.Mainnet }) let msg = 'should calc correctly for chainstart (only genesis)' @@ -333,12 +271,18 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { st.equal(c.forkHash(Hardfork.SpuriousDragon), '0x3edd5b10', msg) c = new Common({ chain: Chain.Kovan }) - const f = () => { + let f = () => { c.forkHash(Hardfork.Merge) } msg = 'should throw when called on non-applied or future HF' st.throws(f, /No fork hash calculation possible/, msg) + f = () => { + c.forkHash('thisHardforkDoesNotExist') + } + msg = 'should throw when called with a HF that does not exist on chain' + st.throws(f, /No fork hash calculation possible/, msg) + st.end() }) diff --git a/packages/common/tests/mergePOS.spec.ts b/packages/common/tests/mergePOS.spec.ts index 9e092aa28c9..ac42cd774c3 100644 --- a/packages/common/tests/mergePOS.spec.ts +++ b/packages/common/tests/mergePOS.spec.ts @@ -8,6 +8,11 @@ tape('[Common]: Merge/POS specific logic', function (t: tape.Test) { const customChains = [testnetMerge] const c = new Common({ chain: 'testnetMerge', hardfork: Hardfork.Istanbul, customChains }) st.ok(c.hardforkTD(Hardfork.Merge)?.eqn(5000), 'should get the HF total difficulty') + st.equal( + c.hardforkTD('thisHardforkDoesNotExist'), + null, + 'should return null if HF does not exist on chain' + ) st.end() }) diff --git a/packages/common/tests/params.spec.ts b/packages/common/tests/params.spec.ts index 8aa81eaefc0..f060ea052d0 100644 --- a/packages/common/tests/params.spec.ts +++ b/packages/common/tests/params.spec.ts @@ -1,5 +1,6 @@ import tape from 'tape' import Common, { Chain, Hardfork } from '../src/' +import { BN } from 'ethereumjs-util' tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: tape.Test) { t.test('Basic usage', function (st: tape.Test) { @@ -72,6 +73,10 @@ tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: t msg = 'Should correctly translate block numbers into HF states (original value)' st.equal(c.paramByBlock('pow', 'minerReward', 4369999), '5000000000000000000', msg) + msg = 'Should correctly translate total difficulty into HF states' + const td = new BN('1196768507891266117779') + st.equal(c.paramByBlock('pow', 'minerReward', 4370000, td), '3000000000000000000', msg) + st.comment('-----------------------------------------------------------------') st.end() }) diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index 2e12057fb09..ef9c6d3a87e 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -2,7 +2,7 @@ import { debug as createDebugLogger } from 'debug' import { BaseTrie as Trie } from 'merkle-patricia-tree' import { Account, Address, bigIntToBN, BN, bnToBigInt, intToBuffer, rlp } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' -import { ConsensusType } from '@ethereumjs/common' +import { ConsensusType, Hardfork } from '@ethereumjs/common' import VM from './index' import Bloom from './bloom' import { StateManager } from './state' @@ -143,8 +143,8 @@ export default async function runBlock(this: VM, opts: RunBlockOpts): Promise Date: Fri, 4 Mar 2022 14:43:17 -0700 Subject: [PATCH 13/44] vm: reintroduce modifyAccountFields (#1763) * add modifyAccountFields method and tests * use new method in eei * update usage in various tests --- packages/client/test/miner/miner.spec.ts | 3 +- .../client/test/miner/pendingBlock.spec.ts | 3 +- packages/vm/src/evm/eei.ts | 6 +- packages/vm/src/state/interface.ts | 3 + packages/vm/src/state/stateManager.ts | 22 +++++- .../tests/api/EIPs/eip-1559-FeeMarket.spec.ts | 18 ++--- .../tests/api/EIPs/eip-3198-BaseFee.spec.ts | 4 +- .../vm/tests/api/state/stateManager.spec.ts | 78 +++++++++++++++++++ 8 files changed, 110 insertions(+), 27 deletions(-) diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index 01b16f78ba1..dc28caff101 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -29,9 +29,8 @@ const B = { } const setBalance = async (stateManager: StateManager, address: Address, balance: BN) => { - // this fn can be replaced with modifyAccountFields() when #1369 is available await stateManager.checkpoint() - await stateManager.putAccount(address, new Account(new BN(0), balance)) + await stateManager.modifyAccountFields(address, { balance }) await stateManager.commit() } diff --git a/packages/client/test/miner/pendingBlock.spec.ts b/packages/client/test/miner/pendingBlock.spec.ts index a1f57142e5b..5209f3e7798 100644 --- a/packages/client/test/miner/pendingBlock.spec.ts +++ b/packages/client/test/miner/pendingBlock.spec.ts @@ -27,9 +27,8 @@ const B = { } const setBalance = async (stateManager: StateManager, address: Address, balance: BN) => { - // this fn can be replaced with modifyAccountFields() when #1369 is available await stateManager.checkpoint() - await stateManager.putAccount(address, new Account(new BN(0), balance)) + await stateManager.modifyAccountFields(address, { balance }) await stateManager.commit() } diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index a3d713f6159..7b7f0d6623b 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -452,9 +452,9 @@ export default class EEI { await this._state.putAccount(toAddress, toAccount) // Subtract from contract balance - const account = await this._state.getAccount(this._env.address) - account.balance = new BN(0) - await this._state.putAccount(this._env.address, account) + await this._state.modifyAccountFields(this._env.address, { + balance: new BN(0), + }) trap(ERROR.STOP) } diff --git a/packages/vm/src/state/interface.ts b/packages/vm/src/state/interface.ts index 1e9179a5148..353e7f5d649 100644 --- a/packages/vm/src/state/interface.ts +++ b/packages/vm/src/state/interface.ts @@ -9,12 +9,15 @@ export interface StorageDump { [key: string]: string } +export type AccountFields = Partial> + export interface StateManager { copy(): StateManager getAccount(address: Address): Promise putAccount(address: Address, account: Account): Promise deleteAccount(address: Address): Promise touchAccount(address: Address): void + modifyAccountFields(address: Address, accountFields: AccountFields): Promise putContractCode(address: Address, value: Buffer): Promise getContractCode(address: Address): Promise getContractStorage(address: Address, key: Buffer): Promise diff --git a/packages/vm/src/state/stateManager.ts b/packages/vm/src/state/stateManager.ts index 29a5e317c6a..8bf18d04a20 100644 --- a/packages/vm/src/state/stateManager.ts +++ b/packages/vm/src/state/stateManager.ts @@ -15,7 +15,7 @@ import { setLengthLeft, } from 'ethereumjs-util' import Common from '@ethereumjs/common' -import { StateManager, StorageDump } from './interface' +import { StateManager, StorageDump, AccountFields } from './interface' import Cache, { getCb, putCb } from './cache' import { BaseStateManager } from './' import { short } from '../evm/opcodes' @@ -132,12 +132,10 @@ export default class DefaultStateManager extends BaseStateManager implements Sta const key = Buffer.concat([CODEHASH_PREFIX, codeHash]) await this._trie.db.put(key, value) - const account = await this.getAccount(address) if (this.DEBUG) { this._debug(`Update codeHash (-> ${short(codeHash)}) for account ${address}`) } - account.codeHash = codeHash - await this.putAccount(address, account) + await this.modifyAccountFields(address, { codeHash }) } /** @@ -513,4 +511,20 @@ export default class DefaultStateManager extends BaseStateManager implements Sta } return false } + + /** + * Gets the account associated with `address`, modifies the given account + * fields, then saves the account into state. Account fields can include + * `nonce`, `balance`, `stateRoot`, and `codeHash`. + * @param address - Address of the account to modify + * @param accountFields - Object containing account fields and values to modify + */ + async modifyAccountFields(address: Address, accountFields: AccountFields): Promise { + const account = await this.getAccount(address) + account.nonce = accountFields.nonce ?? account.nonce + account.balance = accountFields.balance ?? account.balance + account.stateRoot = accountFields.stateRoot ?? account.stateRoot + account.codeHash = accountFields.codeHash ?? account.codeHash + await this.putAccount(address, account) + } } diff --git a/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts b/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts index 82d855fe498..756653fcea2 100644 --- a/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts @@ -109,11 +109,8 @@ tape('EIP1559 tests', (t) => { { common } ) const block2 = makeBlock(GWEI, tx2, 1) - account = await vm.stateManager.getAccount(sender) - account.balance = balance - await vm.stateManager.putAccount(sender, account) - miner.balance = new BN(0) - await vm.stateManager.putAccount(coinbase, miner) + await vm.stateManager.modifyAccountFields(sender, { balance }) + await vm.stateManager.modifyAccountFields(coinbase, { balance: new BN(0) }) const results2 = await vm.runTx({ tx: block2.transactions[0], block: block2, @@ -140,11 +137,8 @@ tape('EIP1559 tests', (t) => { { common } ) const block3 = makeBlock(GWEI, tx3, 0) - account = await vm.stateManager.getAccount(sender) - account.balance = balance - await vm.stateManager.putAccount(sender, account) - miner.balance = new BN(0) - await vm.stateManager.putAccount(coinbase, miner) + await vm.stateManager.modifyAccountFields(sender, { balance }) + await vm.stateManager.modifyAccountFields(coinbase, { balance: new BN(0) }) const results3 = await vm.runTx({ tx: block3.transactions[0], block: block3, @@ -180,10 +174,8 @@ tape('EIP1559 tests', (t) => { ) const block = makeBlock(GWEI, tx, 2) const vm = new VM({ common }) - const account = await vm.stateManager.getAccount(sender) const balance = GWEI.muln(210000).muln(10) - account.balance = balance - await vm.stateManager.putAccount(sender, account) + await vm.stateManager.modifyAccountFields(sender, { balance }) /** * GASPRICE diff --git a/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts b/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts index 2e6bffcd847..46d10333cb8 100644 --- a/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts @@ -74,9 +74,7 @@ tape('EIP3198 tests', (t) => { ) const block = makeBlock(fee, tx, 2) const vm = new VM({ common }) - const account = await vm.stateManager.getAccount(sender) - account.balance = ETHER - await vm.stateManager.putAccount(sender, account) + await vm.stateManager.modifyAccountFields(sender, { balance: ETHER }) // Track stack diff --git a/packages/vm/tests/api/state/stateManager.spec.ts b/packages/vm/tests/api/state/stateManager.spec.ts index bdc2fc02838..8eacb1ad72e 100644 --- a/packages/vm/tests/api/state/stateManager.spec.ts +++ b/packages/vm/tests/api/state/stateManager.spec.ts @@ -168,6 +168,84 @@ tape('StateManager', (t) => { st.end() } ) + + t.test('should modify account fields correctly', async (st) => { + const stateManager = new DefaultStateManager() + const account = createAccount() + const address = new Address(Buffer.from('a94f5374fce5edbc8e2a8697c15331677e6ebf0b', 'hex')) + await stateManager.putAccount(address, account) + + await stateManager.modifyAccountFields(address, { balance: new BN(1234) }) + + const res1 = await stateManager.getAccount(address) + + st.equal(res1.balance.toString('hex'), '4d2') + + await stateManager.modifyAccountFields(address, { nonce: new BN(1) }) + + const res2 = await stateManager.getAccount(address) + + st.equal(res2.nonce.toNumber(), 1) + + await stateManager.modifyAccountFields(address, { + codeHash: Buffer.from( + 'd748bf26ab37599c944babfdbeecf6690801bd61bf2670efb0a34adfc6dca10b', + 'hex' + ), + stateRoot: Buffer.from( + 'cafd881ab193703b83816c49ff6c2bf6ba6f464a1be560c42106128c8dbc35e7', + 'hex' + ), + }) + + const res3 = await stateManager.getAccount(address) + + st.equal( + res3.codeHash.toString('hex'), + 'd748bf26ab37599c944babfdbeecf6690801bd61bf2670efb0a34adfc6dca10b' + ) + st.equal( + res3.stateRoot.toString('hex'), + 'cafd881ab193703b83816c49ff6c2bf6ba6f464a1be560c42106128c8dbc35e7' + ) + + st.end() + }) + + t.test( + 'should modify account fields correctly on previously non-existent account', + async (st) => { + const stateManager = new DefaultStateManager() + const address = new Address(Buffer.from('a94f5374fce5edbc8e2a8697c15331677e6ebf0b', 'hex')) + + await stateManager.modifyAccountFields(address, { balance: new BN(1234) }) + const res1 = await stateManager.getAccount(address) + st.equal(res1.balance.toString('hex'), '4d2') + + await stateManager.modifyAccountFields(address, { nonce: new BN(1) }) + const res2 = await stateManager.getAccount(address) + st.equal(res2.nonce.toNumber(), 1) + + const newCodeHash = Buffer.from( + 'd748bf26ab37599c944babfdbeecf6690801bd61bf2670efb0a34adfc6dca10b', + 'hex' + ) + const newStateRoot = Buffer.from( + 'cafd881ab193703b83816c49ff6c2bf6ba6f464a1be560c42106128c8dbc35e7', + 'hex' + ) + await stateManager.modifyAccountFields(address, { + codeHash: newCodeHash, + stateRoot: newStateRoot, + }) + + const res3 = await stateManager.getAccount(address) + st.ok(res3.codeHash.equals(newCodeHash)) + st.ok(res3.stateRoot.equals(newStateRoot)) + st.end() + } + ) + t.test( 'should generate the genesis state root correctly for mainnet from ethereum/tests data', async (st) => { From 90ff2028350e2ca0a01af0e3b4b10c1e3b279bac Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Sat, 5 Mar 2022 09:51:13 +0100 Subject: [PATCH 14/44] Develop Rebase Fixes (2022-03-05) --- packages/vm/src/index.ts | 2 ++ packages/vm/tests/api/index.spec.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index 841fae5d2f9..e1682cfe72c 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -293,6 +293,8 @@ export default class VM extends AsyncEventEmitter { Hardfork.Berlin, Hardfork.London, Hardfork.ArrowGlacier, + Hardfork.PreMerge, + Hardfork.Merge, ] if (!supportedHardforks.includes(this._common.hardfork() as Hardfork)) { throw new Error( diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index 00e2b22968e..36306ec8a6d 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -67,7 +67,7 @@ tape('VM -> basic instantiation / boolean switches', (t) => { tape('VM -> supportedHardforks', (t) => { t.test('should throw when common is set to an unsupported hardfork', async (st) => { - const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Merge }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Shanghai }) try { await VM.create({ common }) st.fail('should have failed for unsupported hardfork') From df169ff1649f44f88832dd7c4212afcc999935c7 Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Sat, 5 Mar 2022 09:51:44 +0100 Subject: [PATCH 15/44] Monorepo: Rebuild package-lock.json --- package-lock.json | 1602 +++++++++++++++++++++------------------------ 1 file changed, 764 insertions(+), 838 deletions(-) diff --git a/package-lock.json b/package-lock.json index 10d632c72f0..7f4778f73a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,27 +51,27 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", - "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.0.tgz", + "integrity": "sha512-392byTlpGWXMv4FbyWw3sAZ/FrW/DrwqLGXpy0mbyNe9Taqv1mg9yON5/o0cnr8XYCkFTZbC1eV+c+LAROgrng==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz", - "integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==", + "version": "7.17.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.5.tgz", + "integrity": "sha512-/BBMw4EvjmyquN5O+t5eh0+YqB3XXJkYD2cjKpYtWOfFy4lQ4UozNSmxAcWT8r2XtZs0ewG+zrfsqeR15i1ajA==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.7", - "@babel/helper-compilation-targets": "^7.17.7", - "@babel/helper-module-transforms": "^7.17.7", - "@babel/helpers": "^7.17.8", - "@babel/parser": "^7.17.8", + "@babel/generator": "^7.17.3", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.17.2", + "@babel/parser": "^7.17.3", "@babel/template": "^7.16.7", "@babel/traverse": "^7.17.3", "@babel/types": "^7.17.0", @@ -90,9 +90,9 @@ } }, "node_modules/@babel/generator": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.3.tgz", + "integrity": "sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg==", "dev": true, "dependencies": { "@babel/types": "^7.17.0", @@ -104,12 +104,12 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", - "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.17.7", + "@babel/compat-data": "^7.16.4", "@babel/helper-validator-option": "^7.16.7", "browserslist": "^4.17.5", "semver": "^6.3.0" @@ -184,14 +184,14 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", - "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", + "version": "7.17.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.6.tgz", + "integrity": "sha512-2ULmRdqoOMpdvkbT8jONrZML/XALfzxlb052bldftkicAUy8AxSCkD5trDPQcwHNmolcl7wP6ehNqMlyUw6AaA==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-simple-access": "^7.16.7", "@babel/helper-split-export-declaration": "^7.16.7", "@babel/helper-validator-identifier": "^7.16.7", "@babel/template": "^7.16.7", @@ -212,12 +212,12 @@ } }, "node_modules/@babel/helper-simple-access": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", - "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", "dev": true, "dependencies": { - "@babel/types": "^7.17.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -266,13 +266,13 @@ } }, "node_modules/@babel/helpers": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.8.tgz", - "integrity": "sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw==", + "version": "7.17.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.2.tgz", + "integrity": "sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ==", "dev": true, "dependencies": { "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", + "@babel/traverse": "^7.17.0", "@babel/types": "^7.17.0" }, "engines": { @@ -356,9 +356,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", - "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==", + "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.3.tgz", + "integrity": "sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -432,9 +432,9 @@ } }, "node_modules/@chainsafe/libp2p-noise": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.1.2.tgz", - "integrity": "sha512-UvZLWvIS7bAz6M8XfsnC/NhT1c/lg8NNsME1hTvo21kRwyxNFpB8gEhId03Cb5B23oIaHhMySAHBcpuMiSxQ2w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.1.1.tgz", + "integrity": "sha512-/Fz86sZmnvRSf7FHxMPifzakxx9xK4KVYx6yi35KPZughop9ivJslUSCLhx/UqDHiuj3h9i04pVXET6nIjSJyQ==", "dependencies": { "@stablelib/chacha20poly1305": "^1.0.1", "@stablelib/hkdf": "^1.0.1", @@ -537,9 +537,9 @@ } }, "node_modules/@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", + "integrity": "sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==", "dev": true, "engines": { "node": ">=10.0.0" @@ -578,9 +578,9 @@ "link": true }, "node_modules/@ethersproject/abi": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.0.tgz", - "integrity": "sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz", + "integrity": "sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w==", "dev": true, "funding": [ { @@ -593,21 +593,21 @@ } ], "dependencies": { - "@ethersproject/address": "^5.6.0", - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/constants": "^5.6.0", - "@ethersproject/hash": "^5.6.0", - "@ethersproject/keccak256": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.0" + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/hash": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" } }, "node_modules/@ethersproject/abstract-provider": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz", - "integrity": "sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz", + "integrity": "sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg==", "dev": true, "funding": [ { @@ -620,19 +620,19 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/networks": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/transactions": "^5.6.0", - "@ethersproject/web": "^5.6.0" + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/networks": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/transactions": "^5.5.0", + "@ethersproject/web": "^5.5.0" } }, "node_modules/@ethersproject/abstract-signer": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz", - "integrity": "sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz", + "integrity": "sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA==", "dev": true, "funding": [ { @@ -645,17 +645,17 @@ } ], "dependencies": { - "@ethersproject/abstract-provider": "^5.6.0", - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0" + "@ethersproject/abstract-provider": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0" } }, "node_modules/@ethersproject/address": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.0.tgz", - "integrity": "sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.5.0.tgz", + "integrity": "sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw==", "dev": true, "funding": [ { @@ -668,17 +668,17 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/keccak256": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/rlp": "^5.6.0" + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/rlp": "^5.5.0" } }, "node_modules/@ethersproject/base64": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.0.tgz", - "integrity": "sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.5.0.tgz", + "integrity": "sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA==", "dev": true, "funding": [ { @@ -691,13 +691,13 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.0" + "@ethersproject/bytes": "^5.5.0" } }, "node_modules/@ethersproject/bignumber": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.0.tgz", - "integrity": "sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", "dev": true, "funding": [ { @@ -710,8 +710,8 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", "bn.js": "^4.11.9" } }, @@ -722,9 +722,9 @@ "dev": true }, "node_modules/@ethersproject/bytes": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.0.tgz", - "integrity": "sha512-3hJPlYemb9V4VLfJF5BfN0+55vltPZSHU3QKUyP9M3Y2TcajbiRrz65UG+xVHOzBereB1b9mn7r12o177xgN7w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", "dev": true, "funding": [ { @@ -737,13 +737,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.5.0" } }, "node_modules/@ethersproject/constants": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.0.tgz", - "integrity": "sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", "dev": true, "funding": [ { @@ -756,13 +756,13 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.6.0" + "@ethersproject/bignumber": "^5.5.0" } }, "node_modules/@ethersproject/hash": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.0.tgz", - "integrity": "sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.5.0.tgz", + "integrity": "sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg==", "dev": true, "funding": [ { @@ -775,20 +775,20 @@ } ], "dependencies": { - "@ethersproject/abstract-signer": "^5.6.0", - "@ethersproject/address": "^5.6.0", - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/keccak256": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.0" + "@ethersproject/abstract-signer": "^5.5.0", + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" } }, "node_modules/@ethersproject/keccak256": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.0.tgz", - "integrity": "sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.5.0.tgz", + "integrity": "sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg==", "dev": true, "funding": [ { @@ -801,14 +801,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.0", + "@ethersproject/bytes": "^5.5.0", "js-sha3": "0.8.0" } }, "node_modules/@ethersproject/logger": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", - "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==", "dev": true, "funding": [ { @@ -822,9 +822,9 @@ ] }, "node_modules/@ethersproject/networks": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.0.tgz", - "integrity": "sha512-DaVzgyThzHgSDLuURhvkp4oviGoGe9iTZW4jMEORHDRCgSZ9K9THGFKqL+qGXqPAYLEgZTf5z2w56mRrPR1MjQ==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.5.2.tgz", + "integrity": "sha512-NEqPxbGBfy6O3x4ZTISb90SjEDkWYDUbEeIFhJly0F7sZjoQMnj5KYzMSkMkLKZ+1fGpx00EDpHQCy6PrDupkQ==", "dev": true, "funding": [ { @@ -837,13 +837,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.5.0" } }, "node_modules/@ethersproject/properties": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", - "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", "dev": true, "funding": [ { @@ -856,13 +856,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.5.0" } }, "node_modules/@ethersproject/rlp": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.0.tgz", - "integrity": "sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.5.0.tgz", + "integrity": "sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA==", "dev": true, "funding": [ { @@ -875,14 +875,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0" } }, "node_modules/@ethersproject/signing-key": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.0.tgz", - "integrity": "sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.5.0.tgz", + "integrity": "sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng==", "dev": true, "funding": [ { @@ -895,9 +895,9 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", "bn.js": "^4.11.9", "elliptic": "6.5.4", "hash.js": "1.1.7" @@ -910,9 +910,9 @@ "dev": true }, "node_modules/@ethersproject/strings": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.0.tgz", - "integrity": "sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", + "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", "dev": true, "funding": [ { @@ -925,15 +925,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/constants": "^5.6.0", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" } }, "node_modules/@ethersproject/transactions": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.0.tgz", - "integrity": "sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.5.0.tgz", + "integrity": "sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA==", "dev": true, "funding": [ { @@ -946,21 +946,21 @@ } ], "dependencies": { - "@ethersproject/address": "^5.6.0", - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/constants": "^5.6.0", - "@ethersproject/keccak256": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/rlp": "^5.6.0", - "@ethersproject/signing-key": "^5.6.0" + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/rlp": "^5.5.0", + "@ethersproject/signing-key": "^5.5.0" } }, "node_modules/@ethersproject/web": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.0.tgz", - "integrity": "sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.1.tgz", + "integrity": "sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg==", "dev": true, "funding": [ { @@ -973,11 +973,11 @@ } ], "dependencies": { - "@ethersproject/base64": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.0" + "@ethersproject/base64": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" } }, "node_modules/@istanbuljs/load-nyc-config": { @@ -1076,6 +1076,11 @@ } ] }, + "node_modules/@noble/hashes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.0.0.tgz", + "integrity": "sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg==" + }, "node_modules/@noble/secp256k1": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.5.5.tgz", @@ -1176,6 +1181,48 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, + "node_modules/@scure/base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.0.0.tgz", + "integrity": "sha512-gIVaYhUsy+9s58m/ETjSJVKHhKTBMmcRb9cEV5/5dwvfDlfORjKrFsDeDHWRrm6RjcPvCLZFwGJjAjLj1gg4HA==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/@scure/bip32": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.0.1.tgz", + "integrity": "sha512-AU88KKTpQ+YpTLoicZ/qhFhRRIo96/tlb+8YmDDHR9yiKVjSsFZiefJO4wjS2PMTkz5/oIcw84uAq/8pleQURA==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "~1.0.0", + "@noble/secp256k1": "~1.5.2", + "@scure/base": "~1.0.0" + } + }, + "node_modules/@scure/bip39": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.0.0.tgz", + "integrity": "sha512-HrtcikLbd58PWOkl02k9V6nXWQyoa7A0+Ek9VF7z17DDk9XZAFUcIdqfh0jJXLypmizc5/8P6OxoUeKliiWv4w==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "~1.0.0", + "@scure/base": "~1.0.0" + } + }, "node_modules/@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -1371,12 +1418,6 @@ "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", "integrity": "sha512-q5veSX6zjUy/DlDhR4Y4cU0k2Ar+DT2LUraP00T19WLmTO6Se1djepCCaqU6nQrwcJ5Hyo/CWqxTzrrFg8eqbQ==" }, - "node_modules/@types/assert": { - "version": "1.5.6", - "resolved": "https://registry.npmjs.org/@types/assert/-/assert-1.5.6.tgz", - "integrity": "sha512-Y7gDJiIqb9qKUHfBQYOWGngUpLORtirAVPuj/CWJrU2C6ZM4/y3XLwuwfGMF8s7QzW746LQZx23m0+1FSgjfug==", - "dev": true - }, "node_modules/@types/async": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@types/async/-/async-2.4.2.tgz", @@ -1401,6 +1442,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -1527,9 +1569,9 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.10.tgz", - "integrity": "sha512-BLO9bBq59vW3fxCpD4o0N4U+DXsvwvIcl+jofw0frQo/GrBFC+/jRZj1E7kgp6dvTyNmA4y6JCV5Id/r3mNP5A==", + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, "node_modules/@types/jwt-simple": { @@ -1571,9 +1613,9 @@ } }, "node_modules/@types/lodash": { - "version": "4.14.180", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.180.tgz", - "integrity": "sha512-XOKXa1KIxtNXgASAnwj7cnttJxS4fksBRywK/9LzRV5YxrF80BXZIGeQSuoESQ/VkUj30Ae0+YcuHc15wJCB2g==" + "version": "4.14.179", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.179.tgz", + "integrity": "sha512-uwc1x90yCKqGcIOAT6DwOSuxnrAbpkdPsUOZtwrXb4D/6wZs+6qG7QnIawDuZWg0sWpxl+ltIKCaLoMlna678w==" }, "node_modules/@types/long": { "version": "4.0.1", @@ -1622,14 +1664,6 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, - "node_modules/@types/pbkdf2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", @@ -1649,6 +1683,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -1664,9 +1699,9 @@ } }, "node_modules/@types/supertest": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.12.tgz", - "integrity": "sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.11.tgz", + "integrity": "sha512-uci4Esokrw9qGb9bvhhSVEjd6rkny/dk5PK/Qz4yxKiyppEI+dOPlNrZBahE3i+PoKFYyDxChVXZ/ysS/nrm1Q==", "dev": true, "dependencies": { "@types/superagent": "*" @@ -2046,18 +2081,6 @@ "typedarray-to-buffer": "~3.1.5" } }, - "node_modules/@verdaccio/local-storage/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, "node_modules/@verdaccio/readme": { "version": "9.7.5", "resolved": "https://registry.npmjs.org/@verdaccio/readme/-/readme-9.7.5.tgz", @@ -2556,9 +2579,9 @@ } }, "node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true, "engines": { "node": ">=6" @@ -3025,14 +3048,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "node_modules/base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, "node_modules/base32.js": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/base32.js/-/base32.js-0.1.0.tgz", @@ -3110,6 +3125,25 @@ "node": "*" } }, + "node_modules/bigint-crypto-utils": { + "version": "3.0.23", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.0.23.tgz", + "integrity": "sha512-ecCXGRhpfm6gOMlNymoojOXnASyx8lwk3Z8f76lANPAnR/rgo/OKVMajxN5TbfT/BaEfcBXskpIUiRz8HPDKoQ==", + "dependencies": { + "bigint-mod-arith": "^3.0.1" + }, + "engines": { + "node": ">=10.4.0" + } + }, + "node_modules/bigint-mod-arith": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bigint-mod-arith/-/bigint-mod-arith-3.0.2.tgz", + "integrity": "sha512-tlhD4h/D1sv4pJfZzBesKOlfXRCQTeMMUrGbpc2PAawMAjb/S/OPAQfi667w6COt/UHOfvOW47sCSMaSEj4zIg==", + "engines": { + "node": ">=10.4.0" + } + }, "node_modules/bignumber.js": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", @@ -3177,9 +3211,9 @@ } }, "node_modules/blakejs": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", + "integrity": "sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg==" }, "node_modules/bn.js": { "version": "5.2.0", @@ -3343,6 +3377,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, "dependencies": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -3355,7 +3390,8 @@ "node_modules/browserify-aes/node_modules/buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true }, "node_modules/browserify-cipher": { "version": "1.0.1", @@ -3463,23 +3499,13 @@ } }, "node_modules/browserslist": { - "version": "4.20.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", - "integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==", + "version": "4.19.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.3.tgz", + "integrity": "sha512-XK3X4xtKJ+Txj8G5c30B4gsm71s69lqXlkYui4s6EkKxuv49qjYlY6oVd+IFJ73d4YymtM3+djvvt/R/iJwwDg==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - } - ], "dependencies": { - "caniuse-lite": "^1.0.30001317", - "electron-to-chromium": "^1.4.84", + "caniuse-lite": "^1.0.30001312", + "electron-to-chromium": "^1.4.71", "escalade": "^3.1.1", "node-releases": "^2.0.2", "picocolors": "^1.0.0" @@ -3489,24 +3515,10 @@ }, "engines": { "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", - "dependencies": { - "base-x": "^3.0.2" - } - }, - "node_modules/bs58check": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "dependencies": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" } }, "node_modules/buffer": { @@ -3678,20 +3690,14 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001319", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001319.tgz", - "integrity": "sha512-xjlIAFHucBRSMUo1kb5D4LYgcN1M45qdKP++lhqowDpwJwGkpIRTt5qQqnhxjj1vHcI7nrJxWhCC1ATrCEBTcw==", + "version": "1.0.30001313", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001313.tgz", + "integrity": "sha512-rI1UN0koZUiKINjysQDuRi2VeSCce3bYJNmDcj3PIKREiAmjakugBul1QSkg/fPrlULYl6oWfGg3PbgOSY9X4Q==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - } - ] + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } }, "node_modules/caseless": { "version": "0.12.0", @@ -3821,6 +3827,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -4405,6 +4412,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, "dependencies": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -4417,6 +4425,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, "dependencies": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -4752,9 +4761,9 @@ } }, "node_modules/date-format": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.6.tgz", - "integrity": "sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.4.tgz", + "integrity": "sha512-/jyf4rhB17ge328HJuJjAcmRtCsGd+NDeAtahRBTaK6vSPR6MO5HlrAit3Nn7dVjaa6sowW0WXt8yQtLyZQFRg==", "dev": true, "engines": { "node": ">=4.0" @@ -4782,9 +4791,9 @@ "dev": true }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dependencies": { "ms": "2.1.2" }, @@ -5294,9 +5303,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.90", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.90.tgz", - "integrity": "sha512-ZwKgSA0mQMyEhz+NR0F8dRzkrCLeHLzLkjx/CWf16+zV85hQ6meXPQbKanvhnpkYb7b2uJNj+enQJ/N877ND4Q==", + "version": "1.4.76", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.76.tgz", + "integrity": "sha512-3Vftv7cenJtQb+k00McEBZ2vVmZ/x+HEF7pcZONZIkOsESqAqVuACmBxMv0JhzX7u0YltU0vSqRqgBSTAhFUjA==", "dev": true }, "node_modules/elliptic": { @@ -5578,18 +5587,14 @@ } }, "node_modules/es5-ext": { - "version": "0.10.59", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.59.tgz", - "integrity": "sha512-cOgyhW0tIJyQY1Kfw6Kr0viu9ZlUctVchRMZ7R0HiH3dxTSp5zJDLecwxUqPUrGKMsgBI1wd1FL+d9Jxfi4cLw==", + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", "dev": true, - "hasInstallScript": true, "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" } }, "node_modules/es6-error": { @@ -6328,25 +6333,14 @@ } }, "node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.0.3.tgz", + "integrity": "sha512-NQLTW0x0CosoVb/n79x/TRHtfvS3hgNUPTUSCu0vM+9k6IIhHFFrAOJReneexjZsoZxMjJHnJn4lrE8EbnSyqQ==", "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" + "@noble/hashes": "1.0.0", + "@noble/secp256k1": "1.5.5", + "@scure/bip32": "1.0.1", + "@scure/bip39": "1.0.0" } }, "node_modules/ethereumjs-util": { @@ -6394,6 +6388,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, "dependencies": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" @@ -7587,6 +7582,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, "dependencies": { "inherits": "^2.0.4", "readable-stream": "^3.6.0", @@ -9328,9 +9324,9 @@ } }, "node_modules/jayson/node_modules/@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==" + "version": "12.20.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", + "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==" }, "node_modules/jayson/node_modules/commander": { "version": "2.20.3", @@ -9556,10 +9552,13 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, "bin": { "json5": "lib/cli.js" }, @@ -9823,9 +9822,9 @@ } }, "node_modules/karma-chrome-launcher": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.1.tgz", - "integrity": "sha512-hsIglcq1vtboGPAN+DGCISCFOxW+ZVnIqhDQcCMqqCp+4dmJ0Qpq5QAjkbA0X2L9Mi6OBkHi2Srrbmm7pUKkzQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz", + "integrity": "sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg==", "dev": true, "dependencies": { "which": "^1.2.1" @@ -10547,9 +10546,9 @@ } }, "node_modules/libp2p-bootstrap/node_modules/node-forge": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.0.tgz", - "integrity": "sha512-08ARB91bUi6zNKzVmaj3QO7cr397uiDT2nJ63cHjyNtCTWIgvS47j3eT0WfzUwS9+6Z5YshRaoasFkXCKrIYbA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.2.1.tgz", + "integrity": "sha512-Fcvtbb+zBcZXbTTVwqGA5W+MKBj56UjVRevvchv5XrcyXbmNdesfZL37nlcWOfpgHhgmxApw3tQbTr4CqNmX4w==", "engines": { "node": ">= 6.13.0" } @@ -11664,16 +11663,16 @@ "dev": true }, "node_modules/log4js": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.4.tgz", - "integrity": "sha512-ncaWPsuw9Vl1CKA406hVnJLGQKy1OHx6buk8J4rE2lVW+NW5Y82G5/DIloO7NkqLOUtNPEANaWC1kZYVjXssPw==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.2.tgz", + "integrity": "sha512-k80cggS2sZQLBwllpT1p06GtfvzMmSdUCkW96f0Hj83rKGJDAu2vZjt9B9ag2vx8Zz1IXzxoLgqvRJCdMKybGg==", "dev": true, "dependencies": { - "date-format": "^4.0.6", - "debug": "^4.3.4", + "date-format": "^4.0.4", + "debug": "^4.3.3", "flatted": "^3.2.5", "rfdc": "^1.3.0", - "streamroller": "^3.0.6" + "streamroller": "^3.0.4" }, "engines": { "node": ">=8.0" @@ -11857,6 +11856,7 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -11971,6 +11971,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, "dependencies": { "bn.js": "^4.0.0", "brorand": "^1.0.1" @@ -11982,7 +11983,8 @@ "node_modules/miller-rabin/node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true }, "node_modules/mime": { "version": "2.6.0", @@ -11997,19 +11999,19 @@ } }, "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", "dependencies": { - "mime-db": "1.52.0" + "mime-db": "1.51.0" }, "engines": { "node": ">= 0.6" @@ -12045,17 +12047,17 @@ } }, "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "dependencies": { - "minimist": "^1.2.6" + "minimist": "^1.2.5" }, "bin": { "mkdirp": "bin/cmd.js" @@ -12662,9 +12664,9 @@ } }, "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", "dev": true }, "node_modules/nice-try": { @@ -13653,6 +13655,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, "dependencies": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -14150,18 +14153,15 @@ } }, "node_modules/prettier": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz", - "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", + "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", "dev": true, "bin": { "prettier": "bin-prettier.js" }, "engines": { "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/prettier-linter-helpers": { @@ -15012,6 +15012,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -15166,11 +15167,6 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/scrypt-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" - }, "node_modules/secp256k1": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", @@ -15354,7 +15350,8 @@ "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true }, "node_modules/setprototypeof": { "version": "1.2.0", @@ -15365,6 +15362,7 @@ "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -15720,9 +15718,9 @@ } }, "node_modules/solc": { - "version": "0.8.13", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.13.tgz", - "integrity": "sha512-C0yTN+rjEOGO6uVOXI8+EKa75SFMuZpQ2tryex4QxWIg0HRWZvCHKfVPuLZ5wx06Sb6GBp6uQA5yqQyXZnXOJw==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.12.tgz", + "integrity": "sha512-TU3anAhKWBQ/WrerJ9EcHrNwGOA1y5vIk5Flz7dBNamLDkX9VQTIwcKd3FiZsT0Ew8rSU7RTmJyGNHRGzP5TBA==", "dev": true, "dependencies": { "command-exists": "^1.2.8", @@ -16683,13 +16681,13 @@ } }, "node_modules/streamroller": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.6.tgz", - "integrity": "sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.4.tgz", + "integrity": "sha512-GI9NzeD+D88UFuIlJkKNDH/IsuR+qIN7Qh8EsmhoRZr9bQoehTraRgwtLUkZbpcAw+hLPfHOypmppz8YyGK68w==", "dev": true, "dependencies": { - "date-format": "^4.0.6", - "debug": "^4.3.4", + "date-format": "^4.0.4", + "debug": "^4.3.3", "fs-extra": "^10.0.1" }, "engines": { @@ -17089,9 +17087,9 @@ } }, "node_modules/terser": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", - "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.0.tgz", + "integrity": "sha512-R3AUhNBGWiFc77HXag+1fXpAxTAFRQTJemlJKjAgD9r8xXTpjNKqIXwHM/o7Rh+O0kUJtS3WQVdBeMKFk5sw9A==", "dev": true, "dependencies": { "acorn": "^8.5.0", @@ -17442,9 +17440,9 @@ } }, "node_modules/ts-node": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", - "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.6.0.tgz", + "integrity": "sha512-CJen6+dfOXolxudBQXnVjRVvYTmTWbyz7cn+xq2XTsvnaXbHqr4gXSCNbS2Jj8yTZMuGwUoBESLaOkLascVVvg==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "0.7.0", @@ -17464,7 +17462,6 @@ "bin": { "ts-node": "dist/bin.js", "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" @@ -17629,16 +17626,16 @@ } }, "node_modules/typedoc": { - "version": "0.22.13", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.13.tgz", - "integrity": "sha512-NHNI7Dr6JHa/I3+c62gdRNXBIyX7P33O9TafGLd07ur3MqzcKgwTvpg18EtvCLHJyfeSthAtCLpM7WkStUmDuQ==", + "version": "0.22.12", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.12.tgz", + "integrity": "sha512-FcyC+YuaOpr3rB9QwA1IHOi9KnU2m50sPJW5vcNRPCIdecp+3bFkh7Rq5hBU1Fyn29UR2h4h/H7twZHWDhL0sw==", "dev": true, "dependencies": { "glob": "^7.2.0", "lunr": "^2.3.9", - "marked": "^4.0.12", - "minimatch": "^5.0.1", - "shiki": "^0.10.1" + "marked": "^4.0.10", + "minimatch": "^3.0.4", + "shiki": "^0.10.0" }, "bin": { "typedoc": "bin/typedoc" @@ -17647,7 +17644,7 @@ "node": ">= 12.10.0" }, "peerDependencies": { - "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x || 4.6.x" + "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x" } }, "node_modules/typedoc-plugin-markdown": { @@ -17662,31 +17659,10 @@ "typedoc": ">=0.22.0" } }, - "node_modules/typedoc/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/typedoc/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/typescript": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", - "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -17716,9 +17692,9 @@ } }, "node_modules/uglify-js": { - "version": "3.15.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.3.tgz", - "integrity": "sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg==", + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.2.tgz", + "integrity": "sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==", "dev": true, "optional": true, "bin": { @@ -17944,9 +17920,10 @@ } }, "node_modules/verdaccio": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/verdaccio/-/verdaccio-4.13.0.tgz", - "integrity": "sha512-kipaE7VeHNKelrbHlO1I7yjh2V97qn9Fg6r3tMyDveTXHwKUcAjynmWOFqKx/a566xJYClKc4t4z6UCVVs3gAQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/verdaccio/-/verdaccio-4.12.2.tgz", + "integrity": "sha512-ZIvakoKZuJNQ1PFbrx7qTcTLSgSS1GfdTbNZhFPBORxUZjAdTPDS1WmuIS2CvWwrEK/UxikbQIyD9nMsAL2NkQ==", + "deprecated": "upgrade to v5.x, security support for 4.x has expired", "dev": true, "dependencies": { "@verdaccio/commons-api": "9.7.1", @@ -18200,18 +18177,6 @@ "node": "*" } }, - "node_modules/verdaccio/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, "node_modules/verdaccio/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -18990,9 +18955,9 @@ } }, "node_modules/yargs": { - "version": "17.4.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.0.tgz", - "integrity": "sha512-WJudfrk81yWFSOkZYpAZx4Nt7V4xp7S/uJkX0CnxovMCt1wCE8LNftPpNuF9X/u9gN5nsD7ycYtRcDf2pL3UiA==", + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -19036,13 +19001,13 @@ }, "packages/block": { "name": "@ethereumjs/block", - "version": "3.6.2", + "version": "3.6.1", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^2.6.3", - "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/common": "^2.6.2", + "@ethereumjs/tx": "^3.5.0", "ethereumjs-util": "^7.1.4", - "merkle-patricia-tree": "^4.2.4" + "merkle-patricia-tree": "^4.2.3" }, "devDependencies": { "@types/lru-cache": "^5.1.0", @@ -19135,11 +19100,11 @@ }, "packages/blockchain": { "name": "@ethereumjs/blockchain", - "version": "5.5.2", + "version": "5.5.1", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/block": "^3.6.1", + "@ethereumjs/common": "^2.6.2", "@ethereumjs/ethash": "^1.1.0", "debug": "^4.3.3", "ethereumjs-util": "^7.1.4", @@ -19239,18 +19204,18 @@ }, "packages/client": { "name": "@ethereumjs/client", - "version": "0.4.0", + "version": "0.3.0", "hasInstallScript": true, "license": "MPL-2.0", "dependencies": { "@chainsafe/libp2p-noise": "^4.1.1", - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/block": "^3.6.1", + "@ethereumjs/blockchain": "^5.5.1", + "@ethereumjs/common": "^2.6.2", "@ethereumjs/devp2p": "^4.2.1", "@ethereumjs/ethash": "^1.1.0", - "@ethereumjs/tx": "^3.5.1", - "@ethereumjs/vm": "^5.8.0", + "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/vm": "^5.7.1", "body-parser": "^1.19.2", "chalk": "^4.1.2", "connect": "^3.7.0", @@ -19271,7 +19236,7 @@ "libp2p-mplex": "^0.10.2", "libp2p-tcp": "^0.15.3", "libp2p-websockets": "^0.15.1", - "merkle-patricia-tree": "^4.2.4", + "merkle-patricia-tree": "^4.2.3", "multiaddr": "^10.0.1", "peer-id": "^0.14.3", "qheap": "^1.4.0", @@ -19397,7 +19362,7 @@ }, "packages/common": { "name": "@ethereumjs/common", - "version": "2.6.3", + "version": "2.6.2", "license": "MIT", "dependencies": { "crc-32": "^1.2.0", @@ -19496,7 +19461,7 @@ "version": "4.2.1", "license": "MIT", "dependencies": { - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.2", "@types/bl": "^2.1.0", "@types/k-bucket": "^5.0.0", "@types/lru-cache": "^5.1.0", @@ -19517,8 +19482,8 @@ "snappyjs": "^0.6.1" }, "devDependencies": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/block": "^3.6.1", + "@ethereumjs/tx": "^3.5.0", "@types/async": "^2.4.1", "@types/chalk": "^2.2.0", "@types/debug": "^4.1.4", @@ -19681,14 +19646,14 @@ "version": "1.1.0", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^3.6.2", + "@ethereumjs/block": "^3.6.1", "@types/levelup": "^4.3.0", + "bigint-crypto-utils": "^3.0.23", "buffer-xor": "^2.0.1", - "ethereumjs-util": "^7.1.4", - "miller-rabin": "^4.0.0" + "ethereumjs-util": "^7.1.4" }, "devDependencies": { - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.2", "@types/tape": "^4.13.2", "eslint": "^6.8.0", "level-mem": "^5.0.1", @@ -19865,7 +19830,7 @@ }, "packages/trie": { "name": "merkle-patricia-tree", - "version": "4.2.4", + "version": "4.2.3", "license": "MPL-2.0", "dependencies": { "@types/levelup": "^4.3.0", @@ -19968,10 +19933,10 @@ }, "packages/tx": { "name": "@ethereumjs/tx", - "version": "3.5.1", + "version": "3.5.0", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.2", "ethereumjs-util": "^7.1.4" }, "devDependencies": { @@ -20070,14 +20035,11 @@ "version": "7.1.4", "license": "MPL-2.0", "dependencies": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", + "ethereum-cryptography": "^1.0.3", "rlp": "^2.2.4" }, "devDependencies": { - "@types/assert": "^1.5.4", + "@types/bn.js": "^5.1.0", "@types/node": "^16.11.7", "@types/secp256k1": "^4.0.1", "@types/tape": "^4.13.2", @@ -20110,20 +20072,20 @@ }, "packages/vm": { "name": "@ethereumjs/vm", - "version": "5.8.0", + "version": "5.7.1", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.3", - "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/block": "^3.6.1", + "@ethereumjs/blockchain": "^5.5.1", + "@ethereumjs/common": "^2.6.2", + "@ethereumjs/tx": "^3.5.0", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", "debug": "^4.3.3", "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", - "merkle-patricia-tree": "^4.2.4", + "merkle-patricia-tree": "^4.2.3", "rustbn.js": "~0.2.0" }, "devDependencies": { @@ -20248,24 +20210,24 @@ } }, "@babel/compat-data": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", - "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.0.tgz", + "integrity": "sha512-392byTlpGWXMv4FbyWw3sAZ/FrW/DrwqLGXpy0mbyNe9Taqv1mg9yON5/o0cnr8XYCkFTZbC1eV+c+LAROgrng==", "dev": true }, "@babel/core": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz", - "integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==", + "version": "7.17.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.5.tgz", + "integrity": "sha512-/BBMw4EvjmyquN5O+t5eh0+YqB3XXJkYD2cjKpYtWOfFy4lQ4UozNSmxAcWT8r2XtZs0ewG+zrfsqeR15i1ajA==", "dev": true, "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.7", - "@babel/helper-compilation-targets": "^7.17.7", - "@babel/helper-module-transforms": "^7.17.7", - "@babel/helpers": "^7.17.8", - "@babel/parser": "^7.17.8", + "@babel/generator": "^7.17.3", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.17.2", + "@babel/parser": "^7.17.3", "@babel/template": "^7.16.7", "@babel/traverse": "^7.17.3", "@babel/types": "^7.17.0", @@ -20277,9 +20239,9 @@ } }, "@babel/generator": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.3.tgz", + "integrity": "sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg==", "dev": true, "requires": { "@babel/types": "^7.17.0", @@ -20288,12 +20250,12 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", - "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", "dev": true, "requires": { - "@babel/compat-data": "^7.17.7", + "@babel/compat-data": "^7.16.4", "@babel/helper-validator-option": "^7.16.7", "browserslist": "^4.17.5", "semver": "^6.3.0" @@ -20347,14 +20309,14 @@ } }, "@babel/helper-module-transforms": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", - "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", + "version": "7.17.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.6.tgz", + "integrity": "sha512-2ULmRdqoOMpdvkbT8jONrZML/XALfzxlb052bldftkicAUy8AxSCkD5trDPQcwHNmolcl7wP6ehNqMlyUw6AaA==", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-simple-access": "^7.16.7", "@babel/helper-split-export-declaration": "^7.16.7", "@babel/helper-validator-identifier": "^7.16.7", "@babel/template": "^7.16.7", @@ -20369,12 +20331,12 @@ "dev": true }, "@babel/helper-simple-access": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", - "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", "dev": true, "requires": { - "@babel/types": "^7.17.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-skip-transparent-expression-wrappers": { @@ -20408,13 +20370,13 @@ "dev": true }, "@babel/helpers": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.8.tgz", - "integrity": "sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw==", + "version": "7.17.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.2.tgz", + "integrity": "sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ==", "dev": true, "requires": { "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", + "@babel/traverse": "^7.17.0", "@babel/types": "^7.17.0" } }, @@ -20482,9 +20444,9 @@ } }, "@babel/parser": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", - "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==", + "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.3.tgz", + "integrity": "sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA==", "dev": true }, "@babel/plugin-transform-spread": { @@ -20537,9 +20499,9 @@ } }, "@chainsafe/libp2p-noise": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.1.2.tgz", - "integrity": "sha512-UvZLWvIS7bAz6M8XfsnC/NhT1c/lg8NNsME1hTvo21kRwyxNFpB8gEhId03Cb5B23oIaHhMySAHBcpuMiSxQ2w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.1.1.tgz", + "integrity": "sha512-/Fz86sZmnvRSf7FHxMPifzakxx9xK4KVYx6yi35KPZughop9ivJslUSCLhx/UqDHiuj3h9i04pVXET6nIjSJyQ==", "requires": { "@stablelib/chacha20poly1305": "^1.0.1", "@stablelib/hkdf": "^1.0.1", @@ -20628,16 +20590,16 @@ } }, "@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", + "integrity": "sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==", "dev": true }, "@ethereumjs/block": { "version": "file:packages/block", "requires": { - "@ethereumjs/common": "^2.6.3", - "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/common": "^2.6.2", + "@ethereumjs/tx": "^3.5.0", "@types/lru-cache": "^5.1.0", "@types/node": "^16.11.7", "@types/tape": "^4.13.2", @@ -20648,7 +20610,7 @@ "karma-firefox-launcher": "^2.1.0", "karma-tap": "^4.2.0", "karma-typescript": "^5.5.3", - "merkle-patricia-tree": "^4.2.4", + "merkle-patricia-tree": "^4.2.3", "nyc": "^15.1.0", "prettier": "^2.0.5", "tape": "^5.3.1", @@ -20724,8 +20686,8 @@ "@ethereumjs/blockchain": { "version": "file:packages/blockchain", "requires": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/block": "^3.6.1", + "@ethereumjs/common": "^2.6.2", "@ethereumjs/ethash": "^1.1.0", "@types/async": "^2.4.1", "@types/lru-cache": "^5.1.0", @@ -20819,13 +20781,13 @@ "requires": { "@babel/plugin-transform-spread": "^7.10.1", "@chainsafe/libp2p-noise": "^4.1.1", - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/block": "^3.6.1", + "@ethereumjs/blockchain": "^5.5.1", + "@ethereumjs/common": "^2.6.2", "@ethereumjs/devp2p": "^4.2.1", "@ethereumjs/ethash": "^1.1.0", - "@ethereumjs/tx": "^3.5.1", - "@ethereumjs/vm": "^5.8.0", + "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/vm": "^5.7.1", "@types/body-parser": "^1.19.2", "@types/connect": "^3.4.35", "@types/fs-extra": "^8.1.0", @@ -20863,7 +20825,7 @@ "libp2p-mplex": "^0.10.2", "libp2p-tcp": "^0.15.3", "libp2p-websockets": "^0.15.1", - "merkle-patricia-tree": "^4.2.4", + "merkle-patricia-tree": "^4.2.3", "multiaddr": "^10.0.1", "node-fetch": "^2.6.1", "nyc": "^15.1.0", @@ -21042,9 +21004,9 @@ "@ethereumjs/devp2p": { "version": "file:packages/devp2p", "requires": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.3", - "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/block": "^3.6.1", + "@ethereumjs/common": "^2.6.2", + "@ethereumjs/tx": "^3.5.0", "@types/async": "^2.4.1", "@types/bl": "^2.1.0", "@types/chalk": "^2.2.0", @@ -21201,15 +21163,15 @@ "@ethereumjs/ethash": { "version": "file:packages/ethash", "requires": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/block": "^3.6.1", + "@ethereumjs/common": "^2.6.2", "@types/levelup": "^4.3.0", "@types/tape": "^4.13.2", + "bigint-crypto-utils": "^3.0.23", "buffer-xor": "^2.0.1", "eslint": "^6.8.0", "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", - "miller-rabin": "^4.0.0", "nyc": "^15.1.0", "prettier": "^2.0.5", "tape": "^5.3.1", @@ -21285,7 +21247,7 @@ "@ethereumjs/tx": { "version": "file:packages/tx", "requires": { - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.2", "@types/minimist": "^1.2.0", "@types/node": "^16.11.7", "@types/tape": "^4.13.2", @@ -21373,10 +21335,10 @@ "@ethereumjs/vm": { "version": "file:packages/vm", "requires": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.3", - "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/block": "^3.6.1", + "@ethereumjs/blockchain": "^5.5.1", + "@ethereumjs/common": "^2.6.2", + "@ethereumjs/tx": "^3.5.0", "@ethersproject/abi": "^5.0.12", "@types/benchmark": "^1.0.33", "@types/core-js": "^2.5.0", @@ -21400,7 +21362,7 @@ "level": "^6.0.0", "level-mem": "^5.0.1", "mcl-wasm": "^0.7.1", - "merkle-patricia-tree": "^4.2.4", + "merkle-patricia-tree": "^4.2.3", "minimist": "^1.2.5", "node-dir": "^0.1.17", "nyc": "^15.1.0", @@ -21479,80 +21441,80 @@ } }, "@ethersproject/abi": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.0.tgz", - "integrity": "sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz", + "integrity": "sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w==", "dev": true, "requires": { - "@ethersproject/address": "^5.6.0", - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/constants": "^5.6.0", - "@ethersproject/hash": "^5.6.0", - "@ethersproject/keccak256": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.0" + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/hash": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" } }, "@ethersproject/abstract-provider": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz", - "integrity": "sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz", + "integrity": "sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/networks": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/transactions": "^5.6.0", - "@ethersproject/web": "^5.6.0" + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/networks": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/transactions": "^5.5.0", + "@ethersproject/web": "^5.5.0" } }, "@ethersproject/abstract-signer": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz", - "integrity": "sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz", + "integrity": "sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA==", "dev": true, "requires": { - "@ethersproject/abstract-provider": "^5.6.0", - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0" + "@ethersproject/abstract-provider": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0" } }, "@ethersproject/address": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.0.tgz", - "integrity": "sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.5.0.tgz", + "integrity": "sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/keccak256": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/rlp": "^5.6.0" + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/rlp": "^5.5.0" } }, "@ethersproject/base64": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.0.tgz", - "integrity": "sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.5.0.tgz", + "integrity": "sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.0" + "@ethersproject/bytes": "^5.5.0" } }, "@ethersproject/bignumber": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.0.tgz", - "integrity": "sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", "bn.js": "^4.11.9" }, "dependencies": { @@ -21565,92 +21527,92 @@ } }, "@ethersproject/bytes": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.0.tgz", - "integrity": "sha512-3hJPlYemb9V4VLfJF5BfN0+55vltPZSHU3QKUyP9M3Y2TcajbiRrz65UG+xVHOzBereB1b9mn7r12o177xgN7w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", "dev": true, "requires": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.5.0" } }, "@ethersproject/constants": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.0.tgz", - "integrity": "sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.6.0" + "@ethersproject/bignumber": "^5.5.0" } }, "@ethersproject/hash": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.0.tgz", - "integrity": "sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.5.0.tgz", + "integrity": "sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg==", "dev": true, "requires": { - "@ethersproject/abstract-signer": "^5.6.0", - "@ethersproject/address": "^5.6.0", - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/keccak256": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.0" + "@ethersproject/abstract-signer": "^5.5.0", + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" } }, "@ethersproject/keccak256": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.0.tgz", - "integrity": "sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.5.0.tgz", + "integrity": "sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.0", + "@ethersproject/bytes": "^5.5.0", "js-sha3": "0.8.0" } }, "@ethersproject/logger": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", - "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==", "dev": true }, "@ethersproject/networks": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.0.tgz", - "integrity": "sha512-DaVzgyThzHgSDLuURhvkp4oviGoGe9iTZW4jMEORHDRCgSZ9K9THGFKqL+qGXqPAYLEgZTf5z2w56mRrPR1MjQ==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.5.2.tgz", + "integrity": "sha512-NEqPxbGBfy6O3x4ZTISb90SjEDkWYDUbEeIFhJly0F7sZjoQMnj5KYzMSkMkLKZ+1fGpx00EDpHQCy6PrDupkQ==", "dev": true, "requires": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.5.0" } }, "@ethersproject/properties": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", - "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", "dev": true, "requires": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.5.0" } }, "@ethersproject/rlp": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.0.tgz", - "integrity": "sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.5.0.tgz", + "integrity": "sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0" } }, "@ethersproject/signing-key": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.0.tgz", - "integrity": "sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.5.0.tgz", + "integrity": "sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", "bn.js": "^4.11.9", "elliptic": "6.5.4", "hash.js": "1.1.7" @@ -21665,44 +21627,44 @@ } }, "@ethersproject/strings": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.0.tgz", - "integrity": "sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", + "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/constants": "^5.6.0", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" } }, "@ethersproject/transactions": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.0.tgz", - "integrity": "sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.5.0.tgz", + "integrity": "sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA==", "dev": true, "requires": { - "@ethersproject/address": "^5.6.0", - "@ethersproject/bignumber": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/constants": "^5.6.0", - "@ethersproject/keccak256": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/rlp": "^5.6.0", - "@ethersproject/signing-key": "^5.6.0" + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/rlp": "^5.5.0", + "@ethersproject/signing-key": "^5.5.0" } }, "@ethersproject/web": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.0.tgz", - "integrity": "sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.1.tgz", + "integrity": "sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg==", "dev": true, "requires": { - "@ethersproject/base64": "^5.6.0", - "@ethersproject/bytes": "^5.6.0", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.0" + "@ethersproject/base64": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" } }, "@istanbuljs/load-nyc-config": { @@ -21784,6 +21746,11 @@ "resolved": "https://registry.npmjs.org/@noble/ed25519/-/ed25519-1.6.0.tgz", "integrity": "sha512-UKju89WV37IUALIMfKhKW3psO8AqmrE/GvH6QbPKjzolQ98zM7WmGUeY+xdIgSf5tqPFf75ZCYMgym6E9Jsw3Q==" }, + "@noble/hashes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.0.0.tgz", + "integrity": "sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg==" + }, "@noble/secp256k1": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.5.5.tgz", @@ -21869,6 +21836,30 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, + "@scure/base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.0.0.tgz", + "integrity": "sha512-gIVaYhUsy+9s58m/ETjSJVKHhKTBMmcRb9cEV5/5dwvfDlfORjKrFsDeDHWRrm6RjcPvCLZFwGJjAjLj1gg4HA==" + }, + "@scure/bip32": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.0.1.tgz", + "integrity": "sha512-AU88KKTpQ+YpTLoicZ/qhFhRRIo96/tlb+8YmDDHR9yiKVjSsFZiefJO4wjS2PMTkz5/oIcw84uAq/8pleQURA==", + "requires": { + "@noble/hashes": "~1.0.0", + "@noble/secp256k1": "~1.5.2", + "@scure/base": "~1.0.0" + } + }, + "@scure/bip39": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.0.0.tgz", + "integrity": "sha512-HrtcikLbd58PWOkl02k9V6nXWQyoa7A0+Ek9VF7z17DDk9XZAFUcIdqfh0jJXLypmizc5/8P6OxoUeKliiWv4w==", + "requires": { + "@noble/hashes": "~1.0.0", + "@scure/base": "~1.0.0" + } + }, "@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -22061,12 +22052,6 @@ "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", "integrity": "sha512-q5veSX6zjUy/DlDhR4Y4cU0k2Ar+DT2LUraP00T19WLmTO6Se1djepCCaqU6nQrwcJ5Hyo/CWqxTzrrFg8eqbQ==" }, - "@types/assert": { - "version": "1.5.6", - "resolved": "https://registry.npmjs.org/@types/assert/-/assert-1.5.6.tgz", - "integrity": "sha512-Y7gDJiIqb9qKUHfBQYOWGngUpLORtirAVPuj/CWJrU2C6ZM4/y3XLwuwfGMF8s7QzW746LQZx23m0+1FSgjfug==", - "dev": true - }, "@types/async": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@types/async/-/async-2.4.2.tgz", @@ -22091,6 +22076,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", + "dev": true, "requires": { "@types/node": "*" } @@ -22216,9 +22202,9 @@ } }, "@types/json-schema": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.10.tgz", - "integrity": "sha512-BLO9bBq59vW3fxCpD4o0N4U+DXsvwvIcl+jofw0frQo/GrBFC+/jRZj1E7kgp6dvTyNmA4y6JCV5Id/r3mNP5A==", + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, "@types/jwt-simple": { @@ -22260,9 +22246,9 @@ } }, "@types/lodash": { - "version": "4.14.180", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.180.tgz", - "integrity": "sha512-XOKXa1KIxtNXgASAnwj7cnttJxS4fksBRywK/9LzRV5YxrF80BXZIGeQSuoESQ/VkUj30Ae0+YcuHc15wJCB2g==" + "version": "4.14.179", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.179.tgz", + "integrity": "sha512-uwc1x90yCKqGcIOAT6DwOSuxnrAbpkdPsUOZtwrXb4D/6wZs+6qG7QnIawDuZWg0sWpxl+ltIKCaLoMlna678w==" }, "@types/long": { "version": "4.0.1", @@ -22311,14 +22297,6 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, - "@types/pbkdf2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", - "requires": { - "@types/node": "*" - } - }, "@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", @@ -22338,6 +22316,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "dev": true, "requires": { "@types/node": "*" } @@ -22353,9 +22332,9 @@ } }, "@types/supertest": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.12.tgz", - "integrity": "sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.11.tgz", + "integrity": "sha512-uci4Esokrw9qGb9bvhhSVEjd6rkny/dk5PK/Qz4yxKiyppEI+dOPlNrZBahE3i+PoKFYyDxChVXZ/ysS/nrm1Q==", "dev": true, "requires": { "@types/superagent": "*" @@ -22614,15 +22593,6 @@ "ltgt": "^2.1.2", "typedarray-to-buffer": "~3.1.5" } - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } } } }, @@ -23034,9 +23004,9 @@ } }, "ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "ansi-styles": { @@ -23429,14 +23399,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, "base32.js": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/base32.js/-/base32.js-0.1.0.tgz", @@ -23488,6 +23450,19 @@ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, + "bigint-crypto-utils": { + "version": "3.0.23", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.0.23.tgz", + "integrity": "sha512-ecCXGRhpfm6gOMlNymoojOXnASyx8lwk3Z8f76lANPAnR/rgo/OKVMajxN5TbfT/BaEfcBXskpIUiRz8HPDKoQ==", + "requires": { + "bigint-mod-arith": "^3.0.1" + } + }, + "bigint-mod-arith": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bigint-mod-arith/-/bigint-mod-arith-3.0.2.tgz", + "integrity": "sha512-tlhD4h/D1sv4pJfZzBesKOlfXRCQTeMMUrGbpc2PAawMAjb/S/OPAQfi667w6COt/UHOfvOW47sCSMaSEj4zIg==" + }, "bignumber.js": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", @@ -23551,9 +23526,9 @@ } }, "blakejs": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", + "integrity": "sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg==" }, "bn.js": { "version": "5.2.0", @@ -23752,6 +23727,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, "requires": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -23764,7 +23740,8 @@ "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true } } }, @@ -23828,36 +23805,18 @@ } }, "browserslist": { - "version": "4.20.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", - "integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==", + "version": "4.19.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.3.tgz", + "integrity": "sha512-XK3X4xtKJ+Txj8G5c30B4gsm71s69lqXlkYui4s6EkKxuv49qjYlY6oVd+IFJ73d4YymtM3+djvvt/R/iJwwDg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001317", - "electron-to-chromium": "^1.4.84", + "caniuse-lite": "^1.0.30001312", + "electron-to-chromium": "^1.4.71", "escalade": "^3.1.1", "node-releases": "^2.0.2", "picocolors": "^1.0.0" } }, - "bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", - "requires": { - "base-x": "^3.0.2" - } - }, - "bs58check": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "requires": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - } - }, "buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", @@ -23995,9 +23954,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001319", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001319.tgz", - "integrity": "sha512-xjlIAFHucBRSMUo1kb5D4LYgcN1M45qdKP++lhqowDpwJwGkpIRTt5qQqnhxjj1vHcI7nrJxWhCC1ATrCEBTcw==", + "version": "1.0.30001313", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001313.tgz", + "integrity": "sha512-rI1UN0koZUiKINjysQDuRi2VeSCce3bYJNmDcj3PIKREiAmjakugBul1QSkg/fPrlULYl6oWfGg3PbgOSY9X4Q==", "dev": true }, "caseless": { @@ -24098,6 +24057,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -24609,6 +24569,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, "requires": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -24621,6 +24582,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, "requires": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -24948,9 +24910,9 @@ } }, "date-format": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.6.tgz", - "integrity": "sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.4.tgz", + "integrity": "sha512-/jyf4rhB17ge328HJuJjAcmRtCsGd+NDeAtahRBTaK6vSPR6MO5HlrAit3Nn7dVjaa6sowW0WXt8yQtLyZQFRg==", "dev": true }, "dateformat": { @@ -24972,9 +24934,9 @@ "dev": true }, "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "requires": { "ms": "2.1.2" }, @@ -25418,9 +25380,9 @@ } }, "electron-to-chromium": { - "version": "1.4.90", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.90.tgz", - "integrity": "sha512-ZwKgSA0mQMyEhz+NR0F8dRzkrCLeHLzLkjx/CWf16+zV85hQ6meXPQbKanvhnpkYb7b2uJNj+enQJ/N877ND4Q==", + "version": "1.4.76", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.76.tgz", + "integrity": "sha512-3Vftv7cenJtQb+k00McEBZ2vVmZ/x+HEF7pcZONZIkOsESqAqVuACmBxMv0JhzX7u0YltU0vSqRqgBSTAhFUjA==", "dev": true }, "elliptic": { @@ -25649,14 +25611,14 @@ } }, "es5-ext": { - "version": "0.10.59", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.59.tgz", - "integrity": "sha512-cOgyhW0tIJyQY1Kfw6Kr0viu9ZlUctVchRMZ7R0HiH3dxTSp5zJDLecwxUqPUrGKMsgBI1wd1FL+d9Jxfi4cLw==", + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", "dev": true, "requires": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "next-tick": "^1.1.0" + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" } }, "es6-error": { @@ -26240,39 +26202,25 @@ "dev": true }, "ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.0.3.tgz", + "integrity": "sha512-NQLTW0x0CosoVb/n79x/TRHtfvS3hgNUPTUSCu0vM+9k6IIhHFFrAOJReneexjZsoZxMjJHnJn4lrE8EbnSyqQ==", "requires": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" + "@noble/hashes": "1.0.0", + "@noble/secp256k1": "1.5.5", + "@scure/bip32": "1.0.1", + "@scure/bip39": "1.0.0" } }, "ethereumjs-util": { "version": "file:packages/util", "requires": { - "@types/assert": "^1.5.4", "@types/bn.js": "^5.1.0", "@types/node": "^16.11.7", "@types/secp256k1": "^4.0.1", "@types/tape": "^4.13.2", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", "eslint": "^6.8.0", - "ethereum-cryptography": "^0.1.3", + "ethereum-cryptography": "^1.0.3", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", "karma-firefox-launcher": "^2.1.0", @@ -26331,6 +26279,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, "requires": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" @@ -27249,6 +27198,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, "requires": { "inherits": "^2.0.4", "readable-stream": "^3.6.0", @@ -28543,9 +28493,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==" + "version": "12.20.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", + "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==" }, "commander": { "version": "2.20.3", @@ -28736,10 +28686,13 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", - "dev": true + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } }, "jsonc-parser": { "version": "3.0.0", @@ -29003,9 +28956,9 @@ } }, "karma-chrome-launcher": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.1.tgz", - "integrity": "sha512-hsIglcq1vtboGPAN+DGCISCFOxW+ZVnIqhDQcCMqqCp+4dmJ0Qpq5QAjkbA0X2L9Mi6OBkHi2Srrbmm7pUKkzQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz", + "integrity": "sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg==", "dev": true, "requires": { "which": "^1.2.1" @@ -29684,9 +29637,9 @@ } }, "node-forge": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.0.tgz", - "integrity": "sha512-08ARB91bUi6zNKzVmaj3QO7cr397uiDT2nJ63cHjyNtCTWIgvS47j3eT0WfzUwS9+6Z5YshRaoasFkXCKrIYbA==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.2.1.tgz", + "integrity": "sha512-Fcvtbb+zBcZXbTTVwqGA5W+MKBj56UjVRevvchv5XrcyXbmNdesfZL37nlcWOfpgHhgmxApw3tQbTr4CqNmX4w==" }, "peer-id": { "version": "0.16.0", @@ -30486,16 +30439,16 @@ "dev": true }, "log4js": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.4.tgz", - "integrity": "sha512-ncaWPsuw9Vl1CKA406hVnJLGQKy1OHx6buk8J4rE2lVW+NW5Y82G5/DIloO7NkqLOUtNPEANaWC1kZYVjXssPw==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.2.tgz", + "integrity": "sha512-k80cggS2sZQLBwllpT1p06GtfvzMmSdUCkW96f0Hj83rKGJDAu2vZjt9B9ag2vx8Zz1IXzxoLgqvRJCdMKybGg==", "dev": true, "requires": { - "date-format": "^4.0.6", - "debug": "^4.3.4", + "date-format": "^4.0.4", + "debug": "^4.3.3", "flatted": "^3.2.5", "rfdc": "^1.3.0", - "streamroller": "^3.0.6" + "streamroller": "^3.0.4" }, "dependencies": { "flatted": { @@ -30665,6 +30618,7 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -30848,6 +30802,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, "requires": { "bn.js": "^4.0.0", "brorand": "^1.0.1" @@ -30856,7 +30811,8 @@ "bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true } } }, @@ -30867,16 +30823,16 @@ "dev": true }, "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==" }, "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", "requires": { - "mime-db": "1.52.0" + "mime-db": "1.51.0" } }, "mimic-fn": { @@ -30903,17 +30859,17 @@ } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "^1.2.6" + "minimist": "^1.2.5" } }, "mkdirp-classic": { @@ -31431,9 +31387,9 @@ "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==" }, "next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", "dev": true }, "nice-try": { @@ -32173,6 +32129,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, "requires": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -32564,9 +32521,9 @@ "dev": true }, "prettier": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz", - "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", + "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", "dev": true }, "prettier-linter-helpers": { @@ -33267,6 +33224,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -33448,11 +33406,6 @@ "ajv-keywords": "^3.5.2" } }, - "scrypt-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" - }, "secp256k1": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", @@ -33603,7 +33556,8 @@ "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true }, "setprototypeof": { "version": "1.2.0", @@ -33614,6 +33568,7 @@ "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -33903,9 +33858,9 @@ } }, "solc": { - "version": "0.8.13", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.13.tgz", - "integrity": "sha512-C0yTN+rjEOGO6uVOXI8+EKa75SFMuZpQ2tryex4QxWIg0HRWZvCHKfVPuLZ5wx06Sb6GBp6uQA5yqQyXZnXOJw==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.12.tgz", + "integrity": "sha512-TU3anAhKWBQ/WrerJ9EcHrNwGOA1y5vIk5Flz7dBNamLDkX9VQTIwcKd3FiZsT0Ew8rSU7RTmJyGNHRGzP5TBA==", "dev": true, "requires": { "command-exists": "^1.2.8", @@ -34697,13 +34652,13 @@ "integrity": "sha512-nEs6hBGIPsVz6uq6pscGGKfoPDQWrDQW0b0UHurtSDysekfKLmkPg7FQVRE2sj3Rad6yUo9E1sGTxOWyYsHQ/g==" }, "streamroller": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.6.tgz", - "integrity": "sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.4.tgz", + "integrity": "sha512-GI9NzeD+D88UFuIlJkKNDH/IsuR+qIN7Qh8EsmhoRZr9bQoehTraRgwtLUkZbpcAw+hLPfHOypmppz8YyGK68w==", "dev": true, "requires": { - "date-format": "^4.0.6", - "debug": "^4.3.4", + "date-format": "^4.0.4", + "debug": "^4.3.3", "fs-extra": "^10.0.1" } }, @@ -35010,9 +34965,9 @@ } }, "terser": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", - "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.0.tgz", + "integrity": "sha512-R3AUhNBGWiFc77HXag+1fXpAxTAFRQTJemlJKjAgD9r8xXTpjNKqIXwHM/o7Rh+O0kUJtS3WQVdBeMKFk5sw9A==", "dev": true, "requires": { "acorn": "^8.5.0", @@ -35280,9 +35235,9 @@ } }, "ts-node": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", - "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.6.0.tgz", + "integrity": "sha512-CJen6+dfOXolxudBQXnVjRVvYTmTWbyz7cn+xq2XTsvnaXbHqr4gXSCNbS2Jj8yTZMuGwUoBESLaOkLascVVvg==", "dev": true, "requires": { "@cspotcode/source-map-support": "0.7.0", @@ -35411,36 +35366,16 @@ } }, "typedoc": { - "version": "0.22.13", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.13.tgz", - "integrity": "sha512-NHNI7Dr6JHa/I3+c62gdRNXBIyX7P33O9TafGLd07ur3MqzcKgwTvpg18EtvCLHJyfeSthAtCLpM7WkStUmDuQ==", + "version": "0.22.12", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.12.tgz", + "integrity": "sha512-FcyC+YuaOpr3rB9QwA1IHOi9KnU2m50sPJW5vcNRPCIdecp+3bFkh7Rq5hBU1Fyn29UR2h4h/H7twZHWDhL0sw==", "dev": true, "requires": { "glob": "^7.2.0", "lunr": "^2.3.9", - "marked": "^4.0.12", - "minimatch": "^5.0.1", - "shiki": "^0.10.1" - }, - "dependencies": { - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0" - } - }, - "minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", - "dev": true, - "requires": { - "brace-expansion": "^2.0.1" - } - } + "marked": "^4.0.10", + "minimatch": "^3.0.4", + "shiki": "^0.10.0" } }, "typedoc-plugin-markdown": { @@ -35453,9 +35388,9 @@ } }, "typescript": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", - "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true }, "ua-parser-js": { @@ -35465,9 +35400,9 @@ "dev": true }, "uglify-js": { - "version": "3.15.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.3.tgz", - "integrity": "sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg==", + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.2.tgz", + "integrity": "sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==", "dev": true, "optional": true }, @@ -35659,9 +35594,9 @@ "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, "verdaccio": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/verdaccio/-/verdaccio-4.13.0.tgz", - "integrity": "sha512-kipaE7VeHNKelrbHlO1I7yjh2V97qn9Fg6r3tMyDveTXHwKUcAjynmWOFqKx/a566xJYClKc4t4z6UCVVs3gAQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/verdaccio/-/verdaccio-4.12.2.tgz", + "integrity": "sha512-ZIvakoKZuJNQ1PFbrx7qTcTLSgSS1GfdTbNZhFPBORxUZjAdTPDS1WmuIS2CvWwrEK/UxikbQIyD9nMsAL2NkQ==", "dev": true, "requires": { "@verdaccio/commons-api": "9.7.1", @@ -35814,15 +35749,6 @@ "brace-expansion": "^1.1.7" } }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -36480,9 +36406,9 @@ "dev": true }, "yargs": { - "version": "17.4.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.0.tgz", - "integrity": "sha512-WJudfrk81yWFSOkZYpAZx4Nt7V4xp7S/uJkX0CnxovMCt1wCE8LNftPpNuF9X/u9gN5nsD7ycYtRcDf2pL3UiA==", + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", From 8dfa78c384d2cfbd683b4c13142cc0875c3ad80e Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Tue, 8 Mar 2022 14:14:51 -0700 Subject: [PATCH 16/44] develop: fix client parse, move modifyAccountFields to baseStateManager (#1765) * client fix parse: now with common default being london, explicitly setHardforkByBlockNumber(0) when creating genesis header * vm: move new modifyAccountFields to baseStateManager * fix lint --- packages/client/lib/util/parse.ts | 6 +++--- packages/client/test/miner/miner.spec.ts | 2 +- .../client/test/miner/pendingBlock.spec.ts | 2 +- packages/vm/src/state/baseStateManager.ts | 17 +++++++++++++++++ packages/vm/src/state/stateManager.ts | 18 +----------------- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/packages/client/lib/util/parse.ts b/packages/client/lib/util/parse.ts index be8beb67072..c3b6eead213 100644 --- a/packages/client/lib/util/parse.ts +++ b/packages/client/lib/util/parse.ts @@ -148,16 +148,16 @@ async function createGethGenesisBlockHeader(json: any) { stateRoot, baseFeePerGas, } - let common + let common = new Common({ chain: 1 }) if (json.config.londonBlock === 0) { // chainId is not important here, we just want to set // hardfork to London for baseFeePerGas support - const hardforks = new Common({ chain: 1 }) + const hardforks = common .hardforks() .map((h) => (h.name === Hardfork.London ? { ...h, block: 0 } : h)) common = Common.custom({ chainId: 1, hardforks }) - common.setHardforkByBlockNumber(0) } + common.setHardforkByBlockNumber(0) return BlockHeader.fromHeaderData(headerData, { common }) } diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index dc28caff101..f088282fea6 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -4,7 +4,7 @@ import Common, { Chain as CommonChain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction, Transaction } from '@ethereumjs/tx' import { Block, BlockHeader } from '@ethereumjs/block' import { DefaultStateManager, StateManager } from '@ethereumjs/vm/dist/state' -import { Account, Address, BN } from 'ethereumjs-util' +import { Address, BN } from 'ethereumjs-util' import { Config } from '../../lib/config' import { FullEthereumService } from '../../lib/service' import { Chain } from '../../lib/blockchain' diff --git a/packages/client/test/miner/pendingBlock.spec.ts b/packages/client/test/miner/pendingBlock.spec.ts index 5209f3e7798..2376a0da784 100644 --- a/packages/client/test/miner/pendingBlock.spec.ts +++ b/packages/client/test/miner/pendingBlock.spec.ts @@ -5,7 +5,7 @@ import { Transaction } from '@ethereumjs/tx' import { BlockHeader } from '@ethereumjs/block' import VM from '@ethereumjs/vm' import { DefaultStateManager, StateManager } from '@ethereumjs/vm/dist/state' -import { Account, Address, BN } from 'ethereumjs-util' +import { Address, BN } from 'ethereumjs-util' import { Config } from '../../lib/config' import { TxPool } from '../../lib/service/txpool' import { PendingBlock } from '../../lib/miner' diff --git a/packages/vm/src/state/baseStateManager.ts b/packages/vm/src/state/baseStateManager.ts index 8a852575881..4093978da8a 100644 --- a/packages/vm/src/state/baseStateManager.ts +++ b/packages/vm/src/state/baseStateManager.ts @@ -5,6 +5,7 @@ import { debug as createDebugLogger, Debugger } from 'debug' import { Account, Address, toBuffer } from 'ethereumjs-util' import { ripemdPrecompileAddress } from '../evm/precompiles' import Cache from './cache' +import { AccountFields } from './interface' import { DefaultStateManagerOpts } from './stateManager' type AddressHex = string @@ -108,6 +109,22 @@ export abstract class BaseStateManager { this.touchAccount(address) } + /** + * Gets the account associated with `address`, modifies the given account + * fields, then saves the account into state. Account fields can include + * `nonce`, `balance`, `stateRoot`, and `codeHash`. + * @param address - Address of the account to modify + * @param accountFields - Object containing account fields and values to modify + */ + async modifyAccountFields(address: Address, accountFields: AccountFields): Promise { + const account = await this.getAccount(address) + account.nonce = accountFields.nonce ?? account.nonce + account.balance = accountFields.balance ?? account.balance + account.stateRoot = accountFields.stateRoot ?? account.stateRoot + account.codeHash = accountFields.codeHash ?? account.codeHash + await this.putAccount(address, account) + } + /** * Deletes an account from state under the provided `address`. The account will also be removed from the state trie. * @param address - Address of the account which should be deleted diff --git a/packages/vm/src/state/stateManager.ts b/packages/vm/src/state/stateManager.ts index 8bf18d04a20..a31424f1c5b 100644 --- a/packages/vm/src/state/stateManager.ts +++ b/packages/vm/src/state/stateManager.ts @@ -15,7 +15,7 @@ import { setLengthLeft, } from 'ethereumjs-util' import Common from '@ethereumjs/common' -import { StateManager, StorageDump, AccountFields } from './interface' +import { StateManager, StorageDump } from './interface' import Cache, { getCb, putCb } from './cache' import { BaseStateManager } from './' import { short } from '../evm/opcodes' @@ -511,20 +511,4 @@ export default class DefaultStateManager extends BaseStateManager implements Sta } return false } - - /** - * Gets the account associated with `address`, modifies the given account - * fields, then saves the account into state. Account fields can include - * `nonce`, `balance`, `stateRoot`, and `codeHash`. - * @param address - Address of the account to modify - * @param accountFields - Object containing account fields and values to modify - */ - async modifyAccountFields(address: Address, accountFields: AccountFields): Promise { - const account = await this.getAccount(address) - account.nonce = accountFields.nonce ?? account.nonce - account.balance = accountFields.balance ?? account.balance - account.stateRoot = accountFields.stateRoot ?? account.stateRoot - account.codeHash = accountFields.codeHash ?? account.codeHash - await this.putAccount(address, account) - } } From f2243ae0f9281ec2cf8cdb70318046314959d1da Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Mon, 14 Mar 2022 13:54:00 +0100 Subject: [PATCH 17/44] Convert bn to bigint (#1771) * util: use bigints. Expose new secp constants * common: use bigints * tx: use bigints * lint: fix util, tx, common * tx: fix isSigned * update comment block style to be picked up by vscode * remove doc typo (extra `) * tx: add isSigned() tests to base.spec.ts to iterate across txTypes * block: bn to bigint changes wip block: finish header changes block: test updates block: test fixes Partial difficulty fixes * block: fix homestead difficulty * block: fix >= Byzantium difficulty * BigInt conversion fixes * block: update st.ok to st.equals * Update readme to use bigints * ethash: bn to bigint * blockchain: wip bn to bigint changes * devp2p: bn to bigint * vm: wip remaining bn -> bigint * vm: more test fixes * fix runTx negative value args test, ensure balance does not go negative when using skipBalance * vm: lint:fix * re-add newline * Blockchain: small rebase fix * vm: Fix API tests * client: bn to bigint updates in source * client: various fixes * client: last fixes * client: integration test fixes * replace st.ok usage with st.equal * normalize st.equals to st.equal * update toType cases * nits, lint * fix vm benchmarks * client: fix fullEthereumService tests * touch ups, fix miner integration test * use prefix increment * client: fix full sync test * test fixes * Fix reorg logic bug * bnTo... function renaming and cleanup * Goodbye bn.js * reverse changelog changes * nits * remove more BN, more nits * turn off restrict-plus-operands and remove disable overrides (does not work properly) * more nits, update package-lock * fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp) * replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime * more nits / fixes * Fix misplaced paren * Fix miner test * more nits * fix buffer to big int * set expectedTests back to >= comparison * last fixes * Removed re-introduced Common methods Co-authored-by: Paul Miller Co-authored-by: Ryan Ghods Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com> Co-authored-by: Jochem Brouwer --- config/eslint.js | 1 + packages/block/README.md | 13 +- packages/block/src/block.ts | 17 +- packages/block/src/clique.ts | 8 +- packages/block/src/header.ts | 291 +++--- packages/block/src/types.ts | 16 +- packages/block/test/block.spec.ts | 52 +- packages/block/test/difficulty.spec.ts | 13 +- packages/block/test/eip1559block.spec.ts | 169 ++-- packages/block/test/header.spec.ts | 30 +- packages/block/test/mergeBlock.spec.ts | 16 +- packages/block/test/util.ts | 10 +- packages/blockchain/src/clique.ts | 8 +- packages/blockchain/src/db/constants.ts | 15 +- packages/blockchain/src/db/helpers.ts | 10 +- packages/blockchain/src/db/manager.ts | 40 +- packages/blockchain/src/db/operation.ts | 3 +- packages/blockchain/src/index.ts | 153 ++-- packages/blockchain/test/clique.spec.ts | 20 +- packages/blockchain/test/index.spec.ts | 82 +- packages/blockchain/test/pos.spec.ts | 25 +- packages/blockchain/test/reorg.spec.ts | 48 +- packages/blockchain/test/util.ts | 16 +- packages/client/bin/cli.ts | 2 +- packages/client/lib/blockchain/chain.ts | 44 +- packages/client/lib/config.ts | 2 +- packages/client/lib/execution/receipt.ts | 8 +- packages/client/lib/execution/vmexecution.ts | 6 +- packages/client/lib/miner/miner.ts | 20 +- packages/client/lib/miner/pendingBlock.ts | 9 +- packages/client/lib/net/peer/peer.ts | 6 +- .../client/lib/net/protocol/ethprotocol.ts | 94 +- .../client/lib/net/protocol/flowcontrol.ts | 3 - .../client/lib/net/protocol/lesprotocol.ts | 64 +- packages/client/lib/rpc/modules/engine.ts | 12 +- packages/client/lib/rpc/modules/eth.ts | 74 +- .../client/lib/service/fullethereumservice.ts | 13 +- packages/client/lib/service/txpool.ts | 18 +- .../client/lib/sync/fetcher/blockfetcher.ts | 4 +- .../lib/sync/fetcher/blockfetcherbase.ts | 49 +- .../client/lib/sync/fetcher/headerfetcher.ts | 23 +- packages/client/lib/sync/fullsync.ts | 73 +- packages/client/lib/sync/lightsync.ts | 24 +- packages/client/lib/sync/sync.ts | 10 +- packages/client/lib/types.ts | 3 +- packages/client/lib/util/parse.ts | 7 +- packages/client/test/blockchain/chain.spec.ts | 15 +- .../integration/fullethereumservice.spec.ts | 17 +- .../client/test/integration/fullsync.spec.ts | 5 +- .../client/test/integration/lightsync.spec.ts | 4 +- .../client/test/integration/merge.spec.ts | 26 +- .../client/test/integration/miner.spec.ts | 19 +- packages/client/test/miner/miner.spec.ts | 46 +- .../client/test/miner/pendingBlock.spec.ts | 22 +- .../test/net/protocol/ethprotocol.spec.ts | 40 +- .../test/net/protocol/lesprotocol.spec.ts | 16 +- .../client/test/rpc/eth/blockNumber.spec.ts | 6 +- packages/client/test/rpc/eth/call.spec.ts | 6 +- packages/client/test/rpc/eth/chainId.spec.ts | 3 +- .../client/test/rpc/eth/estimateGas.spec.ts | 6 +- .../client/test/rpc/eth/getBalance.spec.ts | 14 +- .../test/rpc/eth/getBlockByNumber.spec.ts | 8 +- packages/client/test/rpc/eth/getCode.spec.ts | 4 +- packages/client/test/rpc/eth/getLogs.spec.ts | 6 +- packages/client/test/rpc/eth/getProof.spec.ts | 4 +- .../client/test/rpc/eth/getStorageAt.spec.ts | 4 +- .../eth/getUncleCountByBlockNumber.spec.ts | 3 +- packages/client/test/rpc/eth/syncing.spec.ts | 3 +- packages/client/test/rpc/helpers.ts | 6 +- packages/client/test/rpc/mockBlockchain.ts | 4 +- .../test/service/fullethereumservice.spec.ts | 14 +- .../test/service/lightethereumservice.spec.ts | 3 +- .../test/sync/execution/vmexecution.spec.ts | 4 +- .../test/sync/fetcher/blockfetcher.spec.ts | 57 +- .../test/sync/fetcher/headerfetcher.spec.ts | 11 +- packages/client/test/sync/fullsync.spec.ts | 39 +- packages/client/test/sync/lightsync.spec.ts | 25 +- packages/client/test/sync/sync.spec.ts | 7 +- packages/client/test/util/parse.spec.ts | 4 +- packages/common/src/index.ts | 80 +- packages/common/src/types.ts | 6 +- packages/common/tests/chains.spec.ts | 13 +- packages/common/tests/customChains.spec.ts | 23 +- packages/common/tests/hardforks.spec.ts | 19 +- packages/common/tests/mergePOS.spec.ts | 4 +- packages/common/tests/params.spec.ts | 3 +- .../devp2p/examples/peer-communication-les.ts | 2 +- .../devp2p/examples/peer-communication.ts | 10 +- packages/devp2p/src/protocol/eth.ts | 39 +- packages/devp2p/src/protocol/les.ts | 4 +- packages/ethash/package.json | 6 +- packages/ethash/src/index.ts | 54 +- packages/ethash/src/util.ts | 36 +- packages/ethash/test/ethash.spec.ts | 13 +- packages/ethash/test/miner.spec.ts | 23 +- packages/rlp/test/dataTypes.spec.ts | 8 +- packages/tx/src/baseTransaction.ts | 120 +-- packages/tx/src/eip1559Transaction.ts | 113 +-- packages/tx/src/eip2930Transaction.ts | 96 +- packages/tx/src/legacyTransaction.ts | 115 ++- packages/tx/src/transactionFactory.ts | 4 +- packages/tx/src/types.ts | 32 +- packages/tx/test/base.spec.ts | 57 +- packages/tx/test/eip1559.spec.ts | 31 +- packages/tx/test/inputValue.spec.ts | 27 +- packages/tx/test/legacy.spec.ts | 71 +- packages/tx/test/transactionFactory.spec.ts | 15 +- packages/tx/test/typedTxsAndEIP2930.spec.ts | 66 +- packages/util/docs/README.md | 14 +- packages/util/package.json | 3 +- packages/util/src/account.ts | 53 +- packages/util/src/address.ts | 20 +- packages/util/src/bytes.ts | 81 +- packages/util/src/constants.ts | 24 +- packages/util/src/externals.ts | 8 +- packages/util/src/index.ts | 2 +- packages/util/src/signature.ts | 83 +- packages/util/src/types.ts | 86 +- packages/util/test/account.spec.ts | 41 +- packages/util/test/address.spec.ts | 6 +- packages/util/test/bytes.spec.ts | 11 +- packages/util/test/constants.spec.ts | 7 +- packages/util/test/externals.spec.ts | 41 +- packages/util/test/signature.spec.ts | 38 +- packages/util/test/types.spec.ts | 68 +- packages/vm/benchmarks/mainnetBlocks.ts | 2 +- packages/vm/benchmarks/mockchain.ts | 6 +- packages/vm/benchmarks/util.ts | 25 +- packages/vm/examples/helpers/account-utils.ts | 3 +- packages/vm/examples/helpers/tx-builder.ts | 3 +- packages/vm/src/buildBlock.ts | 12 +- packages/vm/src/evm/eei.ts | 32 +- packages/vm/src/evm/evm.ts | 19 +- packages/vm/src/evm/interpreter.ts | 8 +- packages/vm/src/evm/opcodes/EIP2929.ts | 4 +- packages/vm/src/evm/opcodes/functions.ts | 48 +- packages/vm/src/evm/opcodes/gas.ts | 853 +++++++++--------- packages/vm/src/evm/opcodes/util.ts | 56 +- .../vm/src/evm/precompiles/01-ecrecover.ts | 10 +- packages/vm/src/index.ts | 8 +- packages/vm/src/runBlock.ts | 34 +- packages/vm/src/runTx.ts | 67 +- packages/vm/src/state/stateManager.ts | 11 +- .../EIPs/eip-1283-net-gas-metering.spec.ts | 44 +- .../tests/api/EIPs/eip-1559-FeeMarket.spec.ts | 76 +- .../vm/tests/api/EIPs/eip-2537-BLS.spec.ts | 4 +- .../api/EIPs/eip-2565-modexp-gas-cost.spec.ts | 2 +- packages/vm/tests/api/EIPs/eip-2929.spec.ts | 10 +- .../api/EIPs/eip-2930-accesslists.spec.ts | 12 +- .../tests/api/EIPs/eip-3198-BaseFee.spec.ts | 30 +- packages/vm/tests/api/EIPs/eip-3529.spec.ts | 8 +- packages/vm/tests/api/EIPs/eip-3541.spec.ts | 6 +- packages/vm/tests/api/EIPs/eip-3855.spec.ts | 12 +- ...t-difficulty-opcode-with-prevrando.spec.ts | 10 +- packages/vm/tests/api/buildBlock.spec.ts | 12 +- packages/vm/tests/api/events.spec.ts | 11 +- packages/vm/tests/api/evm/stack.spec.ts | 7 +- packages/vm/tests/api/index.spec.ts | 27 + .../vm/tests/api/istanbul/eip-1344.spec.ts | 8 +- .../vm/tests/api/istanbul/eip-1884.spec.ts | 8 +- .../vm/tests/api/istanbul/eip-2200.spec.ts | 6 +- packages/vm/tests/api/runBlock.spec.ts | 54 +- packages/vm/tests/api/runBlockchain.spec.ts | 4 +- packages/vm/tests/api/runCall.spec.ts | 17 +- packages/vm/tests/api/runCode.spec.ts | 2 +- packages/vm/tests/api/runTx.spec.ts | 103 ++- .../vm/tests/api/state/accountExists.spec.ts | 6 +- packages/vm/tests/api/state/cache.spec.ts | 26 +- .../tests/api/state/proofStateManager.spec.ts | 8 +- .../vm/tests/api/state/stateManager.spec.ts | 33 +- packages/vm/tests/api/utils.ts | 14 +- packages/vm/tests/tester/index.ts | 12 +- .../tester/runners/BlockchainTestsRunner.ts | 29 +- .../tester/runners/GeneralStateTestsRunner.ts | 2 +- packages/vm/tests/util.ts | 48 +- 175 files changed, 2773 insertions(+), 2830 deletions(-) diff --git a/config/eslint.js b/config/eslint.js index bc4d661c1af..2ab30905817 100644 --- a/config/eslint.js +++ b/config/eslint.js @@ -45,6 +45,7 @@ module.exports = { 'prettier/prettier': 'error', 'no-redeclare': 'off', '@typescript-eslint/no-redeclare': ['error'], + '@typescript-eslint/restrict-plus-operands': 'off', }, parserOptions: { sourceType: 'module', diff --git a/packages/block/README.md b/packages/block/README.md index 866a43c5811..5ced2cf6d94 100644 --- a/packages/block/README.md +++ b/packages/block/README.md @@ -62,16 +62,15 @@ This library supports the creation of [EIP-1559](https://eips.ethereum.org/EIPS/ To instantiate an EIP-1559 block, the hardfork parameter on the `Common` instance needs to be set to `london` (this is now the default hardfork): ```typescript -import { BN } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import Common, { Chain, Hardfork } from '@ethereumjs/common' const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) const block = Block.fromBlockData({ header: { - baseFeePerGas: new BN(10), - gasLimit: new BN(100), - gasUsed: new BN(60) + baseFeePerGas: BigInt(10), + gasLimit: BigInt(100), + gasUsed: BigInt(60) } }, { common }) @@ -85,14 +84,14 @@ block.header.calcNextBaseFee().toNumber() // 11 const blockWithMatchingBaseFee = Block.fromBlockData({ header: { baseFeePerGas: parentHeader.calcNextBaseFee(), - gasLimit: new BN(100), - gasUsed: new BN(60) + gasLimit: BigInt(100), + gasUsed: BigInt(60) } }, { common }) ``` -EIP-1559 blocks have an extra `baseFeePerGas` field (default: `new BN(7)`) and can encompass `FeeMarketEIP1559Transaction` txs (type `2`) (supported by `@ethereumjs/tx` `v3.2.0` or higher) as well as `Transaction` legacy txs (internal type `0`) and `AccessListEIP2930Transaction` txs (type `1`). +EIP-1559 blocks have an extra `baseFeePerGas` field (default: `BigInt(7)`) and can encompass `FeeMarketEIP1559Transaction` txs (type `2`) (supported by `@ethereumjs/tx` `v3.2.0` or higher) as well as `Transaction` legacy txs (internal type `0`) and `AccessListEIP2930Transaction` txs (type `1`). ## Consensus Types diff --git a/packages/block/src/block.ts b/packages/block/src/block.ts index b3a1b075699..0113845e8d6 100644 --- a/packages/block/src/block.ts +++ b/packages/block/src/block.ts @@ -1,5 +1,5 @@ import { BaseTrie as Trie } from 'merkle-patricia-tree' -import { BN, rlp, keccak256, KECCAK256_RLP, bufferToHex } from 'ethereumjs-util' +import { rlp, keccak256, KECCAK256_RLP, bufferToHex } from 'ethereumjs-util' import Common, { ConsensusType } from '@ethereumjs/common' import { TransactionFactory, @@ -30,7 +30,6 @@ export class Block { */ public static fromBlockData(blockData: BlockData = {}, opts?: BlockOptions) { const { header: headerData, transactions: txsData, uncleHeaders: uhsData } = blockData - const header = BlockHeader.fromHeaderData(headerData, opts) // parse transactions @@ -250,12 +249,12 @@ export class Block { if (this._common.isActivatedEIP(1559)) { if (tx.supports(Capability.EIP1559FeeMarket)) { tx = tx as FeeMarketEIP1559Transaction - if (tx.maxFeePerGas.lt(this.header.baseFeePerGas!)) { + if (tx.maxFeePerGas < this.header.baseFeePerGas!) { errs.push('tx unable to pay base fee (EIP-1559 tx)') } } else { tx = tx as Transaction - if (tx.gasPrice.lt(this.header.baseFeePerGas!)) { + if (tx.gasPrice < this.header.baseFeePerGas!) { errs.push('tx unable to pay base fee (non EIP-1559 tx)') } } @@ -368,7 +367,7 @@ export class Block { * * @param parentBlock - the parent of this `Block` */ - canonicalDifficulty(parentBlock: Block): BN { + canonicalDifficulty(parentBlock: Block): bigint { return this.header.canonicalDifficulty(parentBlock.header) } @@ -422,11 +421,11 @@ export class Block { // Check how many blocks we should get in order to validate the uncle. // In the worst case, we get 8 blocks, in the best case, we only get 1 block. const canonicalBlockMap: Block[] = [] - let lowestUncleNumber = this.header.number.clone() + let lowestUncleNumber = this.header.number uncleHeaders.map((header) => { - if (header.number.lt(lowestUncleNumber)) { - lowestUncleNumber = header.number.clone() + if (header.number < lowestUncleNumber) { + lowestUncleNumber = header.number } }) @@ -437,7 +436,7 @@ export class Block { const includedUncles: { [key: string]: boolean } = {} // Due to the header validation check above, we know that `getBlocks` is between 1 and 8 inclusive. - const getBlocks = this.header.number.clone().sub(lowestUncleNumber).addn(1).toNumber() + const getBlocks = this.header.number - lowestUncleNumber + BigInt(1) // See Geth: https://github.com/ethereum/go-ethereum/blob/b63bffe8202d46ea10ac8c4f441c582642193ac8/consensus/ethash/consensus.go#L207 // Here we get the necessary blocks from the chain. diff --git a/packages/block/src/clique.ts b/packages/block/src/clique.ts index 5fda0f0caac..5ac55ce6158 100644 --- a/packages/block/src/clique.ts +++ b/packages/block/src/clique.ts @@ -1,11 +1,9 @@ -import { BN } from 'ethereumjs-util' - // Fixed number of extra-data prefix bytes reserved for signer vanity export const CLIQUE_EXTRA_VANITY = 32 // Fixed number of extra-data suffix bytes reserved for signer seal export const CLIQUE_EXTRA_SEAL = 65 // Block difficulty for in-turn signatures -export const CLIQUE_DIFF_INTURN = new BN(2) -// Block difficulty for in-turn signatures -export const CLIQUE_DIFF_NOTURN = new BN(1) +export const CLIQUE_DIFF_INTURN = BigInt(2) +// Block difficulty for out-of-turn signatures +export const CLIQUE_DIFF_NOTURN = BigInt(1) diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index ca2d627831f..8dcbb8b9860 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -1,9 +1,8 @@ import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '@ethereumjs/common' import { Address, - BN, - bnToHex, - bnToUnpaddedBuffer, + bigIntToHex, + bigIntToUnpaddedBuffer, ecrecover, ecsign, intToBuffer, @@ -14,6 +13,9 @@ import { toBuffer, zeros, bufferToHex, + bufferToBigInt, + toType, + TypeOutput, } from 'ethereumjs-util' import { Blockchain, BlockHeaderBuffer, BlockOptions, HeaderData, JsonHeader } from './types' import { @@ -27,7 +29,7 @@ interface HeaderCache { hash: Buffer | undefined } -const DEFAULT_GAS_LIMIT = new BN(Buffer.from('ffffffffffffff', 'hex')) +const DEFAULT_GAS_LIMIT = BigInt('0xffffffffffffff') /** * An object that represents the block header. @@ -40,15 +42,15 @@ export class BlockHeader { public readonly transactionsTrie: Buffer public readonly receiptTrie: Buffer public readonly logsBloom: Buffer - public readonly difficulty: BN - public readonly number: BN - public readonly gasLimit: BN - public readonly gasUsed: BN - public readonly timestamp: BN + public readonly difficulty: bigint + public readonly number: bigint + public readonly gasLimit: bigint + public readonly gasUsed: bigint + public readonly timestamp: bigint public readonly extraData: Buffer public readonly mixHash: Buffer public readonly nonce: Buffer - public readonly baseFeePerGas?: BN + public readonly baseFeePerGas?: bigint public readonly _common: Common @@ -99,24 +101,24 @@ export class BlockHeader { } = headerData return new BlockHeader( - parentHash ? toBuffer(parentHash) : zeros(32), - uncleHash ? toBuffer(uncleHash) : KECCAK256_RLP_ARRAY, - coinbase ? new Address(toBuffer(coinbase)) : Address.zero(), - stateRoot ? toBuffer(stateRoot) : zeros(32), - transactionsTrie ? toBuffer(transactionsTrie) : KECCAK256_RLP, - receiptTrie ? toBuffer(receiptTrie) : KECCAK256_RLP, - logsBloom ? toBuffer(logsBloom) : zeros(256), - difficulty ? new BN(toBuffer(difficulty)) : new BN(0), - number ? new BN(toBuffer(number)) : new BN(0), - gasLimit ? new BN(toBuffer(gasLimit)) : DEFAULT_GAS_LIMIT, - gasUsed ? new BN(toBuffer(gasUsed)) : new BN(0), - timestamp ? new BN(toBuffer(timestamp)) : new BN(0), - extraData ? toBuffer(extraData) : Buffer.from([]), - mixHash ? toBuffer(mixHash) : zeros(32), - nonce ? toBuffer(nonce) : zeros(8), + toType(parentHash, TypeOutput.Buffer) ?? zeros(32), + toType(uncleHash, TypeOutput.Buffer) ?? KECCAK256_RLP_ARRAY, + new Address(toType(coinbase, TypeOutput.Buffer) ?? Buffer.alloc(20)), + toType(stateRoot, TypeOutput.Buffer) ?? zeros(32), + toType(transactionsTrie, TypeOutput.Buffer) ?? KECCAK256_RLP, + toType(receiptTrie, TypeOutput.Buffer) ?? KECCAK256_RLP, + toType(logsBloom, TypeOutput.Buffer) ?? zeros(256), + toType(difficulty, TypeOutput.BigInt) ?? BigInt(0), + toType(number, TypeOutput.BigInt) ?? BigInt(0), + toType(gasLimit, TypeOutput.BigInt) ?? DEFAULT_GAS_LIMIT, + toType(gasUsed, TypeOutput.BigInt) ?? BigInt(0), + toType(timestamp, TypeOutput.BigInt) ?? BigInt(0), + toType(extraData, TypeOutput.Buffer) ?? Buffer.from([]), + toType(mixHash, TypeOutput.Buffer) ?? zeros(32), + toType(nonce, TypeOutput.Buffer) ?? zeros(8), opts, baseFeePerGas !== undefined && baseFeePerGas !== null - ? new BN(toBuffer(baseFeePerGas)) + ? toType(baseFeePerGas, TypeOutput.BigInt) : undefined ) } @@ -178,17 +180,17 @@ export class BlockHeader { toBuffer(transactionsTrie), toBuffer(receiptTrie), toBuffer(logsBloom), - new BN(toBuffer(difficulty)), - new BN(toBuffer(number)), - new BN(toBuffer(gasLimit)), - new BN(toBuffer(gasUsed)), - new BN(toBuffer(timestamp)), + bufferToBigInt(difficulty), + bufferToBigInt(number), + bufferToBigInt(gasLimit), + bufferToBigInt(gasUsed), + bufferToBigInt(timestamp), toBuffer(extraData), toBuffer(mixHash), toBuffer(nonce), opts, baseFeePerGas !== undefined && baseFeePerGas !== null - ? new BN(toBuffer(baseFeePerGas)) + ? bufferToBigInt(baseFeePerGas) : undefined ) } @@ -216,16 +218,16 @@ export class BlockHeader { transactionsTrie: Buffer, receiptTrie: Buffer, logsBloom: Buffer, - difficulty: BN, - number: BN, - gasLimit: BN, - gasUsed: BN, - timestamp: BN, + difficulty: bigint, + number: bigint, + gasLimit: bigint, + gasUsed: bigint, + timestamp: bigint, extraData: Buffer, mixHash: Buffer, nonce: Buffer, options: BlockOptions = {}, - baseFeePerGas?: BN + baseFeePerGas?: bigint ) { if (options.common) { this._common = options.common.copy() @@ -252,13 +254,13 @@ export class BlockHeader { if (this._common.isActivatedEIP(1559)) { if (baseFeePerGas === undefined) { const londonHfBlock = this._common.hardforkBlock(Hardfork.London) - const isInitialEIP1559Block = londonHfBlock && number.eq(londonHfBlock) + const isInitialEIP1559Block = londonHfBlock && number === londonHfBlock if (isInitialEIP1559Block) { - baseFeePerGas = new BN(this._common.param('gasConfig', 'initialBaseFee')) + baseFeePerGas = BigInt(this._common.param('gasConfig', 'initialBaseFee')) } else { // Minimum possible value for baseFeePerGas is 7, // so we use it as the default if the field is missing. - baseFeePerGas = new BN(7) + baseFeePerGas = BigInt(7) } } } else { @@ -268,15 +270,15 @@ export class BlockHeader { } if (options.initWithGenesisHeader) { - number = new BN(0) - if (gasLimit.eq(DEFAULT_GAS_LIMIT)) { - gasLimit = new BN(toBuffer(this._common.genesis().gasLimit)) + number = BigInt(0) + if (gasLimit === DEFAULT_GAS_LIMIT) { + gasLimit = BigInt(this._common.genesis().gasLimit) } - if (timestamp.isZero()) { - timestamp = new BN(toBuffer(this._common.genesis().timestamp)) + if (timestamp === BigInt(0)) { + timestamp = BigInt(this._common.genesis().timestamp ?? 0) } - if (difficulty.isZero()) { - difficulty = new BN(toBuffer(this._common.genesis().difficulty)) + if (difficulty === BigInt(0)) { + difficulty = BigInt(this._common.genesis().difficulty) } if (extraData.length === 0) { extraData = toBuffer(this._common.genesis().extraData) @@ -291,7 +293,7 @@ export class BlockHeader { this._common.gteHardfork(Hardfork.London) && this._common.genesis().baseFeePerGas !== undefined ) { - baseFeePerGas = new BN(toBuffer(this._common.genesis().baseFeePerGas)) + baseFeePerGas = BigInt(this._common.genesis().baseFeePerGas!) } } @@ -386,7 +388,7 @@ export class BlockHeader { if (nonce.length !== 8) { // Hack to check for Kovan due to non-standard nonce length (65 bytes) - if (this._common.networkId().eqn(42)) { + if (this._common.networkId() === BigInt(42)) { if (nonce.length !== 65) { const msg = this._errorMsg( `nonce must be 65 bytes on kovan, received ${nonce.length} bytes` @@ -410,7 +412,7 @@ export class BlockHeader { )} (expected: ${KECCAK256_RLP_ARRAY.toString('hex')})` error = true } - if (!difficulty.eq(new BN(0))) { + if (difficulty !== BigInt(0)) { errorMsg += `, difficulty: ${difficulty} (expected: 0)` error = true } @@ -436,7 +438,7 @@ export class BlockHeader { * * @param parentBlockHeader - the header from the parent `Block` of this header */ - canonicalDifficulty(parentBlockHeader: BlockHeader): BN { + canonicalDifficulty(parentBlockHeader: BlockHeader): bigint { if (this._common.consensusType() !== ConsensusType.ProofOfWork) { const msg = this._errorMsg('difficulty calculation is only supported on PoW chains') throw new Error(msg) @@ -450,61 +452,62 @@ export class BlockHeader { const hardfork = this._common.hardfork() const blockTs = this.timestamp const { timestamp: parentTs, difficulty: parentDif } = parentBlockHeader - const minimumDifficulty = new BN( + const minimumDifficulty = BigInt( this._common.paramByHardfork('pow', 'minimumDifficulty', hardfork) ) - const offset = parentDif.div( - new BN(this._common.paramByHardfork('pow', 'difficultyBoundDivisor', hardfork)) - ) - let num = this.number.clone() + const offset = + parentDif / BigInt(this._common.paramByHardfork('pow', 'difficultyBoundDivisor', hardfork)) + let num = this.number // We use a ! here as TS cannot follow this hardfork-dependent logic, but it always gets assigned - let dif!: BN + let dif!: bigint if (this._common.hardforkGteHardfork(hardfork, Hardfork.Byzantium)) { // max((2 if len(parent.uncles) else 1) - ((timestamp - parent.timestamp) // 9), -99) (EIP100) const uncleAddend = parentBlockHeader.uncleHash.equals(KECCAK256_RLP_ARRAY) ? 1 : 2 - let a = blockTs.sub(parentTs).idivn(9).ineg().iaddn(uncleAddend) - const cutoff = new BN(-99) + let a = BigInt(uncleAddend) - (blockTs - parentTs) / BigInt(9) + const cutoff = BigInt(-99) // MAX(cutoff, a) - if (cutoff.gt(a)) { + if (cutoff > a) { a = cutoff } - dif = parentDif.add(offset.mul(a)) + dif = parentDif + offset * a } if (this._common.hardforkGteHardfork(hardfork, Hardfork.Byzantium)) { // Get delay as parameter from common - num.isubn(this._common.param('pow', 'difficultyBombDelay')) - if (num.ltn(0)) { - num = new BN(0) + num = num - BigInt(this._common.param('pow', 'difficultyBombDelay')) + if (num < BigInt(0)) { + num = BigInt(0) } } else if (this._common.hardforkGteHardfork(hardfork, Hardfork.Homestead)) { // 1 - (block_timestamp - parent_timestamp) // 10 - let a = blockTs.sub(parentTs).idivn(10).ineg().iaddn(1) - const cutoff = new BN(-99) + let a = BigInt(1) - (blockTs - parentTs) / BigInt(10) + const cutoff = BigInt(-99) // MAX(cutoff, a) - if (cutoff.gt(a)) { + if (cutoff > a) { a = cutoff } - dif = parentDif.add(offset.mul(a)) + dif = parentDif + offset * a } else { // pre-homestead if ( - parentTs.addn(this._common.paramByHardfork('pow', 'durationLimit', hardfork)).gt(blockTs) + parentTs + BigInt(this._common.paramByHardfork('pow', 'durationLimit', hardfork)) > + blockTs ) { - dif = offset.add(parentDif) + dif = offset + parentDif } else { - dif = parentDif.sub(offset) + dif = parentDif - offset } } - const exp = num.divn(100000).isubn(2) - if (!exp.isNeg()) { - dif.iadd(new BN(2).pow(exp)) + const exp = num / BigInt(100000) - BigInt(2) + if (exp >= 0) { + // eslint-disable-next-line + dif = dif + BigInt(2) ** exp } - if (dif.lt(minimumDifficulty)) { + if (dif < minimumDifficulty) { dif = minimumDifficulty } @@ -517,7 +520,7 @@ export class BlockHeader { * @param parentBlockHeader - the header from the parent `Block` of this header */ validateDifficulty(parentBlockHeader: BlockHeader): boolean { - return this.canonicalDifficulty(parentBlockHeader).eq(this.difficulty) + return this.canonicalDifficulty(parentBlockHeader) === this.difficulty } /** @@ -526,7 +529,7 @@ export class BlockHeader { */ validateCliqueDifficulty(blockchain: Blockchain): boolean { this._requireClique('validateCliqueDifficulty') - if (!this.difficulty.eq(CLIQUE_DIFF_INTURN) && !this.difficulty.eq(CLIQUE_DIFF_NOTURN)) { + if (this.difficulty !== CLIQUE_DIFF_INTURN && this.difficulty !== CLIQUE_DIFF_NOTURN) { const msg = this._errorMsg( `difficulty for clique block must be INTURN (2) or NOTURN (1), received: ${this.difficulty}` ) @@ -544,10 +547,10 @@ export class BlockHeader { return true } const signerIndex = signers.findIndex((address: Address) => address.equals(this.cliqueSigner())) - const inTurn = this.number.modn(signers.length) === signerIndex + const inTurn = this.number % BigInt(signers.length) === BigInt(signerIndex) if ( - (inTurn && this.difficulty.eq(CLIQUE_DIFF_INTURN)) || - (!inTurn && this.difficulty.eq(CLIQUE_DIFF_NOTURN)) + (inTurn && this.difficulty === CLIQUE_DIFF_INTURN) || + (!inTurn && this.difficulty === CLIQUE_DIFF_NOTURN) ) { return true } @@ -565,23 +568,23 @@ export class BlockHeader { // EIP-1559: assume double the parent gas limit on fork block // to adopt to the new gas target centered logic const londonHardforkBlock = this._common.hardforkBlock(Hardfork.London) - if (londonHardforkBlock && this.number.eq(londonHardforkBlock)) { - const elasticity = new BN(this._common.param('gasConfig', 'elasticityMultiplier')) - parentGasLimit = parentGasLimit.mul(elasticity) + if (londonHardforkBlock && this.number === londonHardforkBlock) { + const elasticity = BigInt(this._common.param('gasConfig', 'elasticityMultiplier')) + parentGasLimit = parentGasLimit * elasticity } const gasLimit = this.gasLimit const hardfork = this._common.hardfork() - const a = parentGasLimit.div( - new BN(this._common.paramByHardfork('gasConfig', 'gasLimitBoundDivisor', hardfork)) - ) - const maxGasLimit = parentGasLimit.add(a) - const minGasLimit = parentGasLimit.sub(a) + const a = + parentGasLimit / + BigInt(this._common.paramByHardfork('gasConfig', 'gasLimitBoundDivisor', hardfork)) + const maxGasLimit = parentGasLimit + a + const minGasLimit = parentGasLimit - a const result = - gasLimit.lt(maxGasLimit) && - gasLimit.gt(minGasLimit) && - gasLimit.gte(this._common.paramByHardfork('gasConfig', 'minGasLimit', hardfork)) + gasLimit < maxGasLimit && + gasLimit > minGasLimit && + gasLimit >= BigInt(this._common.paramByHardfork('gasConfig', 'minGasLimit', hardfork)) return result } @@ -603,7 +606,7 @@ export class BlockHeader { * @param blockchain - validate against an @ethereumjs/blockchain * @param height - If this is an uncle header, this is the height of the block that is including it */ - async validate(blockchain: Blockchain, height?: BN): Promise { + async validate(blockchain: Blockchain, height?: bigint): Promise { if (this.isGenesis()) { return } @@ -664,12 +667,12 @@ export class BlockHeader { } const { number } = this - if (!number.eq(parentHeader.number.addn(1))) { + if (number !== parentHeader.number + BigInt(1)) { const msg = this._errorMsg('invalid number') throw new Error(msg) } - if (this.timestamp.lte(parentHeader.timestamp)) { + if (this.timestamp <= parentHeader.timestamp) { const msg = this._errorMsg('invalid timestamp') throw new Error(msg) } @@ -677,7 +680,7 @@ export class BlockHeader { if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique) { const period = this._common.consensusConfig().period // Timestamp diff between blocks is lower than PERIOD (clique) - if (parentHeader.timestamp.addn(period).gt(this.timestamp)) { + if (parentHeader.timestamp + BigInt(period) > this.timestamp) { const msg = this._errorMsg('invalid timestamp diff (lower than period)') throw new Error(msg) } @@ -696,15 +699,15 @@ export class BlockHeader { } if (height) { - const dif = height.sub(parentHeader.number) - if (!(dif.ltn(8) && dif.gtn(1))) { + const dif = height - parentHeader.number + if (!(dif < BigInt(8) && dif > BigInt(1))) { const msg = this._errorMsg('uncle block has a parent that is too old or too young') throw new Error(msg) } } // check if the block used too much gas - if (this.gasUsed.gt(this.gasLimit)) { + if (this.gasUsed > this.gasLimit) { const msg = this._errorMsg('Invalid block: too much gas used') throw new Error(msg) } @@ -715,10 +718,10 @@ export class BlockHeader { throw new Error(msg) } const londonHfBlock = this._common.hardforkBlock(Hardfork.London) - const isInitialEIP1559Block = londonHfBlock && this.number.eq(londonHfBlock) + const isInitialEIP1559Block = londonHfBlock && this.number === londonHfBlock if (isInitialEIP1559Block) { - const initialBaseFee = new BN(this._common.param('gasConfig', 'initialBaseFee')) - if (!this.baseFeePerGas!.eq(initialBaseFee)) { + const initialBaseFee = BigInt(this._common.param('gasConfig', 'initialBaseFee')) + if (this.baseFeePerGas! !== initialBaseFee) { const msg = this._errorMsg('Initial EIP1559 block does not have initial base fee') throw new Error(msg) } @@ -726,7 +729,7 @@ export class BlockHeader { // check if the base fee is correct const expectedBaseFee = parentHeader.calcNextBaseFee() - if (!this.baseFeePerGas!.eq(expectedBaseFee)) { + if (this.baseFeePerGas! !== expectedBaseFee) { const msg = this._errorMsg('Invalid block: base fee not correct') throw new Error(msg) } @@ -737,37 +740,39 @@ export class BlockHeader { /** * Calculates the base fee for a potential next block */ - public calcNextBaseFee(): BN { + public calcNextBaseFee(): bigint { if (!this._common.isActivatedEIP(1559)) { const msg = this._errorMsg( 'calcNextBaseFee() can only be called with EIP1559 being activated' ) throw new Error(msg) } - let nextBaseFee: BN - const elasticity = new BN(this._common.param('gasConfig', 'elasticityMultiplier')) - const parentGasTarget = this.gasLimit.div(elasticity) + let nextBaseFee: bigint + const elasticity = BigInt(this._common.param('gasConfig', 'elasticityMultiplier')) + const parentGasTarget = this.gasLimit / elasticity - if (parentGasTarget.eq(this.gasUsed)) { + if (parentGasTarget === this.gasUsed) { nextBaseFee = this.baseFeePerGas! - } else if (this.gasUsed.gt(parentGasTarget)) { - const gasUsedDelta = this.gasUsed.sub(parentGasTarget) - const baseFeeMaxChangeDenominator = new BN( + } else if (this.gasUsed > parentGasTarget) { + const gasUsedDelta = this.gasUsed - parentGasTarget + const baseFeeMaxChangeDenominator = BigInt( this._common.param('gasConfig', 'baseFeeMaxChangeDenominator') ) - const calculatedDelta = this.baseFeePerGas!.mul(gasUsedDelta) - .div(parentGasTarget) - .div(baseFeeMaxChangeDenominator) - nextBaseFee = BN.max(calculatedDelta, new BN(1)).add(this.baseFeePerGas!) + const calculatedDelta = + (this.baseFeePerGas! * gasUsedDelta) / parentGasTarget / baseFeeMaxChangeDenominator + nextBaseFee = + (calculatedDelta > BigInt(1) ? calculatedDelta : BigInt(1)) + this.baseFeePerGas! } else { - const gasUsedDelta = parentGasTarget.sub(this.gasUsed) - const baseFeeMaxChangeDenominator = new BN( + const gasUsedDelta = parentGasTarget - this.gasUsed + const baseFeeMaxChangeDenominator = BigInt( this._common.param('gasConfig', 'baseFeeMaxChangeDenominator') ) - const calculatedDelta = this.baseFeePerGas!.mul(gasUsedDelta) - .div(parentGasTarget) - .div(baseFeeMaxChangeDenominator) - nextBaseFee = BN.max(this.baseFeePerGas!.sub(calculatedDelta), new BN(0)) + const calculatedDelta = + (this.baseFeePerGas! * gasUsedDelta) / parentGasTarget / baseFeeMaxChangeDenominator + nextBaseFee = + this.baseFeePerGas! - calculatedDelta > BigInt(0) + ? this.baseFeePerGas! - calculatedDelta + : BigInt(0) } return nextBaseFee } @@ -784,18 +789,18 @@ export class BlockHeader { this.transactionsTrie, this.receiptTrie, this.logsBloom, - bnToUnpaddedBuffer(this.difficulty), - bnToUnpaddedBuffer(this.number), - bnToUnpaddedBuffer(this.gasLimit), - bnToUnpaddedBuffer(this.gasUsed), - bnToUnpaddedBuffer(this.timestamp), + bigIntToUnpaddedBuffer(this.difficulty), + bigIntToUnpaddedBuffer(this.number), + bigIntToUnpaddedBuffer(this.gasLimit), + bigIntToUnpaddedBuffer(this.gasUsed), + bigIntToUnpaddedBuffer(this.timestamp ?? BigInt(0)), this.extraData, this.mixHash, this.nonce, ] if (this._common.isActivatedEIP(1559)) { - rawItems.push(bnToUnpaddedBuffer(this.baseFeePerGas!)) + rawItems.push(bigIntToUnpaddedBuffer(this.baseFeePerGas!)) } return rawItems @@ -819,7 +824,7 @@ export class BlockHeader { * Checks if the block header is a genesis header. */ isGenesis(): boolean { - return this.number.isZero() + return this.number === BigInt(0) } private _requireClique(name: string) { @@ -847,10 +852,10 @@ export class BlockHeader { */ cliqueIsEpochTransition(): boolean { this._requireClique('cliqueIsEpochTransition') - const epoch = new BN(this._common.consensusConfig().epoch) + const epoch = BigInt(this._common.consensusConfig().epoch) // Epoch transition block if the block number has no // remainder on the division by the epoch length - return this.number.mod(epoch).isZero() + return this.number % epoch === BigInt(0) } /** @@ -941,7 +946,7 @@ export class BlockHeader { } const r = extraSeal.slice(0, 32) const s = extraSeal.slice(32, 64) - const v = new BN(extraSeal.slice(64, 65)).addn(27) + const v = bufferToBigInt(extraSeal.slice(64, 65)) + BigInt(27) const pubKey = ecrecover(this.cliqueSigHash(), v, r, s) return Address.fromPublicKey(pubKey) } @@ -965,17 +970,17 @@ export class BlockHeader { transactionsTrie: '0x' + this.transactionsTrie.toString('hex'), receiptTrie: '0x' + this.receiptTrie.toString('hex'), logsBloom: '0x' + this.logsBloom.toString('hex'), - difficulty: bnToHex(this.difficulty), - number: bnToHex(this.number), - gasLimit: bnToHex(this.gasLimit), - gasUsed: bnToHex(this.gasUsed), - timestamp: bnToHex(this.timestamp), + difficulty: bigIntToHex(this.difficulty), + number: bigIntToHex(this.number), + gasLimit: bigIntToHex(this.gasLimit), + gasUsed: bigIntToHex(this.gasUsed), + timestamp: bigIntToHex(this.timestamp), extraData: '0x' + this.extraData.toString('hex'), mixHash: '0x' + this.mixHash.toString('hex'), nonce: '0x' + this.nonce.toString('hex'), } if (this._common.isActivatedEIP(1559)) { - jsonDict.baseFeePerGas = '0x' + this.baseFeePerGas!.toString('hex') + jsonDict.baseFeePerGas = bigIntToHex(this.baseFeePerGas!) } return jsonDict } @@ -1005,13 +1010,17 @@ export class BlockHeader { return } const DAOActivationBlock = this._common.hardforkBlock(Hardfork.Dao) - if (!DAOActivationBlock || DAOActivationBlock.isZero() || this.number.lt(DAOActivationBlock)) { + if ( + !DAOActivationBlock || + DAOActivationBlock === BigInt(0) || + this.number < DAOActivationBlock + ) { return } const DAO_ExtraData = Buffer.from('64616f2d686172642d666f726b', 'hex') - const DAO_ForceExtraDataRange = new BN(9) - const drift = this.number.sub(DAOActivationBlock) - if (drift.lte(DAO_ForceExtraDataRange) && !this.extraData.equals(DAO_ExtraData)) { + const DAO_ForceExtraDataRange = BigInt(9) + const drift = this.number - DAOActivationBlock + if (drift <= DAO_ForceExtraDataRange && !this.extraData.equals(DAO_ExtraData)) { const msg = this._errorMsg("extraData should be 'dao-hard-fork'") throw new Error(msg) } diff --git a/packages/block/src/types.ts b/packages/block/src/types.ts index 541866294a3..a04078b006b 100644 --- a/packages/block/src/types.ts +++ b/packages/block/src/types.ts @@ -1,4 +1,4 @@ -import { AddressLike, BNLike, BufferLike } from 'ethereumjs-util' +import { AddressLike, BigIntLike, BufferLike } from 'ethereumjs-util' import Common from '@ethereumjs/common' import { TxData, JsonTx, AccessListEIP2930TxData, FeeMarketEIP1559TxData } from '@ethereumjs/tx' import { Block } from './block' @@ -38,7 +38,7 @@ export interface BlockOptions { * e.g. both Merge and Shanghai HF blocks set and the block number from the block provided * pointing to a Shanghai block: this will lead to set the HF as Shanghai and not the Merge). */ - hardforkByTD?: BNLike + hardforkByTD?: BigIntLike /** * Turns the block header into the canonical genesis block header * @@ -90,15 +90,15 @@ export interface HeaderData { transactionsTrie?: BufferLike receiptTrie?: BufferLike logsBloom?: BufferLike - difficulty?: BNLike - number?: BNLike - gasLimit?: BNLike - gasUsed?: BNLike - timestamp?: BNLike + difficulty?: BigIntLike + number?: BigIntLike + gasLimit?: BigIntLike + gasUsed?: BigIntLike + timestamp?: BigIntLike extraData?: BufferLike mixHash?: BufferLike nonce?: BufferLike - baseFeePerGas?: BNLike + baseFeePerGas?: BigIntLike } /** diff --git a/packages/block/test/block.spec.ts b/packages/block/test/block.spec.ts index bdc5eed4139..a0e9009f233 100644 --- a/packages/block/test/block.spec.ts +++ b/packages/block/test/block.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { BN, keccak256, rlp, zeros, toBuffer } from 'ethereumjs-util' +import { keccak256, rlp, zeros, toBuffer } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block, BlockBuffer, BlockHeader } from '../src' import blockFromRpc from '../src/from-rpc' @@ -184,8 +184,8 @@ tape('[Block]: block functions', function (t) { const parentBlock = Block.fromBlockData( { header: { - number: block.header.number.subn(1), - timestamp: block.header.timestamp.subn(1000), + number: block.header.number - BigInt(1), + timestamp: block.header.timestamp - BigInt(1000), gasLimit: block.header.gasLimit, }, }, @@ -233,7 +233,7 @@ tape('[Block]: block functions', function (t) { const blockRlp = toBuffer(testDataPreLondon.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp, { common, freeze: false }) await testTransactionValidation(st, block) - ;(block.transactions[0] as any).gasPrice = new BN(0) + ;(block.transactions[0] as any).gasPrice = BigInt(0) const result = block.validateTransactions(true) st.ok( result[0].includes('tx unable to pay base fee (non EIP-1559 tx)'), @@ -319,7 +319,7 @@ tape('[Block]: block functions', function (t) { const genesis = Block.genesis({}) await blockchain.putBlock(genesis) - const emptyBlock = Block.fromBlockData({ header: { number: new BN(1) } }, { common }) + const emptyBlock = Block.fromBlockData({ header: { number: BigInt(1) } }, { common }) //assertion if (emptyBlock.hash().equals(genesis.hash())) { @@ -409,11 +409,11 @@ tape('[Block]: block functions', function (t) { const uncleBlock = Block.fromBlockData( { header: { - number: genesis.header.number.addn(1), + number: genesis.header.number + BigInt(1), parentHash: genesis.hash(), - timestamp: genesis.header.timestamp.addn(1), - gasLimit: new BN(5000), - difficulty: new BN(0), // invalid difficulty + timestamp: genesis.header.timestamp + BigInt(1), + gasLimit: BigInt(5000), + difficulty: BigInt(0), // invalid difficulty }, }, { common } @@ -552,8 +552,8 @@ tape('[Block]: block functions', function (t) { const rootBlock = Block.fromBlockData( { header: { - number: mainnetForkBlock!.subn(3), - gasLimit: new BN(5000), + number: mainnetForkBlock! - BigInt(3), + gasLimit: BigInt(5000), }, }, { common } @@ -581,10 +581,10 @@ tape('[Block]: block functions', function (t) { await blockchain.putBlock(forkBlock) await preForkBlock.validate(blockchain) - st.ok(common.hardfork() === Hardfork.London, 'validation did not change common hardfork') + st.equal(common.hardfork(), Hardfork.London, 'validation did not change common hardfork') await forkBlock2.validate(blockchain) - st.ok(common.hardfork() === Hardfork.London, 'validation did not change common hardfork') + st.equal(common.hardfork(), Hardfork.London, 'validation did not change common hardfork') const forkBlock2HeaderData = forkBlock2.header.toJSON() const uncleHeaderData = unclePreFork.header.toJSON() @@ -610,7 +610,7 @@ tape('[Block]: block functions', function (t) { await forkBlock_ValidCommon.validate(blockchain) st.pass('successfully validated a pre-london uncle on a london block') - st.ok(common.hardfork() === Hardfork.London, 'validation did not change common hardfork') + st.equal(common.hardfork(), Hardfork.London, 'validation did not change common hardfork') const forkBlock_InvalidCommon = Block.fromBlockData( { @@ -633,7 +633,7 @@ tape('[Block]: block functions', function (t) { ) } - st.ok(common.hardfork() === Hardfork.London, 'validation did not change common hardfork') + st.equal(common.hardfork(), Hardfork.London, 'validation did not change common hardfork') } ) @@ -746,8 +746,8 @@ tape('[Block]: block functions', function (t) { const genesis = Block.genesis({}, { common }) const nextBlockHeaderData = { - number: genesis.header.number.addn(1), - timestamp: genesis.header.timestamp.addn(10), + number: genesis.header.number + BigInt(1), + timestamp: genesis.header.timestamp + BigInt(10), } const blockWithoutDifficultyCalculation = Block.fromBlockData({ @@ -755,8 +755,9 @@ tape('[Block]: block functions', function (t) { }) // test if difficulty defaults to 0 - st.ok( - blockWithoutDifficultyCalculation.header.difficulty.eqn(0), + st.equal( + blockWithoutDifficultyCalculation.header.difficulty, + BigInt(0), 'header difficulty should default to 0' ) @@ -771,13 +772,12 @@ tape('[Block]: block functions', function (t) { ) st.ok( - blockWithDifficultyCalculation.header.difficulty.gtn(0), + blockWithDifficultyCalculation.header.difficulty > BigInt(0), 'header difficulty should be set if difficulty header is given' ) st.ok( - blockWithDifficultyCalculation.header - .canonicalDifficulty(genesis.header) - .eq(blockWithDifficultyCalculation.header.difficulty), + blockWithDifficultyCalculation.header.canonicalDifficulty(genesis.header) === + blockWithDifficultyCalculation.header.difficulty, 'header difficulty is canonical difficulty if difficulty header is given' ) st.ok( @@ -787,8 +787,8 @@ tape('[Block]: block functions', function (t) { // test if we can provide a block which is too far ahead to still calculate difficulty const noParentHeaderData = { - number: genesis.header.number.addn(1337), - timestamp: genesis.header.timestamp.addn(10), + number: genesis.header.number + BigInt(1337), + timestamp: genesis.header.timestamp + BigInt(10), } const block_farAhead = Block.fromBlockData( @@ -801,7 +801,7 @@ tape('[Block]: block functions', function (t) { ) st.ok( - block_farAhead.header.difficulty.gtn(0), + block_farAhead.header.difficulty > BigInt(0), 'should allow me to provide a bogus next block to calculate difficulty on when providing a difficulty header' ) st.end() diff --git a/packages/block/test/difficulty.spec.ts b/packages/block/test/difficulty.spec.ts index f7a04e20f42..2a78f77c7ab 100644 --- a/packages/block/test/difficulty.spec.ts +++ b/packages/block/test/difficulty.spec.ts @@ -1,16 +1,8 @@ import tape from 'tape' import Common, { Chain } from '@ethereumjs/common' -import { BN, toBuffer, bufferToInt, isHexPrefixed } from 'ethereumjs-util' +import { bufferToInt } from 'ethereumjs-util' import { Block } from '../src' -function normalize(data: any) { - Object.keys(data).forEach((i) => { - if (i !== 'homestead' && typeof data[i] === 'string') { - data[i] = isHexPrefixed(data[i]) ? new BN(toBuffer(data[i])) : new BN(data[i]) - } - }) -} - function runDifficultyTests( st: tape.Test, test: any, @@ -18,9 +10,8 @@ function runDifficultyTests( block: Block, msg: string ) { - normalize(test) const dif = block.canonicalDifficulty(parentBlock) - st.ok(dif.eq(test.currentDifficulty), `test canonicalDifficulty: ${msg}`) + st.equal(dif, BigInt(test.currentDifficulty), `test canonicalDifficulty: ${msg}`) st.ok(block.validateDifficulty(parentBlock), `test validateDifficulty: ${msg}`) } diff --git a/packages/block/test/eip1559block.spec.ts b/packages/block/test/eip1559block.spec.ts index f6eb13f2e9e..a367ebb158c 100644 --- a/packages/block/test/eip1559block.spec.ts +++ b/packages/block/test/eip1559block.spec.ts @@ -1,7 +1,6 @@ import tape from 'tape' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { BlockHeader } from '../src/header' -import { BN } from 'ethereumjs-util' import { Mockchain } from './mockchain' import { Block } from '../src/block' import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' @@ -25,12 +24,12 @@ const genesis = Block.fromBlockData({}) // (Otherwise there would be need for a custom chain only for testing purposes) common.hardforkBlock = function (hardfork: string | undefined) { if (hardfork === 'london') { - return new BN(1) + return BigInt(1) } else if (hardfork === 'dao') { // Avoid DAO HF side-effects - return new BN(99) + return BigInt(99) } - return new BN(0) + return BigInt(0) } tape('EIP1559 tests', function (t) { @@ -45,11 +44,11 @@ tape('EIP1559 tests', function (t) { st.throws(() => { BlockHeader.fromHeaderData( { - number: new BN(1), + number: BigInt(1), parentHash: genesis.hash(), - timestamp: new BN(1), - gasLimit: genesis.header.gasLimit.muln(2), // Special case on EIP-1559 transition block - baseFeePerGas: new BN(5), + timestamp: BigInt(1), + gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block + baseFeePerGas: BigInt(5), }, { common, @@ -63,10 +62,10 @@ tape('EIP1559 tests', function (t) { t.test('Header -> validate()', async function (st) { const header = BlockHeader.fromHeaderData( { - number: new BN(1), + number: BigInt(1), parentHash: genesis.hash(), - gasLimit: genesis.header.gasLimit.muln(2), // Special case on EIP-1559 transition block - timestamp: new BN(1), + gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block + timestamp: BigInt(1), baseFeePerGas: 100, }, { @@ -98,18 +97,18 @@ tape('EIP1559 tests', function (t) { ) } - ;(header as any).baseFeePerGas = new BN(7) // reset for next test + ;(header as any).baseFeePerGas = BigInt(7) // reset for next test const block = Block.fromBlockData({ header }, { common }) try { const blockchain = Object.create(blockchain1) await blockchain.putBlock(block) const header = BlockHeader.fromHeaderData( { - number: new BN(2), + number: BigInt(2), parentHash: block.hash(), gasLimit: block.header.gasLimit, - timestamp: new BN(10), - baseFeePerGas: new BN(1000), + timestamp: BigInt(10), + baseFeePerGas: BigInt(1000), }, { calcDifficultyFromHeader: block.header, @@ -128,11 +127,11 @@ tape('EIP1559 tests', function (t) { const block1 = Block.fromBlockData( { header: { - number: new BN(1), + number: BigInt(1), parentHash: genesis.hash(), - gasLimit: genesis.header.gasLimit.muln(2), // Special case on EIP-1559 transition block - timestamp: new BN(1), - baseFeePerGas: new BN(common.param('gasConfig', 'initialBaseFee')), + gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block + timestamp: BigInt(1), + baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), }, }, { @@ -152,11 +151,11 @@ tape('EIP1559 tests', function (t) { t.test('Header -> validate()', async function (st) { const header = BlockHeader.fromHeaderData( { - baseFeePerGas: new BN(1000), - number: new BN(1), + baseFeePerGas: BigInt(1000), + number: BigInt(1), parentHash: genesis.hash(), - gasLimit: genesis.header.gasLimit.muln(2), // Special case on EIP-1559 transition block - timestamp: new BN(1), + gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block + timestamp: BigInt(1), }, { calcDifficultyFromHeader: genesis.header, @@ -177,10 +176,10 @@ tape('EIP1559 tests', function (t) { const block = Block.fromBlockData( { header: { - number: new BN(2), + number: BigInt(2), parentHash: block1.hash(), - timestamp: new BN(2), - gasLimit: genesis.header.gasLimit.muln(2), // Special case on EIP-1559 transition block + timestamp: BigInt(2), + gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block baseFeePerGas: Buffer.from('342770c0', 'hex'), }, }, @@ -198,14 +197,14 @@ tape('EIP1559 tests', function (t) { t.test('Header -> validate() -> gas usage', async function (st) { const header = BlockHeader.fromHeaderData( { - number: new BN(1), + number: BigInt(1), parentHash: genesis.hash(), - timestamp: new BN(1), - gasLimit: genesis.header.gasLimit.muln(2), // Special case on EIP-1559 transition block - gasUsed: genesis.header.gasLimit - .muln(common.param('gasConfig', 'elasticityMultiplier')) - .addn(1), - baseFeePerGas: new BN(common.param('gasConfig', 'initialBaseFee')), + timestamp: BigInt(1), + gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block + gasUsed: + genesis.header.gasLimit * BigInt(common.param('gasConfig', 'elasticityMultiplier')) + + BigInt(1), + baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), }, { calcDifficultyFromHeader: genesis.header, @@ -225,12 +224,12 @@ tape('EIP1559 tests', function (t) { t.test('Header -> validate() -> gas usage', async function (st) { const header = BlockHeader.fromHeaderData( { - number: new BN(1), + number: BigInt(1), parentHash: genesis.hash(), - timestamp: new BN(1), - gasLimit: genesis.header.gasLimit.muln(2), // Special case on EIP-1559 transition block - gasUsed: genesis.header.gasLimit.muln(2), - baseFeePerGas: new BN(common.param('gasConfig', 'initialBaseFee')), + timestamp: BigInt(1), + gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block + gasUsed: genesis.header.gasLimit * BigInt(2), + baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), }, { calcDifficultyFromHeader: genesis.header, @@ -244,14 +243,14 @@ tape('EIP1559 tests', function (t) { }) t.test('Header -> validate() -> gasLimit -> success cases', async function (st) { - let parentGasLimit = genesis.header.gasLimit.muln(2) + let parentGasLimit = genesis.header.gasLimit * BigInt(2) let header = BlockHeader.fromHeaderData( { - number: new BN(1), + number: BigInt(1), parentHash: genesis.hash(), - timestamp: new BN(1), - gasLimit: parentGasLimit.add(parentGasLimit.divn(1024)).subn(1), - baseFeePerGas: new BN(common.param('gasConfig', 'initialBaseFee')), + timestamp: BigInt(1), + gasLimit: parentGasLimit + parentGasLimit / BigInt(1024) - BigInt(1), + baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), }, { calcDifficultyFromHeader: genesis.header, @@ -263,11 +262,11 @@ tape('EIP1559 tests', function (t) { header = BlockHeader.fromHeaderData( { - number: new BN(1), + number: BigInt(1), parentHash: genesis.hash(), - timestamp: new BN(1), - gasLimit: parentGasLimit.sub(parentGasLimit.divn(1024)).addn(1), - baseFeePerGas: new BN(common.param('gasConfig', 'initialBaseFee')), + timestamp: BigInt(1), + gasLimit: parentGasLimit - parentGasLimit / BigInt(1024) + BigInt(1), + baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), }, { calcDifficultyFromHeader: genesis.header, @@ -280,10 +279,10 @@ tape('EIP1559 tests', function (t) { parentGasLimit = block1.header.gasLimit header = BlockHeader.fromHeaderData( { - number: new BN(2), + number: BigInt(2), parentHash: block1.hash(), - timestamp: new BN(2), - gasLimit: parentGasLimit.add(parentGasLimit.divn(1024)).subn(1), + timestamp: BigInt(2), + gasLimit: parentGasLimit + parentGasLimit / BigInt(1024) - BigInt(1), baseFeePerGas: Buffer.from('342770c0', 'hex'), }, { @@ -296,10 +295,10 @@ tape('EIP1559 tests', function (t) { header = BlockHeader.fromHeaderData( { - number: new BN(2), + number: BigInt(2), parentHash: block1.hash(), - timestamp: new BN(2), - gasLimit: parentGasLimit.sub(parentGasLimit.divn(1024)).addn(1), + timestamp: BigInt(2), + gasLimit: parentGasLimit - parentGasLimit / BigInt(1024) + BigInt(1), baseFeePerGas: Buffer.from('342770c0', 'hex'), }, { @@ -313,14 +312,14 @@ tape('EIP1559 tests', function (t) { }) t.test('Header -> validate() -> gasLimit -> error cases', async function (st) { - let parentGasLimit = genesis.header.gasLimit.muln(2) + let parentGasLimit = genesis.header.gasLimit * BigInt(2) let header = BlockHeader.fromHeaderData( { - number: new BN(1), + number: BigInt(1), parentHash: genesis.hash(), - timestamp: new BN(1), - gasLimit: parentGasLimit.add(parentGasLimit.divn(1024)), - baseFeePerGas: new BN(common.param('gasConfig', 'initialBaseFee')), + timestamp: BigInt(1), + gasLimit: parentGasLimit + parentGasLimit / BigInt(1024), + baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), }, { calcDifficultyFromHeader: genesis.header, @@ -340,10 +339,10 @@ tape('EIP1559 tests', function (t) { parentGasLimit = block1.header.gasLimit header = BlockHeader.fromHeaderData( { - number: new BN(2), + number: BigInt(2), parentHash: block1.hash(), - timestamp: new BN(2), - gasLimit: parentGasLimit.add(parentGasLimit.divn(1024)), + timestamp: BigInt(2), + gasLimit: parentGasLimit + parentGasLimit / BigInt(1024), baseFeePerGas: Buffer.from('342770c0', 'hex'), }, { @@ -364,14 +363,14 @@ tape('EIP1559 tests', function (t) { }) t.test('Header -> validate() -> gasLimit -> error cases', async function (st) { - let parentGasLimit = genesis.header.gasLimit.muln(2) + let parentGasLimit = genesis.header.gasLimit * BigInt(2) let header = BlockHeader.fromHeaderData( { - number: new BN(1), + number: BigInt(1), parentHash: genesis.hash(), - timestamp: new BN(1), - gasLimit: parentGasLimit.sub(parentGasLimit.divn(1024)), - baseFeePerGas: new BN(common.param('gasConfig', 'initialBaseFee')), + timestamp: BigInt(1), + gasLimit: parentGasLimit - parentGasLimit / BigInt(1024), + baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), }, { calcDifficultyFromHeader: genesis.header, @@ -391,10 +390,10 @@ tape('EIP1559 tests', function (t) { parentGasLimit = block1.header.gasLimit header = BlockHeader.fromHeaderData( { - number: new BN(2), + number: BigInt(2), parentHash: block1.hash(), - timestamp: new BN(2), - gasLimit: parentGasLimit.sub(parentGasLimit.divn(1024)), + timestamp: BigInt(2), + gasLimit: parentGasLimit - parentGasLimit / BigInt(1024), baseFeePerGas: Buffer.from('342770c0', 'hex'), }, { @@ -417,24 +416,24 @@ tape('EIP1559 tests', function (t) { t.test('Header -> validate() -> tx', async (st) => { const transaction = FeeMarketEIP1559Transaction.fromTxData( { - maxFeePerGas: new BN(0), - maxPriorityFeePerGas: new BN(0), + maxFeePerGas: BigInt(0), + maxPriorityFeePerGas: BigInt(0), }, { common } ).sign(Buffer.from('46'.repeat(32), 'hex')) const block = Block.fromBlockData( { header: { - number: new BN(1), + number: BigInt(1), parentHash: genesis.hash(), - gasLimit: genesis.header.gasLimit.muln(2), // Special case on EIP-1559 transition block - timestamp: new BN(1), - baseFeePerGas: new BN(common.param('gasConfig', 'initialBaseFee')), + gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block + timestamp: BigInt(1), + baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), }, transactions: [ { - maxFeePerGas: new BN(0), - maxPriorityFeePerGas: new BN(0), + maxFeePerGas: BigInt(0), + maxPriorityFeePerGas: BigInt(0), type: 2, v: transaction.v, r: transaction.r, @@ -466,14 +465,14 @@ tape('EIP1559 tests', function (t) { const item = eip1559BaseFee[index] const result = BlockHeader.fromHeaderData( { - baseFeePerGas: new BN(item.parentBaseFee), - gasUsed: new BN(item.parentGasUsed), - gasLimit: new BN(item.parentTargetGasUsed).muln(2), + baseFeePerGas: BigInt(item.parentBaseFee), + gasUsed: BigInt(item.parentGasUsed), + gasLimit: BigInt(item.parentTargetGasUsed) * BigInt(2), }, { common } ).calcNextBaseFee() - const expected = new BN(item.expectedBaseFee) - st.ok(expected.eq(result), 'base fee correct') + const expected = BigInt(item.expectedBaseFee) + st.equal(expected, result, 'base fee correct') } st.end() }) @@ -481,11 +480,11 @@ tape('EIP1559 tests', function (t) { t.test('Header -> toJSON()', function (st) { const header = BlockHeader.fromHeaderData( { - number: new BN(1), + number: BigInt(1), parentHash: genesis.hash(), - timestamp: new BN(1), + timestamp: BigInt(1), gasLimit: genesis.header.gasLimit, - baseFeePerGas: new BN(5), + baseFeePerGas: BigInt(5), }, { common, diff --git a/packages/block/test/header.spec.ts b/packages/block/test/header.spec.ts index 761734526e4..167f0f1ffc3 100644 --- a/packages/block/test/header.spec.ts +++ b/packages/block/test/header.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN, zeros, KECCAK256_RLP, KECCAK256_RLP_ARRAY, rlp } from 'ethereumjs-util' +import { Address, zeros, KECCAK256_RLP, KECCAK256_RLP_ARRAY, rlp } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { BlockHeader } from '../src/header' import { Block } from '../src' @@ -19,11 +19,11 @@ tape('[Block]: Header functions', function (t) { st.ok(header.transactionsTrie.equals(KECCAK256_RLP)) st.ok(header.receiptTrie.equals(KECCAK256_RLP)) st.ok(header.logsBloom.equals(zeros(256))) - st.ok(header.difficulty.isZero()) - st.ok(header.number.isZero()) - st.ok(header.gasLimit.eq(new BN(Buffer.from('ffffffffffffff', 'hex')))) - st.ok(header.gasUsed.isZero()) - st.ok(header.timestamp.isZero()) + st.equal(header.difficulty, BigInt(0)) + st.equal(header.number, BigInt(0)) + st.equal(header.gasLimit, BigInt('0xffffffffffffff')) + st.equal(header.gasUsed, BigInt(0)) + st.equal(header.timestamp, BigInt(0)) st.ok(header.extraData.equals(Buffer.from([]))) st.ok(header.mixHash.equals(zeros(32))) st.ok(header.nonce.equals(zeros(8))) @@ -205,7 +205,7 @@ tape('[Block]: Header functions', function (t) { parentHash = genesis.hash() gasLimit = genesis.header.gasLimit - data = { number, parentHash, timestamp, gasLimit, difficulty: new BN(1) } as any + data = { number, parentHash, timestamp, gasLimit, difficulty: BigInt(1) } as any opts = { common } as any // valid extraData (32 byte vanity + 65 byte seal) @@ -244,7 +244,7 @@ tape('[Block]: Header functions', function (t) { Buffer.alloc(20), Buffer.alloc(21), ]) - const epoch = new BN(common.consensusConfig().epoch) + const epoch = BigInt(common.consensusConfig().epoch) header = BlockHeader.fromHeaderData({ ...data, number: epoch, extraData }, opts) try { await header.validate(blockchain) @@ -271,10 +271,10 @@ tape('[Block]: Header functions', function (t) { await blockchain.putBlock(block) headerData.number = 1 - headerData.timestamp = new BN(1422494850) + headerData.timestamp = BigInt(1422494850) headerData.extraData = Buffer.alloc(97) headerData.mixHash = Buffer.alloc(32) - headerData.difficulty = new BN(2) + headerData.difficulty = BigInt(2) let testCase = 'should throw on lower than period timestamp diffs' let header = BlockHeader.fromHeaderData(headerData, { common }) @@ -286,7 +286,7 @@ tape('[Block]: Header functions', function (t) { } testCase = 'should not throw on timestamp diff equal to period' - headerData.timestamp = new BN(1422494864) + headerData.timestamp = BigInt(1422494864) header = BlockHeader.fromHeaderData(headerData, { common }) try { await header.validate(blockchain) @@ -328,7 +328,7 @@ tape('[Block]: Header functions', function (t) { headerData.mixHash = Buffer.alloc(32) testCase = 'should throw on invalid clique difficulty' - headerData.difficulty = new BN(3) + headerData.difficulty = BigInt(3) header = BlockHeader.fromHeaderData(headerData, { common }) try { header.validateCliqueDifficulty(blockchain) @@ -342,7 +342,7 @@ tape('[Block]: Header functions', function (t) { } testCase = 'validateCliqueDifficulty() should return true with NOTURN difficulty and one signer' - headerData.difficulty = new BN(2) + headerData.difficulty = BigInt(2) const poaBlockchain = new PoaMockchain() const cliqueSigner = Buffer.from( '64bf9cc30328b0e42387b3c82c614e6386259136235e20c1357bd11cdee86993', @@ -364,7 +364,7 @@ tape('[Block]: Header functions', function (t) { testCase = 'validateCliqueDifficulty() should return false with INTURN difficulty and one signer' - headerData.difficulty = new BN(1) + headerData.difficulty = BigInt(1) header = BlockHeader.fromHeaderData(headerData, { common, cliqueSigner }) try { const res = header.validateCliqueDifficulty(poaBlockchain) @@ -454,7 +454,7 @@ tape('[Block]: Header functions', function (t) { { baseChain: Chain.Mainnet, hardfork: Hardfork.London } ) const header = BlockHeader.fromHeaderData({}, { common, initWithGenesisHeader: true }) - st.ok(header.baseFeePerGas!.eq(new BN('1000', 16)), 'correct baseFeePerGas') + st.equal(header.baseFeePerGas!, BigInt(0x1000), 'correct baseFeePerGas') st.end() }) }) diff --git a/packages/block/test/mergeBlock.spec.ts b/packages/block/test/mergeBlock.spec.ts index 9e598a0bef2..3e1c0eb241d 100644 --- a/packages/block/test/mergeBlock.spec.ts +++ b/packages/block/test/mergeBlock.spec.ts @@ -1,7 +1,7 @@ import tape from 'tape' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { BlockHeader } from '../src/header' -import { Address, BN, KECCAK256_RLP, KECCAK256_RLP_ARRAY, zeros } from 'ethereumjs-util' +import { Address, KECCAK256_RLP, KECCAK256_RLP_ARRAY, zeros } from 'ethereumjs-util' import { Block } from '../src/block' const common = new Common({ @@ -17,13 +17,13 @@ function validateMergeHeader(st: tape.Test, header: BlockHeader) { st.ok(header.transactionsTrie.equals(KECCAK256_RLP), 'transactionsTrie') st.ok(header.receiptTrie.equals(KECCAK256_RLP), 'receiptTrie') st.ok(header.logsBloom.equals(zeros(256)), 'logsBloom') - st.ok(header.difficulty.isZero(), 'difficulty') - st.ok(header.number.isZero(), 'number') - st.ok(header.gasLimit.eq(new BN(Buffer.from('ffffffffffffff', 'hex'))), 'gasLimit') - st.ok(header.gasUsed.isZero(), 'gasUsed') - st.ok(header.timestamp.isZero(), 'timestamp') + st.equal(header.difficulty, BigInt(0), 'difficulty') + st.equal(header.number, BigInt(0), 'number') + st.equal(header.gasLimit, BigInt('0xffffffffffffff'), 'gasLimit') + st.equal(header.gasUsed, BigInt(0), 'gasUsed') + st.equal(header.timestamp, BigInt(0), 'timestamp') st.ok(header.extraData.length <= 32, 'extraData') - st.ok(header.mixHash.length === 32, 'mixHash') + st.equal(header.mixHash.length, 32, 'mixHash') st.ok(header.nonce.equals(zeros(8)), 'nonce') } @@ -52,7 +52,7 @@ tape('[Header]: Casper PoS / The Merge Functionality', function (t) { try { const headerData = { - difficulty: new BN(123456), + difficulty: BigInt(123456), } BlockHeader.fromHeaderData(headerData, { common }) st.fail('should throw') diff --git a/packages/block/test/util.ts b/packages/block/test/util.ts index 22d6fb9531f..1b250b314be 100644 --- a/packages/block/test/util.ts +++ b/packages/block/test/util.ts @@ -1,5 +1,5 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { BN, rlp, keccak256 } from 'ethereumjs-util' +import { rlp, keccak256 } from 'ethereumjs-util' import { Block, BlockHeader } from '../src' /** @@ -21,12 +21,12 @@ function createBlock( throw new Error('extra data graffiti must be 32 bytes or less') } - const number = parentBlock.header.number.addn(1) - const timestamp = parentBlock.header.timestamp.addn(1) + const number = parentBlock.header.number + BigInt(1) + const timestamp = parentBlock.header.timestamp + BigInt(1) const londonHfBlock = common.hardforkBlock(Hardfork.London) const baseFeePerGas = - londonHfBlock && number.gt(londonHfBlock) ? parentBlock.header.calcNextBaseFee() : undefined + londonHfBlock && number > londonHfBlock ? parentBlock.header.calcNextBaseFee() : undefined return Block.fromBlockData( { @@ -34,7 +34,7 @@ function createBlock( number, parentHash: parentBlock.hash(), timestamp, - gasLimit: new BN(5000), + gasLimit: BigInt(5000), extraData: Buffer.from(extraData), uncleHash: keccak256(rlp.encode(uncles.map((uh) => uh.raw()))), baseFeePerGas, diff --git a/packages/blockchain/src/clique.ts b/packages/blockchain/src/clique.ts index 93c25d01bec..563f9ee2852 100644 --- a/packages/blockchain/src/clique.ts +++ b/packages/blockchain/src/clique.ts @@ -1,15 +1,15 @@ -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' // Clique Signer State: [blockNumber, signers] -export type CliqueSignerState = [BN, Address[]] +export type CliqueSignerState = [bigint, Address[]] export type CliqueLatestSignerStates = CliqueSignerState[] // Clique Vote: [blockNumber, [signer, beneficiary, cliqueNonce]] -export type CliqueVote = [BN, [Address, Address, Buffer]] +export type CliqueVote = [bigint, [Address, Address, Buffer]] export type CliqueLatestVotes = CliqueVote[] // Clique Block Signer: [blockNumber, signer] -export type CliqueBlockSigner = [BN, Address] +export type CliqueBlockSigner = [bigint, Address] export type CliqueLatestBlockSigners = CliqueBlockSigner[] // Magic nonce number to vote on adding a new signer diff --git a/packages/blockchain/src/db/constants.ts b/packages/blockchain/src/db/constants.ts index 6eb631b1e9c..2b0cbda70d2 100644 --- a/packages/blockchain/src/db/constants.ts +++ b/packages/blockchain/src/db/constants.ts @@ -1,4 +1,4 @@ -import { BN } from 'ethereumjs-util' +import { bigIntToBuffer } from 'ethereumjs-util' // Geth compatible DB keys @@ -57,17 +57,18 @@ const BODY_PREFIX = Buffer.from('b') // Utility functions /** - * Convert BN to big endian Buffer + * Convert bigint to big endian Buffer */ -const bufBE8 = (n: BN) => n.toArrayLike(Buffer, 'be', 8) +const bufBE8 = (n: bigint) => bigIntToBuffer(BigInt.asUintN(64, n)) -const tdKey = (n: BN, hash: Buffer) => Buffer.concat([HEADER_PREFIX, bufBE8(n), hash, TD_SUFFIX]) +const tdKey = (n: bigint, hash: Buffer) => + Buffer.concat([HEADER_PREFIX, bufBE8(n), hash, TD_SUFFIX]) -const headerKey = (n: BN, hash: Buffer) => Buffer.concat([HEADER_PREFIX, bufBE8(n), hash]) +const headerKey = (n: bigint, hash: Buffer) => Buffer.concat([HEADER_PREFIX, bufBE8(n), hash]) -const bodyKey = (n: BN, hash: Buffer) => Buffer.concat([BODY_PREFIX, bufBE8(n), hash]) +const bodyKey = (n: bigint, hash: Buffer) => Buffer.concat([BODY_PREFIX, bufBE8(n), hash]) -const numberToHashKey = (n: BN) => Buffer.concat([HEADER_PREFIX, bufBE8(n), NUM_SUFFIX]) +const numberToHashKey = (n: bigint) => Buffer.concat([HEADER_PREFIX, bufBE8(n), NUM_SUFFIX]) const hashToNumberKey = (hash: Buffer) => Buffer.concat([BLOCK_HASH_PEFIX, hash]) diff --git a/packages/blockchain/src/db/helpers.ts b/packages/blockchain/src/db/helpers.ts index d70e485fc0b..f8ab286ccd7 100644 --- a/packages/blockchain/src/db/helpers.ts +++ b/packages/blockchain/src/db/helpers.ts @@ -1,5 +1,5 @@ import { DBOp, DBTarget } from './operation' -import { BN, rlp } from 'ethereumjs-util' +import { rlp } from 'ethereumjs-util' import { Block, BlockHeader } from '@ethereumjs/block' import { bufBE8 } from './constants' @@ -8,7 +8,7 @@ import { bufBE8 } from './constants' * and the DB operations from `db/operation.ts` and also handles the right encoding of the keys */ -function DBSetTD(TD: BN, blockNumber: BN, blockHash: Buffer): DBOp { +function DBSetTD(TD: bigint, blockNumber: bigint, blockHash: Buffer): DBOp { return DBOp.set(DBTarget.TotalDifficulty, rlp.encode(TD), { blockNumber, blockHash, @@ -37,7 +37,7 @@ function DBSetBlockOrHeader(blockBody: Block | BlockHeader): DBOp[] { }) ) - const isGenesis = header.number.eqn(0) + const isGenesis = header.number === BigInt(0) if ( isGenesis || @@ -55,14 +55,14 @@ function DBSetBlockOrHeader(blockBody: Block | BlockHeader): DBOp[] { return dbOps } -function DBSetHashToNumber(blockHash: Buffer, blockNumber: BN): DBOp { +function DBSetHashToNumber(blockHash: Buffer, blockNumber: bigint): DBOp { const blockNumber8Byte = bufBE8(blockNumber) return DBOp.set(DBTarget.HashToNumber, blockNumber8Byte, { blockHash, }) } -function DBSaveLookups(blockHash: Buffer, blockNumber: BN): DBOp[] { +function DBSaveLookups(blockHash: Buffer, blockNumber: bigint): DBOp[] { const ops = [] ops.push(DBOp.set(DBTarget.NumberToHash, blockHash, { blockNumber })) diff --git a/packages/blockchain/src/db/manager.ts b/packages/blockchain/src/db/manager.ts index 5a8241f1086..f89e00f1b22 100644 --- a/packages/blockchain/src/db/manager.ts +++ b/packages/blockchain/src/db/manager.ts @@ -1,4 +1,4 @@ -import { Address, BN, rlp } from 'ethereumjs-util' +import { Address, rlp, bufferToBigInt } from 'ethereumjs-util' import { Block, BlockHeader, BlockOptions, BlockBuffer, BlockBodyBuffer } from '@ethereumjs/block' import Common from '@ethereumjs/common' import { CliqueLatestSignerStates, CliqueLatestVotes, CliqueLatestBlockSigners } from '../clique' @@ -75,7 +75,7 @@ export class DBManager { const signerStates = await this.get(DBTarget.CliqueSignerStates) const states = (rlp.decode(signerStates)) as [Buffer, Buffer[]] return states.map((state) => { - const blockNum = new BN(state[0]) + const blockNum = bufferToBigInt(state[0] as Buffer) const addrs = (state[1]).map((buf: Buffer) => new Address(buf)) return [blockNum, addrs] }) as CliqueLatestSignerStates @@ -95,7 +95,7 @@ export class DBManager { const signerVotes = await this.get(DBTarget.CliqueVotes) const votes = (rlp.decode(signerVotes)) as [Buffer, [Buffer, Buffer, Buffer]] return votes.map((vote) => { - const blockNum = new BN(vote[0]) + const blockNum = bufferToBigInt(vote[0] as Buffer) const signer = new Address((vote[1] as any)[0]) const beneficiary = new Address((vote[1] as any)[1]) const nonce = (vote[1] as any)[2] @@ -117,7 +117,7 @@ export class DBManager { const blockSigners = await this.get(DBTarget.CliqueBlockSigners) const signers = (rlp.decode(blockSigners)) as [Buffer, Buffer][] return signers.map((s) => { - const blockNum = new BN(s[0]) + const blockNum = bufferToBigInt(s[0] as Buffer) const signer = new Address(s[1] as any) return [blockNum, signer] }) as CliqueLatestBlockSigners @@ -133,9 +133,9 @@ export class DBManager { * Fetches a block (header and body) given a block id, * which can be either its hash or its number. */ - async getBlock(blockId: Buffer | BN | number): Promise { + async getBlock(blockId: Buffer | bigint | number): Promise { if (typeof blockId === 'number' && Number.isInteger(blockId)) { - blockId = new BN(blockId) + blockId = BigInt(blockId) } let number @@ -143,7 +143,7 @@ export class DBManager { if (Buffer.isBuffer(blockId)) { hash = blockId number = await this.hashToNumber(blockId) - } else if (BN.isBN(blockId)) { + } else if (typeof blockId === 'bigint') { number = blockId hash = await this.numberToHash(blockId) } else { @@ -161,10 +161,10 @@ export class DBManager { } const blockData = [header.raw(), ...body] as BlockBuffer const opts: BlockOptions = { common: this._common } - if (number.isZero()) { + if (number === BigInt(0)) { opts.hardforkByBlockNumber = true } else { - opts.hardforkByTD = await this.getTotalDifficulty(header.parentHash, number.subn(1)) + opts.hardforkByTD = await this.getTotalDifficulty(header.parentHash, number - BigInt(1)) } return Block.fromValuesArray(blockData, opts) } @@ -172,7 +172,7 @@ export class DBManager { /** * Fetches body of a block given its hash and number. */ - async getBody(blockHash: Buffer, blockNumber: BN): Promise { + async getBody(blockHash: Buffer, blockNumber: bigint): Promise { const body = await this.get(DBTarget.Body, { blockHash, blockNumber }) return rlp.decode(body) as any as BlockBodyBuffer } @@ -180,14 +180,14 @@ export class DBManager { /** * Fetches header of a block given its hash and number. */ - async getHeader(blockHash: Buffer, blockNumber: BN) { + async getHeader(blockHash: Buffer, blockNumber: bigint) { const encodedHeader = await this.get(DBTarget.Header, { blockHash, blockNumber }) const opts: BlockOptions = { common: this._common } - if (blockNumber.isZero()) { + if (blockNumber === BigInt(0)) { opts.hardforkByBlockNumber = true } else { - const parentHash = await this.numberToHash(blockNumber.subn(1)) - opts.hardforkByTD = await this.getTotalDifficulty(parentHash, blockNumber.subn(1)) + const parentHash = await this.numberToHash(blockNumber - BigInt(1)) + opts.hardforkByTD = await this.getTotalDifficulty(parentHash, blockNumber - BigInt(1)) } return BlockHeader.fromRLPSerializedHeader(encodedHeader, opts) } @@ -195,24 +195,24 @@ export class DBManager { /** * Fetches total difficulty for a block given its hash and number. */ - async getTotalDifficulty(blockHash: Buffer, blockNumber: BN): Promise { + async getTotalDifficulty(blockHash: Buffer, blockNumber: bigint): Promise { const td = await this.get(DBTarget.TotalDifficulty, { blockHash, blockNumber }) - return new BN(rlp.decode(td)) + return bufferToBigInt(rlp.decode(td)) } /** * Performs a block hash to block number lookup. */ - async hashToNumber(blockHash: Buffer): Promise { + async hashToNumber(blockHash: Buffer): Promise { const value = await this.get(DBTarget.HashToNumber, { blockHash }) - return new BN(value) + return bufferToBigInt(value) } /** * Performs a block number to block hash lookup. */ - async numberToHash(blockNumber: BN): Promise { - if (blockNumber.ltn(0)) { + async numberToHash(blockNumber: bigint): Promise { + if (blockNumber < BigInt(0)) { throw new level.errors.NotFoundError() } diff --git a/packages/blockchain/src/db/operation.ts b/packages/blockchain/src/db/operation.ts index 857bc930715..254463dc932 100644 --- a/packages/blockchain/src/db/operation.ts +++ b/packages/blockchain/src/db/operation.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import { HEADS_KEY, HEAD_HEADER_KEY, @@ -43,7 +42,7 @@ export interface DBOpData { // a Database Key is identified by a block hash, a block number, or both export type DatabaseKey = { - blockNumber?: BN + blockNumber?: bigint blockHash?: Buffer } diff --git a/packages/blockchain/src/index.ts b/packages/blockchain/src/index.ts index 8e2ecd9e2ab..4c18d22bb88 100644 --- a/packages/blockchain/src/index.ts +++ b/packages/blockchain/src/index.ts @@ -1,6 +1,6 @@ import { debug as createDebugLogger } from 'debug' import Semaphore from 'semaphore-async-await' -import { Address, BN, rlp } from 'ethereumjs-util' +import { Address, rlp, bigIntToBuffer } from 'ethereumjs-util' import { Block, BlockData, BlockHeader } from '@ethereumjs/block' import Ethash from '@ethereumjs/ethash' import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '@ethereumjs/common' @@ -45,7 +45,7 @@ export interface BlockchainInterface { /** * Returns a block by its hash or number. */ - getBlock(blockId: Buffer | number | BN): Promise + getBlock(blockId: Buffer | number | bigint): Promise /** * Iterates through blocks starting at the specified iterator head and calls @@ -338,7 +338,7 @@ export default class Blockchain implements BlockchainInterface { private async _init(genesisBlock?: Block): Promise { let dbGenesisBlock try { - const genesisHash = await this.dbManager.numberToHash(new BN(0)) + const genesisHash = await this.dbManager.numberToHash(BigInt(0)) dbGenesisBlock = await this.dbManager.getBlock(genesisHash) } catch (error: any) { if (error.type !== 'NotFoundError') { @@ -366,9 +366,9 @@ export default class Blockchain implements BlockchainInterface { // If there is no genesis block put the genesis block in the DB. // For that TD, the BlockOrHeader, and the Lookups have to be saved. const dbOps: DBOp[] = [] - dbOps.push(DBSetTD(genesisBlock.header.difficulty.clone(), new BN(0), genesisHash)) + dbOps.push(DBSetTD(genesisBlock.header.difficulty, BigInt(0), genesisHash)) DBSetBlockOrHeader(genesisBlock).map((op) => dbOps.push(op)) - DBSaveLookups(genesisHash, new BN(0)).map((op) => dbOps.push(op)) + DBSaveLookups(genesisHash, BigInt(0)).map((op) => dbOps.push(op)) await this.dbManager.batch(dbOps) @@ -470,7 +470,7 @@ export default class Blockchain implements BlockchainInterface { * @hidden */ private cliqueCheckRecentlySigned(header: BlockHeader): boolean { - if (header.isGenesis() || header.number.eqn(1)) { + if (header.isGenesis() || header.number === BigInt(1)) { // skip genesis, first block return false } @@ -490,7 +490,7 @@ export default class Blockchain implements BlockchainInterface { */ private async cliqueSaveGenesisSigners(genesisBlock: Block) { const genesisSignerState: CliqueSignerState = [ - new BN(0), + BigInt(0), genesisBlock.header.cliqueEpochTransitionSigners(), ] await this.cliqueUpdateSignerStates(genesisSignerState) @@ -515,10 +515,10 @@ export default class Blockchain implements BlockchainInterface { const blockSigners = this._cliqueLatestBlockSigners const lastBlockNumber = blockSigners[blockSigners.length - 1]?.[0] if (lastBlockNumber) { - const blockLimit = lastBlockNumber.subn(limit) + const blockLimit = lastBlockNumber - BigInt(limit) const states = this._cliqueLatestSignerStates const lastItem = states[states.length - 1] - this._cliqueLatestSignerStates = states.filter((state) => state[0].gte(blockLimit)) + this._cliqueLatestSignerStates = states.filter((state) => state[0] >= blockLimit) if (this._cliqueLatestSignerStates.length === 0) { // always keep at least one item on the stack this._cliqueLatestSignerStates.push(lastItem) @@ -527,7 +527,7 @@ export default class Blockchain implements BlockchainInterface { // save to db const formatted = this._cliqueLatestSignerStates.map((state) => [ - state[0].toArrayLike(Buffer), + bigIntToBuffer(state[0]), state[1].map((a) => a.toBuffer()), ]) dbOps.push(DBOp.set(DBTarget.CliqueSignerStates, rlp.encode(formatted))) @@ -558,9 +558,8 @@ export default class Blockchain implements BlockchainInterface { // on the newly touched beneficiary, one with the added new vote for (let round = 1; round <= 2; round++) { // See if there is a new majority consensus to update the signer list - const lastEpochBlockNumber = header.number.sub( - header.number.mod(new BN(this._common.consensusConfig().epoch)) - ) + const lastEpochBlockNumber = + header.number - (header.number % BigInt(this._common.consensusConfig().epoch)) const limit = this.cliqueSignerLimit() let activeSigners = this.cliqueActiveSigners() let consensus = false @@ -568,7 +567,7 @@ export default class Blockchain implements BlockchainInterface { // AUTH vote analysis let votes = this._cliqueLatestVotes.filter((vote) => { return ( - vote[0].gte(lastEpochBlockNumber) && + vote[0] >= BigInt(lastEpochBlockNumber) && !vote[1][0].equals(signer) && vote[1][1].equals(beneficiary) && vote[1][2].equals(CLIQUE_NONCE_AUTH) @@ -605,7 +604,7 @@ export default class Blockchain implements BlockchainInterface { // DROP vote votes = this._cliqueLatestVotes.filter((vote) => { return ( - vote[0].gte(lastEpochBlockNumber) && + vote[0] >= BigInt(lastEpochBlockNumber) && !vote[1][0].equals(signer) && vote[1][1].equals(beneficiary) && vote[1][2].equals(CLIQUE_NONCE_DROP) @@ -668,17 +667,16 @@ export default class Blockchain implements BlockchainInterface { const blockSigners = this._cliqueLatestBlockSigners const lastBlockNumber = blockSigners[blockSigners.length - 1]?.[0] if (lastBlockNumber) { - const lastEpochBlockNumber = lastBlockNumber.sub( - lastBlockNumber.mod(new BN(this._common.consensusConfig().epoch)) - ) - const blockLimit = lastEpochBlockNumber.subn(limit) - this._cliqueLatestVotes = this._cliqueLatestVotes.filter((state) => state[0].gte(blockLimit)) + const lastEpochBlockNumber = + lastBlockNumber - (lastBlockNumber % BigInt(this._common.consensusConfig().epoch)) + const blockLimit = lastEpochBlockNumber - BigInt(limit) + this._cliqueLatestVotes = this._cliqueLatestVotes.filter((state) => state[0] >= blockLimit) } // save votes to db const dbOps: DBOp[] = [] const formatted = this._cliqueLatestVotes.map((v) => [ - v[0].toArrayLike(Buffer), + bigIntToBuffer(v[0]), [v[1][0].toBuffer(), v[1][1].toBuffer(), v[1][2]], ]) dbOps.push(DBOp.set(DBTarget.CliqueVotes, rlp.encode(formatted))) @@ -700,7 +698,6 @@ export default class Blockchain implements BlockchainInterface { if (header.isGenesis()) { return } - // add this block's signer const signer: CliqueBlockSigner = [header.number, header.cliqueSigner()] this._cliqueLatestBlockSigners.push(signer) @@ -718,7 +715,7 @@ export default class Blockchain implements BlockchainInterface { // save to db const formatted = this._cliqueLatestBlockSigners.map((b) => [ - b[0].toArrayLike(Buffer), + bigIntToBuffer(b[0]), b[1].toBuffer(), ]) dbOps.push(DBOp.set(DBTarget.CliqueBlockSigners, rlp.encode(formatted))) @@ -913,11 +910,11 @@ export default class Blockchain implements BlockchainInterface { const { header } = block const blockHash = header.hash() const blockNumber = header.number - const td = header.difficulty.clone() - const currentTd = { header: new BN(0), block: new BN(0) } + let td = header.difficulty + const currentTd = { header: BigInt(0), block: BigInt(0) } let dbOps: DBOp[] = [] - if (!block._common.chainId().eq(this._common.chainId())) { + if (block._common.chainId() !== this._common.chainId()) { throw new Error('Chain mismatch while trying to put block or header') } @@ -939,7 +936,6 @@ export default class Blockchain implements BlockchainInterface { if (!valid) { throw new Error('invalid PoA block signature (clique)') } - if (this.cliqueCheckRecentlySigned(header)) { throw new Error('recently signed') } @@ -950,7 +946,7 @@ export default class Blockchain implements BlockchainInterface { // validate checkpoint signers towards active signers on epoch transition blocks if (header.cliqueIsEpochTransition()) { // note: keep votes on epoch transition blocks in case of reorgs. - // only active (non-stale) votes will counted (if vote.blockNumber >= lastEpochBlockNumber) + // only active (non-stale) votes will counted (if vote.blockNumber >= lastEpochBlockNumber const checkpointSigners = header.cliqueEpochTransitionSigners() const activeSigners = this.cliqueActiveSigners() @@ -973,11 +969,11 @@ export default class Blockchain implements BlockchainInterface { } // calculate the total difficulty of the new block - let parentTd = new BN(0) + let parentTd = BigInt(0) if (!block.isGenesis()) { - parentTd = await this.getTotalDifficulty(header.parentHash, blockNumber.subn(1)) + parentTd = await this.getTotalDifficulty(header.parentHash, blockNumber - BigInt(1)) } - td.iadd(parentTd) + td += parentTd // save total difficulty to the database dbOps = dbOps.concat(DBSetTD(td, blockNumber, blockHash)) @@ -985,11 +981,11 @@ export default class Blockchain implements BlockchainInterface { // save header/block to the database dbOps = dbOps.concat(DBSetBlockOrHeader(block)) - let ancientHeaderNumber: undefined | BN + let ancientHeaderNumber: undefined | bigint // if total difficulty is higher than current, add it to canonical chain if ( block.isGenesis() || - (block._common.consensusType() !== ConsensusType.ProofOfStake && td.gt(currentTd.header)) || + (block._common.consensusType() !== ConsensusType.ProofOfStake && td > currentTd.header) || block._common.consensusType() === ConsensusType.ProofOfStake ) { if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique) { @@ -1010,7 +1006,7 @@ export default class Blockchain implements BlockchainInterface { } // delete higher number assignments and overwrite stale canonical chain - await this._deleteCanonicalChainReferences(blockNumber.addn(1), blockHash, dbOps) + await this._deleteCanonicalChainReferences(blockNumber + BigInt(1), blockHash, dbOps) // from the current header block, check the blockchain in reverse (i.e. // traverse `parentHash`) until `numberToHash` matches the current // number/hash in the canonical chain also: overwrite any heads if these @@ -1019,7 +1015,7 @@ export default class Blockchain implements BlockchainInterface { } else { // the TD is lower than the current highest TD so we will add the block // to the DB, but will not mark it as the canonical chain. - if (td.gt(currentTd.block) && item instanceof Block) { + if (td > currentTd.block && item instanceof Block) { this._headBlockHash = blockHash } // save hash to number lookup info even if rebuild not needed @@ -1030,12 +1026,15 @@ export default class Blockchain implements BlockchainInterface { await this.dbManager.batch(ops) // Clique: update signer votes and state - if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique && ancientHeaderNumber) { - await this._cliqueDeleteSnapshots(ancientHeaderNumber.addn(1)) + if ( + this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique && + ancientHeaderNumber !== undefined + ) { + await this._cliqueDeleteSnapshots(ancientHeaderNumber! + BigInt(1)) for ( - const number = ancientHeaderNumber.addn(1); - number.lte(header.number); - number.iaddn(1) + let number = ancientHeaderNumber! + BigInt(1); + number <= header.number; + number += BigInt(1) ) { const canonicalHeader = await this._getCanonicalHeader(number) await this._cliqueBuildSnapshots(canonicalHeader) @@ -1051,10 +1050,10 @@ export default class Blockchain implements BlockchainInterface { * this will be immediately looked up, otherwise it will wait until we have * unlocked the DB */ - async getBlock(blockId: Buffer | number | BN): Promise { + async getBlock(blockId: Buffer | number | bigint): Promise { // cannot wait for a lock here: it is used both in `validate` of `Block` // (calls `getBlock` to get `parentHash`) it is also called from `runBlock` - // in the `VM` if we encounter a `BLOCKHASH` opcode: then a BN is used we + // in the `VM` if we encounter a `BLOCKHASH` opcode: then a bigint is used we // need to then read the block from the canonical chain Q: is this safe? We // know it is OK if we call it from the iterator... (runBlock) await this.initPromise @@ -1064,14 +1063,14 @@ export default class Blockchain implements BlockchainInterface { /** * @hidden */ - private async _getBlock(blockId: Buffer | number | BN) { + private async _getBlock(blockId: Buffer | number | bigint) { return this.dbManager.getBlock(blockId) } /** * Gets total difficulty for a block specified by hash and number */ - public async getTotalDifficulty(hash: Buffer, number?: BN): Promise { + public async getTotalDifficulty(hash: Buffer, number?: bigint): Promise { if (!number) { number = await this.dbManager.hashToNumber(hash) } @@ -1087,7 +1086,7 @@ export default class Blockchain implements BlockchainInterface { * @param reverse - Fetch blocks in reverse */ async getBlocks( - blockId: Buffer | BN | number, + blockId: Buffer | bigint | number, maxBlocks: number, skip: number, reverse: boolean @@ -1096,7 +1095,7 @@ export default class Blockchain implements BlockchainInterface { const blocks: Block[] = [] let i = -1 - const nextBlock = async (blockId: Buffer | BN | number): Promise => { + const nextBlock = async (blockId: Buffer | bigint | number): Promise => { let block try { block = await this._getBlock(blockId) @@ -1107,7 +1106,7 @@ export default class Blockchain implements BlockchainInterface { return } i++ - const nextBlockNumber = block.header.number.addn(reverse ? -1 : 1) + const nextBlockNumber = block.header.number + BigInt(reverse ? -1 : 1) if (i !== 0 && skip && i % (skip + 1) !== 0) { return await nextBlock(nextBlockNumber) } @@ -1146,7 +1145,7 @@ export default class Blockchain implements BlockchainInterface { throw error } } - if (number) { + if (number !== undefined) { min = mid + 1 } else { max = mid - 1 @@ -1224,7 +1223,7 @@ export default class Blockchain implements BlockchainInterface { */ private async _delChild( blockHash: Buffer, - blockNumber: BN, + blockNumber: bigint, headHash: Buffer | null, ops: DBOp[] ) { @@ -1247,7 +1246,7 @@ export default class Blockchain implements BlockchainInterface { } try { - const childHeader = await this._getCanonicalHeader(blockNumber.addn(1)) + const childHeader = await this._getCanonicalHeader(blockNumber + BigInt(1)) await this._delChild(childHeader.hash(), childHeader.number, headHash, ops) } catch (error: any) { if (error.type !== 'NotFoundError') { @@ -1287,7 +1286,7 @@ export default class Blockchain implements BlockchainInterface { } const headBlockNumber = await this.dbManager.hashToNumber(headHash) - const nextBlockNumber = headBlockNumber.addn(1) + let nextBlockNumber = headBlockNumber + BigInt(1) let blocksRanCounter = 0 while (maxBlocks !== blocksRanCounter) { @@ -1297,7 +1296,7 @@ export default class Blockchain implements BlockchainInterface { const reorg = lastBlock ? lastBlock.hash().equals(nextBlock.header.parentHash) : false lastBlock = nextBlock await onBlock(nextBlock, reorg) - nextBlockNumber.iaddn(1) + nextBlockNumber += BigInt(1) blocksRanCounter++ } catch (error: any) { if (error.type === 'NotFoundError') { @@ -1350,19 +1349,19 @@ export default class Blockchain implements BlockchainInterface { } let { header } = await this._getBlock(this._headHeaderHash) - if (header.number.gt(newHeader.number)) { + if (header.number > newHeader.number) { header = await this._getCanonicalHeader(newHeader.number) } else { - while (!header.number.eq(newHeader.number) && newHeader.number.gtn(0)) { - newHeader = await this._getHeader(newHeader.parentHash, newHeader.number.subn(1)) + while (header.number !== newHeader.number && newHeader.number > BigInt(0)) { + newHeader = await this._getHeader(newHeader.parentHash, newHeader.number - BigInt(1)) } } - if (!header.number.eq(newHeader.number)) { + if (header.number !== newHeader.number) { throw new Error('Failed to find ancient header') } - while (!header.hash().equals(newHeader.hash()) && header.number.gtn(0)) { - header = await this._getCanonicalHeader(header.number.subn(1)) - newHeader = await this._getHeader(newHeader.parentHash, newHeader.number.subn(1)) + while (!header.hash().equals(newHeader.hash()) && header.number > BigInt(0)) { + header = await this._getCanonicalHeader(header.number - BigInt(1)) + newHeader = await this._getHeader(newHeader.parentHash, newHeader.number - BigInt(1)) } if (!header.hash().equals(newHeader.hash())) { throw new Error('Failed to find ancient header') @@ -1385,19 +1384,19 @@ export default class Blockchain implements BlockchainInterface { * Remove clique snapshots with blockNumber higher than input. * @param blockNumber - the block number from which we start deleting */ - private async _cliqueDeleteSnapshots(blockNumber: BN) { + private async _cliqueDeleteSnapshots(blockNumber: bigint) { // remove blockNumber from clique snapshots // (latest signer states, latest votes, latest block signers) - this._cliqueLatestSignerStates = this._cliqueLatestSignerStates.filter((s) => - s[0].lte(blockNumber) + this._cliqueLatestSignerStates = this._cliqueLatestSignerStates.filter( + (s) => s[0] <= blockNumber ) await this.cliqueUpdateSignerStates() - this._cliqueLatestVotes = this._cliqueLatestVotes.filter((v) => v[0].lte(blockNumber)) + this._cliqueLatestVotes = this._cliqueLatestVotes.filter((v) => v[0] <= blockNumber) await this.cliqueUpdateVotes() - this._cliqueLatestBlockSigners = this._cliqueLatestBlockSigners.filter((s) => - s[0].lte(blockNumber) + this._cliqueLatestBlockSigners = this._cliqueLatestBlockSigners.filter( + (s) => s[0] <= blockNumber ) await this.cliqueUpdateLatestBlockSigners() } @@ -1415,8 +1414,11 @@ export default class Blockchain implements BlockchainInterface { * @param ops - the DatabaseOperation list to write DatabaseOperations to * @hidden */ - private async _deleteCanonicalChainReferences(blockNumber: BN, headHash: Buffer, ops: DBOp[]) { - blockNumber = blockNumber.clone() + private async _deleteCanonicalChainReferences( + blockNumber: bigint, + headHash: Buffer, + ops: DBOp[] + ) { let hash: Buffer | false hash = await this.safeNumberToHash(blockNumber) @@ -1440,7 +1442,7 @@ export default class Blockchain implements BlockchainInterface { this._headBlockHash = headHash } - blockNumber.iaddn(1) + blockNumber += BigInt(1) hash = await this.safeNumberToHash(blockNumber) } @@ -1462,7 +1464,7 @@ export default class Blockchain implements BlockchainInterface { * @hidden */ private async _rebuildCanonical(header: BlockHeader, ops: DBOp[]) { - const currentNumber = header.number.clone() // we change this during this method with `isubn` + let currentNumber = header.number let currentCanonicalHash: Buffer = header.hash() // track the staleHash: this is the hash currently in the DB which matches @@ -1482,7 +1484,7 @@ export default class Blockchain implements BlockchainInterface { const blockHash = header.hash() const blockNumber = header.number - if (blockNumber.isZero()) { + if (blockNumber === BigInt(0)) { break } @@ -1503,7 +1505,7 @@ export default class Blockchain implements BlockchainInterface { } try { - header = await this._getHeader(header.parentHash, currentNumber.isubn(1)) + header = await this._getHeader(header.parentHash, --currentNumber) } catch (error: any) { staleHeads = [] if (error.type !== 'NotFoundError') { @@ -1553,7 +1555,7 @@ export default class Blockchain implements BlockchainInterface { * * @hidden */ - private async _getHeader(hash: Buffer, number?: BN) { + private async _getHeader(hash: Buffer, number?: bigint) { if (!number) { number = await this.dbManager.hashToNumber(hash) } @@ -1565,7 +1567,7 @@ export default class Blockchain implements BlockchainInterface { * * @hidden */ - private async _getCanonicalHeader(number: BN) { + private async _getCanonicalHeader(number: bigint) { const hash = await this.dbManager.numberToHash(number) return this._getHeader(hash, number) } @@ -1576,7 +1578,7 @@ export default class Blockchain implements BlockchainInterface { * any other error, this function throws. * @param number */ - async safeNumberToHash(number: BN): Promise { + async safeNumberToHash(number: bigint): Promise { try { const hash = await this.dbManager.numberToHash(number) return hash @@ -1599,6 +1601,7 @@ export default class Blockchain implements BlockchainInterface { throw new Error('Signer not found') } const { number } = await this.getLatestHeader() - return number.addn(1).mod(new BN(signers.length)).eqn(signerIndex) + //eslint-disable-next-line + return (number + BigInt(1)) % BigInt(signers.length) === BigInt(signerIndex) } } diff --git a/packages/blockchain/test/clique.spec.ts b/packages/blockchain/test/clique.spec.ts index afda60e9f59..2470daf6826 100644 --- a/packages/blockchain/test/clique.spec.ts +++ b/packages/blockchain/test/clique.spec.ts @@ -1,6 +1,6 @@ import { Block } from '@ethereumjs/block' import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '@ethereumjs/common' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import tape from 'tape' import Blockchain from '../src' import { CLIQUE_NONCE_AUTH, CLIQUE_NONCE_DROP } from '../src/clique' @@ -11,7 +11,7 @@ tape('Clique: Initialization', (t) => { const blockchain = new Blockchain({ common }) const head = await blockchain.getHead() - st.equals(head.hash().toString('hex'), common.genesis().hash.slice(2), 'correct genesis hash') + st.equal(head.hash().toString('hex'), common.genesis().hash.slice(2), 'correct genesis hash') st.deepEquals( blockchain.cliqueActiveSigners(), @@ -23,7 +23,7 @@ tape('Clique: Initialization', (t) => { const COMMON = new Common({ chain: Chain.Rinkeby, hardfork: Hardfork.Chainstart }) const EXTRA_DATA = Buffer.alloc(97) - const GAS_LIMIT = 8000000 + const GAS_LIMIT = BigInt(8000000) type Signer = { address: Address @@ -157,10 +157,10 @@ tape('Clique: Initialization', (t) => { number, parentHash: lastBlock.hash(), coinbase, - timestamp: lastBlock.header.timestamp.addn(15), + timestamp: lastBlock.header.timestamp + BigInt(15), extraData, gasLimit: GAS_LIMIT, - difficulty: new BN(2), + difficulty: BigInt(2), nonce, }, } @@ -169,7 +169,7 @@ tape('Clique: Initialization', (t) => { const signers = blockchain.cliqueActiveSigners() const signerIndex = signers.findIndex((address: Address) => address.equals(signer.address)) const inTurn = number % signers.length === signerIndex - blockData.header.difficulty = inTurn ? new BN(2) : new BN(1) + blockData.header.difficulty = inTurn ? BigInt(2) : BigInt(1) // set signer const cliqueSigner = signer.privateKey @@ -212,9 +212,9 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, A) ;(blockchain as any)._validateBlocks = false - const number = new BN(1) + const number = BigInt(1) const extraData = Buffer.alloc(97) - let difficulty = new BN(5) + let difficulty = BigInt(5) let block = Block.fromBlockData( { header: { number, extraData, difficulty } }, { common: COMMON } @@ -231,7 +231,7 @@ tape('Clique: Initialization', (t) => { } } - difficulty = new BN(1) + difficulty = BigInt(1) const cliqueSigner = A.privateKey block = Block.fromBlockData( { header: { number, extraData, difficulty } }, @@ -272,7 +272,7 @@ tape('Clique: Initialization', (t) => { t.test('Clique Voting: Single signer, no votes cast', async (st) => { const { blocks, blockchain } = await initWithSigners([A]) const block = await addNextBlock(blockchain, blocks, A) - st.equal(block.header.number.toNumber(), 1) + st.equal(block.header.number, BigInt(1)) st.deepEqual(blockchain.cliqueActiveSigners(), [A.address]) st.end() }) diff --git a/packages/blockchain/test/index.spec.ts b/packages/blockchain/test/index.spec.ts index 677c019669a..ee5e27909d8 100644 --- a/packages/blockchain/test/index.spec.ts +++ b/packages/blockchain/test/index.spec.ts @@ -1,4 +1,3 @@ -import { BN } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block, BlockHeader, BlockOptions } from '@ethereumjs/block' import tape from 'tape' @@ -26,19 +25,19 @@ tape('blockchain test', (t) => { const head = await blockchain.getHead() const iteratorHead = await blockchain.getIteratorHead() - st.equals( + st.equal( head.hash().toString('hex'), common.genesis().hash.slice(2), 'correct genesis hash (getHead())' ) - st.equals( + st.equal( iteratorHead.hash().toString('hex'), common.genesis().hash.slice(2), 'correct genesis hash (getIteratorHead())' ) blockchain = await Blockchain.create({ common, hardforkByHeadBlockNumber: true }) - st.equals( + st.equal( common.hardfork(), 'tangerineWhistle', 'correct HF setting with hardforkByHeadBlockNumber option' @@ -56,7 +55,7 @@ tape('blockchain test', (t) => { const head = await blockchain.getHead() - st.equals(head.header.number.toNumber(), 5, 'correct block number') + st.equal(head.header.number, BigInt(5), 'correct block number') st.end() }) @@ -95,7 +94,7 @@ tape('blockchain test', (t) => { }) t.test('should not validate a block incorrectly flagged as genesis', async (st) => { - const genesisBlock = Block.fromBlockData({ header: { number: new BN(8) } }) + const genesisBlock = Block.fromBlockData({ header: { number: BigInt(8) } }) try { await Blockchain.create({ validateBlocks: true, @@ -140,7 +139,7 @@ tape('blockchain test', (t) => { header: { number, parentHash: lastBlock.hash(), - timestamp: lastBlock.header.timestamp.addn(1), + timestamp: lastBlock.header.timestamp + BigInt(1), gasLimit, }, } @@ -183,7 +182,7 @@ tape('blockchain test', (t) => { header: { number: 1, parentHash: genesisBlock.hash(), - timestamp: genesisBlock.header.timestamp.addn(1), + timestamp: genesisBlock.header.timestamp + BigInt(1), gasLimit, }, } @@ -227,7 +226,7 @@ tape('blockchain test', (t) => { // start: genesisHash, max: 5, skip: 0, reverse: false const getBlocks = await blockchain.getBlocks(blocks[0].hash(), 5, 0, false) st.equal(getBlocks!.length, 5) - st.ok(blocks[0].header.number.eq(getBlocks[0].header.number)) + st.equal(blocks[0].header.number, getBlocks[0].header.number) st.ok(isConsecutive(getBlocks!), 'blocks should be consecutive') st.end() }) @@ -238,7 +237,7 @@ tape('blockchain test', (t) => { // start: genesisHash, max: 5, skip: 1, reverse: false const getBlocks = await blockchain.getBlocks(blocks[0].hash(), 5, 1, false) st.equal(getBlocks!.length, 5, 'should get 5 blocks') - st.ok(getBlocks![1].header.number.eq(blocks[2].header.number), 'should skip second block') + st.equal(getBlocks![1].header.number, blocks[2].header.number, 'should skip second block') st.ok(!isConsecutive(getBlocks!), 'blocks should not be consecutive') st.end() }) @@ -249,7 +248,7 @@ tape('blockchain test', (t) => { // start: genesisHash, max: 4, skip: 2, reverse: false const getBlocks = await blockchain.getBlocks(blocks[0].hash(), 4, 2, false) st.equal(getBlocks!.length, 4, 'should get 4 blocks') - st.ok(getBlocks![1].header.number.eq(blocks[3].header.number), 'should skip two blocks apart') + st.equal(getBlocks![1].header.number, blocks[3].header.number, 'should skip two blocks apart') st.ok(!isConsecutive(getBlocks!), 'blocks should not be consecutive') st.end() }) @@ -260,7 +259,7 @@ tape('blockchain test', (t) => { // start: genesisHash, max: 17, skip: 0, reverse: false const getBlocks = await blockchain.getBlocks(blocks[0].hash(), 17, 0, false) st.equal(getBlocks!.length, 15) - st.ok(getBlocks![0].header.number.eq(blocks[0].header.number)) + st.equal(getBlocks![0].header.number, blocks[0].header.number) st.ok(isConsecutive(getBlocks!), 'blocks should be consecutive') st.end() }) @@ -271,7 +270,7 @@ tape('blockchain test', (t) => { // start: 0, max: 5, skip: 0, reverse: false const getBlocks = await blockchain.getBlocks(0, 5, 0, false) st.equal(getBlocks!.length, 5) - st.ok(getBlocks![0].header.number.eq(blocks[0].header.number)) + st.equal(getBlocks![0].header.number, blocks[0].header.number) st.ok(isConsecutive(getBlocks!), 'blocks should be consecutive') st.end() }) @@ -282,7 +281,7 @@ tape('blockchain test', (t) => { // start: 1, max: 5, skip: 1, reverse: false const getBlocks = await blockchain.getBlocks(1, 5, 1, false) st.equal(getBlocks!.length, 5) - st.ok(getBlocks![1].header.number.eq(blocks[3].header.number), 'should skip one block') + st.equal(getBlocks![1].header.number, blocks[3].header.number, 'should skip one block') st.ok(!isConsecutive(getBlocks!), 'blocks should not be consecutive') st.end() }) @@ -293,7 +292,7 @@ tape('blockchain test', (t) => { // start: 0, max: 5, skip: 2, reverse: false const getBlocks = await blockchain.getBlocks(0, 5, 2, false) st.equal(getBlocks!.length, 5) - st.ok(getBlocks![1].header.number.eq(blocks[3].header.number), 'should skip two blocks') + st.equal(getBlocks![1].header.number, blocks[3].header.number, 'should skip two blocks') st.ok(!isConsecutive(getBlocks!), 'blocks should not be consecutive') st.end() }) @@ -304,7 +303,7 @@ tape('blockchain test', (t) => { // start: 0, max: 17, skip: 0, reverse: false const getBlocks = await blockchain.getBlocks(0, 17, 0, false) st.equal(getBlocks!.length, 15) - st.ok(getBlocks![0].header.number.eq(blocks[0].header.number)) + st.equal(getBlocks![0].header.number, blocks[0].header.number) st.ok(isConsecutive(getBlocks!), 'blocks should be consecutive') st.end() }) @@ -315,7 +314,7 @@ tape('blockchain test', (t) => { // start: 1, max: 5, skip: 0, reverse: false const getBlocks = await blockchain.getBlocks(1, 5, 0, false) st.equal(getBlocks!.length, 5) - st.ok(getBlocks![0].header.number.eq(blocks[1].header.number)) + st.equal(getBlocks![0].header.number, blocks[1].header.number) st.ok(isConsecutive(getBlocks!), 'blocks should be consecutive') st.end() }) @@ -326,7 +325,7 @@ tape('blockchain test', (t) => { // start: 5, max: 5, skip: 0, reverse: false const getBlocks = await blockchain.getBlocks(5, 5, 0, false) st.equal(getBlocks!.length, 5) - st.ok(getBlocks![0].header.number.eq(blocks[5].header.number)) + st.equal(getBlocks![0].header.number, blocks[5].header.number) st.ok(isConsecutive(getBlocks!), 'blocks should be consecutive') st.end() }) @@ -337,7 +336,7 @@ tape('blockchain test', (t) => { // start: 5, max: 5, skip: 0, reverse: true const getBlocks = await blockchain.getBlocks(5, 5, 0, true) st.equal(getBlocks!.length, 5) - st.ok(getBlocks![0].header.number.eq(blocks[5].header.number)) + st.equal(getBlocks![0].header.number, blocks[5].header.number) st.ok(isConsecutive(getBlocks!.reverse()), 'blocks should be consecutive') st.end() }) @@ -348,7 +347,7 @@ tape('blockchain test', (t) => { // start: 5, max: 15, skip: 0, reverse: true const getBlocks = await blockchain.getBlocks(5, 15, 0, true) st.equal(getBlocks!.length, 6) - st.ok(getBlocks![0].header.number.eq(blocks[5].header.number)) + st.equal(getBlocks![0].header.number, blocks[5].header.number) st.ok(isConsecutive(getBlocks!.reverse()), 'blocks should be consecutive') st.end() }) @@ -359,7 +358,7 @@ tape('blockchain test', (t) => { // start: 10, max: 10, skip: 1, reverse: true const getBlocks = await blockchain.getBlocks(10, 10, 1, true) st.equal(getBlocks!.length, 6) - st.ok(getBlocks![1].header.number.eq(blocks[8].header.number), 'should skip one block') + st.equal(getBlocks![1].header.number, blocks[8].header.number, 'should skip one block') st.ok(!isConsecutive(getBlocks!.reverse()), 'blocks should not be consecutive') st.end() }) @@ -386,8 +385,8 @@ tape('blockchain test', (t) => { i++ } }) - st.equals(iterated, 24) - st.equals(i, 24) + st.equal(iterated, 24) + st.equal(i, 24) st.end() }) @@ -406,8 +405,8 @@ tape('blockchain test', (t) => { }, 5 ) - st.equals(iterated, 5) - st.equals(i, 5) + st.equal(iterated, 5) + st.equal(i, 5) st.end() } ) @@ -431,8 +430,8 @@ tape('blockchain test', (t) => { .catch(() => { st.fail('Promise cannot throw when running 0 blocks') }) - st.equals(iterated, 0) - st.equals(i, 0) + st.equal(iterated, 0) + st.equal(i, 0) st.end() } ) @@ -481,7 +480,7 @@ tape('blockchain test', (t) => { 5 ) - st.equals(i, 1) + st.equal(i, 1) st.end() }) @@ -540,7 +539,7 @@ tape('blockchain test', (t) => { number: 15, parentHash: blocks[14].hash(), gasLimit: 8000000, - timestamp: blocks[14].header.timestamp.addn(1), + timestamp: BigInt(blocks[14].header.timestamp) + BigInt(1), } const forkHeader = BlockHeader.fromHeaderData(headerData, { common, @@ -565,7 +564,8 @@ tape('blockchain test', (t) => { number: 15, parentHash: blocks[14].hash(), gasLimit: 8000000, - timestamp: blocks[14].header.timestamp.addn(1), + //eslint-disable-next-line + timestamp: BigInt(blocks[14].header.timestamp) + BigInt(1), } const forkHeader = BlockHeader.fromHeaderData(headerData, { common, @@ -643,7 +643,7 @@ tape('blockchain test', (t) => { const head = await blockchain.getHead() if (genesis) { st.ok(head.hash().equals(genesis.hash()), 'should get head') - st.equals( + st.equal( (blockchain as any)._heads['head0'].toString('hex'), 'abcd', 'should get state root heads' @@ -699,14 +699,14 @@ tape('blockchain test', (t) => { const blockchain = new Blockchain({ db }) const number = await blockchain.dbManager.hashToNumber(genesis?.hash()) - st.ok(number.isZero(), 'should perform _hashToNumber correctly') + st.equal(number, BigInt(0), 'should perform _hashToNumber correctly') - const hash = await blockchain.dbManager.numberToHash(new BN(0)) + const hash = await blockchain.dbManager.numberToHash(BigInt(0)) st.ok(genesis.hash().equals(hash), 'should perform _numberToHash correctly') // cast the blockchain as in order to get access to the private getTotalDifficulty - const td = await (blockchain).getTotalDifficulty(genesis.hash(), new BN(0)) - st.ok(td.eq(genesis.header.difficulty), 'should perform getTotalDifficulty correctly') + const td = await (blockchain).getTotalDifficulty(genesis.hash(), BigInt(0)) + st.equal(td, genesis.header.difficulty, 'should perform getTotalDifficulty correctly') st.end() }) @@ -727,7 +727,7 @@ tape('blockchain test', (t) => { number: 1, parentHash: genesisBlock.hash(), gasLimit, - timestamp: genesisBlock.header.timestamp.addn(1), + timestamp: genesisBlock.header.timestamp + BigInt(1), } const header = BlockHeader.fromHeaderData(headerData, { calcDifficultyFromHeader: genesisBlock.header, @@ -766,7 +766,7 @@ tape('blockchain test', (t) => { header: { number: 1, parentHash: genesisBlock.hash(), - timestamp: genesisBlock.header.timestamp.addn(3), + timestamp: genesisBlock.header.timestamp + BigInt(3), gasLimit, }, } @@ -776,7 +776,7 @@ tape('blockchain test', (t) => { const headerData1 = { number: 1, parentHash: genesisBlock.hash(), - timestamp: genesisBlock.header.timestamp.addn(1), + timestamp: genesisBlock.header.timestamp + BigInt(1), gasLimit, } opts.calcDifficultyFromHeader = genesisBlock.header @@ -786,7 +786,7 @@ tape('blockchain test', (t) => { const headerData2 = { number: 2, parentHash: header1.hash(), - timestamp: header1.timestamp.addn(1), + timestamp: header1.timestamp + BigInt(1), gasLimit, } opts.calcDifficultyFromHeader = block.header @@ -821,14 +821,14 @@ tape('blockchain test', (t) => { header: { number: 1, parentHash: genesisBlock.hash(), - timestamp: genesisBlock.header.timestamp.addn(1), + timestamp: genesisBlock.header.timestamp + BigInt(1), gasLimit, }, } const blockData2 = { ...blockData1, number: 2, - timestamp: genesisBlock.header.timestamp.addn(2), + timestamp: genesisBlock.header.timestamp + BigInt(2), } const blocks = [ diff --git a/packages/blockchain/test/pos.spec.ts b/packages/blockchain/test/pos.spec.ts index 2d605b2b0ac..f0131013660 100644 --- a/packages/blockchain/test/pos.spec.ts +++ b/packages/blockchain/test/pos.spec.ts @@ -1,20 +1,19 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Common, { Hardfork } from '@ethereumjs/common' -import { BN } from 'ethereumjs-util' import Blockchain from '../src' import testnet from './testdata/testnet.json' const buildChain = async (blockchain: Blockchain, common: Common, height: number) => { const blocks: Block[] = [] - const londonBlockNumber = common.hardforkBlock('london')!.toNumber() + const londonBlockNumber = Number(common.hardforkBlock('london')!) const genesis = Block.genesis({}, { common }) blocks.push(genesis) for (let number = 1; number <= height; number++) { - let baseFeePerGas = new BN(0) + let baseFeePerGas = BigInt(0) if (number === londonBlockNumber) { - baseFeePerGas = new BN(1000000000) + baseFeePerGas = BigInt(1000000000) } else if (number > londonBlockNumber) { baseFeePerGas = blocks[number - 1].header.calcNextBaseFee() } @@ -23,8 +22,8 @@ const buildChain = async (blockchain: Blockchain, common: Common, height: number header: { number: number, parentHash: blocks[number - 1].hash(), - timestamp: blocks[number - 1].header.timestamp.addn(1), - gasLimit: number >= londonBlockNumber ? new BN(10000) : new BN(5000), + timestamp: blocks[number - 1].header.timestamp + BigInt(1), + gasLimit: number >= londonBlockNumber ? BigInt(10000) : BigInt(5000), baseFeePerGas: number >= londonBlockNumber ? baseFeePerGas : undefined, }, }, @@ -72,7 +71,7 @@ tape('Proof of Stake - inserting blocks into blockchain', async (t) => { await buildChain(blockchain, s.common, 15) const latestHeader = await blockchain.getLatestHeader() - t.equal(latestHeader.number.toNumber(), 15, 'blockchain is at correct height') + t.equal(latestHeader.number, BigInt(15), 'blockchain is at correct height') t.equal( (blockchain as any)._common.hardfork(), @@ -80,19 +79,15 @@ tape('Proof of Stake - inserting blocks into blockchain', async (t) => { 'HF should have been correctly updated' ) const td = await blockchain.getTotalDifficulty(latestHeader.hash()) - t.equal( - td.toNumber(), - 1313601, - 'should have calculated the correct post-Merge total difficulty' - ) + t.equal(td, BigInt(1313601), 'should have calculated the correct post-Merge total difficulty') const powBlock = Block.fromBlockData({ header: { number: 16, - difficulty: new BN(1), + difficulty: BigInt(1), parentHash: latestHeader.hash(), - timestamp: latestHeader.timestamp.addn(1), - gasLimit: new BN(10000), + timestamp: latestHeader.timestamp + BigInt(1), + gasLimit: BigInt(10000), }, }) try { diff --git a/packages/blockchain/test/reorg.spec.ts b/packages/blockchain/test/reorg.spec.ts index 81ac8bc34a3..136276730ed 100644 --- a/packages/blockchain/test/reorg.spec.ts +++ b/packages/blockchain/test/reorg.spec.ts @@ -1,6 +1,6 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block } from '@ethereumjs/block' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import tape from 'tape' import Blockchain from '../src' import { CLIQUE_NONCE_AUTH } from '../src/clique' @@ -14,9 +14,9 @@ tape('reorg tests', (t) => { const genesis = Block.fromBlockData( { header: { - number: new BN(0), - difficulty: new BN(0x020000), - gasLimit: new BN(8000000), + number: BigInt(0), + difficulty: BigInt(0x020000), + gasLimit: BigInt(8000000), }, }, { common } @@ -33,20 +33,20 @@ tape('reorg tests', (t) => { blocks_lowTD.push(generateConsecutiveBlock(genesis, 0)) - const TD_Low = genesis.header.difficulty.add(blocks_lowTD[0].header.difficulty) - const TD_High = genesis.header.difficulty.clone() + let TD_Low = genesis.header.difficulty + blocks_lowTD[0].header.difficulty + let TD_High = genesis.header.difficulty // Keep generating blocks until the Total Difficulty (TD) of the High TD chain is higher than the TD of the Low TD chain // This means that the block number of the high TD chain is 1 lower than the low TD chain - while (TD_High.cmp(TD_Low) == -1) { + while (TD_High < TD_Low) { blocks_lowTD.push(generateConsecutiveBlock(blocks_lowTD[blocks_lowTD.length - 1], 0)) blocks_highTD.push( generateConsecutiveBlock(blocks_highTD[blocks_highTD.length - 1] || genesis, 1) ) - TD_Low.iadd(blocks_lowTD[blocks_lowTD.length - 1].header.difficulty) - TD_High.iadd(blocks_highTD[blocks_highTD.length - 1].header.difficulty) + TD_Low += blocks_lowTD[blocks_lowTD.length - 1].header.difficulty + TD_High += blocks_highTD[blocks_highTD.length - 1].header.difficulty } // sanity check @@ -57,14 +57,10 @@ tape('reorg tests', (t) => { const number_highTD = highTDBlock.header.number // ensure that the block difficulty is higher on the highTD chain when compared to the low TD chain + t.ok(number_lowTD > number_highTD, 'low TD should have a lower TD than the reported high TD') t.ok( - number_lowTD.cmp(number_highTD) == 1, - 'low TD should have a lower TD than the reported high TD' - ) - t.ok( - blocks_lowTD[blocks_lowTD.length - 1].header.number.gt( - blocks_highTD[blocks_highTD.length - 1].header.number - ), + blocks_lowTD[blocks_lowTD.length - 1].header.number > + blocks_highTD[blocks_highTD.length - 1].header.number, 'low TD block should have a higher number than high TD block' ) @@ -118,7 +114,7 @@ tape('reorg tests', (t) => { ...base, number: 1, parentHash: genesisBlock.hash(), - timestamp: genesisBlock.header.timestamp.addn(30), + timestamp: genesisBlock.header.timestamp + BigInt(30), }, }, { common } @@ -129,7 +125,7 @@ tape('reorg tests', (t) => { ...base, number: 2, parentHash: block1_low.hash(), - timestamp: block1_low.header.timestamp.addn(30), + timestamp: block1_low.header.timestamp + BigInt(30), nonce, coinbase: beneficiary1, }, @@ -143,7 +139,7 @@ tape('reorg tests', (t) => { ...base, number: 1, parentHash: genesisBlock.hash(), - timestamp: genesisBlock.header.timestamp.addn(15), + timestamp: genesisBlock.header.timestamp + BigInt(15), }, }, { common } @@ -154,7 +150,7 @@ tape('reorg tests', (t) => { ...base, number: 2, parentHash: block1_high.hash(), - timestamp: block1_high.header.timestamp.addn(15), + timestamp: block1_high.header.timestamp + BigInt(15), }, }, { common } @@ -165,7 +161,7 @@ tape('reorg tests', (t) => { ...base, number: 3, parentHash: block2_high.hash(), - timestamp: block2_high.header.timestamp.addn(15), + timestamp: block2_high.header.timestamp + BigInt(15), nonce, coinbase: beneficiary2, }, @@ -191,7 +187,7 @@ tape('reorg tests', (t) => { let signerStates = (blockchain as any)._cliqueLatestSignerStates t.ok( !signerStates.find( - (s: any) => s[0].eqn(2) && s[1].find((a: Address) => a.equals(beneficiary1)) + (s: any) => s[0] === BigInt(2) && s[1].find((a: Address) => a.equals(beneficiary1)) ), 'should not find reorged signer state' ) @@ -200,7 +196,7 @@ tape('reorg tests', (t) => { t.ok( !signerVotes.find( (v: any) => - v[0].eqn(2) && + v[0] === BigInt(2) && v[1][0].equals(block1_low.header.cliqueSigner()) && v[1][1].equals(beneficiary1) && v[1][2].equals(CLIQUE_NONCE_AUTH) @@ -211,7 +207,7 @@ tape('reorg tests', (t) => { let blockSigners = (blockchain as any)._cliqueLatestBlockSigners t.ok( !blockSigners.find( - (s: any) => s[0].eqn(1) && s[1].equals(block1_low.header.cliqueSigner()) + (s: any) => s[0] === BigInt(1) && s[1].equals(block1_low.header.cliqueSigner()) ), 'should not find reorged block signer' ) @@ -219,7 +215,7 @@ tape('reorg tests', (t) => { signerStates = (blockchain as any)._cliqueLatestSignerStates t.ok( !!signerStates.find( - (s: any) => s[0].eqn(3) && s[1].find((a: Address) => a.equals(beneficiary2)) + (s: any) => s[0] === BigInt(3) && s[1].find((a: Address) => a.equals(beneficiary2)) ), 'should find reorged signer state' ) @@ -230,7 +226,7 @@ tape('reorg tests', (t) => { blockSigners = (blockchain as any)._cliqueLatestBlockSigners t.ok( !!blockSigners.find( - (s: any) => s[0].eqn(3) && s[1].equals(block3_high.header.cliqueSigner()) + (s: any) => s[0] === BigInt(3) && s[1].equals(block3_high.header.cliqueSigner()) ), 'should find reorged block signer' ) diff --git a/packages/blockchain/test/util.ts b/packages/blockchain/test/util.ts index 8fa39262e3f..84f1b2ac3ba 100644 --- a/packages/blockchain/test/util.ts +++ b/packages/blockchain/test/util.ts @@ -1,4 +1,4 @@ -import { BN, rlp } from 'ethereumjs-util' +import { rlp, toBuffer } from 'ethereumjs-util' import { Block, BlockHeader } from '@ethereumjs/block' import Common, { Chain, Hardfork } from '@ethereumjs/common' import Blockchain from '../src' @@ -23,7 +23,7 @@ export const generateBlocks = (numberOfBlocks: number, existingBlocks?: Block[]) number: i, parentHash: lastBlock.hash(), gasLimit, - timestamp: lastBlock.header.timestamp.addn(1), + timestamp: lastBlock.header.timestamp + BigInt(1), }, } const block = Block.fromBlockData(blockData, { @@ -72,15 +72,15 @@ export const generateConsecutiveBlock = ( } const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.MuirGlacier }) const tmpHeader = BlockHeader.fromHeaderData({ - number: parentBlock.header.number.addn(1), - timestamp: parentBlock.header.timestamp.addn(10 + -difficultyChangeFactor * 9), + number: parentBlock.header.number + BigInt(1), + timestamp: parentBlock.header.timestamp + BigInt(10 + -difficultyChangeFactor * 9), }) const header = BlockHeader.fromHeaderData( { - number: parentBlock.header.number.addn(1), + number: parentBlock.header.number + BigInt(1), parentHash: parentBlock.hash(), - gasLimit: new BN(8000000), - timestamp: parentBlock.header.timestamp.addn(10 + -difficultyChangeFactor * 9), + gasLimit: BigInt(8000000), + timestamp: parentBlock.header.timestamp + BigInt(10 + -difficultyChangeFactor * 9), difficulty: tmpHeader.canonicalDifficulty(parentBlock.header), }, { @@ -155,7 +155,7 @@ export const createTestDB = async () => { ), keyEncoding: 'binary', valueEncoding: 'binary', - value: rlp.encode(new BN(17179869184).toBuffer()), + value: rlp.encode(toBuffer(17179869184)), }, { type: 'put', diff --git a/packages/client/bin/cli.ts b/packages/client/bin/cli.ts index 798629d67ba..ac229b5b238 100755 --- a/packages/client/bin/cli.ts +++ b/packages/client/bin/cli.ts @@ -549,7 +549,7 @@ async function run() { // Configure common based on args given if ( (args.customChainParams || args.customGenesisState || args.gethGenesis) && - (!(args.network === 'mainnet') || args.networkId) + (args.network !== 'mainnet' || args.networkId) ) { console.error('cannot specify both custom chain parameters and preset network ID') process.exit() diff --git a/packages/client/lib/blockchain/chain.ts b/packages/client/lib/blockchain/chain.ts index 50cef26058c..b0cdfc2f872 100644 --- a/packages/client/lib/blockchain/chain.ts +++ b/packages/client/lib/blockchain/chain.ts @@ -1,7 +1,7 @@ import { Block, BlockHeader } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import { ConsensusAlgorithm, Hardfork } from '@ethereumjs/common' -import { BN, toBuffer } from 'ethereumjs-util' +import { toBuffer } from 'ethereumjs-util' import { Config } from '../config' import { Event } from '../types' // eslint-disable-next-line implicit-dependencies/no-implicit @@ -39,12 +39,12 @@ export interface ChainBlocks { /** * The total difficulty of the blockchain */ - td: BN + td: bigint /** * The height of the blockchain */ - height: BN + height: bigint } /** @@ -59,12 +59,12 @@ export interface ChainHeaders { /** * The total difficulty of the headerchain */ - td: BN + td: bigint /** * The height of the headerchain */ - height: BN + height: bigint } /** @@ -89,14 +89,14 @@ export class Chain { private _headers: ChainHeaders = { latest: null, - td: new BN(0), - height: new BN(0), + td: BigInt(0), + height: BigInt(0), } private _blocks: ChainBlocks = { latest: null, - td: new BN(0), - height: new BN(0), + td: BigInt(0), + height: BigInt(0), } /** @@ -130,20 +130,20 @@ export class Chain { private reset() { this._headers = { latest: null, - td: new BN(0), - height: new BN(0), + td: BigInt(0), + height: BigInt(0), } this._blocks = { latest: null, - td: new BN(0), - height: new BN(0), + td: BigInt(0), + height: BigInt(0), } } /** * Network ID */ - get networkId(): BN { + get networkId(): bigint { return this.config.chainCommon.networkId() } @@ -219,13 +219,13 @@ export class Chain { const headers: ChainHeaders = { latest: null, - td: new BN(0), - height: new BN(0), + td: BigInt(0), + height: BigInt(0), } const blocks: ChainBlocks = { latest: null, - td: new BN(0), - height: new BN(0), + td: BigInt(0), + height: BigInt(0), } headers.latest = await this.getLatestHeader() @@ -255,7 +255,7 @@ export class Chain { * @param reverse get blocks in reverse * @returns an array of the blocks */ - async getBlocks(block: Buffer | BN, max = 1, skip = 0, reverse = false): Promise { + async getBlocks(block: Buffer | bigint, max = 1, skip = 0, reverse = false): Promise { if (!this.opened) throw new Error('Chain closed') return this.blockchain.getBlocks(block, max, skip, reverse) } @@ -265,7 +265,7 @@ export class Chain { * @param block block hash or number * @throws if block is not found */ - async getBlock(block: Buffer | BN): Promise { + async getBlock(block: Buffer | bigint): Promise { if (!this.opened) throw new Error('Chain closed') return this.blockchain.getBlock(block) } @@ -310,7 +310,7 @@ export class Chain { * @returns list of block headers */ async getHeaders( - block: Buffer | BN, + block: Buffer | bigint, max: number, skip: number, reverse: boolean @@ -372,7 +372,7 @@ export class Chain { * @param num the block number * @returns the td */ - async getTd(hash: Buffer, num: BN): Promise { + async getTd(hash: Buffer, num: bigint): Promise { if (!this.opened) throw new Error('Chain closed') return this.blockchain.getTotalDifficulty(hash, num) } diff --git a/packages/client/lib/config.ts b/packages/client/lib/config.ts index a2d6af97c91..e76ef700d72 100644 --- a/packages/client/lib/config.ts +++ b/packages/client/lib/config.ts @@ -263,7 +263,7 @@ export class Config { public synchronized: boolean public lastSyncDate: number /** Best known block height */ - public syncTargetHeight?: BN + public syncTargetHeight?: bigint public readonly chainCommon: Common public readonly execCommon: Common diff --git a/packages/client/lib/execution/receipt.ts b/packages/client/lib/execution/receipt.ts index 0af1a329865..f2c049c6007 100644 --- a/packages/client/lib/execution/receipt.ts +++ b/packages/client/lib/execution/receipt.ts @@ -164,7 +164,7 @@ export class ReceiptsManager extends MetaDBManager { ): Promise { const returnedLogs: GetLogsReturn = [] let returnedLogsSize = 0 - for (const i = from.header.number.clone(); i.lte(to.header.number); i.iaddn(1)) { + for (let i = from.header.number; i <= to.header.number; i++) { const block = await this.chain.getBlock(i) const receipts = await this.getReceipts(block.hash()) if (receipts.length === 0) continue @@ -238,7 +238,7 @@ export class ReceiptsManager extends MetaDBManager { if (operation === IndexOperation.Save) { const withinTxLookupLimit = this.config.txLookupLimit === 0 || - this.chain.headers.height.subn(this.config.txLookupLimit).lt(block.header.number) + this.chain.headers.height - BigInt(this.config.txLookupLimit) < block.header.number if (withinTxLookupLimit) { for (const [i, tx] of block.transactions.entries()) { const index: TxHashIndex = [block.hash(), i] @@ -248,8 +248,8 @@ export class ReceiptsManager extends MetaDBManager { } if (this.config.txLookupLimit > 0) { // Remove tx hashes for one block past txLookupLimit - const limit = this.chain.headers.height.subn(this.config.txLookupLimit) - if (limit.ltn(0)) return + const limit = this.chain.headers.height - BigInt(this.config.txLookupLimit) + if (limit < BigInt(0)) return const blockDelIndexes = await this.chain.getBlock(limit) void this.updateIndex(IndexOperation.Delete, IndexType.TxHash, blockDelIndexes) } diff --git a/packages/client/lib/execution/vmexecution.ts b/packages/client/lib/execution/vmexecution.ts index ab804963dbd..ca684f3c4ff 100644 --- a/packages/client/lib/execution/vmexecution.ts +++ b/packages/client/lib/execution/vmexecution.ts @@ -73,7 +73,7 @@ export class VMExecution extends Execution { this.config.execCommon.setHardforkByBlockNumber(number, td) this.hardfork = this.config.execCommon.hardfork() this.config.logger.info(`Initializing VM execution hardfork=${this.hardfork}`) - if (number.isZero()) { + if (number === BigInt(0)) { await this.vm.stateManager.generateCanonicalGenesis() } } @@ -254,9 +254,9 @@ export class VMExecution extends Execution { const endHeadBlock = await this.vm.blockchain.getIteratorHead('vm') if (numExecuted > 0) { - const firstNumber = startHeadBlock.header.number.toNumber() + const firstNumber = startHeadBlock.header.number const firstHash = short(startHeadBlock.hash()) - const lastNumber = endHeadBlock.header.number.toNumber() + const lastNumber = endHeadBlock.header.number const lastHash = short(endHeadBlock.hash()) const baseFeeAdd = this.config.execCommon.gteHardfork(Hardfork.London) ? `baseFee=${endHeadBlock.header.baseFeePerGas} ` diff --git a/packages/client/lib/miner/miner.ts b/packages/client/lib/miner/miner.ts index 3964347b7c1..a570628497c 100644 --- a/packages/client/lib/miner/miner.ts +++ b/packages/client/lib/miner/miner.ts @@ -1,6 +1,5 @@ import Ethash, { Solution, Miner as EthashMiner } from '@ethereumjs/ethash' import { BlockHeader } from '@ethereumjs/block' -import { BN } from 'ethereumjs-util' import { ConsensusType, Hardfork } from '@ethereumjs/common' import { Event } from '../types' import { Config } from '../config' @@ -127,8 +126,8 @@ export class Miner { private async chainUpdated() { this.ethashMiner?.stop() const latestBlockHeader = this.latestBlockHeader() - const target = latestBlockHeader.timestamp.muln(1000).addn(this.period).sub(new BN(Date.now())) - const timeout = BN.max(new BN(0), target).toNumber() + const target = Number(latestBlockHeader.timestamp) * 1000 + this.period - Date.now() + const timeout = BigInt(0) > target ? 0 : target this.config.logger.debug( `Miner: Chain updated with block ${ latestBlockHeader.number @@ -175,7 +174,8 @@ export class Miner { this.config.events.once(Event.CHAIN_UPDATED, _boundSetInterruptHandler) const parentBlock = this.service.chain.blocks.latest! - const number = parentBlock.header.number.addn(1) + //eslint-disable-next-line + const number = parentBlock.header.number + BigInt(1) let { gasLimit } = parentBlock.header if (this.config.chainCommon.consensusType() === ConsensusType.ProofOfAuthority) { @@ -221,14 +221,14 @@ export class Miner { let baseFeePerGas const londonHardforkBlock = this.config.chainCommon.hardforkBlock(Hardfork.London) - const isInitialEIP1559Block = londonHardforkBlock && number.eq(londonHardforkBlock) + const isInitialEIP1559Block = londonHardforkBlock && number === londonHardforkBlock if (isInitialEIP1559Block) { // Get baseFeePerGas from `paramByEIP` since 1559 not currently active on common - baseFeePerGas = new BN( + baseFeePerGas = BigInt( this.config.chainCommon.paramByEIP('gasConfig', 'initialBaseFee', 1559) ) // Set initial EIP1559 block gas limit to 2x parent gas limit per logic in `block.validateGasLimit` - gasLimit = gasLimit.muln(2) + gasLimit = gasLimit * BigInt(2) } else if (this.config.chainCommon.isActivatedEIP(1559)) { baseFeePerGas = parentBlock.header.calcNextBaseFee() } @@ -270,13 +270,11 @@ export class Miner { await blockBuilder.addTransaction(txs[index]) } catch (error: any) { if (error.message === 'tx has a higher gas limit than the remaining gas in the block') { - if (blockBuilder.gasUsed > BigInt(gasLimit.subn(21000).toString(10))) { + if (blockBuilder.gasUsed > gasLimit - BigInt(21000)) { // If block has less than 21000 gas remaining, consider it full blockFull = true this.config.logger.info( - `Miner: Assembled block full (gasLeft: ${gasLimit.sub( - new BN(blockBuilder.gasUsed.toString(10)) - )})` + `Miner: Assembled block full (gasLeft: ${gasLimit - blockBuilder.gasUsed})` ) } } else { diff --git a/packages/client/lib/miner/pendingBlock.ts b/packages/client/lib/miner/pendingBlock.ts index 3b752369b91..32f8fb809d3 100644 --- a/packages/client/lib/miner/pendingBlock.ts +++ b/packages/client/lib/miner/pendingBlock.ts @@ -6,7 +6,6 @@ import type { Block, HeaderData } from '@ethereumjs/block' import type { TypedTransaction } from '@ethereumjs/tx' import type { TxPool } from '../service/txpool' import type { Config } from '../config' -import { bnToBigInt } from 'ethereumjs-util' interface PendingBlockOpts { /* Config */ @@ -38,7 +37,7 @@ export class PendingBlock { * @returns an 8-byte payload identifier to call {@link BlockBuilder.build} with */ async start(vm: VM, parentBlock: Block, headerData: Partial = {}) { - const number = parentBlock.header.number.addn(1) + const number = parentBlock.header.number + BigInt(1) const { gasLimit } = parentBlock.header const baseFeePerGas = vm._common.isActivatedEIP(1559) ? parentBlock.header.calcNextBaseFee() @@ -79,11 +78,11 @@ export class PendingBlock { await builder.addTransaction(txs[index]) } catch (error: any) { if (error.message === 'tx has a higher gas limit than the remaining gas in the block') { - if (builder.gasUsed > bnToBigInt(gasLimit) - BigInt(21000)) { + if (builder.gasUsed > gasLimit - BigInt(21000)) { // If block has less than 21000 gas remaining, consider it full blockFull = true this.config.logger.info( - `Pending: Assembled block full (gasLeft: ${bnToBigInt(gasLimit) - builder.gasUsed})` + `Pending: Assembled block full (gasLeft: ${gasLimit - builder.gasUsed})` ) } } else { @@ -137,7 +136,7 @@ export class PendingBlock { await builder.addTransaction(txs[index]) } catch (error: any) { if (error.message === 'tx has a higher gas limit than the remaining gas in the block') { - if (builder.gasUsed > bnToBigInt((builder as any).headerData.gasLimit) - BigInt(21000)) { + if (builder.gasUsed > (builder as any).headerData.gasLimit - BigInt(21000)) { // If block has less than 21000 gas remaining, consider it full blockFull = true this.config.logger.info(`Pending: Assembled block full`) diff --git a/packages/client/lib/net/peer/peer.ts b/packages/client/lib/net/peer/peer.ts index 9a3ab642d4f..5d3a155f826 100644 --- a/packages/client/lib/net/peer/peer.ts +++ b/packages/client/lib/net/peer/peer.ts @@ -105,12 +105,12 @@ export class Peer extends events.EventEmitter { * ```typescript * await peer.bindProtocol(ethProtocol, sender) * // Example: Directly call message name as a method on the bound protocol - * const headers1 = await peer.eth.getBlockHeaders({ block: new BN(1), max: 100 }) + * const headers1 = await peer.eth.getBlockHeaders({ block: BigInt(1), max: 100 }) * // Example: Call request() method with message name as first parameter - * const headers2 = await peer.eth.request('getBlockHeaders', { block: new BN(1), max: 100 }) + * const headers2 = await peer.eth.request('getBlockHeaders', { block: BigInt(1), max: 100 }) * // Example: Call send() method with message name as first parameter and * // wait for response message as an event - * peer.eth.send('getBlockHeaders', { block: new BN(1), max: 100 }) + * peer.eth.send('getBlockHeaders', { block: BigInt(1), max: 100 }) * peer.eth.on('message', ({ data }) => console.log(`Received ${data.length} headers`)) * ``` */ diff --git a/packages/client/lib/net/protocol/ethprotocol.ts b/packages/client/lib/net/protocol/ethprotocol.ts index 3e992cd3865..d3907219b41 100644 --- a/packages/client/lib/net/protocol/ethprotocol.ts +++ b/packages/client/lib/net/protocol/ethprotocol.ts @@ -6,7 +6,7 @@ import { BlockBodyBuffer, } from '@ethereumjs/block' import { TransactionFactory, TypedTransaction } from '@ethereumjs/tx' -import { BN, bufferToInt, intToBuffer, rlp } from 'ethereumjs-util' +import { bigIntToBuffer, bufferToBigInt, bufferToInt, intToBuffer, rlp } from 'ethereumjs-util' import { Chain } from './../../blockchain' import { Message, Protocol, ProtocolOptions } from './protocol' import type { TxReceiptWithType } from '../../execution/receipt' @@ -23,9 +23,9 @@ interface EthProtocolOptions extends ProtocolOptions { type GetBlockHeadersOpts = { /* Request id (default: next internal id) */ - reqId?: BN + reqId?: bigint /* The block's number or hash */ - block: BN | Buffer + block: bigint | Buffer /* Max number of blocks to return */ max: number /* Number of blocks to skip apart (default: 0) */ @@ -36,21 +36,21 @@ type GetBlockHeadersOpts = { type GetBlockBodiesOpts = { /* Request id (default: next internal id) */ - reqId?: BN + reqId?: bigint /* The block hashes */ hashes: Buffer[] } type GetPooledTransactionsOpts = { /* Request id (default: next internal id) */ - reqId?: BN + reqId?: bigint /* The tx hashes */ hashes: Buffer[] } type GetReceiptsOpts = { /* Request id (default: next internal id) */ - reqId?: BN + reqId?: bigint /* The block hashes to request receipts for */ hashes: Buffer[] } @@ -60,13 +60,13 @@ type GetReceiptsOpts = { * methods in camelCase to BoundProtocol. */ export interface EthProtocolMethods { - getBlockHeaders: (opts: GetBlockHeadersOpts) => Promise<[BN, BlockHeader[]]> - getBlockBodies: (opts: GetBlockBodiesOpts) => Promise<[BN, BlockBodyBuffer[]]> - getPooledTransactions: (opts: GetPooledTransactionsOpts) => Promise<[BN, TypedTransaction[]]> - getReceipts: (opts: GetReceiptsOpts) => Promise<[BN, TxReceipt[]]> + getBlockHeaders: (opts: GetBlockHeadersOpts) => Promise<[bigint, BlockHeader[]]> + getBlockBodies: (opts: GetBlockBodiesOpts) => Promise<[bigint, BlockBodyBuffer[]]> + getPooledTransactions: (opts: GetPooledTransactionsOpts) => Promise<[bigint, TypedTransaction[]]> + getReceipts: (opts: GetReceiptsOpts) => Promise<[bigint, TxReceipt[]]> } -const id = new BN(0) +let id = BigInt(0) /** * Implements eth/66 protocol @@ -79,8 +79,8 @@ export class EthProtocol extends Protocol { { name: 'NewBlockHashes', code: 0x01, - encode: (hashes: any[]) => hashes.map((hn) => [hn[0], hn[1].toArrayLike(Buffer)]), - decode: (hashes: any[]) => hashes.map((hn) => [hn[0], new BN(hn[1])]), + encode: (hashes: any[]) => hashes.map((hn) => [hn[0], bigIntToBuffer(hn[1])]), + decode: (hashes: any[]) => hashes.map((hn) => [hn[0], bufferToBigInt(hn[1])]), }, { name: 'Transactions', @@ -97,7 +97,7 @@ export class EthProtocol extends Protocol { return serializedTxs }, decode: ([txs]: [Buffer[]]) => { - // TODO: add proper Common instance (problem: service not accesible) + // TODO: add proper Common instance (problem: service not accessible) //const common = this.config.chainCommon.copy() //common.setHardforkByBlockNumber(this.config.syncTargetHeight, this.chain.headers.td) return txs.map((txData) => TransactionFactory.fromBlockBodyData(txData)) @@ -108,12 +108,12 @@ export class EthProtocol extends Protocol { code: 0x03, response: 0x04, encode: ({ reqId, block, max, skip = 0, reverse = false }: GetBlockHeadersOpts) => [ - (reqId === undefined ? id.iaddn(1) : new BN(reqId)).toArrayLike(Buffer), - [BN.isBN(block) ? block.toArrayLike(Buffer) : block, max, skip, !reverse ? 0 : 1], + bigIntToBuffer(reqId ?? ++id), + [typeof block === 'bigint' ? bigIntToBuffer(block) : block, max, skip, !reverse ? 0 : 1], ], decode: ([reqId, [block, max, skip, reverse]]: any) => ({ - reqId: new BN(reqId), - block: block.length === 32 ? block : new BN(block), + reqId: bufferToBigInt(reqId), + block: block.length === 32 ? block : bufferToBigInt(block), max: bufferToInt(max), skip: bufferToInt(skip), reverse: bufferToInt(reverse) === 0 ? false : true, @@ -122,12 +122,12 @@ export class EthProtocol extends Protocol { { name: 'BlockHeaders', code: 0x04, - encode: ({ reqId, headers }: { reqId: BN; headers: BlockHeader[] }) => [ - reqId.toArrayLike(Buffer), + encode: ({ reqId, headers }: { reqId: bigint; headers: BlockHeader[] }) => [ + bigIntToBuffer(reqId), headers.map((h) => h.raw()), ], decode: ([reqId, headers]: [Buffer, BlockHeaderBuffer[]]) => [ - new BN(reqId), + bufferToBigInt(reqId), headers.map((h) => // TODO: need to implement hardforkByTD otherwise // pre-merge blocks will fail to init if chainCommon is past merge @@ -144,35 +144,32 @@ export class EthProtocol extends Protocol { name: 'GetBlockBodies', code: 0x05, response: 0x06, - encode: ({ reqId, hashes }: GetBlockBodiesOpts) => [ - (reqId === undefined ? id.iaddn(1) : new BN(reqId)).toArrayLike(Buffer), - hashes, - ], + encode: ({ reqId, hashes }: GetBlockBodiesOpts) => [bigIntToBuffer(reqId ?? ++id), hashes], decode: ([reqId, hashes]: [Buffer, Buffer[]]) => ({ - reqId: new BN(reqId), + reqId: bufferToBigInt(reqId), hashes, }), }, { name: 'BlockBodies', code: 0x06, - encode: ({ reqId, bodies }: { reqId: BN; bodies: BlockBodyBuffer[] }) => [ - reqId.toArrayLike(Buffer), + encode: ({ reqId, bodies }: { reqId: bigint; bodies: BlockBodyBuffer[] }) => [ + bigIntToBuffer(reqId), bodies, ], - decode: ([reqId, bodies]: [Buffer, BlockBodyBuffer[]]) => [new BN(reqId), bodies], + decode: ([reqId, bodies]: [Buffer, BlockBodyBuffer[]]) => [bufferToBigInt(reqId), bodies], }, { name: 'NewBlock', code: 0x07, - encode: ([block, td]: [Block, BN]) => [block.raw(), td.toArrayLike(Buffer)], + encode: ([block, td]: [Block, bigint]) => [block.raw(), bigIntToBuffer(td)], decode: ([block, td]: [BlockBuffer, Buffer]) => [ Block.fromValuesArray(block, { // eslint-disable-next-line no-invalid-this common: this.config.chainCommon, hardforkByBlockNumber: true, }), - new BN(td), + td, ], }, { @@ -184,18 +181,18 @@ export class EthProtocol extends Protocol { code: 0x09, response: 0x0a, encode: ({ reqId, hashes }: GetPooledTransactionsOpts) => [ - (reqId === undefined ? id.iaddn(1) : new BN(reqId)).toArrayLike(Buffer), + bigIntToBuffer(reqId ?? ++id), hashes, ], decode: ([reqId, hashes]: [Buffer, Buffer[]]) => ({ - reqId: new BN(reqId), + reqId: bufferToBigInt(reqId), hashes, }), }, { name: 'PooledTransactions', code: 0x0a, - encode: ({ reqId, txs }: { reqId: BN; txs: TypedTransaction[] }) => { + encode: ({ reqId, txs }: { reqId: bigint; txs: TypedTransaction[] }) => { const serializedTxs = [] for (const tx of txs) { if (tx.type === 0) { @@ -204,10 +201,10 @@ export class EthProtocol extends Protocol { serializedTxs.push(tx.serialize()) } } - return [reqId.toArrayLike(Buffer), serializedTxs] + return [bigIntToBuffer(reqId), serializedTxs] }, decode: ([reqId, txs]: [Buffer, any[]]) => [ - new BN(reqId), + bufferToBigInt(reqId), // TODO: add proper Common instance (problem: service not accesible) //const common = this.config.chainCommon.copy() //common.setHardforkByBlockNumber(this.config.syncTargetHeight) @@ -218,19 +215,19 @@ export class EthProtocol extends Protocol { name: 'GetReceipts', code: 0x0f, response: 0x10, - encode: ({ reqId, hashes }: { reqId: BN; hashes: Buffer[] }) => [ - (reqId === undefined ? id.iaddn(1) : new BN(reqId)).toArrayLike(Buffer), + encode: ({ reqId, hashes }: { reqId: bigint; hashes: Buffer[] }) => [ + bigIntToBuffer(reqId ?? ++id), hashes, ], decode: ([reqId, hashes]: [Buffer, Buffer[]]) => ({ - reqId: new BN(reqId), + reqId: bufferToBigInt(reqId), hashes, }), }, { name: 'Receipts', code: 0x10, - encode: ({ reqId, receipts }: { reqId: BN; receipts: TxReceiptWithType[] }) => { + encode: ({ reqId, receipts }: { reqId: bigint; receipts: TxReceiptWithType[] }) => { const serializedReceipts = [] for (const receipt of receipts) { let encodedReceipt = rlp.encode([ @@ -247,10 +244,10 @@ export class EthProtocol extends Protocol { } serializedReceipts.push(encodedReceipt) } - return [reqId.toArrayLike(Buffer), serializedReceipts] + return [bigIntToBuffer(reqId), serializedReceipts] }, decode: ([reqId, receipts]: [Buffer, Buffer[]]) => [ - new BN(reqId), + bufferToBigInt(reqId), receipts.map((r) => { // Legacy receipt if r[0] >= 0xc0, otherwise typed receipt with first byte as TransactionType const decoded = rlp.decode(r[0] >= 0xc0 ? r : r.slice(1)) as any @@ -313,13 +310,12 @@ export class EthProtocol extends Protocol { */ encodeStatus(): any { return { - networkId: this.chain.networkId.toArrayLike(Buffer), - td: this.chain.blocks.td.isZero() - ? Buffer.from([]) - : this.chain.blocks.td.toArrayLike(Buffer), + networkId: bigIntToBuffer(this.chain.networkId), + td: + this.chain.blocks.td === BigInt(0) ? Buffer.from([]) : bigIntToBuffer(this.chain.blocks.td), bestHash: this.chain.blocks.latest!.hash(), genesisHash: this.chain.genesis.hash, - latestBlock: this.chain.blocks.latest!.header.number.toArrayLike(Buffer), + latestBlock: bigIntToBuffer(this.chain.blocks.latest!.header.number), } } @@ -329,8 +325,8 @@ export class EthProtocol extends Protocol { */ decodeStatus(status: any): any { return { - networkId: new BN(status.networkId), - td: new BN(status.td), + networkId: bufferToBigInt(status.networkId), + td: bufferToBigInt(status.td), bestHash: status.bestHash, genesisHash: status.genesisHash, } diff --git a/packages/client/lib/net/protocol/flowcontrol.ts b/packages/client/lib/net/protocol/flowcontrol.ts index d8e8860dcf0..d548fc4a663 100644 --- a/packages/client/lib/net/protocol/flowcontrol.ts +++ b/packages/client/lib/net/protocol/flowcontrol.ts @@ -68,7 +68,6 @@ export class FlowControl { const params = this.in.get(peer.id) ?? ({ ble: bl } as FlowParams) if (params.last) { // recharge BLE at rate of MRR when less than BL - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands params.ble = Math.min(params.ble! + mrr * (now - params.last), bl) } params.last = now @@ -90,12 +89,10 @@ export class FlowControl { const now = Date.now() const params = this.out.get(peer.id) ?? {} if (params.bv && params.last) { - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands params.bv = Math.min(params.bv + this.mrr * (now - params.last), this.bl) } else { params.bv = this.bl } - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands params.bv -= this.mrc[messageName].base + this.mrc[messageName].req * count params.last = now if (params.bv < 0) { diff --git a/packages/client/lib/net/protocol/lesprotocol.ts b/packages/client/lib/net/protocol/lesprotocol.ts index 50676ab1640..0f9a9d345f2 100644 --- a/packages/client/lib/net/protocol/lesprotocol.ts +++ b/packages/client/lib/net/protocol/lesprotocol.ts @@ -1,4 +1,4 @@ -import { BN, bufferToInt } from 'ethereumjs-util' +import { bigIntToBuffer, bufferToBigInt, bufferToInt, intToBuffer } from 'ethereumjs-util' import { BlockHeader, BlockHeaderBuffer } from '@ethereumjs/block' import { Chain } from './../../blockchain' import { Message, Protocol, ProtocolOptions } from './protocol' @@ -14,9 +14,9 @@ export interface LesProtocolOptions extends ProtocolOptions { type GetBlockHeadersOpts = { /* Request id (default: next internal id) */ - reqId?: BN + reqId?: bigint /* The block's number or hash */ - block: BN | Buffer + block: bigint | Buffer /* Max number of blocks to return */ max: number /* Number of blocks to skip apart (default: 0) */ @@ -31,10 +31,10 @@ type GetBlockHeadersOpts = { export interface LesProtocolMethods { getBlockHeaders: ( opts: GetBlockHeadersOpts - ) => Promise<{ reqId: BN; bv: BN; headers: BlockHeader[] }> + ) => Promise<{ reqId: bigint; bv: bigint; headers: BlockHeader[] }> } -const id = new BN(0) +let id = BigInt(0) /** * Implements les/1 and les/2 protocols @@ -52,15 +52,15 @@ export class LesProtocol extends Protocol { encode: ({ headHash, headNumber, headTd, reorgDepth }: any) => [ // TO DO: handle state changes headHash, - headNumber.toArrayLike(Buffer), - headTd.toArrayLike(Buffer), - new BN(reorgDepth).toArrayLike(Buffer), + bigIntToBuffer(headNumber), + bigIntToBuffer(headTd), + intToBuffer(reorgDepth), ], decode: ([headHash, headNumber, headTd, reorgDepth]: any) => ({ // TO DO: handle state changes - headHash: headHash, - headNumber: new BN(headNumber), - headTd: new BN(headTd), + headHash, + headNumber: bufferToBigInt(headNumber), + headTd: bufferToBigInt(headTd), reorgDepth: bufferToInt(reorgDepth), }), }, @@ -69,12 +69,12 @@ export class LesProtocol extends Protocol { code: 0x02, response: 0x03, encode: ({ reqId, block, max, skip = 0, reverse = false }: GetBlockHeadersOpts) => [ - (reqId === undefined ? id.iaddn(1) : new BN(reqId)).toArrayLike(Buffer), - [BN.isBN(block) ? block.toArrayLike(Buffer) : block, max, skip, !reverse ? 0 : 1], + bigIntToBuffer(reqId ?? ++id), + [typeof block === 'bigint' ? bigIntToBuffer(block) : block, max, skip, !reverse ? 0 : 1], ], decode: ([reqId, [block, max, skip, reverse]]: any) => ({ - reqId: new BN(reqId), - block: block.length === 32 ? block : new BN(block), + reqId: bufferToBigInt(reqId), + block: block.length === 32 ? block : bufferToBigInt(block), max: bufferToInt(max), skip: bufferToInt(skip), reverse: bufferToInt(reverse) === 0 ? false : true, @@ -84,13 +84,13 @@ export class LesProtocol extends Protocol { name: 'BlockHeaders', code: 0x03, encode: ({ reqId, bv, headers }: any) => [ - new BN(reqId).toArrayLike(Buffer), - new BN(bv).toArrayLike(Buffer), + bigIntToBuffer(reqId), + bigIntToBuffer(bv), headers.map((h: BlockHeader) => h.raw()), ], decode: ([reqId, bv, headers]: any) => ({ - reqId: new BN(reqId), - bv: new BN(bv), + reqId: bufferToBigInt(reqId), + bv: bufferToBigInt(bv), headers: headers.map((h: BlockHeaderBuffer) => BlockHeader.fromValuesArray(h, { hardforkByBlockNumber: true, @@ -158,8 +158,8 @@ export class LesProtocol extends Protocol { serveChainSince: 0, serveStateSince: 0, // txRelay: 1, TODO: uncomment with client tx pool functionality - 'flowControl/BL': new BN(this.flow.bl).toArrayLike(Buffer), - 'flowControl/MRR': new BN(this.flow.mrr).toArrayLike(Buffer), + 'flowControl/BL': intToBuffer(this.flow.bl), + 'flowControl/MRR': intToBuffer(this.flow.mrr), 'flowControl/MRC': Object.entries(this.flow.mrc).map(([name, { base, req }]) => { const { code } = this.messages.find((m) => m.name === name)! return [code, base, req] @@ -171,17 +171,17 @@ export class LesProtocol extends Protocol { const nextFork = this.config.chainCommon.nextHardforkBlock(this.config.chainCommon.hardfork()) const forkID = [ Buffer.from(forkHash.slice(2), 'hex'), - nextFork ? nextFork.toArrayLike(Buffer) : Buffer.from([]), + nextFork ? bigIntToBuffer(nextFork) : Buffer.from([]), ] return { - networkId: this.chain.networkId.toArrayLike(Buffer), - headTd: this.chain.headers.td.toArrayLike(Buffer), + networkId: bigIntToBuffer(this.chain.networkId), + headTd: bigIntToBuffer(this.chain.headers.td), headHash: this.chain.headers.latest?.hash(), - headNum: this.chain.headers.latest?.number.toArrayLike(Buffer), + headNum: bigIntToBuffer(this.chain.headers.height), genesisHash: this.chain.genesis.hash, forkID, - recentTxLookup: new BN(1).toArrayLike(Buffer), + recentTxLookup: intToBuffer(1), ...serveOptions, } } @@ -195,7 +195,7 @@ export class LesProtocol extends Protocol { const mrc: any = {} if (status['flowControl/MRC']) { for (let entry of status['flowControl/MRC']) { - entry = entry.map((e: any) => new BN(e).toNumber()) + entry = entry.map((e: any) => bufferToInt(e)) mrc[entry[0]] = { base: entry[1], req: entry[2] } const message = this.messages.find((m) => m.code === entry[0]) if (message) { @@ -204,10 +204,10 @@ export class LesProtocol extends Protocol { } } return { - networkId: new BN(status.networkId), - headTd: new BN(status.headTd), + networkId: bufferToBigInt(status.networkId), + headTd: bufferToBigInt(status.headTd), headHash: status.headHash, - headNum: new BN(status.headNum), + headNum: bufferToBigInt(status.headNum), genesisHash: status.genesisHash, forkID: status.forkID, recentTxLookup: status.recentTxLookup, @@ -215,8 +215,8 @@ export class LesProtocol extends Protocol { serveChainSince: status.serveChainSince ?? 0, serveStateSince: status.serveStateSince ?? 0, txRelay: !!status.txRelay, - bl: status['flowControl/BL'] ? new BN(status['flowControl/BL']).toNumber() : undefined, - mrr: status['flowControl/MRR'] ? new BN(status['flowControl/MRR']).toNumber() : undefined, + bl: status['flowControl/BL'] ? bufferToInt(status['flowControl/BL']) : undefined, + mrr: status['flowControl/MRR'] ? bufferToInt(status['flowControl/MRR']) : undefined, mrc: mrc, } } diff --git a/packages/client/lib/rpc/modules/engine.ts b/packages/client/lib/rpc/modules/engine.ts index 1366d79a24c..6caef4a58a5 100644 --- a/packages/client/lib/rpc/modules/engine.ts +++ b/packages/client/lib/rpc/modules/engine.ts @@ -1,6 +1,6 @@ import { Block, HeaderData } from '@ethereumjs/block' import { TransactionFactory, TypedTransaction } from '@ethereumjs/tx' -import { toBuffer, bufferToHex, rlp, BN, zeros } from 'ethereumjs-util' +import { toBuffer, bufferToHex, rlp, zeros } from 'ethereumjs-util' import { BaseTrie as Trie } from 'merkle-patricia-tree' import { Hardfork } from '@ethereumjs/common' @@ -542,10 +542,16 @@ export class Engine { await this.execution.setHead(blocks) this.service.txPool.removeNewBlockTxs(blocks) - const timeDiff = new Date().getTime() / 1000 - headBlock.header.timestamp.toNumber() + // TODO: removed along rebase, 2022-04-05, @holgerd77 + // Analyze if code should be there for some reason + /*for (const block of blocks) { + this.validBlocks.delete(block.hash().toString('hex')) + }*/ + + const timeDiff = new Date().getTime() / 1000 - Number(headBlock.header.timestamp) if ( (!this.config.syncTargetHeight || - this.config.syncTargetHeight.lt(headBlock.header.number)) && + this.config.syncTargetHeight < headBlock.header.number) && timeDiff < 30 ) { this.config.synchronized = true diff --git a/packages/client/lib/rpc/modules/eth.ts b/packages/client/lib/rpc/modules/eth.ts index ebc42e808f4..57e860b822b 100644 --- a/packages/client/lib/rpc/modules/eth.ts +++ b/packages/client/lib/rpc/modules/eth.ts @@ -11,9 +11,8 @@ import { import { Account, Address, - BN, bufferToHex, - bnToHex, + bigIntToHex, intToHex, rlp, toBuffer, @@ -171,7 +170,7 @@ const jsonRpcBlock = async ( receiptsRoot: header.receiptTrie!, miner: header.coinbase!, difficulty: header.difficulty!, - totalDifficulty: bnToHex(td), + totalDifficulty: bigIntToHex(td), extraData: header.extraData!, size: intToHex(Buffer.byteLength(JSON.stringify(json))), gasLimit: header.gasLimit!, @@ -190,7 +189,7 @@ const jsonRpcTx = (tx: TypedTransaction, block?: Block, txIndex?: number): JsonR const txJSON = tx.toJSON() return { blockHash: block ? bufferToHex(block.hash()) : null, - blockNumber: block ? bnToHex(block.header.number) : null, + blockNumber: block ? bigIntToHex(block.header.number) : null, from: tx.getSenderAddress().toString(), gas: txJSON.gasLimit!, gasPrice: txJSON.gasPrice ?? txJSON.maxFeePerGas!, @@ -226,7 +225,7 @@ const jsonRpcLog = async ( transactionIndex: txIndex !== undefined ? intToHex(txIndex) : null, transactionHash: tx ? bufferToHex(tx.hash()) : null, blockHash: block ? bufferToHex(block.hash()) : null, - blockNumber: block ? bnToHex(block.header.number) : null, + blockNumber: block ? bigIntToHex(block.header.number) : null, address: bufferToHex(log[0]), topics: log[1].map((t) => bufferToHex(t as Buffer)), data: bufferToHex(log[2]), @@ -237,8 +236,8 @@ const jsonRpcLog = async ( */ const jsonRpcReceipt = async ( receipt: TxReceipt, - gasUsed: BN, - effectiveGasPrice: BN, + gasUsed: bigint, + effectiveGasPrice: bigint, block: Block, tx: TypedTransaction, txIndex: number, @@ -248,12 +247,12 @@ const jsonRpcReceipt = async ( transactionHash: bufferToHex(tx.hash()), transactionIndex: intToHex(txIndex), blockHash: bufferToHex(block.hash()), - blockNumber: bnToHex(block.header.number), + blockNumber: bigIntToHex(block.header.number), from: tx.getSenderAddress().toString(), to: tx.to?.toString() ?? null, - cumulativeGasUsed: bnToHex(new BN(receipt.gasUsed)), - effectiveGasPrice: bnToHex(effectiveGasPrice), - gasUsed: bnToHex(gasUsed), + cumulativeGasUsed: bufferToHex(receipt.gasUsed), + effectiveGasPrice: bigIntToHex(effectiveGasPrice), + gasUsed: bigIntToHex(gasUsed), contractAddress: contractAddress?.toString() ?? null, logs: await Promise.all( receipt.logs.map((l, i) => jsonRpcLog(l, block, tx, txIndex, logIndex + i)) @@ -284,12 +283,12 @@ const getBlockByOption = async (blockOpt: string, chain: Chain) => { if (blockOpt === 'latest') { block = latest } else if (blockOpt === 'earliest') { - block = await chain.getBlock(new BN(0)) + block = await chain.getBlock(BigInt(0)) } else { - const blockNumber = new BN(toBuffer(blockOpt)) - if (blockNumber.eq(latest.header.number)) { + const blockNumber = BigInt(blockOpt) + if (blockNumber === latest.header.number) { block = latest - } else if (blockNumber.gt(latest.header.number)) { + } else if (blockNumber > latest.header.number) { throw { code: INVALID_PARAMS, message: 'specified block greater than current height', @@ -433,7 +432,7 @@ export class Eth { * @param params An empty array */ async blockNumber(_params = []) { - return bnToHex(this._chain.headers.latest?.number ?? new BN(0)) + return bigIntToHex(this._chain.headers.latest?.number ?? BigInt(0)) } /** @@ -488,7 +487,7 @@ export class Eth { */ async chainId(_params = []) { const chainId = this._chain.config.chainCommon.chainId() - return bnToHex(chainId) + return bigIntToHex(chainId) } /** @@ -567,7 +566,7 @@ export class Eth { const vm = this._vm.copy() await vm.stateManager.setStateRoot(block.header.stateRoot) const account = await vm.stateManager.getAccount(address) - return bnToHex(account.balance) + return bigIntToHex(account.balance) } /** @@ -709,7 +708,7 @@ export class Eth { const address = Address.fromString(addressHex) const account: Account = await vm.stateManager.getAccount(address) - return bnToHex(account.nonce) + return bigIntToHex(account.nonce) } /** @@ -727,11 +726,11 @@ export class Eth { */ async getUncleCountByBlockNumber(params: [string]) { const [blockNumberHex] = params - const blockNumber = new BN(toBuffer(blockNumberHex)) + const blockNumber = BigInt(blockNumberHex) const latest = this._chain.headers.latest?.number ?? (await this._chain.getLatestHeader()).number - if (blockNumber.gt(latest)) { + if (blockNumber > latest) { throw { code: INVALID_PARAMS, message: 'specified block greater than current height', @@ -763,10 +762,12 @@ export class Eth { const parentBlock = await this._chain.getBlock(block.header.parentHash) const tx = block.transactions[txIndex] const effectiveGasPrice = tx.supports(Capability.EIP1559FeeMarket) - ? BN.min( - (tx as FeeMarketEIP1559Transaction).maxPriorityFeePerGas, - (tx as FeeMarketEIP1559Transaction).maxFeePerGas.sub(block.header.baseFeePerGas!) - ).add(block.header.baseFeePerGas!) + ? (tx as FeeMarketEIP1559Transaction).maxPriorityFeePerGas < + (tx as FeeMarketEIP1559Transaction).maxFeePerGas - block.header.baseFeePerGas! + ? (tx as FeeMarketEIP1559Transaction).maxPriorityFeePerGas + : (tx as FeeMarketEIP1559Transaction).maxFeePerGas - + block.header.baseFeePerGas! + + block.header.baseFeePerGas! : (tx as Transaction).gasPrice // Run tx through copied vm to get tx gasUsed and createdAddress @@ -778,7 +779,7 @@ export class Eth { const { gasUsed, createdAddress } = runBlockResult.results[txIndex] return jsonRpcReceipt( receipt, - new BN(gasUsed.toString(10)), + gasUsed, effectiveGasPrice, block, tx, @@ -820,12 +821,12 @@ export class Eth { } } else { if (fromBlock === 'earliest') { - from = await this._chain.getBlock(new BN(0)) + from = await this._chain.getBlock(BigInt(0)) } else if (fromBlock === 'latest' || fromBlock === undefined) { from = this._chain.blocks.latest! } else { - const blockNum = new BN(toBuffer(fromBlock)) - if (blockNum.gt(this._chain.headers.height)) { + const blockNum = BigInt(fromBlock) + if (blockNum > this._chain.headers.height) { throw { code: INVALID_PARAMS, message: 'specified `fromBlock` greater than current height', @@ -838,8 +839,8 @@ export class Eth { } else if (toBlock === 'latest' || toBlock === undefined) { to = this._chain.blocks.latest! } else { - const blockNum = new BN(toBuffer(toBlock)) - if (blockNum.gt(this._chain.headers.height)) { + const blockNum = BigInt(toBlock) + if (blockNum > this._chain.headers.height) { throw { code: INVALID_PARAMS, message: 'specified `toBlock` greater than current height', @@ -849,7 +850,8 @@ export class Eth { } } if ( - to.header.number.sub(from.header.number).gtn(this.receiptsManager.GET_LOGS_BLOCK_RANGE_LIMIT) + to.header.number - from.header.number > + BigInt(this.receiptsManager.GET_LOGS_BLOCK_RANGE_LIMIT) ) { throw { code: INVALID_PARAMS, @@ -991,15 +993,15 @@ export class Eth { } const currentBlockHeader = this._chain.headers?.latest ?? (await this._chain.getLatestHeader()) - const currentBlock = bnToHex(currentBlockHeader.number) + const currentBlock = bigIntToHex(currentBlockHeader.number) const synchronizer = this.client.services[0].synchronizer const { syncTargetHeight } = this.client.config - const startingBlock = bnToHex(synchronizer.startingBlock) + const startingBlock = bigIntToHex(synchronizer.startingBlock) let highestBlock if (syncTargetHeight) { - highestBlock = bnToHex(syncTargetHeight) + highestBlock = bigIntToHex(syncTargetHeight) } else { const bestPeer = synchronizer.best() if (!bestPeer) { @@ -1015,7 +1017,7 @@ export class Eth { message: `highest block header unavailable`, } } - highestBlock = bnToHex(highestBlockHeader.number) + highestBlock = bigIntToHex(highestBlockHeader.number) } return { startingBlock, currentBlock, highestBlock } diff --git a/packages/client/lib/service/fullethereumservice.ts b/packages/client/lib/service/fullethereumservice.ts index ad4ed83af80..5c431f13cb6 100644 --- a/packages/client/lib/service/fullethereumservice.ts +++ b/packages/client/lib/service/fullethereumservice.ts @@ -1,5 +1,4 @@ import { Hardfork } from '@ethereumjs/common' -import { BN } from 'ethereumjs-util' import { EthereumService, EthereumServiceOptions } from './ethereumservice' import { TxPool } from './txpool' import { FullSynchronizer } from '../sync/fullsync' @@ -161,10 +160,10 @@ export class FullEthereumService extends EthereumService { async handleEth(message: any, peer: Peer): Promise { if (message.name === 'GetBlockHeaders') { const { reqId, block, max, skip, reverse } = message.data - if (BN.isBN(block)) { + if (typeof block === 'bigint') { if ( - (reverse && block.gt(this.chain.headers.height)) || - (!reverse && block.addn(max * skip).gt(this.chain.headers.height)) + (reverse && block > this.chain.headers.height) || + (!reverse && block + BigInt(max * skip) > this.chain.headers.height) ) { // Don't respond to requests greater than the current height return @@ -240,10 +239,10 @@ export class FullEthereumService extends EthereumService { this.pool.ban(peer, 300000) this.config.logger.debug(`Dropping peer for violating flow control ${peer}`) } else { - if (BN.isBN(block)) { + if (typeof block === 'bigint') { if ( - (reverse && block.gt(this.chain.headers.height)) || - (!reverse && block.addn(max * skip).gt(this.chain.headers.height)) + (reverse && block > this.chain.headers.height) || + (!reverse && block + BigInt(max * skip) > this.chain.headers.height) ) { // Don't respond to requests greater than the current height return diff --git a/packages/client/lib/service/txpool.ts b/packages/client/lib/service/txpool.ts index 38df870334d..4d417f0c057 100644 --- a/packages/client/lib/service/txpool.ts +++ b/packages/client/lib/service/txpool.ts @@ -5,7 +5,7 @@ import { Transaction, TypedTransaction, } from '@ethereumjs/tx' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { Config } from '../config' import { Peer } from '../net/peer' import type VM from '@ethereumjs/vm' @@ -191,7 +191,7 @@ export class TxPool { let add: TxPoolObject[] = [] if (inPool) { // Replace pooled txs with the same nonce - add = inPool.filter((poolObj) => !poolObj.tx.nonce.eq(tx.nonce)) + add = inPool.filter((poolObj) => poolObj.tx.nonce !== tx.nonce) } const address: UnprefixedAddress = tx.getSenderAddress().toString().slice(2) const hash: UnprefixedHash = tx.hash().toString('hex') @@ -456,13 +456,13 @@ export class TxPool { * @param baseFee Provide a baseFee to subtract from the legacy * gasPrice to determine the leftover priority tip. */ - private txGasPrice(tx: TypedTransaction, baseFee?: BN) { + private txGasPrice(tx: TypedTransaction, baseFee?: bigint) { const supports1559 = tx.supports(Capability.EIP1559FeeMarket) if (baseFee) { if (supports1559) { return (tx as FeeMarketEIP1559Transaction).maxPriorityFeePerGas } else { - return (tx as Transaction).gasPrice.sub(baseFee) + return (tx as Transaction).gasPrice - baseFee } } else { if (supports1559) { @@ -489,19 +489,19 @@ export class TxPool { * * @param baseFee Provide a baseFee to exclude txs with a lower gasPrice */ - async txsByPriceAndNonce(baseFee?: BN) { + async txsByPriceAndNonce(baseFee?: bigint) { const txs: TypedTransaction[] = [] // Separate the transactions by account and sort by nonce const byNonce = new Map() for (const [address, poolObjects] of this.pool) { let txsSortedByNonce = poolObjects .map((obj) => obj.tx) - .sort((a, b) => a.nonce.sub(b.nonce).toNumber()) + .sort((a, b) => Number(a.nonce - b.nonce)) // Check if the account nonce matches the lowest known tx nonce const { nonce } = await this.vm.stateManager.getAccount( new Address(Buffer.from(address, 'hex')) ) - if (!txsSortedByNonce[0].nonce.eq(nonce)) { + if (!txsSortedByNonce[0].nonce !== nonce) { // Account nonce does not match the lowest known tx nonce, // therefore no txs from this address are currently exectuable continue @@ -509,7 +509,7 @@ export class TxPool { if (baseFee) { // If any tx has an insiffucient gasPrice, // remove all txs after that since they cannot be executed - const found = txsSortedByNonce.findIndex((tx) => this.txGasPrice(tx).lt(baseFee)) + const found = txsSortedByNonce.findIndex((tx) => this.txGasPrice(tx) < baseFee) if (found > -1) { txsSortedByNonce = txsSortedByNonce.slice(0, found) } @@ -519,7 +519,7 @@ export class TxPool { // Initialize a price based heap with the head transactions const byPrice = new Heap({ comparBefore: (a: TypedTransaction, b: TypedTransaction) => - this.txGasPrice(b, baseFee).sub(this.txGasPrice(a, baseFee)).ltn(0), + this.txGasPrice(b, baseFee) - this.txGasPrice(a, baseFee) < BigInt(0), }) byNonce.forEach((txs, address) => { byPrice.insert(txs[0]) diff --git a/packages/client/lib/sync/fetcher/blockfetcher.ts b/packages/client/lib/sync/fetcher/blockfetcher.ts index 79d02b37adc..ef298d378f8 100644 --- a/packages/client/lib/sync/fetcher/blockfetcher.ts +++ b/packages/client/lib/sync/fetcher/blockfetcher.ts @@ -25,10 +25,10 @@ export class BlockFetcher extends BlockFetcherBase { const { task, peer, partialResult } = job let { first, count } = task if (partialResult) { - first = first.addn(partialResult.length) + first = first + BigInt(partialResult.length) count -= partialResult.length } - const blocksRange = `${first}-${first.addn(count)}` + const blocksRange = `${first}-${first + BigInt(count)}` const peerInfo = `id=${peer?.id.slice(0, 8)} address=${peer?.address}` const headersResult = await peer!.eth!.getBlockHeaders({ diff --git a/packages/client/lib/sync/fetcher/blockfetcherbase.ts b/packages/client/lib/sync/fetcher/blockfetcherbase.ts index 77a4ad14abe..68bab09ec1f 100644 --- a/packages/client/lib/sync/fetcher/blockfetcherbase.ts +++ b/packages/client/lib/sync/fetcher/blockfetcherbase.ts @@ -1,5 +1,4 @@ import { Fetcher, FetcherOptions } from './fetcher' -import { BN } from 'ethereumjs-util' import { Chain } from '../../blockchain' export interface BlockFetcherOptions extends FetcherOptions { @@ -7,17 +6,17 @@ export interface BlockFetcherOptions extends FetcherOptions { chain: Chain /* Block number to start fetching from */ - first: BN + first: bigint /* How many blocks to fetch */ - count: BN + count: bigint /* Destroy fetcher once all tasks are done */ destroyWhenDone?: boolean } export type JobTask = { - first: BN + first: bigint count: number } @@ -30,12 +29,12 @@ export abstract class BlockFetcherBase extends Fetcher< /** * Where the fetcher starts apart from the tasks already in the `in` queue */ - first: BN + first: bigint /** * Number of items in the fetcher starting from (and including) `first`. * `first + count - 1` gives the height fetcher is attempting to reach */ - count: BN + count: bigint /** * Create new block fetcher @@ -59,17 +58,17 @@ export abstract class BlockFetcherBase extends Fetcher< const max = this.config.maxPerRequest const tasks: JobTask[] = [] let debugStr = `first=${first}` - const pushedCount = new BN(0) + const pushedCount = BigInt(0) - while (count.gten(max) && tasks.length < maxTasks) { - tasks.push({ first: first.clone(), count: max }) - first.iaddn(max) - count.isubn(max) - pushedCount.iaddn(max) + while (count >= BigInt(max) && tasks.length < maxTasks) { + tasks.push({ first: first, count: max }) + first += BigInt(max) + count -= BigInt(max) + pushedCount += BigInt(max) } - if (count.gtn(0) && tasks.length < maxTasks) { - tasks.push({ first: first.clone(), count: count.toNumber() }) - pushedCount.iadd(count) + if (count > BigInt(0) && tasks.length < maxTasks) { + tasks.push({ first: first, count: Number(count) }) + pushedCount += count } debugStr += ` count=${pushedCount}` this.debug(`Created new tasks num=${tasks.length} ${debugStr}`) @@ -77,7 +76,7 @@ export abstract class BlockFetcherBase extends Fetcher< } nextTasks(): void { - if (this.in.length === 0 && this.count.gten(0)) { + if (this.in.length === 0 && this.count > BigInt(0)) { this.debug(`Fetcher pending with first=${this.first} count=${this.count}`) const tasks = this.tasks(this.first, this.count) for (const task of tasks) { @@ -92,7 +91,7 @@ export abstract class BlockFetcherBase extends Fetcher< */ clear() { let first = this.first - let last = this.first.add(this.count).subn(1) + let last = this.first + this.count - BigInt(1) // We have to loop because the jobs won't always be in increasing order. // Some jobs could have refetch tasks enqueued, so it is better to find @@ -109,7 +108,7 @@ export abstract class BlockFetcherBase extends Fetcher< } } this.first = first - this.count = last.sub(this.first).addn(1) + this.count = last - this.first + BigInt(1) // Already removed jobs from the `in` heap, just pass to super for further cleanup super.clear() } @@ -125,12 +124,12 @@ export abstract class BlockFetcherBase extends Fetcher< * @param numberList List of block numbers * @param min Start block number */ - enqueueByNumberList(numberList: BN[], min: BN, max: BN) { + enqueueByNumberList(numberList: bigint[], min: bigint, max: bigint) { // Check and update the height - const last = this.first.add(this.count).subn(1) + const last = this.first + this.count - BigInt(1) let updateHeightStr = '' - if (max.gt(last)) { - this.count.iadd(max.sub(last)) + if (max > last) { + this.count += (max - last) updateHeightStr = `updated height=${max}` } // Re-enqueue the numbers which are less than `first` to refetch them, @@ -138,13 +137,13 @@ export abstract class BlockFetcherBase extends Fetcher< numberList = numberList.filter((num) => num.lte(this.first)) const numBlocks = numberList.length let bulkRequest = true - const seqCheckNum = min.clone() + let seqCheckNum = min for (let num = 1; num <= numBlocks; num++) { - if (!numberList.map((num) => num.toString()).includes(seqCheckNum.toString())) { + if (!numberList.includes(seqCheckNum)) { bulkRequest = false break } - seqCheckNum.iaddn(1) + seqCheckNum++ } if (bulkRequest && numBlocks > 0) { diff --git a/packages/client/lib/sync/fetcher/headerfetcher.ts b/packages/client/lib/sync/fetcher/headerfetcher.ts index 0986ce29d2a..91f5c187d18 100644 --- a/packages/client/lib/sync/fetcher/headerfetcher.ts +++ b/packages/client/lib/sync/fetcher/headerfetcher.ts @@ -3,7 +3,6 @@ import { Peer } from '../../net/peer' import { FlowControl } from '../../net/protocol' import { BlockHeader } from '@ethereumjs/block' import { Job } from './types' -import { BN } from 'ethereumjs-util' import { Event } from '../../types' export interface HeaderFetcherOptions extends BlockFetcherOptions { @@ -11,7 +10,7 @@ export interface HeaderFetcherOptions extends BlockFetcherOptions { flow: FlowControl } -type BlockHeaderResult = { reqId: BN; bv: BN; headers: BlockHeader[] } +type BlockHeaderResult = { reqId: bigint; bv: bigint; headers: BlockHeader[] } /** * Implements an les/1 based header fetcher @@ -58,20 +57,28 @@ export class HeaderFetcher extends BlockFetcherBase, result: BlockHeaderResult) { - this.flow.handleReply(job.peer!, result.bv.toNumber()) + this.flow.handleReply(job.peer!, Number(result.bv)) let { headers } = result headers = (job.partialResult ?? []).concat(headers) job.partialResult = undefined - if (headers.length === job.task.count) { return headers } else if (headers.length > 0 && headers.length < job.task.count) { // Adopt the start block/header number from the remaining jobs // if the number of the results provided is lower than the expected count - job.partialResult = headers - this.debug( - `Adopt start block/header number from remaining jobs (provided=${headers.length} expected=${job.task.count})` - ) + const lengthDiff = job.task.count - headers.length + const adoptedJobs = [] + while (this.in.length > 0) { + const job = this.in.remove() + if (job) { + job.task.first = job.task.first - BigInt(lengthDiff) + adoptedJobs.push(job) + } + } + for (const job of adoptedJobs) { + this.in.insert(job) + } + return headers } return } diff --git a/packages/client/lib/sync/fullsync.ts b/packages/client/lib/sync/fullsync.ts index 634a13c4a0d..ed9079d31b8 100644 --- a/packages/client/lib/sync/fullsync.ts +++ b/packages/client/lib/sync/fullsync.ts @@ -1,5 +1,4 @@ import { Hardfork } from '@ethereumjs/common' -import { BN } from 'ethereumjs-util' import { Peer } from '../net/peer/peer' import { short } from '../util' import { Event } from '../types' @@ -91,8 +90,8 @@ export class FullSynchronizer extends Synchronizer { if (peer.eth?.status) { const td = peer.eth.status.td if ( - (!best && td.gte(this.chain.blocks.td)) || - (best && best.eth && best.eth.status.td.lt(td)) + (!best && td >= this.chain.blocks.td) || + (best && best.eth && best.eth.status.td < td) ) { best = peer } @@ -113,7 +112,23 @@ export class FullSynchronizer extends Synchronizer { } /** - * Called from `sync()` to sync blocks and state from peer starting from current height. + * Checks if tx pool should be started + */ + checkTxPoolState() { + if (!this.syncTargetHeight || this.txPool.running) { + return + } + // If height gte target, we are close enough to the + // head of the chain that the tx pool can be started + const target = + this.syncTargetHeight - BigInt(this.txPool.BLOCKS_BEFORE_TARGET_HEIGHT_ACTIVATION) + if (this.chain.headers.height >= target) { + this.txPool.start() + } + } + + /** + * Sync all blocks and state from peer starting from current height. * @param peer remote peer to sync with * @returns a boolean if the setup was successful */ @@ -122,19 +137,16 @@ export class FullSynchronizer extends Synchronizer { if (!latest) return false const height = latest.number - if (!this.config.syncTargetHeight || this.config.syncTargetHeight.lt(latest.number)) { + if (!this.config.syncTargetHeight || this.config.syncTargetHeight < latest.number) { this.config.syncTargetHeight = height this.config.logger.info(`New sync target height=${height} hash=${short(latest.hash())}`) } // Start fetcher from a safe distance behind because if the previous fetcher exited // due to a reorg, it would make sense to step back and refetch. - const first = BN.max( - this.chain.blocks.height.addn(1).subn(this.config.safeReorgDistance), - new BN(1) - ) - const count = height.sub(first).addn(1) - if (count.lten(0)) return false + const first = this.chain.blocks.height >= BigInt(this.config.safeReorgDistance): this.chain.blocks.height - BigInt(this.config.safeReorgDistance) + BigInt(1) : BigInt(1); + const count = height - first + BigInt(1) + if (count < BigInt(0)) return false if (!this.fetcher || this.fetcher.errored) { this.fetcher = new BlockFetcher({ config: this.config, @@ -146,9 +158,11 @@ export class FullSynchronizer extends Synchronizer { destroyWhenDone: false, }) } else { - const fetcherHeight = this.fetcher.first.add(this.fetcher.count).subn(1) - if (height.gt(fetcherHeight)) this.fetcher.count.iadd(height.sub(fetcherHeight)) - this.config.logger.info(`Updated fetcher target to height=${height} peer=${peer} `) + const fetcherHeight = this.fetcher.first + this.fetcher.count - BigInt(1) + if (height > fetcherHeight){ + this.fetcher.count += (height - fetcherHeight) + this.config.logger.info(`Updated fetcher target to height=${height} peer=${peer} `) + } } return true } @@ -172,8 +186,9 @@ export class FullSynchronizer extends Synchronizer { return } - const first = blocks[0].header.number - const last = blocks[blocks.length - 1].header.number + + const first = BigInt(blocks[0].header.number) + const last = BigInt(blocks[blocks.length - 1].header.number) const hash = short(blocks[0].hash()) const baseFeeAdd = this.config.chainCommon.gteHardfork(Hardfork.London) ? `baseFee=${blocks[0].header.baseFeePerGas} ` @@ -215,6 +230,7 @@ export class FullSynchronizer extends Synchronizer { if (!this.running) return await this.execution.run() this.txPool.checkRunState() + return true } /** @@ -257,7 +273,7 @@ export class FullSynchronizer extends Synchronizer { // Don't send NEW_BLOCK announcement to peer that sent original new block message this.addToKnownByPeer(block.hash(), peer) } - if (block.header.number.gt(this.chain.headers.height.addn(1))) { + if (block.header.number > this.chain.headers.height + BigInt(1)) { // If the block number exceeds one past our height we cannot validate it return } @@ -281,8 +297,8 @@ export class FullSynchronizer extends Synchronizer { await this.chain.putBlocks([block]) // Check if new sync target height can be set const blockNumber = block.header.number - if (!this.config.syncTargetHeight || blockNumber.gt(this.config.syncTargetHeight)) { - this.config.syncTargetHeight = blockNumber + if (!this.config.syncTargetHeight || blockNumber > this.config.syncTargetHeight) { + this.syncTargetHeight = blockNumber } } else { // Call handleNewBlockHashes to retrieve all blocks between chain tip and new block @@ -301,21 +317,20 @@ export class FullSynchronizer extends Synchronizer { * Chain was updated, new block hashes received * @param data new block hash announcements */ - handleNewBlockHashes(data: [Buffer, BN][]) { + handleNewBlockHashes(data: [Buffer, bigint][]) { if (!data.length || !this.fetcher || this.fetcher.errored) return - let min = new BN(-1) - let newSyncHeight: [Buffer, BN] | undefined - const blockNumberList: BN[] = [] - for (const value of data) { + let min = BigInt(-1) + let newSyncHeight + const blockNumberList: bigint[] = [] + data.forEach((value) => { const blockNumber = value[1] blockNumberList.push(blockNumber) - if (min.eqn(-1) || blockNumber.lt(min)) { + if (min === BigInt(-1) || blockNumber < min) { min = blockNumber } - // Check if new sync target height can be set - if (newSyncHeight && blockNumber.lte(newSyncHeight[1])) continue - if (this.config.syncTargetHeight && blockNumber.lte(this.config.syncTargetHeight)) continue + if (newSyncHeight && blockNumber <= newSyncHeight[1]) continue + if (this.config.syncTargetHeight && blockNumber <= this.config.syncTargetHeight) continue newSyncHeight = value } @@ -324,7 +339,7 @@ export class FullSynchronizer extends Synchronizer { this.config.syncTargetHeight = height this.config.logger.info(`New sync target height number=${height} hash=${short(hash)}`) // Enqueue if we are close enough to chain head - if (min.lt(this.chain.headers.height.addn(3000))) { + if (min < this.chain.headers.height + BigInt(3000)) { this.fetcher.enqueueByNumberList(blockNumberList, min, height) } } diff --git a/packages/client/lib/sync/lightsync.ts b/packages/client/lib/sync/lightsync.ts index 03b72edf322..95484b3796f 100644 --- a/packages/client/lib/sync/lightsync.ts +++ b/packages/client/lib/sync/lightsync.ts @@ -1,5 +1,4 @@ import { Hardfork } from '@ethereumjs/common' -import { BN } from 'ethereumjs-util' import { Peer } from '../net/peer/peer' import { short } from '../util' import { Synchronizer, SynchronizerOptions } from './sync' @@ -59,8 +58,8 @@ export class LightSynchronizer extends Synchronizer { if (peer.les) { const td = peer.les.status.headTd if ( - (!best && td.gte(this.chain.headers.td)) || - (best && best.les && best.les.status.headTd.lt(td)) + (!best && td >= this.chain.headers.td) || + (best && best.les && best.les.status.headTd < td) ) { best = peer } @@ -90,19 +89,16 @@ export class LightSynchronizer extends Synchronizer { if (!latest) return false const height = peer!.les!.status.headNum - if (!this.config.syncTargetHeight || this.config.syncTargetHeight.lt(height)) { + if (!this.config.syncTargetHeight || this.config.syncTargetHeight < height) { this.config.syncTargetHeight = height this.config.logger.info(`New sync target height=${height} hash=${short(latest.hash())}`) } // Start fetcher from a safe distance behind because if the previous fetcher exited // due to a reorg, it would make sense to step back and refetch. - const first = BN.max( - this.chain.headers.height.addn(1).subn(this.config.safeReorgDistance), - new BN(1) - ) - const count = height.sub(first).addn(1) - if (count.lten(0)) return false + const first = this.chain.headers.height >= BigInt(this.config.safeReorgDistance)? this.chain.headers.height - BigInt(this.config.safeReorgDistance) + BigInt(1): BigInt(1); + const count = height - first + BigInt(1) + if (count < BigInt(0)) return false if (!this.fetcher || this.fetcher.errored) { this.fetcher = new HeaderFetcher({ config: this.config, @@ -115,9 +111,11 @@ export class LightSynchronizer extends Synchronizer { destroyWhenDone: false, }) } else { - const fetcherHeight = this.fetcher.first.add(this.fetcher.count).subn(1) - if (height.gt(fetcherHeight)) this.fetcher.count.iadd(height.sub(fetcherHeight)) - this.config.logger.info(`Updated fetcher target to height=${height} peer=${peer}`) + const fetcherHeight = this.fetcher.first + this.fetcher.count - BigInt(1) + if (height > fetcherHeight){ + this.fetcher.count += (height - fetcherHeight) + this.config.logger.info(`Updated fetcher target to height=${height} peer=${peer} `) + } } return true } diff --git a/packages/client/lib/sync/sync.ts b/packages/client/lib/sync/sync.ts index dcb7ed3b545..a44171657a2 100644 --- a/packages/client/lib/sync/sync.ts +++ b/packages/client/lib/sync/sync.ts @@ -1,5 +1,4 @@ import { Hardfork } from '@ethereumjs/common' -import { BN } from 'ethereumjs-util' import { PeerPool } from '../net/peerpool' import { Peer } from '../net/peer/peer' import { FlowControl } from '../net/protocol' @@ -50,9 +49,10 @@ export abstract class Synchronizer { public fetcher: BlockFetcher | HeaderFetcher | null public opened: boolean public running: boolean - public startingBlock: BN + protected forceSync: boolean + public startingBlock: bigint - /** Time (in ms) after which the synced state is reset */ + // Time (in ms) after which the synced state is reset private SYNCED_STATE_REMOVAL_PERIOD = 60000 private _syncedStatusCheckInterval: NodeJS.Timeout | undefined /* global NodeJS */ @@ -70,7 +70,7 @@ export abstract class Synchronizer { this.opened = false this.running = false this.forceSync = false - this.startingBlock = new BN(0) + this.startingBlock = BigInt(0) this.config.events.on(Event.POOL_PEER_ADDED, (peer) => { if (this.syncable(peer)) { @@ -146,7 +146,7 @@ export abstract class Synchronizer { if (!this.config.syncTargetHeight) { return } - if (this.chain.headers.height.gte(this.config.syncTargetHeight)) { + if (this.chain.headers.height >= this.syncTargetHeight) { if (!this.config.synchronized) { const hash = this.chain.headers.latest?.hash() this.config.logger.info( diff --git a/packages/client/lib/types.ts b/packages/client/lib/types.ts index f8a61d6dbea..795e3f04e5c 100644 --- a/packages/client/lib/types.ts +++ b/packages/client/lib/types.ts @@ -1,5 +1,4 @@ import { EventEmitter } from 'events' -import { BN } from 'ethereumjs-util' import type { Multiaddr } from 'multiaddr' import type { Block, BlockHeader } from '@ethereumjs/block' import type Connection from '../../../node_modules/libp2p-interfaces/dist/src/connection/connection' @@ -37,7 +36,7 @@ export interface EventParams { [Event.SYNC_EXECUTION_VM_ERROR]: [vmError: Error] [Event.SYNC_FETCHED_BLOCKS]: [blocks: Block[]] [Event.SYNC_FETCHED_HEADERS]: [headers: BlockHeader[]] - [Event.SYNC_SYNCHRONIZED]: [chainHeight: BN] + [Event.SYNC_SYNCHRONIZED]: [chainHeight: bigint] [Event.SYNC_ERROR]: [syncError: Error] [Event.SYNC_FETCHER_ERROR]: [fetchError: Error, task: any, peer: Peer | null | undefined] [Event.PEER_CONNECTED]: [connectedPeer: Peer] diff --git a/packages/client/lib/util/parse.ts b/packages/client/lib/util/parse.ts index c3b6eead213..7681ea92063 100644 --- a/packages/client/lib/util/parse.ts +++ b/packages/client/lib/util/parse.ts @@ -5,14 +5,13 @@ import Common, { Hardfork } from '@ethereumjs/common' import { SecureTrie as Trie } from 'merkle-patricia-tree' import { Account, - BN, keccak, rlp, toBuffer, unpadBuffer, isHexPrefixed, stripHexPrefix, - bnToHex, + bigIntToHex, bufferToHex, addHexPrefix, intToHex, @@ -119,7 +118,7 @@ async function createGethGenesisStateTrie(alloc: any) { const { balance, code, storage } = value as any const account = new Account() if (balance) { - account.balance = new BN(isHexPrefixed(balance) ? toBuffer(balance) : balance) + account.balance = BigInt(balance) } if (code) { account.codeHash = keccak(toBuffer(code)) @@ -300,7 +299,7 @@ export async function parseGenesisState(json: any) { for (let address of Object.keys(json.alloc)) { let { balance, code, storage } = json.alloc[address] address = addHexPrefix(address) - balance = isHexPrefixed(balance) ? balance : bnToHex(new BN(balance)) + balance = isHexPrefixed(balance) ? balance : bigIntToHex(BigInt(balance)) code = code ? addHexPrefix(code) : undefined storage = storage ? Object.entries(storage) : undefined state[address] = [balance, code, storage] as any diff --git a/packages/client/test/blockchain/chain.spec.ts b/packages/client/test/blockchain/chain.spec.ts index 059cbfb094b..e5ddf8a633b 100644 --- a/packages/client/test/blockchain/chain.spec.ts +++ b/packages/client/test/blockchain/chain.spec.ts @@ -1,7 +1,6 @@ import tape from 'tape' import { Block, BlockData, HeaderData } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' -import { BN } from 'ethereumjs-util' import { Chain } from '../../lib/blockchain' import { Config } from '../../lib/config' @@ -29,7 +28,7 @@ tape('[Chain]', (t) => { t.test('should retrieve chain properties', async (t) => { const chain = new Chain({ config }) await chain.open() - t.ok(chain.networkId.eqn(1), 'get chain.networkId') + t.equal(chain.networkId, BigInt(1), 'get chain.networkId') t.equal(chain.blocks.td.toString(10), '17179869184', 'get chain.blocks.td') t.equal(chain.blocks.height.toString(10), '0', 'get chain.blocks.height') t.equal( @@ -49,8 +48,8 @@ tape('[Chain]', (t) => { }) const chain = new Chain({ config, blockchain }) const headerData: HeaderData = { - number: new BN(1), - difficulty: new BN('abcdffff', 16), + number: BigInt(1), + difficulty: BigInt(0xabcdffff), parentHash: chain.genesis.hash, } const block = Block.fromBlockData({ header: headerData } as BlockData, { @@ -59,8 +58,8 @@ tape('[Chain]', (t) => { t.equal(await chain.update(), false, 'skip update if not opened') t.equal(await chain.close(), false, 'skip close if not opened') - t.notOk(chain.opened, 'chain should be closed') - t.notOk(chain.blocks.height.toNumber(), 'chain should be empty if not opened') + t.notOk(chain.opened, 'chain shoud be closed') + t.notOk(chain.blocks.height, 'chain should be empty if not opened') try { await chain.putHeaders([block.header]) t.fail('should error if chain is closed') @@ -124,8 +123,8 @@ tape('[Chain]', (t) => { const chain = new Chain({ config, blockchain }) await chain.open() const headerData: HeaderData = { - number: new BN(1), - difficulty: new BN('abcdffff', 16), + number: BigInt(1), + difficulty: BigInt(0xabcdffff), parentHash: chain.genesis.hash, } const block = Block.fromBlockData({ header: headerData } as BlockData, { diff --git a/packages/client/test/integration/fullethereumservice.spec.ts b/packages/client/test/integration/fullethereumservice.spec.ts index af5d62b3863..2cb601c07fb 100644 --- a/packages/client/test/integration/fullethereumservice.spec.ts +++ b/packages/client/test/integration/fullethereumservice.spec.ts @@ -2,7 +2,7 @@ import tape from 'tape' import Blockchain from '@ethereumjs/blockchain' import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' import { Block } from '@ethereumjs/block' -import { BN, toBuffer } from 'ethereumjs-util' +import { toBuffer } from 'ethereumjs-util' import { Config } from '../../lib/config' import { FullEthereumService } from '../../lib/service' import { Event } from '../../lib/types' @@ -37,15 +37,16 @@ tape('[Integration:FullEthereumService]', async (t) => { t.plan(8) const [server, service] = await setup() const peer = await server.accept('peer0') - const [reqId1, headers] = await peer.eth!.getBlockHeaders({ block: new BN(1), max: 2 }) + const [reqId1, headers] = await peer.eth!.getBlockHeaders({ block: BigInt(1), max: 2 }) const hash = Buffer.from( 'a321d27cd2743617c1c1b0d7ecb607dd14febcdfca8f01b79c3f0249505ea069', 'hex' ) - t.ok(reqId1.eqn(1), 'handled GetBlockHeaders') + t.equal(reqId1, BigInt(1), 'handled GetBlockHeaders') t.ok(headers![1].hash().equals(hash), 'handled GetBlockHeaders') - const [reqId2, bodies] = await peer.eth!.getBlockBodies({ hashes: [hash] }) - t.ok(reqId2.eqn(2), 'handled GetBlockBodies') + const res = await peer.eth!.getBlockBodies({ hashes: [hash] }) + const [reqId2, bodies] = res + t.equal(reqId2, BigInt(2), 'handled GetBlockBodies') t.deepEquals(bodies, [[[], []]], 'handled GetBlockBodies') service.config.events.on(Event.PROTOCOL_MESSAGE, async (msg) => { switch (msg.name) { @@ -60,7 +61,7 @@ tape('[Integration:FullEthereumService]', async (t) => { } } }) - peer.eth!.send('NewBlockHashes', [[hash, new BN(2)]]) + peer.eth!.send('NewBlockHashes', [[hash, BigInt(2)]]) const block = Block.fromBlockData( { @@ -71,7 +72,7 @@ tape('[Integration:FullEthereumService]', async (t) => { }, { common: config.chainCommon } ) - peer.eth!.send('NewBlock', [block, new BN(1)]) + peer.eth!.send('NewBlock', [block, BigInt(1)]) const txData = '0x02f90108018001018402625a0094cccccccccccccccccccccccccccccccccccccccc830186a0b8441a8451e600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f85bf859940000000000000000000000000000000000000101f842a00000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000060a701a0afb6e247b1c490e284053c87ab5f6b59e219d51f743f7a4d83e400782bc7e4b9a0479a268e0e0acd4de3f1e28e4fac2a6b32a4195e8dfa9d19147abe8807aa6f64' @@ -91,7 +92,7 @@ tape('[Integration:FullEthereumService]', async (t) => { t.test('should handle LES requests', async (t) => { const [server, service] = await setup() const peer = await server.accept('peer0') - const { headers } = await peer.les!.getBlockHeaders({ block: new BN(1), max: 2 }) + const { headers } = await peer.les!.getBlockHeaders({ block: BigInt(1), max: 2 }) t.equals( headers[1].hash().toString('hex'), 'a321d27cd2743617c1c1b0d7ecb607dd14febcdfca8f01b79c3f0249505ea069', diff --git a/packages/client/test/integration/fullsync.spec.ts b/packages/client/test/integration/fullsync.spec.ts index e3dfbd4ac5c..d71651b10e1 100644 --- a/packages/client/test/integration/fullsync.spec.ts +++ b/packages/client/test/integration/fullsync.spec.ts @@ -8,8 +8,9 @@ tape('[Integration:FullSync]', async (t) => { const [localServer, localService] = await setup({ location: '127.0.0.1', height: 0 }) await localService.synchronizer.stop() await localServer.discover('remotePeer1', '127.0.0.2') + // await localService.synchronizer.sync() localService.config.events.on(Event.SYNC_SYNCHRONIZED, async () => { - t.equals(localService.chain.blocks.height.toNumber(), 20, 'synced') + t.equals(localService.chain.blocks.height, BigInt(20), 'synced') await destroy(localServer, localService) await destroy(remoteServer, remoteService) }) @@ -42,7 +43,7 @@ tape('[Integration:FullSync]', async (t) => { await localServer.discover('remotePeer2', '127.0.0.3') localService.config.events.on(Event.SYNC_SYNCHRONIZED, async () => { - if (localService.chain.blocks.height.toNumber() === 10) { + if (localService.chain.blocks.height === BigInt(10)) { t.pass('synced with best peer') await destroy(localServer, localService) await destroy(remoteServer1, remoteService1) diff --git a/packages/client/test/integration/lightsync.spec.ts b/packages/client/test/integration/lightsync.spec.ts index 35fca76a86e..dbb028731db 100644 --- a/packages/client/test/integration/lightsync.spec.ts +++ b/packages/client/test/integration/lightsync.spec.ts @@ -18,7 +18,7 @@ tape('[Integration:LightSync]', async (t) => { await localService.synchronizer.stop() await localServer.discover('remotePeer1', '127.0.0.2') localService.config.events.on(Event.SYNC_SYNCHRONIZED, async () => { - t.equals(localService.chain.headers.height.toNumber(), 20, 'synced') + t.equals(localService.chain.headers.height, BigInt(20), 'synced') await destroy(localServer, localService) await destroy(remoteServer, remoteService) }) @@ -66,7 +66,7 @@ tape('[Integration:LightSync]', async (t) => { await localServer.discover('remotePeer1', '127.0.0.2') await localServer.discover('remotePeer2', '127.0.0.3') localService.config.events.on(Event.SYNC_SYNCHRONIZED, async () => { - if (localService.chain.headers.height.toNumber() === 10) { + if (localService.chain.headers.height === BigInt(10)) { t.pass('synced with best peer') await destroy(localServer, localService) await destroy(remoteServer1, remoteService1) diff --git a/packages/client/test/integration/merge.spec.ts b/packages/client/test/integration/merge.spec.ts index 03b632e1f95..9e85305ca58 100644 --- a/packages/client/test/integration/merge.spec.ts +++ b/packages/client/test/integration/merge.spec.ts @@ -6,7 +6,7 @@ import Common, { ConsensusAlgorithm, Hardfork, } from '@ethereumjs/common' -import { BN, Address } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { Config } from '../../lib/config' import { Chain } from '../../lib/blockchain' import { FullEthereumService } from '../../lib/service' @@ -107,12 +107,13 @@ tape('[Integration:Merge]', async (t) => { }) remoteService.chain.blockchain.cliqueActiveSigners = () => [accounts[0][0]] // stub await server.discover('remotePeer1', '127.0.0.2') - const targetTTD = new BN(5) + const targetTTD = BigInt(5) remoteService.config.events.on(Event.SYNC_SYNCHRONIZED, async () => { const { td } = remoteService.chain.headers - if (td.eq(targetTTD)) { - t.ok( - remoteService.chain.headers.td.eq(targetTTD), + if (td === targetTTD) { + t.equal( + remoteService.chain.headers.td, + targetTTD, 'synced blocks to the merge successfully' ) // Make sure the miner has stopped @@ -121,7 +122,7 @@ tape('[Integration:Merge]', async (t) => { await destroy(remoteServer, remoteService) t.end() } - if (td.gt(targetTTD)) { + if (td > targetTTD) { t.fail('chain should not exceed merge TTD') } }) @@ -137,16 +138,17 @@ tape('[Integration:Merge]', async (t) => { common: commonPoW, }) await server.discover('remotePeer1', '127.0.0.2') - const targetTTD = new BN(1000) - let terminalHeight: BN | undefined + const targetTTD = BigInt(1000) + let terminalHeight: bigint | undefined remoteService.config.events.on(Event.CHAIN_UPDATED, async () => { const { height, td } = remoteService.chain.headers - if (td.gt(targetTTD)) { + if (td > targetTTD) { if (!terminalHeight) { terminalHeight = height } - t.ok( - remoteService.chain.headers.height.eq(terminalHeight), + t.equal( + remoteService.chain.headers.height, + terminalHeight, 'synced blocks to the merge successfully' ) // Make sure the miner has stopped @@ -155,7 +157,7 @@ tape('[Integration:Merge]', async (t) => { await destroy(remoteServer, remoteService) t.end() } - if (terminalHeight?.lt(height)) { + if (terminalHeight && terminalHeight < height) { t.fail('chain should not exceed merge terminal block') } }) diff --git a/packages/client/test/integration/miner.spec.ts b/packages/client/test/integration/miner.spec.ts index 71f7bf80e99..6dce3155e96 100644 --- a/packages/client/test/integration/miner.spec.ts +++ b/packages/client/test/integration/miner.spec.ts @@ -1,7 +1,12 @@ import tape from 'tape' import Blockchain from '@ethereumjs/blockchain' -import Common, { Chain as ChainCommon, ConsensusType, ConsensusAlgorithm } from '@ethereumjs/common' -import { BN, Address } from 'ethereumjs-util' +import Common, { + Chain as ChainCommon, + ConsensusType, + ConsensusAlgorithm, + Hardfork, +} from '@ethereumjs/common' +import { Address } from 'ethereumjs-util' import { Config } from '../../lib/config' import { Chain } from '../../lib/blockchain' import { FullEthereumService } from '../../lib/service' @@ -10,8 +15,12 @@ import MockServer from './mocks/mockserver' import { setup, destroy } from './util' tape('[Integration:Miner]', async (t) => { + const hardforks = new Common({ chain: ChainCommon.Goerli }) + .hardforks() + .map((h) => (h.name === Hardfork.London ? { ...h, block: 0 } : h)) const common = Common.custom( { + hardforks, consensus: { type: ConsensusType.ProofOfAuthority, algorithm: ConsensusAlgorithm.Clique, @@ -76,10 +85,10 @@ tape('[Integration:Miner]', async (t) => { remoteService.chain.blockchain.cliqueActiveSigners = () => [accounts[0][0]] // stub ;(remoteService as FullEthereumService).execution.run = async () => 1 // stub await server.discover('remotePeer1', '127.0.0.2') - const targetHeight = new BN(5) + const targetHeight = BigInt(5) remoteService.config.events.on(Event.SYNC_SYNCHRONIZED, async (chainHeight) => { - if (chainHeight.eq(targetHeight)) { - t.ok(remoteService.chain.blocks.height.eq(targetHeight), 'synced blocks successfully') + if (chainHeight === targetHeight) { + t.equal(remoteService.chain.blocks.height, targetHeight, 'synced blocks successfully') await destroy(server, service) await destroy(remoteServer, remoteService) t.end() diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index f088282fea6..ea80a6579bf 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -4,7 +4,7 @@ import Common, { Chain as CommonChain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction, Transaction } from '@ethereumjs/tx' import { Block, BlockHeader } from '@ethereumjs/block' import { DefaultStateManager, StateManager } from '@ethereumjs/vm/dist/state' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { Config } from '../../lib/config' import { FullEthereumService } from '../../lib/service' import { Chain } from '../../lib/blockchain' @@ -28,7 +28,7 @@ const B = { ), } -const setBalance = async (stateManager: StateManager, address: Address, balance: BN) => { +const setBalance = async (stateManager: StateManager, address: Address, balance: bigint) => { await stateManager.checkpoint() await stateManager.modifyAccountFields(address, { balance }) await stateManager.commit() @@ -50,13 +50,13 @@ tape('[Miner]', async (t) => { get headers() { return { latest: BlockHeader.fromHeaderData(), - height: new BN(0), + height: BigInt(0), } } get blocks() { return { latest: Block.fromBlockData(), - height: new BN(0), + height: BigInt(0), } } blockchain: any = { @@ -147,7 +147,7 @@ tape('[Miner]', async (t) => { txPool.start() miner.start() - await setBalance(vm.stateManager, A.address, new BN('200000000000001')) + await setBalance(vm.stateManager, A.address, BigInt('200000000000001')) // add tx txPool.add(txA01) @@ -179,8 +179,8 @@ tape('[Miner]', async (t) => { txPool.start() miner.start() - await setBalance(vm.stateManager, A.address, new BN('400000000000001')) - await setBalance(vm.stateManager, B.address, new BN('400000000000001')) + await setBalance(vm.stateManager, A.address, BigInt('400000000000001')) + await setBalance(vm.stateManager, B.address, BigInt('400000000000001')) // add txs txPool.add(txA01) @@ -263,12 +263,12 @@ tape('[Miner]', async (t) => { const block = Block.fromBlockData({ header: { gasLimit } }, { common }) Object.defineProperty(chain, 'headers', { get: function () { - return { latest: block.header, height: new BN(0) } + return { latest: block.header, height: BigInt(0) } }, }) Object.defineProperty(chain, 'blocks', { get: function () { - return { latest: block, height: new BN(0) } + return { latest: block, height: BigInt(0) } }, }) const service = new FullEthereumService({ @@ -281,7 +281,7 @@ tape('[Miner]', async (t) => { txPool.start() miner.start() - await setBalance(vm.stateManager, A.address, new BN('200000000000001')) + await setBalance(vm.stateManager, A.address, BigInt('200000000000001')) // add txs const data = '0xfe' // INVALID opcode, consumes all gas @@ -327,7 +327,7 @@ tape('[Miner]', async (t) => { txPool.start() miner.start() - await setBalance(vm.stateManager, A.address, new BN('200000000000001')) + await setBalance(vm.stateManager, A.address, BigInt('200000000000001')) // add many txs to slow assembling for (let i = 0; i < 1000; i++) { @@ -396,12 +396,13 @@ tape('[Miner]', async (t) => { const blockHeader3 = await chain.getLatestHeader() config.execCommon.setHardforkByBlockNumber(3) t.equal(config.execCommon.hardfork(), Hardfork.London) - t.ok( - blockHeader2.gasLimit.muln(2).eq(blockHeader3.gasLimit), + t.equal( + blockHeader2.gasLimit * BigInt(2), + blockHeader3.gasLimit, 'gas limit should be double previous block' ) - const initialBaseFee = new BN(config.execCommon.paramByEIP('gasConfig', 'initialBaseFee', 1559)) - t.ok(blockHeader3.baseFeePerGas!.eq(initialBaseFee), 'baseFee should be initial value') + const initialBaseFee = BigInt(config.execCommon.paramByEIP('gasConfig', 'initialBaseFee', 1559)) + t.equal(blockHeader3.baseFeePerGas!, initialBaseFee, 'baseFee should be initial value') // block 4 await (miner as any).queueNextAssembly(0) @@ -409,17 +410,17 @@ tape('[Miner]', async (t) => { const blockHeader4 = await chain.getLatestHeader() config.execCommon.setHardforkByBlockNumber(4) t.equal(config.execCommon.hardfork(), Hardfork.London) - t.ok( - blockHeader4.baseFeePerGas!.eq(blockHeader3.calcNextBaseFee()), + t.equal( + blockHeader4.baseFeePerGas!, + blockHeader3.calcNextBaseFee(), 'baseFee should be as calculated' ) - t.ok((await chain.getLatestHeader()).number.eqn(4)) + t.equal((await chain.getLatestHeader()).number, BigInt(4)) miner.stop() await chain.close() }) t.test('should handle mining ethash PoW', async (t) => { - t.plan(1) const common = new Common({ chain: CommonChain.Ropsten, hardfork: Hardfork.Istanbul }) ;(common as any)._chainParams['genesis'].difficulty = 1 const config = new Config({ transports: [], accounts, mine: true, common }) @@ -433,14 +434,15 @@ tape('[Miner]', async (t) => { ;(chain.blockchain as any)._validateConsensus = false ;(miner as any).chainUpdated = async () => {} // stub miner.start() - await wait(100) + await wait(1000) config.events.on(Event.CHAIN_UPDATED, async () => { - t.ok(chain.blocks.latest!.header.number.eqn(1)) + t.equal(chain.blocks.latest!.header.number, BigInt(1)) miner.stop() await chain.close() + t.end() }) await (miner as any).queueNextAssembly(0) - await wait(3000) + await wait(10000) }) t.test('should reset td', (t) => { diff --git a/packages/client/test/miner/pendingBlock.spec.ts b/packages/client/test/miner/pendingBlock.spec.ts index 2376a0da784..58848c205b7 100644 --- a/packages/client/test/miner/pendingBlock.spec.ts +++ b/packages/client/test/miner/pendingBlock.spec.ts @@ -5,7 +5,7 @@ import { Transaction } from '@ethereumjs/tx' import { BlockHeader } from '@ethereumjs/block' import VM from '@ethereumjs/vm' import { DefaultStateManager, StateManager } from '@ethereumjs/vm/dist/state' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { Config } from '../../lib/config' import { TxPool } from '../../lib/service/txpool' import { PendingBlock } from '../../lib/miner' @@ -26,7 +26,7 @@ const B = { ), } -const setBalance = async (stateManager: StateManager, address: Address, balance: BN) => { +const setBalance = async (stateManager: StateManager, address: Address, balance: bigint) => { await stateManager.checkpoint() await stateManager.modifyAccountFields(address, { balance }) await stateManager.commit() @@ -83,8 +83,8 @@ tape('[PendingBlock]', async (t) => { txPool.add(txA02) const pendingBlock = new PendingBlock({ config, txPool }) const vm = await VM.create({ common }) - await setBalance(vm.stateManager, A.address, new BN(5000000000000000)) - await setBalance(vm.stateManager, B.address, new BN(5000000000000000)) + await setBalance(vm.stateManager, A.address, BigInt(5000000000000000)) + await setBalance(vm.stateManager, B.address, BigInt(5000000000000000)) const parentBlock = await vm.blockchain.getLatestBlock() const payloadId = await pendingBlock.start(vm, parentBlock) t.equal(pendingBlock.pendingPayloads.length, 1, 'should set the pending payload') @@ -92,8 +92,8 @@ tape('[PendingBlock]', async (t) => { const built = await pendingBlock.build(payloadId) if (!built) return t.fail('pendingBlock did not return') const [block, receipts] = built - t.ok(block.header.number.eqn(1), 'should have built block number 1') - t.equal(block.transactions.length, 3, 'should include txs from pool') + t.equal(block?.header.number, BigInt(1), 'should have built block number 1') + t.equal(block?.transactions.length, 3, 'should include txs from pool') t.equal(receipts.length, 3, 'receipts should match number of transactions') t.equal(pendingBlock.pendingPayloads.length, 0, 'should reset the pending payload after build') t.end() @@ -104,7 +104,7 @@ tape('[PendingBlock]', async (t) => { txPool.add(txA01) const pendingBlock = new PendingBlock({ config, txPool }) const vm = await VM.create({ common }) - await setBalance(vm.stateManager, A.address, new BN(5000000000000000)) + await setBalance(vm.stateManager, A.address, BigInt(5000000000000000)) const parentBlock = await vm.blockchain.getLatestBlock() const payloadId = await pendingBlock.start(vm, parentBlock) t.equal(pendingBlock.pendingPayloads.length, 1, 'should set the pending payload') @@ -132,15 +132,15 @@ tape('[PendingBlock]', async (t) => { txPool.add(txA03) const pendingBlock = new PendingBlock({ config, txPool }) const vm = await VM.create({ common }) - await setBalance(vm.stateManager, A.address, new BN(5000000000000000)) + await setBalance(vm.stateManager, A.address, BigInt(5000000000000000)) const parentBlock = await vm.blockchain.getLatestBlock() const payloadId = await pendingBlock.start(vm, parentBlock) t.equal(pendingBlock.pendingPayloads.length, 1, 'should set the pending payload') const built = await pendingBlock.build(payloadId) if (!built) return t.fail('pendingBlock did not return') const [block, receipts] = built - t.ok(block.header.number.eqn(1), 'should have built block number 1') - t.equal(block.transactions.length, 2, 'should include txs from pool that fit in the block') + t.equal(block?.header.number, BigInt(1), 'should have built block number 1') + t.equal(block?.transactions.length, 2, 'should include txs from pool that fit in the block') t.equal(receipts.length, 2, 'receipts should match number of transactions') t.equal(pendingBlock.pendingPayloads.length, 0, 'should reset the pending payload after build') t.end() @@ -157,7 +157,7 @@ tape('[PendingBlock]', async (t) => { const built = await pendingBlock.build(payloadId) if (!built) return t.fail('pendingBlock did not return') const [block, receipts] = built - t.ok(block.header.number.eqn(1), 'should have built block number 1') + t.equal(block?.header.number, BigInt(1), 'should have built block number 1') t.equal( block.transactions.length, 0, diff --git a/packages/client/test/net/protocol/ethprotocol.spec.ts b/packages/client/test/net/protocol/ethprotocol.spec.ts index 3fc48d8297d..03eae882f6f 100644 --- a/packages/client/test/net/protocol/ethprotocol.spec.ts +++ b/packages/client/test/net/protocol/ethprotocol.spec.ts @@ -2,10 +2,10 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Common, { Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' -import { BN } from 'ethereumjs-util' import { Chain } from '../../../lib/blockchain/chain' import { Config } from '../../../lib/config' import { EthProtocol } from '../../../lib/net/protocol' +import { bigIntToBuffer, bufferToBigInt, intToBuffer } from 'ethereumjs-util' tape('[EthProtocol]', (t) => { t.test('should get properties', (t) => { @@ -34,14 +34,14 @@ tape('[EthProtocol]', (t) => { const p = new EthProtocol({ config, chain }) Object.defineProperty(chain, 'networkId', { get: () => { - return new BN(1) + return BigInt(1) }, }) Object.defineProperty(chain, 'blocks', { get: () => { return { - td: new BN(100), - latest: { hash: () => '0xaa', header: { number: new BN(10) } }, + td: BigInt(100), + latest: { hash: () => '0xaa', header: { number: BigInt(10) } }, } }, }) @@ -68,8 +68,8 @@ tape('[EthProtocol]', (t) => { genesisHash: '0xbb', }) t.ok( - status.networkId.eqn(1) && - status.td.eqn(100) && + status.networkId === BigInt(1) && + status.td === BigInt(100) && status.bestHash === '0xaa' && status.genesisHash === '0xbb', 'decode status' @@ -81,18 +81,18 @@ tape('[EthProtocol]', (t) => { const config = new Config({ transports: [] }) const chain = new Chain({ config }) const p = new EthProtocol({ config, chain }) - const td = new BN(100) + const td = BigInt(100) const block = Block.fromBlockData({}, { common: config.chainCommon }) const res = p.decode(p.messages.filter((message) => message.name === 'NewBlock')[0], [ block.raw(), - td.toBuffer(), + bigIntToBuffer(td), ]) const res2 = p.encode(p.messages.filter((message) => message.name === 'NewBlock')[0], [ block, td, ]) t.deepEquals(res[0].hash(), block.hash(), 'correctly decoded block') - t.ok(new BN(res2[1]).eq(td), 'correctly encoded td') + t.equal(bufferToBigInt(res2[1]), td, 'correctly encoded td') t.end() }) @@ -102,16 +102,16 @@ tape('[EthProtocol]', (t) => { const p = new EthProtocol({ config, chain }) const block = Block.fromBlockData({}) const res = p.decode(p.messages.filter((message) => message.name === 'GetReceipts')[0], [ - new BN(1), + BigInt(1), [block.hash()], ]) const res2 = p.encode(p.messages.filter((message) => message.name === 'GetReceipts')[0], { - reqId: new BN(1), + reqId: BigInt(1), hashes: [block.hash()], }) - t.ok(res.reqId.eqn(1), 'correctly decoded reqId') + t.equal(res.reqId, BigInt(1), 'correctly decoded reqId') t.ok(res.hashes[0].equals(block.hash()), 'correctly decoded blockHash') - t.ok(new BN(res2[0]).eqn(1), 'correctly encoded reqId') + t.equal(bufferToBigInt(res2[0]), BigInt(1), 'correctly encoded reqId') t.ok(res2[1][0].equals(block.hash()), 'correctly encoded blockHash') t.end() }) @@ -133,10 +133,10 @@ tape('[EthProtocol]', (t) => { { common: config.chainCommon } ) const res = p.encode(p.messages.filter((message) => message.name === 'PooledTransactions')[0], { - reqId: new BN(1), + reqId: BigInt(1), txs: [tx], }) - t.ok(new BN(res[0]).eqn(1), 'correctly encoded reqId') + t.equal(bufferToBigInt(res[0]), BigInt(1), 'correctly encoded reqId') t.deepEqual(res[1][0], tx.serialize(), 'EIP1559 transaction correctly encoded') t.end() }) @@ -151,14 +151,14 @@ tape('[EthProtocol]', (t) => { const receipts = [ { status: 1 as 0 | 1, - gasUsed: new BN(100).toArrayLike(Buffer), + gasUsed: intToBuffer(100), bitvector: Buffer.alloc(256), logs: [[Buffer.alloc(20), [Buffer.alloc(32), Buffer.alloc(32, 1)], Buffer.alloc(10)]], txType: 2, }, { status: 0 as 0 | 1, - gasUsed: new BN(1000).toArrayLike(Buffer), + gasUsed: intToBuffer(1000), bitvector: Buffer.alloc(256, 1), logs: [[Buffer.alloc(20, 1), [Buffer.alloc(32, 1), Buffer.alloc(32, 1)], Buffer.alloc(10)]], txType: 0, @@ -167,10 +167,10 @@ tape('[EthProtocol]', (t) => { // encode let res = p.encode(p.messages.filter((message) => message.name === 'Receipts')[0], { - reqId: new BN(1), + reqId: BigInt(1), receipts, }) - t.ok(new BN(res[0]).eqn(1), 'correctly encoded reqId') + t.equal(bufferToBigInt(res[0]), BigInt(1), 'correctly encoded reqId') const expectedSerializedReceipts = [ Buffer.from( '02f9016d0164b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f866f864940000000000000000000000000000000000000000f842a00000000000000000000000000000000000000000000000000000000000000000a001010101010101010101010101010101010101010101010101010101010101018a00000000000000000000', @@ -185,7 +185,7 @@ tape('[EthProtocol]', (t) => { // decode the encoded result and match to the original receipts (without tx type) res = p.decode(p.messages.filter((message) => message.name === 'Receipts')[0], res) - t.ok(new BN(res[0]).eqn(1), 'correctly decoded reqId') + t.equal(BigInt(res[0]), BigInt(1), 'correctly decoded reqId') const receiptsWithoutTxType = receipts.map((r: any) => { delete r.txType return r diff --git a/packages/client/test/net/protocol/lesprotocol.spec.ts b/packages/client/test/net/protocol/lesprotocol.spec.ts index 0caed31bf24..73de2307a7a 100644 --- a/packages/client/test/net/protocol/lesprotocol.spec.ts +++ b/packages/client/test/net/protocol/lesprotocol.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import { Chain } from '../../../lib/blockchain' import { Config } from '../../../lib/config' import { FlowControl, LesProtocol } from '../../../lib/net/protocol' @@ -36,13 +35,13 @@ tape('[LesProtocol]', (t) => { const p = new LesProtocol({ config, chain, flow }) Object.defineProperty(chain, 'networkId', { get: () => { - return new BN(1) + return BigInt(1) }, }) Object.defineProperty(chain, 'blocks', { get: () => { return { - td: new BN(100), + td: BigInt(100), latest: { hash: () => '0xaa' }, } }, @@ -55,11 +54,12 @@ tape('[LesProtocol]', (t) => { Object.defineProperty(chain, 'headers', { get: () => { return { - td: new BN(100), + td: BigInt(100), latest: { hash: () => '0xaa', - number: new BN(100), + number: BigInt(100), }, + height: BigInt(100), } }, }) @@ -85,10 +85,10 @@ tape('[LesProtocol]', (t) => { status = { ...status, networkId: [0x01] } status = p.decodeStatus(status) t.ok( - status.networkId.toNumber() === 1 && - status.headTd.toString('hex') === '64' && + status.networkId === BigInt(1) && + status.headTd === BigInt(100) && status.headHash === '0xaa' && - status.headNum.toNumber() === 100 && + status.headNum === BigInt(100) && status.genesisHash === '0xbb' && status.forkID[0].toString('hex') === 'fc64ec04' && status.forkID[1].toString('hex') === '118c30' && diff --git a/packages/client/test/rpc/eth/blockNumber.spec.ts b/packages/client/test/rpc/eth/blockNumber.spec.ts index e807f40be89..65bb8c72f0d 100644 --- a/packages/client/test/rpc/eth/blockNumber.spec.ts +++ b/packages/client/test/rpc/eth/blockNumber.spec.ts @@ -1,11 +1,11 @@ import tape from 'tape' -import { BN, bnToHex } from 'ethereumjs-util' +import { bigIntToHex } from 'ethereumjs-util' import { startRPC, createManager, createClient, params, baseRequest } from '../helpers' const method = 'eth_blockNumber' tape(`${method}: call with valid arguments`, async (t) => { - const mockBlockNumber = new BN(123) + const mockBlockNumber = BigInt(123) const mockChain = { headers: { latest: { number: mockBlockNumber } }, getLatestHeader: async function (): Promise { @@ -19,7 +19,7 @@ tape(`${method}: call with valid arguments`, async (t) => { const req = params(method) const expectRes = (res: any) => { - t.equal(res.body.result, bnToHex(mockBlockNumber)) + t.equal(res.body.result, bigIntToHex(mockBlockNumber)) } await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/call.spec.ts b/packages/client/test/rpc/eth/call.spec.ts index 6f6b18acfa7..45a5cc659c1 100644 --- a/packages/client/test/rpc/eth/call.spec.ts +++ b/packages/client/test/rpc/eth/call.spec.ts @@ -3,7 +3,7 @@ import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' -import { Address, BN, bnToHex, bufferToHex } from 'ethereumjs-util' +import { Address, bigIntToHex, bufferToHex } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' import { startRPC, createManager, createClient, params, baseRequest } from '../helpers' import { checkError } from '../util' @@ -76,7 +76,7 @@ tape(`${method}: call with valid arguments`, async (t) => { to: createdAddress!.toString(), from: address.toString(), data: `0x${funcHash}`, - gasLimit: bnToHex(new BN(53000)), + gasLimit: bigIntToHex(BigInt(53000)), } const estimateTx = Transaction.fromTxData(estimateTxData, { freeze: false }) estimateTx.getSenderAddress = () => { @@ -113,7 +113,7 @@ tape(`${method}: call with unsupported block argument`, async (t) => { to: address.toString(), from: address.toString(), data: `0x${funcHash}`, - gasLimit: bnToHex(new BN(53000)), + gasLimit: bigIntToHex(BigInt(53000)), } const req = params(method, [{ ...estimateTxData, gas: estimateTxData.gasLimit }, 'pending']) diff --git a/packages/client/test/rpc/eth/chainId.spec.ts b/packages/client/test/rpc/eth/chainId.spec.ts index 19b5e54ace3..a43a0365b8b 100644 --- a/packages/client/test/rpc/eth/chainId.spec.ts +++ b/packages/client/test/rpc/eth/chainId.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import Common, { Chain } from '@ethereumjs/common' import { baseSetup, params, baseRequest, createClient, createManager, startRPC } from '../helpers' @@ -50,7 +49,7 @@ tape(`${method}: returns 42 for Kovan`, async (t) => { const req = params(method, []) const expectRes = (res: any) => { const msg = 'should return chainId 42' - const chainId = new BN(42).toString(16) + const chainId = BigInt(42).toString(16) t.equal(res.body.result, `0x${chainId}`, msg) } await baseRequest(t, server, req, 200, expectRes) diff --git a/packages/client/test/rpc/eth/estimateGas.spec.ts b/packages/client/test/rpc/eth/estimateGas.spec.ts index adde17cb093..3c9c28e3ce7 100644 --- a/packages/client/test/rpc/eth/estimateGas.spec.ts +++ b/packages/client/test/rpc/eth/estimateGas.spec.ts @@ -3,7 +3,7 @@ import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' -import { Address, BN, bnToHex } from 'ethereumjs-util' +import { Address, bigIntToHex } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' import { startRPC, createManager, createClient, params, baseRequest } from '../helpers' import { checkError } from '../util' @@ -77,7 +77,7 @@ tape(`${method}: call with valid arguments`, async (t) => { to: createdAddress!.toString(), from: address.toString(), data: `0x${funcHash}`, - gasLimit: bnToHex(new BN(53000)), + gasLimit: bigIntToHex(BigInt(53000)), } const estimateTx = Transaction.fromTxData(estimateTxData, { freeze: false }) estimateTx.getSenderAddress = () => { @@ -114,7 +114,7 @@ tape(`${method}: call with unsupported block argument`, async (t) => { to: address.toString(), from: address.toString(), data: `0x${funcHash}`, - gasLimit: bnToHex(new BN(53000)), + gasLimit: bigIntToHex(BigInt(53000)), } const req = params(method, [{ ...estimateTxData, gas: estimateTxData.gasLimit }, 'pending']) diff --git a/packages/client/test/rpc/eth/getBalance.spec.ts b/packages/client/test/rpc/eth/getBalance.spec.ts index 0204d94fa7f..66b370dc956 100644 --- a/packages/client/test/rpc/eth/getBalance.spec.ts +++ b/packages/client/test/rpc/eth/getBalance.spec.ts @@ -3,7 +3,7 @@ import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' -import { Address, BN, toBuffer, bnToHex } from 'ethereumjs-util' +import { Address, bigIntToHex } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' import { startRPC, createManager, createClient, params, baseRequest } from '../helpers' import { checkError } from '../util' @@ -32,11 +32,11 @@ tape(`${method}: ensure balance deducts after a tx`, async (t) => { const address = Address.fromString('0xccfd725760a68823ff1e062f4cc97e1360e8d997') // verify balance is genesis amount - const genesisBalance = new BN(toBuffer('0x15ac56edc4d12c0000')) + const genesisBalance = BigInt(0x15ac56edc4d12c0000) let req = params(method, [address.toString(), 'latest']) let expectRes = (res: any) => { const msg = 'should return the correct genesis balance' - t.equal(res.body.result, bnToHex(genesisBalance), msg) + t.equal(res.body.result, bigIntToHex(genesisBalance), msg) } await baseRequest(t, server, req, 200, expectRes, false) @@ -52,11 +52,11 @@ tape(`${method}: ensure balance deducts after a tx`, async (t) => { const { amountSpent } = result.results[0] // verify balance is genesis amount minus amountSpent - const expectedNewBalance = genesisBalance.sub(new BN(amountSpent.toString(10))) + const expectedNewBalance = genesisBalance - amountSpent req = params(method, [address.toString(), 'latest']) expectRes = (res: any) => { const msg = 'should return the correct balance after a tx' - t.equal(res.body.result, bnToHex(expectedNewBalance), msg) + t.equal(res.body.result, bigIntToHex(expectedNewBalance), msg) } await baseRequest(t, server, req, 200, expectRes, false) @@ -64,7 +64,7 @@ tape(`${method}: ensure balance deducts after a tx`, async (t) => { req = params(method, [address.toString(), 'earliest']) expectRes = (res: any) => { const msg = "should return the correct balance with 'earliest'" - t.equal(res.body.result, bnToHex(genesisBalance), msg) + t.equal(res.body.result, bigIntToHex(genesisBalance), msg) } await baseRequest(t, server, req, 200, expectRes, false) @@ -72,7 +72,7 @@ tape(`${method}: ensure balance deducts after a tx`, async (t) => { req = params(method, [address.toString(), '0x0']) expectRes = (res: any) => { const msg = 'should return the correct balance with a past block number' - t.equal(res.body.result, bnToHex(genesisBalance), msg) + t.equal(res.body.result, bigIntToHex(genesisBalance), msg) } await baseRequest(t, server, req, 200, expectRes, false) diff --git a/packages/client/test/rpc/eth/getBlockByNumber.spec.ts b/packages/client/test/rpc/eth/getBlockByNumber.spec.ts index e54eff2aa33..f31a0897c79 100644 --- a/packages/client/test/rpc/eth/getBlockByNumber.spec.ts +++ b/packages/client/test/rpc/eth/getBlockByNumber.spec.ts @@ -1,5 +1,5 @@ import { Block } from '@ethereumjs/block' -import { BN, bufferToHex } from 'ethereumjs-util' +import { bufferToHex } from 'ethereumjs-util' import tape from 'tape' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' import { startRPC, createManager, createClient, params, baseRequest } from '../helpers' @@ -40,7 +40,7 @@ function createChain() { const genesisBlock = { hash: () => genesisBlockHash, header: { - number: new BN(0), + number: BigInt(0), }, toJSON: () => ({ ...Block.fromBlockData({ header: { number: 0 } }).toJSON(), transactions }), transactions: [{ hash: () => txHash }], @@ -49,7 +49,7 @@ function createChain() { const block = { hash: () => blockHash, header: { - number: new BN(1), + number: BigInt(1), }, toJSON: () => ({ ...Block.fromBlockData({ header: { number: 1 } }).toJSON(), @@ -63,7 +63,7 @@ function createChain() { getBlock: () => genesisBlock, getLatestBlock: () => block, getLatestHeader: () => block.header, - getTd: () => new BN(0), + getTd: () => BigInt(0), } } diff --git a/packages/client/test/rpc/eth/getCode.spec.ts b/packages/client/test/rpc/eth/getCode.spec.ts index 48dfd0fa424..18e3002ead8 100644 --- a/packages/client/test/rpc/eth/getCode.spec.ts +++ b/packages/client/test/rpc/eth/getCode.spec.ts @@ -3,7 +3,7 @@ import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' import { startRPC, createManager, createClient, params, baseRequest } from '../helpers' import { checkError } from '../util' @@ -87,7 +87,7 @@ tape(`${method}: ensure returns correct code`, async (t) => { const { createdAddress } = result.results[0] await vm.blockchain.putBlock(ranBlock!) - const expectedContractAddress = Address.generate(address, new BN(0)) + const expectedContractAddress = Address.generate(address, BigInt(0)) t.ok( createdAddress!.equals(expectedContractAddress), 'should match the expected contract address' diff --git a/packages/client/test/rpc/eth/getLogs.spec.ts b/packages/client/test/rpc/eth/getLogs.spec.ts index 7674c362039..49b5469d950 100644 --- a/packages/client/test/rpc/eth/getLogs.spec.ts +++ b/packages/client/test/rpc/eth/getLogs.spec.ts @@ -1,6 +1,6 @@ import tape from 'tape' import { Transaction } from '@ethereumjs/tx' -import { Address, BN, bufferToHex } from 'ethereumjs-util' +import { Address, bufferToHex } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' import { params, baseRequest, setupChain, runBlockWithTxs, dummy } from '../helpers' import { checkError } from '../util' @@ -49,8 +49,8 @@ tape(`${method}: call with valid arguments`, async (t) => { { common } ).sign(dummy.privKey) - const contractAddr1 = Address.generate(dummy.addr, new BN(0)) - const contractAddr2 = Address.generate(dummy.addr, new BN(1)) + const contractAddr1 = Address.generate(dummy.addr, BigInt(0)) + const contractAddr2 = Address.generate(dummy.addr, BigInt(1)) // construct txs to emit the logs // data calls log(logCount: 10, num1: 1, num2: 2, num3: 3, num4: 4) const data = Buffer.from( diff --git a/packages/client/test/rpc/eth/getProof.spec.ts b/packages/client/test/rpc/eth/getProof.spec.ts index d4403239edc..be6064884f9 100644 --- a/packages/client/test/rpc/eth/getProof.spec.ts +++ b/packages/client/test/rpc/eth/getProof.spec.ts @@ -3,7 +3,7 @@ import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' -import { Address, BN, bnToHex } from 'ethereumjs-util' +import { Address, bigIntToHex } from 'ethereumjs-util' import { startRPC, createManager, createClient, params, baseRequest } from '../helpers' import type { FullEthereumService } from '../../../lib/service' @@ -100,7 +100,7 @@ tape(`${method}: call with valid arguments`, async (t) => { to: createdAddress!.toString(), from: address.toString(), data: `0x${funcHash}`, - gasLimit: bnToHex(new BN(530000)), + gasLimit: bigIntToHex(BigInt(530000)), nonce: 1, } const storeTx = Transaction.fromTxData(storeTxData, { common, freeze: false }) diff --git a/packages/client/test/rpc/eth/getStorageAt.spec.ts b/packages/client/test/rpc/eth/getStorageAt.spec.ts index 18de909d0d4..298e57cc7f1 100644 --- a/packages/client/test/rpc/eth/getStorageAt.spec.ts +++ b/packages/client/test/rpc/eth/getStorageAt.spec.ts @@ -3,7 +3,7 @@ import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' -import { Address, BN, bnToHex, bufferToHex, keccak } from 'ethereumjs-util' +import { Address, bigIntToHex, bufferToHex, keccak } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' import { startRPC, createManager, createClient, params, baseRequest } from '../helpers' import { checkError } from '../util' @@ -81,7 +81,7 @@ tape(`${method}: call with valid arguments`, async (t) => { to: createdAddress!.toString(), from: address.toString(), data: `0x${funcHash}`, - gasLimit: bnToHex(new BN(530000)), + gasLimit: bigIntToHex(BigInt(530000)), nonce: 1, } const storeTx = Transaction.fromTxData(storeTxData, { common, freeze: false }) diff --git a/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts b/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts index 76f2d2f034e..d87f6fac701 100644 --- a/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts +++ b/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' import { startRPC, createManager, createClient, params, baseRequest } from '../helpers' import { checkError } from '../util' @@ -10,7 +9,7 @@ function createChain() { transactions: [], header: { hash: () => Buffer.from([1]), - number: new BN('5'), + number: BigInt('5'), }, } return { diff --git a/packages/client/test/rpc/eth/syncing.spec.ts b/packages/client/test/rpc/eth/syncing.spec.ts index e0741027555..3972bc52cf9 100644 --- a/packages/client/test/rpc/eth/syncing.spec.ts +++ b/packages/client/test/rpc/eth/syncing.spec.ts @@ -1,6 +1,5 @@ import tape from 'tape' import td from 'testdouble' -import { BN } from 'ethereumjs-util' import { INTERNAL_ERROR } from '../../../lib/rpc/error-code' import { baseRequest, createManager, createClient, params, startRPC } from '../helpers' import { checkError } from '../util' @@ -66,7 +65,7 @@ tape(`${method}: should return syncing status object when unsynced`, async (t) = synchronizer.best = td.func() synchronizer.latest = td.func() td.when(synchronizer.best()).thenReturn('peer') - td.when(synchronizer.latest('peer' as any)).thenResolve({ number: new BN(2) }) + td.when(synchronizer.latest('peer' as any)).thenResolve({ number: BigInt(2) }) client.config.synchronized = false t.equals(client.config.synchronized, false, 'not synchronized yet') diff --git a/packages/client/test/rpc/helpers.ts b/packages/client/test/rpc/helpers.ts index e4d469f21ed..cbeb95d9c42 100644 --- a/packages/client/test/rpc/helpers.ts +++ b/packages/client/test/rpc/helpers.ts @@ -2,7 +2,7 @@ import tape from 'tape' import { Server as RPCServer, HttpServer } from 'jayson/promise' import Blockchain from '@ethereumjs/blockchain' import Common, { Chain as ChainEnum } from '@ethereumjs/common' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { RPCManager as Manager } from '../../lib/rpc' import { getLogger } from '../../lib/logging' import { Config } from '../../lib/config' @@ -69,7 +69,7 @@ export function createClient(clientOpts: any = {}) { } const clientConfig = { ...defaultClientConfig, ...clientOpts } - chain.getTd = async (_hash: Buffer, _num: BN) => new BN(1000) + chain.getTd = async (_hash: Buffer, _num: bigint) => BigInt(1000) config.synchronized = true config.lastSyncDate = Date.now() @@ -238,7 +238,7 @@ export async function runBlockWithTxs( const blockBuilder = await vmCopy.buildBlock({ parentBlock, headerData: { - timestamp: parentBlock.header.timestamp.addn(1), + timestamp: parentBlock.header.timestamp + BigInt(1), }, blockOpts: { calcDifficultyFromHeader: parentBlock.header, diff --git a/packages/client/test/rpc/mockBlockchain.ts b/packages/client/test/rpc/mockBlockchain.ts index 5b2d7995382..8a1da6bacc5 100644 --- a/packages/client/test/rpc/mockBlockchain.ts +++ b/packages/client/test/rpc/mockBlockchain.ts @@ -1,5 +1,5 @@ import { Block } from '@ethereumjs/block' -import { BN, bufferToHex, toBuffer } from 'ethereumjs-util' +import { bufferToHex, toBuffer } from 'ethereumjs-util' export function mockBlockchain(options: any = {}) { const number = options.number ?? '0x444444' @@ -12,7 +12,7 @@ export function mockBlockchain(options: any = {}) { const block = { hash: () => toBuffer(blockHash), header: { - number: new BN(toBuffer(number)), + number: BigInt(number), }, toJSON: () => ({ ...Block.fromBlockData({ header: { number } }).toJSON(), diff --git a/packages/client/test/service/fullethereumservice.spec.ts b/packages/client/test/service/fullethereumservice.spec.ts index 8908b684064..41d039dbe9e 100644 --- a/packages/client/test/service/fullethereumservice.spec.ts +++ b/packages/client/test/service/fullethereumservice.spec.ts @@ -1,7 +1,7 @@ import tape from 'tape' import td from 'testdouble' import { Log } from '@ethereumjs/vm/dist/evm/types' -import { BN } from 'ethereumjs-util' +import { intToBuffer } from 'ethereumjs-util' import { Config } from '../../lib/config' import { Event } from '../../lib/types' import { Chain } from '../../lib/blockchain' @@ -82,7 +82,7 @@ tape('[FullEthereumService]', async (t) => { service.config.events.on(Event.SYNC_ERROR, (err) => { if (err.message === 'error0') t.pass('got error 1') }) - service.config.events.emit(Event.SYNC_SYNCHRONIZED, new BN(0)) + service.config.events.emit(Event.SYNC_SYNCHRONIZED, BigInt(0)) service.config.events.emit(Event.SYNC_ERROR, new Error('error0')) service.config.events.on(Event.SERVER_ERROR, (err) => { if (err.message === 'error1') t.pass('got error 2') @@ -110,7 +110,7 @@ tape('[FullEthereumService]', async (t) => { const config = new Config({ transports: [] }) const chain = new Chain({ config }) const service = new FullEthereumService({ config, chain }) - await service.handle({ name: 'NewBlock', data: [{}, new BN(1)] }, 'eth', undefined as any) + await service.handle({ name: 'NewBlock', data: [{}, BigInt(1)] }, 'eth', undefined as any) td.verify(service.synchronizer.handleNewBlock({} as any, undefined)) t.end() }) @@ -126,7 +126,7 @@ tape('[FullEthereumService]', async (t) => { const receipts = [ { status: 1 as 0 | 1, - gasUsed: new BN(100).toArrayLike(Buffer), + gasUsed: intToBuffer(100), bitvector: Buffer.alloc(256), logs: [ [Buffer.alloc(20), [Buffer.alloc(32), Buffer.alloc(32, 1)], Buffer.alloc(10)], @@ -135,7 +135,7 @@ tape('[FullEthereumService]', async (t) => { }, { status: 0 as 0 | 1, - gasUsed: new BN(1000).toArrayLike(Buffer), + gasUsed: intToBuffer(1000), bitvector: Buffer.alloc(256, 1), logs: [ [Buffer.alloc(20, 1), [Buffer.alloc(32, 1), Buffer.alloc(32, 1)], Buffer.alloc(10)], @@ -147,8 +147,8 @@ tape('[FullEthereumService]', async (t) => { receipts ) const peer = { eth: { send: td.func() } } as any - await service.handle({ name: 'GetReceipts', data: [new BN(1), [blockHash]] }, 'eth', peer) - td.verify(peer.eth.send('Receipts', { reqId: new BN(1), receipts })) + await service.handle({ name: 'GetReceipts', data: [BigInt(1), [blockHash]] }, 'eth', peer) + td.verify(peer.eth.send('Receipts', { reqId: BigInt(1), receipts })) t.end() }) diff --git a/packages/client/test/service/lightethereumservice.spec.ts b/packages/client/test/service/lightethereumservice.spec.ts index f33ab73faaa..76cd31b860e 100644 --- a/packages/client/test/service/lightethereumservice.spec.ts +++ b/packages/client/test/service/lightethereumservice.spec.ts @@ -1,6 +1,5 @@ import tape from 'tape' import td from 'testdouble' -import { BN } from 'ethereumjs-util' import { Config } from '../../lib/config' import { Event } from '../../lib/types' import { Chain } from '../../lib/blockchain' @@ -62,7 +61,7 @@ tape('[LightEthereumService]', async (t) => { service.config.events.on(Event.SYNC_ERROR, (err: Error) => { if (err.message === 'error0') t.pass('got error 1') }) - service.config.events.emit(Event.SYNC_SYNCHRONIZED, new BN(0)) + service.config.events.emit(Event.SYNC_SYNCHRONIZED, BigInt(0)) service.config.events.emit(Event.SYNC_ERROR, new Error('error0')) service.config.events.on(Event.SERVER_ERROR, (err: Error) => { if (err.message === 'error1') t.pass('got error 2') diff --git a/packages/client/test/sync/execution/vmexecution.spec.ts b/packages/client/test/sync/execution/vmexecution.spec.ts index 9cd7c5d48ab..78c4acc7edb 100644 --- a/packages/client/test/sync/execution/vmexecution.spec.ts +++ b/packages/client/test/sync/execution/vmexecution.spec.ts @@ -46,7 +46,7 @@ tape('[VMExecution]', async (t) => { exec = await testSetup(blockchain) await exec.run() newHead = await exec.vm.blockchain.getHead() - t.ok(newHead.header.number.eqn(5), 'should run all blocks') + t.equal(newHead.header.number, BigInt(5), 'should run all blocks') const common = new Common({ chain: 'testnet', customChains: [testnet] }) exec = await testSetup(blockchain, common) @@ -77,7 +77,7 @@ tape('[VMExecution]', async (t) => { exec = await testSetup(blockchain, common) await exec.run() newHead = await exec.vm.blockchain.getHead() - t.deepEqual(newHead.header.number.toNumber(), 7, 'should run all blocks') + t.deepEqual(newHead.header.number, BigInt(7), 'should run all blocks') t.end() }) diff --git a/packages/client/test/sync/fetcher/blockfetcher.spec.ts b/packages/client/test/sync/fetcher/blockfetcher.spec.ts index 1319742ffe5..26e296320f4 100644 --- a/packages/client/test/sync/fetcher/blockfetcher.spec.ts +++ b/packages/client/test/sync/fetcher/blockfetcher.spec.ts @@ -1,6 +1,5 @@ import tape from 'tape' import td from 'testdouble' -import { BN } from 'ethereumjs-util' import { Config } from '../../../lib/config' import { Chain } from '../../../lib/blockchain/chain' import { wait } from '../../integration/util' @@ -24,8 +23,8 @@ tape('[BlockFetcher]', async (t) => { config, pool, chain, - first: new BN(1), - count: new BN(10), + first: BigInt(1), + count: BigInt(10), timeout: 5, }) fetcher.next = () => false @@ -48,32 +47,32 @@ tape('[BlockFetcher]', async (t) => { config, pool, chain, - first: new BN(1), - count: new BN(10), + first: BigInt(1), + count: BigInt(10), timeout: 5, }) void fetcher.fetch() t.equals((fetcher as any).in.size(), 2, 'added 2 tasks') await wait(100) - let blockNumberList = [new BN(11), new BN(12)] - let min = new BN(11) - let max = new BN(12) + let blockNumberList = [new BigInt(11), new BigInt(12)] + let min = new BigInt(11) + let max = new BigInt(12) fetcher.enqueueByNumberList(blockNumberList, min, max) t.equals((fetcher as any).in.size(), 3, '1 new task for two subsequent block numbers') - blockNumberList = [new BN(13), new BN(15)] - min = new BN(13) - max = new BN(15) + blockNumberList = [new BigInt(13), new BigInt(15)] + min = new BigInt(13) + max = new BigInt(15) fetcher.enqueueByNumberList(blockNumberList, min, max) t.equals((fetcher as any).in.size(), 3, 'no new task added only the height changed') - t.equals(fetcher.first.add(fetcher.count).subn(1).eqn(15), true, 'height should now be 15') + t.equals(fetcher.first + fetcher.count - BigInt(1) === BigInt(15), true, 'height should now be 15') // Clear fetcher queue for next test of gap when following head fetcher.clear() - blockNumberList = [new BN(50), new BN(51)] - min = new BN(50) - max = new BN(51) + blockNumberList = [new BigInt(50), new BigInt(51)] + min = new BigInt(50) + max = new BigInt(51) fetcher.enqueueByNumberList(blockNumberList, min, max) t.equals( (fetcher as any).in.size(), @@ -93,8 +92,8 @@ tape('[BlockFetcher]', async (t) => { config, pool, chain, - first: new BN(0), - count: new BN(0), + first: BigInt(0), + count: BigInt(0), }) const blocks: any = [{ header: { number: 1 } }, { header: { number: 2 } }] t.deepEquals(fetcher.process({ task: { count: 2 } } as any, blocks), blocks, 'got results') @@ -110,11 +109,11 @@ tape('[BlockFetcher]', async (t) => { config, pool, chain, - first: new BN(0), - count: new BN(0), + first: new BigInt(0), + count: new BigInt(0), }) const blocks: any = [{ header: { number: 1 } }, { header: { number: 2 } }] - const task = { count: 3, first: new BN(1) } + const task = { count: 3, first: new BigInt(1) } ;(fetcher as any).running = true fetcher.enqueueTask(task) const job = (fetcher as any).in.peek() @@ -138,8 +137,8 @@ tape('[BlockFetcher]', async (t) => { config, pool, chain, - first: new BN(0), - count: new BN(0), + first: BigInt(0), + count: BigInt(0), }) td.when((fetcher as any).pool.idle(td.matchers.anything())).thenReturn('peer0') t.equals(fetcher.peer(), 'peer0', 'found peer') @@ -154,12 +153,12 @@ tape('[BlockFetcher]', async (t) => { config, pool, chain, - first: new BN(0), - count: new BN(0), + first: new BigInt(0), + count: new BigInt(0), }) const partialResult: any = [{ header: { number: 1 } }, { header: { number: 2 } }] - const task = { count: 3, first: new BN(1) } + const task = { count: 3, first: new BigInt(1) } const peer = { eth: { getBlockBodies: td.func(), getBlockHeaders: td.func() }, id: 'random', @@ -169,7 +168,7 @@ tape('[BlockFetcher]', async (t) => { await fetcher.request(job as any) td.verify( job.peer.eth.getBlockHeaders({ - block: job.task.first.addn(partialResult.length), + block: job.task.first + BigInt(partialResult.length), max: job.task.count - partialResult.length, }) ) @@ -188,15 +187,15 @@ tape('[BlockFetcher]', async (t) => { config, pool, chain, - first: new BN(1), - count: new BN(10), + first: BigInt(1), + count: BigInt(10), timeout: 5, }) td.when(chain.putBlocks(td.matchers.anything())).thenReject(new Error('err0')) try { await fetcher.store([]) } catch (err: any) { - st.ok(err.message === 'err0', 'store() threw on invalid block') + st.equal(err.message, 'err0', 'store() threw on invalid block') } td.reset() chain.putBlocks = td.func() diff --git a/packages/client/test/sync/fetcher/headerfetcher.spec.ts b/packages/client/test/sync/fetcher/headerfetcher.spec.ts index df78ffaa976..962605f0639 100644 --- a/packages/client/test/sync/fetcher/headerfetcher.spec.ts +++ b/packages/client/test/sync/fetcher/headerfetcher.spec.ts @@ -1,7 +1,6 @@ import tape from 'tape' import td from 'testdouble' import { Config } from '../../../lib/config' -import { BN } from 'ethereumjs-util' import { Chain } from '../../../lib/blockchain' import { Event } from '../../../lib/types' @@ -24,12 +23,12 @@ tape('[HeaderFetcher]', async (t) => { const headers = [{ number: 1 }, { number: 2 }] t.deepEquals( //@ts-ignore - fetcher.process({ task: { count: 2 }, peer: 'peer0' }, { headers, bv: new BN(1) }), + fetcher.process({ task: { count: 2 }, peer: 'peer0' }, { headers, bv: BigInt(1) }), headers, 'got results' ) //@ts-ignore - t.notOk(fetcher.process({ task: { count: 2 } }, { headers: [], bv: new BN(1) }), 'bad results') + t.notOk(fetcher.process({ task: { count: 2 } }, { headers: [], bv: BigInt(1) }), 'bad results') td.verify((fetcher as any).flow.handleReply('peer0', 1)) t.end() }) @@ -108,15 +107,15 @@ tape('[HeaderFetcher]', async (t) => { config, pool, chain, - first: new BN(1), - count: new BN(10), + first: BigInt(1), + count: BigInt(10), timeout: 5, }) td.when(chain.putHeaders([0 as any])).thenReject(new Error('err0')) try { await fetcher.store([0 as any]) } catch (err: any) { - st.ok(err.message === 'err0', 'store() threw on invalid header') + st.equal(err.message, 'err0', 'store() threw on invalid header') } td.when(chain.putHeaders([1 as any])).thenResolve(1) config.events.on(Event.SYNC_FETCHED_HEADERS, () => diff --git a/packages/client/test/sync/fullsync.spec.ts b/packages/client/test/sync/fullsync.spec.ts index 1022d6a8672..c4a51473707 100644 --- a/packages/client/test/sync/fullsync.spec.ts +++ b/packages/client/test/sync/fullsync.spec.ts @@ -1,6 +1,5 @@ import tape from 'tape' import td from 'testdouble' -import { BN } from 'ethereumjs-util' import { Config } from '../../lib/config' import { Chain } from '../../lib/blockchain' import { Event } from '../../lib/types' @@ -65,10 +64,10 @@ tape('[FullSynchronizer]', async (t) => { const chain = new Chain({ config }) const sync = new FullSynchronizer({ config, pool, chain, txPool, execution }) const peer = { eth: { getBlockHeaders: td.func(), status: { bestHash: 'hash' } } } - const headers = [{ number: new BN(5) }] - td.when(peer.eth.getBlockHeaders({ block: 'hash', max: 1 })).thenResolve([new BN(1), headers]) + const headers = [{ number: BigInt(5) }] + td.when(peer.eth.getBlockHeaders({ block: 'hash', max: 1 })).thenResolve([BigInt(1), headers]) const latest = await sync.latest(peer as any) - t.ok(latest!.number.eqn(5), 'got height') + t.equal(latest!.number, BigInt(5), 'got height') await sync.stop() await sync.close() t.end() @@ -88,10 +87,10 @@ tape('[FullSynchronizer]', async (t) => { }) ;(sync as any).running = true ;(sync as any).height = td.func() - ;(sync as any).chain = { blocks: { td: new BN(1) } } + ;(sync as any).chain = { blocks: { td: BigInt(1) } } const peers = [ - { eth: { status: { td: new BN(1) } }, inbound: false }, - { eth: { status: { td: new BN(2) } }, inbound: false }, + { eth: { status: { td: BigInt(1) } }, inbound: false }, + { eth: { status: { td: BigInt(2) } }, inbound: false }, ] ;(sync as any).pool = { peers } ;(sync as any).forceSync = true @@ -124,17 +123,17 @@ tape('[FullSynchronizer]', async (t) => { sync.latest = td.func() td.when(sync.best()).thenReturn('peer') td.when(sync.latest('peer' as any)).thenResolve({ - number: new BN(2), + number: BigInt(2), hash: () => Buffer.from([]), }) td.when(BlockFetcher.prototype.fetch(), { delay: 20, times: 2 }).thenResolve(undefined) - ;(sync as any).chain = { blocks: { height: new BN(3) } } + ;(sync as any).chain = { blocks: { height: BigInt(3) } } t.notOk(await sync.sync(), 'local height > remote height') ;(sync as any).chain = { - blocks: { height: new BN(0) }, + blocks: { height: BigInt(0) }, } setTimeout(() => { - config.events.emit(Event.SYNC_SYNCHRONIZED, new BN(0)) + config.events.emit(Event.SYNC_SYNCHRONIZED, BigInt(0)) }, 100) t.ok(await sync.sync(), 'local height < remote height') td.when(BlockFetcher.prototype.fetch()).thenReject(new Error('err0')) @@ -148,7 +147,6 @@ tape('[FullSynchronizer]', async (t) => { }) t.test('should send NewBlock/NewBlockHashes to right peers', async (t) => { - t.plan(9) const config = new Config({ transports: [] }) const pool = new PeerPool() as any const chain = new Chain({ config }) @@ -161,10 +159,10 @@ tape('[FullSynchronizer]', async (t) => { execution, }) ;(sync as any).fetcher = { - enqueueByNumberList: (blockNumberList: BN[], min: BN) => { - t.ok(blockNumberList[0].eqn(0), 'enqueueing the correct block in the Fetcher') + enqueueByNumberList: (blockNumberList: bigint[], min: bigint) => { + t.equal(blockNumberList[0], BigInt(0), 'enqueueing the correct block in the Fetcher') t.equal(blockNumberList.length, 1, 'correct number of blocks enqueued in Fetcher') - t.ok(min.eqn(0), 'correct start block number in Fetcher') + t.equal(min, BigInt(0), 'correct start block number in Fetcher') }, } @@ -173,7 +171,7 @@ tape('[FullSynchronizer]', async (t) => { { id: 'Peer 1', eth: { - status: { td: new BN(1) }, + status: { td: BigInt(1) }, send(name: string) { t.equal(name, 'NewBlock', 'sent NewBlock to Peer 1') }, @@ -183,7 +181,7 @@ tape('[FullSynchronizer]', async (t) => { { id: 'Peer 2', eth: { - status: { td: new BN(2) }, + status: { td: BigInt(2) }, send(name: string) { t.equal(name, 'NewBlockHashes', 'sent NewBlockHashes to Peer 2') timesSentToPeer2++ @@ -194,7 +192,7 @@ tape('[FullSynchronizer]', async (t) => { { id: 'Peer 3', eth: { - status: { td: new BN(3) }, + status: { td: BigInt(3) }, send() { t.fail('should not send announcement to peer3') }, @@ -216,13 +214,12 @@ tape('[FullSynchronizer]', async (t) => { }) chain.getLatestBlock = td.func() chain.putBlocks = td.func() - // NewBlock message from Peer 3 await sync.handleNewBlock(newBlock, peers[2] as any) - t.ok(config.syncTargetHeight?.eqn(0), 'sync target height should be set to 0') + t.equal(config.syncTargetHeight, BigInt(0), 'sync target height should be set to 0') await sync.handleNewBlock(newBlock) - t.ok(timesSentToPeer2 === 1, 'sent NewBlockHashes to Peer 2 once') + t.equal(timesSentToPeer2, 1, 'sent NewBlockHashes to Peer 2 once') t.pass('did not send NewBlock to Peer 3') ;(sync as any).chain._blocks = { latest: chainTip, diff --git a/packages/client/test/sync/lightsync.spec.ts b/packages/client/test/sync/lightsync.spec.ts index 31739891af8..a09404c36d4 100644 --- a/packages/client/test/sync/lightsync.spec.ts +++ b/packages/client/test/sync/lightsync.spec.ts @@ -1,6 +1,5 @@ import tape from 'tape' import td from 'testdouble' -import { BN } from 'ethereumjs-util' import { Config } from '../../lib/config' import { Chain } from '../../lib/blockchain' import { Event } from '../../lib/types' @@ -43,14 +42,14 @@ tape('[LightSynchronizer]', async (t) => { chain, }) ;(sync as any).running = true - ;(sync as any).chain = { headers: { td: new BN(1) } } + ;(sync as any).chain = { headers: { td: BigInt(1) } } const peers = [ { - les: { status: { headTd: new BN(1), headNum: new BN(1), serveHeaders: 1 } }, + les: { status: { headTd: BigInt(1), headNum: BigInt(1), serveHeaders: 1 } }, inbound: false, }, { - les: { status: { headTd: new BN(2), headNum: new BN(2), serveHeaders: 1 } }, + les: { status: { headTd: BigInt(2), headNum: BigInt(2), serveHeaders: 1 } }, inbound: false, }, ] @@ -73,17 +72,17 @@ tape('[LightSynchronizer]', async (t) => { }) sync.best = td.func() sync.latest = td.func() - td.when(sync.best()).thenReturn({ les: { status: { headNum: new BN(2) } } } as any) + td.when(sync.best()).thenReturn({ les: { status: { headNum: BigInt(2) } } } as any) td.when(sync.latest(td.matchers.anything())).thenResolve({ - number: new BN(2), + number: BigInt(2), hash: () => Buffer.from([]), }) td.when(HeaderFetcher.prototype.fetch(), { delay: 20, times: 2 }).thenResolve(undefined) - ;(sync as any).chain = { headers: { height: new BN(3) } } + ;(sync as any).chain = { headers: { height: BigInt(3) } } t.notOk(await sync.sync(), 'local height > remote height') - ;(sync as any).chain = { headers: { height: new BN(0) } } + ;(sync as any).chain = { headers: { height: BigInt(0) } } setTimeout(() => { - config.events.emit(Event.SYNC_SYNCHRONIZED, new BN(0)) + config.events.emit(Event.SYNC_SYNCHRONIZED, BigInt(0)) }, 100) t.ok(await sync.sync(), 'local height < remote height') td.when(HeaderFetcher.prototype.fetch()).thenReject(new Error('err0')) @@ -110,9 +109,9 @@ tape('[LightSynchronizer]', async (t) => { }) sync.best = td.func() sync.latest = td.func() - td.when(sync.best()).thenReturn({ les: { status: { headNum: new BN(2) } } } as any) + td.when(sync.best()).thenReturn({ les: { status: { headNum: BigInt(2) } } } as any) td.when(sync.latest(td.matchers.anything())).thenResolve({ - number: new BN(2), + number: BigInt(2), hash: () => Buffer.from([]), }) td.when(HeaderFetcher.prototype.fetch()).thenResolve(undefined) @@ -144,9 +143,9 @@ tape('[LightSynchronizer]', async (t) => { }) sync.best = td.func() sync.latest = td.func() - td.when(sync.best()).thenReturn({ les: { status: { headNum: new BN(2) } } } as any) + td.when(sync.best()).thenReturn({ les: { status: { headNum: BigInt(2) } } } as any) td.when(sync.latest(td.matchers.anything())).thenResolve({ - number: new BN(2), + number: BigInt(2), hash: () => Buffer.from([]), }) td.when(HeaderFetcher.prototype.fetch()).thenResolve(undefined) diff --git a/packages/client/test/sync/sync.spec.ts b/packages/client/test/sync/sync.spec.ts index 28830db0d86..597eb648135 100644 --- a/packages/client/test/sync/sync.spec.ts +++ b/packages/client/test/sync/sync.spec.ts @@ -1,6 +1,5 @@ import tape from 'tape' import td from 'testdouble' -import { BN } from 'ethereumjs-util' import { Config } from '../../lib/config' import { Chain } from '../../lib/blockchain' import { Synchronizer } from '../../lib/sync/sync' @@ -28,7 +27,7 @@ tape('[Synchronizer]', async (t) => { t.test('should sync', async (t) => { const config = new Config({ transports: [] }) - config.syncTargetHeight = new BN(1) + config.syncTargetHeight = new BigInt(1) const pool = new PeerPool() as any const chain = new Chain({ config }) const sync = new SynchronizerTest({ config, pool, chain }) @@ -45,8 +44,8 @@ tape('[Synchronizer]', async (t) => { void sync.start() ;(sync as any).chain._headers = { latest: { hash: () => Buffer.from([]) }, - td: new BN(0), - height: new BN(1), + td: BigInt(0), + height: BigInt(1), } config.events.emit(Event.CHAIN_UPDATED) await new Promise(() => {}) // resolves once t.end() is called diff --git a/packages/client/test/util/parse.spec.ts b/packages/client/test/util/parse.spec.ts index 622dc8a5e39..733a02d6252 100644 --- a/packages/client/test/util/parse.spec.ts +++ b/packages/client/test/util/parse.spec.ts @@ -127,7 +127,7 @@ tape('[Util/Parse]', (t) => { st.plan(2) const json = require('../testdata/geth-genesis/no-extra-data.json') const params = await parseCustomParams(json, 'noExtraData') - st.equals(params.genesis.extraData, '0x', 'extraData set to 0x') - st.equals(params.genesis.timestamp, '0x10', 'timestamp parsed correctly') + st.equal(params.genesis.extraData, '0x', 'extraData set to 0x') + st.equal(params.genesis.timestamp, '0x10', 'timestamp parsed correctly') }) }) diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index 017857579d5..579acf64925 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -1,6 +1,6 @@ import { EventEmitter } from 'events' import { buf as crc32Buffer } from 'crc-32' -import { BN, BNLike, toType, TypeOutput, intToBuffer } from 'ethereumjs-util' +import { BigIntLike, toType, TypeOutput, intToBuffer } from 'ethereumjs-util' import { hardforks as HARDFORK_CHANGES } from './hardforks' import { EIPs } from './eips' import { @@ -128,7 +128,7 @@ export interface CommonOpts extends BaseOpts { * either from a chain directly supported or a custom chain * passed in via {@link CommonOpts.customChains}. */ - chain: string | number | Chain | BN | object + chain: string | number | Chain | bigint | object /** * Initialize (in addition to the supported chains) with the selected * custom chains @@ -179,7 +179,7 @@ export interface CustomCommonOpts extends BaseOpts { * The name (`mainnet`), id (`1`), or {@link Chain} enum of * a standard chain used to base the custom chain params on. */ - baseChain?: string | number | Chain | BN + baseChain?: string | number | Chain | bigint } /** @@ -309,20 +309,20 @@ export default class Common extends EventEmitter { /** * Static method to determine if a {@link chainId} is supported as a standard chain - * @param chainId BN id (`1`) of a standard chain + * @param chainId bigint id (`1`) of a standard chain * @returns boolean */ - static isSupportedChainId(chainId: BN): boolean { + static isSupportedChainId(chainId: bigint): boolean { const initializedChains: any = this._getInitializedChains() return Boolean(initializedChains['names'][chainId.toString()]) } private static _getChainParams( - chain: string | number | Chain | BN, + chain: string | number | Chain | bigint, customChains?: IChain[] ): IChain { const initializedChains: any = this._getInitializedChains(customChains) - if (typeof chain === 'number' || BN.isBN(chain)) { + if (typeof chain === 'number' || typeof chain === 'bigint') { chain = chain.toString() if (initializedChains['names'][chain]) { @@ -369,8 +369,8 @@ export default class Common extends EventEmitter { * representation. Or, a Dictionary of chain parameters for a private network. * @returns The dictionary with parameters set as chain */ - setChain(chain: string | number | Chain | BN | object): any { - if (typeof chain === 'number' || typeof chain === 'string' || BN.isBN(chain)) { + setChain(chain: string | number | Chain | bigint | object): any { + if (typeof chain === 'number' || typeof chain === 'bigint' || typeof chain === 'string') { // Filter out genesis states if passed in to customChains let plainCustomChains: IChain[] if ( @@ -386,7 +386,7 @@ export default class Common extends EventEmitter { } else if (typeof chain === 'object') { if (this._customChains.length > 0) { throw new Error( - 'Chain must be a string, number, or BN when initialized with customChains passed in' + 'Chain must be a string, number, or bigint when initialized with customChains passed in' ) } const required = ['networkId', 'genesis', 'hardforks', 'bootstrapNodes'] @@ -434,9 +434,9 @@ export default class Common extends EventEmitter { * @param td * @returns The name of the HF */ - getHardforkByBlockNumber(blockNumber: BNLike, td?: BNLike): string { - blockNumber = toType(blockNumber, TypeOutput.BN) - td = toType(td, TypeOutput.BN) + getHardforkByBlockNumber(blockNumber: BigIntLike, td?: BigIntLike): string { + blockNumber = toType(blockNumber, TypeOutput.BigInt) + td = toType(td, TypeOutput.BigInt) let hardfork = Hardfork.Chainstart let minTdHF @@ -446,17 +446,17 @@ export default class Common extends EventEmitter { // Skip comparison for not applied HFs if (hf.block === null) { if (td !== undefined && td !== null && hf.td !== undefined && hf.td !== null) { - if (td.gte(new BN(hf.td))) { + if (td >= BigInt(hf.td)) { return hf.name } } continue } - if (blockNumber.gte(new BN(hf.block))) { + if (blockNumber >= BigInt(hf.block)) { hardfork = hf.name as Hardfork } if (td && hf.td) { - if (td.gte(new BN(hf.td))) { + if (td >= BigInt(hf.td)) { minTdHF = hf.name } else { maxTdHF = previousHF @@ -496,7 +496,7 @@ export default class Common extends EventEmitter { * @param td * @returns The name of the HF set */ - setHardforkByBlockNumber(blockNumber: BNLike, td?: BNLike): string { + setHardforkByBlockNumber(blockNumber: BigIntLike, td?: BigIntLike): string { const hardfork = this.getHardforkByBlockNumber(blockNumber, td) this.setHardfork(hardfork) return hardfork @@ -627,7 +627,7 @@ export default class Common extends EventEmitter { * @param blockNumber Block number * @param td Total difficulty */ - paramByBlock(topic: string, name: string, blockNumber: BNLike, td?: BNLike): any { + paramByBlock(topic: string, name: string, blockNumber: BigIntLike, td?: BigIntLike): any { const hardfork = this.getHardforkByBlockNumber(blockNumber, td) return this.paramByHardfork(topic, name, hardfork) } @@ -662,11 +662,11 @@ export default class Common extends EventEmitter { * @param blockNumber * @returns True if HF is active on block number */ - hardforkIsActiveOnBlock(hardfork: string | Hardfork | null, blockNumber: BNLike): boolean { - blockNumber = toType(blockNumber, TypeOutput.BN) + hardforkIsActiveOnBlock(hardfork: string | Hardfork | null, blockNumber: BigIntLike): boolean { + blockNumber = toType(blockNumber, TypeOutput.BigInt) hardfork = hardfork ?? this._hardfork const hfBlock = this.hardforkBlock(hardfork) - if (hfBlock && blockNumber.gte(hfBlock)) { + if (hfBlock && blockNumber >= hfBlock) { return true } return false @@ -677,7 +677,7 @@ export default class Common extends EventEmitter { * @param blockNumber * @returns True if HF is active on block number */ - activeOnBlock(blockNumber: BNLike): boolean { + activeOnBlock(blockNumber: BigIntLike): boolean { return this.hardforkIsActiveOnBlock(null, blockNumber) } @@ -717,13 +717,13 @@ export default class Common extends EventEmitter { * @param hardfork Hardfork name, optional if HF set * @returns Block number or null if unscheduled */ - hardforkBlock(hardfork?: string | Hardfork): BN | null { + hardforkBlock(hardfork?: string | Hardfork): bigint | null { hardfork = hardfork ?? this._hardfork const block = this._getHardfork(hardfork)?.['block'] if (block === undefined || block === null) { return null } - return new BN(block) + return BigInt(block) } /** @@ -731,13 +731,13 @@ export default class Common extends EventEmitter { * @param hardfork Hardfork name, optional if HF set * @returns Total difficulty or null if no set */ - hardforkTD(hardfork?: string | Hardfork): BN | null { + hardforkTD(hardfork?: string | Hardfork): bigint | null { hardfork = hardfork ?? this._hardfork const td = this._getHardfork(hardfork)?.['td'] if (td === undefined || td === null) { return null } - return new BN(td) + return BigInt(td) } /** @@ -746,11 +746,11 @@ export default class Common extends EventEmitter { * @param hardfork Hardfork name, optional if HF set * @returns True if blockNumber is HF block */ - isHardforkBlock(blockNumber: BNLike, hardfork?: string | Hardfork): boolean { - blockNumber = toType(blockNumber, TypeOutput.BN) + isHardforkBlock(blockNumber: BigIntLike, hardfork?: string | Hardfork): boolean { + blockNumber = toType(blockNumber, TypeOutput.BigInt) hardfork = hardfork ?? this._hardfork const block = this.hardforkBlock(hardfork) - return block ? block.eq(blockNumber) : false + return block ? block === blockNumber : false } /** @@ -758,7 +758,7 @@ export default class Common extends EventEmitter { * @param hardfork Hardfork name, optional if HF set * @returns Block number or null if not available */ - nextHardforkBlock(hardfork?: string | Hardfork): BN | null { + nextHardforkBlock(hardfork?: string | Hardfork): bigint | null { hardfork = hardfork ?? this._hardfork const hfBlock = this.hardforkBlock(hardfork) if (hfBlock === null) { @@ -768,9 +768,9 @@ export default class Common extends EventEmitter { // Logic: if accumulator is still null and on the first occurrence of // a block greater than the current hfBlock set the accumulator, // pass on the accumulator as the final result from this time on - const nextHfBlock = this.hardforks().reduce((acc: BN | null, hf: HardforkParams) => { - const block = new BN(hf.block!) - return block.gt(hfBlock) && acc === null ? block : acc + const nextHfBlock = this.hardforks().reduce((acc: bigint | null, hf: HardforkParams) => { + const block = BigInt(hf.block === null ? 0 : hf.block) + return block > hfBlock && acc === null ? block : acc }, null) return nextHfBlock } @@ -781,12 +781,12 @@ export default class Common extends EventEmitter { * @param hardfork Hardfork name, optional if HF set * @returns True if blockNumber is HF block */ - isNextHardforkBlock(blockNumber: BNLike, hardfork?: string | Hardfork): boolean { - blockNumber = toType(blockNumber, TypeOutput.BN) + isNextHardforkBlock(blockNumber: BigIntLike, hardfork?: string | Hardfork): boolean { + blockNumber = toType(blockNumber, TypeOutput.BigInt) hardfork = hardfork ?? this._hardfork const nextHardforkBlock = this.nextHardforkBlock(hardfork) - return nextHardforkBlock === null ? false : nextHardforkBlock.eq(blockNumber) + return nextHardforkBlock === null ? false : nextHardforkBlock === blockNumber } /** @@ -934,8 +934,8 @@ export default class Common extends EventEmitter { * Returns the Id of current chain * @returns chain Id */ - chainId(): BN { - return new BN(this._chainParams['chainId']) + chainId(): bigint { + return BigInt(this._chainParams['chainId']) } /** @@ -950,8 +950,8 @@ export default class Common extends EventEmitter { * Returns the Id of current network * @returns network Id */ - networkId(): BN { - return new BN(this._chainParams['networkId']) + networkId(): bigint { + return BigInt(this._chainParams['networkId']) } /** diff --git a/packages/common/src/types.ts b/packages/common/src/types.ts index b96e4ccd831..e56890ef1d9 100644 --- a/packages/common/src/types.ts +++ b/packages/common/src/types.ts @@ -1,4 +1,4 @@ -import { BN, PrefixedHexString } from 'ethereumjs-util' +import { PrefixedHexString } from 'ethereumjs-util' import { ConsensusAlgorithm, ConsensusType, Hardfork as HardforkName } from '.' export interface genesisStatesType { @@ -17,8 +17,8 @@ export interface chainsType { export interface Chain { name: string - chainId: number | BN - networkId: number | BN + chainId: number | bigint + networkId: number | bigint // TODO: make mandatory in next breaking release defaultHardfork?: string comment: string diff --git a/packages/common/tests/chains.spec.ts b/packages/common/tests/chains.spec.ts index cdd6b66551d..711d75d389e 100644 --- a/packages/common/tests/chains.spec.ts +++ b/packages/common/tests/chains.spec.ts @@ -1,13 +1,12 @@ import tape from 'tape' import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '../src/' -import { BN } from 'ethereumjs-util' tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { t.test('Should initialize with chain provided', function (st: tape.Test) { let c = new Common({ chain: 'mainnet' }) st.equal(c.chainName(), 'mainnet', 'should initialize with chain name') - st.ok(c.chainId().eqn(1), 'should return correct chain Id') - st.ok(c.networkId().eqn(1), 'should return correct network Id') + st.equal(c.chainId(), BigInt(1), 'should return correct chain Id') + st.equal(c.networkId(), BigInt(1), 'should return correct network Id') st.equal(c.hardfork(), Hardfork.London, 'should set hardfork to current default hardfork') st.equal( c.hardfork(), @@ -24,8 +23,8 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { t.test('Should initialize with chain provided by Chain enum', function (st: tape.Test) { const c = new Common({ chain: Chain.Mainnet }) st.equal(c.chainName(), 'mainnet', 'should initialize with chain name') - st.ok(c.chainId().eqn(1), 'should return correct chain Id') - st.ok(c.networkId().eqn(1), 'should return correct network Id') + st.equal(c.chainId(), BigInt(1), 'should return correct chain Id') + st.equal(c.networkId(), BigInt(1), 'should return correct network Id') st.equal(c.hardfork(), Hardfork.London, 'should set hardfork to current default hardfork') st.equal( c.hardfork(), @@ -193,12 +192,12 @@ tape('[Common/Chains]: Initialization / Chain params', function (t: tape.Test) { tape('[Common]: isSupportedChainId static method', function (t: tape.Test) { t.test('Should return true for supported chainId', function (st: tape.Test) { - st.equal(Common.isSupportedChainId(new BN(1)), true, 'returns true') + st.equal(Common.isSupportedChainId(BigInt(1)), true, 'returns true') st.end() }) t.test('Should return false for unsupported chainId', function (st: tape.Test) { - st.equal(Common.isSupportedChainId(new BN(0)), false, 'returns false') + st.equal(Common.isSupportedChainId(BigInt(0)), false, 'returns false') st.end() }) }) diff --git a/packages/common/tests/customChains.spec.ts b/packages/common/tests/customChains.spec.ts index 7c31556b491..7d7f2046e6b 100644 --- a/packages/common/tests/customChains.spec.ts +++ b/packages/common/tests/customChains.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import Common, { Chain, ConsensusType, CustomChain, Hardfork } from '../src/' import testnet from './data/testnet.json' import testnet2 from './data/testnet2.json' @@ -13,8 +12,8 @@ tape('[Common]: Custom chains', function (t: tape.Test) { function (st: tape.Test) { const c = new Common({ chain: testnet, hardfork: Hardfork.Byzantium }) st.equal(c.chainName(), 'testnet', 'should initialize with chain name') - st.ok(c.chainId().eqn(12345), 'should return correct chain Id') - st.ok(c.networkId().eqn(12345), 'should return correct network Id') + st.equal(c.chainId(), BigInt(12345), 'should return correct chain Id') + st.equal(c.networkId(), BigInt(12345), 'should return correct network Id') st.equal( c.genesis().hash, '0xaa00000000000000000000000000000000000000000000000000000000000000', @@ -52,8 +51,8 @@ tape('[Common]: Custom chains', function (t: tape.Test) { // From custom chain params st.equal(customChainCommon.chainName(), customChainParams.name) - st.ok(customChainCommon.chainId().eqn(customChainParams.chainId)) - st.ok(customChainCommon.networkId().eqn(customChainParams.networkId)) + st.equal(customChainCommon.chainId(), BigInt(customChainParams.chainId)) + st.equal(customChainCommon.networkId(), BigInt(customChainParams.networkId)) // Fallback params from mainnet st.equal(customChainCommon.genesis(), mainnetCommon.genesis()) @@ -68,13 +67,13 @@ tape('[Common]: Custom chains', function (t: tape.Test) { t.test('custom() -> behavior', function (st: tape.Test) { let common = Common.custom({ chainId: 123 }) - st.deepEqual(common.networkId(), new BN(1), 'should default to mainnet base chain') + st.deepEqual(common.networkId(), BigInt(1), 'should default to mainnet base chain') st.equal(common.chainName(), 'custom-chain', 'should set default custom chain name') common = Common.custom(CustomChain.PolygonMumbai) st.deepEqual( common.networkId(), - new BN(80001), + BigInt(80001), 'supported chain -> should initialize with correct chain ID' ) for (const customChain of Object.values(CustomChain)) { @@ -121,7 +120,7 @@ tape('[Common]: Custom chains', function (t: tape.Test) { } catch (e: any) { st.ok( e.message.includes( - 'Chain must be a string, number, or BN when initialized with customChains passed in' + 'Chain must be a string, number, or bigint when initialized with customChains passed in' ), 'should throw an exception on wrong initialization' ) @@ -137,11 +136,11 @@ tape('[Common]: Custom chains', function (t: tape.Test) { customChains: [testnet], }) st.equal(c.chainName(), 'mainnet', 'customChains, chain set to supported chain') - st.ok(c.hardforkBlock()!.eqn(4370000), 'customChains, chain set to supported chain') + st.equal(c.hardforkBlock()!, BigInt(4370000), 'customChains, chain set to supported chain') c.setChain('testnet') st.equal(c.chainName(), 'testnet', 'customChains, chain switched to custom chain') - st.ok(c.hardforkBlock()!.eqn(4), 'customChains, chain switched to custom chain') + st.equal(c.hardforkBlock()!, BigInt(4), 'customChains, chain switched to custom chain') c = new Common({ chain: 'testnet', @@ -149,7 +148,7 @@ tape('[Common]: Custom chains', function (t: tape.Test) { customChains: [testnet], }) st.equal(c.chainName(), 'testnet', 'customChains, chain initialized with custom chain') - st.ok(c.hardforkBlock()!.eqn(4), 'customChains, chain initialized with custom chain') + st.equal(c.hardforkBlock()!, BigInt(4), 'customChains, chain initialized with custom chain') st.deepEqual( c.genesisState(), {}, @@ -163,7 +162,7 @@ tape('[Common]: Custom chains', function (t: tape.Test) { customChains, }) st.equal(c.chainName(), 'testnet2', 'customChains, chain initialized with custom chain') - st.ok(c.hardforkBlock()!.eqn(10), 'customChains, chain initialized with custom chain') + st.equal(c.hardforkBlock()!, BigInt(10), 'customChains, chain initialized with custom chain') c.setChain('testnet') st.equal(c.chainName(), 'testnet', 'customChains, should allow to switch custom chain') diff --git a/packages/common/tests/hardforks.spec.ts b/packages/common/tests/hardforks.spec.ts index 9894a5fb338..a5092f20804 100644 --- a/packages/common/tests/hardforks.spec.ts +++ b/packages/common/tests/hardforks.spec.ts @@ -1,5 +1,4 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '../src' tape('[Common]: Hardfork logic', function (t: tape.Test) { @@ -73,18 +72,18 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('hardforkBlock()', function (st: tape.Test) { let c = new Common({ chain: Chain.Ropsten }) let msg = 'should return the correct HF change block for byzantium (provided)' - st.ok(c.hardforkBlock(Hardfork.Byzantium)!.eqn(1700000), msg) + st.equal(c.hardforkBlock(Hardfork.Byzantium)!, BigInt(1700000), msg) msg = 'should return null if HF does not exist on chain' st.equal(c.hardforkBlock('thisHardforkDoesNotExist'), null, msg) c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) msg = 'should return the correct HF change block for byzantium (set)' - st.ok(c.hardforkBlock()!.eqn(1700000), msg) + st.equal(c.hardforkBlock()!, BigInt(1700000), msg) c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Istanbul }) msg = 'should return the correct HF change block for istanbul (set)' - st.ok(c.hardforkBlock()!.eqn(6485846), msg) + st.equal(c.hardforkBlock()!, BigInt(6485846), msg) st.end() }) @@ -111,14 +110,14 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { let c = new Common({ chain: Chain.Rinkeby, hardfork: Hardfork.Chainstart }) let msg = 'should work with HF set / return correct next HF block for chainstart (rinkeby: chainstart -> homestead)' - st.ok(c.nextHardforkBlock()!.eqn(1), msg) + st.equal(c.nextHardforkBlock()!, BigInt(1), msg) msg = 'should correctly skip a HF where block is set to null (rinkeby: homestead -> (dao) -> tangerineWhistle)' - st.ok(c.nextHardforkBlock('homestead')!.eqn(2), msg) + st.equal(c.nextHardforkBlock('homestead')!, BigInt(2), msg) msg = 'should return correct next HF (rinkeby: byzantium -> constantinople)' - st.ok(c.nextHardforkBlock(Hardfork.Byzantium)!.eqn(3660663), msg) + st.equal(c.nextHardforkBlock(Hardfork.Byzantium)!, BigInt(3660663), msg) msg = 'should return null if next HF is not available (rinkeby: london -> shanghai)' st.equal(c.nextHardforkBlock(Hardfork.London), null, msg) @@ -126,7 +125,7 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { msg = 'should work correctly along the need to skip several forks (ropsten: chainstart -> (homestead) -> (dao) -> (tangerineWhistle) -> spuriousDragon)' c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Chainstart }) - st.ok(c.nextHardforkBlock()!.eqn(10), msg) + st.equal(c.nextHardforkBlock()!, BigInt(10), msg) st.end() }) @@ -184,8 +183,8 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { const c = new Common({ chain: Chain.Mainnet }) let msg = 'should return correct value' - st.ok(c.hardforkBlock(Hardfork.Berlin)!.eqn(12244000), msg) - st.ok(c.hardforkBlock(Hardfork.Berlin)!.eq(new BN(12244000)), msg) + st.equal(c.hardforkBlock(Hardfork.Berlin)!, BigInt(12244000), msg) + st.equal(c.hardforkBlock(Hardfork.Berlin)!, BigInt(12244000), msg) msg = 'should return null for unscheduled hardfork' // developer note: when Shanghai is set, diff --git a/packages/common/tests/mergePOS.spec.ts b/packages/common/tests/mergePOS.spec.ts index ac42cd774c3..67f150667e8 100644 --- a/packages/common/tests/mergePOS.spec.ts +++ b/packages/common/tests/mergePOS.spec.ts @@ -7,7 +7,7 @@ tape('[Common]: Merge/POS specific logic', function (t: tape.Test) { t.test('hardforkTD()', function (st: tape.Test) { const customChains = [testnetMerge] const c = new Common({ chain: 'testnetMerge', hardfork: Hardfork.Istanbul, customChains }) - st.ok(c.hardforkTD(Hardfork.Merge)?.eqn(5000), 'should get the HF total difficulty') + st.equal(c.hardforkTD(Hardfork.Merge), BigInt(5000), 'should get the HF total difficulty') st.equal( c.hardforkTD('thisHardforkDoesNotExist'), null, @@ -179,7 +179,7 @@ tape('[Common]: Merge/POS specific logic', function (t: tape.Test) { const customChains = [testnetPOS] const c = new Common({ chain: 'testnetPOS', hardfork: Hardfork.Istanbul, customChains }) - st.ok(c.hardforkTD(Hardfork.Chainstart)?.eqn(0), 'should get the HF total difficulty') + st.equal(c.hardforkTD(Hardfork.Chainstart), BigInt(0), 'should get the HF total difficulty') const msg = 'block number > last HF block number set, TD set (0) and equal' st.equal(c.getHardforkByBlockNumber(5, 0), 'shanghai', msg) diff --git a/packages/common/tests/params.spec.ts b/packages/common/tests/params.spec.ts index f060ea052d0..d823dd3308f 100644 --- a/packages/common/tests/params.spec.ts +++ b/packages/common/tests/params.spec.ts @@ -1,6 +1,5 @@ import tape from 'tape' import Common, { Chain, Hardfork } from '../src/' -import { BN } from 'ethereumjs-util' tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: tape.Test) { t.test('Basic usage', function (st: tape.Test) { @@ -74,7 +73,7 @@ tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: t st.equal(c.paramByBlock('pow', 'minerReward', 4369999), '5000000000000000000', msg) msg = 'Should correctly translate total difficulty into HF states' - const td = new BN('1196768507891266117779') + const td = BigInt('1196768507891266117779') st.equal(c.paramByBlock('pow', 'minerReward', 4370000, td), '3000000000000000000', msg) st.comment('-----------------------------------------------------------------') diff --git a/packages/devp2p/examples/peer-communication-les.ts b/packages/devp2p/examples/peer-communication-les.ts index 2663340d83f..f73cce0128c 100644 --- a/packages/devp2p/examples/peer-communication-les.ts +++ b/packages/devp2p/examples/peer-communication-les.ts @@ -191,7 +191,7 @@ dpt.addPeer({ address: '127.0.0.1', udpPort: 30303, tcpPort: 30303 }) function onNewBlock(block: Block, peer: Peer) { const blockHashHex = block.hash().toString('hex') - const blockNumber = block.header.number.toNumber() + const blockNumber = block.header.number console.log( `----------------------------------------------------------------------------------------------------------` diff --git a/packages/devp2p/examples/peer-communication.ts b/packages/devp2p/examples/peer-communication.ts index 81cb2314807..6c9b8c1336c 100644 --- a/packages/devp2p/examples/peer-communication.ts +++ b/packages/devp2p/examples/peer-communication.ts @@ -339,17 +339,13 @@ function onNewTx(tx: TypedTransaction, peer: Peer) { const blocksCache = new LRUCache({ max: 100 }) function onNewBlock(block: Block, peer: Peer) { const blockHashHex = block.hash().toString('hex') - const blockNumber = block.header.number.toNumber() + const blockNumber = block.header.number if (blocksCache.has(blockHashHex)) return blocksCache.set(blockHashHex, true) - console.log( - `----------------------------------------------------------------------------------------------------------` - ) + console.log() console.log(`New block ${blockNumber}: ${blockHashHex} (from ${getPeerAddr(peer)})`) - console.log( - `----------------------------------------------------------------------------------------------------------` - ) + console.log('-'.repeat(105)) for (const tx of block.transactions) onNewTx(tx, peer) } diff --git a/packages/devp2p/src/protocol/eth.ts b/packages/devp2p/src/protocol/eth.ts index df0434b362e..348ad987076 100644 --- a/packages/devp2p/src/protocol/eth.ts +++ b/packages/devp2p/src/protocol/eth.ts @@ -1,6 +1,6 @@ import assert from 'assert' import snappy from 'snappyjs' -import { BN, rlp } from 'ethereumjs-util' +import { bufferToBigInt, bufferToHex, rlp, bigIntToBuffer } from 'ethereumjs-util' import { int2buffer, buffer2int, assertEq, formatLogId, formatLogData } from '../util' import { Peer } from '../rlpx/peer' import { EthProtocol, Protocol, SendMethod } from './protocol' @@ -10,10 +10,10 @@ export class ETH extends Protocol { _peerStatus: ETH.StatusMsg | null = null // Eth64 - _hardfork = 'chainstart' - _latestBlock = new BN(0) - _forkHash = '' - _nextForkBlock = new BN(0) + _hardfork: string = 'chainstart' + _latestBlock = BigInt(0) + _forkHash: string = '' + _nextForkBlock = BigInt(0) constructor(version: number, peer: Peer, send: SendMethod) { super(peer, send, EthProtocol.ETH, version, ETH.MESSAGE_CODES) @@ -24,10 +24,10 @@ export class ETH extends Protocol { this._hardfork = c.hardfork() ? c.hardfork() : this._hardfork // Set latestBlock minimally to start block of fork to have some more // accurate basis if no latestBlock is provided along status send - this._latestBlock = c.hardforkBlock(this._hardfork) ?? new BN(0) + this._latestBlock = c.hardforkBlock(this._hardfork) ?? BigInt(0) this._forkHash = c.forkHash(this._hardfork) // Next fork block number or 0 if none available - this._nextForkBlock = c.nextHardforkBlock(this._hardfork) ?? new BN(0) + this._nextForkBlock = c.nextHardforkBlock(this._hardfork) ?? BigInt(0) } } @@ -99,13 +99,13 @@ export class ETH extends Protocol { _validateForkId(forkId: Buffer[]) { const c = this._peer._common - const peerForkHash = `0x${forkId[0].toString('hex')}` - const peerNextFork = new BN(forkId[1]) + const peerForkHash = bufferToHex(forkId[0]) + const peerNextFork = bufferToBigInt(forkId[1]) if (this._forkHash === peerForkHash) { // There is a known next fork - if (!peerNextFork.isZero()) { - if (this._latestBlock.gte(peerNextFork)) { + if (peerNextFork > BigInt(0)) { + if (this._latestBlock >= peerNextFork) { const msg = 'Remote is advertising a future fork that passed locally' this.debug('STATUS', msg) throw new assert.AssertionError({ message: msg }) @@ -121,7 +121,7 @@ export class ETH extends Protocol { if (!c.hardforkGteHardfork(peerFork.name, this._hardfork)) { const nextHardforkBlock = c.nextHardforkBlock(peerFork.name) - if (peerNextFork === null || !nextHardforkBlock || !nextHardforkBlock.eq(peerNextFork)) { + if (peerNextFork === null || !nextHardforkBlock || nextHardforkBlock !== peerNextFork) { const msg = 'Outdated fork status, remote needs software update' this.debug('STATUS', msg) throw new assert.AssertionError({ message: msg }) @@ -214,15 +214,15 @@ export class ETH extends Protocol { if (this._status !== null) return this._status = [ int2buffer(this._version), - this._peer._common.chainId().toArrayLike(Buffer), + bigIntToBuffer(this._peer._common.chainId()), status.td, status.bestHash, status.genesisHash, ] if (this._version >= 64) { if (status.latestBlock) { - const latestBlock = new BN(status.latestBlock) - if (latestBlock.lt(this._latestBlock)) { + const latestBlock = bufferToBigInt(status.latestBlock) + if (latestBlock < this._latestBlock) { throw new Error( 'latest block provided is not matching the HF setting of the Common instance (Rlpx)' ) @@ -231,9 +231,10 @@ export class ETH extends Protocol { } const forkHashB = Buffer.from(this._forkHash.substr(2), 'hex') - const nextForkB = this._nextForkBlock.eqn(0) - ? Buffer.from('', 'hex') - : this._nextForkBlock.toArrayLike(Buffer) + const nextForkB = + this._nextForkBlock === BigInt(0) + ? Buffer.from('', 'hex') + : bigIntToBuffer(this._nextForkBlock) this._status.push([forkHashB, nextForkB]) } @@ -315,7 +316,7 @@ export namespace ETH { export type StatusOpts = { td: Buffer bestHash: Buffer - latestBlock?: number + latestBlock?: Buffer genesisHash: Buffer } diff --git a/packages/devp2p/src/protocol/les.ts b/packages/devp2p/src/protocol/les.ts index a1b5345faeb..2c5bc46165f 100644 --- a/packages/devp2p/src/protocol/les.ts +++ b/packages/devp2p/src/protocol/les.ts @@ -1,5 +1,5 @@ +import { bigIntToBuffer, rlp } from 'ethereumjs-util' import ms from 'ms' -import { rlp } from 'ethereumjs-util' import snappy from 'snappyjs' import { int2buffer, buffer2int, assertEq, formatLogData } from '../util' import { Peer, DISCONNECT_REASONS } from '../rlpx/peer' @@ -154,7 +154,7 @@ export class LES extends Protocol { status['announceType'] = int2buffer(DEFAULT_ANNOUNCE_TYPE) } status['protocolVersion'] = int2buffer(this._version) - status['networkId'] = this._peer._common.chainId().toArrayLike(Buffer) + status['networkId'] = bigIntToBuffer(this._peer._common.chainId()) this._status = status diff --git a/packages/ethash/package.json b/packages/ethash/package.json index 0f8ab8d7cd5..ff51302d774 100644 --- a/packages/ethash/package.json +++ b/packages/ethash/package.json @@ -18,6 +18,8 @@ "types": "dist/index.d.ts", "browser": "dist.browser/index.js", "scripts": { + "postinstall": "npm run depBrowserWorkaround", + "depBrowserWorkaround": "npx json -I -f ../../node_modules/bigint-crypto-utils/package.json -e \"this.browser='./dist/bundles/umd.js'\"", "build": "npm run build:node && npm run build:browser", "build:node": "../../config/cli/ts-build.sh node", "build:browser": "../../config/cli/ts-build.sh browser", @@ -33,9 +35,9 @@ "dependencies": { "@ethereumjs/block": "^3.6.2", "@types/levelup": "^4.3.0", + "bigint-crypto-utils": "^3.0.23", "buffer-xor": "^2.0.1", - "ethereumjs-util": "^7.1.4", - "miller-rabin": "^4.0.0" + "ethereumjs-util": "^7.1.4" }, "devDependencies": { "@ethereumjs/common": "^2.6.4", diff --git a/packages/ethash/src/index.ts b/packages/ethash/src/index.ts index 48bfed6d8b7..7249fd86662 100644 --- a/packages/ethash/src/index.ts +++ b/packages/ethash/src/index.ts @@ -1,4 +1,13 @@ -import { BN, keccak, keccak256, rlphash, zeros, TWO_POW256 } from 'ethereumjs-util' +import { + keccak, + keccak256, + rlphash, + zeros, + TWO_POW256, + bigIntToBuffer, + bufferToBigInt, + setLengthLeft, +} from 'ethereumjs-util' import { params, fnv, @@ -26,7 +35,7 @@ export class Miner { public solution?: Solution - private currentNonce: BN + private currentNonce: bigint private headerHash?: Buffer private stopMining: boolean @@ -45,7 +54,7 @@ export class Miner { } else { throw new Error('unsupported mineObject') } - this.currentNonce = new BN(0) + this.currentNonce = BigInt(0) this.ethash = ethash this.stopMining = false } @@ -96,29 +105,29 @@ export class Miner { const headerHash = this.headerHash const { number, difficulty } = this.blockHeader - await this.ethash.loadEpoc(number.toNumber()) - const self = this - while (iterations != 0 && !this.stopMining) { + await this.ethash.loadEpoc(number) + + while (iterations !== 0 && !this.stopMining) { // The promise/setTimeout construction is necessary to ensure we jump out of the event loop // Without this, for high-difficulty blocks JS never jumps out of the Promise const solution = await new Promise((resolve) => { - setTimeout(function () { - const nonce = self.currentNonce.toBuffer(undefined, 8) + setTimeout(() => { + const nonce = setLengthLeft(bigIntToBuffer(this.currentNonce), 8) - const a = self.ethash.run(headerHash, nonce) - const result = new BN(a.hash) + const a = this.ethash.run(headerHash, nonce) + const result = bufferToBigInt(a.hash) - if (TWO_POW256.div(difficulty).cmp(result) === 1) { + if (TWO_POW256 / difficulty > result) { const solution: Solution = { - mixHash: a.mix, + mixHash: a.mix, nonce, } - self.solution = solution + this.solution = solution resolve(solution) return } - self.currentNonce.iaddn(1) + this.currentNonce++ iterations-- resolve(null) @@ -150,9 +159,7 @@ export default class Ethash { } mkcache(cacheSize: number, seed: Buffer) { - // console.log('generating cache') - // console.log('size: ' + cacheSize) - // console.log('seed: ' + seed.toString('hex')) + // console.log(`generating cache\nsize: ${cacheSize}\nseed: ${seed.toString('hex')}`) const n = Math.floor(cacheSize / params.HASH_BYTES) const o = [keccak(seed, 512)] @@ -235,7 +242,7 @@ export default class Ethash { /** * Loads the seed and cache given a block number. */ - async loadEpoc(number: number) { + async loadEpoc(number: bigint) { const epoc = getEpoc(number) if (this.epoc === epoc) { @@ -278,8 +285,8 @@ export default class Ethash { } if (!data) { - this.cacheSize = getCacheSize(epoc) - this.fullSize = getFullSize(epoc) + this.cacheSize = await getCacheSize(epoc) + this.fullSize = await getFullSize(epoc) const [seed, foundEpoc] = await findLastSeed(epoc) this.seed = getSeed(seed, foundEpoc, epoc) @@ -296,7 +303,6 @@ export default class Ethash { this.dbOpts ) } else { - // Object.assign(this, data) this.cache = data.cache.map((a: Buffer) => { return Buffer.from(a) }) @@ -320,11 +326,11 @@ export default class Ethash { const headerHash = this.headerHash(header.raw()) const { number, difficulty, mixHash, nonce } = header - await this.loadEpoc(number.toNumber()) + await this.loadEpoc(number) const a = this.run(headerHash, nonce) - const result = new BN(a.hash) + const result = bufferToBigInt(a.hash) - return a.mix.equals(mixHash) && TWO_POW256.div(difficulty).cmp(result) === 1 + return a.mix.equals(mixHash) && TWO_POW256 / difficulty > result } async verifyPOW(block: Block) { diff --git a/packages/ethash/src/util.ts b/packages/ethash/src/util.ts index e208670836f..5a45e899460 100644 --- a/packages/ethash/src/util.ts +++ b/packages/ethash/src/util.ts @@ -1,5 +1,5 @@ -import { BN, keccak256 } from 'ethereumjs-util' -const MR = require('miller-rabin') +import { isProbablyPrime } from 'bigint-crypto-utils' +import { keccak256 } from 'ethereumjs-util' export const params = { DATASET_BYTES_INIT: 1073741824, // 2^30 @@ -16,32 +16,28 @@ export const params = { WORD_BYTES: 4, } -export function getCacheSize(epoc: number) { - const mr = new MR() - let sz = - (exports.params.CACHE_BYTES_INIT as number) + - (exports.params.CACHE_BYTES_GROWTH as number) * epoc - sz -= exports.params.HASH_BYTES - while (!mr.test(new BN(sz / exports.params.HASH_BYTES))) { - sz -= 2 * exports.params.HASH_BYTES +export async function getCacheSize(epoc: number) { + const { CACHE_BYTES_INIT, CACHE_BYTES_GROWTH, HASH_BYTES } = params + let sz = CACHE_BYTES_INIT + CACHE_BYTES_GROWTH * epoc + sz -= HASH_BYTES + while (!(await isProbablyPrime(sz / HASH_BYTES, undefined, true))) { + sz -= 2 * HASH_BYTES } return sz } -export function getFullSize(epoc: number) { - const mr = new MR() - let sz = - (exports.params.DATASET_BYTES_INIT as number) + - (exports.params.DATASET_BYTES_GROWTH as number) * epoc - sz -= exports.params.MIX_BYTES - while (!mr.test(new BN(sz / exports.params.MIX_BYTES))) { - sz -= 2 * exports.params.MIX_BYTES +export async function getFullSize(epoc: number) { + const { DATASET_BYTES_INIT, DATASET_BYTES_GROWTH, MIX_BYTES } = params + let sz = DATASET_BYTES_INIT + DATASET_BYTES_GROWTH * epoc + sz -= MIX_BYTES + while (!(await isProbablyPrime(sz / MIX_BYTES, undefined, true))) { + sz -= 2 * MIX_BYTES } return sz } -export function getEpoc(blockNumber: number) { - return Math.floor(blockNumber / exports.params.EPOCH_LENGTH) +export function getEpoc(blockNumber: bigint) { + return Number(blockNumber / BigInt(params.EPOCH_LENGTH)) } /** diff --git a/packages/ethash/test/ethash.spec.ts b/packages/ethash/test/ethash.spec.ts index c0e141c6e8f..a477d6ae466 100644 --- a/packages/ethash/test/ethash.spec.ts +++ b/packages/ethash/test/ethash.spec.ts @@ -9,17 +9,17 @@ const ethash = new Ethash() const tests = Object.keys(powTests) const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) -tape('POW tests', function (t) { - tests.forEach(function (key) { +tape('POW tests', async function (t) { + for (const key of tests) { const test = powTests[key] const header = BlockHeader.fromRLPSerializedHeader(Buffer.from(test.header, 'hex'), { common }) const headerHash = ethash.headerHash(header.raw()) t.equal(headerHash.toString('hex'), test.header_hash, 'generate header hash') - const epoc = getEpoc(header.number.toNumber()) - t.equal(getCacheSize(epoc), test.cache_size, 'generate cache size') - t.equal(getFullSize(epoc), test.full_size, 'generate full cache size') + const epoc = getEpoc(header.number) + t.equal(await getCacheSize(epoc), test.cache_size, 'generate cache size') + t.equal(await getFullSize(epoc), test.full_size, 'generate full cache size') ethash.mkcache(test.cache_size, Buffer.from(test.seed, 'hex')) t.equal(ethash.cacheHash().toString('hex'), test.cache_hash, 'generate cache') @@ -27,6 +27,5 @@ tape('POW tests', function (t) { const r = ethash.run(headerHash, Buffer.from(test.nonce, 'hex'), test.full_size) t.equal(r.hash.toString('hex'), test.result, 'generate result') t.equal(r.mix.toString('hex'), test.mixHash, 'generate mix hash') - }) - t.end() + } }) diff --git a/packages/ethash/test/miner.spec.ts b/packages/ethash/test/miner.spec.ts index 653f2353639..463cd21ce72 100644 --- a/packages/ethash/test/miner.spec.ts +++ b/packages/ethash/test/miner.spec.ts @@ -1,7 +1,6 @@ import tape from 'tape' import { Block, BlockHeader } from '@ethereumjs/block' import Ethash from '../src' -import { BN } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' const level = require('level-mem') @@ -14,8 +13,8 @@ tape('Check if miner works as expected', async function (t) { const block = Block.fromBlockData( { header: { - difficulty: new BN(100), - number: new BN(1), + difficulty: BigInt(100), + number: BigInt(1), }, }, { common } @@ -25,11 +24,11 @@ tape('Check if miner works as expected', async function (t) { t.ok(!invalidBlockResult, 'should be invalid') const miner = e.getMiner(block.header) - t.ok((await miner.iterate(1)) === undefined, 'iterations can return undefined') + t.equals(await miner.iterate(1), undefined, 'iterations can return undefined') - t.ok((miner as any).currentNonce.eqn(1), 'miner saves current nonce') + t.equals((miner as any).currentNonce, BigInt(1), 'miner saves current nonce') await miner.iterate(1) - t.ok((miner as any).currentNonce.eqn(2), 'miner succesfully iterates over nonces') + t.equals((miner as any).currentNonce, BigInt(2), 'miner succesfully iterates over nonces') const solution = await miner.iterate(-1) @@ -58,8 +57,8 @@ tape('Check if it is possible to mine Blocks and BlockHeaders', async function ( const block = Block.fromBlockData( { header: { - difficulty: new BN(100), - number: new BN(1), + difficulty: BigInt(100), + number: BigInt(1), }, }, { common } @@ -84,8 +83,8 @@ tape('Check if it is possible to stop the miner', async function (t) { const block = Block.fromBlockData( { header: { - difficulty: new BN(10000000000000), - number: new BN(1), + difficulty: BigInt(10000000000000), + number: BigInt(1), }, }, { common } @@ -119,8 +118,8 @@ tape('Should keep common when mining blocks or headers', async function (t) { const block = Block.fromBlockData( { header: { - difficulty: new BN(100), - number: new BN(1), + difficulty: BigInt(100), + number: BigInt(1), }, }, { diff --git a/packages/rlp/test/dataTypes.spec.ts b/packages/rlp/test/dataTypes.spec.ts index d350b31dde6..33d74aaf708 100644 --- a/packages/rlp/test/dataTypes.spec.ts +++ b/packages/rlp/test/dataTypes.spec.ts @@ -106,8 +106,8 @@ tape('RLP encoding (list)', (t) => { tape('RLP encoding (BigInt)', (t) => { t.test('should encode a BigInt value', (st) => { - const encodedBN = RLP.encode(BigInt(3)) - st.deepEqual(encodedBN[0], 3) + const encoded = RLP.encode(BigInt(3)) + st.deepEqual(encoded[0], 3) st.end() }) @@ -472,11 +472,11 @@ tape('stream', (t) => { decoded = RLP.decode(decoded.remainder, true) st.deepEqual(decoded.data, utf8ToBytes(longString)) decoded = RLP.decode(decoded.remainder, true) - st.ok(decoded.data.length === 3) + st.equal(decoded.data.length, 3) st.deepEqual(decoded.data[0], Uint8Array.from([1])) st.deepEqual(decoded.data[1], Uint8Array.from([2])) st.deepEqual(decoded.data[2], Uint8Array.from([3])) - st.ok(decoded.remainder.length === 0) + st.equal(decoded.remainder.length, 0) st.end() }) }) diff --git a/packages/tx/src/baseTransaction.ts b/packages/tx/src/baseTransaction.ts index 3a6af62de3b..b091686381b 100644 --- a/packages/tx/src/baseTransaction.ts +++ b/packages/tx/src/baseTransaction.ts @@ -1,15 +1,16 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Address, - BN, + BigIntLike, toBuffer, MAX_INTEGER, MAX_UINT64, unpadBuffer, ecsign, publicToAddress, - BNLike, bufferToHex, + bufferToBigInt, + SECP256K1_ORDER_DIV_2, } from 'ethereumjs-util' import { TxData, @@ -25,7 +26,7 @@ import { interface TransactionCache { hash: Buffer | undefined dataFee?: { - value: BN + value: bigint hardfork: string | Hardfork } } @@ -40,15 +41,15 @@ interface TransactionCache { export abstract class BaseTransaction { private readonly _type: number - public readonly nonce: BN - public readonly gasLimit: BN + public readonly nonce: bigint + public readonly gasLimit: bigint public readonly to?: Address - public readonly value: BN + public readonly value: bigint public readonly data: Buffer - public readonly v?: BN - public readonly r?: BN - public readonly s?: BN + public readonly v?: bigint + public readonly r?: bigint + public readonly s?: bigint public readonly common!: Common @@ -84,22 +85,22 @@ export abstract class BaseTransaction { constructor(txData: TxData | AccessListEIP2930TxData | FeeMarketEIP1559TxData) { const { nonce, gasLimit, to, value, data, v, r, s, type } = txData - this._type = new BN(toBuffer(type)).toNumber() + this._type = Number(bufferToBigInt(toBuffer(type))) const toB = toBuffer(to === '' ? '0x' : to) const vB = toBuffer(v === '' ? '0x' : v) const rB = toBuffer(r === '' ? '0x' : r) const sB = toBuffer(s === '' ? '0x' : s) - this.nonce = new BN(toBuffer(nonce === '' ? '0x' : nonce)) - this.gasLimit = new BN(toBuffer(gasLimit === '' ? '0x' : gasLimit)) + this.nonce = bufferToBigInt(toBuffer(nonce === '' ? '0x' : nonce)) + this.gasLimit = bufferToBigInt(toBuffer(gasLimit === '' ? '0x' : gasLimit)) this.to = toB.length > 0 ? new Address(toB) : undefined - this.value = new BN(toBuffer(value === '' ? '0x' : value)) + this.value = bufferToBigInt(toBuffer(value === '' ? '0x' : value)) this.data = toBuffer(data === '' ? '0x' : data) - this.v = vB.length > 0 ? new BN(vB) : undefined - this.r = rB.length > 0 ? new BN(rB) : undefined - this.s = sB.length > 0 ? new BN(sB) : undefined + this.v = vB.length > 0 ? bufferToBigInt(vB) : undefined + this.r = rB.length > 0 ? bufferToBigInt(rB) : undefined + this.s = sB.length > 0 ? bufferToBigInt(sB) : undefined this._validateCannotExceedMaxInteger({ value: this.value, r: this.r, s: this.s }) @@ -149,7 +150,7 @@ export abstract class BaseTransaction { validate(stringError: boolean = false): boolean | string[] { const errors = [] - if (this.getBaseFee().gt(this.gasLimit)) { + if (this.getBaseFee() > this.gasLimit) { errors.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`) } @@ -160,13 +161,35 @@ export abstract class BaseTransaction { return stringError ? errors : errors.length === 0 } + protected _validateYParity() { + const { v } = this + if (v !== undefined && v !== BigInt(0) && v !== BigInt(1)) { + const msg = this._errorMsg('The y-parity of the transaction should either be 0 or 1') + throw new Error(msg) + } + } + + /** + * EIP-2: All transaction signatures whose s-value is greater than secp256k1n/2are considered invalid. + * Reasoning: https://ethereum.stackexchange.com/a/55728 + */ + protected _validateHighS() { + const { s } = this + if (this.common.gteHardfork('homestead') && s !== undefined && s > SECP256K1_ORDER_DIV_2) { + const msg = this._errorMsg( + 'Invalid Signature: s-values greater than secp256k1n/2 are considered invalid' + ) + throw new Error(msg) + } + } + /** * The minimum amount of gas the tx must have (DataFee + TxFee + Creation Fee) */ - getBaseFee(): BN { - const fee = this.getDataFee().addn(this.common.param('gasPrices', 'tx')) + getBaseFee(): bigint { + let fee = this.getDataFee() + BigInt(this.common.param('gasPrices', 'tx')) if (this.common.gteHardfork('homestead') && this.toCreationAddress()) { - fee.iaddn(this.common.param('gasPrices', 'txCreation')) + fee += BigInt(this.common.param('gasPrices', 'txCreation')) } return fee } @@ -174,31 +197,28 @@ export abstract class BaseTransaction { /** * The amount of gas paid for the data in this tx */ - getDataFee(): BN { + getDataFee(): bigint { const txDataZero = this.common.param('gasPrices', 'txDataZero') const txDataNonZero = this.common.param('gasPrices', 'txDataNonZero') - let cost: number | BN = 0 + let cost = 0 for (let i = 0; i < this.data.length; i++) { this.data[i] === 0 ? (cost += txDataZero) : (cost += txDataNonZero) } - cost = new BN(cost) if ((this.to === undefined || this.to === null) && this.common.isActivatedEIP(3860)) { const dataLength = Math.ceil(this.data.length / 32) - const initCodeCost = new BN(this.common.param('gasPrices', 'initCodeWordCost')).imuln( - dataLength - ) - cost.iadd(initCodeCost) + const initCodeCost = this.common.param('gasPrices', 'initCodeWordCost') * dataLength + cost += initCodeCost } - return cost + return BigInt(cost) } /** * The up front amount that an account must have for this transaction to be valid */ - abstract getUpfrontCost(): BN + abstract getUpfrontCost(): bigint /** * If the tx's `to` is to the creation address @@ -237,18 +257,10 @@ export abstract class BaseTransaction { public isSigned(): boolean { const { v, r, s } = this - if (this.type === 0) { - if (!v || !r || !s) { - return false - } else { - return true - } + if (v === undefined || r === undefined || s === undefined) { + return false } else { - if (v === undefined || !r || !s) { - return false - } else { - return true - } + return true } } @@ -337,12 +349,12 @@ export abstract class BaseTransaction { * @param common - {@link Common} instance from tx options * @param chainId - Chain ID from tx options (typed txs) or signature (legacy tx) */ - protected _getCommon(common?: Common, chainId?: BNLike) { + protected _getCommon(common?: Common, chainId?: BigIntLike) { // Chain ID provided if (chainId) { - const chainIdBN = new BN(toBuffer(chainId)) + const chainIdBigInt = bufferToBigInt(toBuffer(chainId)) if (common) { - if (!common.chainId().eq(chainIdBN)) { + if (common.chainId() !== chainIdBigInt) { const msg = this._errorMsg('The chain ID does not match the chain ID of Common') throw new Error(msg) } @@ -350,18 +362,18 @@ export abstract class BaseTransaction { // -> Return provided Common return common.copy() } else { - if (Common.isSupportedChainId(chainIdBN)) { + if (Common.isSupportedChainId(chainIdBigInt)) { // No Common, chain ID supported by Common // -> Instantiate Common with chain ID - return new Common({ chain: chainIdBN, hardfork: this.DEFAULT_HARDFORK }) + return new Common({ chain: chainIdBigInt, hardfork: this.DEFAULT_HARDFORK }) } else { // No Common, chain ID not supported by Common // -> Instantiate custom Common derived from DEFAULT_CHAIN return Common.custom( { name: 'custom-chain', - networkId: chainIdBN, - chainId: chainIdBN, + networkId: chainIdBigInt, + chainId: chainIdBigInt, }, { baseChain: this.DEFAULT_CHAIN, hardfork: this.DEFAULT_HARDFORK } ) @@ -377,13 +389,13 @@ export abstract class BaseTransaction { } /** - * Validates that an object with BN values cannot exceed the specified bit limit. - * @param values Object containing string keys and BN values + * Validates that an object with BigInt values cannot exceed the specified bit limit. + * @param values Object containing string keys and BigInt values * @param bits Number of bits to check (64 or 256) * @param cannotEqual Pass true if the number also cannot equal one less the maximum value */ protected _validateCannotExceedMaxInteger( - values: { [key: string]: BN | undefined }, + values: { [key: string]: bigint | undefined }, bits = 256, cannotEqual = false ) { @@ -391,14 +403,14 @@ export abstract class BaseTransaction { switch (bits) { case 64: if (cannotEqual) { - if (value?.gte(MAX_UINT64)) { + if (value !== undefined && value >= MAX_UINT64) { const msg = this._errorMsg( `${key} cannot equal or exceed MAX_UINT64 (2^64-1), given ${value}` ) throw new Error(msg) } } else { - if (value?.gt(MAX_UINT64)) { + if (value !== undefined && value > MAX_UINT64) { const msg = this._errorMsg(`${key} cannot exceed MAX_UINT64 (2^64-1), given ${value}`) throw new Error(msg) } @@ -406,14 +418,14 @@ export abstract class BaseTransaction { break case 256: if (cannotEqual) { - if (value?.gte(MAX_INTEGER)) { + if (value !== undefined && value >= MAX_INTEGER) { const msg = this._errorMsg( `${key} cannot equal or exceed MAX_INTEGER (2^256-1), given ${value}` ) throw new Error(msg) } } else { - if (value?.gt(MAX_INTEGER)) { + if (value !== undefined && value > MAX_INTEGER) { const msg = this._errorMsg( `${key} cannot exceed MAX_INTEGER (2^256-1), given ${value}` ) diff --git a/packages/tx/src/eip1559Transaction.ts b/packages/tx/src/eip1559Transaction.ts index a6e9a6a333d..faf5926dbf8 100644 --- a/packages/tx/src/eip1559Transaction.ts +++ b/packages/tx/src/eip1559Transaction.ts @@ -1,7 +1,7 @@ import { - BN, - bnToHex, - bnToUnpaddedBuffer, + bigIntToHex, + bigIntToUnpaddedBuffer, + bufferToBigInt, ecrecover, keccak256, MAX_INTEGER, @@ -17,7 +17,6 @@ import { FeeMarketEIP1559TxData, FeeMarketEIP1559ValuesArray, JsonTx, - N_DIV_2, TxOptions, } from './types' import { AccessLists, checkMaxInitCodeSize } from './util' @@ -32,11 +31,11 @@ const TRANSACTION_TYPE_BUFFER = Buffer.from(TRANSACTION_TYPE.toString(16).padSta * - EIP: [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) */ export default class FeeMarketEIP1559Transaction extends BaseTransaction { - public readonly chainId: BN + public readonly chainId: bigint public readonly accessList: AccessListBuffer public readonly AccessListJSON: AccessList - public readonly maxPriorityFeePerGas: BN - public readonly maxFeePerGas: BN + public readonly maxPriorityFeePerGas: bigint + public readonly maxFeePerGas: bigint public readonly common: Common @@ -118,7 +117,7 @@ export default class FeeMarketEIP1559Transaction extends BaseTransaction MAX_INTEGER) { const msg = this._errorMsg('gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)') throw new Error(msg) } - if (this.maxFeePerGas.lt(this.maxPriorityFeePerGas)) { + if (this.maxFeePerGas < this.maxPriorityFeePerGas) { const msg = this._errorMsg( 'maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)' ) throw new Error(msg) } - if (this.v && !this.v.eqn(0) && !this.v.eqn(1)) { - const msg = this._errorMsg('The y-parity of the transaction should either be 0 or 1') - throw new Error(msg) - } - - if (this.common.gteHardfork('homestead') && this.s?.gt(N_DIV_2)) { - const msg = this._errorMsg( - 'Invalid Signature: s-values greater than secp256k1n/2 are considered invalid' - ) - throw new Error(msg) - } + this._validateYParity() + this._validateHighS() if (this.common.isActivatedEIP(3860)) { checkMaxInitCodeSize(this.common, this.data.length) @@ -208,13 +198,13 @@ export default class FeeMarketEIP1559Transaction extends BaseTransaction { - public readonly chainId: BN + public readonly chainId: bigint public readonly accessList: AccessListBuffer public readonly AccessListJSON: AccessList - public readonly gasPrice: BN + public readonly gasPrice: bigint public readonly common: Common @@ -107,7 +106,7 @@ export default class AccessListEIP2930Transaction extends BaseTransaction MAX_INTEGER) { const msg = this._errorMsg('gasLimit * gasPrice cannot exceed MAX_INTEGER') throw new Error(msg) } - if (this.v && !this.v.eqn(0) && !this.v.eqn(1)) { - const msg = this._errorMsg('The y-parity of the transaction should either be 0 or 1') - throw new Error(msg) - } - if (this.common.gteHardfork('homestead') && this.s?.gt(N_DIV_2)) { - const msg = this._errorMsg( - 'Invalid Signature: s-values greater than secp256k1n/2 are considered invalid' - ) - throw new Error(msg) - } + this._validateYParity() + this._validateHighS() if (this.common.isActivatedEIP(3860)) { checkMaxInitCodeSize(this.common, this.data.length) @@ -184,13 +175,13 @@ export default class AccessListEIP2930Transaction extends BaseTransaction { - public readonly gasPrice: BN + public readonly gasPrice: bigint public readonly common: Common @@ -98,9 +104,9 @@ export default class Transaction extends BaseTransaction { this.common = this._validateTxV(this.v, opts.common) - this.gasPrice = new BN(toBuffer(txData.gasPrice === '' ? '0x' : txData.gasPrice)) + this.gasPrice = bufferToBigInt(toBuffer(txData.gasPrice === '' ? '0x' : txData.gasPrice)) - if (this.gasPrice.mul(this.gasLimit).gt(MAX_INTEGER)) { + if (this.gasPrice * this.gasLimit > MAX_INTEGER) { const msg = this._errorMsg('gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)') throw new Error(msg) } @@ -115,11 +121,8 @@ export default class Transaction extends BaseTransaction { // then when computing the hash of a transaction for purposes of signing or recovering // instead of hashing only the first six elements (i.e. nonce, gasprice, startgas, to, value, data) // hash nine elements, with v replaced by CHAIN_ID, r = 0 and s = 0. - const v = this.v! - const chainIdDoubled = this.common.chainId().muln(2) - // v and chain ID meet EIP-155 conditions - if (v.eq(chainIdDoubled.addn(35)) || v.eq(chainIdDoubled.addn(36))) { + if (meetsEIP155(this.v!, this.common.chainId())) { this.activeCapabilities.push(Capability.EIP155ReplayProtection) } } @@ -150,15 +153,15 @@ export default class Transaction extends BaseTransaction { */ raw(): TxValuesArray { return [ - bnToUnpaddedBuffer(this.nonce), - bnToUnpaddedBuffer(this.gasPrice), - bnToUnpaddedBuffer(this.gasLimit), + bigIntToUnpaddedBuffer(this.nonce), + bigIntToUnpaddedBuffer(this.gasPrice), + bigIntToUnpaddedBuffer(this.gasLimit), this.to !== undefined ? this.to.buf : Buffer.from([]), - bnToUnpaddedBuffer(this.value), + bigIntToUnpaddedBuffer(this.value), this.data, - this.v !== undefined ? bnToUnpaddedBuffer(this.v) : Buffer.from([]), - this.r !== undefined ? bnToUnpaddedBuffer(this.r) : Buffer.from([]), - this.s !== undefined ? bnToUnpaddedBuffer(this.s) : Buffer.from([]), + this.v !== undefined ? bigIntToUnpaddedBuffer(this.v) : Buffer.from([]), + this.r !== undefined ? bigIntToUnpaddedBuffer(this.r) : Buffer.from([]), + this.s !== undefined ? bigIntToUnpaddedBuffer(this.s) : Buffer.from([]), ] } @@ -177,11 +180,11 @@ export default class Transaction extends BaseTransaction { private _getMessageToSign() { const values = [ - bnToUnpaddedBuffer(this.nonce), - bnToUnpaddedBuffer(this.gasPrice), - bnToUnpaddedBuffer(this.gasLimit), + bigIntToUnpaddedBuffer(this.nonce), + bigIntToUnpaddedBuffer(this.gasPrice), + bigIntToUnpaddedBuffer(this.gasLimit), this.to !== undefined ? this.to.buf : Buffer.from([]), - bnToUnpaddedBuffer(this.value), + bigIntToUnpaddedBuffer(this.value), this.data, ] @@ -223,7 +226,7 @@ export default class Transaction extends BaseTransaction { /** * The amount of gas paid for the data in this tx */ - getDataFee(): BN { + getDataFee(): bigint { if (this.cache.dataFee && this.cache.dataFee.hardfork === this.common.hardfork()) { return this.cache.dataFee.value } @@ -241,8 +244,8 @@ export default class Transaction extends BaseTransaction { /** * The up front amount that an account must have for this transaction to be valid */ - getUpfrontCost(): BN { - return this.gasLimit.mul(this.gasPrice).add(this.value) + getUpfrontCost(): bigint { + return this.gasLimit * this.gasPrice + this.value } /** @@ -295,22 +298,16 @@ export default class Transaction extends BaseTransaction { getSenderPublicKey(): Buffer { const msgHash = this.getMessageToVerifySignature() - // EIP-2: All transaction signatures whose s-value is greater than secp256k1n/2 are considered invalid. - // Reasoning: https://ethereum.stackexchange.com/a/55728 - if (this.common.gteHardfork('homestead') && this.s?.gt(N_DIV_2)) { - const msg = this._errorMsg( - 'Invalid Signature: s-values greater than secp256k1n/2 are considered invalid' - ) - throw new Error(msg) - } - const { v, r, s } = this + + this._validateHighS() + try { return ecrecover( msgHash, v!, - bnToUnpaddedBuffer(r!), - bnToUnpaddedBuffer(s!), + bigIntToUnpaddedBuffer(r!), + bigIntToUnpaddedBuffer(s!), this.supports(Capability.EIP155ReplayProtection) ? this.common.chainId() : undefined ) } catch (e: any) { @@ -323,9 +320,9 @@ export default class Transaction extends BaseTransaction { * Process the v, r, s values from the `sign` method of the base transaction. */ protected _processSignature(v: number, r: Buffer, s: Buffer) { - const vBN = new BN(v) + let vBigInt = BigInt(v) if (this.supports(Capability.EIP155ReplayProtection)) { - vBN.iadd(this.common.chainId().muln(2).addn(8)) + vBigInt += this.common.chainId() * BigInt(2) + BigInt(8) } const opts = { @@ -340,9 +337,9 @@ export default class Transaction extends BaseTransaction { to: this.to, value: this.value, data: this.data, - v: vBN, - r: new BN(r), - s: new BN(s), + v: vBigInt, + r: bufferToBigInt(r), + s: bufferToBigInt(s), }, opts ) @@ -353,36 +350,34 @@ export default class Transaction extends BaseTransaction { */ toJSON(): JsonTx { return { - nonce: bnToHex(this.nonce), - gasPrice: bnToHex(this.gasPrice), - gasLimit: bnToHex(this.gasLimit), + nonce: bigIntToHex(this.nonce), + gasPrice: bigIntToHex(this.gasPrice), + gasLimit: bigIntToHex(this.gasLimit), to: this.to !== undefined ? this.to.toString() : undefined, - value: bnToHex(this.value), + value: bigIntToHex(this.value), data: '0x' + this.data.toString('hex'), - v: this.v !== undefined ? bnToHex(this.v) : undefined, - r: this.r !== undefined ? bnToHex(this.r) : undefined, - s: this.s !== undefined ? bnToHex(this.s) : undefined, + v: this.v !== undefined ? bigIntToHex(this.v) : undefined, + r: this.r !== undefined ? bigIntToHex(this.r) : undefined, + s: this.s !== undefined ? bigIntToHex(this.s) : undefined, } } /** * Validates tx's `v` value */ - private _validateTxV(v?: BN, common?: Common): Common { - let chainIdBN + private _validateTxV(_v?: bigint, common?: Common): Common { + let chainIdBigInt + const v = _v !== undefined ? Number(_v) : undefined // No unsigned tx and EIP-155 activated and chain ID included if ( v !== undefined && - !v.eqn(0) && + v !== 0 && (!common || common.gteHardfork('spuriousDragon')) && - !v.eqn(27) && - !v.eqn(28) + v !== 27 && + v !== 28 ) { if (common) { - const chainIdDoubled = common.chainId().muln(2) - const isValidEIP155V = v.eq(chainIdDoubled.addn(35)) || v.eq(chainIdDoubled.addn(36)) - - if (!isValidEIP155V) { + if (!meetsEIP155(BigInt(v), common.chainId())) { throw new Error( `Incompatible EIP155-based V ${v} and chain id ${common.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.` ) @@ -390,16 +385,16 @@ export default class Transaction extends BaseTransaction { } else { // Derive the original chain ID let numSub - if (v.subn(35).isEven()) { + if ((v - 35) % 2 === 0) { numSub = 35 } else { numSub = 36 } // Use derived chain ID to create a proper Common - chainIdBN = v.subn(numSub).divn(2) + chainIdBigInt = BigInt(v - numSub) / BigInt(2) } } - return this._getCommon(common, chainIdBN) + return this._getCommon(common, chainIdBigInt) } /** diff --git a/packages/tx/src/transactionFactory.ts b/packages/tx/src/transactionFactory.ts index d5fabb2e3e2..cdb849d83ba 100644 --- a/packages/tx/src/transactionFactory.ts +++ b/packages/tx/src/transactionFactory.ts @@ -1,4 +1,4 @@ -import { BN, toBuffer } from 'ethereumjs-util' +import { bufferToBigInt, toBuffer } from 'ethereumjs-util' import { TxOptions, TypedTransaction, @@ -26,7 +26,7 @@ export default class TransactionFactory { // Assume legacy transaction return Transaction.fromTxData(txData, txOptions) } else { - const txType = new BN(toBuffer(txData.type)).toNumber() + const txType = Number(bufferToBigInt(toBuffer(txData.type))) if (txType === 0) { return Transaction.fromTxData(txData, txOptions) } else if (txType === 1) { diff --git a/packages/tx/src/types.ts b/packages/tx/src/types.ts index 98dee369ad9..19b086d0756 100644 --- a/packages/tx/src/types.ts +++ b/packages/tx/src/types.ts @@ -1,4 +1,4 @@ -import { BN, AddressLike, BNLike, BufferLike, PrefixedHexString } from 'ethereumjs-util' +import { AddressLike, BigIntLike, BufferLike, PrefixedHexString } from 'ethereumjs-util' import Common from '@ethereumjs/common' import { default as Transaction } from './legacyTransaction' import { default as AccessListEIP2930Transaction } from './eip2930Transaction' @@ -114,17 +114,17 @@ export type TxData = { /** * The transaction's nonce. */ - nonce?: BNLike + nonce?: BigIntLike /** * The transaction's gas price. */ - gasPrice?: BNLike + gasPrice?: BigIntLike /** * The transaction's gas limit. */ - gasLimit?: BNLike + gasLimit?: BigIntLike /** * The transaction's the address is sent to. @@ -134,7 +134,7 @@ export type TxData = { /** * The amount of Ether sent. */ - value?: BNLike + value?: BigIntLike /** * This will contain the data of the message or the init of a contract. @@ -144,23 +144,23 @@ export type TxData = { /** * EC recovery ID. */ - v?: BNLike + v?: BigIntLike /** * EC signature parameter. */ - r?: BNLike + r?: BigIntLike /** * EC signature parameter. */ - s?: BNLike + s?: BigIntLike /** * The transaction type */ - type?: BNLike + type?: BigIntLike } /** @@ -170,7 +170,7 @@ export interface AccessListEIP2930TxData extends TxData { /** * The transaction's chain ID */ - chainId?: BNLike + chainId?: BigIntLike /** * The access list which contains the addresses/storage slots which the transaction wishes to access @@ -190,11 +190,11 @@ export interface FeeMarketEIP1559TxData extends AccessListEIP2930TxData { /** * The maximum inclusion fee per gas (this fee is given to the miner) */ - maxPriorityFeePerGas?: BNLike + maxPriorityFeePerGas?: BigIntLike /** * The maximum total fee */ - maxFeePerGas?: BNLike + maxFeePerGas?: BigIntLike } /** @@ -263,11 +263,3 @@ export interface JsonTx { maxPriorityFeePerGas?: string maxFeePerGas?: string } - -/** - * A const defining secp256k1n/2 - */ -export const N_DIV_2 = new BN( - '7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0', - 16 -) diff --git a/packages/tx/test/base.spec.ts b/packages/tx/test/base.spec.ts index 2bd83d305c0..e1646049f01 100644 --- a/packages/tx/test/base.spec.ts +++ b/packages/tx/test/base.spec.ts @@ -4,12 +4,18 @@ import { Transaction, AccessListEIP2930Transaction, FeeMarketEIP1559Transaction, - N_DIV_2, Capability, } from '../src' import { TxsJsonEntry } from './types' import { BaseTransaction } from '../src/baseTransaction' -import { privateToPublic, BN, toBuffer, MAX_INTEGER, MAX_UINT64 } from 'ethereumjs-util' +import { + privateToPublic, + toBuffer, + MAX_INTEGER, + MAX_UINT64, + SECP256K1_ORDER, + bufferToBigInt, +} from 'ethereumjs-util' tape('[BaseTransaction]', function (t) { // EIP-2930 is not enabled in Common by default (2021-03-06) @@ -241,7 +247,7 @@ tape('[BaseTransaction]', function (t) { t.test('verifySignature()', function (st) { for (const txType of txTypes) { txType.txs.forEach(function (tx: any) { - st.equals(tx.verifySignature(), true, `${txType.name}: signature should be valid`) + st.equal(tx.verifySignature(), true, `${txType.name}: signature should be valid`) }) } st.end() @@ -253,7 +259,7 @@ tape('[BaseTransaction]', function (t) { // set `s` to a single zero txFixture.data.s = '0x' + '0' const tx = txType.class.fromTxData(txFixture.data, { common }) - st.equals(tx.verifySignature(), false, `${txType.name}: signature should not be valid`) + st.equal(tx.verifySignature(), false, `${txType.name}: signature should not be valid`) st.ok( (tx.validate(true)).includes('Invalid Signature'), `${txType.name}: should return an error string about not verifying signatures` @@ -281,13 +287,38 @@ tape('[BaseTransaction]', function (t) { st.end() }) + t.test('isSigned() -> returns correct values', function (st) { + for (const txType of txTypes) { + const txs = [ + ...txType.txs, + // add unsigned variants + ...txType.txs.map((tx) => + txType.class.fromTxData({ + ...tx, + v: undefined, + r: undefined, + s: undefined, + }) + ), + ] + for (const tx of txs) { + st.equal( + tx.isSigned(), + tx.v !== undefined && tx.r !== undefined && tx.s !== undefined, + 'isSigned() returns correctly' + ) + } + } + st.end() + }) + t.test('getSenderAddress()', function (st) { for (const txType of txTypes) { txType.txs.forEach(function (tx: any, i: number) { const { privateKey, sendersAddress } = txType.fixtures[i] if (privateKey) { const signedTx = tx.sign(Buffer.from(privateKey, 'hex')) - st.equals( + st.equal( signedTx.getSenderAddress().toString(), `0x${sendersAddress}`, `${txType.name}: should get sender's address after signing it` @@ -327,7 +358,7 @@ tape('[BaseTransaction]', function (t) { if (privateKey) { let signedTx = tx.sign(Buffer.from(privateKey, 'hex')) signedTx = JSON.parse(JSON.stringify(signedTx)) // deep clone - ;(signedTx as any).s = N_DIV_2.addn(1) + ;(signedTx as any).s = SECP256K1_ORDER + BigInt(1) st.throws(() => { signedTx.getSenderPublicKey() }, 'should throw when s-value is greater than secp256k1n/2') @@ -368,11 +399,11 @@ tape('[BaseTransaction]', function (t) { st.equal(tx.r, undefined) st.equal(tx.s, undefined) st.isEquivalent(tx.to, undefined) - st.isEquivalent(tx.value, new BN(bufferZero)) + st.isEquivalent(tx.value, bufferToBigInt(bufferZero)) st.isEquivalent(tx.data, bufferZero) - st.isEquivalent(tx.gasPrice, new BN(bufferZero)) - st.isEquivalent(tx.gasLimit, new BN(bufferZero)) - st.isEquivalent(tx.nonce, new BN(bufferZero)) + st.isEquivalent(tx.gasPrice, bufferToBigInt(bufferZero)) + st.isEquivalent(tx.gasLimit, bufferToBigInt(bufferZero)) + st.isEquivalent(tx.nonce, bufferToBigInt(bufferZero)) st.end() }) @@ -388,12 +419,12 @@ tape('[BaseTransaction]', function (t) { ) } try { - ;(tx as any)._validateCannotExceedMaxInteger({ a: MAX_INTEGER.addn(1) }, 256, false) + ;(tx as any)._validateCannotExceedMaxInteger({ a: MAX_INTEGER + BigInt(1) }, 256, false) } catch (err: any) { st.ok(err.message.includes('exceed MAX_INTEGER'), 'throws when value exceeds MAX_INTEGER') } try { - ;(tx as any)._validateCannotExceedMaxInteger({ a: new BN(0) }, 100, false) + ;(tx as any)._validateCannotExceedMaxInteger({ a: BigInt(0) }, 100, false) } catch (err: any) { st.ok( err.message.includes('unimplemented bits value'), @@ -401,7 +432,7 @@ tape('[BaseTransaction]', function (t) { ) } try { - ;(tx as any)._validateCannotExceedMaxInteger({ a: MAX_UINT64.addn(1) }, 64, false) + ;(tx as any)._validateCannotExceedMaxInteger({ a: MAX_UINT64 + BigInt(1) }, 64, false) } catch (err: any) { st.ok(err.message.includes('2^64'), 'throws when 64 bit integer exceeds MAX_UINT64') } diff --git a/packages/tx/test/eip1559.spec.ts b/packages/tx/test/eip1559.spec.ts index 1612fa1746c..c9f3d015ac2 100644 --- a/packages/tx/test/eip1559.spec.ts +++ b/packages/tx/test/eip1559.spec.ts @@ -1,5 +1,5 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { BN, rlp, TWO_POW256 } from 'ethereumjs-util' +import { rlp, TWO_POW256 } from 'ethereumjs-util' import tape from 'tape' import { FeeMarketEIP1559Transaction } from '../src' @@ -12,7 +12,7 @@ const common = new Common({ const validAddress = Buffer.from('01'.repeat(20), 'hex') const validSlot = Buffer.from('01'.repeat(32), 'hex') -const chainId = new BN(4) +const chainId = BigInt(4) tape('[FeeMarketEIP1559Transaction]', function (t) { t.test('cannot input decimal or negative values', (st) => { @@ -33,7 +33,7 @@ tape('[FeeMarketEIP1559Transaction]', function (t) { '0xaa.1', -10.1, -1, - new BN(-10), + BigInt(-10), '-100', '-10.1', '-0xaa', @@ -49,7 +49,12 @@ tape('[FeeMarketEIP1559Transaction]', function (t) { for (const value of values) { const txData: any = {} for (const testCase of cases) { - if (!(value === 'chainId' && (isNaN(testCase) || testCase === false))) { + if ( + !( + value === 'chainId' && + ((typeof testCase === 'number' && isNaN(testCase)) || testCase === false) + ) + ) { txData[value] = testCase st.throws(() => { FeeMarketEIP1559Transaction.fromTxData(txData) @@ -70,13 +75,13 @@ tape('[FeeMarketEIP1559Transaction]', function (t) { }, { common } ) - st.equals(tx.getUpfrontCost().toNumber(), 806, 'correct upfront cost with default base fee') - let baseFee = new BN(0) - st.equals(tx.getUpfrontCost(baseFee).toNumber(), 806, 'correct upfront cost with 0 base fee') - baseFee = new BN(4) - st.equals( - tx.getUpfrontCost(baseFee).toNumber(), - 1006, + st.equal(tx.getUpfrontCost(), BigInt(806), 'correct upfront cost with default base fee') + let baseFee = BigInt(0) + st.equal(tx.getUpfrontCost(baseFee), BigInt(806), 'correct upfront cost with 0 base fee') + baseFee = BigInt(4) + st.equal( + tx.getUpfrontCost(baseFee), + BigInt(1006), 'correct upfront cost with cost-changing base fee value' ) st.end() @@ -171,7 +176,7 @@ tape('[FeeMarketEIP1559Transaction]', function (t) { st.doesNotThrow(() => { FeeMarketEIP1559Transaction.fromTxData( { - maxFeePerGas: TWO_POW256.subn(1), + maxFeePerGas: TWO_POW256 - BigInt(1), maxPriorityFeePerGas: 100, gasLimit: 1, value: 6, @@ -182,7 +187,7 @@ tape('[FeeMarketEIP1559Transaction]', function (t) { st.throws(() => { FeeMarketEIP1559Transaction.fromTxData( { - maxFeePerGas: TWO_POW256.subn(1), + maxFeePerGas: TWO_POW256 - BigInt(1), maxPriorityFeePerGas: 100, gasLimit: 100, value: 6, diff --git a/packages/tx/test/inputValue.spec.ts b/packages/tx/test/inputValue.spec.ts index 0627d1cd411..e5b6f7a9452 100644 --- a/packages/tx/test/inputValue.spec.ts +++ b/packages/tx/test/inputValue.spec.ts @@ -2,8 +2,7 @@ import tape from 'tape' import { Address, AddressLike, - BN, - BNLike, + BigIntLike, BufferLike, bufferToHex, toBuffer, @@ -16,9 +15,9 @@ function generateAddressLikeValues(address: string): AddressLike[] { return [address, toBuffer(address), new Address(toBuffer(address))] } -// @returns: Array with subtypes of the BNLike type for a given number -function generateBNLikeValues(value: number): BNLike[] { - return [value, new BN(value), `0x${value.toString(16)}`, toBuffer(value)] +// @returns: Array with subtypes of the BigIntLike type for a given number +function generateBigIntLikeValues(value: number): BigIntLike[] { + return [value, BigInt(value), `0x${value.toString(16)}`, toBuffer(value)] } // @returns: Array with subtypes of the BufferLike type for a given string @@ -85,25 +84,25 @@ function getRandomSubarray(array: TArrayItem[], size: number) { const baseTxValues = { data: generateBufferLikeValues('0x65'), - gasLimit: generateBNLikeValues(100000), - nonce: generateBNLikeValues(0), + gasLimit: generateBigIntLikeValues(100000), + nonce: generateBigIntLikeValues(0), to: generateAddressLikeValues('0x0000000000000000000000000000000000000000'), - r: generateBNLikeValues(100), - s: generateBNLikeValues(100), - value: generateBNLikeValues(10), + r: generateBigIntLikeValues(100), + s: generateBigIntLikeValues(100), + value: generateBigIntLikeValues(10), } const legacyTxValues = { - gasPrice: generateBNLikeValues(100), + gasPrice: generateBigIntLikeValues(100), } const accessListEip2930TxValues = { - chainId: generateBNLikeValues(4), + chainId: generateBigIntLikeValues(4), } const eip1559TxValues = { - maxFeePerGas: generateBNLikeValues(100), - maxPriorityFeePerGas: generateBNLikeValues(50), + maxFeePerGas: generateBigIntLikeValues(100), + maxPriorityFeePerGas: generateBigIntLikeValues(50), } tape('[Transaction Input Values]', function (t) { diff --git a/packages/tx/test/legacy.spec.ts b/packages/tx/test/legacy.spec.ts index 8839d64b6f8..602e32c5862 100644 --- a/packages/tx/test/legacy.spec.ts +++ b/packages/tx/test/legacy.spec.ts @@ -1,6 +1,13 @@ import tape from 'tape' import { Buffer } from 'buffer' -import { BN, rlp, toBuffer, bufferToHex, intToBuffer, unpadBuffer } from 'ethereumjs-util' +import { + rlp, + toBuffer, + bufferToHex, + intToBuffer, + unpadBuffer, + bufferToBigInt, +} from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction, TxData } from '../src' import { TxsJsonEntry, VitaliksTestsDataEntry } from './types' @@ -19,7 +26,7 @@ tape('[Transaction]', function (t) { '0xaa.1', -10.1, -1, - new BN(-10), + BigInt(-10), '-100', '-10.1', '-0xaa', @@ -55,28 +62,30 @@ tape('[Transaction]', function (t) { txData[6] = intToBuffer(45) // v with 0-parity and chain ID 5 let tx = Transaction.fromValuesArray(txData) st.ok( - tx.common.chainId().eqn(5), + tx.common.chainId() === BigInt(5), 'should initialize Common with chain ID (supported) derived from v value (v with 0-parity)' ) txData[6] = intToBuffer(46) // v with 1-parity and chain ID 5 tx = Transaction.fromValuesArray(txData) st.ok( - tx.common.chainId().eqn(5), + tx.common.chainId() === BigInt(5), 'should initialize Common with chain ID (supported) derived from v value (v with 1-parity)' ) txData[6] = intToBuffer(2033) // v with 0-parity and chain ID 999 tx = Transaction.fromValuesArray(txData) - st.ok( - tx.common.chainId().eqn(999), + st.equal( + tx.common.chainId(), + BigInt(999), 'should initialize Common with chain ID (unsupported) derived from v value (v with 0-parity)' ) txData[6] = intToBuffer(2034) // v with 1-parity and chain ID 999 tx = Transaction.fromValuesArray(txData) - st.ok( - tx.common.chainId().eqn(999), + st.equal( + tx.common.chainId(), + BigInt(999), 'should initialize Common with chain ID (unsupported) derived from v value (v with 1-parity)' ) st.end() @@ -103,8 +112,8 @@ tape('[Transaction]', function (t) { }) t.test('Initialization -> should accept lesser r values', function (st) { - const tx = Transaction.fromTxData({ r: new BN(toBuffer('0x0005')) }) - st.equals(tx.r!.toString('hex'), '5') + const tx = Transaction.fromTxData({ r: bufferToBigInt(toBuffer('0x0005')) }) + st.equal(tx.r!.toString(16), '5') st.end() }) @@ -113,7 +122,7 @@ tape('[Transaction]', function (t) { function (st) { let common = new Common({ chain: 42, hardfork: Hardfork.Petersburg }) let tx = Transaction.fromTxData({}, { common }) - st.ok(tx.common.chainId().eqn(42)) + st.equal(tx.common.chainId(), BigInt(42)) const privKey = Buffer.from(txFixtures[0].privateKey, 'hex') tx = tx.sign(privKey) const serialized = tx.serialize() @@ -128,7 +137,7 @@ tape('[Transaction]', function (t) { function (st) { st.throws(() => { const common = new Common({ chain: 42, hardfork: Hardfork.Petersburg }) - Transaction.fromTxData({ v: new BN(1) }, { common }) + Transaction.fromTxData({ v: BigInt(1) }, { common }) }) st.end() } @@ -136,26 +145,26 @@ tape('[Transaction]', function (t) { t.test('validate() -> should validate with string option', function (st) { transactions.forEach(function (tx) { - st.ok(typeof tx.validate(true)[0] === 'string') + st.equal(typeof tx.validate(true)[0], 'string') }) st.end() }) t.test('getBaseFee() -> should return base fee', function (st) { const tx = Transaction.fromTxData({}) - st.equals(tx.getBaseFee().toNumber(), 53000) + st.equal(tx.getBaseFee(), BigInt(53000)) st.end() }) t.test('getDataFee() -> should return data fee', function (st) { let tx = Transaction.fromTxData({}) - st.equals(tx.getDataFee().toNumber(), 0) + st.equal(tx.getDataFee(), BigInt(0)) tx = Transaction.fromValuesArray(txFixtures[3].raw.map(toBuffer)) - st.equals(tx.getDataFee().toNumber(), 1716) + st.equal(tx.getDataFee(), BigInt(1716)) tx = Transaction.fromValuesArray(txFixtures[3].raw.map(toBuffer), { freeze: false }) - st.equals(tx.getDataFee().toNumber(), 1716) + st.equal(tx.getDataFee(), BigInt(1716)) st.end() }) @@ -163,12 +172,12 @@ tape('[Transaction]', function (t) { t.test('getDataFee() -> should return correct data fee for istanbul', function (st) { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) let tx = Transaction.fromTxData({}, { common }) - st.equals(tx.getDataFee().toNumber(), 0) + st.equal(tx.getDataFee(), BigInt(0)) tx = Transaction.fromValuesArray(txFixtures[3].raw.map(toBuffer), { common, }) - st.equals(tx.getDataFee().toNumber(), 1716) + st.equal(tx.getDataFee(), BigInt(1716)) st.end() }) @@ -178,9 +187,9 @@ tape('[Transaction]', function (t) { const tx = Transaction.fromValuesArray(txFixtures[0].raw.map(toBuffer), { common, }) - st.equals(tx.getDataFee().toNumber(), 656) + st.equal(tx.getDataFee(), BigInt(656)) tx.common.setHardfork(Hardfork.Istanbul) - st.equals(tx.getDataFee().toNumber(), 240) + st.equal(tx.getDataFee(), BigInt(240)) st.end() }) @@ -190,7 +199,7 @@ tape('[Transaction]', function (t) { gasLimit: 10000000, value: 42, }) - st.equals(tx.getUpfrontCost().toNumber(), 10000000042) + st.equal(tx.getUpfrontCost(), BigInt(10000000042)) st.end() }) @@ -405,16 +414,16 @@ tape('[Transaction]', function (t) { ) st.true(signedWithEIP155.verifySignature()) - st.notEqual(signedWithEIP155.v?.toString('hex'), '1c') - st.notEqual(signedWithEIP155.v?.toString('hex'), '1b') + st.notEqual(signedWithEIP155.v?.toString(16), '1c') + st.notEqual(signedWithEIP155.v?.toString(16), '1b') signedWithEIP155 = Transaction.fromTxData(fixtureTxSignedWithoutEIP155.toJSON()).sign( privateKey ) st.true(signedWithEIP155.verifySignature()) - st.notEqual(signedWithEIP155.v?.toString('hex'), '1c') - st.notEqual(signedWithEIP155.v?.toString('hex'), '1b') + st.notEqual(signedWithEIP155.v?.toString(16), '1c') + st.notEqual(signedWithEIP155.v?.toString(16), '1b') let signedWithoutEIP155 = Transaction.fromTxData(fixtureTxSignedWithEIP155.toJSON(), { common, @@ -422,8 +431,7 @@ tape('[Transaction]', function (t) { st.true(signedWithoutEIP155.verifySignature()) st.true( - signedWithoutEIP155.v?.toString('hex') == '1c' || - signedWithoutEIP155.v?.toString('hex') == '1b', + signedWithoutEIP155.v?.toString(16) == '1c' || signedWithoutEIP155.v?.toString(16) == '1b', "v shouldn't be EIP155 encoded" ) @@ -433,8 +441,7 @@ tape('[Transaction]', function (t) { st.true(signedWithoutEIP155.verifySignature()) st.true( - signedWithoutEIP155.v?.toString('hex') == '1c' || - signedWithoutEIP155.v?.toString('hex') == '1b', + signedWithoutEIP155.v?.toString(16) == '1c' || signedWithoutEIP155.v?.toString(16) == '1b', "v shouldn' be EIP155 encoded" ) @@ -445,7 +452,7 @@ tape('[Transaction]', function (t) { t.test('sign(), verifySignature(): sign tx with chainId specified in params', function (st) { const common = new Common({ chain: 42, hardfork: Hardfork.Petersburg }) let tx = Transaction.fromTxData({}, { common }) - st.ok(tx.common.chainId().eqn(42)) + st.equal(tx.common.chainId(), BigInt(42)) const privKey = Buffer.from(txFixtures[0].privateKey, 'hex') tx = tx.sign(privKey) @@ -454,7 +461,7 @@ tape('[Transaction]', function (t) { const reTx = Transaction.fromSerializedTx(serialized, { common }) st.equal(reTx.verifySignature(), true) - st.ok(reTx.common.chainId().eqn(42)) + st.equal(reTx.common.chainId(), BigInt(42)) st.end() }) diff --git a/packages/tx/test/transactionFactory.spec.ts b/packages/tx/test/transactionFactory.spec.ts index 154094c5ad0..cdf5b5d456d 100644 --- a/packages/tx/test/transactionFactory.spec.ts +++ b/packages/tx/test/transactionFactory.spec.ts @@ -1,5 +1,4 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { BN } from 'ethereumjs-util' import tape from 'tape' import { AccessListEIP2930Transaction, @@ -19,12 +18,12 @@ const unsignedTx = Transaction.fromTxData({}) const signedTx = unsignedTx.sign(pKey) const unsignedEIP2930Tx = AccessListEIP2930Transaction.fromTxData( - { chainId: new BN(1) }, + { chainId: BigInt(1) }, { common } ) const signedEIP2930Tx = unsignedEIP2930Tx.sign(pKey) -const unsignedEIP1559Tx = FeeMarketEIP1559Transaction.fromTxData({ chainId: new BN(1) }, { common }) +const unsignedEIP1559Tx = FeeMarketEIP1559Transaction.fromTxData({ chainId: BigInt(1) }, { common }) const signedEIP1559Tx = unsignedEIP1559Tx.sign(pKey) const txTypes = [ @@ -59,7 +58,7 @@ tape('[TransactionFactory]: Basic functions', function (t) { for (const txType of txTypes) { const serialized = txType.unsigned.serialize() const factoryTx = TransactionFactory.fromSerializedData(serialized, { common }) - st.equals( + st.equal( factoryTx.constructor.name, txType.class.name, `should return the right type (${txType.name})` @@ -97,7 +96,7 @@ tape('[TransactionFactory]: Basic functions', function (t) { rawTx = txType.signed.raw() as Buffer[] } const tx = TransactionFactory.fromBlockBodyData(rawTx, { common }) - st.equals(tx.constructor.name, txType.name, `should return the right type (${txType.name})`) + st.equal(tx.constructor.name, txType.name, `should return the right type (${txType.name})`) if (txType.eip2718) { st.deepEqual( tx.serialize(), @@ -114,14 +113,14 @@ tape('[TransactionFactory]: Basic functions', function (t) { t.test('fromTxData() -> success cases', function (st) { for (const txType of txTypes) { const tx = TransactionFactory.fromTxData({ type: txType.type }, { common }) - st.equals( + st.equal( tx.constructor.name, txType.class.name, `should return the right type (${txType.name})` ) if (!txType.eip2718) { const tx = TransactionFactory.fromTxData({}) - st.equals( + st.equal( tx.constructor.name, txType.class.name, `should return the right type (${txType.name})` @@ -142,7 +141,7 @@ tape('[TransactionFactory]: Basic functions', function (t) { }) st.throws(() => { - TransactionFactory.fromTxData({ value: new BN('-100') }) + TransactionFactory.fromTxData({ value: BigInt('-100') }) }) st.end() diff --git a/packages/tx/test/typedTxsAndEIP2930.spec.ts b/packages/tx/test/typedTxsAndEIP2930.spec.ts index 8d53dfecdc0..68faa178013 100644 --- a/packages/tx/test/typedTxsAndEIP2930.spec.ts +++ b/packages/tx/test/typedTxsAndEIP2930.spec.ts @@ -1,11 +1,12 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Address, - BN, bufferToHex, MAX_INTEGER, MAX_UINT64, + SECP256K1_ORDER_DIV_2, privateToAddress, + bufferToBigInt, } from 'ethereumjs-util' import tape from 'tape' import { @@ -18,11 +19,6 @@ import { const pKey = Buffer.from('4646464646464646464646464646464646464646464646464646464646464646', 'hex') const address = privateToAddress(pKey) -const N_DIV_2_PLUS_1 = new BN( - '7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1', - 16 -) - const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London, @@ -43,7 +39,7 @@ const txTypes = [ const validAddress = Buffer.from('01'.repeat(20), 'hex') const validSlot = Buffer.from('01'.repeat(32), 'hex') -const chainId = new BN(1) +const chainId = BigInt(1) tape( '[AccessListEIP2930Transaction / FeeMarketEIP1559Transaction] -> EIP-2930 Compatibility', @@ -57,7 +53,7 @@ tape( chainId: 5, }) t.ok( - tx.common.chainId().eqn(5), + tx.common.chainId() === BigInt(5), 'should initialize Common with chain ID provided (supported chain ID)' ) @@ -65,7 +61,7 @@ tape( chainId: 99999, }) t.ok( - tx.common.chainId().eqn(99999), + tx.common.chainId() === BigInt(99999), 'should initialize Common with chain ID provided (unsupported chain ID)' ) @@ -77,7 +73,7 @@ tape( t.throws(() => { txType.class.fromTxData( { - chainId: chainId.addn(1), + chainId: chainId + BigInt(1), }, { common } ) @@ -103,7 +99,7 @@ tape( '0xaa.1', -10.1, -1, - new BN(-10), + BigInt(-10), '-100', '-10.1', '-0xaa', @@ -119,7 +115,12 @@ tape( for (const value of values) { const txData: any = {} for (const testCase of cases) { - if (!(value === 'chainId' && (isNaN(testCase) || testCase === false))) { + if ( + !( + value === 'chainId' && + ((typeof testCase === 'number' && isNaN(testCase)) || testCase === false) + ) + ) { txData[value] = testCase st.throws(() => { AccessListEIP2930Transaction.fromTxData(txData) @@ -299,7 +300,8 @@ tape( }) t.throws(() => { - const tx = txType.class.fromTxData({ s: N_DIV_2_PLUS_1, r: 1, v: 1 }, { common }) + const high = SECP256K1_ORDER_DIV_2 + BigInt(1) + const tx = txType.class.fromTxData({ s: high, r: 1, v: 1 }, { common }) const signed = tx.sign(pKey) signed.getSenderPublicKey() }, `should throw with invalid s value (${txType.name})`) @@ -310,15 +312,15 @@ tape( t.test('getDataFee()', function (st) { for (const txType of txTypes) { let tx = txType.class.fromTxData({}, { common }) - st.ok(tx.getDataFee().toNumber() === 0, 'Should return data fee when frozen') + st.equal(tx.getDataFee(), BigInt(0), 'Should return data fee when frozen') tx = txType.class.fromTxData({}, { common, freeze: false }) - st.ok(tx.getDataFee().toNumber() === 0, 'Should return data fee when not frozen') + st.equal(tx.getDataFee(), BigInt(0), 'Should return data fee when not frozen') const mutableCommon = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) tx = txType.class.fromTxData({}, { common: mutableCommon }) tx.common.setHardfork(Hardfork.Istanbul) - st.ok(tx.getDataFee().toNumber() === 0, 'Should invalidate cached value on hardfork change') + st.equal(tx.getDataFee(), BigInt(0), 'Should invalidate cached value on hardfork change') } st.end() }) @@ -335,7 +337,7 @@ tape('[AccessListEIP2930Transaction] -> Class Specific Tests', function (t) { const validAddress = Buffer.from('01'.repeat(20), 'hex') const validSlot = Buffer.from('01'.repeat(32), 'hex') - const chainId = new BN(1) + const chainId = BigInt(1) try { AccessListEIP2930Transaction.fromTxData( { @@ -388,9 +390,8 @@ tape('[AccessListEIP2930Transaction] -> Class Specific Tests', function (t) { const creationFee: number = common.param('gasPrices', 'txCreation') st.ok( - tx - .getBaseFee() - .eqn( + tx.getBaseFee() === + BigInt( txDataNonZero * 2 + txDataZero + baseFee + @@ -410,9 +411,8 @@ tape('[AccessListEIP2930Transaction] -> Class Specific Tests', function (t) { ) st.ok( - tx - .getBaseFee() - .eqn( + tx.getBaseFee() === + BigInt( txDataNonZero * 2 + txDataZero + creationFee + @@ -435,7 +435,9 @@ tape('[AccessListEIP2930Transaction] -> Class Specific Tests', function (t) { { common } ) - st.ok(tx.getBaseFee().eqn(baseFee + accessListAddressCost * 2 + accessListStorageKeyCost * 3)) + st.ok( + tx.getBaseFee() === BigInt(baseFee + accessListAddressCost * 2 + accessListStorageKeyCost * 3) + ) st.end() }) @@ -449,7 +451,7 @@ tape('[AccessListEIP2930Transaction] -> Class Specific Tests', function (t) { }, { common } ) - st.equals(tx.getUpfrontCost().toNumber(), 10000000042) + st.equal(tx.getUpfrontCost(), BigInt(10000000042)) st.end() }) @@ -498,7 +500,7 @@ tape('[AccessListEIP2930Transaction] -> Class Specific Tests', function (t) { nonce: 0x00, to: new Address(Buffer.from('df0a88b2b68c673713a8ec826003676f272e3573', 'hex')), value: 0x01, - chainId: new BN(Buffer.from('796f6c6f763378', 'hex')), + chainId: bufferToBigInt(Buffer.from('796f6c6f763378', 'hex')), accessList: [[address, [slot1]]], } @@ -529,11 +531,11 @@ tape('[AccessListEIP2930Transaction] -> Class Specific Tests', function (t) { 'bbd570a3c6acc9bb7da0d5c0322fe4ea2a300db80226f7df4fef39b2d6649eec', 'hex' ) - const v = new BN(0) - const r = new BN( + const v = BigInt(0) + const r = bufferToBigInt( Buffer.from('294ac94077b35057971e6b4b06dfdf55a6fbed819133a6c1d31e187f1bca938d', 'hex') ) - const s = new BN( + const s = bufferToBigInt( Buffer.from('0be950468ba1c25a5cb50e9f6d8aa13c8cd21f24ba909402775b262ac76d374d', 'hex') ) @@ -545,9 +547,9 @@ tape('[AccessListEIP2930Transaction] -> Class Specific Tests', function (t) { const signed = unsignedTx.sign(pkey) - t.ok(v.eq(signed.v!), 'v correct') - t.ok(r.eq(signed.r!), 'r correct') - t.ok(s.eq(signed.s!), 's correct') + t.ok(v === signed.v!, 'v correct') + t.ok(r === signed.r!, 'r correct') + t.ok(s === signed.s!, 's correct') t.ok(expectedSigned.equals(signed.serialize()), 'serialized signed message correct') t.ok(expectedHash.equals(signed.hash()), 'hash correct') diff --git a/packages/util/docs/README.md b/packages/util/docs/README.md index 58a13cc1e9c..71fcf23434e 100644 --- a/packages/util/docs/README.md +++ b/packages/util/docs/README.md @@ -56,9 +56,9 @@ ethereumjs-util - [arrToBufArr](README.md#arrtobufarr) - [arrayContainsArray](README.md#arraycontainsarray) - [baToJSON](README.md#batojson) -- [bnToHex](README.md#bntohex) +- [bigIntToHex](README.md#bigIntToHex) - [bnToRlp](README.md#bntorlp) -- [bnToUnpaddedBuffer](README.md#bntounpaddedbuffer) +- [bigIntToUnpaddedBuffer](README.md#bigIntToUnpaddedBuffer) - [bufArrToArr](README.md#bufarrtoarr) - [bufferToHex](README.md#buffertohex) - [bufferToInt](README.md#buffertoint) @@ -447,9 +447,9 @@ Converts a `Buffer` or `Array` to JSON. ___ -### bnToHex +### bigIntToHex -▸ **bnToHex**(`value`): [`PrefixedHexString`](README.md#prefixedhexstring) +▸ **bigIntToHex**(`value`): [`PrefixedHexString`](README.md#prefixedhexstring) Convert BN to 0x-prefixed hex string. @@ -473,7 +473,7 @@ ___ ▸ **bnToRlp**(`value`): `Buffer` -Deprecated alias for [bnToUnpaddedBuffer](README.md#bntounpaddedbuffer) +Deprecated alias for [bigIntToUnpaddedBuffer](README.md#bigIntToUnpaddedBuffer) **`deprecated`** @@ -493,9 +493,9 @@ Deprecated alias for [bnToUnpaddedBuffer](README.md#bntounpaddedbuffer) ___ -### bnToUnpaddedBuffer +### bigIntToUnpaddedBuffer -▸ **bnToUnpaddedBuffer**(`value`): `Buffer` +▸ **bigIntToUnpaddedBuffer**(`value`): `Buffer` Convert value from BN to an unpadded Buffer (useful for RLP transport) diff --git a/packages/util/package.json b/packages/util/package.json index d3a7c9a955f..0633ce0b85d 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -37,12 +37,11 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", "ethereum-cryptography": "^1.0.3", "rlp": "^2.2.4" }, "devDependencies": { + "@types/bn.js": "^5.1.0", "@types/node": "^16.11.7", "@types/secp256k1": "^4.0.1", "@types/tape": "^4.13.2", diff --git a/packages/util/src/account.ts b/packages/util/src/account.ts index 466fea90727..0d93356daab 100644 --- a/packages/util/src/account.ts +++ b/packages/util/src/account.ts @@ -1,22 +1,24 @@ -import { BN, rlp } from './externals' +import { rlp } from './externals' import { Point, utils } from 'ethereum-cryptography/secp256k1' import { stripHexPrefix } from './internal' import { KECCAK256_RLP, KECCAK256_NULL } from './constants' -import { zeros, bufferToHex, toBuffer } from './bytes' +import { zeros, bufferToHex, toBuffer, bufferToBigInt } from './bytes' import { keccak, keccak256, keccakFromString, rlphash } from './hash' import { assertIsString, assertIsHexString, assertIsBuffer } from './helpers' -import { BNLike, BufferLike, bnToUnpaddedBuffer, toType, TypeOutput } from './types' +import { BigIntLike, BufferLike, bigIntToUnpaddedBuffer } from './types' + +const _0n = BigInt(0) export interface AccountData { - nonce?: BNLike - balance?: BNLike + nonce?: BigIntLike + balance?: BigIntLike stateRoot?: BufferLike codeHash?: BufferLike } export class Account { - nonce: BN - balance: BN + nonce: bigint + balance: bigint stateRoot: Buffer codeHash: Buffer @@ -24,8 +26,8 @@ export class Account { const { nonce, balance, stateRoot, codeHash } = accountData return new Account( - nonce ? new BN(toBuffer(nonce)) : undefined, - balance ? new BN(toBuffer(balance)) : undefined, + nonce ? bufferToBigInt(toBuffer(nonce)) : undefined, + balance ? bufferToBigInt(toBuffer(balance)) : undefined, stateRoot ? toBuffer(stateRoot) : undefined, codeHash ? toBuffer(codeHash) : undefined ) @@ -44,19 +46,14 @@ export class Account { public static fromValuesArray(values: Buffer[]) { const [nonce, balance, stateRoot, codeHash] = values - return new Account(new BN(nonce), new BN(balance), stateRoot, codeHash) + return new Account(bufferToBigInt(nonce), bufferToBigInt(balance), stateRoot, codeHash) } /** * This constructor assigns and validates the values. * Use the static factory methods to assist in creating an Account from varying data types. */ - constructor( - nonce = new BN(0), - balance = new BN(0), - stateRoot = KECCAK256_RLP, - codeHash = KECCAK256_NULL - ) { + constructor(nonce = _0n, balance = _0n, stateRoot = KECCAK256_RLP, codeHash = KECCAK256_NULL) { this.nonce = nonce this.balance = balance this.stateRoot = stateRoot @@ -66,10 +63,10 @@ export class Account { } private _validate() { - if (this.nonce.lt(new BN(0))) { + if (this.nonce < _0n) { throw new Error('nonce must be greater than zero') } - if (this.balance.lt(new BN(0))) { + if (this.balance < _0n) { throw new Error('balance must be greater than zero') } if (this.stateRoot.length !== 32) { @@ -85,8 +82,8 @@ export class Account { */ raw(): Buffer[] { return [ - bnToUnpaddedBuffer(this.nonce), - bnToUnpaddedBuffer(this.balance), + bigIntToUnpaddedBuffer(this.nonce), + bigIntToUnpaddedBuffer(this.balance), this.stateRoot, this.codeHash, ] @@ -112,7 +109,7 @@ export class Account { * "An account is considered empty when it has no code and zero nonce and zero balance." */ isEmpty(): boolean { - return this.balance.isZero() && this.nonce.isZero() && this.codeHash.equals(KECCAK256_NULL) + return this.balance === _0n && this.nonce === _0n && this.codeHash.equals(KECCAK256_NULL) } } @@ -141,13 +138,16 @@ export const isValidAddress = function (hexAddress: string): boolean { * [EIP-55](https://eips.ethereum.org/EIPS/eip-55), so this will break in existing applications. * Usage of this EIP is therefore discouraged unless you have a very targeted use case. */ -export const toChecksumAddress = function (hexAddress: string, eip1191ChainId?: BNLike): string { +export const toChecksumAddress = function ( + hexAddress: string, + eip1191ChainId?: BigIntLike +): string { assertIsHexString(hexAddress) const address = stripHexPrefix(hexAddress).toLowerCase() let prefix = '' if (eip1191ChainId) { - const chainId = toType(eip1191ChainId, TypeOutput.BN) + const chainId = bufferToBigInt(toBuffer(eip1191ChainId)) prefix = chainId.toString() + '0x' } @@ -172,7 +172,7 @@ export const toChecksumAddress = function (hexAddress: string, eip1191ChainId?: */ export const isValidChecksumAddress = function ( hexAddress: string, - eip1191ChainId?: BNLike + eip1191ChainId?: BigIntLike ): boolean { return isValidAddress(hexAddress) && toChecksumAddress(hexAddress, eip1191ChainId) === hexAddress } @@ -185,16 +185,15 @@ export const isValidChecksumAddress = function ( export const generateAddress = function (from: Buffer, nonce: Buffer): Buffer { assertIsBuffer(from) assertIsBuffer(nonce) - const nonceBN = new BN(nonce) - if (nonceBN.isZero()) { + if (bufferToBigInt(nonce) === BigInt(0)) { // in RLP we want to encode null in the case of zero nonce // read the RLP documentation for an answer if you dare return rlphash([from, null]).slice(-20) } // Only take the lower 160bits of the hash - return rlphash([from, Buffer.from(nonceBN.toArray())]).slice(-20) + return rlphash([from, nonce]).slice(-20) } /** diff --git a/packages/util/src/address.ts b/packages/util/src/address.ts index fc9b8d9d3df..5d402f71de7 100644 --- a/packages/util/src/address.ts +++ b/packages/util/src/address.ts @@ -1,5 +1,4 @@ -import { BN } from './externals' -import { toBuffer, zeros } from './bytes' +import { toBuffer, zeros, bigIntToBuffer, bufferToBigInt } from './bytes' import { isValidAddress, pubToAddress, @@ -65,11 +64,11 @@ export class Address { * @param from The address which is creating this new address * @param nonce The nonce of the from account */ - static generate(from: Address, nonce: BN): Address { - if (!BN.isBN(nonce)) { - throw new Error('Expected nonce to be a BigNum') + static generate(from: Address, nonce: bigint): Address { + if (typeof nonce !== 'bigint') { + throw new Error('Expected nonce to be a bigint') } - return new Address(generateAddress(from.buf, nonce.toArrayLike(Buffer))) + return new Address(generateAddress(from.buf, bigIntToBuffer(nonce))) } /** @@ -107,11 +106,10 @@ export class Address { * by EIP-1352 */ isPrecompileOrSystemAddress(): boolean { - const addressBN = new BN(this.buf) - const rangeMin = new BN(0) - const rangeMax = new BN('ffff', 'hex') - - return addressBN.gte(rangeMin) && addressBN.lte(rangeMax) + const address = bufferToBigInt(this.buf) + const rangeMin = BigInt(0) + const rangeMax = BigInt('0xffff') + return address >= rangeMin && address <= rangeMax } /** diff --git a/packages/util/src/bytes.ts b/packages/util/src/bytes.ts index 3bc3d97b41c..e5a81d33c6d 100644 --- a/packages/util/src/bytes.ts +++ b/packages/util/src/bytes.ts @@ -1,4 +1,3 @@ -import { BN } from './externals' import { stripHexPrefix, padToEven, isHexString, isHexPrefixed } from './internal' import { PrefixedHexString, @@ -136,7 +135,7 @@ export const unpadHexString = function (a: string): string { export type ToBufferInputTypes = | PrefixedHexString | number - | BN + | bigint | Buffer | Uint8Array | number[] @@ -147,7 +146,7 @@ export type ToBufferInputTypes = /** * Attempts to turn a value into a `Buffer`. - * Inputs supported: `Buffer`, `String` (hex-prefixed), `Number`, null/undefined, `BN` and other objects + * Inputs supported: `Buffer`, `String` (hex-prefixed), `Number`, null/undefined, `BigInt` and other objects * with a `toArray()` or `toBuffer()` method. * @param v the value */ @@ -177,11 +176,13 @@ export const toBuffer = function (v: ToBufferInputTypes): Buffer { return intToBuffer(v) } - if (BN.isBN(v)) { - if (v.isNeg()) { - throw new Error(`Cannot convert negative BN to buffer. Given: ${v}`) + if (typeof v === 'bigint') { + if (v < BigInt(0)) { + throw new Error(`Cannot convert negative bigint to buffer. Given: ${v}`) } - return v.toArrayLike(Buffer) + let n = v.toString(16) + if (n.length % 2) n = '0' + n + return Buffer.from(n, 'hex') } if (v.toArray) { @@ -197,37 +198,57 @@ export const toBuffer = function (v: ToBufferInputTypes): Buffer { } /** - * Converts a `Buffer` to a `Number`. + * Converts a `Buffer` into a `0x`-prefixed hex `String`. * @param buf `Buffer` object to convert - * @throws If the input number exceeds 53 bits. */ -export const bufferToInt = function (buf: Buffer): number { - return new BN(toBuffer(buf)).toNumber() +export const bufferToHex = function (buf: Buffer): string { + buf = toBuffer(buf) + return '0x' + buf.toString('hex') } /** - * Converts a `Buffer` into a `0x`-prefixed hex `String`. + * Converts a {@link Buffer} to a {@link bigint} + */ +export function bufferToBigInt(buf: Buffer) { + const hex = bufferToHex(buf) + if (hex === '0x') { + return BigInt(0) + } + return BigInt(hex) +} + +/** + * Converts a {@link bigint} to a {@link Buffer} + */ +export function bigIntToBuffer(num: bigint) { + return toBuffer('0x' + num.toString(16)) +} + +/** + * Converts a `Buffer` to a `Number`. * @param buf `Buffer` object to convert + * @throws If the input number exceeds 53 bits. */ -export const bufferToHex = function (buf: Buffer): string { - buf = toBuffer(buf) - return '0x' + buf.toString('hex') +export const bufferToInt = function (buf: Buffer): number { + const res = Number(bufferToBigInt(buf)) + if (!Number.isSafeInteger(res)) throw new Error('Number exceeds 53 bits') + return res } /** - * Interprets a `Buffer` as a signed integer and returns a `BN`. Assumes 256-bit numbers. + * Interprets a `Buffer` as a signed integer and returns a `BigInt`. Assumes 256-bit numbers. * @param num Signed integer value */ -export const fromSigned = function (num: Buffer): BN { - return new BN(num).fromTwos(256) +export const fromSigned = function (num: Buffer): bigint { + return BigInt.asIntN(256, bufferToBigInt(num)) } /** - * Converts a `BN` to an unsigned integer and returns it as a `Buffer`. Assumes 256-bit numbers. + * Converts a `BigInt` to an unsigned integer and returns it as a `Buffer`. Assumes 256-bit numbers. * @param num */ -export const toUnsigned = function (num: BN): Buffer { - return Buffer.from(num.toTwos(256).toArray()) +export const toUnsigned = function (num: bigint): Buffer { + return bigIntToBuffer(BigInt.asUintN(256, num)) } /** @@ -332,21 +353,3 @@ export function bufArrToArr(arr: Buffer | NestedBufferArray): Uint8Array | Neste } return arr.map((a) => bufArrToArr(a)) } - -/** - * Converts a {@link Buffer} to a {@link bigint}` - */ -export function bufferToBigInt(buf: Buffer) { - const hex = bufferToHex(buf) - if (hex === '0x') { - return BigInt(0) - } - return BigInt(hex) -} - -/** - * Converts a {@link bigint} to a {@link Buffer} - */ -export function bigIntToBuffer(num: bigint) { - return toBuffer('0x' + num.toString(16)) -} diff --git a/packages/util/src/constants.ts b/packages/util/src/constants.ts index 20dc334dc6a..99068442faa 100644 --- a/packages/util/src/constants.ts +++ b/packages/util/src/constants.ts @@ -1,17 +1,16 @@ import { Buffer } from 'buffer' -import { BN } from './externals' +import { CURVE } from 'ethereum-cryptography/secp256k1' /** * 2^64-1 */ -export const MAX_UINT64 = new BN('ffffffffffffffff', 16) +export const MAX_UINT64 = BigInt('0xffffffffffffffff') /** * The max integer that the evm can handle (2^256-1) */ -export const MAX_INTEGER = new BN( - 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', - 16 +export const MAX_INTEGER = BigInt( + '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' ) /** @@ -19,20 +18,15 @@ export const MAX_INTEGER = new BN( */ export const MAX_INTEGER_BIGINT = BigInt(2) ** BigInt(256) - BigInt(1) -/** - * 2^256 - * - * @deprecated bn.js constants are deprecated, please use the newly introduced bigint constants - */ -export const TWO_POW256 = new BN( - '10000000000000000000000000000000000000000000000000000000000000000', - 16 -) +export const SECP256K1_ORDER = CURVE.n +export const SECP256K1_ORDER_DIV_2 = CURVE.n / BigInt(2) /** * 2^256 */ -export const TWO_POW256_BIGINT = BigInt(2) ** BigInt(256) +export const TWO_POW256 = BigInt( + '0x10000000000000000000000000000000000000000000000000000000000000000' +) /** * Keccak-256 hash of null diff --git a/packages/util/src/externals.ts b/packages/util/src/externals.ts index 17fae57870c..d644e58528e 100644 --- a/packages/util/src/externals.ts +++ b/packages/util/src/externals.ts @@ -1,17 +1,11 @@ /** * Re-exports commonly used modules: - * * Exports [`BN`](https://github.com/indutny/bn.js), [`rlp`](https://github.com/ethereumjs/rlp). + * [`rlp`](https://github.com/ethereumjs/rlp). * @packageDocumentation */ -import BN from 'bn.js' import * as rlp from 'rlp' -/** - * [`BN`](https://github.com/indutny/bn.js) - */ -export { BN } - /** * [`rlp`](https://github.com/ethereumjs/rlp) */ diff --git a/packages/util/src/index.ts b/packages/util/src/index.ts index bda39a3f6c8..365db716c1f 100644 --- a/packages/util/src/index.ts +++ b/packages/util/src/index.ts @@ -34,7 +34,7 @@ export * from './bytes' export * from './object' /** - * External exports (BN, rlp) + * External exports (rlp) */ export * from './externals' diff --git a/packages/util/src/signature.ts b/packages/util/src/signature.ts index ed1b09afbd3..cd3bd4d36ba 100644 --- a/packages/util/src/signature.ts +++ b/packages/util/src/signature.ts @@ -1,9 +1,16 @@ import { signSync, recoverPublicKey } from 'ethereum-cryptography/secp256k1' -import { BN } from './externals' -import { toBuffer, setLengthLeft, bufferToHex, bufferToInt } from './bytes' +import { + toBuffer, + setLengthLeft, + bigIntToBuffer, + bufferToHex, + bufferToInt, + bufferToBigInt, +} from './bytes' +import { SECP256K1_ORDER, SECP256K1_ORDER_DIV_2 } from './constants' import { keccak } from './hash' import { assertIsBuffer } from './helpers' -import { BNLike, toType, TypeOutput } from './types' +import { BigIntLike, toType, TypeOutput } from './types' export interface ECDSASignature { v: number @@ -21,7 +28,11 @@ export interface ECDSASignatureBuffer { * Returns the ECDSA signature of a message hash. */ export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId?: number): ECDSASignature -export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId: BNLike): ECDSASignatureBuffer +export function ecsign( + msgHash: Buffer, + privateKey: Buffer, + chainId: BigIntLike +): ECDSASignatureBuffer export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId: any): any { const [signature, recovery] = signSync(msgHash, privateKey, { recovered: true, der: false }) @@ -35,28 +46,27 @@ export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId: any): any { 'The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)' ) } - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands const v = chainId ? recovery + (chainId * 2 + 35) : recovery + 27 return { r, s, v } } - const chainIdBN = toType(chainId as BNLike, TypeOutput.BN) - const v = chainIdBN.muln(2).addn(35).addn(recovery).toArrayLike(Buffer) + const chainIdBigInt = toType(chainId as BigIntLike, TypeOutput.BigInt) + const v = bigIntToBuffer(chainIdBigInt * BigInt(2) + BigInt(35) + BigInt(recovery)) return { r, s, v } } -function calculateSigRecovery(v: BNLike, chainId?: BNLike): BN { - const vBN = toType(v, TypeOutput.BN) +function calculateSigRecovery(v: BigIntLike, chainId?: BigIntLike): bigint { + const vBigInt = bufferToBigInt(toBuffer(v)) if (!chainId) { - return vBN.subn(27) + return vBigInt - BigInt(27) } - const chainIdBN = toType(chainId, TypeOutput.BN) - return vBN.sub(chainIdBN.muln(2).addn(35)) + const chainIdBigInt = bufferToBigInt(toBuffer(chainId)) + return vBigInt - (chainIdBigInt * BigInt(2) + BigInt(35)) } -function isValidSigRecovery(recovery: number | BN): boolean { - const rec = new BN(recovery) - return rec.eqn(0) || rec.eqn(1) +function isValidSigRecovery(recovery: number | bigint): boolean { + const rec = BigInt(recovery) + return rec === BigInt(0) || rec === BigInt(1) } /** @@ -65,10 +75,10 @@ function isValidSigRecovery(recovery: number | BN): boolean { */ export const ecrecover = function ( msgHash: Buffer, - v: BNLike, + v: BigIntLike, r: Buffer, s: Buffer, - chainId?: BNLike + chainId?: BigIntLike ): Buffer { const signature = Buffer.concat([setLengthLeft(r, 32), setLengthLeft(s, 32)], 64) const recovery = calculateSigRecovery(v, chainId) @@ -76,7 +86,7 @@ export const ecrecover = function ( throw new Error('Invalid signature v value') } - const senderPubKey = recoverPublicKey(msgHash, signature, recovery.toNumber()) + const senderPubKey = recoverPublicKey(msgHash, signature, Number(recovery)) return Buffer.from(senderPubKey.slice(1)) } @@ -84,7 +94,12 @@ export const ecrecover = function ( * Convert signature parameters into the format of `eth_sign` RPC method. * @returns Signature */ -export const toRpcSig = function (v: BNLike, r: Buffer, s: Buffer, chainId?: BNLike): string { +export const toRpcSig = function ( + v: BigIntLike, + r: Buffer, + s: Buffer, + chainId?: BigIntLike +): string { const recovery = calculateSigRecovery(v, chainId) if (!isValidSigRecovery(recovery)) { throw new Error('Invalid signature v value') @@ -98,7 +113,12 @@ export const toRpcSig = function (v: BNLike, r: Buffer, s: Buffer, chainId?: BNL * Convert signature parameters into the format of Compact Signature Representation (EIP-2098). * @returns Signature */ -export const toCompactSig = function (v: BNLike, r: Buffer, s: Buffer, chainId?: BNLike): string { +export const toCompactSig = function ( + v: BigIntLike, + r: Buffer, + s: Buffer, + chainId?: BigIntLike +): string { const recovery = calculateSigRecovery(v, chainId) if (!isValidSigRecovery(recovery)) { throw new Error('Invalid signature v value') @@ -155,18 +175,12 @@ export const fromRpcSig = function (sig: string): ECDSASignature { * @param homesteadOrLater Indicates whether this is being used on either the homestead hardfork or a later one */ export const isValidSignature = function ( - v: BNLike, + v: BigIntLike, r: Buffer, s: Buffer, homesteadOrLater: boolean = true, - chainId?: BNLike + chainId?: BigIntLike ): boolean { - const SECP256K1_N_DIV_2 = new BN( - '7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0', - 16 - ) - const SECP256K1_N = new BN('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141', 16) - if (r.length !== 32 || s.length !== 32) { return false } @@ -175,14 +189,19 @@ export const isValidSignature = function ( return false } - const rBN = new BN(r) - const sBN = new BN(s) + const rBigInt = bufferToBigInt(r) + const sBigInt = bufferToBigInt(s) - if (rBN.isZero() || rBN.gt(SECP256K1_N) || sBN.isZero() || sBN.gt(SECP256K1_N)) { + if ( + rBigInt === BigInt(0) || + rBigInt >= SECP256K1_ORDER || + sBigInt === BigInt(0) || + sBigInt >= SECP256K1_ORDER + ) { return false } - if (homesteadOrLater && sBN.cmp(SECP256K1_N_DIV_2) === 1) { + if (homesteadOrLater && sBigInt >= SECP256K1_ORDER_DIV_2) { return false } diff --git a/packages/util/src/types.ts b/packages/util/src/types.ts index 633dfe8362a..9f5bb893fc3 100644 --- a/packages/util/src/types.ts +++ b/packages/util/src/types.ts @@ -1,22 +1,28 @@ -import { BN } from './externals' import { isHexString } from './internal' import { Address } from './address' -import { unpadBuffer, toBuffer, ToBufferInputTypes } from './bytes' +import { + unpadBuffer, + toBuffer, + ToBufferInputTypes, + bigIntToBuffer, + bufferToBigInt, + bufferToHex, +} from './bytes' /* - * A type that represents a BNLike input that can be converted to a BN. + * A type that represents an input that can be converted to a BigInt. */ -export type BNLike = BN | PrefixedHexString | number | Buffer +export type BigIntLike = bigint | PrefixedHexString | number | Buffer /* - * A type that represents a BufferLike input that can be converted to a Buffer. + * A type that represents an input that can be converted to a Buffer. */ export type BufferLike = | Buffer | Uint8Array | number[] | number - | BN + | bigint | TransformableToBuffer | PrefixedHexString @@ -26,8 +32,7 @@ export type BufferLike = export type PrefixedHexString = string /** - * A type that represents an Address-like value. - * To convert to address, use `new Address(toBuffer(value))` + * A type that represents an input that can be converted to an Address. */ export type AddressLike = Address | Buffer | PrefixedHexString @@ -51,29 +56,20 @@ export type NestedUint8Array = Array export type NestedBufferArray = Array /** - * Convert BN to 0x-prefixed hex string. - */ -export function bnToHex(value: BN): PrefixedHexString { - return `0x${value.toString(16)}` -} - -/** - * Convert value from BN to an unpadded Buffer + * Convert value from bigint to an unpadded Buffer * (useful for RLP transport) * @param value value to convert */ -export function bnToUnpaddedBuffer(value: BN): Buffer { - // Using `bn.toArrayLike(Buffer)` instead of `bn.toBuffer()` - // for compatibility with browserify and similar tools - return unpadBuffer(value.toArrayLike(Buffer)) +export function bigIntToUnpaddedBuffer(value: bigint): Buffer { + return unpadBuffer(bigIntToBuffer(value)) } /** - * Deprecated alias for {@link bnToUnpaddedBuffer} + * Deprecated alias for {@link bigIntToUnpaddedBuffer} * @deprecated */ -export function bnToRlp(value: BN): Buffer { - return bnToUnpaddedBuffer(value) +export function bigIntToRlp(value: bigint): Buffer { + return bigIntToUnpaddedBuffer(value) } /** @@ -81,14 +77,14 @@ export function bnToRlp(value: BN): Buffer { */ export enum TypeOutput { Number, - BN, + BigInt, Buffer, PrefixedHexString, } export type TypeOutputReturnType = { [TypeOutput.Number]: number - [TypeOutput.BN]: BN + [TypeOutput.BigInt]: bigint [TypeOutput.Buffer]: Buffer [TypeOutput.PrefixedHexString]: PrefixedHexString } @@ -126,33 +122,27 @@ export function toType( const output = toBuffer(input) - if (outputType === TypeOutput.Buffer) { - return output as TypeOutputReturnType[T] - } else if (outputType === TypeOutput.BN) { - return new BN(output) as TypeOutputReturnType[T] - } else if (outputType === TypeOutput.Number) { - const bn = new BN(output) - const max = new BN(Number.MAX_SAFE_INTEGER.toString()) - if (bn.gt(max)) { - throw new Error( - 'The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)' - ) + switch (outputType) { + case TypeOutput.Buffer: + return output as TypeOutputReturnType[T] + case TypeOutput.BigInt: + return bufferToBigInt(output) as TypeOutputReturnType[T] + case TypeOutput.Number: { + const bigInt = bufferToBigInt(output) + if (bigInt > BigInt(Number.MAX_SAFE_INTEGER)) { + throw new Error( + 'The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)' + ) + } + return Number(bigInt) as TypeOutputReturnType[T] } - return bn.toNumber() as TypeOutputReturnType[T] - } else { - // outputType === TypeOutput.PrefixedHexString - return `0x${output.toString('hex')}` as TypeOutputReturnType[T] + case TypeOutput.PrefixedHexString: + return bufferToHex(output) as TypeOutputReturnType[T] + default: + throw new Error('unknown outputType') } } -export const bnToBigInt = (bn: BN) => { - return BigInt(new BN(bn).toString(10)) -} - -export const bigIntToBN = (num: bigint) => { - return new BN(num.toString(10)) -} - export const bigIntToHex = (num: bigint) => { return '0x' + num.toString(16) } diff --git a/packages/util/test/account.spec.ts b/packages/util/test/account.spec.ts index 5524d74e7f1..916bdaeccac 100644 --- a/packages/util/test/account.spec.ts +++ b/packages/util/test/account.spec.ts @@ -1,7 +1,6 @@ import tape from 'tape' import { Account, - BN, isValidPrivate, isValidPublic, importPublic, @@ -15,14 +14,17 @@ import { isValidAddress, toChecksumAddress, rlp, + bufferToBigInt, } from '../src' const eip1014Testdata = require('./testdata/eip1014Examples.json') +const _0n = BigInt(0) + tape('Account', function (t) { t.test('empty constructor', function (st) { const account = new Account() - st.ok(account.nonce.isZero(), 'should have zero nonce') - st.ok(account.balance.isZero(), 'should have zero balance') + st.equal(account.nonce, _0n, 'should have zero nonce') + st.equal(account.balance, _0n, 'should have zero balance') st.equal( account.stateRoot.toString('hex'), '56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', @@ -44,8 +46,8 @@ tape('Account', function (t) { '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470', // codeHash ] const account = Account.fromValuesArray(raw.map(toBuffer)) - st.ok(account.nonce.eqn(2), 'should have correct nonce') - st.ok(account.balance.eqn(900), 'should have correct balance') + st.equal(account.nonce, BigInt(2), 'should have correct nonce') + st.equal(account.balance, BigInt(900), 'should have correct balance') st.equal( account.stateRoot.toString('hex'), '56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', @@ -67,8 +69,8 @@ tape('Account', function (t) { codeHash: '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470', } const account = Account.fromAccountData(raw) - st.ok(account.nonce.eqn(2), 'should have correct nonce') - st.ok(account.balance.eqn(900), 'should have correct balance') + st.equal(account.nonce, BigInt(2), 'should have correct nonce') + st.equal(account.balance, BigInt(900), 'should have correct balance') st.equal( account.stateRoot.toString('hex'), '56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', @@ -88,8 +90,8 @@ tape('Account', function (t) { 'hex' ) const account = Account.fromRlpSerializedAccount(accountRlp) - st.ok(account.nonce.eqn(2), 'should have correct nonce') - st.ok(account.balance.eqn(900), 'should have correct balance') + st.equal(account.nonce, BigInt(2), 'should have correct nonce') + st.equal(account.balance, BigInt(900), 'should have correct balance') st.equal( account.stateRoot.toString('hex'), '56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', @@ -159,17 +161,17 @@ tape('Account', function (t) { new Account(undefined, undefined, undefined, Buffer.from('hey')) }, 'should only accept length 32 buffer for codeHash') - const data = { balance: new BN(5) } + const data = { balance: BigInt(5) } st.throws(() => { Account.fromRlpSerializedAccount(data as any) }, 'should only accept an array in fromRlpSerializedAccount') st.throws(() => { - new Account(new BN(-5)) + new Account(BigInt(-5)) }, 'should not accept nonce less than 0') st.throws(() => { - new Account(undefined, new BN(-5)) + new Account(undefined, BigInt(-5)) }, 'should not accept balance less than 0') st.end() }) @@ -177,10 +179,7 @@ tape('Account', function (t) { tape('Utility Functions', function (t) { t.test('isValidPrivate', function (st) { - const SECP256K1_N = new BN( - 'fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141', - 16 - ) + const SECP256K1_N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141') let tmp = '0011223344' st.notOk(isValidPrivate(Buffer.from(tmp, 'hex')), 'should fail on short input') @@ -200,10 +199,10 @@ tape('Utility Functions', function (t) { tmp = SECP256K1_N.toString(16) st.notOk(isValidPrivate(Buffer.from(tmp, 'hex')), 'should fail on invalid curve (== N)') - tmp = SECP256K1_N.addn(1).toString(16) + tmp = (SECP256K1_N + BigInt(1)).toString(16) st.notOk(isValidPrivate(Buffer.from(tmp, 'hex')), 'should fail on invalid curve (>= N)') - tmp = SECP256K1_N.subn(1).toString(16) + tmp = (SECP256K1_N - BigInt(1)).toString(16) st.ok(isValidPrivate(Buffer.from(tmp, 'hex')), 'should work otherwise (< N)') st.end() }) @@ -570,7 +569,7 @@ tape('Utility Functions', function (t) { for (const addr of addresses) { st.equal(toChecksumAddress(addr.toLowerCase(), Number(chainId)), addr) st.equal(toChecksumAddress(addr.toLowerCase(), Buffer.from([chainId] as any)), addr) - st.equal(toChecksumAddress(addr.toLowerCase(), new BN(chainId)), addr) + st.equal(toChecksumAddress(addr.toLowerCase(), BigInt(chainId)), addr) st.equal( toChecksumAddress( addr.toLowerCase(), @@ -586,7 +585,7 @@ tape('Utility Functions', function (t) { const addr = '0x88021160C5C792225E4E5452585947470010289D' const chainIDBuffer = Buffer.from('796f6c6f763378', 'hex') st.equal(toChecksumAddress(addr.toLowerCase(), chainIDBuffer), addr) - st.equal(toChecksumAddress(addr.toLowerCase(), new BN(chainIDBuffer)), addr) + st.equal(toChecksumAddress(addr.toLowerCase(), bufferToBigInt(chainIDBuffer)), addr) st.equal(toChecksumAddress(addr.toLowerCase(), '0x' + chainIDBuffer.toString('hex')), addr) const chainIDNumber = parseInt(chainIDBuffer.toString('hex'), 16) st.throws(() => { @@ -624,7 +623,7 @@ tape('Utility Functions', function (t) { for (const addr of addresses) { st.ok(isValidChecksumAddress(addr, Number(chainId))) st.ok(isValidChecksumAddress(addr, Buffer.from([chainId] as any))) - st.ok(isValidChecksumAddress(addr, new BN(chainId))) + st.ok(isValidChecksumAddress(addr, BigInt(chainId))) st.equal( isValidChecksumAddress(addr, '0x' + Buffer.from([chainId] as any).toString('hex')), true diff --git a/packages/util/test/address.spec.ts b/packages/util/test/address.spec.ts index 78d8f499b30..b4f9c5a5219 100644 --- a/packages/util/test/address.spec.ts +++ b/packages/util/test/address.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN, toBuffer } from '../src' +import { Address, toBuffer } from '../src' const eip1014Testdata = require('./testdata/eip1014Examples.json') tape('Address', (t) => { @@ -67,10 +67,10 @@ tape('Address', (t) => { t.test('should generate address for created contract', (st) => { const from = Address.fromString('0x990ccf8a0de58091c028d6ff76bb235ee67c1c39') - const addr = Address.generate(from, new BN(14)) + const addr = Address.generate(from, BigInt(14)) st.equal(addr.toString(), '0xd658a4b8247c14868f3c512fa5cbb6e458e4a989') - const addr2 = Address.generate(from, new BN(0)) + const addr2 = Address.generate(from, BigInt(0)) st.equal(addr2.toString(), '0xbfa69ba91385206bfdd2d8b9c1a5d6c10097a85b') st.end() }) diff --git a/packages/util/test/bytes.spec.ts b/packages/util/test/bytes.spec.ts index e8e1efef624..95fc5c932dc 100644 --- a/packages/util/test/bytes.spec.ts +++ b/packages/util/test/bytes.spec.ts @@ -2,7 +2,6 @@ import tape from 'tape' import { arrToBufArr, Address, - BN, bufArrToArr, zeros, zeroAddress, @@ -200,7 +199,7 @@ tape('toUnsigned', function (t) { t.test('should convert a signed (negative) number to unsigned', function (st) { const neg = '-452312848583266388373324160190187140051835877600158453279131187530910662656' const hex = 'ff00000000000000000000000000000000000000000000000000000000000000' - const num = new BN(neg) + const num = BigInt(neg) st.equal(toUnsigned(num).toString('hex'), hex) st.end() @@ -209,7 +208,7 @@ tape('toUnsigned', function (t) { t.test('should convert a signed (positive) number to unsigned', function (st) { const neg = '452312848583266388373324160190187140051835877600158453279131187530910662656' const hex = '0100000000000000000000000000000000000000000000000000000000000000' - const num = new BN(neg) + const num = BigInt(neg) st.equal(toUnsigned(num).toString('hex'), hex) st.end() @@ -267,8 +266,8 @@ tape('toBuffer', function (t) { st.ok(toBuffer(null).equals(Buffer.allocUnsafe(0))) // undefined st.ok(toBuffer(undefined).equals(Buffer.allocUnsafe(0))) - // 'toBN' - st.ok(toBuffer(new BN(1)).equals(Buffer.from([1]))) + // BigInt + st.ok(toBuffer(BigInt(1)).equals(Buffer.from([1]))) // 'toArray' st.ok( toBuffer({ @@ -284,7 +283,7 @@ tape('toBuffer', function (t) { toBuffer({ test: 1 } as any) }) st.throws(function () { - toBuffer(new BN(-10)) + toBuffer(BigInt(-10)) }) st.end() }) diff --git a/packages/util/test/constants.spec.ts b/packages/util/test/constants.spec.ts index 6fdae9ae19a..2ee3e5e51b2 100644 --- a/packages/util/test/constants.spec.ts +++ b/packages/util/test/constants.spec.ts @@ -8,23 +8,22 @@ import { KECCAK256_RLP_ARRAY, KECCAK256_RLP_S, KECCAK256_RLP, - TWO_POW256_BIGINT, } from '../src' tape('constants', function (t) { t.test('should match constants', function (st) { st.equal( - MAX_INTEGER.toString('hex'), + MAX_INTEGER.toString(16), 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' ) st.equal( - TWO_POW256.toString('hex'), + TWO_POW256.toString(16), '10000000000000000000000000000000000000000000000000000000000000000' ) st.equal( - TWO_POW256_BIGINT.toString(16), + TWO_POW256.toString(16), '10000000000000000000000000000000000000000000000000000000000000000' ) diff --git a/packages/util/test/externals.spec.ts b/packages/util/test/externals.spec.ts index afdd2f20feb..f42bce3e975 100644 --- a/packages/util/test/externals.spec.ts +++ b/packages/util/test/externals.spec.ts @@ -1,46 +1,7 @@ import tape from 'tape' -import BN_export from 'bn.js' import * as rlp_export from 'rlp' import * as src from '../src' -tape('External BN export', (t) => { - t.test('should export `BN`', (st) => { - st.equal(src.BN, BN_export) - st.end() - }) - - t.test('should use a BN function correctly', (st) => { - const a = new src.BN('dead', 16) - const b = new src.BN('101010', 2) - const result = a.add(b) - st.equal(result.toString(10), '57047') - st.end() - }) - - t.test('should throw on exceptions', (st) => { - // should not allow 0 input - st.throws(() => { - new src.BN(1).egcd(new src.BN('0')) - }, /^Error: Assertion failed$/) - st.end() - }) - - t.test('should not accept an unsafe integer', (st) => { - const num = Math.pow(2, 53) - st.throws(() => { - return new src.BN(num, 10) - }, /^Error: Assertion failed$/) - st.end() - }) - - t.test('should throw error with num eq 0x4000000', (st) => { - st.throws(function () { - new src.BN(0).iaddn(0x4000000) - }, /^Error: Assertion failed$/) - st.end() - }) -}) - tape('External rlp export', (t) => { t.test('should export `rlp`', (st) => { st.equal(src.rlp, rlp_export) @@ -113,7 +74,7 @@ tape('External ethjsUtil export', (t) => { t.test('should use ethjsUtil functions correctly', (st) => { // should convert intToHex - st.equal(src.intToHex(new src.BN(0).toNumber()), '0x0') + st.equal(src.intToHex(0), '0x0') // should convert intToHex const i = 6003400 diff --git a/packages/util/test/signature.spec.ts b/packages/util/test/signature.spec.ts index 9163568be45..de543358be5 100644 --- a/packages/util/test/signature.spec.ts +++ b/packages/util/test/signature.spec.ts @@ -1,6 +1,5 @@ import tape from 'tape' import { - BN, ecsign, ecrecover, privateToPublic, @@ -10,6 +9,8 @@ import { toRpcSig, toCompactSig, intToBuffer, + bufferToBigInt, + bigIntToBuffer, } from '../src' const echash = Buffer.from( @@ -71,7 +72,7 @@ tape('ecsign', function (t) { st.ok(sig.s.equals(expectedSigS)) st.equal(sig.v, 150 * 2 + 35) - let sigBuffer = ecsign(echash, ecprivkey, new BN(150)) + let sigBuffer = ecsign(echash, ecprivkey, BigInt(150)) st.ok(sigBuffer.r.equals(expectedSigR)) st.ok(sigBuffer.s.equals(expectedSigS)) st.ok(sigBuffer.v.equals(expectedSigV)) @@ -102,7 +103,7 @@ tape('ecsign', function (t) { ) const expectedSigV = Buffer.from('f2ded8deec6713', 'hex') - let sigBuffer = ecsign(echash, ecprivkey, new BN(chainIDBuffer)) + let sigBuffer = ecsign(echash, ecprivkey, bufferToBigInt(chainIDBuffer)) st.ok(sigBuffer.r.equals(expectedSigR)) st.ok(sigBuffer.s.equals(expectedSigS)) st.ok(sigBuffer.v.equals(expectedSigV)) @@ -206,10 +207,10 @@ tape('ecrecover', function (t) { let sender = ecrecover(msgHash, vBuffer, r, s, chainIDBuffer) st.ok(sender.equals(senderPubKey), 'sender pubkey correct (Buffer)') - const vBN = new BN(vBuffer) - const chainIDBN = new BN(chainIDBuffer) - sender = ecrecover(msgHash, vBN, r, s, chainIDBN) - st.ok(sender.equals(senderPubKey), 'sender pubkey correct (BN)') + const vBigInt = bufferToBigInt(vBuffer) + const chainIDBigInt = bufferToBigInt(chainIDBuffer) + sender = ecrecover(msgHash, vBigInt, r, s, chainIDBigInt) + st.ok(sender.equals(senderPubKey), 'sender pubkey correct (BigInt)') const vHexString = '0xf2ded8deec6714' const chainIDHexString = '0x796f6c6f763378' @@ -280,27 +281,24 @@ tape('isValidSignature', function (t) { st.end() }) t.test('should fail when on homestead and s > secp256k1n/2', function (st) { - const SECP256K1_N_DIV_2 = new BN( - '7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0', - 16 + const SECP256K1_N_DIV_2 = BigInt( + '0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0' ) const r = Buffer.from('99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9', 'hex') - const s = Buffer.from(SECP256K1_N_DIV_2.add(new BN('1', 16)).toString(16), 'hex') + const s = bigIntToBuffer(SECP256K1_N_DIV_2 + BigInt(1)) const v = 27 st.notOk(isValidSignature(v, r, s, true)) st.end() }) t.test('should not fail when not on homestead but s > secp256k1n/2', function (st) { - const SECP256K1_N_DIV_2 = new BN( - '7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0', - 16 + const SECP256K1_N_DIV_2 = BigInt( + '0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0' ) const r = Buffer.from('99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9', 'hex') - const s = Buffer.from(SECP256K1_N_DIV_2.add(new BN('1', 16)).toString(16), 'hex') - + const s = bigIntToBuffer(SECP256K1_N_DIV_2 + BigInt(1)) const v = 27 st.ok(isValidSignature(v, r, s, false)) st.end() @@ -326,7 +324,7 @@ tape('isValidSignature', function (t) { const v = chainId * 2 + 35 st.ok(isValidSignature(v, r, s, false, chainId)) st.ok(isValidSignature(intToBuffer(v), r, s, false, intToBuffer(chainId))) - st.ok(isValidSignature(new BN(v), r, s, false, new BN(chainId))) + st.ok(isValidSignature(BigInt(v), r, s, false, BigInt(chainId))) st.ok( isValidSignature( '0x' + intToBuffer(v).toString('hex'), @@ -345,7 +343,7 @@ tape('isValidSignature', function (t) { const vBuffer = Buffer.from('f2ded8deec6714', 'hex') const chainIDBuffer = Buffer.from('796f6c6f763378', 'hex') st.ok(isValidSignature(vBuffer, r, s, false, chainIDBuffer)) - st.ok(isValidSignature(new BN(vBuffer), r, s, false, new BN(chainIDBuffer))) + st.ok(isValidSignature(bufferToBigInt(vBuffer), r, s, false, bufferToBigInt(chainIDBuffer))) st.ok( isValidSignature( '0x' + vBuffer.toString('hex'), @@ -415,7 +413,7 @@ tape('message sig', function (t) { const v = chainId * 2 + 35 st.equal(toRpcSig(v, r, s, chainId), sig) st.equal(toRpcSig(intToBuffer(v), r, s, intToBuffer(chainId)), sig) - st.equal(toRpcSig(new BN(v), r, s, new BN(chainId)), sig) + st.equal(toRpcSig(BigInt(v), r, s, BigInt(chainId)), sig) st.equal( toRpcSig( '0x' + intToBuffer(v).toString('hex'), @@ -441,7 +439,7 @@ tape('message sig', function (t) { const chainIDBuffer = Buffer.from('796f6c6f763378', 'hex') const vBuffer = Buffer.from('f2ded8deec6714', 'hex') st.equal(toRpcSig(vBuffer, r, s, chainIDBuffer), sig) - st.equal(toRpcSig(new BN(vBuffer), r, s, new BN(chainIDBuffer)), sig) + st.equal(toRpcSig(bufferToBigInt(vBuffer), r, s, bufferToBigInt(chainIDBuffer)), sig) st.equal( toRpcSig('0x' + vBuffer.toString('hex'), r, s, '0x' + chainIDBuffer.toString('hex')), sig diff --git a/packages/util/test/types.spec.ts b/packages/util/test/types.spec.ts index ac1f62f5aaa..ec009b22f15 100644 --- a/packages/util/test/types.spec.ts +++ b/packages/util/test/types.spec.ts @@ -1,27 +1,25 @@ import tape from 'tape' import { - BN, toType, TypeOutput, intToBuffer, bufferToHex, intToHex, - bnToHex, - bnToUnpaddedBuffer, + bigIntToUnpaddedBuffer, toBuffer, - bnToBigInt, - bigIntToBN, bigIntToHex, + bigIntToBuffer, + bufferToBigInt, } from '../src' tape('toType', function (t) { t.test('from null and undefined', function (st) { st.equal(toType(null, TypeOutput.Number), null) - st.equal(toType(null, TypeOutput.BN), null) + st.equal(toType(null, TypeOutput.BigInt), null) st.equal(toType(null, TypeOutput.Buffer), null) st.equal(toType(null, TypeOutput.PrefixedHexString), null) st.equal(toType(undefined, TypeOutput.Number), undefined) - st.equal(toType(undefined, TypeOutput.BN), undefined) + st.equal(toType(undefined, TypeOutput.BigInt), undefined) st.equal(toType(undefined, TypeOutput.Buffer), undefined) st.equal(toType(undefined, TypeOutput.PrefixedHexString), undefined) st.end() @@ -33,9 +31,9 @@ tape('toType', function (t) { st.strictEqual(result, num) st.end() }) - st.test('should convert to BN', function (st) { - const result = toType(num, TypeOutput.BN) - st.ok(result.eq(new BN(num))) + st.test('should convert to BigInt', function (st) { + const result = toType(num, TypeOutput.BigInt) + st.equal(result, BigInt(num)) st.end() }) st.test('should convert to Buffer', function (st) { @@ -45,43 +43,43 @@ tape('toType', function (t) { }) st.test('should convert to PrefixedHexString', function (st) { const result = toType(num, TypeOutput.PrefixedHexString) - st.strictEqual(result, bufferToHex(new BN(num).toArrayLike(Buffer))) + st.strictEqual(result, bufferToHex(bigIntToBuffer(BigInt(num)))) st.end() }) st.test('should throw an error if greater than MAX_SAFE_INTEGER', function (st) { st.throws(() => { const num = Number.MAX_SAFE_INTEGER + 1 - toType(num, TypeOutput.BN) + toType(num, TypeOutput.BigInt) }, /^Error: The provided number is greater than MAX_SAFE_INTEGER \(please use an alternative input type\)$/) st.end() }) }) - t.test('from BN', function (st) { - const num = new BN(1000) + t.test('from BigInt', function (st) { + const num = BigInt(1000) st.test('should convert to Number', function (st) { const result = toType(num, TypeOutput.Number) - st.strictEqual(result, num.toNumber()) + st.strictEqual(result, Number(num)) st.end() }) - st.test('should convert to BN', function (st) { - const result = toType(num, TypeOutput.BN) - st.ok(result.eq(num)) + st.test('should convert to BigInt', function (st) { + const result = toType(num, TypeOutput.BigInt) + st.equal(result, num) st.end() }) st.test('should convert to Buffer', function (st) { const result = toType(num, TypeOutput.Buffer) - st.ok(result.equals(num.toArrayLike(Buffer))) + st.ok(result.equals(bigIntToBuffer(num))) st.end() }) st.test('should convert to PrefixedHexString', function (st) { const result = toType(num, TypeOutput.PrefixedHexString) - st.strictEqual(result, bufferToHex(num.toArrayLike(Buffer))) + st.strictEqual(result, bufferToHex(bigIntToBuffer(num))) st.end() }) st.test( 'should throw an error if converting to Number and greater than MAX_SAFE_INTEGER', function (st) { - const num = new BN(Number.MAX_SAFE_INTEGER).addn(1) + const num = BigInt(Number.MAX_SAFE_INTEGER) + BigInt(1) st.throws(() => { toType(num, TypeOutput.Number) }, /^Error: The provided number is greater than MAX_SAFE_INTEGER \(please use an alternative output type\)$/) @@ -96,9 +94,9 @@ tape('toType', function (t) { st.ok(intToBuffer(result).equals(num)) st.end() }) - st.test('should convert to BN', function (st) { - const result = toType(num, TypeOutput.BN) - st.ok(result.eq(new BN(num))) + st.test('should convert to BigInt', function (st) { + const result = toType(num, TypeOutput.BigInt) + st.equal(result, bufferToBigInt(num)) st.end() }) st.test('should convert to Buffer', function (st) { @@ -119,9 +117,9 @@ tape('toType', function (t) { st.strictEqual(intToHex(result), num) st.end() }) - st.test('should convert to BN', function (st) { - const result = toType(num, TypeOutput.BN) - st.strictEqual(bnToHex(result), num) + st.test('should convert to BigInt', function (st) { + const result = toType(num, TypeOutput.BigInt) + st.strictEqual(bigIntToHex(result), num) st.end() }) st.test('should convert to Buffer', function (st) { @@ -138,24 +136,14 @@ tape('toType', function (t) { }) }) -tape('bnToUnpaddedBuffer', function (t) { +tape('bigIntToUnpaddedBuffer', function (t) { t.test('should equal unpadded buffer value', function (st) { - st.ok(bnToUnpaddedBuffer(new BN(0)).equals(Buffer.from([]))) - st.ok(bnToUnpaddedBuffer(new BN(100)).equals(Buffer.from('64', 'hex'))) + st.ok(bigIntToUnpaddedBuffer(BigInt(0)).equals(Buffer.from([]))) + st.ok(bigIntToUnpaddedBuffer(BigInt(100)).equals(Buffer.from('64', 'hex'))) st.end() }) }) -tape('bnToBigInt', (st) => { - st.equal(bnToBigInt(new BN(1)), BigInt(1)) - st.end() -}) - -tape('bigIntToBN', (st) => { - st.ok(bigIntToBN(BigInt(1)).eq(new BN(1))) - st.end() -}) - tape('bigIntToHex', (st) => { st.equal(bigIntToHex(BigInt(1)), '0x1') st.end() diff --git a/packages/vm/benchmarks/mainnetBlocks.ts b/packages/vm/benchmarks/mainnetBlocks.ts index 156759a5050..c660cb87bcd 100644 --- a/packages/vm/benchmarks/mainnetBlocks.ts +++ b/packages/vm/benchmarks/mainnetBlocks.ts @@ -30,7 +30,7 @@ export async function mainnetBlocks(suite?: Benchmark.Suite, numSamples?: number for (const blockData of data) { const block = blockFromRPC(blockData.block, [], { common }) - const blockNumber = block.header.number.toNumber() + const blockNumber = Number(block.header.number) const { receipts, preState, blockhashes } = blockData if ([9422909, 9422911, 9422912, 9422913, 9422914].includes(blockNumber)) { diff --git a/packages/vm/benchmarks/mockchain.ts b/packages/vm/benchmarks/mockchain.ts index b1d094f6e82..d8e46c6a693 100644 --- a/packages/vm/benchmarks/mockchain.ts +++ b/packages/vm/benchmarks/mockchain.ts @@ -1,5 +1,3 @@ -import { BN } from 'ethereumjs-util' - // Mockchain: only used to provide blockhashes for the BLOCKHASH opcode for the VM. Has no other uses. export default class Mockchain { _hashes: any @@ -8,7 +6,7 @@ export default class Mockchain { this._hashes = {} } - getBlock(num: BN): any { + getBlock(num: bigint): any { const bhash = this._hashes[num.toString()] return { hash() { @@ -17,7 +15,7 @@ export default class Mockchain { } } - putBlockHash(num: BN, hash: Buffer): void { + putBlockHash(num: bigint, hash: Buffer): void { this._hashes[num.toString()] = hash } } diff --git a/packages/vm/benchmarks/util.ts b/packages/vm/benchmarks/util.ts index c2b1b29efaf..193df1a8425 100644 --- a/packages/vm/benchmarks/util.ts +++ b/packages/vm/benchmarks/util.ts @@ -1,4 +1,4 @@ -import { Account, Address, toBuffer, bufferToInt, BN, bnToBigInt } from 'ethereumjs-util' +import { Account, Address, toBuffer } from 'ethereumjs-util' import Common from '@ethereumjs/common' import { Block } from '@ethereumjs/block' import { StateManager, DefaultStateManager } from '../dist/state' @@ -31,7 +31,7 @@ export async function getPreState( for (const k in pre) { const address = new Address(toBuffer(k)) const { nonce, balance, code, storage } = pre[k] - const account = new Account(new BN(hexToBuffer(nonce)), new BN(hexToBuffer(balance))) + const account = new Account(BigInt(nonce), BigInt(balance)) await state.putAccount(address, account) await state.putContractCode(address, toBuffer(code)) for (const sk in storage) { @@ -50,23 +50,13 @@ export async function getPreState( export function getBlockchain(blockhashes: any): Mockchain { let mockchain = new Mockchain() - for (let hashStr in blockhashes) { - const bn = new BN(hashStr.substr(2), 'hex') - const hash = blockhashes[hashStr] - const hashBuffer = Buffer.from(hash.substr(2), 'hex') - mockchain.putBlockHash(bn, hashBuffer) + for (const blockNum in blockhashes) { + const hash = blockhashes[blockNum] + mockchain.putBlockHash(BigInt(blockNum), toBuffer(hash)) } return mockchain } -const hexToBuffer = (h: string, allowZero: boolean = false): Buffer => { - const buf = toBuffer(h) - if (!allowZero && buf.toString('hex') === '00') { - return Buffer.alloc(0) - } - return buf -} - export const verifyResult = (block: Block, result: RunBlockResult) => { // verify the receipt root, the logs bloom and the gas used after block execution, // throw if any of these is not the expected value @@ -84,9 +74,8 @@ export const verifyResult = (block: Block, result: RunBlockResult) => { let cumGasUsedActual = parseInt(receipts[index].gasUsed.toString('hex'), 16) let gasUsed = cumGasUsedActual - cumGasUsed if (gasUsed !== gasUsedExpected) { - const blockNumber = block.header.number.toNumber() console.log(`[DEBUG] - Transaction at index ${index} of block ${blockNumber} + Transaction at index ${index} of block ${block.header.number} did not yield expected gas. Gas used expected: ${gasUsedExpected}, actual: ${gasUsed}, @@ -100,7 +89,7 @@ export const verifyResult = (block: Block, result: RunBlockResult) => { if (!result.logsBloom.equals(block.header.logsBloom)) { throw new Error('invalid logsBloom') } - if (!(bnToBigInt(block.header.gasUsed) === result.gasUsed)) { + if (block.header.gasUsed !== result.gasUsed) { throw new Error('invalid gasUsed') } } diff --git a/packages/vm/examples/helpers/account-utils.ts b/packages/vm/examples/helpers/account-utils.ts index 18b525248da..9dbcd0a87b5 100644 --- a/packages/vm/examples/helpers/account-utils.ts +++ b/packages/vm/examples/helpers/account-utils.ts @@ -1,6 +1,5 @@ import VM from '../../dist' import { Account, Address } from 'ethereumjs-util' -import { BN } from 'ethereumjs-util/dist/externals' export const keyPair = { secretKey: '0x3cd7232cd6f3fc66a57a6bedc1a8ed6c228fff0a327e169c2bcc5e869ed49511', @@ -11,7 +10,7 @@ export const keyPair = { export const insertAccount = async (vm: VM, address: Address) => { const acctData = { nonce: 0, - balance: new BN(10).pow(new BN(18)), // 1 eth + balance: BigInt(10) ** BigInt(18), // 1 eth } const account = Account.fromAccountData(acctData) diff --git a/packages/vm/examples/helpers/tx-builder.ts b/packages/vm/examples/helpers/tx-builder.ts index 835fbe90667..27748af4e2c 100644 --- a/packages/vm/examples/helpers/tx-builder.ts +++ b/packages/vm/examples/helpers/tx-builder.ts @@ -1,6 +1,5 @@ import { Interface, defaultAbiCoder as AbiCoder } from '@ethersproject/abi' import { AccessListEIP2930TxData, FeeMarketEIP1559TxData, TxData } from '@ethereumjs/tx' -import { BN } from 'ethereumjs-util' type TransactionsData = TxData | AccessListEIP2930TxData | FeeMarketEIP1559TxData @@ -36,7 +35,7 @@ export const encodeDeployment = ( export const buildTransaction = (data: Partial): TransactionsData => { const defaultData: Partial = { - nonce: new BN(0), + nonce: BigInt(0), gasLimit: 2_000_000, // We assume that 2M is enough, gasPrice: 1, value: 0, diff --git a/packages/vm/src/buildBlock.ts b/packages/vm/src/buildBlock.ts index 15de3d24d68..3b055052b8f 100644 --- a/packages/vm/src/buildBlock.ts +++ b/packages/vm/src/buildBlock.ts @@ -1,4 +1,4 @@ -import { Address, toBuffer, rlp, bnToBigInt, bigIntToBN, toType, TypeOutput } from 'ethereumjs-util' +import { Address, toBuffer, rlp, toType, TypeOutput } from 'ethereumjs-util' import { BaseTrie as Trie } from 'merkle-patricia-tree' import { Block, BlockOptions, HeaderData } from '@ethereumjs/block' import { ConsensusType } from '@ethereumjs/common' @@ -88,7 +88,7 @@ export class BlockBuilder { this.headerData = { ...opts.headerData, parentHash: opts.headerData?.parentHash ?? opts.parentBlock.hash(), - number: opts.headerData?.number ?? opts.parentBlock.header.number.addn(1), + number: opts.headerData?.number ?? opts.parentBlock.header.number + BigInt(1), gasLimit: opts.headerData?.gasLimit ?? opts.parentBlock.header.gasLimit, } @@ -173,15 +173,15 @@ export class BlockBuilder { // According to the Yellow Paper, a transaction's gas limit // cannot be greater than the remaining gas in the block - const blockGasLimit = bnToBigInt(toType(this.headerData.gasLimit, TypeOutput.BN)) + const blockGasLimit = toType(this.headerData.gasLimit, TypeOutput.BigInt) const blockGasRemaining = blockGasLimit - this.gasUsed - if (bnToBigInt(tx.gasLimit) > blockGasRemaining) { + if (tx.gasLimit > blockGasRemaining) { throw new Error('tx has a higher gas limit than the remaining gas in the block') } const header = { ...this.headerData, - gasUsed: bigIntToBN(this.gasUsed), + gasUsed: this.gasUsed, } const blockData = { header, transactions: this.transactions } const block = Block.fromBlockData(blockData, this.blockOpts) @@ -230,7 +230,7 @@ export class BlockBuilder { const transactionsTrie = await this.transactionsTrie() const receiptTrie = await this.receiptTrie() const logsBloom = this.logsBloom() - const gasUsed = bigIntToBN(this.gasUsed) + const gasUsed = this.gasUsed const timestamp = this.headerData.timestamp ?? Math.round(Date.now() / 1000) const headerData = { diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index 7b7f0d6623b..04ba789c448 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -1,5 +1,5 @@ import { debug as createDebugLogger } from 'debug' -import { Account, Address, BN, MAX_UINT64, bufferToBigInt, bnToBigInt } from 'ethereumjs-util' +import { Account, Address, MAX_UINT64, bufferToBigInt } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { ConsensusAlgorithm } from '@ethereumjs/common' @@ -159,19 +159,19 @@ export default class EEI { async getExternalBalance(address: Address): Promise { // shortcut if current account if (address.equals(this._env.address)) { - return bnToBigInt(this._env.contract.balance) + return this._env.contract.balance } // otherwise load account then return balance const account = await this._state.getAccount(address) - return bnToBigInt(account.balance) + return account.balance } /** * Returns balance of self. */ getSelfBalance(): bigint { - return bnToBigInt(this._env.contract.balance) + return this._env.contract.balance } /** @@ -284,7 +284,7 @@ export default class EEI { * Returns the block’s number. */ getBlockNumber(): bigint { - return bnToBigInt(this._env.block.header.number) + return this._env.block.header.number } /** @@ -310,14 +310,14 @@ export default class EEI { * Returns the block's timestamp. */ getBlockTimestamp(): bigint { - return bnToBigInt(this._env.block.header.timestamp) + return this._env.block.header.timestamp } /** * Returns the block's difficulty. */ getBlockDifficulty(): bigint { - return bnToBigInt(this._env.block.header.difficulty) + return this._env.block.header.difficulty } /** @@ -331,7 +331,7 @@ export default class EEI { * Returns the block's gas limit. */ getBlockGasLimit(): bigint { - return bnToBigInt(this._env.block.header.gasLimit) + return this._env.block.header.gasLimit } /** @@ -339,7 +339,7 @@ export default class EEI { * CHAINID opcode proposed in [EIP-1344](https://eips.ethereum.org/EIPS/eip-1344). */ getChainId(): bigint { - return bnToBigInt(this._common.chainId()) + return this._common.chainId() } /** @@ -351,7 +351,7 @@ export default class EEI { // Sanity check throw new Error('Block has no Base Fee') } - return bnToBigInt(baseFee) + return baseFee } /** @@ -448,12 +448,12 @@ export default class EEI { // Add to beneficiary balance const toAccount = await this._state.getAccount(toAddress) - toAccount.balance.iadd(this._env.contract.balance) + toAccount.balance += this._env.contract.balance await this._state.putAccount(toAddress, toAccount) // Subtract from contract balance await this._state.modifyAccountFields(this._env.address, { - balance: new BN(0), + balance: BigInt(0), }) trap(ERROR.STOP) @@ -569,7 +569,7 @@ export default class EEI { // Check if account has enough ether and max depth not exceeded if ( this._env.depth >= this._common.param('vm', 'stackLimit') || - (msg.delegatecall !== true && bnToBigInt(this._env.contract.balance) < msg.value) + (msg.delegatecall !== true && this._env.contract.balance < msg.value) ) { return BigInt(0) } @@ -628,17 +628,17 @@ export default class EEI { // Check if account has enough ether and max depth not exceeded if ( this._env.depth >= this._common.param('vm', 'stackLimit') || - (msg.delegatecall !== true && bnToBigInt(this._env.contract.balance) < msg.value) + (msg.delegatecall !== true && this._env.contract.balance < msg.value) ) { return BigInt(0) } // EIP-2681 check - if (this._env.contract.nonce.gte(MAX_UINT64)) { + if (this._env.contract.nonce >= MAX_UINT64) { return BigInt(0) } - this._env.contract.nonce.iaddn(1) + this._env.contract.nonce += BigInt(1) await this._state.putAccount(this._env.address, this._env.contract) if (this._common.isActivatedEIP(3860)) { diff --git a/packages/vm/src/evm/evm.ts b/packages/vm/src/evm/evm.ts index 1bcd70efcdf..6e4e79cc4a7 100644 --- a/packages/vm/src/evm/evm.ts +++ b/packages/vm/src/evm/evm.ts @@ -2,7 +2,7 @@ import { debug as createDebugLogger } from 'debug' import { Account, Address, - bigIntToBN, + bigIntToBuffer, generateAddress, generateAddress2, KECCAK256_NULL, @@ -338,7 +338,10 @@ export default class EVM { let toAccount = await this._state.getAccount(message.to) // Check for collision - if ((toAccount.nonce && toAccount.nonce.gtn(0)) || !toAccount.codeHash.equals(KECCAK256_NULL)) { + if ( + (toAccount.nonce && toAccount.nonce > BigInt(0)) || + !toAccount.codeHash.equals(KECCAK256_NULL) + ) { if (this._vm.DEBUG) { debug(`Returning on address collision`) } @@ -365,7 +368,7 @@ export default class EVM { toAccount = await this._state.getAccount(message.to) // EIP-161 on account creation and CREATE execution if (this._vm._common.gteHardfork('spuriousDragon')) { - toAccount.nonce.iaddn(1) + toAccount.nonce += BigInt(1) } // Add tx value to the `to` account @@ -629,14 +632,14 @@ export default class EVM { addr = generateAddress2(message.caller.buf, message.salt, message.code as Buffer) } else { const acc = await this._state.getAccount(message.caller) - const newNonce = acc.nonce.subn(1) - addr = generateAddress(message.caller.buf, newNonce.toArrayLike(Buffer)) + const newNonce = acc.nonce - BigInt(1) + addr = generateAddress(message.caller.buf, bigIntToBuffer(newNonce)) } return new Address(addr) } async _reduceSenderBalance(account: Account, message: Message): Promise { - account.balance.isub(bigIntToBN(message.value)) + account.balance -= message.value const result = this._state.putAccount(message.caller, account) if (this._vm.DEBUG) { debug(`Reduced sender (${message.caller}) balance (-> ${account.balance})`) @@ -645,8 +648,8 @@ export default class EVM { } async _addToBalance(toAccount: Account, message: Message): Promise { - const newBalance = toAccount.balance.add(bigIntToBN(message.value)) - if (newBalance.gt(MAX_INTEGER)) { + const newBalance = toAccount.balance + message.value + if (newBalance > MAX_INTEGER) { throw new VmError(ERROR.VALUE_OVERFLOW) } toAccount.balance = newBalance diff --git a/packages/vm/src/evm/interpreter.ts b/packages/vm/src/evm/interpreter.ts index 534d49d89b2..752fd89b111 100644 --- a/packages/vm/src/evm/interpreter.ts +++ b/packages/vm/src/evm/interpreter.ts @@ -179,7 +179,7 @@ export default class Interpreter { if (opInfo.dynamicGas) { const dynamicGasHandler = this._vm._dynamicGasHandlers.get(this._runState.opCode)! - // This function updates the gas BN in-place using `i*` methods + // This function updates the gas in-place. // It needs the base fee, for correct gas limit calculation for the CALL opcodes gas = await dynamicGasHandler(this._runState, gas, this._vm._common) } @@ -283,8 +283,8 @@ export default class Interpreter { * @property {fee} opcode.number Base fee of the opcode * @property {dynamicFee} opcode.dynamicFee Dynamic opcode fee * @property {boolean} opcode.isAsync opcode is async - * @property {BN} gasLeft amount of gasLeft - * @property {BN} gasRefund gas refund + * @property {BigInt} gasLeft amount of gasLeft + * @property {BigInt} gasRefund gas refund * @property {StateManager} stateManager a {@link StateManager} instance * @property {Array} stack an `Array` of `Buffers` containing the stack * @property {Array} returnStack the return stack @@ -292,7 +292,7 @@ export default class Interpreter { * @property {Address} address the address of the `account` * @property {Number} depth the current number of calls deep the contract is * @property {Buffer} memory the memory of the VM as a `buffer` - * @property {BN} memoryWordCount current size of memory in words + * @property {BigInt} memoryWordCount current size of memory in words * @property {Address} codeAddress the address of the code which is currently being ran (this differs from `address` in a `DELEGATECALL` and `CALLCODE` call) */ return this._vm._emit('step', eventObj) diff --git a/packages/vm/src/evm/opcodes/EIP2929.ts b/packages/vm/src/evm/opcodes/EIP2929.ts index c9780cc55fa..f2887cf2eca 100644 --- a/packages/vm/src/evm/opcodes/EIP2929.ts +++ b/packages/vm/src/evm/opcodes/EIP2929.ts @@ -76,10 +76,10 @@ export function accessStorageEIP2929( * location is already warm * @param {RunState} runState * @param {Buffer} key storage slot - * @param {BN} defaultCost SSTORE_RESET_GAS / SLOAD + * @param {BigInt} defaultCost SSTORE_RESET_GAS / SLOAD * @param {string} costName parameter name ('noop') * @param {Common} common - * @return {BN} adjusted cost + * @return {BigInt} adjusted cost */ export function adjustSstoreGasEIP2929( runState: RunState, diff --git a/packages/vm/src/evm/opcodes/functions.ts b/packages/vm/src/evm/opcodes/functions.ts index cabfea1fb85..b737a410656 100644 --- a/packages/vm/src/evm/opcodes/functions.ts +++ b/packages/vm/src/evm/opcodes/functions.ts @@ -3,7 +3,7 @@ import { Address, keccak256, KECCAK256_NULL, - TWO_POW256_BIGINT, + TWO_POW256, MAX_INTEGER_BIGINT, setLengthLeft, bufferToBigInt, @@ -49,7 +49,7 @@ export const handlers: Map = new Map([ 0x01, function (runState) { const [a, b] = runState.stack.popN(2) - const r = mod(a + b, TWO_POW256_BIGINT) + const r = mod(a + b, TWO_POW256) runState.stack.push(r) }, ], @@ -58,7 +58,7 @@ export const handlers: Map = new Map([ 0x02, function (runState) { const [a, b] = runState.stack.popN(2) - const r = mod(a * b, TWO_POW256_BIGINT) + const r = mod(a * b, TWO_POW256) runState.stack.push(r) }, ], @@ -67,7 +67,7 @@ export const handlers: Map = new Map([ 0x03, function (runState) { const [a, b] = runState.stack.popN(2) - const r = mod(a - b, TWO_POW256_BIGINT) + const r = mod(a - b, TWO_POW256) runState.stack.push(r) }, ], @@ -80,7 +80,7 @@ export const handlers: Map = new Map([ if (b === BigInt(0)) { r = BigInt(0) } else { - r = mod(a / b, TWO_POW256_BIGINT) + r = mod(a / b, TWO_POW256) } runState.stack.push(r) }, @@ -371,7 +371,7 @@ export const handlers: Map = new Map([ function (runState) { const [offset, length] = runState.stack.popN(2) let data = Buffer.alloc(0) - if (!(length === BigInt(0))) { + if (length !== BigInt(0)) { data = runState.memory.read(Number(offset), Number(length)) } const r = bufferToBigInt(keccak256(data)) @@ -452,7 +452,7 @@ export const handlers: Map = new Map([ function (runState) { const [memOffset, dataOffset, dataLength] = runState.stack.popN(3) - if (!(dataLength === BigInt(0))) { + if (dataLength !== BigInt(0)) { const data = getDataSlice(runState.eei.getCallData(), dataOffset, dataLength) const memOffsetNum = Number(memOffset) const dataLengthNum = Number(dataLength) @@ -474,7 +474,7 @@ export const handlers: Map = new Map([ function (runState) { const [memOffset, codeOffset, dataLength] = runState.stack.popN(3) - if (!(dataLength === BigInt(0))) { + if (dataLength !== BigInt(0)) { const data = getDataSlice(runState.eei.getCode(), codeOffset, dataLength) const memOffsetNum = Number(memOffset) const lengthNum = Number(dataLength) @@ -496,10 +496,10 @@ export const handlers: Map = new Map([ [ 0x3c, async function (runState) { - const [addressBN, memOffset, codeOffset, dataLength] = runState.stack.popN(4) + const [addressBigInt, memOffset, codeOffset, dataLength] = runState.stack.popN(4) - if (!(dataLength === BigInt(0))) { - const code = await runState.eei.getExternalCode(addressBN) + if (dataLength !== BigInt(0)) { + const code = await runState.eei.getExternalCode(addressBigInt) const data = getDataSlice(code, codeOffset, dataLength) const memOffsetNum = Number(memOffset) @@ -543,7 +543,7 @@ export const handlers: Map = new Map([ function (runState) { const [memOffset, returnDataOffset, dataLength] = runState.stack.popN(3) - if (!(dataLength === BigInt(0))) { + if (dataLength !== BigInt(0)) { const data = getDataSlice(runState.eei.getReturnData(), returnDataOffset, dataLength) const memOffsetNum = Number(memOffset) const lengthNum = Number(dataLength) @@ -729,7 +729,7 @@ export const handlers: Map = new Map([ 0x57, function (runState) { const [dest, cond] = runState.stack.popN(2) - if (!(cond === BigInt(0))) { + if (cond !== BigInt(0)) { if (dest > runState.eei.getCodeSize()) { trap(ERROR.INVALID_JUMP + ' at ' + describeLocation(runState)) } @@ -861,7 +861,7 @@ export const handlers: Map = new Map([ }) let mem = Buffer.alloc(0) - if (!(memLength === BigInt(0))) { + if (memLength !== BigInt(0)) { mem = runState.memory.read(Number(memOffset), Number(memLength)) } @@ -911,7 +911,7 @@ export const handlers: Map = new Map([ runState.messageGasLimit = undefined let data = Buffer.alloc(0) - if (!(length === BigInt(0))) { + if (length !== BigInt(0)) { data = runState.memory.read(Number(offset), Number(length)) } @@ -933,7 +933,7 @@ export const handlers: Map = new Map([ runState.messageGasLimit = undefined let data = Buffer.alloc(0) - if (!(length === BigInt(0))) { + if (length !== BigInt(0)) { data = runState.memory.read(Number(offset), Number(length)) } @@ -955,7 +955,7 @@ export const handlers: Map = new Map([ const toAddress = new Address(addressToBuffer(toAddr)) let data = Buffer.alloc(0) - if (!(inLength === BigInt(0))) { + if (inLength !== BigInt(0)) { data = runState.memory.read(Number(inOffset), Number(inLength)) } @@ -980,7 +980,7 @@ export const handlers: Map = new Map([ runState.messageGasLimit = undefined let data = Buffer.alloc(0) - if (!(inLength === BigInt(0))) { + if (inLength !== BigInt(0)) { data = runState.memory.read(Number(inOffset), Number(inLength)) } @@ -1000,7 +1000,7 @@ export const handlers: Map = new Map([ const toAddress = new Address(addressToBuffer(toAddr)) let data = Buffer.alloc(0) - if (!(inLength === BigInt(0))) { + if (inLength !== BigInt(0)) { data = runState.memory.read(Number(inOffset), Number(inLength)) } @@ -1026,7 +1026,7 @@ export const handlers: Map = new Map([ runState.messageGasLimit = undefined let data = Buffer.alloc(0) - if (!(inLength === BigInt(0))) { + if (inLength !== BigInt(0)) { data = runState.memory.read(Number(inOffset), Number(inLength)) } @@ -1042,7 +1042,7 @@ export const handlers: Map = new Map([ function (runState) { const [offset, length] = runState.stack.popN(2) let returnData = Buffer.alloc(0) - if (!(length === BigInt(0))) { + if (length !== BigInt(0)) { returnData = runState.memory.read(Number(offset), Number(length)) } runState.eei.finish(returnData) @@ -1054,7 +1054,7 @@ export const handlers: Map = new Map([ function (runState) { const [offset, length] = runState.stack.popN(2) let returnData = Buffer.alloc(0) - if (!(length === BigInt(0))) { + if (length !== BigInt(0)) { returnData = runState.memory.read(Number(offset), Number(length)) } runState.eei.revert(returnData) @@ -1065,8 +1065,8 @@ export const handlers: Map = new Map([ [ 0xff, async function (runState) { - const selfdestructToAddressBN = runState.stack.pop() - const selfdestructToAddress = new Address(addressToBuffer(selfdestructToAddressBN)) + const selfdestructToAddressBigInt = runState.stack.pop() + const selfdestructToAddress = new Address(addressToBuffer(selfdestructToAddressBigInt)) return runState.eei.selfDestruct(selfdestructToAddress) }, ], diff --git a/packages/vm/src/evm/opcodes/gas.ts b/packages/vm/src/evm/opcodes/gas.ts index b2553131b8a..a18f9e3bfc5 100644 --- a/packages/vm/src/evm/opcodes/gas.ts +++ b/packages/vm/src/evm/opcodes/gas.ts @@ -34,287 +34,178 @@ export interface SyncDynamicGasHandler { export const dynamicGasHandlers: Map = new Map([ - [ - /* SHA3 */ - 0x20, - async function (runState, gas, common): Promise { - const [offset, length] = runState.stack.peek(2) - gas += subMemUsage(runState, offset, length, common) - gas += BigInt(common.param('gasPrices', 'sha3Word')) * divCeil(length, BigInt(32)) - return gas - }, - ], - [ - /* BALANCE */ - 0x31, - async function (runState, gas, common): Promise { - if (common.isActivatedEIP(2929)) { - const addressBigInt = runState.stack.peek()[0] - const address = new Address(addressToBuffer(addressBigInt)) - gas += accessAddressEIP2929(runState, address, common) - } - return gas - }, - ], - [ - /* CALLDATACOPY */ - 0x37, - async function (runState, gas, common): Promise { - const [memOffset, _dataOffset, dataLength] = runState.stack.peek(3) - - gas += subMemUsage(runState, memOffset, dataLength, common) - if (!(dataLength === BigInt(0))) { - gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) - } - return gas - }, - ], - [ - /* CODECOPY */ - 0x39, - async function (runState, gas, common): Promise { - const [memOffset, _codeOffset, dataLength] = runState.stack.peek(3) - - gas += subMemUsage(runState, memOffset, dataLength, common) - if (!(dataLength === BigInt(0))) { - gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) - } - return gas - }, - ], - [ - /* EXTCODESIZE */ - 0x3b, - async function (runState, gas, common): Promise { - if (common.isActivatedEIP(2929)) { - const addressBigInt = runState.stack.peek()[0] - const address = new Address(addressToBuffer(addressBigInt)) - gas += accessAddressEIP2929(runState, address, common) - } - return gas - }, - ], - [ - /* EXTCODECOPY */ - 0x3c, - async function (runState, gas, common): Promise { - const [addressBigInt, memOffset, _codeOffset, dataLength] = runState.stack.peek(4) - - gas += subMemUsage(runState, memOffset, dataLength, common) - - if (common.isActivatedEIP(2929)) { - const address = new Address(addressToBuffer(addressBigInt)) - gas += accessAddressEIP2929(runState, address, common) - } - - if (!(dataLength === BigInt(0))) { - gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) - } - return gas - }, - ], - [ - /* RETURNDATACOPY */ - 0x3e, - async function (runState, gas, common): Promise { - const [memOffset, returnDataOffset, dataLength] = runState.stack.peek(3) - - if (returnDataOffset + dataLength > runState.eei.getReturnDataSize()) { - trap(ERROR.OUT_OF_GAS) - } - - gas += subMemUsage(runState, memOffset, dataLength, common) - - if (!(dataLength === BigInt(0))) { - gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) - } - return gas - }, - ], - [ - /* EXTCODEHASH */ - 0x3f, - async function (runState, gas, common): Promise { - if (common.isActivatedEIP(2929)) { - const addressBigInt = runState.stack.peek()[0] - const address = new Address(addressToBuffer(addressBigInt)) - gas += accessAddressEIP2929(runState, address, common) - } - return gas - }, - ], - [ - /* MLOAD */ - 0x51, - async function (runState, gas, common): Promise { - const pos = runState.stack.peek()[0] - gas += subMemUsage(runState, pos, BigInt(32), common) - return gas - }, - ], - [ - /* MSTORE */ - 0x52, - async function (runState, gas, common): Promise { - const offset = runState.stack.peek()[0] - gas += subMemUsage(runState, offset, BigInt(32), common) - return gas - }, - ], - [ - /* MSTORE8 */ - 0x53, - async function (runState, gas, common): Promise { - const offset = runState.stack.peek()[0] - gas += subMemUsage(runState, offset, BigInt(1), common) - return gas - }, - ], - [ - /* SLOAD */ - 0x54, - async function (runState, gas, common): Promise { - const key = runState.stack.peek()[0] - const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) - - if (common.isActivatedEIP(2929)) { - gas += accessStorageEIP2929(runState, keyBuf, false, common) - } - return gas - }, - ], - [ - /* SSTORE */ - 0x55, - async function (runState, gas, common): Promise { - if (runState.eei.isStatic()) { - trap(ERROR.STATIC_STATE_CHANGE) - } - const [key, val] = runState.stack.peek(2) - - const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) - // NOTE: this should be the shortest representation - let value - if (val === BigInt(0)) { - value = Buffer.from([]) - } else { - value = bigIntToBuffer(val) - } - - // TODO: Replace getContractStorage with EEI method - const currentStorage = setLengthLeftStorage(await runState.eei.storageLoad(keyBuf)) - const originalStorage = setLengthLeftStorage(await runState.eei.storageLoad(keyBuf, true)) - if (common.hardfork() === 'constantinople') { - gas += updateSstoreGasEIP1283( - runState, - currentStorage, - originalStorage, - setLengthLeftStorage(value), - common - ) - } else if (common.gteHardfork('istanbul')) { - gas += updateSstoreGasEIP2200( - runState, - currentStorage, - originalStorage, - setLengthLeftStorage(value), - keyBuf, - common - ) - } else { - gas += updateSstoreGas(runState, currentStorage, setLengthLeftStorage(value), common) - } - - if (common.isActivatedEIP(2929)) { - // We have to do this after the Istanbul (EIP2200) checks. - // Otherwise, we might run out of gas, due to "sentry check" of 2300 gas, - // if we deduct extra gas first. - gas += accessStorageEIP2929(runState, keyBuf, true, common) - } - return gas - }, - ], - [ - /* LOG */ - 0xa0, - async function (runState, gas, common): Promise { - if (runState.eei.isStatic()) { - trap(ERROR.STATIC_STATE_CHANGE) - } - - const [memOffset, memLength] = runState.stack.peek(2) - - const topicsCount = runState.opCode - 0xa0 - - if (topicsCount < 0 || topicsCount > 4) { - trap(ERROR.OUT_OF_RANGE) - } - - gas += subMemUsage(runState, memOffset, memLength, common) - gas += - BigInt(common.param('gasPrices', 'logTopic')) * BigInt(topicsCount) + - memLength * BigInt(common.param('gasPrices', 'logData')) - return gas - }, - ], - [ - /* CREATE */ - 0xf0, - async function (runState, gas, common): Promise { - if (runState.eei.isStatic()) { - trap(ERROR.STATIC_STATE_CHANGE) - } - const [_value, offset, length] = runState.stack.peek(3) - - if (common.isActivatedEIP(2929)) { - gas += accessAddressEIP2929(runState, runState.eei.getAddress(), common, false) - } - - gas += subMemUsage(runState, offset, length, common) - - let gasLimit = BigInt(runState.eei.getGasLeft()) - gas - gasLimit = maxCallGas(gasLimit, gasLimit, runState, common) - - runState.messageGasLimit = gasLimit - return gas - }, - ], - [ - /* CALL */ - 0xf1, - async function (runState, gas, common): Promise { - const [currentGasLimit, toAddr, value, inOffset, inLength, outOffset, outLength] = - runState.stack.peek(7) - const toAddress = new Address(addressToBuffer(toAddr)) - - if (runState.eei.isStatic() && !(value === BigInt(0))) { - trap(ERROR.STATIC_STATE_CHANGE) - } - gas += subMemUsage(runState, inOffset, inLength, common) - gas += subMemUsage(runState, outOffset, outLength, common) - if (common.isActivatedEIP(2929)) { - gas += accessAddressEIP2929(runState, toAddress, common) - } - - if (!(value === BigInt(0))) { - gas += BigInt(common.param('gasPrices', 'callValueTransfer')) - } - - if (common.gteHardfork('spuriousDragon')) { - // We are at or after Spurious Dragon - // Call new account gas: account is DEAD and we transfer nonzero value - if ((await runState.eei.isAccountEmpty(toAddress)) && !(value === BigInt(0))) { - gas += BigInt(common.param('gasPrices', 'callNewAccount')) - } - } else if (!(await runState.eei.accountExists(toAddress))) { - // We are before Spurious Dragon and the account does not exist. - // Call new account gas: account does not exist (it is not in the state trie, not even as an "empty" account) - gas += BigInt(common.param('gasPrices', 'callNewAccount')) - } - - let gasLimit = maxCallGas( - currentGasLimit, - runState.eei.getGasLeft() - gas, + [ + /* SHA3 */ + 0x20, + async function (runState, gas, common): Promise { + const [offset, length] = runState.stack.peek(2) + gas += subMemUsage(runState, offset, length, common) + gas += BigInt(common.param('gasPrices', 'sha3Word')) * divCeil(length, BigInt(32)) + return gas + }, + ], + [ + /* BALANCE */ + 0x31, + async function (runState, gas, common): Promise { + if (common.isActivatedEIP(2929)) { + const addressBigInt = runState.stack.peek()[0] + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) + } + return gas + }, + ], + [ + /* CALLDATACOPY */ + 0x37, + async function (runState, gas, common): Promise { + const [memOffset, _dataOffset, dataLength] = runState.stack.peek(3) + + gas += subMemUsage(runState, memOffset, dataLength, common) + if (dataLength !== BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) + } + return gas + }, + ], + [ + /* CODECOPY */ + 0x39, + async function (runState, gas, common): Promise { + const [memOffset, _codeOffset, dataLength] = runState.stack.peek(3) + + gas += subMemUsage(runState, memOffset, dataLength, common) + if (dataLength !== BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) + } + return gas + }, + ], + [ + /* EXTCODESIZE */ + 0x3b, + async function (runState, gas, common): Promise { + if (common.isActivatedEIP(2929)) { + const addressBigInt = runState.stack.peek()[0] + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) + } + return gas + }, + ], + [ + /* EXTCODECOPY */ + 0x3c, + async function (runState, gas, common): Promise { + const [addressBigInt, memOffset, _codeOffset, dataLength] = runState.stack.peek(4) + + gas += subMemUsage(runState, memOffset, dataLength, common) + + if (common.isActivatedEIP(2929)) { + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) + } + + if (dataLength !== BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) + } + return gas + }, + ], + [ + /* RETURNDATACOPY */ + 0x3e, + async function (runState, gas, common): Promise { + const [memOffset, returnDataOffset, dataLength] = runState.stack.peek(3) + + if (returnDataOffset + dataLength > runState.eei.getReturnDataSize()) { + trap(ERROR.OUT_OF_GAS) + } + + gas += subMemUsage(runState, memOffset, dataLength, common) + + if (dataLength !== BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) + } + return gas + }, + ], + [ + /* EXTCODEHASH */ + 0x3f, + async function (runState, gas, common): Promise { + if (common.isActivatedEIP(2929)) { + const addressBigInt = runState.stack.peek()[0] + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) + } + return gas + }, + ], + [ + /* MLOAD */ + 0x51, + async function (runState, gas, common): Promise { + const pos = runState.stack.peek()[0] + gas += subMemUsage(runState, pos, BigInt(32), common) + return gas + }, + ], + [ + /* MSTORE */ + 0x52, + async function (runState, gas, common): Promise { + const offset = runState.stack.peek()[0] + gas += subMemUsage(runState, offset, BigInt(32), common) + return gas + }, + ], + [ + /* MSTORE8 */ + 0x53, + async function (runState, gas, common): Promise { + const offset = runState.stack.peek()[0] + gas += subMemUsage(runState, offset, BigInt(1), common) + return gas + }, + ], + [ + /* SLOAD */ + 0x54, + async function (runState, gas, common): Promise { + const key = runState.stack.peek()[0] + const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) + + if (common.isActivatedEIP(2929)) { + gas += accessStorageEIP2929(runState, keyBuf, false, common) + } + return gas + }, + ], + [ + /* SSTORE */ + 0x55, + async function (runState, gas, common): Promise { + if (runState.eei.isStatic()) { + trap(ERROR.STATIC_STATE_CHANGE) + } + const [key, val] = runState.stack.peek(2) + + const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) + // NOTE: this should be the shortest representation + let value + if (val === BigInt(0)) { + value = Buffer.from([]) + } else { + value = bigIntToBuffer(val) + } + + // TODO: Replace getContractStorage with EEI method + const currentStorage = setLengthLeftStorage(await runState.eei.storageLoad(keyBuf)) + const originalStorage = setLengthLeftStorage(await runState.eei.storageLoad(keyBuf, true)) + if (common.hardfork() === 'constantinople') { + gas += updateSstoreGasEIP1283( runState, common ) @@ -362,145 +253,269 @@ export const dynamicGasHandlers: Map runState.eei.getGasLeft() - gas) { - trap(ERROR.OUT_OF_GAS) - } - if (!(value === BigInt(0))) { - // TODO: Don't use private attr directly - runState.eei._gasLeft += BigInt(common.param('gasPrices', 'callStipend')) - gasLimit += BigInt(common.param('gasPrices', 'callStipend')) - } - - runState.messageGasLimit = gasLimit - return gas - }, - ], - [ - /* RETURN */ - 0xf3, - async function (runState, gas, common): Promise { - const [offset, length] = runState.stack.peek(2) - gas += subMemUsage(runState, offset, length, common) - return gas - }, - ], - [ - /* DELEGATECALL */ - 0xf4, - async function (runState, gas, common): Promise { - const [currentGasLimit, toAddr, inOffset, inLength, outOffset, outLength] = - runState.stack.peek(6) - - gas += subMemUsage(runState, inOffset, inLength, common) - gas += subMemUsage(runState, outOffset, outLength, common) - - if (common.isActivatedEIP(2929)) { - const toAddress = new Address(addressToBuffer(toAddr)) - gas += accessAddressEIP2929(runState, toAddress, common) - } - - const gasLimit = maxCallGas( - currentGasLimit, - runState.eei.getGasLeft() - gas, - runState, - common - ) - // note that TangerineWhistle or later this cannot happen - // (it could have ran out of gas prior to getting here though) - if (gasLimit > runState.eei.getGasLeft() - gas) { - trap(ERROR.OUT_OF_GAS) - } - - runState.messageGasLimit = gasLimit - return gas - }, - ], - [ - /* CREATE2 */ - 0xf5, - async function (runState, gas, common): Promise { - if (runState.eei.isStatic()) { - trap(ERROR.STATIC_STATE_CHANGE) - } - - const [_value, offset, length, _salt] = runState.stack.peek(4) - - gas += subMemUsage(runState, offset, length, common) - - if (common.isActivatedEIP(2929)) { - gas += accessAddressEIP2929(runState, runState.eei.getAddress(), common, false) - } - - gas += BigInt(common.param('gasPrices', 'sha3Word')) * divCeil(length, BigInt(32)) - let gasLimit = runState.eei.getGasLeft() - gas - gasLimit = maxCallGas(gasLimit, gasLimit, runState, common) // CREATE2 is only available after TangerineWhistle (Constantinople introduced this opcode) - runState.messageGasLimit = gasLimit - return gas - }, - ], - [ - /* STATICCALL */ - 0xfa, - async function (runState, gas, common): Promise { - const [currentGasLimit, toAddr, inOffset, inLength, outOffset, outLength] = - runState.stack.peek(6) - - gas += subMemUsage(runState, inOffset, inLength, common) - gas += subMemUsage(runState, outOffset, outLength, common) - - if (common.isActivatedEIP(2929)) { - const toAddress = new Address(addressToBuffer(toAddr)) - gas += accessAddressEIP2929(runState, toAddress, common) - } - - const gasLimit = maxCallGas( - currentGasLimit, - runState.eei.getGasLeft() - gas, - runState, - common - ) // we set TangerineWhistle or later to true here, as STATICCALL was available from Byzantium (which is after TangerineWhistle) - - runState.messageGasLimit = gasLimit - return gas - }, - ], - [ - /* REVERT */ - 0xfd, - async function (runState, gas, common): Promise { - const [offset, length] = runState.stack.peek(2) - gas += subMemUsage(runState, offset, length, common) - return gas - }, - ], - [ - /* SELFDESTRUCT */ - 0xff, - async function (runState, gas, common): Promise { - if (runState.eei.isStatic()) { - trap(ERROR.STATIC_STATE_CHANGE) + } else { + gas += updateSstoreGas(runState, currentStorage, setLengthLeftStorage(value), common) + } + + if (common.isActivatedEIP(2929)) { + // We have to do this after the Istanbul (EIP2200) checks. + // Otherwise, we might run out of gas, due to "sentry check" of 2300 gas, + // if we deduct extra gas first. + gas += accessStorageEIP2929(runState, keyBuf, true, common) + } + return gas + }, + ], + [ + /* LOG */ + 0xa0, + async function (runState, gas, common): Promise { + if (runState.eei.isStatic()) { + trap(ERROR.STATIC_STATE_CHANGE) + } + + const [memOffset, memLength] = runState.stack.peek(2) + + const topicsCount = runState.opCode - 0xa0 + + if (topicsCount < 0 || topicsCount > 4) { + trap(ERROR.OUT_OF_RANGE) + } + + gas += subMemUsage(runState, memOffset, memLength, common) + gas += + BigInt(common.param('gasPrices', 'logTopic')) * BigInt(topicsCount) + + memLength * BigInt(common.param('gasPrices', 'logData')) + return gas + }, + ], + [ + /* CREATE */ + 0xf0, + async function (runState, gas, common): Promise { + if (runState.eei.isStatic()) { + trap(ERROR.STATIC_STATE_CHANGE) + } + const [_value, offset, length] = runState.stack.peek(3) + + if (common.isActivatedEIP(2929)) { + gas += accessAddressEIP2929(runState, runState.eei.getAddress(), common, false) + } + + gas += subMemUsage(runState, offset, length, common) + + let gasLimit = BigInt(runState.eei.getGasLeft()) - gas + gasLimit = maxCallGas(gasLimit, gasLimit, runState, common) + + runState.messageGasLimit = gasLimit + return gas + }, + ], + [ + /* CALL */ + 0xf1, + async function (runState, gas, common): Promise { + const [currentGasLimit, toAddr, value, inOffset, inLength, outOffset, outLength] = + runState.stack.peek(7) + const toAddress = new Address(addressToBuffer(toAddr)) + + if (runState.eei.isStatic() && value !== BigInt(0)) { + trap(ERROR.STATIC_STATE_CHANGE) + } + gas += subMemUsage(runState, inOffset, inLength, common) + gas += subMemUsage(runState, outOffset, outLength, common) + if (common.isActivatedEIP(2929)) { + gas += accessAddressEIP2929(runState, toAddress, common) + } + + if (value !== BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'callValueTransfer')) + } + + if (common.gteHardfork('spuriousDragon')) { + // We are at or after Spurious Dragon + // Call new account gas: account is DEAD and we transfer nonzero value + if ((await runState.eei.isAccountEmpty(toAddress)) && !(value === BigInt(0))) { + gas += BigInt(common.param('gasPrices', 'callNewAccount')) } - const selfdestructToaddressBigInt = runState.stack.peek()[0] - - const selfdestructToAddress = new Address(addressToBuffer(selfdestructToaddressBigInt)) - let deductGas = false - if (common.gteHardfork('spuriousDragon')) { - // EIP-161: State Trie Clearing - const balance = await runState.eei.getExternalBalance(runState.eei.getAddress()) - if (balance > BigInt(0)) { - // This technically checks if account is empty or non-existent - // TODO: improve on the API here (EEI and StateManager) - const empty = await runState.eei.isAccountEmpty(selfdestructToAddress) - if (empty) { - deductGas = true - } - } - } else if (common.gteHardfork('tangerineWhistle')) { - // EIP-150 (Tangerine Whistle) gas semantics - const exists = await runState.stateManager.accountExists(selfdestructToAddress) - if (!exists) { + } else if (!(await runState.eei.accountExists(toAddress))) { + // We are before Spurious Dragon and the account does not exist. + // Call new account gas: account does not exist (it is not in the state trie, not even as an "empty" account) + gas += BigInt(common.param('gasPrices', 'callNewAccount')) + } + + let gasLimit = maxCallGas(currentGasLimit, runState.eei.getGasLeft() - gas, runState, common) + // note that TangerineWhistle or later this cannot happen + // (it could have ran out of gas prior to getting here though) + if (gasLimit > runState.eei.getGasLeft() - gas) { + trap(ERROR.OUT_OF_GAS) + } + + if (gas > runState.eei.getGasLeft()) { + trap(ERROR.OUT_OF_GAS) + } + + if (value !== BigInt(0)) { + // TODO: Don't use private attr directly + runState.eei._gasLeft += BigInt(common.param('gasPrices', 'callStipend')) + gasLimit += BigInt(common.param('gasPrices', 'callStipend')) + } + + runState.messageGasLimit = gasLimit + return gas + }, + ], + [ + /* CALLCODE */ + 0xf2, + async function (runState, gas, common): Promise { + const [currentGasLimit, toAddr, value, inOffset, inLength, outOffset, outLength] = + runState.stack.peek(7) + + gas += subMemUsage(runState, inOffset, inLength, common) + gas += subMemUsage(runState, outOffset, outLength, common) + + if (common.isActivatedEIP(2929)) { + const toAddress = new Address(addressToBuffer(toAddr)) + gas += accessAddressEIP2929(runState, toAddress, common) + } + + if (value !== BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'callValueTransfer')) + } + let gasLimit = maxCallGas(currentGasLimit, runState.eei.getGasLeft() - gas, runState, common) + // note that TangerineWhistle or later this cannot happen + // (it could have ran out of gas prior to getting here though) + if (gasLimit > runState.eei.getGasLeft() - gas) { + trap(ERROR.OUT_OF_GAS) + } + if (value !== BigInt(0)) { + // TODO: Don't use private attr directly + runState.eei._gasLeft += BigInt(common.param('gasPrices', 'callStipend')) + gasLimit += BigInt(common.param('gasPrices', 'callStipend')) + } + + runState.messageGasLimit = gasLimit + return gas + }, + ], + [ + /* RETURN */ + 0xf3, + async function (runState, gas, common): Promise { + const [offset, length] = runState.stack.peek(2) + gas += subMemUsage(runState, offset, length, common) + return gas + }, + ], + [ + /* DELEGATECALL */ + 0xf4, + async function (runState, gas, common): Promise { + const [currentGasLimit, toAddr, inOffset, inLength, outOffset, outLength] = + runState.stack.peek(6) + + gas += subMemUsage(runState, inOffset, inLength, common) + gas += subMemUsage(runState, outOffset, outLength, common) + + if (common.isActivatedEIP(2929)) { + const toAddress = new Address(addressToBuffer(toAddr)) + gas += accessAddressEIP2929(runState, toAddress, common) + } + + const gasLimit = maxCallGas( + currentGasLimit, + runState.eei.getGasLeft() - gas, + runState, + common + ) + // note that TangerineWhistle or later this cannot happen + // (it could have ran out of gas prior to getting here though) + if (gasLimit > runState.eei.getGasLeft() - gas) { + trap(ERROR.OUT_OF_GAS) + } + + runState.messageGasLimit = gasLimit + return gas + }, + ], + [ + /* CREATE2 */ + 0xf5, + async function (runState, gas, common): Promise { + if (runState.eei.isStatic()) { + trap(ERROR.STATIC_STATE_CHANGE) + } + + const [_value, offset, length, _salt] = runState.stack.peek(4) + + gas += subMemUsage(runState, offset, length, common) + + if (common.isActivatedEIP(2929)) { + gas += accessAddressEIP2929(runState, runState.eei.getAddress(), common, false) + } + + gas += BigInt(common.param('gasPrices', 'sha3Word')) * divCeil(length, BigInt(32)) + let gasLimit = runState.eei.getGasLeft() - gas + gasLimit = maxCallGas(gasLimit, gasLimit, runState, common) // CREATE2 is only available after TangerineWhistle (Constantinople introduced this opcode) + runState.messageGasLimit = gasLimit + return gas + }, + ], + [ + /* STATICCALL */ + 0xfa, + async function (runState, gas, common): Promise { + const [currentGasLimit, toAddr, inOffset, inLength, outOffset, outLength] = + runState.stack.peek(6) + + gas += subMemUsage(runState, inOffset, inLength, common) + gas += subMemUsage(runState, outOffset, outLength, common) + + if (common.isActivatedEIP(2929)) { + const toAddress = new Address(addressToBuffer(toAddr)) + gas += accessAddressEIP2929(runState, toAddress, common) + } + + const gasLimit = maxCallGas( + currentGasLimit, + runState.eei.getGasLeft() - gas, + runState, + common + ) // we set TangerineWhistle or later to true here, as STATICCALL was available from Byzantium (which is after TangerineWhistle) + + runState.messageGasLimit = gasLimit + return gas + }, + ], + [ + /* REVERT */ + 0xfd, + async function (runState, gas, common): Promise { + const [offset, length] = runState.stack.peek(2) + gas += subMemUsage(runState, offset, length, common) + return gas + }, + ], + [ + /* SELFDESTRUCT */ + 0xff, + async function (runState, gas, common): Promise { + if (runState.eei.isStatic()) { + trap(ERROR.STATIC_STATE_CHANGE) + } + const selfdestructToaddressBigInt = runState.stack.peek()[0] + + const selfdestructToAddress = new Address(addressToBuffer(selfdestructToaddressBigInt)) + let deductGas = false + if (common.gteHardfork('spuriousDragon')) { + // EIP-161: State Trie Clearing + const balance = await runState.eei.getExternalBalance(runState.eei.getAddress()) + if (balance > BigInt(0)) { + // This technically checks if account is empty or non-existent + // TODO: improve on the API here (EEI and StateManager) + const empty = await runState.eei.isAccountEmpty(selfdestructToAddress) + if (empty) { deductGas = true } } diff --git a/packages/vm/src/evm/opcodes/util.ts b/packages/vm/src/evm/opcodes/util.ts index d596dbdc523..da5de367007 100644 --- a/packages/vm/src/evm/opcodes/util.ts +++ b/packages/vm/src/evm/opcodes/util.ts @@ -7,9 +7,8 @@ const MASK_160 = (BigInt(1) << BigInt(160)) - BigInt(1) /** * Proxy function for ethereumjs-util's setLengthLeft, except it returns a zero - * * length buffer in case the buffer is full of zeros. - * @param {Buffer} value Buffer which we want to pad + * @param value Buffer which we want to pad */ export function setLengthLeftStorage(value: Buffer) { if (value.equals(Buffer.alloc(value.length, 0))) { @@ -22,8 +21,6 @@ export function setLengthLeftStorage(value: Buffer) { /** * Wraps error message as VMError - * - * @param {string} err */ export function trap(err: string) { // TODO: facilitate extra data along with errors @@ -32,9 +29,6 @@ export function trap(err: string) { /** * Converts bigint address (they're stored like this on the stack) to buffer address - * - * @param {BN} address - * @return {Buffer} */ export function addressToBuffer(address: bigint | Buffer) { if (Buffer.isBuffer(address)) return address @@ -43,9 +37,6 @@ export function addressToBuffer(address: bigint | Buffer) { /** * Error message helper - generates location string - * - * @param {RunState} runState - * @return {string} */ export function describeLocation(runState: RunState): string { const hash = keccak256(runState.eei.getCode()).toString('hex') @@ -81,15 +72,9 @@ export function short(buffer: Buffer): string { return bufferStr.slice(0, MAX_LENGTH) + '...' } -/** /** * Returns an overflow-safe slice of an array. It right-pads * the data with zeros to `length`. - * - * @param {BN} offset - * @param {BN} length - * @param {Buffer} data - * @returns {Buffer} */ export function getDataSlice(data: Buffer, offset: bigint, length: bigint): Buffer { const len = BigInt(data.length) @@ -112,9 +97,9 @@ export function getDataSlice(data: Buffer, offset: bigint, length: bigint): Buff /** * Get full opcode name from its name and code. * - * @param code {number} Integer code of opcode. - * @param name {string} Short name of the opcode. - * @returns {string} Full opcode name + * @param code Integer code of opcode. + * @param name Short name of the opcode. + * @returns Full opcode name */ export function getFullname(code: number, name: string): string { switch (name) { @@ -136,10 +121,6 @@ export function getFullname(code: number, name: string): string { /** * Checks if a jump is valid given a destination (defined as a 1 in the validJumps array) - * - * @param {RunState} runState - * @param {number} dest - * @return {boolean} */ export function jumpIsValid(runState: RunState, dest: number): boolean { return runState.validJumps[dest] === 1 @@ -147,10 +128,6 @@ export function jumpIsValid(runState: RunState, dest: number): boolean { /** * Checks if a jumpsub is valid given a destination (defined as a 2 in the validJumps array) - * - * @param {RunState} runState - * @param {number} dest - * @return {boolean} */ export function jumpSubIsValid(runState: RunState, dest: number): boolean { return runState.validJumps[dest] === 2 @@ -158,12 +135,11 @@ export function jumpSubIsValid(runState: RunState, dest: number): boolean { /** * Returns an overflow-safe slice of an array. It right-pads - * * the data with zeros to `length`. - * @param {BN} gasLimit - requested gas Limit - * @param {BN} gasLeft - current gas left - * @param {RunState} runState - the current runState - * @param {Common} common - the common + * @param gasLimit requested gas Limit + * @param gasLeft current gas left + * @param runState the current runState + * @param common the common */ export function maxCallGas( gasLimit: bigint, @@ -182,11 +158,6 @@ export function maxCallGas( /** * Subtracts the amount needed for memory usage from `runState.gasLeft` - * - * @method subMemUsage - * @param {Object} runState - * @param {BN} offset - * @param {BN} length */ export function subMemUsage(runState: RunState, offset: bigint, length: bigint, common: Common) { // YP (225): access with zero length will not extend the memory @@ -214,10 +185,6 @@ export function subMemUsage(runState: RunState, offset: bigint, length: bigint, /** * Writes data returned by eei.call* methods to memory - * - * @param {RunState} runState - * @param {BN} outOffset - * @param {BN} outLength */ export function writeCallOutput(runState: RunState, outOffset: bigint, outLength: bigint) { const returnData = runState.eei.getReturnData() @@ -233,11 +200,8 @@ export function writeCallOutput(runState: RunState, outOffset: bigint, outLength } } -/** The first rule set of SSTORE rules, which are the rules pre-Constantinople and in Petersburg - * @param {RunState} runState - * @param {Buffer} currentStorage - * @param {Buffer} value - * @param {Buffer} keyBuf +/** + * The first rule set of SSTORE rules, which are the rules pre-Constantinople and in Petersburg */ export function updateSstoreGas( runState: RunState, diff --git a/packages/vm/src/evm/precompiles/01-ecrecover.ts b/packages/vm/src/evm/precompiles/01-ecrecover.ts index c792867b573..8d94ba6698c 100644 --- a/packages/vm/src/evm/precompiles/01-ecrecover.ts +++ b/packages/vm/src/evm/precompiles/01-ecrecover.ts @@ -1,4 +1,10 @@ -import { setLengthLeft, setLengthRight, ecrecover, publicToAddress, BN } from 'ethereumjs-util' +import { + setLengthLeft, + setLengthRight, + ecrecover, + publicToAddress, + bufferToBigInt, +} from 'ethereumjs-util' import { PrecompileInput } from './types' import { OOGResult, ExecResult } from '../evm' const assert = require('assert') @@ -21,7 +27,7 @@ export default function (opts: PrecompileInput): ExecResult { let publicKey try { - publicKey = ecrecover(msgHash, new BN(v), r, s) + publicKey = ecrecover(msgHash, bufferToBigInt(v), r, s) } catch (e: any) { return { gasUsed, diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index e1682cfe72c..7531549ed3f 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -1,5 +1,5 @@ import { SecureTrie as Trie } from 'merkle-patricia-tree' -import { Account, Address, BNLike } from 'ethereumjs-util' +import { Account, Address, BigIntLike, toType, TypeOutput } from 'ethereumjs-util' import Blockchain from '@ethereumjs/blockchain' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { StateManager, DefaultStateManager } from './state/index' @@ -132,7 +132,7 @@ export interface VMOpts { * e.g. both Merge and Shanghai HF blocks set and the block number from the block provided * pointing to a Shanghai block: this will lead to set the HF as Shanghai and not the Merge). */ - hardforkByTD?: BNLike + hardforkByTD?: BigIntLike /** * Override or add custom opcodes to the VM instruction set @@ -192,7 +192,7 @@ export default class VM extends AsyncEventEmitter { protected _dynamicGasHandlers!: Map protected readonly _hardforkByBlockNumber: boolean - protected readonly _hardforkByTD?: BNLike + protected readonly _hardforkByTD?: BigInt protected readonly _customOpcodes?: CustomOpcode[] protected readonly _customPrecompiles?: CustomPrecompile[] @@ -327,7 +327,7 @@ export default class VM extends AsyncEventEmitter { } this._hardforkByBlockNumber = opts.hardforkByBlockNumber ?? false - this._hardforkByTD = opts.hardforkByTD + this._hardforkByTD = toType(opts.hardforkByTD, TypeOutput.BigInt) if (this._common.isActivatedEIP(2537)) { if (isBrowser()) { diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index ef9c6d3a87e..c154b73683d 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -1,6 +1,6 @@ import { debug as createDebugLogger } from 'debug' import { BaseTrie as Trie } from 'merkle-patricia-tree' -import { Account, Address, bigIntToBN, BN, bnToBigInt, intToBuffer, rlp } from 'ethereumjs-util' +import { Account, Address, bigIntToBuffer, intToBuffer, rlp } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import { ConsensusType, Hardfork } from '@ethereumjs/common' import VM from './index' @@ -120,7 +120,7 @@ export default async function runBlock(this: VM, opts: RunBlockOpts): Promise= BigInt('0x8000000000000000')) { const msg = _errorMsg('Invalid block with gas limit greater than (2^63 - 1)', this, block) throw new Error(msg) } else { @@ -330,13 +330,11 @@ async function applyTransactions(this: VM, block: Block, opts: RunBlockOpts) { let maxGasLimit if (this._common.isActivatedEIP(1559)) { maxGasLimit = - bnToBigInt(block.header.gasLimit) * - BigInt(this._common.param('gasConfig', 'elasticityMultiplier')) + block.header.gasLimit * BigInt(this._common.param('gasConfig', 'elasticityMultiplier')) } else { maxGasLimit = block.header.gasLimit } - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands - const gasLimitIsHigherThanBlock = maxGasLimit < bnToBigInt(tx.gasLimit) + gasUsed + const gasLimitIsHigherThanBlock = maxGasLimit < tx.gasLimit + gasUsed if (gasLimitIsHigherThanBlock) { const msg = _errorMsg('tx has a higher gas limit than the block', this, block) throw new Error(msg) @@ -394,11 +392,7 @@ async function assignBlockRewards(this: VM, block: Block): Promise { const ommers = block.uncleHeaders // Reward ommers for (const ommer of ommers) { - const reward = calculateOmmerReward( - bnToBigInt(ommer.number), - bnToBigInt(block.header.number), - minerReward - ) + const reward = calculateOmmerReward(ommer.number, block.header.number, minerReward) const account = await rewardAccount(state, ommer.coinbase, reward) if (this.DEBUG) { debug(`Add uncle reward ${reward} to account ${ommer.coinbase} (-> ${account.balance})`) @@ -439,7 +433,7 @@ export async function rewardAccount( reward: bigint ): Promise { const account = await state.getAccount(address) - account.balance.iadd(bigIntToBN(reward)) + account.balance += reward await state.putAccount(address, account) return account } @@ -471,10 +465,10 @@ export async function generateTxReceipt( this: VM, tx: TypedTransaction, txRes: RunTxResult, - blockGasUsed: BN + blockGasUsed: bigint ) { const abstractTxReceipt = { - gasUsed: blockGasUsed.toArrayLike(Buffer), + gasUsed: bigIntToBuffer(blockGasUsed), bitvector: txRes.bloom.bitvector, logs: txRes.execResult.logs ?? [], } @@ -535,9 +529,9 @@ async function _applyDAOHardfork(state: StateManager) { // retrieve the account and add it to the DAO's Refund accounts' balance. const address = new Address(Buffer.from(addr, 'hex')) const account = await state.getAccount(address) - DAORefundAccount.balance.iadd(account.balance) + DAORefundAccount.balance += account.balance // clear the accounts' balance - account.balance = new BN(0) + account.balance = BigInt(0) await state.putAccount(address, account) } diff --git a/packages/vm/src/runTx.ts b/packages/vm/src/runTx.ts index 3a064f398ed..72b851b86f1 100644 --- a/packages/vm/src/runTx.ts +++ b/packages/vm/src/runTx.ts @@ -1,13 +1,5 @@ import { debug as createDebugLogger } from 'debug' -import { - Address, - bigIntToBN, - bigIntToBuffer, - BN, - bnToBigInt, - KECCAK256_NULL, - toBuffer, -} from 'ethereumjs-util' +import { Address, bigIntToBuffer, KECCAK256_NULL, toBuffer } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import { ConsensusType } from '@ethereumjs/common' import { @@ -131,10 +123,7 @@ export default async function runTx(this: VM, opts: RunTxOpts): Promise { } // Validate gas limit against tx base fee (DataFee + TxFee + Creation Fee) - const txBaseFee = bnToBigInt(tx.getBaseFee()) - let gasLimit = bnToBigInt(tx.gasLimit) + const txBaseFee = tx.getBaseFee() + let gasLimit = tx.gasLimit if (gasLimit < txBaseFee) { const msg = _errorMsg('base fee exceeds gas limit', this, block, tx) throw new Error(msg) @@ -303,7 +292,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { // assert transaction.max_fee_per_gas >= block.base_fee_per_gas const maxFeePerGas = 'maxFeePerGas' in tx ? tx.maxFeePerGas : tx.gasPrice const baseFeePerGas = block.header.baseFeePerGas! - if (maxFeePerGas.lt(baseFeePerGas)) { + if (maxFeePerGas < baseFeePerGas) { const msg = _errorMsg( `Transaction's maxFeePerGas (${maxFeePerGas}) is less than the block's baseFeePerGas (${baseFeePerGas})`, this, @@ -326,7 +315,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { if (!opts.skipBalance) { const cost = tx.getUpfrontCost(block.header.baseFeePerGas) - if (balance.lt(cost)) { + if (balance < cost) { const msg = _errorMsg( `sender doesn't have enough funds to send tx. The upfront cost is: ${cost} and the sender's account (${caller}) only has: ${balance}`, this, @@ -339,8 +328,8 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { // EIP-1559 spec: // The signer must be able to afford the transaction // `assert balance >= gas_limit * max_fee_per_gas` - const cost = tx.gasLimit.mul((tx as FeeMarketEIP1559Transaction).maxFeePerGas).add(tx.value) - if (balance.lt(cost)) { + const cost = tx.gasLimit * (tx as FeeMarketEIP1559Transaction).maxFeePerGas + tx.value + if (balance < cost) { const msg = _errorMsg( `sender doesn't have enough funds to send tx. The max cost is: ${cost} and the sender's account (${caller}) only has: ${balance}`, this, @@ -352,7 +341,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { } } if (!opts.skipNonce) { - if (!nonce.eq(tx.nonce)) { + if (nonce !== tx.nonce) { const msg = _errorMsg( `the tx doesn't have the correct nonce. account has nonce of: ${nonce} tx has nonce of: ${tx.nonce}`, this, @@ -368,24 +357,29 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { // EIP-1559 tx if (tx.supports(Capability.EIP1559FeeMarket)) { const baseFee = block.header.baseFeePerGas! - inclusionFeePerGas = BN.min( - (tx as FeeMarketEIP1559Transaction).maxPriorityFeePerGas, - (tx as FeeMarketEIP1559Transaction).maxFeePerGas.sub(baseFee) - ) - gasPrice = bnToBigInt(inclusionFeePerGas.add(baseFee)) + inclusionFeePerGas = + (tx as FeeMarketEIP1559Transaction).maxPriorityFeePerGas < + (tx as FeeMarketEIP1559Transaction).maxFeePerGas - baseFee + ? (tx as FeeMarketEIP1559Transaction).maxPriorityFeePerGas + : (tx as FeeMarketEIP1559Transaction).maxFeePerGas - baseFee + + gasPrice = inclusionFeePerGas + baseFee } else { // Have to cast as legacy tx since EIP1559 tx does not have gas price - gasPrice = bnToBigInt((tx).gasPrice) + gasPrice = (tx).gasPrice if (this._common.isActivatedEIP(1559)) { const baseFee = block.header.baseFeePerGas! - inclusionFeePerGas = (tx).gasPrice.sub(baseFee) + inclusionFeePerGas = (tx).gasPrice - baseFee } } // Update from account's nonce and balance - fromAccount.nonce.iaddn(1) - const txCost = bnToBigInt(tx.gasLimit) * gasPrice - fromAccount.balance.isub(bigIntToBN(txCost)) + fromAccount.nonce += BigInt(1) + const txCost = tx.gasLimit * gasPrice + fromAccount.balance -= txCost + if (opts.skipBalance && fromAccount.balance < BigInt(0)) { + fromAccount.balance = BigInt(0) + } await state.putAccount(caller, fromAccount) if (this.DEBUG) { debug( @@ -402,7 +396,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { caller, gasLimit, to, - value: bnToBigInt(value), + value: value, data, }) const evm = new EVM(this, txContext, block) @@ -445,7 +439,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { // Process any gas refund let gasRefund = results.execResult.gasRefund ?? BigInt(0) const maxRefundQuotient = BigInt(this._common.param('gasConfig', 'maxRefundQuotient')) - if (!(gasRefund === BigInt(0))) { + if (gasRefund !== BigInt(0)) { const maxRefund = results.gasUsed / maxRefundQuotient gasRefund = gasRefund < maxRefund ? gasRefund : maxRefund results.gasUsed -= gasRefund @@ -463,7 +457,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { fromAccount = await state.getAccount(caller) const actualTxCost = results.gasUsed * gasPrice const txCostDiff = txCost - actualTxCost - fromAccount.balance.iadd(bigIntToBN(txCostDiff)) + fromAccount.balance += txCostDiff await state.putAccount(caller, fromAccount) if (this.DEBUG) { debug( @@ -488,9 +482,9 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { const minerAccount = await state.getAccount(miner) // add the amount spent on gas to the miner's account if (this._common.isActivatedEIP(1559)) { - minerAccount.balance.iadd(bigIntToBN(results.gasUsed).mul(inclusionFeePerGas)) + minerAccount.balance += results.gasUsed * inclusionFeePerGas } else { - minerAccount.balance.iadd(bigIntToBN(results.amountSpent)) + minerAccount.balance += results.amountSpent } // Put the miner account into the state. If the balance of the miner account remains zero, note that @@ -518,8 +512,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { state.clearOriginalStorageCache() // Generate the tx receipt - const gasUsed = opts.blockGasUsed ?? bnToBigInt(block.header.gasUsed) - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + const gasUsed = opts.blockGasUsed !== undefined ? opts.blockGasUsed : block.header.gasUsed const cumulativeGasUsed = gasUsed + results.gasUsed results.receipt = await generateTxReceipt.bind(this)(tx, results, cumulativeGasUsed) diff --git a/packages/vm/src/state/stateManager.ts b/packages/vm/src/state/stateManager.ts index a31424f1c5b..388e1fbfd83 100644 --- a/packages/vm/src/state/stateManager.ts +++ b/packages/vm/src/state/stateManager.ts @@ -9,8 +9,7 @@ import { unpadBuffer, PrefixedHexString, bufferToHex, - bnToHex, - BN, + bigIntToHex, KECCAK256_RLP, setLengthLeft, } from 'ethereumjs-util' @@ -342,9 +341,9 @@ export default class DefaultStateManager extends BaseStateManager implements Sta const returnValue: Proof = { address: address.toString(), - balance: bnToHex(account.balance), + balance: bigIntToHex(account.balance), codeHash: bufferToHex(account.codeHash), - nonce: bnToHex(account.nonce), + nonce: bigIntToHex(account.nonce), storageHash: bufferToHex(account.stateRoot), accountProof, storageProof, @@ -391,10 +390,10 @@ export default class DefaultStateManager extends BaseStateManager implements Sta const account = Account.fromRlpSerializedAccount(value) const { nonce, balance, stateRoot, codeHash } = account const invalidErrorMsg = 'Invalid proof provided:' - if (!nonce.eq(new BN(toBuffer(proof.nonce)))) { + if (nonce !== BigInt(proof.nonce)) { throw new Error(`${invalidErrorMsg} nonce does not match`) } - if (!balance.eq(new BN(toBuffer(proof.balance)))) { + if (balance !== BigInt(proof.balance)) { throw new Error(`${invalidErrorMsg} balance does not match`) } if (!stateRoot.equals(toBuffer(proof.storageHash))) { diff --git a/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts b/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts index 6322e1c6f5a..fc062493ae0 100644 --- a/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN } from 'ethereumjs-util' +import { Address, setLengthLeft, bigIntToBuffer } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' import { createAccount } from '../utils' @@ -9,39 +9,39 @@ import { createAccount } from '../utils' */ const testCases = [ - { original: new BN(0), code: '60006000556000600055', used: 412, refund: 0 }, // 0 -> 0 -> 0 - { original: new BN(0), code: '60006000556001600055', used: 20212, refund: 0 }, // 0 -> 0 -> 1 - { original: new BN(0), code: '60016000556000600055', used: 20212, refund: 19800 }, // 0 -> 1 -> 0 - { original: new BN(0), code: '60016000556002600055', used: 20212, refund: 0 }, // 0 -> 1 -> 2 - { original: new BN(0), code: '60016000556001600055', used: 20212, refund: 0 }, // 0 -> 1 -> 1 - { original: new BN(1), code: '60006000556000600055', used: 5212, refund: 15000 }, // 1 -> 0 -> 0 - { original: new BN(1), code: '60006000556001600055', used: 5212, refund: 4800 }, // 1 -> 0 -> 1 - { original: new BN(1), code: '60006000556002600055', used: 5212, refund: 0 }, // 1 -> 0 -> 2 - { original: new BN(1), code: '60026000556000600055', used: 5212, refund: 15000 }, // 1 -> 2 -> 0 - { original: new BN(1), code: '60026000556003600055', used: 5212, refund: 0 }, // 1 -> 2 -> 3 - { original: new BN(1), code: '60026000556001600055', used: 5212, refund: 4800 }, // 1 -> 2 -> 1 - { original: new BN(1), code: '60026000556002600055', used: 5212, refund: 0 }, // 1 -> 2 -> 2 - { original: new BN(1), code: '60016000556000600055', used: 5212, refund: 15000 }, // 1 -> 1 -> 0 - { original: new BN(1), code: '60016000556002600055', used: 5212, refund: 0 }, // 1 -> 1 -> 2 - { original: new BN(1), code: '60016000556001600055', used: 412, refund: 0 }, // 1 -> 1 -> 1 - { original: new BN(0), code: '600160005560006000556001600055', used: 40218, refund: 19800 }, // 0 -> 1 -> 0 -> 1 - { original: new BN(1), code: '600060005560016000556000600055', used: 10218, refund: 19800 }, // 1 -> 0 -> 1 -> 0 + { original: BigInt(0), code: '60006000556000600055', used: 412, refund: 0 }, // 0 -> 0 -> 0 + { original: BigInt(0), code: '60006000556001600055', used: 20212, refund: 0 }, // 0 -> 0 -> 1 + { original: BigInt(0), code: '60016000556000600055', used: 20212, refund: 19800 }, // 0 -> 1 -> 0 + { original: BigInt(0), code: '60016000556002600055', used: 20212, refund: 0 }, // 0 -> 1 -> 2 + { original: BigInt(0), code: '60016000556001600055', used: 20212, refund: 0 }, // 0 -> 1 -> 1 + { original: BigInt(1), code: '60006000556000600055', used: 5212, refund: 15000 }, // 1 -> 0 -> 0 + { original: BigInt(1), code: '60006000556001600055', used: 5212, refund: 4800 }, // 1 -> 0 -> 1 + { original: BigInt(1), code: '60006000556002600055', used: 5212, refund: 0 }, // 1 -> 0 -> 2 + { original: BigInt(1), code: '60026000556000600055', used: 5212, refund: 15000 }, // 1 -> 2 -> 0 + { original: BigInt(1), code: '60026000556003600055', used: 5212, refund: 0 }, // 1 -> 2 -> 3 + { original: BigInt(1), code: '60026000556001600055', used: 5212, refund: 4800 }, // 1 -> 2 -> 1 + { original: BigInt(1), code: '60026000556002600055', used: 5212, refund: 0 }, // 1 -> 2 -> 2 + { original: BigInt(1), code: '60016000556000600055', used: 5212, refund: 15000 }, // 1 -> 1 -> 0 + { original: BigInt(1), code: '60016000556002600055', used: 5212, refund: 0 }, // 1 -> 1 -> 2 + { original: BigInt(1), code: '60016000556001600055', used: 412, refund: 0 }, // 1 -> 1 -> 1 + { original: BigInt(0), code: '600160005560006000556001600055', used: 40218, refund: 19800 }, // 0 -> 1 -> 0 -> 1 + { original: BigInt(1), code: '600060005560016000556000600055', used: 10218, refund: 19800 }, // 1 -> 0 -> 1 -> 0 ] tape('Constantinople: EIP-1283', async (t) => { t.test('net-metering SSTORE', async (st) => { const caller = new Address(Buffer.from('0000000000000000000000000000000000000000', 'hex')) const addr = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) - const key = new BN(0).toArrayLike(Buffer, 'be', 32) + const key = setLengthLeft(bigIntToBuffer(BigInt(0)), 32) for (const testCase of testCases) { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Constantinople }) const vm = new VM({ common }) - const account = createAccount(new BN(0), new BN(0)) + const account = createAccount(BigInt(0), BigInt(0)) await vm.stateManager.putAccount(addr, account) await vm.stateManager.putContractCode(addr, Buffer.from(testCase.code, 'hex')) - if (!testCase.original.isZero()) { - await vm.stateManager.putContractStorage(addr, key, testCase.original.toArrayLike(Buffer)) + if (testCase.original !== BigInt(0)) { + await vm.stateManager.putContractStorage(addr, key, bigIntToBuffer(testCase.original)) } const runCallArgs = { diff --git a/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts b/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts index 756653fcea2..18b192f1b70 100644 --- a/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, bigIntToBN, BN, privateToAddress, setLengthLeft } from 'ethereumjs-util' +import { Address, bigIntToBuffer, privateToAddress, setLengthLeft } from 'ethereumjs-util' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { @@ -10,7 +10,7 @@ import { } from '@ethereumjs/tx' import { Block } from '@ethereumjs/block' -const GWEI = new BN('1000000000') +const GWEI = BigInt('1000000000') const common = new Common({ eips: [1559, 2718, 2930], @@ -22,12 +22,12 @@ const common = new Common({ // (Otherwise there would be need for a custom chain only for testing purposes) common.hardforkBlock = function (hardfork: string | undefined) { if (hardfork === 'london') { - return new BN(1) + return BigInt(1) } else if (hardfork === 'dao') { // Avoid DAO HF side-effects - return new BN(99) + return BigInt(99) } - return new BN(0) + return BigInt(0) } const coinbase = new Address(Buffer.from('11'.repeat(20), 'hex')) @@ -40,17 +40,17 @@ const sender = new Address(privateToAddress(pkey)) * @param transaction - the transaction in the block * @param txType - the txtype to use */ -function makeBlock(baseFee: BN, transaction: TypedTransaction, txType: number) { +function makeBlock(baseFee: bigint, transaction: TypedTransaction, txType: number) { const signed = transaction.sign(pkey) const json = signed.toJSON() json.type = txType const block = Block.fromBlockData( { header: { - number: new BN(1), + number: BigInt(1), coinbase, baseFeePerGas: baseFee, - gasLimit: 500000, + gasLimit: BigInt(500000), }, transactions: [json], }, @@ -63,8 +63,8 @@ tape('EIP1559 tests', (t) => { t.test('test EIP1559 with all transaction types', async (st) => { const tx = new FeeMarketEIP1559Transaction( { - maxFeePerGas: GWEI.muln(5), - maxPriorityFeePerGas: GWEI.muln(2), + maxFeePerGas: GWEI * BigInt(5), + maxPriorityFeePerGas: GWEI * BigInt(2), to: Address.zero(), gasLimit: 21000, }, @@ -75,7 +75,7 @@ tape('EIP1559 tests', (t) => { const block = makeBlock(GWEI, tx, 2) const vm = new VM({ common }) let account = await vm.stateManager.getAccount(sender) - const balance = GWEI.muln(21000).muln(10) + const balance = GWEI * BigInt(21000) * BigInt(10) account.balance = balance await vm.stateManager.putAccount(sender, account) const results = await vm.runTx({ @@ -89,72 +89,72 @@ tape('EIP1559 tests', (t) => { // It is also willing to tip the miner 2 GWEI (at most) // Thus, miner should get 21000*2 GWei, and the 21000*1 GWei is burned - let expectedCost = GWEI.muln(21000).muln(3) - let expectedMinerBalance = GWEI.muln(21000).muln(2) - let expectedAccountBalance = balance.sub(expectedCost) + let expectedCost = GWEI * BigInt(21000) * BigInt(3) + let expectedMinerBalance = GWEI * BigInt(21000) * BigInt(2) + let expectedAccountBalance = balance - expectedCost let miner = await vm.stateManager.getAccount(coinbase) - st.ok(miner.balance.eq(expectedMinerBalance), 'miner balance correct') + st.equal(miner.balance, expectedMinerBalance, 'miner balance correct') account = await vm.stateManager.getAccount(sender) - st.ok(account.balance.eq(expectedAccountBalance), 'account balance correct') - st.ok(bigIntToBN(results.amountSpent).eq(expectedCost), 'reported cost correct') + st.equal(account.balance, expectedAccountBalance, 'account balance correct') + st.equal(results.amountSpent, expectedCost, 'reported cost correct') const tx2 = new AccessListEIP2930Transaction( { gasLimit: 21000, - gasPrice: GWEI.muln(5), + gasPrice: GWEI * BigInt(5), to: Address.zero(), }, { common } ) const block2 = makeBlock(GWEI, tx2, 1) await vm.stateManager.modifyAccountFields(sender, { balance }) - await vm.stateManager.modifyAccountFields(coinbase, { balance: new BN(0) }) + await vm.stateManager.modifyAccountFields(coinbase, { balance: BigInt(0) }) const results2 = await vm.runTx({ tx: block2.transactions[0], block: block2, skipNonce: true, }) - expectedCost = GWEI.muln(21000).muln(5) - expectedMinerBalance = GWEI.muln(21000).muln(4) - expectedAccountBalance = balance.sub(expectedCost) + expectedCost = GWEI * BigInt(21000) * BigInt(5) + expectedMinerBalance = GWEI * BigInt(21000) * BigInt(4) + expectedAccountBalance = balance - expectedCost miner = await vm.stateManager.getAccount(coinbase) - st.ok(miner.balance.eq(expectedMinerBalance), 'miner balance correct') + st.equal(miner.balance, expectedMinerBalance, 'miner balance correct') account = await vm.stateManager.getAccount(sender) - st.ok(account.balance.eq(expectedAccountBalance), 'account balance correct') - st.ok(bigIntToBN(results2.amountSpent).eq(expectedCost), 'reported cost correct') + st.equal(account.balance, expectedAccountBalance, 'account balance correct') + st.equal(results2.amountSpent, expectedCost, 'reported cost correct') const tx3 = new Transaction( { gasLimit: 21000, - gasPrice: GWEI.muln(5), + gasPrice: GWEI * BigInt(5), to: Address.zero(), }, { common } ) const block3 = makeBlock(GWEI, tx3, 0) await vm.stateManager.modifyAccountFields(sender, { balance }) - await vm.stateManager.modifyAccountFields(coinbase, { balance: new BN(0) }) + await vm.stateManager.modifyAccountFields(coinbase, { balance: BigInt(0) }) const results3 = await vm.runTx({ tx: block3.transactions[0], block: block3, skipNonce: true, }) - expectedCost = GWEI.muln(21000).muln(5) - expectedMinerBalance = GWEI.muln(21000).muln(4) - expectedAccountBalance = balance.sub(expectedCost) + expectedCost = GWEI * BigInt(21000) * BigInt(5) + expectedMinerBalance = GWEI * BigInt(21000) * BigInt(4) + expectedAccountBalance = balance - expectedCost miner = await vm.stateManager.getAccount(coinbase) - st.ok(miner.balance.eq(expectedMinerBalance), 'miner balance correct') + st.equal(miner.balance, expectedMinerBalance, 'miner balance correct') account = await vm.stateManager.getAccount(sender) - st.ok(account.balance.eq(expectedAccountBalance), 'account balance correct') - st.ok(bigIntToBN(results3.amountSpent).eq(expectedCost), 'reported cost correct') + st.equal(account.balance, expectedAccountBalance, 'account balance correct') + st.equal(results3.amountSpent, expectedCost, 'reported cost correct') st.end() }) @@ -163,8 +163,8 @@ tape('EIP1559 tests', (t) => { const contractAddress = new Address(Buffer.from('20'.repeat(20), 'hex')) const tx = new FeeMarketEIP1559Transaction( { - maxFeePerGas: GWEI.muln(5), - maxPriorityFeePerGas: GWEI.muln(2), + maxFeePerGas: GWEI * BigInt(5), + maxPriorityFeePerGas: GWEI * BigInt(2), to: contractAddress, gasLimit: 210000, }, @@ -174,7 +174,7 @@ tape('EIP1559 tests', (t) => { ) const block = makeBlock(GWEI, tx, 2) const vm = new VM({ common }) - const balance = GWEI.muln(210000).muln(10) + const balance = GWEI * BigInt(210000) * BigInt(10) await vm.stateManager.modifyAccountFields(sender, { balance }) /** @@ -193,8 +193,8 @@ tape('EIP1559 tests', (t) => { const result = await vm.runTx({ tx: block.transactions[0], block }) const returnValue = result.execResult.returnValue - const expectedCost = GWEI.muln(3) - const expectedReturn = setLengthLeft(expectedCost.toBuffer(), 32) + const expectedCost = GWEI * BigInt(3) + const expectedReturn = setLengthLeft(bigIntToBuffer(expectedCost), 32) st.ok(returnValue.equals(expectedReturn)) st.end() diff --git a/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts b/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts index a08e8b992b2..66e2e55dd83 100644 --- a/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts @@ -33,7 +33,7 @@ tape('EIP-2537 BLS tests', (t) => { data: Buffer.alloc(0), }) - if (!(result.execResult.gasUsed === BigInt(0))) { + if (result.execResult.gasUsed !== BigInt(0)) { st.fail('BLS precompiles should not use any gas if EIP not activated') } @@ -64,7 +64,7 @@ tape('EIP-2537 BLS tests', (t) => { data: Buffer.alloc(0), }) - if (!(result.execResult.gasUsed === BigInt(0xffffffffff))) { + if (result.execResult.gasUsed !== BigInt(0xffffffffff)) { st.fail('BLS precompiles should use all gas on empty inputs') } diff --git a/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts b/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts index b328365d4b0..4bc87ba72f0 100644 --- a/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts @@ -22,7 +22,7 @@ tape('EIP-2565 ModExp gas cost tests', (t) => { data: Buffer.from(test.Input, 'hex'), }) - if (!(result.execResult.gasUsed === BigInt(test.Gas))) { + if (result.execResult.gasUsed !== BigInt(test.Gas)) { st.fail( `[${testName}]: Gas usage incorrect, expected ${test.Gas}, got ${result.execResult.gasUsed}` ) diff --git a/packages/vm/tests/api/EIPs/eip-2929.spec.ts b/packages/vm/tests/api/EIPs/eip-2929.spec.ts index 5306f762fac..1b7f7f53e6d 100644 --- a/packages/vm/tests/api/EIPs/eip-2929.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2929.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Account, Address, bigIntToBN, BN } from 'ethereumjs-util' +import { Account, Address } from 'ethereumjs-util' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' @@ -51,7 +51,7 @@ tape('EIP 2929: gas cost tests', (t) => { await vm.stateManager.putContractCode(address, Buffer.from(test.code, 'hex')) const unsignedTx = Transaction.fromTxData({ - gasLimit: bigIntToBN(initialGas), // ensure we pass a lot of gas, so we do not run out of gas + gasLimit: initialGas, // ensure we pass a lot of gas, so we do not run out of gas to: address, // call to the contract address, }) @@ -81,15 +81,15 @@ tape('EIP 2929: gas cost tests', (t) => { // setup the call arguments const unsignedTx = Transaction.fromTxData({ - gasLimit: new BN(21000 + 9000), // ensure we pass a lot of gas, so we do not run out of gas + gasLimit: BigInt(21000 + 9000), // ensure we pass a lot of gas, so we do not run out of gas to: contractAddress, // call to the contract address, - value: new BN(1), + value: BigInt(1), }) const tx = unsignedTx.sign(privateKey) const address = Address.fromPrivateKey(privateKey) - const initialBalance = new BN(10).pow(new BN(18)) + const initialBalance = BigInt(10) ** BigInt(18) const account = await vm.stateManager.getAccount(address) await vm.stateManager.putAccount( diff --git a/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts b/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts index 9713d3d2dc3..9646bc15e0e 100644 --- a/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Account, Address, BN, bufferToHex } from 'ethereumjs-util' +import { Account, Address, bufferToHex } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' import { AccessListEIP2930Transaction } from '@ethereumjs/tx' @@ -31,8 +31,8 @@ tape('EIP-2930 Optional Access Lists tests', (t) => { const txnWithAccessList = AccessListEIP2930Transaction.fromTxData( { accessList: access, - chainId: 1, - gasLimit: 100000, + chainId: BigInt(1), + gasLimit: BigInt(100000), to: contractAddress, }, { common } @@ -40,8 +40,8 @@ tape('EIP-2930 Optional Access Lists tests', (t) => { const txnWithoutAccessList = AccessListEIP2930Transaction.fromTxData( { accessList: [], - chainId: 1, - gasLimit: 100000, + chainId: BigInt(1), + gasLimit: BigInt(100000), to: contractAddress, }, { common } @@ -52,7 +52,7 @@ tape('EIP-2930 Optional Access Lists tests', (t) => { await vm.stateManager.putContractCode(contractAddress, Buffer.from('60005400', 'hex')) const address = Address.fromPrivateKey(privateKey) - const initialBalance = new BN(10).pow(new BN(18)) + const initialBalance = BigInt(10) ** BigInt(18) const account = await vm.stateManager.getAccount(address) await vm.stateManager.putAccount( diff --git a/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts b/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts index 46d10333cb8..28e761c731d 100644 --- a/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts @@ -1,13 +1,13 @@ import tape from 'tape' -import { Address, BN, bnToBigInt, privateToAddress } from 'ethereumjs-util' +import { Address, privateToAddress } from 'ethereumjs-util' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction, TypedTransaction } from '@ethereumjs/tx' import { Block } from '@ethereumjs/block' import { InterpreterStep } from '../../../src/evm/interpreter' -const GWEI = new BN('1000000000') -const ETHER = GWEI.mul(GWEI) +const GWEI = BigInt('1000000000') +const ETHER = GWEI * GWEI const common = new Common({ eips: [1559, 2718, 2930, 3198], @@ -19,12 +19,12 @@ const common = new Common({ // (Otherwise there would be need for a custom chain only for testing purposes) common.hardforkBlock = function (hardfork: string | undefined) { if (hardfork === 'london') { - return new BN(1) + return BigInt(1) } else if (hardfork === 'dao') { // Avoid DAO HF side-effects - return new BN(99) + return BigInt(99) } - return new BN(0) + return BigInt(0) } const coinbase = new Address(Buffer.from('11'.repeat(20), 'hex')) @@ -37,14 +37,14 @@ const sender = new Address(privateToAddress(pkey)) * @param transaction - the transaction in the block * @param txType - the txtype to use */ -function makeBlock(baseFee: BN, transaction: TypedTransaction, txType: number) { +function makeBlock(baseFee: bigint, transaction: TypedTransaction, txType: number) { const signed = transaction.sign(pkey) const json = signed.toJSON() json.type = txType const block = Block.fromBlockData( { header: { - number: new BN(1), + number: BigInt(1), coinbase, baseFeePerGas: baseFee, gasLimit: 500000, @@ -59,13 +59,13 @@ function makeBlock(baseFee: BN, transaction: TypedTransaction, txType: number) { tape('EIP3198 tests', (t) => { t.test('test EIP3198 gas fee and correct value', async (st) => { // Test taken from the EIP. - const fee = new BN(7) + const fee = BigInt(7) const tx = new FeeMarketEIP1559Transaction( { - maxFeePerGas: GWEI.muln(5), - maxPriorityFeePerGas: GWEI.muln(2), + maxFeePerGas: GWEI * BigInt(5), + maxPriorityFeePerGas: GWEI * BigInt(2), to: undefined, // Create contract - gasLimit: 210000, + gasLimit: BigInt(210000), data: '0x4800', }, { @@ -89,10 +89,10 @@ tape('EIP3198 tests', (t) => { tx: block.transactions[0], block, }) - const txBaseFee = bnToBigInt(block.transactions[0].getBaseFee()) + const txBaseFee = block.transactions[0].getBaseFee() const gasUsed = results.gasUsed - txBaseFee - st.ok(gasUsed === BigInt(2), 'gas used correct') - st.ok(stack[0] === bnToBigInt(fee), 'right item pushed on stack') + st.equal(gasUsed, BigInt(2), 'gas used correct') + st.equal(stack[0], fee, 'right item pushed on stack') st.end() }) }) diff --git a/packages/vm/tests/api/EIPs/eip-3529.spec.ts b/packages/vm/tests/api/EIPs/eip-3529.spec.ts index c4759c44524..2f9757c0f7b 100644 --- a/packages/vm/tests/api/EIPs/eip-3529.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3529.spec.ts @@ -148,8 +148,8 @@ tape('EIP-3529 tests', (t) => { const gasUsed = gasLimit - gasLeft! const effectiveGas = gasUsed - gasRefund! - st.equals(Number(effectiveGas), testCase.effectiveGas, 'correct effective gas') - st.equals(Number(gasUsed), testCase.usedGas, 'correct used gas') + st.equal(effectiveGas, BigInt(testCase.effectiveGas), 'correct effective gas') + st.equal(gasUsed, BigInt(testCase.usedGas), 'correct used gas') // clear the storage cache, otherwise next test will use current original value vm.stateManager.clearOriginalStorageCache() @@ -170,9 +170,9 @@ tape('EIP-3529 tests', (t) => { tx, }) - st.ok(result.execResult.exceptionError === undefined, 'transaction executed succesfully') + st.equal(result.execResult.exceptionError, undefined, 'transaction executed succesfully') st.ok(result.execResult.gasRefund !== undefined, 'gas refund is defined') - st.ok(result.execResult.gasRefund === BigInt(0), 'gas refund is zero') + st.equal(result.execResult.gasRefund, BigInt(0), 'gas refund is zero') st.end() }) diff --git a/packages/vm/tests/api/EIPs/eip-3541.spec.ts b/packages/vm/tests/api/EIPs/eip-3541.spec.ts index 8b39c8024b8..8615f5a9780 100644 --- a/packages/vm/tests/api/EIPs/eip-3541.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3541.spec.ts @@ -25,7 +25,7 @@ tape('EIP 3541 tests', (t) => { let code = await vm.stateManager.getContractCode(created!) - st.ok(code.length === 0, 'did not deposit code') + st.equal(code.length, 0, 'did not deposit code') // Test if we can put a valid contract @@ -81,7 +81,7 @@ tape('EIP 3541 tests', (t) => { let code = await vm.stateManager.getContractCode(address!) - st.ok(code.length === 0, 'did not deposit code') + st.equal(code.length, 0, 'did not deposit code') // put 0xFF contract const tx1 = Transaction.fromTxData({ @@ -118,7 +118,7 @@ tape('EIP 3541 tests', (t) => { let code = await vm.stateManager.getContractCode(address!) - st.ok(code.length === 0, 'did not deposit code') + st.equal(code.length, 0, 'did not deposit code') // put 0xFF contract const tx1 = Transaction.fromTxData({ diff --git a/packages/vm/tests/api/EIPs/eip-3855.spec.ts b/packages/vm/tests/api/EIPs/eip-3855.spec.ts index 28b019793a0..85361ebc4eb 100644 --- a/packages/vm/tests/api/EIPs/eip-3855.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3855.spec.ts @@ -29,8 +29,8 @@ tape('EIP 3541 tests', (t) => { }) st.ok(stack!.length == 1) - st.ok(stack![0] === BigInt(0)) - st.ok(result.gasUsed === BigInt(common.param('gasPrices', 'push0'))) + st.equal(stack![0], BigInt(0)) + st.equal(result.gasUsed, BigInt(common.param('gasPrices', 'push0'))) st.end() }) @@ -51,11 +51,11 @@ tape('EIP 3541 tests', (t) => { st.ok(stack.length == depth) stack.forEach((elem: bigint) => { - if (!(elem === BigInt(0))) { + if (elem !== BigInt(0)) { st.fail('stack element is not 0') } }) - st.ok(result.gasUsed === BigInt(common.param('gasPrices', 'push0') * depth)) + st.equal(result.gasUsed, BigInt(common.param('gasPrices', 'push0') * depth)) st.end() }) @@ -69,7 +69,7 @@ tape('EIP 3541 tests', (t) => { gasLimit: BigInt(10000), }) - st.ok(result.exceptionError?.error === ERROR.STACK_OVERFLOW) + st.equal(result.exceptionError?.error, ERROR.STACK_OVERFLOW) st.end() }) @@ -81,6 +81,6 @@ tape('EIP 3541 tests', (t) => { gasLimit: BigInt(10000), }) - st.ok(result.exceptionError!.error === ERROR.INVALID_OPCODE) + st.equal(result.exceptionError!.error, ERROR.INVALID_OPCODE) }) }) diff --git a/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts b/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts index c7d13491def..b4c0f891056 100644 --- a/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts @@ -1,9 +1,9 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { bigIntToBN, BN } from 'ethereumjs-util' import VM from '../../../src' import type { InterpreterStep } from '../../../src/evm/interpreter' +import { bufferToBigInt } from 'ethereumjs-util' tape('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', (t) => { t.test('should return the right values', async (st) => { @@ -14,7 +14,7 @@ tape('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', (t) => { const header = { number: 1, parentHash: genesis.header.hash(), - timestamp: genesis.header.timestamp.addn(1), + timestamp: genesis.header.timestamp + BigInt(1), gasLimit: genesis.header.gasLimit, } let block = Block.fromBlockData( @@ -35,10 +35,10 @@ tape('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', (t) => { gasLimit: BigInt(0xffff), } await vm.runCode({ ...runCodeArgs, block }) - st.ok(bigIntToBN(stack[0]).eq(block.header.difficulty), '0x44 returns DIFFICULTY (London)') + st.equal(stack[0], block.header.difficulty, '0x44 returns DIFFICULTY (London)') common.setHardfork(Hardfork.Merge) - const prevRandao = Buffer.alloc(32, 1) + const prevRandao = bufferToBigInt(Buffer.alloc(32, 1)) block = Block.fromBlockData( { header: { @@ -49,7 +49,7 @@ tape('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', (t) => { { common } ) await vm.runCode({ ...runCodeArgs, block }) - st.ok(bigIntToBN(stack[0]).eq(new BN(prevRandao)), '0x44 returns PREVRANDAO (Merge)') + st.equal(stack[0], prevRandao, '0x44 returns PREVRANDAO (Merge)') st.end() }) diff --git a/packages/vm/tests/api/buildBlock.spec.ts b/packages/vm/tests/api/buildBlock.spec.ts index 2073cacc702..595a2a20fc2 100644 --- a/packages/vm/tests/api/buildBlock.spec.ts +++ b/packages/vm/tests/api/buildBlock.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Account, Address, bnToBigInt } from 'ethereumjs-util' +import { Account, Address } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block } from '@ethereumjs/block' import { Transaction, FeeMarketEIP1559Transaction } from '@ethereumjs/tx' @@ -47,7 +47,7 @@ tape('BlockBuilder', async (t) => { return address } const result = await vmCopy.runBlock({ block }) - st.ok(result.gasUsed === bnToBigInt(block.header.gasUsed)) + st.equal(result.gasUsed, block.header.gasUsed) st.ok(result.receiptRoot.equals(block.header.receiptTrie)) st.ok(result.stateRoot.equals(block.header.stateRoot)) st.ok(result.logsBloom.equals(block.header.logsBloom)) @@ -60,7 +60,7 @@ tape('BlockBuilder', async (t) => { const genesis = Block.genesis({}, { common }) const blockBuilder = await vm.buildBlock({ parentBlock: genesis }) - const gasLimit = genesis.header.gasLimit.addn(1) + const gasLimit = genesis.header.gasLimit + BigInt(1) const tx = Transaction.fromTxData({ gasLimit }, { common }) try { await blockBuilder.addTransaction(tx) @@ -281,7 +281,7 @@ tape('BlockBuilder', async (t) => { // block should successfully execute with VM.runBlock and have same outputs const result = await vmCopy.runBlock({ block }) - st.ok(result.gasUsed === bnToBigInt(block.header.gasUsed)) + st.equal(result.gasUsed, block.header.gasUsed) st.ok(result.receiptRoot.equals(block.header.receiptTrie)) st.ok(result.stateRoot.equals(block.header.stateRoot)) st.ok(result.logsBloom.equals(block.header.logsBloom)) @@ -365,7 +365,7 @@ tape('BlockBuilder', async (t) => { ) st.ok( - block.header.baseFeePerGas!.eq(genesisBlock.header.calcNextBaseFee()), + block.header.baseFeePerGas! === genesisBlock.header.calcNextBaseFee(), "baseFeePerGas should equal parentHeader's calcNextBaseFee" ) @@ -377,7 +377,7 @@ tape('BlockBuilder', async (t) => { return address } const result = await vmCopy.runBlock({ block }) - st.ok(result.gasUsed === bnToBigInt(block.header.gasUsed)) + st.equal(result.gasUsed, block.header.gasUsed) st.ok(result.receiptRoot.equals(block.header.receiptTrie)) st.ok(result.stateRoot.equals(block.header.stateRoot)) st.ok(result.logsBloom.equals(block.header.logsBloom)) diff --git a/packages/vm/tests/api/events.spec.ts b/packages/vm/tests/api/events.spec.ts index 9ae2bd4fda1..e7f0725b87d 100644 --- a/packages/vm/tests/api/events.spec.ts +++ b/packages/vm/tests/api/events.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { toBuffer, bufferToHex } from 'ethereumjs-util' +import { toBuffer, bufferToHex, Address, Account } from 'ethereumjs-util' import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' import { Block } from '@ethereumjs/block' import VM from '../../src/index' @@ -73,7 +73,8 @@ tape('VM events', (t) => { t.test('should emit RunTxResult after running a tx', async (st) => { const vm = new VM() - + const address = Address.fromPrivateKey(privKey) + await vm.stateManager.putAccount(address, new Account(BigInt(0), BigInt(0x11111111))) let emitted: any vm.on('afterTx', (val: any) => { emitted = val @@ -95,7 +96,8 @@ tape('VM events', (t) => { t.test('should emit the Message before running it', async (st) => { const vm = new VM() - + const address = Address.fromPrivateKey(privKey) + await vm.stateManager.putAccount(address, new Account(BigInt(0), BigInt(0x11111111))) let emitted: any vm.on('beforeMessage', (val: any) => { emitted = val @@ -118,7 +120,8 @@ tape('VM events', (t) => { t.test('should emit EVMResult after running a message', async (st) => { const vm = new VM() - + const address = Address.fromPrivateKey(privKey) + await vm.stateManager.putAccount(address, new Account(BigInt(0), BigInt(0x11111111))) let emitted: any vm.on('afterMessage', (val: any) => { emitted = val diff --git a/packages/vm/tests/api/evm/stack.spec.ts b/packages/vm/tests/api/evm/stack.spec.ts index b3ab9740f1e..a1d316cd957 100644 --- a/packages/vm/tests/api/evm/stack.spec.ts +++ b/packages/vm/tests/api/evm/stack.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN } from 'ethereumjs-util' +import { Account, Address, bigIntToBuffer, setLengthLeft } from 'ethereumjs-util' import VM from '../../../src' import Stack from '../../../src/evm/stack' import { createAccount } from '../utils' @@ -127,9 +127,9 @@ tape('Stack', (t) => { const caller = new Address(Buffer.from('00000000000000000000000000000000000000ee', 'hex')) const addr = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) const vm = new VM() - const account = createAccount(new BN(0), new BN(0)) + const account = createAccount(BigInt(0), BigInt(0)) const code = '60008080808060013382F15060005260206000F3' - const expectedReturnValue = new BN(0).toArrayLike(Buffer, 'be', 32) + const expectedReturnValue = setLengthLeft(bigIntToBuffer(BigInt(0)), 32) /* code: remarks: (top of the stack is at the zero index) PUSH1 0x00 @@ -150,6 +150,7 @@ tape('Stack', (t) => { */ await vm.stateManager.putAccount(addr, account) await vm.stateManager.putContractCode(addr, Buffer.from(code, 'hex')) + await vm.stateManager.putAccount(caller, new Account(BigInt(0), BigInt(0x11))) const runCallArgs = { caller: caller, gasLimit: BigInt(0xffffffffff), diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index 36306ec8a6d..5a740c7b6e5 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -150,6 +150,33 @@ tape('VM -> common (chain, HFs, EIPs)', (t) => { }) tape('VM -> hardforkByBlockNumber, hardforkByTD, state (deprecated), blockchain', (t) => { + t.test('hardforkByBlockNumber, hardforkByTD', async (st) => { + const customChains = [testnetMerge] + const common = new Common({ chain: 'testnetMerge', hardfork: Hardfork.Istanbul, customChains }) + + let vm = await VM.create({ common, hardforkByBlockNumber: true }) + st.equal((vm as any)._hardforkByBlockNumber, true, 'should set hardforkByBlockNumber option') + + vm = await VM.create({ common, hardforkByTD: 5001 }) + st.equal((vm as any)._hardforkByTD, BigInt(5001), 'should set hardforkByTD option') + + try { + await VM.create({ common, hardforkByBlockNumber: true, hardforkByTD: 3000 }) + st.fail('should not reach this') + } catch (e: any) { + const msg = + 'should throw if hardforkByBlockNumber and hardforkByTD options are used in conjunction' + st.ok( + e.message.includes( + `The hardforkByBlockNumber and hardforkByTD options can't be used in conjunction` + ), + msg + ) + } + + st.end() + }) + t.test('should work with trie (state) provided', async (st) => { const trie = new Trie() const vm = new VM({ state: trie, activatePrecompiles: true }) diff --git a/packages/vm/tests/api/istanbul/eip-1344.spec.ts b/packages/vm/tests/api/istanbul/eip-1344.spec.ts index baa6578f726..6b39079c4e3 100644 --- a/packages/vm/tests/api/istanbul/eip-1344.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-1344.spec.ts @@ -1,13 +1,13 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' import { ERROR } from '../../../src/exceptions' +import { bufferToBigInt } from 'ethereumjs-util' const testCases = [ - { chain: Chain.Mainnet, hardfork: Hardfork.Istanbul, chainId: new BN(1) }, + { chain: Chain.Mainnet, hardfork: Hardfork.Istanbul, chainId: BigInt(1) }, { chain: Chain.Mainnet, hardfork: Hardfork.Constantinople, err: ERROR.INVALID_OPCODE }, - { chain: Chain.Ropsten, hardfork: Hardfork.Istanbul, chainId: new BN(3) }, + { chain: Chain.Ropsten, hardfork: Hardfork.Istanbul, chainId: BigInt(3) }, ] // CHAINID PUSH8 0x00 MSTORE8 PUSH8 0x01 PUSH8 0x00 RETURN @@ -30,7 +30,7 @@ tape('Istanbul: EIP-1344', async (t) => { st.equal(res.exceptionError?.error, testCase.err) } else { st.assert(res.exceptionError === undefined) - st.assert(testCase.chainId.eq(new BN(res.returnValue))) + st.equal(testCase.chainId, bufferToBigInt(res.returnValue)) } } catch (e: any) { st.fail(e.message) diff --git a/packages/vm/tests/api/istanbul/eip-1884.spec.ts b/packages/vm/tests/api/istanbul/eip-1884.spec.ts index a730a9de074..88956d1c6fe 100644 --- a/packages/vm/tests/api/istanbul/eip-1884.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-1884.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN, bufferToBigInt } from 'ethereumjs-util' +import { Address, bufferToBigInt } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' import { ERROR } from '../../../src/exceptions' @@ -26,10 +26,8 @@ tape('Istanbul: EIP-1884', async (t) => { const common = new Common({ chain, hardfork }) const vm = new VM({ common }) - const balance = testCase.selfbalance - ? new BN(Buffer.from(testCase.selfbalance.slice(2), 'hex')) - : undefined - const account = createAccount(new BN(0), balance) + const balance = testCase.selfbalance ? BigInt(testCase.selfbalance) : undefined + const account = createAccount(BigInt(0), balance) await vm.stateManager.putAccount(addr, account) diff --git a/packages/vm/tests/api/istanbul/eip-2200.spec.ts b/packages/vm/tests/api/istanbul/eip-2200.spec.ts index 41430a28ffe..bea79d4a53d 100644 --- a/packages/vm/tests/api/istanbul/eip-2200.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-2200.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN, setLengthLeft, toBuffer } from 'ethereumjs-util' +import { Address, setLengthLeft, toBuffer } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' import { createAccount } from '../utils' @@ -50,10 +50,10 @@ tape('Istanbul: EIP-2200', async (t) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) const vm = new VM({ common }) - const account = createAccount(new BN(0), new BN(0)) + const account = createAccount(BigInt(0), BigInt(0)) await vm.stateManager.putAccount(addr, account) await vm.stateManager.putContractCode(addr, Buffer.from(testCase.code, 'hex')) - if (!(testCase.original === BigInt(0))) { + if (testCase.original !== BigInt(0)) { await vm.stateManager.putContractStorage( addr, key, diff --git a/packages/vm/tests/api/runBlock.spec.ts b/packages/vm/tests/api/runBlock.spec.ts index 2163dae31f8..9b20b60b3d6 100644 --- a/packages/vm/tests/api/runBlock.spec.ts +++ b/packages/vm/tests/api/runBlock.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN, rlp, KECCAK256_RLP, Account, bnToBigInt } from 'ethereumjs-util' +import { Address, rlp, KECCAK256_RLP, Account, bufferToBigInt } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block } from '@ethereumjs/block' import { @@ -88,9 +88,9 @@ tape('runBlock() -> successful API parameter usage', async (t) => { await vm.stateManager.getAccount( Address.fromString('0xb94f5374fce5ed0000000097c15331677e6ebf0b') ) - ).balance.toString('hex') + ).balance.toString(16) - st.equals( + st.equal( `0x${uncleReward}`, testData.postState['0xb94f5374fce5ed0000000097c15331677e6ebf0b'].balance, 'calculated balance should equal postState balance' @@ -142,13 +142,13 @@ tape('runBlock() -> successful API parameter usage', async (t) => { return Block.fromBlockData( { header: { - number: new BN(10000000), + number: BigInt(10000000), }, transactions: [ Transaction.fromTxData( { data: '0x600154', // PUSH 01 SLOAD - gasLimit: new BN(100000), + gasLimit: BigInt(100000), }, { common } ).sign(privateKey), @@ -237,7 +237,7 @@ tape('runBlock() -> API parameter usage/data errors', async (t) => { // modify first tx's gasLimit const { nonce, gasPrice, to, value, data, v, r, s } = block.transactions[0] - const gasLimit = new BN(Buffer.from('3fefba', 'hex')) + const gasLimit = BigInt('0x3fefba') const opts = { common: block._common } block.transactions[0] = new Transaction( { nonce, gasPrice, gasLimit, to, value, data, v, r, s }, @@ -266,15 +266,15 @@ tape('runBlock() -> runtime behavior', async (t) => { await setupPreConditions(vm.stateManager, testData) // fill two original DAO child-contracts with funds and the recovery account with funds in order to verify that the balance gets summed correctly - const fundBalance1 = new BN(Buffer.from('1111', 'hex')) - const accountFunded1 = createAccount(new BN(0), fundBalance1) + const fundBalance1 = BigInt('0x1111') + const accountFunded1 = createAccount(BigInt(0), fundBalance1) const DAOFundedContractAddress1 = new Address( Buffer.from('d4fe7bc31cedb7bfb8a345f31e668033056b2728', 'hex') ) await vm.stateManager.putAccount(DAOFundedContractAddress1, accountFunded1) - const fundBalance2 = new BN(Buffer.from('2222', 'hex')) - const accountFunded2 = createAccount(new BN(0), fundBalance2) + const fundBalance2 = BigInt('0x2222') + const accountFunded2 = createAccount(BigInt(0), fundBalance2) const DAOFundedContractAddress2 = new Address( Buffer.from('b3fb0e5aba0e20e5c49d252dfd30e102b171a425', 'hex') ) @@ -283,8 +283,8 @@ tape('runBlock() -> runtime behavior', async (t) => { const DAORefundAddress = new Address( Buffer.from('bf4ed7b27f1d666546e30d74d50d173d20bca754', 'hex') ) - const fundBalanceRefund = new BN(Buffer.from('4444', 'hex')) - const accountRefund = createAccount(new BN(0), fundBalanceRefund) + const fundBalanceRefund = BigInt('0x4444') + const accountRefund = createAccount(BigInt(0), fundBalanceRefund) await vm.stateManager.putAccount(DAORefundAddress, accountRefund) await vm.runBlock({ @@ -294,15 +294,15 @@ tape('runBlock() -> runtime behavior', async (t) => { }) const DAOFundedContractAccount1 = await vm.stateManager.getAccount(DAOFundedContractAddress1) - t.ok(DAOFundedContractAccount1.balance.isZero()) // verify our funded account now has 0 balance + t.equals(DAOFundedContractAccount1.balance, BigInt(0)) // verify our funded account now has 0 balance const DAOFundedContractAccount2 = await vm.stateManager.getAccount(DAOFundedContractAddress2) - t.ok(DAOFundedContractAccount2.balance.isZero()) // verify our funded account now has 0 balance + t.equals(DAOFundedContractAccount2.balance, BigInt(0)) // verify our funded account now has 0 balance const DAORefundAccount = await vm.stateManager.getAccount(DAORefundAddress) // verify that the refund account gets the summed balance of the original refund account + two child DAO accounts const msg = 'should transfer balance from DAO children to the Refund DAO account in the DAO fork' - t.ok(DAORefundAccount.balance.eq(new BN(Buffer.from('7777', 'hex'))), msg) + t.ok(DAORefundAccount.balance === BigInt(0x7777), msg) }) t.test('should allocate to correct clique beneficiary', async (t) => { @@ -334,7 +334,7 @@ tape('runBlock() -> runtime behavior', async (t) => { } // add balance to otherUser to send two txs to zero address - await vm.stateManager.putAccount(otherUser.address, new Account(new BN(0), new BN(42000))) + await vm.stateManager.putAccount(otherUser.address, new Account(BigInt(0), BigInt(42000))) const tx = Transaction.fromTxData( { to: Address.zero(), gasLimit: 21000, gasPrice: 1 }, { common } @@ -348,7 +348,7 @@ tape('runBlock() -> runtime behavior', async (t) => { await vm.runBlock({ block, skipNonce: true, skipBlockValidation: true, generate: true }) const account = await vm.stateManager.getAccount(signer.address) - t.ok(account.balance.eqn(42000), 'beneficiary balance should equal the cost of the txs') + t.equal(account.balance, BigInt(42000), 'beneficiary balance should equal the cost of the txs') }) }) @@ -382,7 +382,7 @@ tape('should correctly reflect generated fields', async (t) => { // which is a well known constant. const buffer32Zeros = Buffer.alloc(32, 0) const block = Block.fromBlockData({ - header: { receiptTrie: buffer32Zeros, transactionsTrie: buffer32Zeros, gasUsed: new BN(1) }, + header: { receiptTrie: buffer32Zeros, transactionsTrie: buffer32Zeros, gasUsed: BigInt(1) }, }) const results = await runBlockAndGetAfterBlockEvent(vm, { @@ -393,7 +393,7 @@ tape('should correctly reflect generated fields', async (t) => { t.ok(results.block.header.receiptTrie.equals(KECCAK256_RLP)) t.ok(results.block.header.transactionsTrie.equals(KECCAK256_RLP)) - t.ok(results.block.header.gasUsed.eqn(0)) + t.equals(results.block.header.gasUsed, BigInt(0)) }) async function runWithHf(hardfork: string) { @@ -445,7 +445,7 @@ tape('runBlock() -> tx types', async (t) => { if (transactions.some((t) => t.supports(Capability.EIP1559FeeMarket))) { // @ts-ignore overwrite read-only property - block.header.baseFeePerGas = new BN(7) + block.header.baseFeePerGas = BigInt(7) } //@ts-ignore @@ -459,14 +459,12 @@ tape('runBlock() -> tx types', async (t) => { st.ok( res.gasUsed === - bnToBigInt( - res.receipts - .map((r) => r.gasUsed) - .reduce( - (prevValue: BN, currValue: Buffer) => prevValue.add(new BN(currValue)), - new BN(0) - ) - ), + res.receipts + .map((r) => r.gasUsed) + .reduce( + (prevValue: bigint, currValue: Buffer) => prevValue + bufferToBigInt(currValue), + BigInt(0) + ), "gas used should equal transaction's total gasUsed" ) } diff --git a/packages/vm/tests/api/runBlockchain.spec.ts b/packages/vm/tests/api/runBlockchain.spec.ts index 58f38b59582..020d0424bfb 100644 --- a/packages/vm/tests/api/runBlockchain.spec.ts +++ b/packages/vm/tests/api/runBlockchain.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { BN, toBuffer } from 'ethereumjs-util' +import { toBuffer } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import Common, { Chain, Hardfork } from '@ethereumjs/common' import Blockchain from '@ethereumjs/blockchain' @@ -170,7 +170,7 @@ function createBlock(parent: Block | undefined, n = 0, opts = {}) { header: { number: n, parentHash: parent.hash(), - difficulty: new BN(0xfffffff), + difficulty: BigInt(0xfffffff), stateRoot: parent.header.stateRoot, }, } diff --git a/packages/vm/tests/api/runCall.spec.ts b/packages/vm/tests/api/runCall.spec.ts index 6e013de5aa2..01a7e8db10d 100644 --- a/packages/vm/tests/api/runCall.spec.ts +++ b/packages/vm/tests/api/runCall.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN, keccak256, MAX_UINT64, padToEven } from 'ethereumjs-util' +import { Account, Address, keccak256, MAX_UINT64, padToEven } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../src' import { ERROR } from '../../src/exceptions' @@ -44,7 +44,7 @@ tape('Constantinople: EIP-1014 CREATE2 creates the right contract address', asyn */ await vm.stateManager.putContractCode(contractAddress, Buffer.from(code, 'hex')) // setup the contract code - + await vm.stateManager.putAccount(caller, new Account(BigInt(0), BigInt(0x11111111))) // give the calling account a big balance so we don't run out of funds const codeHash = keccak256(Buffer.from('')) for (let value = 0; value <= 1000; value += 20) { // setup the call arguments @@ -153,8 +153,9 @@ tape('Ensure that precompile activation creates non-empty accounts', async (t) = */ await vmNotActivated.stateManager.putContractCode(contractAddress, Buffer.from(code, 'hex')) // setup the contract code + await vmNotActivated.stateManager.putAccount(caller, new Account(BigInt(0), BigInt(0x111))) // give calling account a positive balance await vmActivated.stateManager.putContractCode(contractAddress, Buffer.from(code, 'hex')) // setup the contract code - + await vmActivated.stateManager.putAccount(caller, new Account(BigInt(0), BigInt(0x111))) // give calling account a positive balance // setup the call arguments const runCallArgs = { caller: caller, // call address @@ -169,7 +170,7 @@ tape('Ensure that precompile activation creates non-empty accounts', async (t) = const diff = resultNotActivated.gasUsed - resultActivated.gasUsed const expected = BigInt(common.param('gasPrices', 'callNewAccount')) - t.assert(diff === expected, 'precompiles are activated') + t.equal(diff, expected, 'precompiles are activated') t.end() }) @@ -358,7 +359,7 @@ tape('ensure that sstores pay for the right gas costs pre-byzantium', async (t) await vm.stateManager.putContractCode(address, Buffer.from(code, 'hex')) const account = await vm.stateManager.getAccount(caller) - account.balance = new BN(100) + account.balance = BigInt(100) await vm.stateManager.putAccount(caller, account) /* @@ -436,7 +437,7 @@ tape( await vm.stateManager.putContractCode(address, Buffer.from(code, 'hex')) const account = await vm.stateManager.getAccount(address) - account.nonce = MAX_UINT64.subn(1) + account.nonce = MAX_UINT64 - BigInt(1) await vm.stateManager.putAccount(address, account) // setup the call arguments @@ -477,8 +478,8 @@ tape('Ensure that IDENTITY precompile copies the memory', async (t) => { const code = '3034526020600760203460045afa602034343e604034f3' const account = await vm.stateManager.getAccount(caller) - account.nonce = new BN(1) // ensure nonce for contract is correct - account.balance = new BN('10000000000000000') + account.nonce = BigInt(1) // ensure nonce for contract is correct + account.balance = BigInt(10000000000000000) await vm.stateManager.putAccount(caller, account) // setup the call arguments diff --git a/packages/vm/tests/api/runCode.spec.ts b/packages/vm/tests/api/runCode.spec.ts index 5c57aaa129d..2fd4bc6c655 100644 --- a/packages/vm/tests/api/runCode.spec.ts +++ b/packages/vm/tests/api/runCode.spec.ts @@ -41,7 +41,7 @@ tape('VM.runCode: initial program counter', (t) => { if (testData.error) { err = err ? err.message : 'no error thrown' - st.equals(err, testData.error, 'error message should match') + st.equal(err, testData.error, 'error message should match') err = false } diff --git a/packages/vm/tests/api/runTx.spec.ts b/packages/vm/tests/api/runTx.spec.ts index 31b2db3cf79..16944c1f381 100644 --- a/packages/vm/tests/api/runTx.spec.ts +++ b/packages/vm/tests/api/runTx.spec.ts @@ -1,13 +1,5 @@ import tape from 'tape' -import { - Account, - Address, - BN, - MAX_INTEGER, - toBuffer, - bufferToBigInt, - bnToBigInt, -} from 'ethereumjs-util' +import { Account, Address, MAX_INTEGER, toBuffer, bufferToBigInt } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { @@ -17,7 +9,7 @@ import { FeeMarketEIP1559TxData, } from '@ethereumjs/tx' import VM from '../../src' -import { createAccount, getTransaction } from './utils' +import { createAccount, getTransaction, setBalance } from './utils' const TRANSACTION_TYPES = [ { @@ -112,7 +104,7 @@ tape('runTx() -> successful API parameter usage', async (t) => { 'hex' ) const address = Address.fromPrivateKey(privateKey) - const initialBalance = new BN(10).pow(new BN(18)) + const initialBalance = BigInt(10) ** BigInt(18) const account = await vm.stateManager.getAccount(address) await vm.stateManager.putAccount( @@ -159,14 +151,17 @@ tape('runTx() -> successful API parameter usage', async (t) => { const baseFee = block.header.baseFeePerGas! const inclusionFeePerGas = tx instanceof FeeMarketEIP1559Transaction - ? bnToBigInt(BN.min(tx.maxPriorityFeePerGas, tx.maxFeePerGas.sub(baseFee))) - : bnToBigInt(tx.gasPrice.sub(baseFee)) + ? tx.maxPriorityFeePerGas < tx.maxFeePerGas - baseFee + ? tx.maxPriorityFeePerGas + : tx.maxFeePerGas - baseFee + : tx.gasPrice - baseFee const expectedCoinbaseBalance = common.isActivatedEIP(1559) ? result.gasUsed * inclusionFeePerGas : result.amountSpent - t.ok( - bnToBigInt(coinbaseAccount.balance) === expectedCoinbaseBalance, + t.equals( + coinbaseAccount.balance, + expectedCoinbaseBalance, `should use custom block (${txType.name})` ) @@ -259,8 +254,8 @@ tape('runTx() -> API parameter usage/data errors', (t) => { let tx = getTransaction(vm._common, 2, true) as FeeMarketEIP1559Transaction const address = tx.getSenderAddress() tx = Object.create(tx) - const maxCost = tx.gasLimit.mul(tx.maxFeePerGas) - await vm.stateManager.putAccount(address, createAccount(new BN(0), maxCost.subn(1))) + const maxCost = tx.gasLimit * tx.maxFeePerGas + await vm.stateManager.putAccount(address, createAccount(BigInt(0), maxCost - BigInt(1))) try { await vm.runTx({ tx }) t.fail('should throw error') @@ -268,7 +263,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { t.ok(e.message.toLowerCase().includes('max cost'), `should fail if max cost exceeds balance`) } // set sufficient balance - await vm.stateManager.putAccount(address, createAccount(new BN(0), maxCost)) + await vm.stateManager.putAccount(address, createAccount(BigInt(0), maxCost)) const res = await vm.runTx({ tx }) t.ok(res, 'should pass if balance is sufficient') @@ -277,13 +272,13 @@ tape('runTx() -> API parameter usage/data errors', (t) => { t.test('run with insufficient eip1559 funds', async (t) => { const vm = new VM({ common }) - const tx = getTransaction(common, 2, true, '0x', false) + const tx = getTransaction(common, 2, true, '0x0', false) const address = tx.getSenderAddress() const account = await vm.stateManager.getAccount(address) - account.balance = new BN(9000000) // This is the maxFeePerGas multiplied with the gasLimit of 90000 + account.balance = BigInt(9000000) // This is the maxFeePerGas multiplied with the gasLimit of 90000 await vm.stateManager.putAccount(address, account) await vm.runTx({ tx }) - account.balance = new BN(9000000) + account.balance = BigInt(9000000) await vm.stateManager.putAccount(address, account) const tx2 = getTransaction(common, 2, true, '0x64', false) // Send 100 wei; now balance < maxFeePerGas*gasLimit + callvalue try { @@ -297,11 +292,11 @@ tape('runTx() -> API parameter usage/data errors', (t) => { t.test('should throw on wrong nonces', async (t) => { const vm = new VM({ common }) - const tx = getTransaction(common, 2, true, '0x', false) + const tx = getTransaction(common, 2, true, '0x0', false) const address = tx.getSenderAddress() const account = await vm.stateManager.getAccount(address) - account.balance = new BN(9000000) // This is the maxFeePerGas multiplied with the gasLimit of 90000 - account.nonce = new BN(1) + account.balance = BigInt(9000000) // This is the maxFeePerGas multiplied with the gasLimit of 90000 + account.nonce = BigInt(1) await vm.stateManager.putAccount(address, account) try { await vm.runTx({ tx }) @@ -393,7 +388,7 @@ tape('runTx() -> runtime errors', async (t) => { const from = createAccount() await vm.stateManager.putAccount(caller, from) - const to = createAccount(new BN(0), MAX_INTEGER) + const to = createAccount(BigInt(0), MAX_INTEGER) await vm.stateManager.putAccount(tx.to!, to) const res = await vm.runTx({ tx }) @@ -424,7 +419,7 @@ tape('runTx() -> runtime errors', async (t) => { const contractAddress = new Address( Buffer.from('61de9dc6f6cff1df2809480882cfd3c2364b28f7', 'hex') ) - const to = createAccount(new BN(0), MAX_INTEGER) + const to = createAccount(BigInt(0), MAX_INTEGER) await vm.stateManager.putAccount(contractAddress, to) const res = await vm.runTx({ tx }) @@ -491,13 +486,16 @@ tape('runTx() -> API return values', async (t) => { t.deepEqual( res.gasUsed, - bnToBigInt(tx.getBaseFee()), + tx.getBaseFee(), `runTx result -> gasUsed -> tx.getBaseFee() (${txType.name})` ) if (tx instanceof FeeMarketEIP1559Transaction) { - const baseFee = new BN(7) - const inclusionFeePerGas = BN.min(tx.maxPriorityFeePerGas, tx.maxFeePerGas.sub(baseFee)) - const gasPrice = bnToBigInt(inclusionFeePerGas) + bnToBigInt(baseFee) + const baseFee = BigInt(7) + const inclusionFeePerGas = + tx.maxPriorityFeePerGas < tx.maxFeePerGas - baseFee + ? tx.maxPriorityFeePerGas + : tx.maxFeePerGas - baseFee + const gasPrice = inclusionFeePerGas + baseFee t.deepEquals( res.amountSpent, res.gasUsed * gasPrice, @@ -506,7 +504,7 @@ tape('runTx() -> API return values', async (t) => { } else { t.deepEqual( res.amountSpent, - res.gasUsed * bnToBigInt((tx).gasPrice), + res.gasUsed * (tx).gasPrice, `runTx result -> amountSpent -> gasUsed * gasPrice (${txType.name})` ) } @@ -555,8 +553,8 @@ tape('runTx() -> consensus bugs', async (t) => { v: '0x26', value: '0x0', } - const beforeBalance = new BN('149123788000000000') - const afterBalance = new BN('129033829000000000') + const beforeBalance = BigInt(149123788000000000) + const afterBalance = BigInt(129033829000000000) const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.SpuriousDragon }) common.setHardforkByBlockNumber(2772981) @@ -565,14 +563,14 @@ tape('runTx() -> consensus bugs', async (t) => { const addr = Address.fromString('0xd3563d8f19a85c95beab50901fd59ca4de69174c') const acc = await vm.stateManager.getAccount(addr) acc.balance = beforeBalance - acc.nonce = new BN(2) + acc.nonce = BigInt(2) await vm.stateManager.putAccount(addr, acc) const tx = Transaction.fromTxData(txData, { common }) await vm.runTx({ tx }) const newBalance = (await vm.stateManager.getAccount(addr)).balance - t.ok(newBalance.eq(afterBalance)) + t.equals(newBalance, afterBalance) t.end() }) @@ -602,7 +600,7 @@ tape('runTx() -> consensus bugs', async (t) => { const addr = Address.fromPrivateKey(pkey) const acc = await vm.stateManager.getAccount(addr) - acc.balance = new BN(10000000000000) + acc.balance = BigInt(10000000000000) await vm.stateManager.putAccount(addr, acc) const tx = FeeMarketEIP1559Transaction.fromTxData(txData, { common }).sign(pkey) @@ -618,21 +616,26 @@ tape('runTx() -> consensus bugs', async (t) => { tape('runTx() -> RunTxOptions', (t) => { t.test('should throw on negative value args', async (t) => { const vm = new VM({ common }) + await setBalance(vm, Address.zero(), BigInt(10000000000)) for (const txType of TRANSACTION_TYPES) { - const tx = getTransaction(vm._common, txType.type, true) - tx.value.isubn(1) - - try { - await vm.runTx({ - tx, - skipBalance: true, - }) - t.fail('should not accept a negative call value') - } catch (err: any) { - t.ok( - err.message.includes('value field cannot be negative'), - 'throws on negative call value' - ) + const tx = getTransaction(vm._common, txType.type, false) + tx.getSenderAddress = () => Address.zero() + // @ts-ignore overwrite read-only property + tx.value -= BigInt(1) + + for (const skipBalance of [true, false]) { + try { + await vm.runTx({ + tx, + skipBalance, + }) + t.fail('should not accept a negative call value') + } catch (err: any) { + t.ok( + err.message.includes('value field cannot be negative'), + 'throws on negative call value' + ) + } } } t.end() diff --git a/packages/vm/tests/api/state/accountExists.spec.ts b/packages/vm/tests/api/state/accountExists.spec.ts index 98151a151f0..388dcbcbb93 100644 --- a/packages/vm/tests/api/state/accountExists.spec.ts +++ b/packages/vm/tests/api/state/accountExists.spec.ts @@ -1,5 +1,5 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { Address, BN, toBuffer } from 'ethereumjs-util' +import { Address, toBuffer } from 'ethereumjs-util' import tape from 'tape' import VM from '../../../src' @@ -21,7 +21,7 @@ tape('correctly apply new account gas fee on pre-Spurious Dragon hardforks', asy const existingAddress = caller const existingAccount = await vm.stateManager.getAccount(existingAddress) - existingAccount.balance = new BN(1) + existingAccount.balance = BigInt(1) await vm.stateManager.putAccount(existingAddress, existingAccount) await vm.stateManager.putContractCode(contractAddress, Buffer.from(code, 'hex')) // setup the contract code await vm.stateManager.putContractStorage( @@ -61,7 +61,7 @@ tape( '606060405236156101065760e060020a600035046305fefda7811461013d57806306fdde031461016357806318160ddd146101c057806323b872dd146101c95780632e1a7d4d146101fb578063313ce5671461021e5780633177029f1461022a57806347f1d8d7146102d25780634b750334146102db57806370a08231146102e45780638620410b146102fc5780638da5cb5b1461030557806395d89b4114610317578063a6f2ae3a14610372578063a9059cbb146103a2578063b414d4b6146103d1578063c91d956c146103ec578063dc3080f21461040f578063dd62ed3e14610434578063e4849b3214610459578063e724529c1461048f578063f2fde38b146104b5575b6104d860055434111561013b5760055433600160a060020a031660009081526008602052604090208054349290920490910190555b565b6104d8600435602435600054600160a060020a0390811633919091161461084157610002565b60408051600180546020600282841615610100026000190190921691909104601f81018290048202840182019094528383526104da93908301828280156105db5780601f106105b0576101008083540402835291602001916105db565b61054860065481565b610548600435602435604435600160a060020a038316600090815260086020526040812054829010156106f657610002565b6104d8600435600054600160a060020a0390811633919091161461091957610002565b61055a60035460ff1681565b610548600435602435600160a060020a033381166000818152600a60209081526040808320878616808552925280832086905580517f4889ca880000000000000000000000000000000000000000000000000000000081526004810194909452602484018690523090941660448401529251909285929091634889ca88916064808201928792909190829003018183876161da5a03f115610002575060019695505050505050565b61054860075481565b61054860045481565b61054860043560086020526000908152604090205481565b61054860055481565b610571600054600160a060020a031681565b6040805160028054602060018216156101000260001901909116829004601f81018290048202840182019094528383526104da93908301828280156105db5780601f106105b0576101008083540402835291602001916105db565b60055430600160a060020a03166000908152600860205260409020546104d8913404908190101561084c57610002565b6104d8600435602435600160a060020a033316600090815260086020526040902054819010156105f157610002565b61054860043560096020526000908152604090205460ff1681565b6104d8600435600054600160a060020a039081163391909116146105e357610002565b600b602090815260043560009081526040808220909252602435815220546105489081565b600a602090815260043560009081526040808220909252602435815220546105489081565b6104d86004355b806008600050600033600160a060020a031681526020019081526020016000206000505410156108a657610002565b6104d8600435602435600054600160a060020a039081163391909116146107e157610002565b6104d8600435600054600160a060020a0390811633919091161461058e57610002565b005b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f16801561053a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60408051918252519081900360200190f35b6040805160ff929092168252519081900360200190f35b60408051600160a060020a03929092168252519081900360200190f35b6000805473ffffffffffffffffffffffffffffffffffffffff19168217905550565b820191906000526020600020905b8154815290600101906020018083116105be57829003601f168201915b505050505081565b66038d7ea4c6800002600755565b600160a060020a038216600090815260086020526040902054818101101561061857610002565b600160a060020a03331660009081526009602052604090205460ff161561063e57610002565b600160a060020a0333811660008181526008602090815260408083208054879003905593861680835291849020805486019055835185815293519193600080516020610940833981519152929081900390910190a3600754600160a060020a0383163110156106c4576007546004546106c491600160a060020a03851631900304610460565b604051600454600754600160a060020a038516926000928431909203919091049082818181858883f150505050505050565b600160a060020a038316600090815260086020526040902054808301101561071d57610002565b600160a060020a038481166000818152600a602090815260408083203390951680845294825280832054938352600b825280832094835293905291909120548301111561076957610002565b600160a060020a03848116600081815260086020908152604080832080548890039055878516808452818420805489019055848452600b835281842033909616845294825291829020805487019055815186815291516000805160206109408339815191529281900390910190a35060019392505050565b600160a060020a038216600081815260096020908152604091829020805460ff1916851790558151928352820183905280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600491909155600555565b600160a060020a03338116600081815260086020908152604080832080548701905530909416808352918490208054869003905583518581529351929391926000805160206109408339815191529281900390910190a350565b30600160a060020a039081166000908152600860205260408082208054850190553390921680825282822080548590039055915160045484029082818181858883f15084815260405130600160a060020a031694935060008051602061094083398151915292509081900360200190a350565b60008054604051600160a060020a03919091169190839082818181858883f150505050505056ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' const existingAddress = caller const existingAccount = await vm.stateManager.getAccount(existingAddress) - existingAccount.balance = new BN(1) + existingAccount.balance = BigInt(1) await vm.stateManager.putAccount(existingAddress, existingAccount) // add empty account to DB const emptyAddress = new Address(Buffer.from('f48a1bdc65d9ccb4b569ffd4bffff415b90783d6', 'hex')) diff --git a/packages/vm/tests/api/state/cache.spec.ts b/packages/vm/tests/api/state/cache.spec.ts index a252d3c9eff..4cc31bff880 100644 --- a/packages/vm/tests/api/state/cache.spec.ts +++ b/packages/vm/tests/api/state/cache.spec.ts @@ -1,6 +1,6 @@ import tape from 'tape' import { SecureTrie as Trie } from 'merkle-patricia-tree' -import { Account, Address, BN } from 'ethereumjs-util' +import { Account, Address } from 'ethereumjs-util' import Cache, { getCb, putCb } from '../../../src/state/cache' import { createAccount } from '../utils' @@ -22,7 +22,7 @@ tape('cache initialization', (t) => { } const cache = new Cache({ getCb, putCb, deleteCb }) - st.ok(cache._checkpoints.length === 0, 'initializes given trie') + st.equal(cache._checkpoints.length, 0, 'initializes given trie') st.end() }) }) @@ -45,18 +45,18 @@ tape('cache put and get account', (t) => { const cache = new Cache({ getCb, putCb, deleteCb }) const addr = new Address(Buffer.from('cd2a3d9f938e13cd947ec05abc7fe734df8dd826', 'hex')) - const acc = createAccount(new BN(0), new BN(0xff11)) + const acc = createAccount(BigInt(0), BigInt(0xff11)) t.test('should fail to get non-existent account', async (st) => { const res = cache.get(addr) - st.notOk(res.balance.eq(acc.balance)) + st.notEqual(res.balance, acc.balance) st.end() }) t.test('should put account', async (st) => { cache.put(addr, acc) const res = cache.get(addr) - st.ok(res.balance.eq(acc.balance)) + st.equal(res.balance, acc.balance) st.end() }) @@ -74,7 +74,7 @@ tape('cache put and get account', (t) => { t.test('trie should contain flushed account', async (st) => { const raw = await trie.get(addr.buf) const res = Account.fromRlpSerializedAccount(raw!) - st.ok(res.balance.eq(acc.balance)) + st.equal(res.balance, acc.balance) st.end() }) @@ -82,18 +82,18 @@ tape('cache put and get account', (t) => { cache.del(addr) const res = cache.get(addr) - st.notOk(res.balance.eq(acc.balance)) + st.notEqual(res.balance, acc.balance) st.end() }) t.test('should update loaded account and flush it', async (st) => { - const updatedAcc = createAccount(new BN(0), new BN(0xff00)) + const updatedAcc = createAccount(BigInt(0), BigInt(0xff00)) cache.put(addr, updatedAcc) await cache.flush() const raw = await trie.get(addr.buf) const res = Account.fromRlpSerializedAccount(raw!) - st.ok(res.balance.eq(updatedAcc.balance)) + st.equal(res.balance, updatedAcc.balance) st.end() }) }) @@ -116,8 +116,8 @@ tape('cache checkpointing', (t) => { const cache = new Cache({ getCb, putCb, deleteCb }) const addr = new Address(Buffer.from('cd2a3d9f938e13cd947ec05abc7fe734df8dd826', 'hex')) - const acc = createAccount(new BN(0), new BN(0xff11)) - const updatedAcc = createAccount(new BN(0x00), new BN(0xff00)) + const acc = createAccount(BigInt(0), BigInt(0xff11)) + const updatedAcc = createAccount(BigInt(0x00), BigInt(0xff00)) t.test('should revert to correct state', async (st) => { cache.put(addr, acc) @@ -125,12 +125,12 @@ tape('cache checkpointing', (t) => { cache.put(addr, updatedAcc) let res = cache.get(addr) - st.ok(res.balance.eq(updatedAcc.balance)) + st.equal(res.balance, updatedAcc.balance) cache.revert() res = cache.get(addr) - st.ok(res.balance.eq(acc.balance)) + st.equal(res.balance, acc.balance) st.end() }) diff --git a/packages/vm/tests/api/state/proofStateManager.spec.ts b/packages/vm/tests/api/state/proofStateManager.spec.ts index 412c363170d..42cfa7d1350 100644 --- a/packages/vm/tests/api/state/proofStateManager.spec.ts +++ b/packages/vm/tests/api/state/proofStateManager.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, BN, keccak256, toBuffer, zeros } from 'ethereumjs-util' +import { Address, keccak256, toBuffer, zeros } from 'ethereumjs-util' import { SecureTrie } from 'merkle-patricia-tree' import { DefaultStateManager } from '../../../src/state' import ropsten_validAccount from './testdata/ropsten_validAccount.json' @@ -17,12 +17,12 @@ tape('ProofStateManager', (t) => { await stateManager.putContractStorage(address, key, value) await stateManager.putContractCode(address, code) const account = await stateManager.getAccount(address) - account.balance = new BN(1) - account.nonce = new BN(2) + account.balance = BigInt(1) + account.nonce = BigInt(2) await stateManager.putAccount(address, account) const address2 = new Address(Buffer.from('20'.repeat(20), 'hex')) const account2 = await stateManager.getAccount(address2) - account.nonce = new BN(2) + account.nonce = BigInt(2) await stateManager.putAccount(address2, account2) await stateManager.commit() diff --git a/packages/vm/tests/api/state/stateManager.spec.ts b/packages/vm/tests/api/state/stateManager.spec.ts index 8eacb1ad72e..4733929b068 100644 --- a/packages/vm/tests/api/state/stateManager.spec.ts +++ b/packages/vm/tests/api/state/stateManager.spec.ts @@ -2,7 +2,6 @@ import tape from 'tape' import { Account, Address, - BN, toBuffer, keccak256, KECCAK256_RLP, @@ -35,7 +34,7 @@ tape('StateManager', (t) => { // commit some data to the trie const address = new Address(Buffer.from('a94f5374fce5edbc8e2a8697c15331677e6ebf0b', 'hex')) - const account = createAccount(new BN(0), new BN(1000)) + const account = createAccount(BigInt(0), BigInt(1000)) await stateManager.checkpoint() await stateManager.putAccount(address, account) await stateManager.commit() @@ -61,15 +60,15 @@ tape('StateManager', (t) => { await stateManager.putAccount(address, account) const account0 = await stateManager.getAccount(address) - st.ok(account0.balance.eq(account.balance), 'account value is set in the cache') + st.equal(account0.balance, account.balance, 'account value is set in the cache') await stateManager.commit() const account1 = await stateManager.getAccount(address) - st.ok(account1.balance.eq(account.balance), 'account value is set in the state trie') + st.equal(account1.balance, account.balance, 'account value is set in the state trie') await stateManager.setStateRoot(initialStateRoot) const account2 = await stateManager.getAccount(address) - st.ok(account2.balance.isZero(), 'account value is set to 0 in original state root') + st.equal(account2.balance, BigInt(0), 'account value is set to 0 in original state root') // test contract storage cache await stateManager.checkpoint() @@ -99,7 +98,7 @@ tape('StateManager', (t) => { const res1 = await stateManager.getAccount(address) - st.equal(res1.balance.toString('hex'), 'fff384') + st.equal(res1.balance, BigInt(0xfff384)) await stateManager._cache.flush() stateManager._cache.clear() @@ -140,7 +139,7 @@ tape('StateManager', (t) => { t.test('should return true for an existent account', async (st) => { const stateManager = new DefaultStateManager() - const account = createAccount(new BN(0x1), new BN(0x1)) + const account = createAccount(BigInt(0x1), BigInt(0x1)) const address = new Address(Buffer.from('a94f5374fce5edbc8e2a8697c15331677e6ebf0b', 'hex')) await stateManager.putAccount(address, account) @@ -156,7 +155,7 @@ tape('StateManager', (t) => { 'should call the callback with a false boolean representing non-emptiness when the account is not empty', async (st) => { const stateManager = new DefaultStateManager() - const account = createAccount(new BN(0x1), new BN(0x1)) + const account = createAccount(BigInt(0x1), BigInt(0x1)) const address = new Address(Buffer.from('a94f5374fce5edbc8e2a8697c15331677e6ebf0b', 'hex')) await stateManager.putAccount(address, account) @@ -175,17 +174,17 @@ tape('StateManager', (t) => { const address = new Address(Buffer.from('a94f5374fce5edbc8e2a8697c15331677e6ebf0b', 'hex')) await stateManager.putAccount(address, account) - await stateManager.modifyAccountFields(address, { balance: new BN(1234) }) + await stateManager.modifyAccountFields(address, { balance: BigInt(1234) }) const res1 = await stateManager.getAccount(address) - st.equal(res1.balance.toString('hex'), '4d2') + st.equal(res1.balance, BigInt(0x4d2)) - await stateManager.modifyAccountFields(address, { nonce: new BN(1) }) + await stateManager.modifyAccountFields(address, { nonce: BigInt(1) }) const res2 = await stateManager.getAccount(address) - st.equal(res2.nonce.toNumber(), 1) + st.equal(res2.nonce, BigInt(1)) await stateManager.modifyAccountFields(address, { codeHash: Buffer.from( @@ -218,13 +217,13 @@ tape('StateManager', (t) => { const stateManager = new DefaultStateManager() const address = new Address(Buffer.from('a94f5374fce5edbc8e2a8697c15331677e6ebf0b', 'hex')) - await stateManager.modifyAccountFields(address, { balance: new BN(1234) }) + await stateManager.modifyAccountFields(address, { balance: BigInt(1234) }) const res1 = await stateManager.getAccount(address) - st.equal(res1.balance.toString('hex'), '4d2') + st.equal(res1.balance, BigInt(0x4d2)) - await stateManager.modifyAccountFields(address, { nonce: new BN(1) }) + await stateManager.modifyAccountFields(address, { nonce: BigInt(1) }) const res2 = await stateManager.getAccount(address) - st.equal(res2.nonce.toNumber(), 1) + st.equal(res2.nonce, BigInt(1)) const newCodeHash = Buffer.from( 'd748bf26ab37599c944babfdbeecf6690801bd61bf2670efb0a34adfc6dca10b', @@ -258,7 +257,7 @@ tape('StateManager', (t) => { const stateManager = new StateManager() await stateManager.generateCanonicalGenesis() const stateRoot = await stateManager.getStateRoot() - st.equals( + st.equal( stateRoot.toString('hex'), genesisData.genesis_state_root, 'generateCanonicalGenesis should produce correct state root for mainnet from ethereum/tests data' diff --git a/packages/vm/tests/api/utils.ts b/packages/vm/tests/api/utils.ts index 4fe705e5c72..0026404c0a1 100644 --- a/packages/vm/tests/api/utils.ts +++ b/packages/vm/tests/api/utils.ts @@ -1,4 +1,4 @@ -import { Account, Address, BN } from 'ethereumjs-util' +import { Account, Address } from 'ethereumjs-util' import Blockchain from '@ethereumjs/blockchain' import VM from '../../src/index' import { VMOpts } from '../../src' @@ -8,12 +8,12 @@ import Common from '@ethereumjs/common' const level = require('level-mem') -export function createAccount(nonce: BN = new BN(0), balance: BN = new BN(0xfff384)) { +export function createAccount(nonce: bigint = BigInt(0), balance: bigint = BigInt(0xfff384)) { return new Account(nonce, balance) } -export async function setBalance(vm: VM, address: Address, balance = new BN(100000000)) { - const account = createAccount(new BN(0), balance) +export async function setBalance(vm: VM, address: Address, balance = BigInt(100000000)) { + const account = createAccount(BigInt(0), balance) await vm.stateManager.checkpoint() await vm.stateManager.putAccount(address, account) await vm.stateManager.commit() @@ -78,11 +78,11 @@ export function getTransaction( ] } else if (txType === 2) { txParams['gasPrice'] = undefined - txParams['maxFeePerGas'] = new BN(100) - txParams['maxPriorityFeePerGas'] = new BN(10) + txParams['maxFeePerGas'] = BigInt(100) + txParams['maxPriorityFeePerGas'] = BigInt(10) } - const tx = TransactionFactory.fromTxData(txParams, { common }) + const tx = TransactionFactory.fromTxData(txParams, { common, freeze: false }) if (sign) { const privateKey = Buffer.from( diff --git a/packages/vm/tests/tester/index.ts b/packages/vm/tests/tester/index.ts index f9b1e26f05b..8977d37620a 100755 --- a/packages/vm/tests/tester/index.ts +++ b/packages/vm/tests/tester/index.ts @@ -221,18 +221,16 @@ async function runTests() { } for (const failingTestIdentifier in failingTests) { - console.log('Errors thrown in ' + failingTestIdentifier + ':') + console.log(`Errors thrown in ${failingTestIdentifier}:`) const errors = failingTests[failingTestIdentifier] for (let i = 0; i < errors.length; i++) { - console.log('\t' + errors[i]) + console.log('\t' + errors[i]) } } - if (expectedTests != undefined) { - t.ok( - (t as any).assertCount >= expectedTests, - 'expected ' + expectedTests.toString() + ' checks, got ' + (t as any).assertCount - ) + if (expectedTests !== undefined) { + const { assertCount } = t as any + t.ok(assertCount >= expectedTests, `expected ${expectedTests} checks, got ${assertCount}`) } t.end() diff --git a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts index 58cc6e9e15c..f3cbcc8771a 100644 --- a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts +++ b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts @@ -3,17 +3,25 @@ import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { ConsensusAlgorithm } from '@ethereumjs/common' import { TransactionFactory } from '@ethereumjs/tx' -import { addHexPrefix, toBuffer, rlp, stripHexPrefix, bufferToBigInt } from 'ethereumjs-util' +import { toBuffer, rlp, stripHexPrefix, bufferToBigInt, isHexPrefixed } from 'ethereumjs-util' import { SecureTrie as Trie } from 'merkle-patricia-tree' import { setupPreConditions, verifyPostConditions } from '../../util' const level = require('level') const levelMem = require('level-mem') +function formatBlockHeader(data: any) { + const formatted: any = {} + for (const [key, value] of Object.entries(data) as [string, string][]) { + formatted[key] = isHexPrefixed(value) ? value : BigInt(value) + } + return formatted +} + export default async function runBlockchainTest(options: any, testData: any, t: tape.Test) { // ensure that the test data is the right fork data if (testData.network != options.forkConfigTestSuite) { - t.comment('skipping test: no data available for ' + options.forkConfigTestSuite) + t.comment(`skipping test: no data available for ${options.forkConfigTestSuite}`) return } @@ -115,7 +123,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: try { // Update common HF - common.setHardforkByBlockNumber(Number(currentBlock)) + common.setHardforkByBlockNumber(currentBlock) // transactionSequence is provided when txs are expected to be rejected. // To run this field we try to import them on the current state. @@ -128,7 +136,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: for (const txData of raw.transactionSequence) { const shouldFail = txData.valid == 'false' try { - const txRLP = Buffer.from(txData.rawBytes.slice(2), 'hex') + const txRLP = toBuffer(txData.rawBytes) const tx = TransactionFactory.fromSerializedData(txRLP) await blockBuilder.addTransaction(tx) if (shouldFail) { @@ -138,7 +146,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: if (!shouldFail) { t.fail(`tx should not fail, but failed: ${e.message}`) } else { - t.pass('tx succesfully failed') + t.pass('tx successfully failed') } } } @@ -174,7 +182,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: await cacheDB.close() if (expectException) { - t.fail('expected exception but test did not throw an exception: ' + expectException) + t.fail(`expected exception but test did not throw an exception: ${expectException}`) return } } catch (error: any) { @@ -196,12 +204,3 @@ export default async function runBlockchainTest(options: any, testData: any, t: t.comment(`Time: ${timeSpent}`) await cacheDB.close() } - -function formatBlockHeader(data: any) { - const r: any = {} - const keys = Object.keys(data) - keys.forEach(function (key) { - r[key] = addHexPrefix(data[key]) - }) - return r -} diff --git a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts index 7f66a727bb3..4ae409227ee 100644 --- a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts +++ b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts @@ -160,6 +160,6 @@ export default async function runStateTest(options: any, testData: any, t: tape. } } catch (e: any) { console.log(e) - t.fail('error running test case for fork: ' + options.forkConfigTestSuite) + t.fail(`error running test case for fork: ${options.forkConfigTestSuite}`) } } diff --git a/packages/vm/tests/util.ts b/packages/vm/tests/util.ts index f91efe3fa5b..208ac903936 100644 --- a/packages/vm/tests/util.ts +++ b/packages/vm/tests/util.ts @@ -9,13 +9,15 @@ import { } from '@ethereumjs/tx' import { Account, - BN, rlp, keccak256, stripHexPrefix, setLengthLeft, toBuffer, Address, + bigIntToBuffer, + bufferToHex, + isHexPrefixed, } from 'ethereumjs-util' import { DefaultStateManager } from '../src/state' @@ -59,14 +61,14 @@ export function dumpState(state: any, cb: Function) { results.push(result) } for (let i = 0; i < results.length; i++) { - console.log("SHA3'd address: " + results[i].address.toString('hex')) - console.log('\tstate root: ' + results[i].stateRoot.toString('hex')) + console.log("SHA3'd address: " + bufferToHex(results[i].address)) + console.log('\tstate root: ' + bufferToHex(results[i].stateRoot)) console.log('\tstorage: ') for (const storageKey in results[i].storage) { - console.log('\t\t' + storageKey + ': ' + results[i].storage[storageKey]) + console.log('\t\t' + storageKey + ': ' + results[i].storage[storageKey]) } - console.log('\tnonce: ' + new BN(results[i].nonce).toString()) - console.log('\tbalance: ' + new BN(results[i].balance).toString()) + console.log('\tnonce: ' + BigInt(results[i].nonce)) + console.log('\tbalance: ' + BigInt(results[i].balance)) } cb() }) @@ -77,14 +79,18 @@ export function format(a: any, toZero: boolean = false, isHex: boolean = false) return Buffer.alloc(0) } - if (a.slice && a.slice(0, 2) === '0x') { + if (typeof a === 'string' && isHexPrefixed(a)) { a = a.slice(2) - if (a.length % 2) a = '0' + a + if (a.length % 2) a = '0' + a a = Buffer.from(a, 'hex') } else if (!isHex) { - a = Buffer.from(new BN(a).toArray()) + try { + a = bigIntToBuffer(BigInt(a)) + } catch { + // pass + } } else { - if (a.length % 2) a = '0' + a + if (a.length % 2) a = '0' + a a = Buffer.from(a, 'hex') } @@ -146,7 +152,7 @@ export async function verifyPostConditions(state: any, testData: any, t: tape.Te const promise = verifyAccountPostConditions(state, address, account, testData, t) queue.push(promise) } else { - t.fail('invalid account in the trie: ' + key) + t.fail('invalid account in the trie: ' + key) } }) @@ -238,11 +244,11 @@ export function verifyGas(results: any, testData: any, t: tape.Test) { return } - const postBal = new BN(testData.post[coinbaseAddr].balance) - const balance = postBal.sub(preBal) - if (!balance.isZero()) { - const amountSpent = results.gasUsed.mul(testData.transaction.gasPrice) - t.ok(amountSpent.eq(balance), 'correct gas') + const postBal = BigInt(testData.post[coinbaseAddr].balance) + const balance = postBal - preBal + if (balance !== BigInt(0)) { + const amountSpent = results.gasUsed * testData.transaction.gasPrice + t.equal(amountSpent, balance, 'correct gas') } else { t.equal(results, undefined) } @@ -250,7 +256,7 @@ export function verifyGas(results: any, testData: any, t: tape.Test) { /** * verifyLogs - * @param logs to verify + * @param logs to verify * @param testData from tests repo */ export function verifyLogs(logs: any, testData: any, t: tape.Test) { @@ -258,7 +264,7 @@ export function verifyLogs(logs: any, testData: any, t: tape.Test) { testData.logs.forEach(function (log: any, i: number) { const rlog = logs[i] t.equal(rlog[0].toString('hex'), log.address, 'log: valid address') - t.equal('0x' + rlog[2].toString('hex'), log.data, 'log: valid data') + t.equal(bufferToHex(rlog[2]), log.data, 'log: valid data') log.topics.forEach(function (topic: string, i: number) { t.equal(rlog[1][i].toString('hex'), topic, 'log: invalid topic') }) @@ -320,13 +326,11 @@ export async function setupPreConditions(state: DefaultStateManager, testData: a // Set contract storage for (const storageKey of Object.keys(storage)) { - const valBN = new BN(format(storage[storageKey]), 16) - if (valBN.isZero()) { + const val = format(storage[storageKey]) + if (['', '00'].includes(val.toString('hex'))) { continue } - const val = valBN.toArrayLike(Buffer, 'be') const key = setLengthLeft(format(storageKey), 32) - await state.putContractStorage(address, key, val) } From a5ad034fc3d72c66114baa2dbc48921dd7d84fcc Mon Sep 17 00:00:00 2001 From: Gabriel Rocheleau Date: Tue, 15 Mar 2022 05:20:58 -0400 Subject: [PATCH 18/44] refactor: unify constructor input types and refactor defaults to class constructor (#1787) --- packages/block/src/header.ts | 141 +++++++++++++++-------------------- 1 file changed, 62 insertions(+), 79 deletions(-) diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index 8dcbb8b9860..3ca6705da9c 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -81,46 +81,7 @@ export class BlockHeader { * @param opts */ public static fromHeaderData(headerData: HeaderData = {}, opts: BlockOptions = {}) { - const { - parentHash, - uncleHash, - coinbase, - stateRoot, - transactionsTrie, - receiptTrie, - logsBloom, - difficulty, - number, - gasLimit, - gasUsed, - timestamp, - extraData, - mixHash, - nonce, - baseFeePerGas, - } = headerData - - return new BlockHeader( - toType(parentHash, TypeOutput.Buffer) ?? zeros(32), - toType(uncleHash, TypeOutput.Buffer) ?? KECCAK256_RLP_ARRAY, - new Address(toType(coinbase, TypeOutput.Buffer) ?? Buffer.alloc(20)), - toType(stateRoot, TypeOutput.Buffer) ?? zeros(32), - toType(transactionsTrie, TypeOutput.Buffer) ?? KECCAK256_RLP, - toType(receiptTrie, TypeOutput.Buffer) ?? KECCAK256_RLP, - toType(logsBloom, TypeOutput.Buffer) ?? zeros(256), - toType(difficulty, TypeOutput.BigInt) ?? BigInt(0), - toType(number, TypeOutput.BigInt) ?? BigInt(0), - toType(gasLimit, TypeOutput.BigInt) ?? DEFAULT_GAS_LIMIT, - toType(gasUsed, TypeOutput.BigInt) ?? BigInt(0), - toType(timestamp, TypeOutput.BigInt) ?? BigInt(0), - toType(extraData, TypeOutput.Buffer) ?? Buffer.from([]), - toType(mixHash, TypeOutput.Buffer) ?? zeros(32), - toType(nonce, TypeOutput.Buffer) ?? zeros(8), - opts, - baseFeePerGas !== undefined && baseFeePerGas !== null - ? toType(baseFeePerGas, TypeOutput.BigInt) - : undefined - ) + return new BlockHeader(headerData, opts) } /** @@ -142,7 +103,7 @@ export class BlockHeader { /** * Static constructor to create a block header from an array of Buffer values * - * @param headerData + * @param values * @param opts */ public static fromValuesArray(values: BlockHeaderBuffer, opts: BlockOptions = {}) { @@ -173,25 +134,25 @@ export class BlockHeader { } return new BlockHeader( - toBuffer(parentHash), - toBuffer(uncleHash), - new Address(toBuffer(coinbase)), - toBuffer(stateRoot), - toBuffer(transactionsTrie), - toBuffer(receiptTrie), - toBuffer(logsBloom), - bufferToBigInt(difficulty), - bufferToBigInt(number), - bufferToBigInt(gasLimit), - bufferToBigInt(gasUsed), - bufferToBigInt(timestamp), - toBuffer(extraData), - toBuffer(mixHash), - toBuffer(nonce), - opts, - baseFeePerGas !== undefined && baseFeePerGas !== null - ? bufferToBigInt(baseFeePerGas) - : undefined + { + parentHash, + uncleHash, + coinbase, + stateRoot, + transactionsTrie, + receiptTrie, + logsBloom, + difficulty, + number, + gasLimit, + gasUsed, + timestamp, + extraData, + mixHash, + nonce, + baseFeePerGas, + }, + opts ) } @@ -210,25 +171,7 @@ export class BlockHeader { * varying data types. For a default empty header, use {@link BlockHeader.fromHeaderData}. * */ - constructor( - parentHash: Buffer, - uncleHash: Buffer, - coinbase: Address, - stateRoot: Buffer, - transactionsTrie: Buffer, - receiptTrie: Buffer, - logsBloom: Buffer, - difficulty: bigint, - number: bigint, - gasLimit: bigint, - gasUsed: bigint, - timestamp: bigint, - extraData: Buffer, - mixHash: Buffer, - nonce: Buffer, - options: BlockOptions = {}, - baseFeePerGas?: bigint - ) { + constructor(headerData: HeaderData, options: BlockOptions = {}) { if (options.common) { this._common = options.common.copy() } else { @@ -246,6 +189,46 @@ export class BlockHeader { ) } + const defaults = { + parentHash: zeros(32), + uncleHash: KECCAK256_RLP_ARRAY, + coinbase: Address.zero(), + stateRoot: zeros(32), + transactionsTrie: KECCAK256_RLP, + receiptTrie: KECCAK256_RLP, + logsBloom: zeros(256), + difficulty: BigInt(0), + number: BigInt(0), + gasLimit: DEFAULT_GAS_LIMIT, + gasUsed: BigInt(0), + timestamp: BigInt(0), + extraData: Buffer.from([]), + mixHash: zeros(32), + nonce: zeros(8), + baseFeePerGas: undefined, + } + + const parentHash = toType(headerData.parentHash, TypeOutput.Buffer) ?? defaults.parentHash + const uncleHash = toType(headerData.uncleHash, TypeOutput.Buffer) ?? defaults.uncleHash + const coinbase = headerData.coinbase + ? new Address(toType(headerData.coinbase, TypeOutput.Buffer)) + : defaults.coinbase + let stateRoot = toType(headerData.stateRoot, TypeOutput.Buffer) ?? defaults.stateRoot + const transactionsTrie = + toType(headerData.transactionsTrie, TypeOutput.Buffer) ?? defaults.transactionsTrie + const receiptTrie = toType(headerData.receiptTrie, TypeOutput.Buffer) ?? defaults.receiptTrie + const logsBloom = toType(headerData.logsBloom, TypeOutput.Buffer) ?? defaults.logsBloom + let difficulty = toType(headerData.difficulty, TypeOutput.BigInt) ?? defaults.difficulty + let number = toType(headerData.number, TypeOutput.BigInt) ?? defaults.number + let gasLimit = toType(headerData.gasLimit, TypeOutput.BigInt) ?? defaults.gasLimit + const gasUsed = toType(headerData.gasUsed, TypeOutput.BigInt) ?? defaults.gasUsed + let timestamp = toType(headerData.timestamp, TypeOutput.BigInt) ?? defaults.timestamp + let extraData = toType(headerData.extraData, TypeOutput.Buffer) ?? defaults.extraData + const mixHash = toType(headerData.mixHash, TypeOutput.Buffer) ?? defaults.mixHash + let nonce = toType(headerData.nonce, TypeOutput.Buffer) ?? defaults.nonce + let baseFeePerGas = + toType(headerData.baseFeePerGas, TypeOutput.BigInt) ?? defaults.baseFeePerGas + const hardforkByBlockNumber = options.hardforkByBlockNumber ?? false if (hardforkByBlockNumber || options.hardforkByTD !== undefined) { this._common.setHardforkByBlockNumber(number, options.hardforkByTD) From 21a42bf944615b9386fbe842ec858e0151aa0ec8 Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Wed, 23 Mar 2022 13:14:55 -0400 Subject: [PATCH 19/44] util: remove object.ts (#1809) Co-authored-by: ScottyPoi --- packages/util/src/index.ts | 7 +- packages/util/src/object.ts | 114 ------------------------ packages/util/src/types.ts | 8 -- packages/util/test/object.spec.ts | 140 ------------------------------ 4 files changed, 1 insertion(+), 268 deletions(-) delete mode 100644 packages/util/src/object.ts delete mode 100644 packages/util/test/object.spec.ts diff --git a/packages/util/src/index.ts b/packages/util/src/index.ts index 365db716c1f..41ed8537480 100644 --- a/packages/util/src/index.ts +++ b/packages/util/src/index.ts @@ -29,12 +29,7 @@ export * from './signature' export * from './bytes' /** - * Function for definining properties on an object - */ -export * from './object' - -/** - * External exports (rlp) + * External exports (BN, rlp) */ export * from './externals' diff --git a/packages/util/src/object.ts b/packages/util/src/object.ts deleted file mode 100644 index aa6949309e5..00000000000 --- a/packages/util/src/object.ts +++ /dev/null @@ -1,114 +0,0 @@ -import { stripHexPrefix } from './internal' -import { rlp } from './externals' -import { toBuffer, baToJSON, unpadBuffer } from './bytes' - -/** - * Defines properties on a `Object`. It make the assumption that underlying data is binary. - * @param self the `Object` to define properties on - * @param fields an array fields to define. Fields can contain: - * * `name` - the name of the properties - * * `length` - the number of bytes the field can have - * * `allowLess` - if the field can be less than the length - * * `allowEmpty` - * @param data data to be validated against the definitions - * @deprecated - */ -export const defineProperties = function (self: any, fields: any, data?: any) { - self.raw = [] - self._fields = [] - - // attach the `toJSON` - self.toJSON = function (label: boolean = false) { - if (label) { - type Dict = { [key: string]: string } - const obj: Dict = {} - self._fields.forEach((field: string) => { - obj[field] = `0x${self[field].toString('hex')}` - }) - return obj - } - return baToJSON(self.raw) - } - - self.serialize = function serialize() { - return rlp.encode(self.raw) - } - - fields.forEach((field: any, i: number) => { - self._fields.push(field.name) - function getter() { - return self.raw[i] - } - function setter(v: any) { - v = toBuffer(v) - - if (v.toString('hex') === '00' && !field.allowZero) { - v = Buffer.allocUnsafe(0) - } - - if (field.allowLess && field.length) { - v = unpadBuffer(v) - if (field.length < v.length) { - throw new Error(`The field ${field.name} must not have more ${field.length} bytes`) - } - } else if (!(field.allowZero && v.length === 0) && field.length) { - if (field.length !== v.length) { - throw new Error(`The field ${field.name} must have byte length of ${field.length}`) - } - } - - self.raw[i] = v - } - - Object.defineProperty(self, field.name, { - enumerable: true, - configurable: true, - get: getter, - set: setter, - }) - - if (field.default) { - self[field.name] = field.default - } - - // attach alias - if (field.alias) { - Object.defineProperty(self, field.alias, { - enumerable: false, - configurable: true, - set: setter, - get: getter, - }) - } - }) - - // if the constuctor is passed data - if (data) { - if (typeof data === 'string') { - data = Buffer.from(stripHexPrefix(data), 'hex') - } - - if (Buffer.isBuffer(data)) { - data = rlp.decode(data) - } - - if (Array.isArray(data)) { - if (data.length > self._fields.length) { - throw new Error('wrong number of fields in data') - } - - // make sure all the items are buffers - data.forEach((d, i) => { - self[self._fields[i]] = toBuffer(d) - }) - } else if (typeof data === 'object') { - const keys = Object.keys(data) - fields.forEach((field: any) => { - if (keys.indexOf(field.name) !== -1) self[field.name] = data[field.name] - if (keys.indexOf(field.alias) !== -1) self[field.alias] = data[field.alias] - }) - } else { - throw new Error('invalid data') - } - } -} diff --git a/packages/util/src/types.ts b/packages/util/src/types.ts index 9f5bb893fc3..1e54cf60e38 100644 --- a/packages/util/src/types.ts +++ b/packages/util/src/types.ts @@ -64,14 +64,6 @@ export function bigIntToUnpaddedBuffer(value: bigint): Buffer { return unpadBuffer(bigIntToBuffer(value)) } -/** - * Deprecated alias for {@link bigIntToUnpaddedBuffer} - * @deprecated - */ -export function bigIntToRlp(value: bigint): Buffer { - return bigIntToUnpaddedBuffer(value) -} - /** * Type output options */ diff --git a/packages/util/test/object.spec.ts b/packages/util/test/object.spec.ts deleted file mode 100644 index 73651545ceb..00000000000 --- a/packages/util/test/object.spec.ts +++ /dev/null @@ -1,140 +0,0 @@ -import tape from 'tape' -import { zeros, defineProperties } from '../src' - -tape('define', function (t) { - const fields = [ - { - name: 'aword', - alias: 'blah', - word: true, - default: Buffer.allocUnsafe(0), - }, - { - name: 'empty', - allowZero: true, - length: 20, - default: Buffer.allocUnsafe(0), - }, - { - name: 'cannotBeZero', - allowZero: false, - default: Buffer.from([0]), - }, - { - name: 'value', - default: Buffer.allocUnsafe(0), - }, - { - name: 'r', - length: 32, - allowLess: true, - default: zeros(32), - }, - ] - - t.test('should trim zeros', function (st) { - const someOb: any = {} - defineProperties(someOb, fields) - // Define Properties - someOb.r = '0x00004' - st.equal(someOb.r.toString('hex'), '04') - - someOb.r = Buffer.from([0, 0, 0, 0, 4]) - st.equal(someOb.r.toString('hex'), '04') - st.end() - }) - - t.test("shouldn't allow wrong size for exact size requirements", function (st) { - const someOb = {} - defineProperties(someOb, fields) - - st.throws(function () { - const tmp = [ - { - name: 'mustBeExactSize', - allowZero: false, - length: 20, - default: Buffer.from([1, 2, 3, 4]), - }, - ] - defineProperties(someOb, tmp) - }) - st.end() - }) - - t.test('it should accept rlp encoded intial data', function (st) { - const someOb: any = {} - const data = { - aword: '0x01', - cannotBeZero: '0x02', - value: '0x03', - r: '0x04', - } - - const expected = { - aword: '0x01', - empty: '0x', - cannotBeZero: '0x02', - value: '0x03', - r: '0x04', - } - - const expectedArray = ['0x01', '0x', '0x02', '0x03', '0x04'] - - defineProperties(someOb, fields, data) - st.deepEqual(someOb.toJSON(true), expected, 'should produce the correctly labeled object') - - const someOb2: any = {} - const rlpEncoded = someOb.serialize().toString('hex') - defineProperties(someOb2, fields, rlpEncoded) - st.equal( - someOb2.serialize().toString('hex'), - rlpEncoded, - 'the constuctor should accept rlp encoded buffers' - ) - - const someOb3 = {} - defineProperties(someOb3, fields, expectedArray) - st.deepEqual(someOb.toJSON(), expectedArray, 'should produce the correctly object') - st.end() - }) - - t.test('it should not accept invalid values in the constuctor', function (st) { - const someOb = {} - st.throws(function () { - defineProperties(someOb, fields, 5) - }, 'should throw on nonsensical data') - - st.throws(function () { - defineProperties(someOb, fields, Array(6)) - }, 'should throw on invalid arrays') - st.end() - }) - - t.test('alias should work ', function (st) { - const someOb: any = {} - const data = { - aword: '0x01', - cannotBeZero: '0x02', - value: '0x03', - r: '0x04', - } - - defineProperties(someOb, fields, data) - st.equal(someOb.blah.toString('hex'), '01') - someOb.blah = '0x09' - st.equal(someOb.blah.toString('hex'), '09') - st.equal(someOb.aword.toString('hex'), '09') - st.end() - }) - - t.test('alias should work #2', function (st) { - const someOb: any = {} - const data = { blah: '0x1' } - - defineProperties(someOb, fields, data) - st.equal(someOb.blah.toString('hex'), '01') - st.equal(someOb.aword.toString('hex'), '01') - st.end() - }) -}) From 8118ffaa9f2b75978f7ef6ab16c527f9904a9f4a Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Thu, 24 Mar 2022 14:22:31 +0100 Subject: [PATCH 20/44] VM: rebase fixes --- package-lock.json | 106 +-- package.json | 3 + packages/vm/src/evm/eei.ts | 2 +- packages/vm/src/evm/opcodes/gas.ts | 857 +++++++++--------- packages/vm/src/index.ts | 19 +- packages/vm/src/runBlock.ts | 4 +- .../EIPs/eip-3540-evm-object-format.spec.ts | 20 +- .../EIPs/eip-3670-eof-code-validation.spec.ts | 8 +- packages/vm/tests/api/EIPs/eip-3860.spec.ts | 6 +- packages/vm/tests/api/customChain.spec.ts | 2 +- .../vm/tests/api/evm/customOpcodes.spec.ts | 39 +- packages/vm/tests/api/index.spec.ts | 1 + 12 files changed, 527 insertions(+), 540 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7f4778f73a2..fdcc874a9bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,9 @@ "workspaces": [ "packages/*" ], + "dependencies": { + "bigint-crypto-utils": "^3.0.23" + }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^4.27.0", "@typescript-eslint/parser": "^4.27.0", @@ -19001,13 +19004,13 @@ }, "packages/block": { "name": "@ethereumjs/block", - "version": "3.6.1", + "version": "3.6.2", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^2.6.2", - "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/common": "^2.6.3", + "@ethereumjs/tx": "^3.5.1", "ethereumjs-util": "^7.1.4", - "merkle-patricia-tree": "^4.2.3" + "merkle-patricia-tree": "^4.2.4" }, "devDependencies": { "@types/lru-cache": "^5.1.0", @@ -19100,11 +19103,11 @@ }, "packages/blockchain": { "name": "@ethereumjs/blockchain", - "version": "5.5.1", + "version": "5.5.2", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/common": "^2.6.2", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/common": "^2.6.3", "@ethereumjs/ethash": "^1.1.0", "debug": "^4.3.3", "ethereumjs-util": "^7.1.4", @@ -19204,18 +19207,18 @@ }, "packages/client": { "name": "@ethereumjs/client", - "version": "0.3.0", + "version": "0.4.0", "hasInstallScript": true, "license": "MPL-2.0", "dependencies": { "@chainsafe/libp2p-noise": "^4.1.1", - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/blockchain": "^5.5.1", - "@ethereumjs/common": "^2.6.2", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.3", "@ethereumjs/devp2p": "^4.2.1", "@ethereumjs/ethash": "^1.1.0", - "@ethereumjs/tx": "^3.5.0", - "@ethereumjs/vm": "^5.7.1", + "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/vm": "^5.8.0", "body-parser": "^1.19.2", "chalk": "^4.1.2", "connect": "^3.7.0", @@ -19236,7 +19239,7 @@ "libp2p-mplex": "^0.10.2", "libp2p-tcp": "^0.15.3", "libp2p-websockets": "^0.15.1", - "merkle-patricia-tree": "^4.2.3", + "merkle-patricia-tree": "^4.2.4", "multiaddr": "^10.0.1", "peer-id": "^0.14.3", "qheap": "^1.4.0", @@ -19362,7 +19365,7 @@ }, "packages/common": { "name": "@ethereumjs/common", - "version": "2.6.2", + "version": "2.6.3", "license": "MIT", "dependencies": { "crc-32": "^1.2.0", @@ -19461,7 +19464,7 @@ "version": "4.2.1", "license": "MIT", "dependencies": { - "@ethereumjs/common": "^2.6.2", + "@ethereumjs/common": "^2.6.3", "@types/bl": "^2.1.0", "@types/k-bucket": "^5.0.0", "@types/lru-cache": "^5.1.0", @@ -19482,8 +19485,8 @@ "snappyjs": "^0.6.1" }, "devDependencies": { - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/tx": "^3.5.1", "@types/async": "^2.4.1", "@types/chalk": "^2.2.0", "@types/debug": "^4.1.4", @@ -19644,16 +19647,17 @@ "packages/ethash": { "name": "@ethereumjs/ethash", "version": "1.1.0", + "hasInstallScript": true, "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^3.6.1", + "@ethereumjs/block": "^3.6.2", "@types/levelup": "^4.3.0", "bigint-crypto-utils": "^3.0.23", "buffer-xor": "^2.0.1", "ethereumjs-util": "^7.1.4" }, "devDependencies": { - "@ethereumjs/common": "^2.6.2", + "@ethereumjs/common": "^2.6.3", "@types/tape": "^4.13.2", "eslint": "^6.8.0", "level-mem": "^5.0.1", @@ -19830,7 +19834,7 @@ }, "packages/trie": { "name": "merkle-patricia-tree", - "version": "4.2.3", + "version": "4.2.4", "license": "MPL-2.0", "dependencies": { "@types/levelup": "^4.3.0", @@ -19933,10 +19937,10 @@ }, "packages/tx": { "name": "@ethereumjs/tx", - "version": "3.5.0", + "version": "3.5.1", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^2.6.2", + "@ethereumjs/common": "^2.6.3", "ethereumjs-util": "^7.1.4" }, "devDependencies": { @@ -20072,20 +20076,20 @@ }, "packages/vm": { "name": "@ethereumjs/vm", - "version": "5.7.1", + "version": "5.8.0", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/blockchain": "^5.5.1", - "@ethereumjs/common": "^2.6.2", - "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.3", + "@ethereumjs/tx": "^3.5.1", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", "debug": "^4.3.3", "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", - "merkle-patricia-tree": "^4.2.3", + "merkle-patricia-tree": "^4.2.4", "rustbn.js": "~0.2.0" }, "devDependencies": { @@ -20598,8 +20602,8 @@ "@ethereumjs/block": { "version": "file:packages/block", "requires": { - "@ethereumjs/common": "^2.6.2", - "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/common": "^2.6.3", + "@ethereumjs/tx": "^3.5.1", "@types/lru-cache": "^5.1.0", "@types/node": "^16.11.7", "@types/tape": "^4.13.2", @@ -20610,7 +20614,7 @@ "karma-firefox-launcher": "^2.1.0", "karma-tap": "^4.2.0", "karma-typescript": "^5.5.3", - "merkle-patricia-tree": "^4.2.3", + "merkle-patricia-tree": "^4.2.4", "nyc": "^15.1.0", "prettier": "^2.0.5", "tape": "^5.3.1", @@ -20686,8 +20690,8 @@ "@ethereumjs/blockchain": { "version": "file:packages/blockchain", "requires": { - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/common": "^2.6.2", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/common": "^2.6.3", "@ethereumjs/ethash": "^1.1.0", "@types/async": "^2.4.1", "@types/lru-cache": "^5.1.0", @@ -20781,13 +20785,13 @@ "requires": { "@babel/plugin-transform-spread": "^7.10.1", "@chainsafe/libp2p-noise": "^4.1.1", - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/blockchain": "^5.5.1", - "@ethereumjs/common": "^2.6.2", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.3", "@ethereumjs/devp2p": "^4.2.1", "@ethereumjs/ethash": "^1.1.0", - "@ethereumjs/tx": "^3.5.0", - "@ethereumjs/vm": "^5.7.1", + "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/vm": "^5.8.0", "@types/body-parser": "^1.19.2", "@types/connect": "^3.4.35", "@types/fs-extra": "^8.1.0", @@ -20825,7 +20829,7 @@ "libp2p-mplex": "^0.10.2", "libp2p-tcp": "^0.15.3", "libp2p-websockets": "^0.15.1", - "merkle-patricia-tree": "^4.2.3", + "merkle-patricia-tree": "^4.2.4", "multiaddr": "^10.0.1", "node-fetch": "^2.6.1", "nyc": "^15.1.0", @@ -21004,9 +21008,9 @@ "@ethereumjs/devp2p": { "version": "file:packages/devp2p", "requires": { - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/common": "^2.6.2", - "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/common": "^2.6.3", + "@ethereumjs/tx": "^3.5.1", "@types/async": "^2.4.1", "@types/bl": "^2.1.0", "@types/chalk": "^2.2.0", @@ -21163,8 +21167,8 @@ "@ethereumjs/ethash": { "version": "file:packages/ethash", "requires": { - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/common": "^2.6.2", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/common": "^2.6.3", "@types/levelup": "^4.3.0", "@types/tape": "^4.13.2", "bigint-crypto-utils": "^3.0.23", @@ -21247,7 +21251,7 @@ "@ethereumjs/tx": { "version": "file:packages/tx", "requires": { - "@ethereumjs/common": "^2.6.2", + "@ethereumjs/common": "^2.6.3", "@types/minimist": "^1.2.0", "@types/node": "^16.11.7", "@types/tape": "^4.13.2", @@ -21335,10 +21339,10 @@ "@ethereumjs/vm": { "version": "file:packages/vm", "requires": { - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/blockchain": "^5.5.1", - "@ethereumjs/common": "^2.6.2", - "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.3", + "@ethereumjs/tx": "^3.5.1", "@ethersproject/abi": "^5.0.12", "@types/benchmark": "^1.0.33", "@types/core-js": "^2.5.0", @@ -21362,7 +21366,7 @@ "level": "^6.0.0", "level-mem": "^5.0.1", "mcl-wasm": "^0.7.1", - "merkle-patricia-tree": "^4.2.3", + "merkle-patricia-tree": "^4.2.4", "minimist": "^1.2.5", "node-dir": "^0.1.17", "nyc": "^15.1.0", diff --git a/package.json b/package.json index 8fd547e7f4b..1facaa84ece 100644 --- a/package.json +++ b/package.json @@ -34,5 +34,8 @@ "e2e:publish": "./scripts/e2e-publish.sh", "e2e:resolutions": "node ./scripts/e2e-resolutions.js", "e2e:inject": "node ./scripts/e2e-inject-resolutions.js" + }, + "dependencies": { + "bigint-crypto-utils": "^3.0.23" } } diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index 04ba789c448..9598dd03939 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -643,7 +643,7 @@ export default class EEI { if (this._common.isActivatedEIP(3860)) { if (msg.data.length > this._common.param('vm', 'maxInitCodeSize')) { - return new BN(0) + return BigInt(0) } } diff --git a/packages/vm/src/evm/opcodes/gas.ts b/packages/vm/src/evm/opcodes/gas.ts index a18f9e3bfc5..e186281c8e2 100644 --- a/packages/vm/src/evm/opcodes/gas.ts +++ b/packages/vm/src/evm/opcodes/gas.ts @@ -34,178 +34,287 @@ export interface SyncDynamicGasHandler { export const dynamicGasHandlers: Map = new Map([ - [ - /* SHA3 */ - 0x20, - async function (runState, gas, common): Promise { - const [offset, length] = runState.stack.peek(2) - gas += subMemUsage(runState, offset, length, common) - gas += BigInt(common.param('gasPrices', 'sha3Word')) * divCeil(length, BigInt(32)) - return gas - }, - ], - [ - /* BALANCE */ - 0x31, - async function (runState, gas, common): Promise { - if (common.isActivatedEIP(2929)) { - const addressBigInt = runState.stack.peek()[0] - const address = new Address(addressToBuffer(addressBigInt)) - gas += accessAddressEIP2929(runState, address, common) - } - return gas - }, - ], - [ - /* CALLDATACOPY */ - 0x37, - async function (runState, gas, common): Promise { - const [memOffset, _dataOffset, dataLength] = runState.stack.peek(3) - - gas += subMemUsage(runState, memOffset, dataLength, common) - if (dataLength !== BigInt(0)) { - gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) - } - return gas - }, - ], - [ - /* CODECOPY */ - 0x39, - async function (runState, gas, common): Promise { - const [memOffset, _codeOffset, dataLength] = runState.stack.peek(3) - - gas += subMemUsage(runState, memOffset, dataLength, common) - if (dataLength !== BigInt(0)) { - gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) - } - return gas - }, - ], - [ - /* EXTCODESIZE */ - 0x3b, - async function (runState, gas, common): Promise { - if (common.isActivatedEIP(2929)) { - const addressBigInt = runState.stack.peek()[0] - const address = new Address(addressToBuffer(addressBigInt)) - gas += accessAddressEIP2929(runState, address, common) - } - return gas - }, - ], - [ - /* EXTCODECOPY */ - 0x3c, - async function (runState, gas, common): Promise { - const [addressBigInt, memOffset, _codeOffset, dataLength] = runState.stack.peek(4) - - gas += subMemUsage(runState, memOffset, dataLength, common) - - if (common.isActivatedEIP(2929)) { - const address = new Address(addressToBuffer(addressBigInt)) - gas += accessAddressEIP2929(runState, address, common) - } - - if (dataLength !== BigInt(0)) { - gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) - } - return gas - }, - ], - [ - /* RETURNDATACOPY */ - 0x3e, - async function (runState, gas, common): Promise { - const [memOffset, returnDataOffset, dataLength] = runState.stack.peek(3) - - if (returnDataOffset + dataLength > runState.eei.getReturnDataSize()) { - trap(ERROR.OUT_OF_GAS) - } - - gas += subMemUsage(runState, memOffset, dataLength, common) - - if (dataLength !== BigInt(0)) { - gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) - } - return gas - }, - ], - [ - /* EXTCODEHASH */ - 0x3f, - async function (runState, gas, common): Promise { - if (common.isActivatedEIP(2929)) { - const addressBigInt = runState.stack.peek()[0] - const address = new Address(addressToBuffer(addressBigInt)) - gas += accessAddressEIP2929(runState, address, common) - } - return gas - }, - ], - [ - /* MLOAD */ - 0x51, - async function (runState, gas, common): Promise { - const pos = runState.stack.peek()[0] - gas += subMemUsage(runState, pos, BigInt(32), common) - return gas - }, - ], - [ - /* MSTORE */ - 0x52, - async function (runState, gas, common): Promise { - const offset = runState.stack.peek()[0] - gas += subMemUsage(runState, offset, BigInt(32), common) - return gas - }, - ], - [ - /* MSTORE8 */ - 0x53, - async function (runState, gas, common): Promise { - const offset = runState.stack.peek()[0] - gas += subMemUsage(runState, offset, BigInt(1), common) - return gas - }, - ], - [ - /* SLOAD */ - 0x54, - async function (runState, gas, common): Promise { - const key = runState.stack.peek()[0] - const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) - - if (common.isActivatedEIP(2929)) { - gas += accessStorageEIP2929(runState, keyBuf, false, common) - } - return gas - }, - ], - [ - /* SSTORE */ - 0x55, - async function (runState, gas, common): Promise { - if (runState.eei.isStatic()) { - trap(ERROR.STATIC_STATE_CHANGE) - } - const [key, val] = runState.stack.peek(2) - - const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) - // NOTE: this should be the shortest representation - let value - if (val === BigInt(0)) { - value = Buffer.from([]) - } else { - value = bigIntToBuffer(val) - } - - // TODO: Replace getContractStorage with EEI method - const currentStorage = setLengthLeftStorage(await runState.eei.storageLoad(keyBuf)) - const originalStorage = setLengthLeftStorage(await runState.eei.storageLoad(keyBuf, true)) - if (common.hardfork() === 'constantinople') { - gas += updateSstoreGasEIP1283( + [ + /* SHA3 */ + 0x20, + async function (runState, gas, common): Promise { + const [offset, length] = runState.stack.peek(2) + gas += subMemUsage(runState, offset, length, common) + gas += BigInt(common.param('gasPrices', 'sha3Word')) * divCeil(length, BigInt(32)) + return gas + }, + ], + [ + /* BALANCE */ + 0x31, + async function (runState, gas, common): Promise { + if (common.isActivatedEIP(2929)) { + const addressBigInt = runState.stack.peek()[0] + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) + } + return gas + }, + ], + [ + /* CALLDATACOPY */ + 0x37, + async function (runState, gas, common): Promise { + const [memOffset, _dataOffset, dataLength] = runState.stack.peek(3) + + gas += subMemUsage(runState, memOffset, dataLength, common) + if (dataLength !== BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) + } + return gas + }, + ], + [ + /* CODECOPY */ + 0x39, + async function (runState, gas, common): Promise { + const [memOffset, _codeOffset, dataLength] = runState.stack.peek(3) + + gas += subMemUsage(runState, memOffset, dataLength, common) + if (dataLength !== BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) + } + return gas + }, + ], + [ + /* EXTCODESIZE */ + 0x3b, + async function (runState, gas, common): Promise { + if (common.isActivatedEIP(2929)) { + const addressBigInt = runState.stack.peek()[0] + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) + } + return gas + }, + ], + [ + /* EXTCODECOPY */ + 0x3c, + async function (runState, gas, common): Promise { + const [addressBigInt, memOffset, _codeOffset, dataLength] = runState.stack.peek(4) + + gas += subMemUsage(runState, memOffset, dataLength, common) + + if (common.isActivatedEIP(2929)) { + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) + } + + if (dataLength !== BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) + } + return gas + }, + ], + [ + /* RETURNDATACOPY */ + 0x3e, + async function (runState, gas, common): Promise { + const [memOffset, returnDataOffset, dataLength] = runState.stack.peek(3) + + if (returnDataOffset + dataLength > runState.eei.getReturnDataSize()) { + trap(ERROR.OUT_OF_GAS) + } + + gas += subMemUsage(runState, memOffset, dataLength, common) + + if (dataLength !== BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'copy')) * divCeil(dataLength, BigInt(32)) + } + return gas + }, + ], + [ + /* EXTCODEHASH */ + 0x3f, + async function (runState, gas, common): Promise { + if (common.isActivatedEIP(2929)) { + const addressBigInt = runState.stack.peek()[0] + const address = new Address(addressToBuffer(addressBigInt)) + gas += accessAddressEIP2929(runState, address, common) + } + return gas + }, + ], + [ + /* MLOAD */ + 0x51, + async function (runState, gas, common): Promise { + const pos = runState.stack.peek()[0] + gas += subMemUsage(runState, pos, BigInt(32), common) + return gas + }, + ], + [ + /* MSTORE */ + 0x52, + async function (runState, gas, common): Promise { + const offset = runState.stack.peek()[0] + gas += subMemUsage(runState, offset, BigInt(32), common) + return gas + }, + ], + [ + /* MSTORE8 */ + 0x53, + async function (runState, gas, common): Promise { + const offset = runState.stack.peek()[0] + gas += subMemUsage(runState, offset, BigInt(1), common) + return gas + }, + ], + [ + /* SLOAD */ + 0x54, + async function (runState, gas, common): Promise { + const key = runState.stack.peek()[0] + const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) + + if (common.isActivatedEIP(2929)) { + gas += accessStorageEIP2929(runState, keyBuf, false, common) + } + return gas + }, + ], + [ + /* SSTORE */ + 0x55, + async function (runState, gas, common): Promise { + if (runState.eei.isStatic()) { + trap(ERROR.STATIC_STATE_CHANGE) + } + const [key, val] = runState.stack.peek(2) + + const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) + // NOTE: this should be the shortest representation + let value + if (val === BigInt(0)) { + value = Buffer.from([]) + } else { + value = bigIntToBuffer(val) + } + + // TODO: Replace getContractStorage with EEI method + const currentStorage = setLengthLeftStorage(await runState.eei.storageLoad(keyBuf)) + const originalStorage = setLengthLeftStorage(await runState.eei.storageLoad(keyBuf, true)) + if (common.hardfork() === 'constantinople') { + gas += updateSstoreGasEIP1283( + runState, + currentStorage, + originalStorage, + setLengthLeftStorage(value), + common + ) + } else if (common.gteHardfork('istanbul')) { + gas += updateSstoreGasEIP2200( + runState, + currentStorage, + originalStorage, + setLengthLeftStorage(value), + keyBuf, + common + ) + } else { + gas += updateSstoreGas(runState, currentStorage, setLengthLeftStorage(value), common) + } + + if (common.isActivatedEIP(2929)) { + // We have to do this after the Istanbul (EIP2200) checks. + // Otherwise, we might run out of gas, due to "sentry check" of 2300 gas, + // if we deduct extra gas first. + gas += accessStorageEIP2929(runState, keyBuf, true, common) + } + return gas + }, + ], + [ + /* LOG */ + 0xa0, + async function (runState, gas, common): Promise { + if (runState.eei.isStatic()) { + trap(ERROR.STATIC_STATE_CHANGE) + } + + const [memOffset, memLength] = runState.stack.peek(2) + + const topicsCount = runState.opCode - 0xa0 + + if (topicsCount < 0 || topicsCount > 4) { + trap(ERROR.OUT_OF_RANGE) + } + + gas += subMemUsage(runState, memOffset, memLength, common) + gas += + BigInt(common.param('gasPrices', 'logTopic')) * BigInt(topicsCount) + + memLength * BigInt(common.param('gasPrices', 'logData')) + return gas + }, + ], + [ + /* CREATE */ + 0xf0, + async function (runState, gas, common): Promise { + if (runState.eei.isStatic()) { + trap(ERROR.STATIC_STATE_CHANGE) + } + const [_value, offset, length] = runState.stack.peek(3) + + if (common.isActivatedEIP(2929)) { + gas += accessAddressEIP2929(runState, runState.eei.getAddress(), common, false) + } + + gas += subMemUsage(runState, offset, length, common) + + let gasLimit = BigInt(runState.eei.getGasLeft()) - gas + gasLimit = maxCallGas(gasLimit, gasLimit, runState, common) + + runState.messageGasLimit = gasLimit + return gas + }, + ], + [ + /* CALL */ + 0xf1, + async function (runState, gas, common): Promise { + const [currentGasLimit, toAddr, value, inOffset, inLength, outOffset, outLength] = + runState.stack.peek(7) + const toAddress = new Address(addressToBuffer(toAddr)) + + if (runState.eei.isStatic() && value !== BigInt(0)) { + trap(ERROR.STATIC_STATE_CHANGE) + } + gas += subMemUsage(runState, inOffset, inLength, common) + gas += subMemUsage(runState, outOffset, outLength, common) + if (common.isActivatedEIP(2929)) { + gas += accessAddressEIP2929(runState, toAddress, common) + } + + if (value !== BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'callValueTransfer')) + } + + if (common.gteHardfork('spuriousDragon')) { + // We are at or after Spurious Dragon + // Call new account gas: account is DEAD and we transfer nonzero value + if ((await runState.eei.isAccountEmpty(toAddress)) && !(value === BigInt(0))) { + gas += BigInt(common.param('gasPrices', 'callNewAccount')) + } + } else if (!(await runState.eei.accountExists(toAddress))) { + // We are before Spurious Dragon and the account does not exist. + // Call new account gas: account does not exist (it is not in the state trie, not even as an "empty" account) + gas += BigInt(common.param('gasPrices', 'callNewAccount')) + } + + let gasLimit = maxCallGas( + currentGasLimit, + runState.eei.getGasLeft() - gas, runState, common ) @@ -219,7 +328,7 @@ export const dynamicGasHandlers: Map { - if (runState.eei.isStatic()) { - trap(ERROR.STATIC_STATE_CHANGE) - } - - const [memOffset, memLength] = runState.stack.peek(2) - - const topicsCount = runState.opCode - 0xa0 - - if (topicsCount < 0 || topicsCount > 4) { - trap(ERROR.OUT_OF_RANGE) - } - - gas += subMemUsage(runState, memOffset, memLength, common) - gas += - BigInt(common.param('gasPrices', 'logTopic')) * BigInt(topicsCount) + - memLength * BigInt(common.param('gasPrices', 'logData')) - return gas - }, - ], - [ - /* CREATE */ - 0xf0, - async function (runState, gas, common): Promise { - if (runState.eei.isStatic()) { - trap(ERROR.STATIC_STATE_CHANGE) - } - const [_value, offset, length] = runState.stack.peek(3) - - if (common.isActivatedEIP(2929)) { - gas += accessAddressEIP2929(runState, runState.eei.getAddress(), common, false) - } - - gas += subMemUsage(runState, offset, length, common) - - let gasLimit = BigInt(runState.eei.getGasLeft()) - gas - gasLimit = maxCallGas(gasLimit, gasLimit, runState, common) - - runState.messageGasLimit = gasLimit - return gas - }, - ], - [ - /* CALL */ - 0xf1, - async function (runState, gas, common): Promise { - const [currentGasLimit, toAddr, value, inOffset, inLength, outOffset, outLength] = - runState.stack.peek(7) - const toAddress = new Address(addressToBuffer(toAddr)) - - if (runState.eei.isStatic() && value !== BigInt(0)) { - trap(ERROR.STATIC_STATE_CHANGE) - } - gas += subMemUsage(runState, inOffset, inLength, common) - gas += subMemUsage(runState, outOffset, outLength, common) - if (common.isActivatedEIP(2929)) { - gas += accessAddressEIP2929(runState, toAddress, common) - } - - if (value !== BigInt(0)) { - gas += BigInt(common.param('gasPrices', 'callValueTransfer')) - } - - if (common.gteHardfork('spuriousDragon')) { - // We are at or after Spurious Dragon - // Call new account gas: account is DEAD and we transfer nonzero value - if ((await runState.eei.isAccountEmpty(toAddress)) && !(value === BigInt(0))) { - gas += BigInt(common.param('gasPrices', 'callNewAccount')) + // note that TangerineWhistle or later this cannot happen + // (it could have ran out of gas prior to getting here though) + if (gasLimit > runState.eei.getGasLeft() - gas) { + trap(ERROR.OUT_OF_GAS) } - } else if (!(await runState.eei.accountExists(toAddress))) { - // We are before Spurious Dragon and the account does not exist. - // Call new account gas: account does not exist (it is not in the state trie, not even as an "empty" account) - gas += BigInt(common.param('gasPrices', 'callNewAccount')) - } - - let gasLimit = maxCallGas(currentGasLimit, runState.eei.getGasLeft() - gas, runState, common) - // note that TangerineWhistle or later this cannot happen - // (it could have ran out of gas prior to getting here though) - if (gasLimit > runState.eei.getGasLeft() - gas) { - trap(ERROR.OUT_OF_GAS) - } - - if (gas > runState.eei.getGasLeft()) { - trap(ERROR.OUT_OF_GAS) - } - - if (value !== BigInt(0)) { - // TODO: Don't use private attr directly - runState.eei._gasLeft += BigInt(common.param('gasPrices', 'callStipend')) - gasLimit += BigInt(common.param('gasPrices', 'callStipend')) - } - - runState.messageGasLimit = gasLimit - return gas - }, - ], - [ - /* CALLCODE */ - 0xf2, - async function (runState, gas, common): Promise { - const [currentGasLimit, toAddr, value, inOffset, inLength, outOffset, outLength] = - runState.stack.peek(7) - - gas += subMemUsage(runState, inOffset, inLength, common) - gas += subMemUsage(runState, outOffset, outLength, common) - - if (common.isActivatedEIP(2929)) { - const toAddress = new Address(addressToBuffer(toAddr)) - gas += accessAddressEIP2929(runState, toAddress, common) - } - - if (value !== BigInt(0)) { - gas += BigInt(common.param('gasPrices', 'callValueTransfer')) - } - let gasLimit = maxCallGas(currentGasLimit, runState.eei.getGasLeft() - gas, runState, common) - // note that TangerineWhistle or later this cannot happen - // (it could have ran out of gas prior to getting here though) - if (gasLimit > runState.eei.getGasLeft() - gas) { - trap(ERROR.OUT_OF_GAS) - } - if (value !== BigInt(0)) { - // TODO: Don't use private attr directly - runState.eei._gasLeft += BigInt(common.param('gasPrices', 'callStipend')) - gasLimit += BigInt(common.param('gasPrices', 'callStipend')) - } - - runState.messageGasLimit = gasLimit - return gas - }, - ], - [ - /* RETURN */ - 0xf3, - async function (runState, gas, common): Promise { - const [offset, length] = runState.stack.peek(2) - gas += subMemUsage(runState, offset, length, common) - return gas - }, - ], - [ - /* DELEGATECALL */ - 0xf4, - async function (runState, gas, common): Promise { - const [currentGasLimit, toAddr, inOffset, inLength, outOffset, outLength] = - runState.stack.peek(6) - - gas += subMemUsage(runState, inOffset, inLength, common) - gas += subMemUsage(runState, outOffset, outLength, common) - - if (common.isActivatedEIP(2929)) { - const toAddress = new Address(addressToBuffer(toAddr)) - gas += accessAddressEIP2929(runState, toAddress, common) - } - - const gasLimit = maxCallGas( - currentGasLimit, - runState.eei.getGasLeft() - gas, - runState, - common - ) - // note that TangerineWhistle or later this cannot happen - // (it could have ran out of gas prior to getting here though) - if (gasLimit > runState.eei.getGasLeft() - gas) { - trap(ERROR.OUT_OF_GAS) - } - - runState.messageGasLimit = gasLimit - return gas - }, - ], - [ - /* CREATE2 */ - 0xf5, - async function (runState, gas, common): Promise { - if (runState.eei.isStatic()) { - trap(ERROR.STATIC_STATE_CHANGE) - } - - const [_value, offset, length, _salt] = runState.stack.peek(4) - - gas += subMemUsage(runState, offset, length, common) - - if (common.isActivatedEIP(2929)) { - gas += accessAddressEIP2929(runState, runState.eei.getAddress(), common, false) - } - - gas += BigInt(common.param('gasPrices', 'sha3Word')) * divCeil(length, BigInt(32)) - let gasLimit = runState.eei.getGasLeft() - gas - gasLimit = maxCallGas(gasLimit, gasLimit, runState, common) // CREATE2 is only available after TangerineWhistle (Constantinople introduced this opcode) - runState.messageGasLimit = gasLimit - return gas - }, - ], - [ - /* STATICCALL */ - 0xfa, - async function (runState, gas, common): Promise { - const [currentGasLimit, toAddr, inOffset, inLength, outOffset, outLength] = - runState.stack.peek(6) - - gas += subMemUsage(runState, inOffset, inLength, common) - gas += subMemUsage(runState, outOffset, outLength, common) - - if (common.isActivatedEIP(2929)) { - const toAddress = new Address(addressToBuffer(toAddr)) - gas += accessAddressEIP2929(runState, toAddress, common) - } - - const gasLimit = maxCallGas( - currentGasLimit, - runState.eei.getGasLeft() - gas, - runState, - common - ) // we set TangerineWhistle or later to true here, as STATICCALL was available from Byzantium (which is after TangerineWhistle) - - runState.messageGasLimit = gasLimit - return gas - }, - ], - [ - /* REVERT */ - 0xfd, - async function (runState, gas, common): Promise { - const [offset, length] = runState.stack.peek(2) - gas += subMemUsage(runState, offset, length, common) - return gas - }, - ], - [ - /* SELFDESTRUCT */ - 0xff, - async function (runState, gas, common): Promise { - if (runState.eei.isStatic()) { - trap(ERROR.STATIC_STATE_CHANGE) - } - const selfdestructToaddressBigInt = runState.stack.peek()[0] - - const selfdestructToAddress = new Address(addressToBuffer(selfdestructToaddressBigInt)) - let deductGas = false - if (common.gteHardfork('spuriousDragon')) { - // EIP-161: State Trie Clearing - const balance = await runState.eei.getExternalBalance(runState.eei.getAddress()) - if (balance > BigInt(0)) { - // This technically checks if account is empty or non-existent - // TODO: improve on the API here (EEI and StateManager) - const empty = await runState.eei.isAccountEmpty(selfdestructToAddress) - if (empty) { + if (value !== BigInt(0)) { + // TODO: Don't use private attr directly + runState.eei._gasLeft += BigInt(common.param('gasPrices', 'callStipend')) + gasLimit += BigInt(common.param('gasPrices', 'callStipend')) + } + + runState.messageGasLimit = gasLimit + return gas + }, + ], + [ + /* RETURN */ + 0xf3, + async function (runState, gas, common): Promise { + const [offset, length] = runState.stack.peek(2) + gas += subMemUsage(runState, offset, length, common) + return gas + }, + ], + [ + /* DELEGATECALL */ + 0xf4, + async function (runState, gas, common): Promise { + const [currentGasLimit, toAddr, inOffset, inLength, outOffset, outLength] = + runState.stack.peek(6) + + gas += subMemUsage(runState, inOffset, inLength, common) + gas += subMemUsage(runState, outOffset, outLength, common) + + if (common.isActivatedEIP(2929)) { + const toAddress = new Address(addressToBuffer(toAddr)) + gas += accessAddressEIP2929(runState, toAddress, common) + } + + const gasLimit = maxCallGas( + currentGasLimit, + runState.eei.getGasLeft() - gas, + runState, + common + ) + // note that TangerineWhistle or later this cannot happen + // (it could have ran out of gas prior to getting here though) + if (gasLimit > runState.eei.getGasLeft() - gas) { + trap(ERROR.OUT_OF_GAS) + } + + runState.messageGasLimit = gasLimit + return gas + }, + ], + [ + /* CREATE2 */ + 0xf5, + async function (runState, gas, common): Promise { + if (runState.eei.isStatic()) { + trap(ERROR.STATIC_STATE_CHANGE) + } + + const [_value, offset, length, _salt] = runState.stack.peek(4) + + gas += subMemUsage(runState, offset, length, common) + + if (common.isActivatedEIP(2929)) { + gas += accessAddressEIP2929(runState, runState.eei.getAddress(), common, false) + } + + gas += BigInt(common.param('gasPrices', 'sha3Word')) * divCeil(length, BigInt(32)) + let gasLimit = runState.eei.getGasLeft() - gas + gasLimit = maxCallGas(gasLimit, gasLimit, runState, common) // CREATE2 is only available after TangerineWhistle (Constantinople introduced this opcode) + runState.messageGasLimit = gasLimit + return gas + }, + ], + [ + /* STATICCALL */ + 0xfa, + async function (runState, gas, common): Promise { + const [currentGasLimit, toAddr, inOffset, inLength, outOffset, outLength] = + runState.stack.peek(6) + + gas += subMemUsage(runState, inOffset, inLength, common) + gas += subMemUsage(runState, outOffset, outLength, common) + + if (common.isActivatedEIP(2929)) { + const toAddress = new Address(addressToBuffer(toAddr)) + gas += accessAddressEIP2929(runState, toAddress, common) + } + + const gasLimit = maxCallGas( + currentGasLimit, + runState.eei.getGasLeft() - gas, + runState, + common + ) // we set TangerineWhistle or later to true here, as STATICCALL was available from Byzantium (which is after TangerineWhistle) + + runState.messageGasLimit = gasLimit + return gas + }, + ], + [ + /* REVERT */ + 0xfd, + async function (runState, gas, common): Promise { + const [offset, length] = runState.stack.peek(2) + gas += subMemUsage(runState, offset, length, common) + return gas + }, + ], + [ + /* SELFDESTRUCT */ + 0xff, + async function (runState, gas, common): Promise { + if (runState.eei.isStatic()) { + trap(ERROR.STATIC_STATE_CHANGE) + } + const selfdestructToaddressBigInt = runState.stack.peek()[0] + + const selfdestructToAddress = new Address(addressToBuffer(selfdestructToaddressBigInt)) + let deductGas = false + if (common.gteHardfork('spuriousDragon')) { + // EIP-161: State Trie Clearing + const balance = await runState.eei.getExternalBalance(runState.eei.getAddress()) + if (balance > BigInt(0)) { + // This technically checks if account is empty or non-existent + // TODO: improve on the API here (EEI and StateManager) + const empty = await runState.eei.isAccountEmpty(selfdestructToAddress) + if (empty) { + deductGas = true + } + } + } else if (common.gteHardfork('tangerineWhistle')) { + // EIP-150 (Tangerine Whistle) gas semantics + const exists = await runState.stateManager.accountExists(selfdestructToAddress) + if (!exists) { deductGas = true } } diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index 7531549ed3f..fb7ff1f307c 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -192,7 +192,7 @@ export default class VM extends AsyncEventEmitter { protected _dynamicGasHandlers!: Map protected readonly _hardforkByBlockNumber: boolean - protected readonly _hardforkByTD?: BigInt + protected readonly _hardforkByTD?: bigint protected readonly _customOpcodes?: CustomOpcode[] protected readonly _customPrecompiles?: CustomPrecompile[] @@ -270,14 +270,6 @@ export default class VM extends AsyncEventEmitter { const DEFAULT_CHAIN = Chain.Mainnet this._common = new Common({ chain: DEFAULT_CHAIN }) } - this._common.on('hardforkChanged', () => { - this.getActiveOpcodes() - this._precompiles = getActivePrecompiles(this._common, this._customPrecompiles) - }) - - // Set list of opcodes based on HF - this.getActiveOpcodes() - this._precompiles = getActivePrecompiles(this._common, this._customPrecompiles) const supportedHardforks = [ Hardfork.Chainstart, @@ -302,9 +294,12 @@ export default class VM extends AsyncEventEmitter { ) } - // Set list of opcodes based on HF - // TODO: make this EIP-friendly - this._opcodes = getOpcodesForHF(this._common) + this._common.on('hardforkChanged', () => { + this.getActiveOpcodes() + }) + + // Initialize the opcode data + this.getActiveOpcodes() if (opts.stateManager) { this.stateManager = opts.stateManager diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index c154b73683d..faddd41677e 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -61,7 +61,7 @@ export interface RunBlockOpts { /** * For merge transition support, pass the chain TD up to the block being run */ - hardforkByTD?: BN + hardforkByTD?: bigint } /** @@ -120,7 +120,7 @@ export default async function runBlock(this: VM, opts: RunBlockOpts): Promise { }) const vm = new VM({ common }) const account = await vm.stateManager.getAccount(sender) - const balance = GWEI.muln(21000).muln(10000000) + const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance await vm.stateManager.putAccount(sender, account) @@ -81,7 +81,7 @@ tape('EIP 3540 tests', (t) => { t.test('invalid EOF format / contract creation', async (st) => { const vm = new VM({ common }) const account = await vm.stateManager.getAccount(sender) - const balance = GWEI.muln(21000).muln(10000000) + const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance await vm.stateManager.putAccount(sender, account) @@ -151,7 +151,7 @@ tape('ensure invalid EOF initcode in EIP-3540 does not consume all gas', (t) => }) const vm = new VM({ common }) const account = await vm.stateManager.getAccount(sender) - const balance = GWEI.muln(21000).muln(10000000) + const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance await vm.stateManager.putAccount(sender, account) @@ -160,7 +160,7 @@ tape('ensure invalid EOF initcode in EIP-3540 does not consume all gas', (t) => data = generateInvalidEOFCode('60016001F3') const res2 = await runTx(vm, data, 1) - st.ok(res.result.gasUsed.gt(res2.result.gasUsed), 'invalid initcode did not consume all gas') + st.ok(res.result.gasUsed > res2.result.gasUsed, 'invalid initcode did not consume all gas') }) t.test('case: create', async (st) => { @@ -171,7 +171,7 @@ tape('ensure invalid EOF initcode in EIP-3540 does not consume all gas', (t) => }) const vm = new VM({ common }) const account = await vm.stateManager.getAccount(sender) - const balance = GWEI.muln(21000).muln(10000000) + const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance await vm.stateManager.putAccount(sender, account) @@ -181,7 +181,7 @@ tape('ensure invalid EOF initcode in EIP-3540 does not consume all gas', (t) => data = deployCreateCode(generateInvalidEOFCode('60016001F3').substring(2)) const res2 = await runTx(vm, data, 1) - st.ok(res.result.gasUsed.gt(res2.result.gasUsed), 'invalid initcode did not consume all gas') + st.ok(res.result.gasUsed > res2.result.gasUsed, 'invalid initcode did not consume all gas') }) t.test('case: create2', async (st) => { @@ -192,7 +192,7 @@ tape('ensure invalid EOF initcode in EIP-3540 does not consume all gas', (t) => }) const vm = new VM({ common }) const account = await vm.stateManager.getAccount(sender) - const balance = GWEI.muln(21000).muln(10000000) + const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance await vm.stateManager.putAccount(sender, account) @@ -201,6 +201,6 @@ tape('ensure invalid EOF initcode in EIP-3540 does not consume all gas', (t) => data = deployCreate2Code(generateInvalidEOFCode('60016001F3').substring(2)) const res2 = await runTx(vm, data, 1) - st.ok(res.result.gasUsed.gt(res2.result.gasUsed), 'invalid initcode did not consume all gas') + st.ok(res.result.gasUsed > res2.result.gasUsed, 'invalid initcode did not consume all gas') }) }) diff --git a/packages/vm/tests/api/EIPs/eip-3670-eof-code-validation.spec.ts b/packages/vm/tests/api/EIPs/eip-3670-eof-code-validation.spec.ts index 2eec64362d7..3c552c48c13 100644 --- a/packages/vm/tests/api/EIPs/eip-3670-eof-code-validation.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3670-eof-code-validation.spec.ts @@ -2,10 +2,10 @@ import tape from 'tape' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' -import { Address, BN, privateToAddress } from 'ethereumjs-util' +import { Address, privateToAddress } from 'ethereumjs-util' import * as eof from '../../../src/evm/opcodes/eof' const pkey = Buffer.from('20'.repeat(32), 'hex') -const GWEI = new BN('1000000000') +const GWEI = BigInt('1000000000') const sender = new Address(privateToAddress(pkey)) async function runTx(vm: VM, data: string, nonce: number) { @@ -59,7 +59,7 @@ tape('EIP 3670 tests', (t) => { t.test('valid contract code transactions', async (st) => { const vm = new VM({ common }) const account = await vm.stateManager.getAccount(sender) - const balance = GWEI.muln(21000).muln(10000000) + const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance await vm.stateManager.putAccount(sender, account) @@ -75,7 +75,7 @@ tape('EIP 3670 tests', (t) => { t.test('invalid contract code transactions', async (st) => { const vm = new VM({ common: common }) const account = await vm.stateManager.getAccount(sender) - const balance = GWEI.muln(21000).muln(10000000) + const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance await vm.stateManager.putAccount(sender, account) diff --git a/packages/vm/tests/api/EIPs/eip-3860.spec.ts b/packages/vm/tests/api/EIPs/eip-3860.spec.ts index e6ed1a55ea1..ab16d859c36 100644 --- a/packages/vm/tests/api/EIPs/eip-3860.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3860.spec.ts @@ -2,9 +2,9 @@ import tape from 'tape' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' -import { Address, BN, privateToAddress } from 'ethereumjs-util' +import { Address, privateToAddress } from 'ethereumjs-util' const pkey = Buffer.from('20'.repeat(32), 'hex') -const GWEI = new BN('1000000000') +const GWEI = BigInt('1000000000') const sender = new Address(privateToAddress(pkey)) tape('EIP 3860 tests', (t) => { @@ -17,7 +17,7 @@ tape('EIP 3860 tests', (t) => { t.test('EIP-3860 tests', async (st) => { const vm = new VM({ common }) const account = await vm.stateManager.getAccount(sender) - const balance = GWEI.muln(21000).muln(10000000) + const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance await vm.stateManager.putAccount(sender, account) diff --git a/packages/vm/tests/api/customChain.spec.ts b/packages/vm/tests/api/customChain.spec.ts index 04f272f9778..db3e2f61b37 100644 --- a/packages/vm/tests/api/customChain.spec.ts +++ b/packages/vm/tests/api/customChain.spec.ts @@ -114,7 +114,7 @@ tape('VM initialized with custom state ', (t) => { st.equal((vm as any)._hardforkByBlockNumber, true, 'should set hardforkByBlockNumber option') vm = await VM.create({ common, hardforkByTD: 5001 }) - st.equal((vm as any)._hardforkByTD, 5001, 'should set hardforkByTD option') + st.equal((vm as any)._hardforkByTD, BigInt(5001), 'should set hardforkByTD option') try { await VM.create({ common, hardforkByBlockNumber: true, hardforkByTD: 3000 }) diff --git a/packages/vm/tests/api/evm/customOpcodes.spec.ts b/packages/vm/tests/api/evm/customOpcodes.spec.ts index 2a1baf4afc9..c9cb035e5b1 100644 --- a/packages/vm/tests/api/evm/customOpcodes.spec.ts +++ b/packages/vm/tests/api/evm/customOpcodes.spec.ts @@ -1,24 +1,23 @@ import tape from 'tape' -import { BN } from 'ethereumjs-util' import VM from '../../../src' import { AddOpcode } from '../../../src/evm/types' import { InterpreterStep, RunState } from '../../../src/evm/interpreter' tape('VM: custom opcodes', (t) => { const fee = 333 - const logicFee = 33 - const totalFee = fee + logicFee - const stackPush = 1 + const logicFee = BigInt(33) + const totalFee = BigInt(fee) + logicFee + const stackPush = BigInt(1) const testOpcode: AddOpcode = { opcode: 0x21, opcodeName: 'TEST', baseFee: fee, - gasFunction: function (runState: RunState, gas: BN) { - gas.iaddn(logicFee) + gasFunction: function (runState: RunState, gas: bigint) { + return gas + logicFee }, logicFunction: function (runState: RunState) { - runState.stack.push(new BN(stackPush)) + runState.stack.push(BigInt(stackPush)) }, } @@ -35,10 +34,10 @@ tape('VM: custom opcodes', (t) => { }) const res = await vm.runCode({ code: Buffer.from('21', 'hex'), - gasLimit: new BN(gas), + gasLimit: BigInt(gas), }) - st.ok(res.gasUsed.eqn(totalFee), 'succesfully charged correct gas') - st.ok(res.runState!.stack._store[0].eqn(stackPush), 'succesfully ran opcode logic') + st.ok(res.gasUsed === totalFee, 'succesfully charged correct gas') + st.ok(res.runState!.stack._store[0] === stackPush, 'succesfully ran opcode logic') st.ok(correctOpcodeName, 'succesfully set opcode name') }) @@ -46,12 +45,12 @@ tape('VM: custom opcodes', (t) => { const vm = new VM({ customOpcodes: [{ opcode: 0x20 }], // deletes KECCAK opcode }) - const gas = 123456 + const gas = BigInt(123456) const res = await vm.runCode({ code: Buffer.from('20', 'hex'), - gasLimit: new BN(gas), + gasLimit: BigInt(gas), }) - st.ok(res.gasUsed.eqn(gas), 'succesfully deleted opcode') + st.ok(res.gasUsed === gas, 'succesfully deleted opcode') }) t.test('should not override default opcodes', async (st) => { @@ -60,12 +59,12 @@ tape('VM: custom opcodes', (t) => { const vm = new VM({ customOpcodes: [{ opcode: 0x01 }], // deletes ADD opcode }) - const gas = 123456 + const gas = BigInt(123456) const res = await vm.runCode({ code: Buffer.from('01', 'hex'), - gasLimit: new BN(gas), + gasLimit: BigInt(gas), }) - st.ok(res.gasUsed.eqn(gas), 'succesfully deleted opcode') + st.ok(res.gasUsed === gas, 'succesfully deleted opcode') const vmDefault = new VM() @@ -79,7 +78,7 @@ tape('VM: custom opcodes', (t) => { // RETURN // Returns 0x05 const result = await vmDefault.runCode({ code: Buffer.from('60046001016000526001601FF3', 'hex'), - gasLimit: new BN(gas), + gasLimit: BigInt(gas), }) st.ok(result.returnValue.equals(Buffer.from('05', 'hex'))) }) @@ -92,9 +91,9 @@ tape('VM: custom opcodes', (t) => { const gas = 123456 const res = await vm.runCode({ code: Buffer.from('20', 'hex'), - gasLimit: new BN(gas), + gasLimit: BigInt(gas), }) - st.ok(res.gasUsed.eqn(totalFee), 'succesfully charged correct gas') - st.ok(res.runState!.stack._store[0].eqn(stackPush), 'succesfully ran opcode logic') + st.ok(res.gasUsed === totalFee, 'succesfully charged correct gas') + st.ok(res.runState!.stack._store[0] === stackPush, 'succesfully ran opcode logic') }) }) diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index 5a740c7b6e5..76cc37b1a09 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -8,6 +8,7 @@ import { isRunningInKarma } from '../util' import { setupVM } from './utils' import testnet from './testdata/testnet.json' import testnet2 from './testdata/testnet2.json' +import testnetMerge from './testdata/testnetMerge.json' // explicitly import util and buffer, // needed for karma-typescript bundling From 5483ddbda66be6e395fb84dfc7f95275a93c8dd1 Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Thu, 24 Mar 2022 14:41:34 +0100 Subject: [PATCH 21/44] Client: rebase fixes --- packages/client/bin/cli.ts | 9 ++++----- packages/client/lib/blockchain/chain.ts | 4 ++-- packages/client/lib/rpc/modules/engine.ts | 10 +++++----- .../client/lib/rpc/util/CLConnectionManager.ts | 2 +- packages/client/lib/sync/fetcher/fetcher.ts | 15 +++++++-------- .../client/lib/sync/fetcher/headerfetcher.ts | 2 +- packages/client/lib/sync/fullsync.ts | 10 +++++----- .../test/sync/fetcher/blockfetcher.spec.ts | 18 +++++++++--------- .../client/test/sync/fetcher/fetcher.spec.ts | 8 +++++--- .../test/sync/fetcher/headerfetcher.spec.ts | 10 +++++----- 10 files changed, 44 insertions(+), 44 deletions(-) diff --git a/packages/client/bin/cli.ts b/packages/client/bin/cli.ts index ac229b5b238..d1e96e58f27 100755 --- a/packages/client/bin/cli.ts +++ b/packages/client/bin/cli.ts @@ -7,7 +7,6 @@ import { randomBytes } from 'crypto' import { existsSync } from 'fs' import { ensureDirSync, readFileSync, removeSync } from 'fs-extra' import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { _getInitializedChains } from '@ethereumjs/common/dist/chains' import { Address, toBuffer } from 'ethereumjs-util' import { parseMultiaddrs, parseGenesisState, parseCustomParams } from '../lib/util' import EthereumClient from '../lib/client' @@ -326,17 +325,17 @@ async function executeBlocks(client: EthereumClient) { */ async function startBlock(client: EthereumClient) { if (!args.startBlock) return - const startBlock = new BN(args.startBlock) + const startBlock = BigInt(args.startBlock) const { blockchain } = client.chain const height = (await blockchain.getLatestHeader()).number - if (height.eq(startBlock)) return - if (height.lt(startBlock)) { + if (height === startBlock) return + if (height < startBlock) { logger.error(`Cannot start chain higher than current height ${height}`) process.exit() } try { const headBlock = await blockchain.getBlock(startBlock) - const delBlock = await blockchain.getBlock(startBlock.addn(1)) + const delBlock = await blockchain.getBlock(startBlock + BigInt(1)) await blockchain.delBlock(delBlock.hash()) logger.info(`Chain height reset to ${headBlock.header.number}`) } catch (err: any) { diff --git a/packages/client/lib/blockchain/chain.ts b/packages/client/lib/blockchain/chain.ts index b0cdfc2f872..420937ff6db 100644 --- a/packages/client/lib/blockchain/chain.ts +++ b/packages/client/lib/blockchain/chain.ts @@ -186,14 +186,14 @@ export class Chain { this.config.chainCommon.on('hardforkChanged', async (hardfork: string) => { if (hardfork !== Hardfork.Merge) { - const block = this.config.chainCommon.hardforkBlockBN() + const block = this.config.chainCommon.hardforkBlock() this.config.logger.info(`New hardfork reached 🪢 ! hardfork=${hardfork} block=${block}`) } else { const block = await this.getLatestBlock() const num = block.header.number const td = await this.blockchain.getTotalDifficulty(block.hash(), num) this.config.logger.info(`Merge hardfork reached 🐼 👉 👈 🐼 ! block=${num} td=${td}`) - this.config.logger.info(`First block for CL-framed execution: block=${num.addn(1)}`) + this.config.logger.info(`First block for CL-framed execution: block=${num + BigInt(1)}`) } }) } diff --git a/packages/client/lib/rpc/modules/engine.ts b/packages/client/lib/rpc/modules/engine.ts index 6caef4a58a5..534d7166cd4 100644 --- a/packages/client/lib/rpc/modules/engine.ts +++ b/packages/client/lib/rpc/modules/engine.ts @@ -153,15 +153,15 @@ const validHash = async (hash: Buffer, chain: Chain): Promise => const validateTerminalBlock = async (block: Block, chain: Chain): Promise => { const td = chain.config.chainCommon.hardforkTD(Hardfork.Merge) if (td === undefined || td === null) return false - const ttd = new BN(td) + const ttd = BigInt(td) const blockTd = await chain.getTd(block.hash(), block.header.number) // Block is terminal if its td >= ttd and its parent td < ttd. // In case the Genesis block has td >= ttd it is the terminal block - if (block.isGenesis()) return blockTd.gte(ttd) + if (block.isGenesis()) return blockTd >= ttd - const parentBlockTd = await chain.getTd(block.header.parentHash, block.header.number.subn(1)) - return blockTd.gte(ttd) && parentBlockTd.lt(ttd) + const parentBlockTd = await chain.getTd(block.header.parentHash, block.header.number - BigInt(1)) + return blockTd >= ttd && parentBlockTd < ttd } /** @@ -660,7 +660,7 @@ export class Engine { message: 'terminalTotalDifficulty not set internally', } } - if (!td.eq(new BN(toBuffer(terminalTotalDifficulty)))) { + if (td !== BigInt(terminalTotalDifficulty)) { throw { code: INVALID_PARAMS, message: `terminalTotalDifficulty set to ${td}, received ${parseInt( diff --git a/packages/client/lib/rpc/util/CLConnectionManager.ts b/packages/client/lib/rpc/util/CLConnectionManager.ts index 57abc953763..68dd7fe6bb7 100644 --- a/packages/client/lib/rpc/util/CLConnectionManager.ts +++ b/packages/client/lib/rpc/util/CLConnectionManager.ts @@ -162,7 +162,7 @@ export class CLConnectionManager { } private timeDiffStr(block: Block) { - const timeDiff = new Date().getTime() / 1000 - block.header.timestamp.toNumber() + const timeDiff = new Date().getTime() / 1000 - Number(block.header.timestamp) const min = 60 const hour = min * 60 const day = hour * 24 diff --git a/packages/client/lib/sync/fetcher/fetcher.ts b/packages/client/lib/sync/fetcher/fetcher.ts index a52b1c13f00..7e85cb383ef 100644 --- a/packages/client/lib/sync/fetcher/fetcher.ts +++ b/packages/client/lib/sync/fetcher/fetcher.ts @@ -1,7 +1,6 @@ import { debug as createDebugLogger, Debugger } from 'debug' import { Readable, Writable } from 'stream' import Heap from 'qheap' -import { BN } from 'ethereumjs-util' import { PeerPool } from '../../net/peerpool' import { Peer } from '../../net/peer' @@ -387,13 +386,13 @@ export abstract class Fetcher extends Readable // Non-fatal error: ban peer and re-enqueue job. // Modify the first job so that it is enqueued from safeReorgDistance as most likely // this is because of a reorg. - const stepBack = BN.min( - jobItems[0].task.first.subn(1), - new BN(this.config.safeReorgDistance) - ).toNumber() + let stepBack = jobItems[0].task.first - BigInt(1) + if (stepBack > BigInt(this.config.safeReorgDistance)) { + stepBack = BigInt(this.config.safeReorgDistance) + } this.debug(`Possible reorg, stepping back ${stepBack} blocks and requeuing jobs.`) - jobItems[0].task.first.isubn(stepBack) - jobItems[0].task.count += stepBack + jobItems[0].task.first - stepBack + jobItems[0].task.count += Number(stepBack) // This will requeue the jobs as we are marking this failure as non-fatal. this.failure(jobItems, error, false, true) cb() @@ -501,7 +500,7 @@ export abstract class Fetcher extends Readable let { first, count } = job.task let partialResult = '' if (job.partialResult) { - first = first.addn(job.partialResult.length) + first = first + BigInt(job.partialResult.length) count -= job.partialResult.length partialResult = ` partialResults=${job.partialResult.length}` } diff --git a/packages/client/lib/sync/fetcher/headerfetcher.ts b/packages/client/lib/sync/fetcher/headerfetcher.ts index 91f5c187d18..310403589af 100644 --- a/packages/client/lib/sync/fetcher/headerfetcher.ts +++ b/packages/client/lib/sync/fetcher/headerfetcher.ts @@ -40,7 +40,7 @@ export class HeaderFetcher extends BlockFetcherBase { // Clear fetcher queue for next test of gap when following head fetcher.clear() - blockNumberList = [new BigInt(50), new BigInt(51)] - min = new BigInt(50) - max = new BigInt(51) + blockNumberList = [BigInt(50), BigInt(51)] + min = BigInt(50) + max = BigInt(51) fetcher.enqueueByNumberList(blockNumberList, min, max) t.equals( (fetcher as any).in.size(), @@ -109,11 +109,11 @@ tape('[BlockFetcher]', async (t) => { config, pool, chain, - first: new BigInt(0), - count: new BigInt(0), + first: BigInt(0), + count: BigInt(0), }) const blocks: any = [{ header: { number: 1 } }, { header: { number: 2 } }] - const task = { count: 3, first: new BigInt(1) } + const task = { count: 3, first: BigInt(1) } ;(fetcher as any).running = true fetcher.enqueueTask(task) const job = (fetcher as any).in.peek() @@ -153,12 +153,12 @@ tape('[BlockFetcher]', async (t) => { config, pool, chain, - first: new BigInt(0), - count: new BigInt(0), + first: BigInt(0), + count: BigInt(0), }) const partialResult: any = [{ header: { number: 1 } }, { header: { number: 2 } }] - const task = { count: 3, first: new BigInt(1) } + const task = { count: 3, first: BigInt(1) } const peer = { eth: { getBlockBodies: td.func(), getBlockHeaders: td.func() }, id: 'random', diff --git a/packages/client/test/sync/fetcher/fetcher.spec.ts b/packages/client/test/sync/fetcher/fetcher.spec.ts index 26f859bb4c8..12d86f933bb 100644 --- a/packages/client/test/sync/fetcher/fetcher.spec.ts +++ b/packages/client/test/sync/fetcher/fetcher.spec.ts @@ -1,6 +1,5 @@ import tape from 'tape' import td from 'testdouble' -import { BN } from 'ethereumjs-util' import { Config } from '../../../lib/config' import { Fetcher } from '../../../lib/sync/fetcher/fetcher' import { Job } from '../../../lib/sync/fetcher/types' @@ -103,7 +102,7 @@ tape('[Fetcher]', (t) => { t.plan(1) const config = new Config({ transports: [] }) const fetcher = new FetcherTest({ config, pool: td.object(), timeout: 5000 }) - const task = { first: new BN(50), count: 10 } + const task = { first: BigInt(50), count: 10 } const job: any = { peer: {}, task, state: 'active', index: 0 } fetcher.next = td.func() fetcher.write() @@ -114,7 +113,10 @@ tape('[Fetcher]', (t) => { ) ;(fetcher as any).success(job, ['something']) setTimeout(() => { - t.ok((fetcher as any).in.peek().task.first.eqn(1), 'should step back for safeReorgDistance') + t.ok( + (fetcher as any).in.peek().task.first === BigInt(1), + 'should step back for safeReorgDistance' + ) }, 20) }) diff --git a/packages/client/test/sync/fetcher/headerfetcher.spec.ts b/packages/client/test/sync/fetcher/headerfetcher.spec.ts index 962605f0639..7304c971094 100644 --- a/packages/client/test/sync/fetcher/headerfetcher.spec.ts +++ b/packages/client/test/sync/fetcher/headerfetcher.spec.ts @@ -43,18 +43,18 @@ tape('[HeaderFetcher]', async (t) => { flow, }) const headers = [{ number: 1 }, { number: 2 }] - const task = { count: 3, first: new BN(1) } + const task = { count: 3, first: BigInt(1) } ;(fetcher as any).running = true fetcher.enqueueTask(task) const job = (fetcher as any).in.peek() - let results = fetcher.process(job as any, { headers, bv: new BN(1) } as any) + let results = fetcher.process(job as any, { headers, bv: BigInt(1) } as any) t.equal((fetcher as any).in.size(), 1, 'Fetcher should still have same job') t.equal(job?.partialResult?.length, 2, 'Should have two partial results') t.equal(results, undefined, 'Process should not return full results yet') const remainingHeaders: any = [{ number: 3 }] - results = fetcher.process(job as any, { headers: remainingHeaders, bv: new BN(1) } as any) + results = fetcher.process(job as any, { headers: remainingHeaders, bv: BigInt(1) } as any) t.equal(results?.length, 3, 'Should return full results') t.end() @@ -79,7 +79,7 @@ tape('[HeaderFetcher]', async (t) => { flow, }) const partialResult = [{ number: 1 }, { number: 2 }] - const task = { count: 3, first: new BN(1) } + const task = { count: 3, first: BigInt(1) } const peer = { les: { getBlockHeaders: td.func() }, id: 'random', @@ -89,7 +89,7 @@ tape('[HeaderFetcher]', async (t) => { await fetcher.request(job as any) td.verify( job.peer.les.getBlockHeaders({ - block: job.task.first.addn(partialResult.length), + block: job.task.first + BigInt(partialResult.length), max: job.task.count - partialResult.length, }) ) From ad2246967f709a03d1df8c472788d2aca0bdfb36 Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Thu, 24 Mar 2022 11:07:22 -0400 Subject: [PATCH 22/44] Fix missing = sign --- packages/client/lib/sync/fetcher/fetcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/lib/sync/fetcher/fetcher.ts b/packages/client/lib/sync/fetcher/fetcher.ts index 7e85cb383ef..0ee37dd38fd 100644 --- a/packages/client/lib/sync/fetcher/fetcher.ts +++ b/packages/client/lib/sync/fetcher/fetcher.ts @@ -391,7 +391,7 @@ export abstract class Fetcher extends Readable stepBack = BigInt(this.config.safeReorgDistance) } this.debug(`Possible reorg, stepping back ${stepBack} blocks and requeuing jobs.`) - jobItems[0].task.first - stepBack + jobItems[0].task.first -= stepBack jobItems[0].task.count += Number(stepBack) // This will requeue the jobs as we are marking this failure as non-fatal. this.failure(jobItems, error, false, true) From 048e68a5b0f2b7cb5d46f510ed8a7deff9b3d589 Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Thu, 24 Mar 2022 12:30:33 -0400 Subject: [PATCH 23/44] Revert process code changes --- packages/client/lib/sync/fetcher/headerfetcher.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/client/lib/sync/fetcher/headerfetcher.ts b/packages/client/lib/sync/fetcher/headerfetcher.ts index 310403589af..f71dde56e72 100644 --- a/packages/client/lib/sync/fetcher/headerfetcher.ts +++ b/packages/client/lib/sync/fetcher/headerfetcher.ts @@ -66,19 +66,7 @@ export class HeaderFetcher extends BlockFetcherBase 0 && headers.length < job.task.count) { // Adopt the start block/header number from the remaining jobs // if the number of the results provided is lower than the expected count - const lengthDiff = job.task.count - headers.length - const adoptedJobs = [] - while (this.in.length > 0) { - const job = this.in.remove() - if (job) { - job.task.first = job.task.first - BigInt(lengthDiff) - adoptedJobs.push(job) - } - } - for (const job of adoptedJobs) { - this.in.insert(job) - } - return headers + job.partialResult = headers } return } From 422410068e50774c083e24cba439c6284cd9a083 Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Sat, 2 Apr 2022 01:11:45 -0700 Subject: [PATCH 24/44] VM, Blockchain, Client: fix storing unsettled promises (develop) (#1811) * blockchain: remove storing unsettled promise * vm: remove storing unsettled promises. make copy() async * client: update to new async changes * block: doc nit * nits * fix vm benchmarks, add _init to mockchain * Make blockchain and vm constructors protected * lint * vm: update new tests to await Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com> --- packages/block/src/header.ts | 2 +- packages/blockchain/src/index.ts | 91 ++++++++----------- packages/blockchain/test/clique.spec.ts | 2 +- packages/blockchain/test/index.spec.ts | 74 +++++++-------- packages/blockchain/test/reorg.spec.ts | 4 +- packages/blockchain/test/util.ts | 2 +- packages/client/lib/blockchain/chain.ts | 4 +- packages/client/lib/client.ts | 58 ++++++++++++ packages/client/lib/execution/vmexecution.ts | 3 +- packages/client/lib/miner/miner.ts | 2 +- packages/client/lib/rpc/modules/engine.ts | 2 +- packages/client/lib/rpc/modules/eth.ts | 18 ++-- packages/client/lib/util/debug.ts | 2 +- packages/client/test/blockchain/chain.spec.ts | 4 +- .../client/test/integration/peerpool.spec.ts | 2 +- packages/client/test/miner/miner.spec.ts | 1 + packages/client/test/rpc/eth/call.spec.ts | 4 +- .../client/test/rpc/eth/estimateGas.spec.ts | 4 +- packages/client/test/rpc/helpers.ts | 2 +- .../test/sync/execution/vmexecution.spec.ts | 2 +- packages/vm/benchmarks/mainnetBlocks.ts | 6 +- packages/vm/benchmarks/mockchain.ts | 2 + packages/vm/examples/run-blockchain.ts | 4 +- packages/vm/examples/run-code-browser.js | 34 ++++--- packages/vm/examples/run-solidity-contract.ts | 2 +- packages/vm/src/index.ts | 32 +++---- .../EIPs/eip-1283-net-gas-metering.spec.ts | 2 +- .../tests/api/EIPs/eip-1559-FeeMarket.spec.ts | 4 +- packages/vm/tests/api/EIPs/eip-2315.spec.ts | 2 +- .../vm/tests/api/EIPs/eip-2537-BLS.spec.ts | 6 +- .../api/EIPs/eip-2565-modexp-gas-cost.spec.ts | 2 +- packages/vm/tests/api/EIPs/eip-2929.spec.ts | 4 +- .../api/EIPs/eip-2930-accesslists.spec.ts | 3 +- .../tests/api/EIPs/eip-3198-BaseFee.spec.ts | 2 +- packages/vm/tests/api/EIPs/eip-3529.spec.ts | 6 +- .../EIPs/eip-3540-evm-object-format.spec.ts | 11 ++- packages/vm/tests/api/EIPs/eip-3541.spec.ts | 8 +- packages/vm/tests/api/EIPs/eip-3607.spec.ts | 4 +- .../EIPs/eip-3670-eof-code-validation.spec.ts | 4 +- packages/vm/tests/api/EIPs/eip-3855.spec.ts | 8 +- packages/vm/tests/api/EIPs/eip-3860.spec.ts | 2 +- ...t-difficulty-opcode-with-prevrando.spec.ts | 2 +- packages/vm/tests/api/buildBlock.spec.ts | 6 +- packages/vm/tests/api/events.spec.ts | 16 ++-- .../vm/tests/api/evm/customOpcodes.spec.ts | 10 +- .../api/evm/precompiles/06-ecadd.spec.ts | 2 +- .../api/evm/precompiles/07-ecmul.spec.ts | 2 +- .../api/evm/precompiles/08-ecpairing.spec.ts | 2 +- .../api/evm/precompiles/hardfork.spec.ts | 6 +- packages/vm/tests/api/evm/stack.spec.ts | 2 +- packages/vm/tests/api/index.spec.ts | 32 +++---- .../vm/tests/api/istanbul/eip-1108.spec.ts | 6 +- .../vm/tests/api/istanbul/eip-1344.spec.ts | 2 +- .../vm/tests/api/istanbul/eip-152.spec.ts | 4 +- .../vm/tests/api/istanbul/eip-1884.spec.ts | 2 +- .../vm/tests/api/istanbul/eip-2200.spec.ts | 2 +- .../vm/tests/api/muirGlacier/index.spec.ts | 4 +- packages/vm/tests/api/opcodes.spec.ts | 18 ++-- packages/vm/tests/api/runBlock.spec.ts | 34 +++---- packages/vm/tests/api/runBlockchain.spec.ts | 30 +++--- packages/vm/tests/api/runCall.spec.ts | 28 +++--- packages/vm/tests/api/runCode.spec.ts | 61 +++++++------ packages/vm/tests/api/runTx.spec.ts | 42 ++++----- .../vm/tests/api/state/accountExists.spec.ts | 4 +- packages/vm/tests/api/utils.ts | 7 +- .../tester/runners/BlockchainTestsRunner.ts | 8 +- .../tester/runners/GeneralStateTestsRunner.ts | 2 +- 67 files changed, 408 insertions(+), 357 deletions(-) diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index 3ca6705da9c..6d0467eb0a7 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -167,7 +167,7 @@ export class BlockHeader { /** * This constructor takes the values, validates them, assigns them and freezes the object. * - * @deprecated - Use the public static factory methods to assist in creating a Header object from + * @deprecated Use the public static factory methods to assist in creating a Header object from * varying data types. For a default empty header, use {@link BlockHeader.fromHeaderData}. * */ diff --git a/packages/blockchain/src/index.ts b/packages/blockchain/src/index.ts index 4c18d22bb88..bc0cdf61a13 100644 --- a/packages/blockchain/src/index.ts +++ b/packages/blockchain/src/index.ts @@ -17,13 +17,12 @@ import { CLIQUE_NONCE_AUTH, CLIQUE_NONCE_DROP, } from './clique' - -const debug = createDebugLogger('blockchain:clique') - // eslint-disable-next-line implicit-dependencies/no-implicit import type { LevelUp } from 'levelup' const level = require('level-mem') +const debug = createDebugLogger('blockchain:clique') + type OnBlock = (block: Block, reorg: boolean) => Promise | void export interface BlockchainInterface { @@ -112,7 +111,7 @@ export interface BlockchainOptions { validateBlocks?: boolean /** - * The blockchain only initializes succesfully if it has a genesis block. If + * The blockchain only initializes successfully if it has a genesis block. If * there is no block available in the DB and a `genesisBlock` is provided, * then the provided `genesisBlock` will be used as genesis. If no block is * present in the DB and no block is provided, then the genesis block as @@ -130,18 +129,25 @@ export default class Blockchain implements BlockchainInterface { private _genesis?: Buffer // the genesis hash of this blockchain - // The following two heads and the heads stored within the `_heads` always point - // to a hash in the canonical chain and never to a stale hash. - // With the exception of `_headHeaderHash` this does not necessarily need to be - // the hash with the highest total difficulty. - private _headBlockHash?: Buffer // the hash of the current head block - private _headHeaderHash?: Buffer // the hash of the current head header - // A Map which stores the head of each key (for instance the "vm" key) which is - // updated along a {@link Blockchain.iterator} method run and can be used to (re)run - // non-verified blocks (for instance in the VM). + /** + * The following two heads and the heads stored within the `_heads` always point + * to a hash in the canonical chain and never to a stale hash. + * With the exception of `_headHeaderHash` this does not necessarily need to be + * the hash with the highest total difficulty. + */ + /** The hash of the current head block */ + private _headBlockHash?: Buffer + /** The hash of the current head header */ + private _headHeaderHash?: Buffer + + /** + * A Map which stores the head of each key (for instance the "vm" key) which is + * updated along a {@link Blockchain.iterator} method run and can be used to (re)run + * non-verified blocks (for instance in the VM). + */ private _heads: { [key: string]: Buffer } - public initPromise: Promise + protected _isInitialized = false private _lock: Semaphore private _common: Common @@ -207,9 +213,7 @@ export default class Blockchain implements BlockchainInterface { public static async create(opts: BlockchainOptions = {}) { const blockchain = new Blockchain(opts) - await blockchain.initPromise!.catch((e) => { - throw e - }) + await blockchain._init(opts.genesisBlock) return blockchain } @@ -233,16 +237,16 @@ export default class Blockchain implements BlockchainInterface { } /** - * Creates new Blockchain object + * Creates new Blockchain object. * - * @deprecated - The direct usage of this constructor is discouraged since + * @deprecated The direct usage of this constructor is discouraged since * non-finalized async initialization might lead to side effects. Please * use the async {@link Blockchain.create} constructor instead (same API). * - * @param opts - An object with the options that this constructor takes. See + * @param opts An object with the options that this constructor takes. See * {@link BlockchainOptions}. */ - constructor(opts: BlockchainOptions = {}) { + protected constructor(opts: BlockchainOptions = {}) { // Throw on chain or hardfork options removed in latest major release to // prevent implicit chain setup on a wrong chain if ('chain' in opts || 'hardfork' in opts) { @@ -291,9 +295,6 @@ export default class Blockchain implements BlockchainInterface { if (opts.genesisBlock && !opts.genesisBlock.isGenesis()) { throw 'supplied block is not a genesis block' } - - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.initPromise = this._init(opts.genesisBlock) } /** @@ -329,13 +330,14 @@ export default class Blockchain implements BlockchainInterface { } /** - * This method is called in the constructor and either sets up the DB or reads + * This method is called in {@link Blockchain.create} and either sets up the DB or reads * values from the DB and makes these available to the consumers of * Blockchain. * * @hidden */ private async _init(genesisBlock?: Block): Promise { + if (this._isInitialized) return let dbGenesisBlock try { const genesisHash = await this.dbManager.numberToHash(BigInt(0)) @@ -421,23 +423,14 @@ export default class Blockchain implements BlockchainInterface { } this._headBlockHash = genesisHash } + if (this._hardforkByHeadBlockNumber) { const latestHeader = await this._getHeader(this._headHeaderHash) const td = await this.getTotalDifficulty(this._headHeaderHash) this._common.setHardforkByBlockNumber(latestHeader.number, td) } - } - /** - * Perform the `action` function after we have initialized this module and - * have acquired a lock - * @param action - the action function to run after initializing and acquiring - * a lock - * @hidden - */ - private async initAndLock(action: () => Promise): Promise { - await this.initPromise - return await this.runWithLock(action) + this._isInitialized = true } /** @@ -758,7 +751,7 @@ export default class Blockchain implements BlockchainInterface { * @param name - Optional name of the iterator head (default: 'vm') */ async getIteratorHead(name = 'vm'): Promise { - return await this.initAndLock(async () => { + return await this.runWithLock(async () => { // if the head is not found return the genesis hash const hash = this._heads[name] || this._genesis if (!hash) { @@ -782,7 +775,7 @@ export default class Blockchain implements BlockchainInterface { * on a first run) */ async getHead(name = 'vm'): Promise { - return await this.initAndLock(async () => { + return await this.runWithLock(async () => { // if the head is not found return the headHeader const hash = this._heads[name] || this._headBlockHash if (!hash) { @@ -798,7 +791,7 @@ export default class Blockchain implements BlockchainInterface { * Returns the latest header in the canonical chain. */ async getLatestHeader(): Promise { - return await this.initAndLock(async () => { + return await this.runWithLock(async () => { if (!this._headHeaderHash) { throw new Error('No head header set') } @@ -811,7 +804,7 @@ export default class Blockchain implements BlockchainInterface { * Returns the latest full block in the canonical chain. */ async getLatestBlock(): Promise { - return this.initAndLock(async () => { + return this.runWithLock(async () => { if (!this._headBlockHash) { throw new Error('No head block set') } @@ -831,7 +824,6 @@ export default class Blockchain implements BlockchainInterface { * @param blocks - The blocks to be added to the blockchain */ async putBlocks(blocks: Block[]) { - await this.initPromise for (let i = 0; i < blocks.length; i++) { await this.putBlock(blocks[i]) } @@ -846,7 +838,6 @@ export default class Blockchain implements BlockchainInterface { * @param block - The block to be added to the blockchain */ async putBlock(block: Block) { - await this.initPromise await this._putBlockOrHeader(block) } @@ -860,7 +851,6 @@ export default class Blockchain implements BlockchainInterface { * @param headers - The headers to be added to the blockchain */ async putHeaders(headers: Array) { - await this.initPromise for (let i = 0; i < headers.length; i++) { await this.putHeader(headers[i]) } @@ -875,7 +865,6 @@ export default class Blockchain implements BlockchainInterface { * @param header - The header to be added to the blockchain */ async putHeader(header: BlockHeader) { - await this.initPromise await this._putBlockOrHeader(header) } @@ -1056,7 +1045,6 @@ export default class Blockchain implements BlockchainInterface { // in the `VM` if we encounter a `BLOCKHASH` opcode: then a bigint is used we // need to then read the block from the canonical chain Q: is this safe? We // know it is OK if we call it from the iterator... (runBlock) - await this.initPromise return await this._getBlock(blockId) } @@ -1091,7 +1079,7 @@ export default class Blockchain implements BlockchainInterface { skip: number, reverse: boolean ): Promise { - return await this.initAndLock(async () => { + return await this.runWithLock(async () => { const blocks: Block[] = [] let i = -1 @@ -1128,7 +1116,7 @@ export default class Blockchain implements BlockchainInterface { * @param hashes - Ordered array of hashes (ordered on `number`). */ async selectNeededHashes(hashes: Array): Promise { - return await this.initAndLock(async () => { + return await this.runWithLock(async () => { let max: number let mid: number let min: number @@ -1173,7 +1161,6 @@ export default class Blockchain implements BlockchainInterface { // But is this the way to go? If we know this is called from the // iterator/runBlockchain we are safe, but if this is called from anywhere // else then this might lead to a concurrency problem? - await this.initPromise await this._delBlock(blockHash) } @@ -1273,7 +1260,7 @@ export default class Blockchain implements BlockchainInterface { * @hidden */ private async _iterator(name: string, onBlock: OnBlock, maxBlocks?: number): Promise { - return await this.initAndLock(async (): Promise => { + return await this.runWithLock(async (): Promise => { const headHash = this._heads[name] || this._genesis let lastBlock: Block | undefined @@ -1314,7 +1301,7 @@ export default class Blockchain implements BlockchainInterface { /** * Set header hash of a certain `tag`. - * When calling the iterator, the iterator will start running the first child block after the header hash currenntly stored. + * When calling the iterator, the iterator will start running the first child block after the header hash currently stored. * @param tag - The tag to save the headHash to * @param headHash - The head hash to save */ @@ -1324,14 +1311,14 @@ export default class Blockchain implements BlockchainInterface { /** * Set header hash of a certain `tag`. - * When calling the iterator, the iterator will start running the first child block after the header hash currenntly stored. + * When calling the iterator, the iterator will start running the first child block after the header hash currently stored. * @param tag - The tag to save the headHash to * @param headHash - The head hash to save * * @deprecated use {@link Blockchain.setIteratorHead()} instead */ async setHead(tag: string, headHash: Buffer) { - await this.initAndLock(async () => { + await this.runWithLock(async () => { this._heads[tag] = headHash await this._saveHeads() }) diff --git a/packages/blockchain/test/clique.spec.ts b/packages/blockchain/test/clique.spec.ts index 2470daf6826..45c954d2150 100644 --- a/packages/blockchain/test/clique.spec.ts +++ b/packages/blockchain/test/clique.spec.ts @@ -8,7 +8,7 @@ import { CLIQUE_NONCE_AUTH, CLIQUE_NONCE_DROP } from '../src/clique' tape('Clique: Initialization', (t) => { t.test('should initialize a clique blockchain', async (st) => { const common = new Common({ chain: Chain.Rinkeby, hardfork: Hardfork.Chainstart }) - const blockchain = new Blockchain({ common }) + const blockchain = await Blockchain.create({ common }) const head = await blockchain.getHead() st.equal(head.hash().toString('hex'), common.genesis().hash.slice(2), 'correct genesis hash') diff --git a/packages/blockchain/test/index.spec.ts b/packages/blockchain/test/index.spec.ts index ee5e27909d8..bd14e98922e 100644 --- a/packages/blockchain/test/index.spec.ts +++ b/packages/blockchain/test/index.spec.ts @@ -10,7 +10,7 @@ const level = require('level-mem') tape('blockchain test', (t) => { t.test('should not crash on getting head of a blockchain without a genesis', async (st) => { - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, }) @@ -20,7 +20,7 @@ tape('blockchain test', (t) => { t.test('should initialize correctly', async (st) => { const common = new Common({ chain: Chain.Ropsten }) - let blockchain = new Blockchain({ common }) + let blockchain = await Blockchain.create({ common }) const head = await blockchain.getHead() const iteratorHead = await blockchain.getIteratorHead() @@ -59,33 +59,27 @@ tape('blockchain test', (t) => { st.end() }) - t.test('should only initialize with supported consensus validation options', (st) => { + t.test('should only initialize with supported consensus validation options', async (st) => { let common = new Common({ chain: Chain.Mainnet }) - st.doesNotThrow(() => { - new Blockchain({ common, validateConsensus: true }) - }) - st.doesNotThrow(() => { - new Blockchain({ common, validateBlocks: true }) - }) - - common = new Common({ chain: Chain.Goerli }) - st.doesNotThrow(() => { - new Blockchain({ common, validateConsensus: true }) - }) - st.doesNotThrow(() => { - new Blockchain({ common, validateBlocks: true }) - }) - st.end() + try { + await Blockchain.create({ common, validateConsensus: true }) + await Blockchain.create({ common, validateBlocks: true }) + common = new Common({ chain: Chain.Goerli }) + await Blockchain.create({ common, validateConsensus: true }) + await Blockchain.create({ common, validateBlocks: true }) + st.pass('should not throw') + } catch (error) { + st.fail('show not have thrown') + } }) t.test('should add a genesis block without errors', async (st) => { const genesisBlock = Block.genesis() - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, genesisBlock, }) - await blockchain.initPromise st.ok( genesisBlock.hash().equals(blockchain.meta.genesis!), 'genesis block hash should be correct' @@ -108,7 +102,7 @@ tape('blockchain test', (t) => { }) t.test('should initialize with a genesis block', async (st) => { - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, }) @@ -125,7 +119,7 @@ tape('blockchain test', (t) => { const genesisBlock = Block.genesis({ header: { gasLimit } }, { common }) blocks.push(genesisBlock) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, genesisBlock, @@ -171,7 +165,7 @@ tape('blockchain test', (t) => { const genesisBlock = Block.genesis({ header: { gasLimit } }, { common }) blocks.push(genesisBlock) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, genesisBlock, @@ -206,7 +200,7 @@ tape('blockchain test', (t) => { const gasLimit = 8000000 const genesisBlock = Block.genesis({ header: { gasLimit } }) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, genesisBlock, @@ -500,7 +494,7 @@ tape('blockchain test', (t) => { }) t.test('should not call iterator function in an empty blockchain', async (st) => { - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, }) @@ -613,7 +607,7 @@ tape('blockchain test', (t) => { t.test('should put one block at a time', async (st) => { const blocks = generateBlocks(15) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, genesisBlock: blocks[0], @@ -628,7 +622,7 @@ tape('blockchain test', (t) => { const blocks: Block[] = [] const genesisBlock = Block.genesis({ header: { gasLimit: 8000000 } }) blocks.push(...generateBlocks(15, [genesisBlock])) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, genesisBlock, @@ -639,7 +633,7 @@ tape('blockchain test', (t) => { t.test('should get heads', async (st) => { const [db, genesis] = await createTestDB() - const blockchain = new Blockchain({ db: db }) + const blockchain = await Blockchain.create({ db: db }) const head = await blockchain.getHead() if (genesis) { st.ok(head.hash().equals(genesis.hash()), 'should get head') @@ -656,7 +650,7 @@ tape('blockchain test', (t) => { t.test('should validate', async (st) => { const genesisBlock = Block.genesis({ header: { gasLimit: 8000000 } }) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, genesisBlock, @@ -679,7 +673,7 @@ tape('blockchain test', (t) => { initWithGenesisHeader: true, common, }) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, genesisBlock, @@ -696,7 +690,7 @@ tape('blockchain test', (t) => { if (!genesis) { return st.fail('genesis not defined!') } - const blockchain = new Blockchain({ db }) + const blockchain = await Blockchain.create({ db }) const number = await blockchain.dbManager.hashToNumber(genesis?.hash()) st.equal(number, BigInt(0), 'should perform _hashToNumber correctly') @@ -716,7 +710,7 @@ tape('blockchain test', (t) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) const genesisBlock = Block.genesis({ header: { gasLimit } }, { common }) - let blockchain = new Blockchain({ + let blockchain = await Blockchain.create({ db, validateBlocks: true, validateConsensus: false, @@ -735,7 +729,7 @@ tape('blockchain test', (t) => { }) await blockchain.putHeader(header) - blockchain = new Blockchain({ + blockchain = await Blockchain.create({ db, validateBlocks: true, validateConsensus: false, @@ -756,7 +750,7 @@ tape('blockchain test', (t) => { const opts: BlockOptions = { common } const genesisBlock = Block.genesis({ header: { gasLimit } }, opts) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, genesisBlock, @@ -840,7 +834,7 @@ tape('blockchain test', (t) => { }), ] - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ common, validateBlocks: true, validateConsensus: false, @@ -871,7 +865,7 @@ tape('initialization tests', (t) => { hardfork: Hardfork.Chainstart, }) const genesisHash = Block.genesis({}, { common }).hash() - const blockchain = new Blockchain({ common }) + const blockchain = await Blockchain.create({ common }) st.ok( (await blockchain.getHead()).hash().equals(genesisHash), @@ -880,7 +874,7 @@ tape('initialization tests', (t) => { const db = blockchain.db - const newBlockchain = new Blockchain({ db, common }) + const newBlockchain = await Blockchain.create({ db, common }) st.ok( (await newBlockchain.getHead()).hash().equals(genesisHash), @@ -896,7 +890,7 @@ tape('initialization tests', (t) => { }, }) const hash = genesisBlock.hash() - const blockchain = new Blockchain({ genesisBlock }) + const blockchain = await Blockchain.create({ genesisBlock }) const db = blockchain.db st.ok( @@ -904,7 +898,7 @@ tape('initialization tests', (t) => { 'blockchain should put custom genesis block' ) - const newBlockchain = new Blockchain({ db, genesisBlock }) + const newBlockchain = await Blockchain.create({ db, genesisBlock }) st.ok( (await newBlockchain.getHead()).hash().equals(hash), 'head hash should be read from the provided db' @@ -919,7 +913,7 @@ tape('initialization tests', (t) => { }, }) const hash = genesisBlock.hash() - const blockchain = new Blockchain({ genesisBlock }) + const blockchain = await Blockchain.create({ genesisBlock }) const db = blockchain.db const otherGenesisBlock = Block.genesis({ diff --git a/packages/blockchain/test/reorg.spec.ts b/packages/blockchain/test/reorg.spec.ts index 136276730ed..53827f3d533 100644 --- a/packages/blockchain/test/reorg.spec.ts +++ b/packages/blockchain/test/reorg.spec.ts @@ -21,7 +21,7 @@ tape('reorg tests', (t) => { }, { common } ) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, common, @@ -90,7 +90,7 @@ tape('reorg tests', (t) => { async (st) => { const common = new Common({ chain: Chain.Goerli, hardfork: Hardfork.Chainstart }) const genesisBlock = Block.genesis({}, { common }) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false, common, diff --git a/packages/blockchain/test/util.ts b/packages/blockchain/test/util.ts index 84f1b2ac3ba..0a5bfc1aed3 100644 --- a/packages/blockchain/test/util.ts +++ b/packages/blockchain/test/util.ts @@ -40,7 +40,7 @@ export const generateBlockchain = async (numberOfBlocks: number, genesis?: Block const existingBlocks: Block[] = genesis ? [genesis] : [] const blocks = generateBlocks(numberOfBlocks, existingBlocks) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: true, validateConsensus: false, genesisBlock: genesis ?? blocks[0], diff --git a/packages/client/lib/blockchain/chain.ts b/packages/client/lib/blockchain/chain.ts index 420937ff6db..cf0fa91a673 100644 --- a/packages/client/lib/blockchain/chain.ts +++ b/packages/client/lib/blockchain/chain.ts @@ -112,7 +112,7 @@ export class Chain { this.blockchain = options.blockchain ?? - new Blockchain({ + new (Blockchain as any)({ db: options.chainDB, common: this.config.chainCommon, hardforkByHeadBlockNumber: true, @@ -180,7 +180,7 @@ export class Chain { async open(): Promise { if (this.opened) return false await this.blockchain.db.open() - await this.blockchain.initPromise + await (this.blockchain as any)._init() this.opened = true await this.update() diff --git a/packages/client/lib/client.ts b/packages/client/lib/client.ts index b2d2bbb2319..0f73e3a6b74 100644 --- a/packages/client/lib/client.ts +++ b/packages/client/lib/client.ts @@ -161,4 +161,62 @@ export default class EthereumClient { server(name: string) { return this.config.servers.find((s) => s.name === name) } + + /** + * Execute a range of blocks on a copy of the VM + * without changing any chain or client state + * + * Possible input formats: + * + * - Single block, '5' + * - Range of blocks, '5-10' + * + */ + async executeBlocks(first: number, last: number, txHashes: string[]) { + this.config.logger.info('Preparing for block execution (debug mode, no services started)...') + if (!this.execution) throw new Error('executeBlocks requires execution') + const vm = await this.execution.vm.copy() + + for (let blockNumber = first; blockNumber <= last; blockNumber++) { + const block = await vm.blockchain.getBlock(blockNumber) + const parentBlock = await vm.blockchain.getBlock(block.header.parentHash) + + // Set the correct state root + await vm.stateManager.setStateRoot(parentBlock.header.stateRoot) + + const td = await vm.blockchain.getTotalDifficulty(block.header.parentHash) + vm._common.setHardforkByBlockNumber(blockNumber, td) + + if (txHashes.length === 0) { + const res = await vm.runBlock({ block }) + this.config.logger.info( + `Executed block num=${blockNumber} hash=0x${block.hash().toString('hex')} txs=${ + block.transactions.length + } gasUsed=${res.gasUsed} ` + ) + } else { + let count = 0 + // Special verbose tx execution mode triggered by BLOCK_NUMBER[*] + // Useful e.g. to trace slow txs + const allTxs = txHashes.length === 1 && txHashes[0] === '*' ? true : false + for (const tx of block.transactions) { + const txHash = bufferToHex(tx.hash()) + if (allTxs || txHashes.includes(txHash)) { + const res = await vm.runTx({ block, tx }) + this.config.logger.info( + `Executed tx hash=${txHash} gasUsed=${res.gasUsed} from block num=${blockNumber}` + ) + count += 1 + } + } + if (count === 0) { + if (!allTxs) { + this.config.logger.warn(`Block number ${first} contains no txs with provided hashes`) + } else { + this.config.logger.info(`Block has 0 transactions (no execution)`) + } + } + } + } + } } diff --git a/packages/client/lib/execution/vmexecution.ts b/packages/client/lib/execution/vmexecution.ts index ca684f3c4ff..367ea55cc8a 100644 --- a/packages/client/lib/execution/vmexecution.ts +++ b/packages/client/lib/execution/vmexecution.ts @@ -43,7 +43,7 @@ export class VMExecution extends Execution { trie, }) - this.vm = new VM({ + this.vm = new (VM as any)({ common: this.config.execCommon, blockchain: this.chain.blockchain, stateManager, @@ -67,6 +67,7 @@ export class VMExecution extends Execution { * Initializes VM execution. Must be called before run() is called */ async open(): Promise { + await this.vm.init() const headBlock = await this.vm.blockchain.getIteratorHead() const { number } = headBlock.header const td = await this.vm.blockchain.getTotalDifficulty(headBlock.header.hash()) diff --git a/packages/client/lib/miner/miner.ts b/packages/client/lib/miner/miner.ts index a570628497c..3a7e522f30f 100644 --- a/packages/client/lib/miner/miner.ts +++ b/packages/client/lib/miner/miner.ts @@ -202,7 +202,7 @@ export class Miner { // Use a copy of the vm to not modify the existing state. // The state will be updated when the newly assembled block // is inserted into the canonical chain. - const vmCopy = this.execution.vm.copy() + const vmCopy = await this.execution.vm.copy() // Set the state root to ensure the resulting state // is based on the parent block's state diff --git a/packages/client/lib/rpc/modules/engine.ts b/packages/client/lib/rpc/modules/engine.ts index 534d7166cd4..1b73715b0fa 100644 --- a/packages/client/lib/rpc/modules/engine.ts +++ b/packages/client/lib/rpc/modules/engine.ts @@ -586,7 +586,7 @@ export class Engine { if (payloadAttributes) { const { timestamp, prevRandao, suggestedFeeRecipient } = payloadAttributes const parentBlock = this.chain.blocks.latest! - const payloadId = await this.pendingBlock.start(this.vm, parentBlock, { + const payloadId = await this.pendingBlock.start(await this.vm.copy(), parentBlock, { timestamp, mixHash: prevRandao, coinbase: suggestedFeeRecipient, diff --git a/packages/client/lib/rpc/modules/eth.ts b/packages/client/lib/rpc/modules/eth.ts index 57e860b822b..47149778883 100644 --- a/packages/client/lib/rpc/modules/eth.ts +++ b/packages/client/lib/rpc/modules/eth.ts @@ -456,7 +456,7 @@ export class Eth { throw new Error('missing vm') } - const vm = this._vm.copy() + const vm = await this._vm.copy() await vm.stateManager.setStateRoot(block.header.stateRoot) const { from, to, gas: gasLimit, gasPrice, value, data } = transaction @@ -514,7 +514,7 @@ export class Eth { throw new Error('missing vm') } - const vm = this._vm.copy() + const vm = await this._vm.copy() await vm.stateManager.setStateRoot(block.header.stateRoot) if (!transaction.gas) { @@ -563,7 +563,7 @@ export class Eth { throw new Error('missing vm') } - const vm = this._vm.copy() + const vm = await this._vm.copy() await vm.stateManager.setStateRoot(block.header.stateRoot) const account = await vm.stateManager.getAccount(address) return bigIntToHex(account.balance) @@ -632,7 +632,7 @@ export class Eth { throw new Error('missing vm') } - const vm = this._vm.copy() + const vm = await this._vm.copy() await vm.stateManager.setStateRoot(block.header.stateRoot) const address = Address.fromString(addressHex) @@ -655,7 +655,7 @@ export class Eth { throw new Error('missing vm') } - const vm = this._vm.copy() + const vm = await this._vm.copy() await vm.stateManager.setStateRoot(block.header.stateRoot) const address = Address.fromString(addressHex) @@ -703,7 +703,7 @@ export class Eth { throw new Error('missing vm') } - const vm = this._vm.copy() + const vm = await this._vm.copy() await vm.stateManager.setStateRoot(block.header.stateRoot) const address = Address.fromString(addressHex) @@ -771,7 +771,9 @@ export class Eth { : (tx as Transaction).gasPrice // Run tx through copied vm to get tx gasUsed and createdAddress - const runBlockResult = await this._vm!.copy().runBlock({ + const runBlockResult = await ( + await this._vm!.copy() + ).runBlock({ block, root: parentBlock.header.stateRoot, skipBlockValidation: true, @@ -966,7 +968,7 @@ export class Eth { throw new Error('missing vm') } - const vm = this._vm.copy() + const vm = await this._vm.copy() if (!('getProof' in vm.stateManager)) { throw new Error('getProof RPC method not supported with the StateManager provided') diff --git a/packages/client/lib/util/debug.ts b/packages/client/lib/util/debug.ts index 17edb4304bd..d9db31a7b5f 100644 --- a/packages/client/lib/util/debug.ts +++ b/packages/client/lib/util/debug.ts @@ -54,7 +54,7 @@ const main = async () => { validateBlocks: true, validateConsensus: false, }) - const vm = new VM({ stateManager, blockchain, common }) + const vm = await VM.create({ stateManager, blockchain, common }) await vm.runBlock({ block }) } diff --git a/packages/client/test/blockchain/chain.spec.ts b/packages/client/test/blockchain/chain.spec.ts index e5ddf8a633b..90cfeaae4f5 100644 --- a/packages/client/test/blockchain/chain.spec.ts +++ b/packages/client/test/blockchain/chain.spec.ts @@ -42,7 +42,7 @@ tape('[Chain]', (t) => { }) t.test('should detect unopened chain', async (t) => { - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false, }) @@ -116,7 +116,7 @@ tape('[Chain]', (t) => { t.test('should add block to chain', async (t) => { // TODO: add test cases with activated block validation - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false, }) diff --git a/packages/client/test/integration/peerpool.spec.ts b/packages/client/test/integration/peerpool.spec.ts index 7b9b759e15b..b3ddb4b5b9d 100644 --- a/packages/client/test/integration/peerpool.spec.ts +++ b/packages/client/test/integration/peerpool.spec.ts @@ -63,7 +63,7 @@ tape('[Integration:PeerPool]', async (t) => { t.test('should handle peer messages', async (t) => { const config = new Config({ transports: [] }) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false, }) diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index ea80a6579bf..9500e840920 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -66,6 +66,7 @@ tape('[Miner]', async (t) => { cliqueCheckRecentlySigned: () => false, // eslint-disable-next-line no-invalid-this copy: () => this.blockchain, + _init: async () => undefined, } } diff --git a/packages/client/test/rpc/eth/call.spec.ts b/packages/client/test/rpc/eth/call.spec.ts index 45a5cc659c1..d7b2bbc97bb 100644 --- a/packages/client/test/rpc/eth/call.spec.ts +++ b/packages/client/test/rpc/eth/call.spec.ts @@ -82,7 +82,9 @@ tape(`${method}: call with valid arguments`, async (t) => { estimateTx.getSenderAddress = () => { return address } - const { execResult } = await vm.copy().runTx({ + const { execResult } = await ( + await vm.copy() + ).runTx({ tx: estimateTx, skipNonce: true, skipBalance: true, diff --git a/packages/client/test/rpc/eth/estimateGas.spec.ts b/packages/client/test/rpc/eth/estimateGas.spec.ts index 3c9c28e3ce7..b3a7db46d30 100644 --- a/packages/client/test/rpc/eth/estimateGas.spec.ts +++ b/packages/client/test/rpc/eth/estimateGas.spec.ts @@ -83,7 +83,9 @@ tape(`${method}: call with valid arguments`, async (t) => { estimateTx.getSenderAddress = () => { return address } - const { gasUsed } = await vm.copy().runTx({ + const { gasUsed } = await ( + await vm.copy() + ).runTx({ tx: estimateTx, skipNonce: true, skipBalance: true, diff --git a/packages/client/test/rpc/helpers.ts b/packages/client/test/rpc/helpers.ts index cbeb95d9c42..77718ccf899 100644 --- a/packages/client/test/rpc/helpers.ts +++ b/packages/client/test/rpc/helpers.ts @@ -234,7 +234,7 @@ export async function runBlockWithTxs( const { vm } = execution // build block with tx const parentBlock = await chain.getLatestBlock() - const vmCopy = vm.copy() + const vmCopy = await vm.copy() const blockBuilder = await vmCopy.buildBlock({ parentBlock, headerData: { diff --git a/packages/client/test/sync/execution/vmexecution.spec.ts b/packages/client/test/sync/execution/vmexecution.spec.ts index 78c4acc7edb..12cf333af8f 100644 --- a/packages/client/test/sync/execution/vmexecution.spec.ts +++ b/packages/client/test/sync/execution/vmexecution.spec.ts @@ -11,7 +11,7 @@ import testnet from './../../testdata/common/testnet.json' tape('[VMExecution]', async (t) => { t.test('Initialization', async (t) => { - const vm = new VM() + const vm = await VM.create() const config = new Config({ vm, transports: [] }) const chain = new Chain({ config }) const exec = new VMExecution({ config, chain }) diff --git a/packages/vm/benchmarks/mainnetBlocks.ts b/packages/vm/benchmarks/mainnetBlocks.ts index c660cb87bcd..74cf14b317f 100644 --- a/packages/vm/benchmarks/mainnetBlocks.ts +++ b/packages/vm/benchmarks/mainnetBlocks.ts @@ -9,7 +9,9 @@ import { getPreState, getBlockchain, verifyResult } from './util' const BLOCK_FIXTURE = 'benchmarks/fixture/blocks-prestate.json' const runBlock = async (vm: VM, block: Block, receipts: any) => { - await vm.copy().runBlock({ + await ( + await vm.copy() + ).runBlock({ block, generate: true, skipBlockValidation: true, @@ -43,7 +45,7 @@ export async function mainnetBlocks(suite?: Benchmark.Suite, numSamples?: number const stateManager = await getPreState(preState, common) const blockchain = getBlockchain(blockhashes) as any - const vm = new VM({ stateManager, common, blockchain }) + const vm = await VM.create({ stateManager, common, blockchain }) if (suite) { suite.add(`Block ${blockNumber}`, async () => { diff --git a/packages/vm/benchmarks/mockchain.ts b/packages/vm/benchmarks/mockchain.ts index d8e46c6a693..c743d78f0f2 100644 --- a/packages/vm/benchmarks/mockchain.ts +++ b/packages/vm/benchmarks/mockchain.ts @@ -6,6 +6,8 @@ export default class Mockchain { this._hashes = {} } + async _init() {} + getBlock(num: bigint): any { const bhash = this._hashes[num.toString()] return { diff --git a/packages/vm/examples/run-blockchain.ts b/packages/vm/examples/run-blockchain.ts index 3cb5c4501db..552165c6843 100644 --- a/packages/vm/examples/run-blockchain.ts +++ b/packages/vm/examples/run-blockchain.ts @@ -34,7 +34,7 @@ async function main() { blockchain._ethash!.cacheDB = level('./.cachedb') } - const vm = new VM({ blockchain, common }) + const vm = await VM.create({ blockchain, common }) await setupPreConditions(vm, testData) @@ -42,7 +42,7 @@ async function main() { await vm.runBlockchain(blockchain) - const blockchainHead = await vm.blockchain.getHead() + const blockchainHead = await vm.blockchain.getIteratorHead() console.log('--- Finished processing the BlockChain ---') console.log('New head:', '0x' + blockchainHead.hash().toString('hex')) diff --git a/packages/vm/examples/run-code-browser.js b/packages/vm/examples/run-code-browser.js index 4bffb591e33..3c200ad8938 100644 --- a/packages/vm/examples/run-code-browser.js +++ b/packages/vm/examples/run-code-browser.js @@ -8,29 +8,33 @@ * using node-static or `python -mSimpleHTTPServer`). */ const BN = require('bn.js') -const VM = require('../dist').default +const VM = require('../dist.browser').default -// Create a new VM instance -// To explicity set the chain or hardfork use [Common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common#usage) -const vm = new VM() +const run = async () => { + // Create a new VM instance + // To explicity set the chain or hardfork use [Common](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common#usage) + const vm = await VM.create() -const STOP = '00' -const ADD = '01' -const PUSH1 = '60' + const STOP = '00' + const ADD = '01' + const PUSH1 = '60' -// Note that numbers added are hex values, so '20' would be '32' as decimal e.g. -const code = [PUSH1, '03', PUSH1, '05', ADD, STOP] + // Note that numbers added are hex values, so '20' would be '32' as decimal e.g. + const code = [PUSH1, '03', PUSH1, '05', ADD, STOP] -vm.on('step', function (data) { + vm.on('step', function (data) { console.log(`Opcode: ${data.opcode.name}\tStack: ${data.stack}`) -}) + }) -vm.runCode({ + vm.runCode({ code: Buffer.from(code.join(''), 'hex'), gasLimit: new BN(0xffff), -}) + }) .then((results) => { - console.log(`Returned: ${results.returnValue.toString('hex')}`) - console.log(`gasUsed : ${results.gasUsed.toString()}`) + console.log(`Returned: ${results.returnValue.toString('hex')}`) + console.log(`gasUsed : ${results.gasUsed.toString()}`) }) .catch(console.error) +} + +run() diff --git a/packages/vm/examples/run-solidity-contract.ts b/packages/vm/examples/run-solidity-contract.ts index b9557a05c99..4ef0cb8c632 100644 --- a/packages/vm/examples/run-solidity-contract.ts +++ b/packages/vm/examples/run-solidity-contract.ts @@ -157,7 +157,7 @@ async function main() { 'hex' ) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const accountAddress = Address.fromPrivateKey(accountPk) console.log('Account: ', accountAddress.toString()) diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index fb7ff1f307c..7837698cdf3 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -20,11 +20,9 @@ import { AsyncDynamicGasHandler, SyncDynamicGasHandler } from './evm/opcodes/gas // very ugly way to detect if we are running in a browser const isBrowser = new Function('try {return this===window;}catch(e){ return false;}') let mcl: any -let mclInitPromise: any if (!isBrowser()) { mcl = require('mcl-wasm') - mclInitPromise = mcl.init(mcl.BLS12_381) } /** @@ -80,7 +78,7 @@ export interface VMOpts { stateManager?: StateManager /** * A {@link SecureTrie} instance for the state tree (ignored if stateManager is passed) - * @deprecated - will be removed in next major version release + * @deprecated will be removed in next major version release */ state?: Trie /** @@ -238,9 +236,13 @@ export default class VM extends AsyncEventEmitter { /** * Instantiates a new {@link VM} Object. + * + * @deprecated The direct usage of this constructor is discouraged since + * non-finalized async initialization might lead to side effects. Please + * use the async {@link VM.create} constructor instead (same API). * @param opts */ - constructor(opts: VMOpts = {}) { + protected constructor(opts: VMOpts = {}) { super() this._opts = opts @@ -311,7 +313,7 @@ export default class VM extends AsyncEventEmitter { }) } - this.blockchain = opts.blockchain ?? new Blockchain({ common: this._common }) + this.blockchain = opts.blockchain ?? new (Blockchain as any)({ common: this._common }) this._allowUnlimitedContractSize = opts.allowUnlimitedContractSize ?? false @@ -343,11 +345,8 @@ export default class VM extends AsyncEventEmitter { } async init(): Promise { - if (this._isInitialized) { - return - } - - await this.blockchain.initPromise + if (this._isInitialized) return + await (this.blockchain as any)._init() if (!this._opts.stateManager) { if (this._opts.activateGenesisState) { @@ -376,12 +375,13 @@ export default class VM extends AsyncEventEmitter { throw new Error('EIP-2537 is currently not supported in browsers') } else { const mcl = this._mcl - await mclInitPromise // ensure that mcl is initialized. + await mcl.init(mcl.BLS12_381) // ensure that mcl is initialized. mcl.setMapToMode(mcl.IRTF) // set the right map mode; otherwise mapToG2 will return wrong values. mcl.verifyOrderG1(1) // subgroup checks for G1 mcl.verifyOrderG2(1) // subgroup checks for G2 } } + this._isInitialized = true } @@ -393,7 +393,6 @@ export default class VM extends AsyncEventEmitter { * @param blockchain - A {@link Blockchain} object to process */ async runBlockchain(blockchain?: Blockchain, maxBlocks?: number): Promise { - await this.init() return runBlockchain.bind(this)(blockchain, maxBlocks) } @@ -408,7 +407,6 @@ export default class VM extends AsyncEventEmitter { * - `generate`: false */ async runBlock(opts: RunBlockOpts): Promise { - await this.init() return runBlock.bind(this)(opts) } @@ -422,7 +420,6 @@ export default class VM extends AsyncEventEmitter { * @param {RunTxOpts} opts */ async runTx(opts: RunTxOpts): Promise { - await this.init() return runTx.bind(this)(opts) } @@ -434,7 +431,6 @@ export default class VM extends AsyncEventEmitter { * @param {RunCallOpts} opts */ async runCall(opts: RunCallOpts): Promise { - await this.init() return runCall.bind(this)(opts) } @@ -446,7 +442,6 @@ export default class VM extends AsyncEventEmitter { * @param {RunCodeOpts} opts */ async runCode(opts: RunCodeOpts): Promise { - await this.init() return runCode.bind(this)(opts) } @@ -465,7 +460,6 @@ export default class VM extends AsyncEventEmitter { * - {@link BlockBuilder.revert} */ async buildBlock(opts: BuildBlockOpts): Promise { - await this.init() return buildBlock.bind(this)(opts) } @@ -484,8 +478,8 @@ export default class VM extends AsyncEventEmitter { /** * Returns a copy of the {@link VM} instance. */ - copy(): VM { - return new VM({ + async copy(): Promise { + return VM.create({ stateManager: this.stateManager.copy(), blockchain: this.blockchain.copy(), common: this._common.copy(), diff --git a/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts b/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts index fc062493ae0..0af0902196f 100644 --- a/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts @@ -35,7 +35,7 @@ tape('Constantinople: EIP-1283', async (t) => { const key = setLengthLeft(bigIntToBuffer(BigInt(0)), 32) for (const testCase of testCases) { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Constantinople }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const account = createAccount(BigInt(0), BigInt(0)) await vm.stateManager.putAccount(addr, account) diff --git a/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts b/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts index 18b192f1b70..01f40c03c96 100644 --- a/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-1559-FeeMarket.spec.ts @@ -73,7 +73,7 @@ tape('EIP1559 tests', (t) => { } ) const block = makeBlock(GWEI, tx, 2) - const vm = new VM({ common }) + const vm = await VM.create({ common }) let account = await vm.stateManager.getAccount(sender) const balance = GWEI * BigInt(21000) * BigInt(10) account.balance = balance @@ -173,7 +173,7 @@ tape('EIP1559 tests', (t) => { } ) const block = makeBlock(GWEI, tx, 2) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const balance = GWEI * BigInt(210000) * BigInt(10) await vm.stateManager.modifyAccountFields(sender, { balance }) diff --git a/packages/vm/tests/api/EIPs/eip-2315.spec.ts b/packages/vm/tests/api/EIPs/eip-2315.spec.ts index 670e7d7d915..5a68ed23591 100644 --- a/packages/vm/tests/api/EIPs/eip-2315.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2315.spec.ts @@ -7,7 +7,7 @@ tape('Berlin: EIP 2315 tests', (t) => { const runTest = async function (test: any, st: tape.Test) { let i = 0 - const vm = new VM({ common }) + const vm = await VM.create({ common }) vm.on('step', function (step: any) { if (test.steps.length) { diff --git a/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts b/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts index 66e2e55dd83..cae1a81de53 100644 --- a/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts @@ -21,7 +21,7 @@ tape('EIP-2537 BLS tests', (t) => { return st.end() } const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.MuirGlacier }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) for (const address of precompiles) { const to = new Address(Buffer.from(address, 'hex')) @@ -52,7 +52,7 @@ tape('EIP-2537 BLS tests', (t) => { return st.end() } const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Byzantium, eips: [2537] }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) for (const address of precompiles) { const to = new Address(Buffer.from(address, 'hex')) @@ -90,7 +90,7 @@ tape('EIP-2537 BLS tests', (t) => { return st.end() } const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin, eips: [2537] }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) const BLS12G2MultiExp = getActivePrecompiles(common).get( '000000000000000000000000000000000000000f' )! diff --git a/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts b/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts index 4bc87ba72f0..9f371f25c81 100644 --- a/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts @@ -9,7 +9,7 @@ const testData = require('../testdata/eip-2565.json') tape('EIP-2565 ModExp gas cost tests', (t) => { t.test('Test return data, gas cost and execution status against testdata', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Byzantium, eips: [2565] }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) for (const test of testData) { const testName = test.Name diff --git a/packages/vm/tests/api/EIPs/eip-2929.spec.ts b/packages/vm/tests/api/EIPs/eip-2929.spec.ts index 1b7f7f53e6d..a23aa2e6cf5 100644 --- a/packages/vm/tests/api/EIPs/eip-2929.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2929.spec.ts @@ -17,7 +17,7 @@ tape('EIP 2929: gas cost tests', (t) => { const runTest = async function (test: any, st: tape.Test) { let i = 0 let currentGas = initialGas - const vm = new VM({ common }) + const vm = await VM.create({ common }) vm.on('step', function (step: any) { const gasUsed = currentGas - step.gasLeft @@ -75,7 +75,7 @@ tape('EIP 2929: gas cost tests', (t) => { ) const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin, eips: [2929] }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) await vm.stateManager.putContractCode(contractAddress, Buffer.from(code, 'hex')) // setup the contract code diff --git a/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts b/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts index 9646bc15e0e..004e3445def 100644 --- a/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts @@ -46,7 +46,8 @@ tape('EIP-2930 Optional Access Lists tests', (t) => { }, { common } ).sign(privateKey) - const vm = new VM({ common }) + + const vm = await VM.create({ common }) // contract code PUSH1 0x00 SLOAD STOP await vm.stateManager.putContractCode(contractAddress, Buffer.from('60005400', 'hex')) diff --git a/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts b/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts index 28e761c731d..f724fe61962 100644 --- a/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts @@ -73,7 +73,7 @@ tape('EIP3198 tests', (t) => { } ) const block = makeBlock(fee, tx, 2) - const vm = new VM({ common }) + const vm = await VM.create({ common }) await vm.stateManager.modifyAccountFields(sender, { balance: ETHER }) // Track stack diff --git a/packages/vm/tests/api/EIPs/eip-3529.spec.ts b/packages/vm/tests/api/EIPs/eip-3529.spec.ts index 2f9757c0f7b..17c45918b35 100644 --- a/packages/vm/tests/api/EIPs/eip-3529.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3529.spec.ts @@ -112,7 +112,7 @@ tape('EIP-3529 tests', (t) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin, eips: [3529] }) t.test('should verify EIP test cases', async (st) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) let gasRefund: bigint let gasLeft: bigint @@ -159,7 +159,7 @@ tape('EIP-3529 tests', (t) => { }) t.test('should not refund selfdestructs', async (st) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = Transaction.fromTxData({ data: '0x6000ff', @@ -182,7 +182,7 @@ tape('EIP-3529 tests', (t) => { * Then, it resets all these 100 slots back to 0. This is to check if the * max gas refund is respected. */ - const vm = new VM({ common }) + const vm = await VM.create({ common }) let startGas: bigint let finalGas: bigint diff --git a/packages/vm/tests/api/EIPs/eip-3540-evm-object-format.spec.ts b/packages/vm/tests/api/EIPs/eip-3540-evm-object-format.spec.ts index 4b4a34eaa1c..03d81b56ace 100644 --- a/packages/vm/tests/api/EIPs/eip-3540-evm-object-format.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3540-evm-object-format.spec.ts @@ -4,6 +4,7 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' import { Address, privateToAddress } from 'ethereumjs-util' import * as eof from '../../../src/evm/opcodes/eof' + const pkey = Buffer.from('20'.repeat(32), 'hex') const GWEI = BigInt('1000000000') const sender = new Address(privateToAddress(pkey)) @@ -63,7 +64,7 @@ tape('EIP 3540 tests', (t) => { hardfork: Hardfork.London, eips: [3540], }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const account = await vm.stateManager.getAccount(sender) const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance @@ -79,7 +80,7 @@ tape('EIP 3540 tests', (t) => { }) t.test('invalid EOF format / contract creation', async (st) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const account = await vm.stateManager.getAccount(sender) const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance @@ -149,7 +150,7 @@ tape('ensure invalid EOF initcode in EIP-3540 does not consume all gas', (t) => hardfork: Hardfork.London, eips: [3540], }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const account = await vm.stateManager.getAccount(sender) const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance @@ -169,7 +170,7 @@ tape('ensure invalid EOF initcode in EIP-3540 does not consume all gas', (t) => hardfork: Hardfork.London, eips: [3540], }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const account = await vm.stateManager.getAccount(sender) const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance @@ -190,7 +191,7 @@ tape('ensure invalid EOF initcode in EIP-3540 does not consume all gas', (t) => hardfork: Hardfork.London, eips: [3540], }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const account = await vm.stateManager.getAccount(sender) const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance diff --git a/packages/vm/tests/api/EIPs/eip-3541.spec.ts b/packages/vm/tests/api/EIPs/eip-3541.spec.ts index 8615f5a9780..115be0ffad5 100644 --- a/packages/vm/tests/api/EIPs/eip-3541.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3541.spec.ts @@ -18,7 +18,7 @@ tape('EIP 3541 tests', (t) => { gasLimit: 1000000, }).sign(pkey) - let vm = new VM({ common }) + let vm = await VM.create({ common }) let result = await vm.runTx({ tx }) let created = result.createdAddress @@ -45,7 +45,7 @@ tape('EIP 3541 tests', (t) => { // check if we can deposit a contract on non-EIP3541 chains - vm = new VM({ common: commonNoEIP3541 }) + vm = await VM.create({ common: commonNoEIP3541 }) const tx2 = Transaction.fromTxData({ data: '0x7FEF0000000000000000000000000000000000000000000000000000000000000060005260206000F3', gasLimit: 1000000, @@ -68,7 +68,7 @@ tape('EIP 3541 tests', (t) => { gasLimit: 1000000, }).sign(pkey) - const vm = new VM({ common }) + const vm = await VM.create({ common }) let address: Address vm.on('step', (step: InterpreterStep) => { @@ -105,7 +105,7 @@ tape('EIP 3541 tests', (t) => { gasLimit: 1000000, }).sign(pkey) - const vm = new VM({ common }) + const vm = await VM.create({ common }) let address: Address vm.on('step', (step: InterpreterStep) => { diff --git a/packages/vm/tests/api/EIPs/eip-3607.spec.ts b/packages/vm/tests/api/EIPs/eip-3607.spec.ts index de7b56cb5ab..ed0520718e2 100644 --- a/packages/vm/tests/api/EIPs/eip-3607.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3607.spec.ts @@ -10,7 +10,7 @@ tape('EIP-3607 tests', (t) => { const precompileAddr = Address.fromString('0x0000000000000000000000000000000000000001') t.test('should reject txs from senders with deployed code when EIP is enabled', async (st) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) await vm.stateManager.putContractCode(precompileAddr, Buffer.alloc(32, 1)) const tx = Transaction.fromTxData({ gasLimit: 100000 }, { freeze: false }) tx.getSenderAddress = () => precompileAddr @@ -30,7 +30,7 @@ tape('EIP-3607 tests', (t) => { t.test( 'should not reject txs from senders with deployed code when EIP is not enabled', async (st) => { - const vm = new VM({ common: commonNoEIP3607 }) + const vm = await VM.create({ common: commonNoEIP3607 }) await vm.stateManager.putContractCode(precompileAddr, Buffer.alloc(32, 1)) const tx = Transaction.fromTxData({ gasLimit: 100000 }, { freeze: false }) tx.getSenderAddress = () => precompileAddr diff --git a/packages/vm/tests/api/EIPs/eip-3670-eof-code-validation.spec.ts b/packages/vm/tests/api/EIPs/eip-3670-eof-code-validation.spec.ts index 3c552c48c13..fadfc89e2fa 100644 --- a/packages/vm/tests/api/EIPs/eip-3670-eof-code-validation.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3670-eof-code-validation.spec.ts @@ -57,7 +57,7 @@ tape('EIP 3670 tests', (t) => { }) t.test('valid contract code transactions', async (st) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const account = await vm.stateManager.getAccount(sender) const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance @@ -73,7 +73,7 @@ tape('EIP 3670 tests', (t) => { }) t.test('invalid contract code transactions', async (st) => { - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) const account = await vm.stateManager.getAccount(sender) const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance diff --git a/packages/vm/tests/api/EIPs/eip-3855.spec.ts b/packages/vm/tests/api/EIPs/eip-3855.spec.ts index 85361ebc4eb..b493f86a4c7 100644 --- a/packages/vm/tests/api/EIPs/eip-3855.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3855.spec.ts @@ -13,7 +13,7 @@ tape('EIP 3541 tests', (t) => { }) t.test('should correctly use push0 opcode', async (st) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) let stack: bigint[] vm.on('step', (e: InterpreterStep) => { @@ -35,7 +35,7 @@ tape('EIP 3541 tests', (t) => { }) t.test('should correctly use push0 to create a stack with stack limit length', async (st) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) let stack: bigint[] = [] vm.on('step', (e: InterpreterStep) => { @@ -60,7 +60,7 @@ tape('EIP 3541 tests', (t) => { }) t.test('should correctly use push0 to create a stack with stack limit + 1 length', async (st) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const depth = common.param('vm', 'stackLimit') + 1 @@ -74,7 +74,7 @@ tape('EIP 3541 tests', (t) => { }) t.test('push0 is not available if EIP3855 is not activated', async (st) => { - const vm = new VM({ common: commonNoEIP3855 }) + const vm = await VM.create({ common: commonNoEIP3855 }) const result = await vm.runCode({ code: Buffer.from('5F', 'hex'), diff --git a/packages/vm/tests/api/EIPs/eip-3860.spec.ts b/packages/vm/tests/api/EIPs/eip-3860.spec.ts index ab16d859c36..77aec6ceb77 100644 --- a/packages/vm/tests/api/EIPs/eip-3860.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3860.spec.ts @@ -15,7 +15,7 @@ tape('EIP 3860 tests', (t) => { }) t.test('EIP-3860 tests', async (st) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const account = await vm.stateManager.getAccount(sender) const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance diff --git a/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts b/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts index b4c0f891056..32a10ac8907 100644 --- a/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts @@ -8,7 +8,7 @@ import { bufferToBigInt } from 'ethereumjs-util' tape('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', (t) => { t.test('should return the right values', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const genesis = await vm.blockchain.getLatestBlock() const header = { diff --git a/packages/vm/tests/api/buildBlock.spec.ts b/packages/vm/tests/api/buildBlock.spec.ts index 595a2a20fc2..588ec2cf737 100644 --- a/packages/vm/tests/api/buildBlock.spec.ts +++ b/packages/vm/tests/api/buildBlock.spec.ts @@ -17,7 +17,7 @@ tape('BlockBuilder', async (t) => { const address = Address.fromString('0xccfd725760a68823ff1e062f4cc97e1360e8d997') await setBalance(vm, address) - const vmCopy = vm.copy() + const vmCopy = await vm.copy() const blockBuilder = await vm.buildBlock({ parentBlock: genesisBlock, @@ -270,7 +270,7 @@ tape('BlockBuilder', async (t) => { const genesisBlock = Block.genesis({ header: { gasLimit: 50000 } }, { common }) const blockchain = await Blockchain.create({ genesisBlock, common, validateConsensus: false }) const vm = await VM.create({ common, blockchain }) - const vmCopy = vm.copy() + const vmCopy = await vm.copy() const blockBuilder = await vm.buildBlock({ parentBlock: genesisBlock, @@ -300,7 +300,7 @@ tape('BlockBuilder', async (t) => { const address = Address.fromString('0xccfd725760a68823ff1e062f4cc97e1360e8d997') await setBalance(vm, address) - const vmCopy = vm.copy() + const vmCopy = await vm.copy() const blockBuilder = await vm.buildBlock({ parentBlock: genesisBlock, diff --git a/packages/vm/tests/api/events.spec.ts b/packages/vm/tests/api/events.spec.ts index e7f0725b87d..76d9a4150c1 100644 --- a/packages/vm/tests/api/events.spec.ts +++ b/packages/vm/tests/api/events.spec.ts @@ -8,7 +8,7 @@ tape('VM events', (t) => { const privKey = toBuffer('0xa5737ecdc1b89ca0091647e727ba082ed8953f29182e94adc397210dda643b07') t.test('should emit the Block before running it', async (st) => { - const vm = new VM() + const vm = await VM.create() let emitted vm.on('beforeBlock', (val: any) => { @@ -29,7 +29,7 @@ tape('VM events', (t) => { }) t.test('should emit a RunBlockResult after running a block', async (st) => { - const vm = new VM() + const vm = await VM.create() let emitted vm.on('afterBlock', (val: any) => { @@ -51,7 +51,7 @@ tape('VM events', (t) => { }) t.test('should emit the Transaction before running it', async (st) => { - const vm = new VM() + const vm = await VM.create() let emitted vm.on('beforeTx', (val: any) => { @@ -72,7 +72,7 @@ tape('VM events', (t) => { }) t.test('should emit RunTxResult after running a tx', async (st) => { - const vm = new VM() + const vm = await VM.create() const address = Address.fromPrivateKey(privKey) await vm.stateManager.putAccount(address, new Account(BigInt(0), BigInt(0x11111111))) let emitted: any @@ -95,7 +95,7 @@ tape('VM events', (t) => { }) t.test('should emit the Message before running it', async (st) => { - const vm = new VM() + const vm = await VM.create() const address = Address.fromPrivateKey(privKey) await vm.stateManager.putAccount(address, new Account(BigInt(0), BigInt(0x11111111))) let emitted: any @@ -119,7 +119,7 @@ tape('VM events', (t) => { }) t.test('should emit EVMResult after running a message', async (st) => { - const vm = new VM() + const vm = await VM.create() const address = Address.fromPrivateKey(privKey) await vm.stateManager.putAccount(address, new Account(BigInt(0), BigInt(0x11111111))) let emitted: any @@ -142,7 +142,7 @@ tape('VM events', (t) => { }) t.test('should emit InterpreterStep on each step', async (st) => { - const vm = new VM() + const vm = await VM.create() let lastEmitted: any vm.on('step', (val: any) => { @@ -166,7 +166,7 @@ tape('VM events', (t) => { }) t.test('should emit a NewContractEvent on new contracts', async (st) => { - const vm = new VM() + const vm = await VM.create() let emitted: any vm.on('newContract', (val: any) => { diff --git a/packages/vm/tests/api/evm/customOpcodes.spec.ts b/packages/vm/tests/api/evm/customOpcodes.spec.ts index c9cb035e5b1..7414760d709 100644 --- a/packages/vm/tests/api/evm/customOpcodes.spec.ts +++ b/packages/vm/tests/api/evm/customOpcodes.spec.ts @@ -22,7 +22,7 @@ tape('VM: custom opcodes', (t) => { } t.test('should add custom opcodes to the VM', async (st) => { - const vm = new VM({ + const vm = await VM.create({ customOpcodes: [testOpcode], }) const gas = 123456 @@ -42,7 +42,7 @@ tape('VM: custom opcodes', (t) => { }) t.test('should delete opcodes from the VM', async (st) => { - const vm = new VM({ + const vm = await VM.create({ customOpcodes: [{ opcode: 0x20 }], // deletes KECCAK opcode }) const gas = BigInt(123456) @@ -56,7 +56,7 @@ tape('VM: custom opcodes', (t) => { t.test('should not override default opcodes', async (st) => { // This test ensures that always the original opcode map is used // Thus, each time you recreate a VM, it is in a clean state - const vm = new VM({ + const vm = await VM.create({ customOpcodes: [{ opcode: 0x01 }], // deletes ADD opcode }) const gas = BigInt(123456) @@ -66,7 +66,7 @@ tape('VM: custom opcodes', (t) => { }) st.ok(res.gasUsed === gas, 'succesfully deleted opcode') - const vmDefault = new VM() + const vmDefault = await VM.create() // PUSH 04 // PUSH 01 @@ -85,7 +85,7 @@ tape('VM: custom opcodes', (t) => { t.test('should override opcodes in the VM', async (st) => { testOpcode.opcode = 0x20 // Overrides KECCAK - const vm = new VM({ + const vm = await VM.create({ customOpcodes: [testOpcode], }) const gas = 123456 diff --git a/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts b/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts index 47b0e5b6261..1a671c68f1f 100644 --- a/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts @@ -6,7 +6,7 @@ import { getActivePrecompiles } from '../../../../src/evm/precompiles' tape('Precompiles: ECADD', (t) => { t.test('ECADD', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) const addressStr = '0000000000000000000000000000000000000006' const ECADD = getActivePrecompiles(common).get(addressStr)! diff --git a/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts b/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts index 19c64215399..f19b15f957b 100644 --- a/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts @@ -6,7 +6,7 @@ import { getActivePrecompiles } from '../../../../src/evm/precompiles' tape('Precompiles: ECMUL', (t) => { t.test('ECMUL', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) const ECMUL = getActivePrecompiles(common).get('0000000000000000000000000000000000000007')! const result = await ECMUL({ diff --git a/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts b/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts index 6759fd17bd7..4729de0e3d3 100644 --- a/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts @@ -6,7 +6,7 @@ import { getActivePrecompiles } from '../../../../src/evm/precompiles' tape('Precompiles: ECPAIRING', (t) => { t.test('ECPAIRING', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) const addressStr = '0000000000000000000000000000000000000008' const ECPAIRING = getActivePrecompiles(common).get(addressStr)! diff --git a/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts b/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts index f76c2a7591c..5676b082bc1 100644 --- a/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts @@ -20,7 +20,7 @@ tape('Precompiles: hardfork availability', (t) => { st.pass('ECPAIRING available in petersburg') } - let vm = new VM({ common: commonByzantium }) + let vm = await VM.create({ common: commonByzantium }) let result = await vm.runCall({ caller: Address.zero(), gasLimit: BigInt(0xffffffffff), @@ -39,7 +39,7 @@ tape('Precompiles: hardfork availability', (t) => { st.pass('ECPAIRING available in petersburg') } - vm = new VM({ common: commonPetersburg }) + vm = await VM.create({ common: commonPetersburg }) result = await vm.runCall({ caller: Address.zero(), gasLimit: BigInt(0xffffffffff), @@ -59,7 +59,7 @@ tape('Precompiles: hardfork availability', (t) => { st.pass('ECPAIRING not available in homestead') } - vm = new VM({ common: commonHomestead }) + vm = await VM.create({ common: commonHomestead }) result = await vm.runCall({ caller: Address.zero(), diff --git a/packages/vm/tests/api/evm/stack.spec.ts b/packages/vm/tests/api/evm/stack.spec.ts index a1d316cd957..87e2de36d1e 100644 --- a/packages/vm/tests/api/evm/stack.spec.ts +++ b/packages/vm/tests/api/evm/stack.spec.ts @@ -126,7 +126,7 @@ tape('Stack', (t) => { t.test('stack items should not change if they are DUPed', async (st) => { const caller = new Address(Buffer.from('00000000000000000000000000000000000000ee', 'hex')) const addr = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) - const vm = new VM() + const vm = await VM.create() const account = createAccount(BigInt(0), BigInt(0)) const code = '60008080808060013382F15060005260206000F3' const expectedReturnValue = setLengthLeft(bigIntToBuffer(BigInt(0)), 32) diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index 76cc37b1a09..70b1a47c941 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -32,8 +32,8 @@ import { Buffer } from 'buffer' // eslint-disable-line @typescript-eslint/no-unu */ tape('VM -> basic instantiation / boolean switches', (t) => { - t.test('should instantiate without params', (st) => { - const vm = new VM() + t.test('should instantiate without params', async (st) => { + const vm = await VM.create() st.ok(vm.stateManager) st.deepEqual( (vm.stateManager as DefaultStateManager)._trie.root, @@ -45,8 +45,7 @@ tape('VM -> basic instantiation / boolean switches', (t) => { }) t.test('should be able to activate precompiles', async (st) => { - const vm = new VM({ activatePrecompiles: true }) - await vm.init() + const vm = await VM.create({ activatePrecompiles: true }) st.notDeepEqual( (vm.stateManager as DefaultStateManager)._trie.root, KECCAK256_RLP, @@ -98,13 +97,12 @@ tape('VM -> common (chain, HFs, EIPs)', (t) => { t.test('should only accept valid chain and fork', async (st) => { let common = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) - let vm = new VM({ common }) - await vm.init() + let vm = await VM.create({ common }) st.equal((vm.stateManager as DefaultStateManager)._common.param('gasPrices', 'ecAdd'), 500) try { common = new Common({ chain: 'mainchain', hardfork: Hardfork.Homestead }) - vm = new VM({ common }) + vm = await VM.create({ common }) st.fail('should have failed for invalid chain') } catch (e: any) { st.ok(e.message.includes('not supported')) @@ -119,9 +117,12 @@ tape('VM -> common (chain, HFs, EIPs)', (t) => { return st.end() } const common = new Common({ chain: Chain.Mainnet, eips: [2537] }) - st.doesNotThrow(() => { - new VM({ common }) - }) + try { + await VM.create({ common }) + st.pass('did not throw') + } catch (error) { + st.fail('should not have thrown') + } st.end() }) @@ -180,8 +181,7 @@ tape('VM -> hardforkByBlockNumber, hardforkByTD, state (deprecated), blockchain' t.test('should work with trie (state) provided', async (st) => { const trie = new Trie() - const vm = new VM({ state: trie, activatePrecompiles: true }) - await vm.init() + const vm = await VM.create({ state: trie, activatePrecompiles: true }) st.notDeepEqual( (vm.stateManager as DefaultStateManager)._trie.root, KECCAK256_RLP, @@ -191,8 +191,7 @@ tape('VM -> hardforkByBlockNumber, hardforkByTD, state (deprecated), blockchain' }) t.test('should instantiate', async (st) => { - const vm = setupVM() - await vm.init() + const vm = await setupVM() st.deepEqual( (vm.stateManager as DefaultStateManager)._trie.root, KECCAK256_RLP, @@ -202,15 +201,14 @@ tape('VM -> hardforkByBlockNumber, hardforkByTD, state (deprecated), blockchain' }) t.test('should pass the correct Common object when copying the VM', async (st) => { - const vm = setupVM({ + const vm = await setupVM({ common: new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }), }) - await vm.init() st.equal(vm._common.chainName(), 'ropsten') st.equal(vm._common.hardfork(), 'byzantium') - const copiedVM = vm.copy() + const copiedVM = await vm.copy() st.equal(copiedVM._common.chainName(), 'ropsten') st.equal(copiedVM._common.hardfork(), 'byzantium') diff --git a/packages/vm/tests/api/istanbul/eip-1108.spec.ts b/packages/vm/tests/api/istanbul/eip-1108.spec.ts index c62380a9575..d851430b302 100644 --- a/packages/vm/tests/api/istanbul/eip-1108.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-1108.spec.ts @@ -6,7 +6,7 @@ import { getActivePrecompiles } from '../../../src/evm/precompiles' tape('Istanbul: EIP-1108 tests', (t) => { t.test('ECADD', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const address = '0000000000000000000000000000000000000006' const ECADD = getActivePrecompiles(common).get(address)! @@ -23,7 +23,7 @@ tape('Istanbul: EIP-1108 tests', (t) => { t.test('ECMUL', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const address = '0000000000000000000000000000000000000007' const ECMUL = getActivePrecompiles(common).get(address)! @@ -40,7 +40,7 @@ tape('Istanbul: EIP-1108 tests', (t) => { t.test('ECPAIRING', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const address = '0000000000000000000000000000000000000008' const ECPAIRING = getActivePrecompiles(common).get(address)! diff --git a/packages/vm/tests/api/istanbul/eip-1344.spec.ts b/packages/vm/tests/api/istanbul/eip-1344.spec.ts index 6b39079c4e3..a8a4ca92b96 100644 --- a/packages/vm/tests/api/istanbul/eip-1344.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-1344.spec.ts @@ -23,7 +23,7 @@ tape('Istanbul: EIP-1344', async (t) => { for (const testCase of testCases) { const { chain, hardfork } = testCase const common = new Common({ chain, hardfork }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) try { const res = await vm.runCode(runCodeArgs) if (testCase.err) { diff --git a/packages/vm/tests/api/istanbul/eip-152.spec.ts b/packages/vm/tests/api/istanbul/eip-152.spec.ts index 2174cdaea1d..249fd3cbe4a 100644 --- a/packages/vm/tests/api/istanbul/eip-152.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-152.spec.ts @@ -78,7 +78,7 @@ const testCases = [ ] tape('Istanbul: EIP-152', (t) => { - t.test('Blake2f', (st) => { + t.test('Blake2f', async (st) => { // eslint-disable-next-line no-undef if ((globalThis).navigator?.userAgent.includes('Firefox')) { // TODO: investigate why this test hangs in karma with firefox @@ -86,7 +86,7 @@ tape('Istanbul: EIP-152', (t) => { } const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) for (const testCase of failingTestCases) { st.comment(testCase.name) diff --git a/packages/vm/tests/api/istanbul/eip-1884.spec.ts b/packages/vm/tests/api/istanbul/eip-1884.spec.ts index 88956d1c6fe..fefaede2f5a 100644 --- a/packages/vm/tests/api/istanbul/eip-1884.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-1884.spec.ts @@ -24,7 +24,7 @@ tape('Istanbul: EIP-1884', async (t) => { for (const testCase of testCases) { const { chain, hardfork } = testCase const common = new Common({ chain, hardfork }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const balance = testCase.selfbalance ? BigInt(testCase.selfbalance) : undefined const account = createAccount(BigInt(0), balance) diff --git a/packages/vm/tests/api/istanbul/eip-2200.spec.ts b/packages/vm/tests/api/istanbul/eip-2200.spec.ts index bea79d4a53d..6d47e76a639 100644 --- a/packages/vm/tests/api/istanbul/eip-2200.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-2200.spec.ts @@ -48,7 +48,7 @@ tape('Istanbul: EIP-2200', async (t) => { for (const testCase of testCases) { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const account = createAccount(BigInt(0), BigInt(0)) await vm.stateManager.putAccount(addr, account) diff --git a/packages/vm/tests/api/muirGlacier/index.spec.ts b/packages/vm/tests/api/muirGlacier/index.spec.ts index 99327b14e51..be8f021d1c8 100644 --- a/packages/vm/tests/api/muirGlacier/index.spec.ts +++ b/packages/vm/tests/api/muirGlacier/index.spec.ts @@ -4,9 +4,9 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../../src' tape('General MuirGlacier VM tests', (t) => { - t.test('should accept muirGlacier harfork option for supported chains', (st) => { + t.test('should accept muirGlacier harfork option for supported chains', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.MuirGlacier }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) st.ok(vm.stateManager) st.deepEqual((vm.stateManager)._trie.root, KECCAK256_RLP, 'it has default trie') st.end() diff --git a/packages/vm/tests/api/opcodes.spec.ts b/packages/vm/tests/api/opcodes.spec.ts index 86744fce019..c370e3fb5cf 100644 --- a/packages/vm/tests/api/opcodes.spec.ts +++ b/packages/vm/tests/api/opcodes.spec.ts @@ -6,9 +6,9 @@ tape('VM -> getActiveOpcodes()', (t) => { const CHAINID = 0x46 //istanbul opcode const BEGINSUB = 0x5c // EIP-2315 opcode - t.test('should not expose opcodes from a follow-up HF (istanbul -> petersburg)', (st) => { + t.test('should not expose opcodes from a follow-up HF (istanbul -> petersburg)', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) st.equal( vm.getActiveOpcodes().get(CHAINID), undefined, @@ -17,9 +17,9 @@ tape('VM -> getActiveOpcodes()', (t) => { st.end() }) - t.test('should expose opcodes when HF is active (>= istanbul)', (st) => { + t.test('should expose opcodes when HF is active (>= istanbul)', async (st) => { let common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - let vm = new VM({ common }) + let vm = await VM.create({ common }) st.equal( vm.getActiveOpcodes().get(CHAINID)!.name, 'CHAINID', @@ -27,7 +27,7 @@ tape('VM -> getActiveOpcodes()', (t) => { ) common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.MuirGlacier }) - vm = new VM({ common }) + vm = await VM.create({ common }) st.equal( vm.getActiveOpcodes().get(CHAINID)!.name, 'CHAINID', @@ -37,9 +37,9 @@ tape('VM -> getActiveOpcodes()', (t) => { st.end() }) - t.test('should expose opcodes when EIP is active', (st) => { + t.test('should expose opcodes when EIP is active', async (st) => { let common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul, eips: [2315] }) - let vm = new VM({ common }) + let vm = await VM.create({ common }) st.equal( vm.getActiveOpcodes().get(BEGINSUB)!.name, 'BEGINSUB', @@ -47,7 +47,7 @@ tape('VM -> getActiveOpcodes()', (t) => { ) common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - vm = new VM({ common }) + vm = await VM.create({ common }) st.equal( vm.getActiveOpcodes().get(BEGINSUB), undefined, @@ -59,7 +59,7 @@ tape('VM -> getActiveOpcodes()', (t) => { t.test('should update opcodes on a hardfork change', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) common.setHardfork(Hardfork.Byzantium) st.equal( diff --git a/packages/vm/tests/api/runBlock.spec.ts b/packages/vm/tests/api/runBlock.spec.ts index 9b20b60b3d6..afdc1cd84ea 100644 --- a/packages/vm/tests/api/runBlock.spec.ts +++ b/packages/vm/tests/api/runBlock.spec.ts @@ -98,26 +98,26 @@ tape('runBlock() -> successful API parameter usage', async (t) => { } t.test('PoW block, unmodified options', async (st) => { - const vm = setupVM({ common }) + const vm = await setupVM({ common }) await simpleRun(vm, st) }) t.test('Uncle blocks, compute uncle rewards', async (st) => { - const vm = setupVM({ common }) + const vm = await setupVM({ common }) await uncleRun(vm, st) }) t.test('PoW block, Common custom chain (Common.custom() static constructor)', async (st) => { const customChainParams = { name: 'custom', chainId: 123, networkId: 678 } const common = Common.custom(customChainParams, { baseChain: 'mainnet', hardfork: 'berlin' }) - const vm = setupVM({ common }) + const vm = await setupVM({ common }) await simpleRun(vm, st) }) t.test('PoW block, Common custom chain (Common customChains constructor option)', async (st) => { const customChains = [testnet] const common = new Common({ chain: 'testnet', hardfork: Hardfork.Berlin, customChains }) - const vm = setupVM({ common }) + const vm = await setupVM({ common }) await simpleRun(vm, st) }) @@ -158,8 +158,8 @@ tape('runBlock() -> successful API parameter usage', async (t) => { ) } - const vm = new VM({ common: common1, hardforkByBlockNumber: true }) - const vm_noSelect = new VM({ common: common2 }) + const vm = await VM.create({ common: common1, hardforkByBlockNumber: true }) + const vm_noSelect = await VM.create({ common: common2 }) const txResultMuirGlacier = await vm.runBlock({ block: getBlock(common1), @@ -185,7 +185,7 @@ tape('runBlock() -> successful API parameter usage', async (t) => { }) tape('runBlock() -> API parameter usage/data errors', async (t) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) t.test('should fail when runTx fails', async (t) => { const blockRlp = testData.blocks[0].rlp @@ -200,7 +200,7 @@ tape('runBlock() -> API parameter usage/data errors', async (t) => { }) t.test('should fail when block gas limit higher than 2^63-1', async (t) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const block = Block.fromBlockData({ header: { @@ -215,7 +215,7 @@ tape('runBlock() -> API parameter usage/data errors', async (t) => { }) t.test('should fail when block validation fails', async (t) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const blockRlp = testData.blocks[0].rlp const block = Object.create(Block.fromRLPSerializedBlock(blockRlp)) @@ -230,7 +230,7 @@ tape('runBlock() -> API parameter usage/data errors', async (t) => { }) t.test('should fail when tx gas limit higher than block gas limit', async (t) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const blockRlp = testData.blocks[0].rlp const block = Object.create(Block.fromRLPSerializedBlock(blockRlp)) @@ -256,7 +256,7 @@ tape('runBlock() -> runtime behavior', async (t) => { t.test('DAO fork behavior', async (t) => { const common = getDAOCommon(1) - const vm = setupVM({ common }) + const vm = await setupVM({ common }) const block1: any = rlp.decode(testData.blocks[0].rlp) // edit extra data of this block to "dao-hard-fork" @@ -307,7 +307,7 @@ tape('runBlock() -> runtime behavior', async (t) => { t.test('should allocate to correct clique beneficiary', async (t) => { const common = new Common({ chain: Chain.Goerli, hardfork: Hardfork.Istanbul }) - const vm = setupVM({ common }) + const vm = await setupVM({ common }) const signer = { address: new Address(Buffer.from('0b90087d864e82a284dca15923f3776de6bb016f', 'hex')), @@ -374,7 +374,7 @@ async function runBlockAndGetAfterBlockEvent( } tape('should correctly reflect generated fields', async (t) => { - const vm = new VM() + const vm = await VM.create() // We create a block with a receiptTrie and transactionsTrie // filled with 0s and no txs. Once we run it we should @@ -398,7 +398,7 @@ tape('should correctly reflect generated fields', async (t) => { async function runWithHf(hardfork: string) { const common = new Common({ chain: Chain.Mainnet, hardfork }) - const vm = setupVM({ common }) + const vm = await setupVM({ common }) const blockRlp = testData.blocks[0].rlp const block = Block.fromRLPSerializedBlock(blockRlp, { common }) @@ -471,7 +471,7 @@ tape('runBlock() -> tx types', async (t) => { t.test('legacy tx', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }) - const vm = setupVM({ common }) + const vm = await setupVM({ common }) const address = Address.fromString('0xccfd725760a68823ff1e062f4cc97e1360e8d997') await setBalance(vm, address) @@ -487,7 +487,7 @@ tape('runBlock() -> tx types', async (t) => { t.test('access list tx', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }) - const vm = setupVM({ common }) + const vm = await setupVM({ common }) const address = Address.fromString('0xccfd725760a68823ff1e062f4cc97e1360e8d997') await setBalance(vm, address) @@ -506,7 +506,7 @@ tape('runBlock() -> tx types', async (t) => { t.test('fee market tx', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) - const vm = setupVM({ common }) + const vm = await setupVM({ common }) const address = Address.fromString('0xccfd725760a68823ff1e062f4cc97e1360e8d997') await setBalance(vm, address) diff --git a/packages/vm/tests/api/runBlockchain.spec.ts b/packages/vm/tests/api/runBlockchain.spec.ts index 020d0424bfb..68c2d9262d1 100644 --- a/packages/vm/tests/api/runBlockchain.spec.ts +++ b/packages/vm/tests/api/runBlockchain.spec.ts @@ -17,17 +17,23 @@ tape('runBlockchain', (t) => { const common = new Common({ chain: Chain.Goerli, hardfork: Hardfork.Chainstart }) t.test('should run without a blockchain parameter', async (st) => { - const vm = setupVM({ common }) - st.doesNotThrow(async function () { + const vm = await setupVM({ common }) + try { await vm.runBlockchain() - }) + st.pass('did not throw') + } catch (error) { + st.fail('should not have thrown') + } }) t.test('should run without blocks', async (st) => { - const vm = setupVM({ common }) - st.doesNotThrow(async function () { + const vm = await setupVM({ common }) + try { await vm.runBlockchain() - }) + st.pass('did not throw') + } catch (error) { + st.fail('should not have thrown') + } }) t.test('should run with genesis block', async (st) => { @@ -41,7 +47,7 @@ tape('runBlockchain', (t) => { validateConsensus: false, genesisBlock, }) - const vm = setupVM({ genesisBlock, blockchain }) + const vm = await setupVM({ genesisBlock, blockchain }) st.ok(blockchain.meta.genesis, 'genesis should be set for blockchain') @@ -62,8 +68,7 @@ tape('runBlockchain', (t) => { const blockRlp = Buffer.from(testData.blocks[0].rlp.slice(2), 'hex') const block = Block.fromRLPSerializedBlock(blockRlp, { common }) - const vm = setupVM({ common, genesisBlock }) - await vm.init() + const vm = await setupVM({ common, genesisBlock }) st.equal(vm.blockchain.meta.genesis?.toString('hex'), testData.genesisBlockHeader.hash.slice(2)) @@ -94,8 +99,7 @@ tape('runBlockchain', (t) => { const blockRlp = toBuffer(testData.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp, { common }) - const vm = setupVM({ common, genesisBlock }) - await vm.init() + const vm = await setupVM({ common, genesisBlock }) st.equal(vm.blockchain.meta.genesis?.toString('hex'), testData.genesisBlockHeader.hash.slice(2)) @@ -115,7 +119,7 @@ tape('runBlockchain', (t) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) const genesisBlock = Block.genesis(undefined, { common }) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ db: blockchainDB, common, validateBlocks: false, @@ -123,7 +127,7 @@ tape('runBlockchain', (t) => { genesisBlock, }) - const vm = setupVM({ genesisBlock, blockchain }) + const vm = await setupVM({ genesisBlock, blockchain }) // Produce error on the third time runBlock is called let runBlockInvocations = 0 diff --git a/packages/vm/tests/api/runCall.spec.ts b/packages/vm/tests/api/runCall.spec.ts index 01a7e8db10d..3487adebf9b 100644 --- a/packages/vm/tests/api/runCall.spec.ts +++ b/packages/vm/tests/api/runCall.spec.ts @@ -27,7 +27,7 @@ tape('Constantinople: EIP-1014 CREATE2 creates the right contract address', asyn ) // contract address // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Constantinople }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const code = '3460008080F560005260206000F3' /* code: remarks: (top of the stack is at the zero index) @@ -86,10 +86,10 @@ tape('Byzantium cannot access Constantinople opcodes', async (t) => { Buffer.from('00000000000000000000000000000000000000ff', 'hex') ) // contract address // setup the vm - const vmByzantium = new VM({ + const vmByzantium = await VM.create({ common: new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Byzantium }), }) - const vmConstantinople = new VM({ + const vmConstantinople = await VM.create({ common: new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Constantinople }), }) const code = '600160011B00' @@ -134,8 +134,8 @@ tape('Ensure that precompile activation creates non-empty accounts', async (t) = ) // contract address // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vmNotActivated = new VM({ common: common }) - const vmActivated = new VM({ common: common, activatePrecompiles: true }) + const vmNotActivated = await VM.create({ common: common }) + const vmActivated = await VM.create({ common: common, activatePrecompiles: true }) const code = '6000808080347300000000000000000000000000000000000000045AF100' /* idea: call the Identity precompile with nonzero value in order to trigger "callNewAccount" for the non-activated VM and do not deduct this @@ -181,7 +181,7 @@ tape('Ensure that Istanbul sstoreCleanRefundEIP2200 gas is applied correctly', a const address = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) const code = '61000260005561000160005500' /* idea: store the original value in the storage slot, except it is now a 1-length buffer instead of a 32-length buffer @@ -232,7 +232,7 @@ tape('ensure correct gas for pre-constantinople sstore', async (t) => { const address = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) // push 1 push 0 sstore stop const code = '600160015500' @@ -259,7 +259,7 @@ tape('ensure correct gas for calling non-existent accounts in homestead', async const address = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Homestead }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) // code to call 0x00..00dd, which does not exist const code = '6000600060006000600060DD61FFFF5A03F100' @@ -290,7 +290,7 @@ tape( const address = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Homestead }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) // code to call back into the calling account (0x00..00EE), // but using too much memory const code = '61FFFF60FF60006000600060EE6000F200' @@ -320,7 +320,7 @@ tape('ensure selfdestruct pays for creating new accounts', async (t) => { const address = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.TangerineWhistle }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) // code to call 0x00..00fe, with the GAS opcode used as gas // this cannot be paid, since we also have to pay for CALL (40 gas) // this should thus go OOG @@ -350,7 +350,7 @@ tape('ensure that sstores pay for the right gas costs pre-byzantium', async (t) const address = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) // code to call 0x00..00fe, with the GAS opcode used as gas // this cannot be paid, since we also have to pay for CALL (40 gas) // this should thus go OOG @@ -420,7 +420,7 @@ tape( const emptyBuffer = Buffer.from('') // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) const code = '60008080F060005500' /* This simple code tries to create an empty contract and then stores the address of the contract in the zero slot. @@ -474,7 +474,7 @@ tape('Ensure that IDENTITY precompile copies the memory', async (t) => { const caller = new Address(Buffer.from('1a02a619e51cc5f8a2a61d2a60f6c80476ee8ead', 'hex')) // caller addres // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) const code = '3034526020600760203460045afa602034343e604034f3' const account = await vm.stateManager.getAccount(caller) @@ -508,7 +508,7 @@ tape('Ensure that IDENTITY precompile copies the memory', async (t) => { tape('Throws on negative call value', async (t) => { // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) // setup the call arguments const runCallArgs = { diff --git a/packages/vm/tests/api/runCode.spec.ts b/packages/vm/tests/api/runCode.spec.ts index 2fd4bc6c655..0f4543f20d7 100644 --- a/packages/vm/tests/api/runCode.spec.ts +++ b/packages/vm/tests/api/runCode.spec.ts @@ -18,42 +18,43 @@ const testCases = [ { code: [STOP], resultPC: 1 }, ] -tape('VM.runCode: initial program counter', (t) => { - const vm = new VM() - - testCases.forEach((testData, i) => { - t.test('should start the execution at the specified pc or 0 #' + i.toString(), async (st) => { - const runCodeArgs = { - code: Buffer.from(testData.code.join(''), 'hex'), - pc: testData.pc, - gasLimit: BigInt(0xffff), - } +tape('VM.runCode: initial program counter', async (t) => { + const vm = await VM.create() - let err - try { - const result = await vm.runCode(runCodeArgs) - if (testData.resultPC !== undefined) { - t.equals(result.runState?.programCounter, testData.resultPC, 'runstate.programCounter') - } - } catch (e: any) { - err = e - } + for (const [i, testData] of testCases.entries()) { + const runCodeArgs = { + code: Buffer.from(testData.code.join(''), 'hex'), + pc: testData.pc, + gasLimit: BigInt(0xffff), + } - if (testData.error) { - err = err ? err.message : 'no error thrown' - st.equal(err, testData.error, 'error message should match') - err = false + let err + try { + const result = await vm.runCode(runCodeArgs) + if (testData.resultPC !== undefined) { + t.equal( + result.runState?.programCounter, + testData.resultPC, + `should start the execution at the specified pc or 0, testCases[${i}]` + ) } + } catch (e: any) { + err = e + } - st.assert(!err) - st.end() - }) - }) + if (testData.error) { + err = err ? err.message : 'no error thrown' + t.equal(err, testData.error, 'error message should match') + err = false + } + + t.assert(!err) + } }) tape('VM.runCode: interpreter', (t) => { t.test('should return a VmError as an exceptionError on the result', async (st) => { - const vm = new VM() + const vm = await VM.create() const INVALID_opcode = 'fe' const runCodeArgs = { @@ -77,7 +78,7 @@ tape('VM.runCode: interpreter', (t) => { stateManager.putContractStorage = (..._args) => { throw new Error('Test') } - const vm = new VM({ stateManager }) + const vm = await VM.create({ stateManager }) const SSTORE = '55' const runCodeArgs = { @@ -97,7 +98,7 @@ tape('VM.runCode: interpreter', (t) => { tape('VM.runCode: RunCodeOptions', (t) => { t.test('should throw on negative value args', async (st) => { - const vm = new VM() + const vm = await VM.create() const runCodeArgs = { value: BigInt(-10), diff --git a/packages/vm/tests/api/runTx.spec.ts b/packages/vm/tests/api/runTx.spec.ts index 16944c1f381..a477da63183 100644 --- a/packages/vm/tests/api/runTx.spec.ts +++ b/packages/vm/tests/api/runTx.spec.ts @@ -45,11 +45,11 @@ tape('runTx() -> successful API parameter usage', async (t) => { t.test('simple run (unmodified options)', async (st) => { let common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) - let vm = new VM({ common }) + let vm = await VM.create({ common }) await simpleRun(vm, 'mainnet (PoW), london HF, default SM - should run without errors', st) common = new Common({ chain: Chain.Rinkeby, hardfork: Hardfork.London }) - vm = new VM({ common }) + vm = await VM.create({ common }) await simpleRun(vm, 'rinkeby (PoA), london HF, default SM - should run without errors', st) st.end() @@ -57,7 +57,7 @@ tape('runTx() -> successful API parameter usage', async (t) => { t.test('should use passed in blockGasUsed to generate tx receipt', async (t) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(vm._common, 0, true) @@ -76,7 +76,7 @@ tape('runTx() -> successful API parameter usage', async (t) => { t.test('Legacy Transaction with HF set to pre-Berlin', async (t) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(vm._common, 0, true) @@ -97,7 +97,7 @@ tape('runTx() -> successful API parameter usage', async (t) => { 'custom block (block option), disabled block gas limit validation (skipBlockGasLimitValidation: true)', async (t) => { for (const txType of TRANSACTION_TYPES) { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const privateKey = Buffer.from( 'e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', @@ -179,7 +179,7 @@ tape('runTx() -> successful API parameter usage', async (t) => { tape('runTx() -> API parameter usage/data errors', (t) => { t.test('Typed Transaction with HF set to pre-Berlin', async (t) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction( new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }), @@ -206,7 +206,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { }) t.test('simple run (reportAccessList option)', async (t) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(vm._common, 0, true) @@ -225,7 +225,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { t.test('run without signature', async (t) => { for (const txType of TRANSACTION_TYPES) { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(vm._common, txType.type, false) try { await vm.runTx({ tx }) @@ -239,7 +239,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { t.test('run with insufficient funds', async (t) => { for (const txType of TRANSACTION_TYPES) { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(vm._common, txType.type, true) try { await vm.runTx({ tx }) @@ -250,7 +250,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { // EIP-1559 // Fail if signer.balance < gas_limit * max_fee_per_gas - const vm = new VM({ common }) + const vm = await VM.create({ common }) let tx = getTransaction(vm._common, 2, true) as FeeMarketEIP1559Transaction const address = tx.getSenderAddress() tx = Object.create(tx) @@ -271,7 +271,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { }) t.test('run with insufficient eip1559 funds', async (t) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(common, 2, true, '0x0', false) const address = tx.getSenderAddress() const account = await vm.stateManager.getAccount(address) @@ -291,7 +291,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { }) t.test('should throw on wrong nonces', async (t) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(common, 2, true, '0x0', false) const address = tx.getSenderAddress() const account = await vm.stateManager.getAccount(address) @@ -311,7 +311,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { // EIP-1559 // Fail if transaction.maxFeePerGas < block.baseFeePerGas for (const txType of TRANSACTION_TYPES) { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(vm._common, txType.type, true) const block = Block.fromBlockData({ header: { baseFeePerGas: 100000 } }, { common }) try { @@ -332,7 +332,7 @@ tape('runTx() -> runtime behavior', async (t) => { t.test('storage cache', async (t) => { for (const txType of TRANSACTION_TYPES) { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const privateKey = Buffer.from( 'e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex' @@ -381,7 +381,7 @@ tape('runTx() -> runtime behavior', async (t) => { tape('runTx() -> runtime errors', async (t) => { t.test('account balance overflows (call)', async (t) => { for (const txType of TRANSACTION_TYPES) { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(vm._common, txType.type, true, '0x01') const caller = tx.getSenderAddress() @@ -409,7 +409,7 @@ tape('runTx() -> runtime errors', async (t) => { t.test('account balance overflows (create)', async (t) => { for (const txType of TRANSACTION_TYPES) { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(vm._common, txType.type, true, '0x01', true) const caller = tx.getSenderAddress() @@ -443,7 +443,7 @@ tape('runTx() -> runtime errors', async (t) => { tape('runTx() -> API return values', async (t) => { t.test('simple run, common return values', async (t) => { for (const txType of TRANSACTION_TYPES) { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(vm._common, txType.type, true) const caller = tx.getSenderAddress() @@ -475,7 +475,7 @@ tape('runTx() -> API return values', async (t) => { t.test('simple run, runTx default return values', async (t) => { for (const txType of TRANSACTION_TYPES) { - const vm = new VM({ common }) + const vm = await VM.create({ common }) const tx = getTransaction(vm._common, txType.type, true) const caller = tx.getSenderAddress() @@ -558,7 +558,7 @@ tape('runTx() -> consensus bugs', async (t) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.SpuriousDragon }) common.setHardforkByBlockNumber(2772981) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const addr = Address.fromString('0xd3563d8f19a85c95beab50901fd59ca4de69174c') const acc = await vm.stateManager.getAccount(addr) @@ -596,7 +596,7 @@ tape('runTx() -> consensus bugs', async (t) => { } const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) - const vm = new VM({ common }) + const vm = await VM.create({ common }) const addr = Address.fromPrivateKey(pkey) const acc = await vm.stateManager.getAccount(addr) @@ -615,7 +615,7 @@ tape('runTx() -> consensus bugs', async (t) => { tape('runTx() -> RunTxOptions', (t) => { t.test('should throw on negative value args', async (t) => { - const vm = new VM({ common }) + const vm = await VM.create({ common }) await setBalance(vm, Address.zero(), BigInt(10000000000)) for (const txType of TRANSACTION_TYPES) { const tx = getTransaction(vm._common, txType.type, false) diff --git a/packages/vm/tests/api/state/accountExists.spec.ts b/packages/vm/tests/api/state/accountExists.spec.ts index 388dcbcbb93..538d0932eea 100644 --- a/packages/vm/tests/api/state/accountExists.spec.ts +++ b/packages/vm/tests/api/state/accountExists.spec.ts @@ -15,7 +15,7 @@ tape('correctly apply new account gas fee on pre-Spurious Dragon hardforks', asy ) // contract address // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Homestead }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) const code = '606060405236156101065760e060020a600035046305fefda7811461013d57806306fdde031461016357806318160ddd146101c057806323b872dd146101c95780632e1a7d4d146101fb578063313ce5671461021e5780633177029f1461022a57806347f1d8d7146102d25780634b750334146102db57806370a08231146102e45780638620410b146102fc5780638da5cb5b1461030557806395d89b4114610317578063a6f2ae3a14610372578063a9059cbb146103a2578063b414d4b6146103d1578063c91d956c146103ec578063dc3080f21461040f578063dd62ed3e14610434578063e4849b3214610459578063e724529c1461048f578063f2fde38b146104b5575b6104d860055434111561013b5760055433600160a060020a031660009081526008602052604090208054349290920490910190555b565b6104d8600435602435600054600160a060020a0390811633919091161461084157610002565b60408051600180546020600282841615610100026000190190921691909104601f81018290048202840182019094528383526104da93908301828280156105db5780601f106105b0576101008083540402835291602001916105db565b61054860065481565b610548600435602435604435600160a060020a038316600090815260086020526040812054829010156106f657610002565b6104d8600435600054600160a060020a0390811633919091161461091957610002565b61055a60035460ff1681565b610548600435602435600160a060020a033381166000818152600a60209081526040808320878616808552925280832086905580517f4889ca880000000000000000000000000000000000000000000000000000000081526004810194909452602484018690523090941660448401529251909285929091634889ca88916064808201928792909190829003018183876161da5a03f115610002575060019695505050505050565b61054860075481565b61054860045481565b61054860043560086020526000908152604090205481565b61054860055481565b610571600054600160a060020a031681565b6040805160028054602060018216156101000260001901909116829004601f81018290048202840182019094528383526104da93908301828280156105db5780601f106105b0576101008083540402835291602001916105db565b60055430600160a060020a03166000908152600860205260409020546104d8913404908190101561084c57610002565b6104d8600435602435600160a060020a033316600090815260086020526040902054819010156105f157610002565b61054860043560096020526000908152604090205460ff1681565b6104d8600435600054600160a060020a039081163391909116146105e357610002565b600b602090815260043560009081526040808220909252602435815220546105489081565b600a602090815260043560009081526040808220909252602435815220546105489081565b6104d86004355b806008600050600033600160a060020a031681526020019081526020016000206000505410156108a657610002565b6104d8600435602435600054600160a060020a039081163391909116146107e157610002565b6104d8600435600054600160a060020a0390811633919091161461058e57610002565b005b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f16801561053a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60408051918252519081900360200190f35b6040805160ff929092168252519081900360200190f35b60408051600160a060020a03929092168252519081900360200190f35b6000805473ffffffffffffffffffffffffffffffffffffffff19168217905550565b820191906000526020600020905b8154815290600101906020018083116105be57829003601f168201915b505050505081565b66038d7ea4c6800002600755565b600160a060020a038216600090815260086020526040902054818101101561061857610002565b600160a060020a03331660009081526009602052604090205460ff161561063e57610002565b600160a060020a0333811660008181526008602090815260408083208054879003905593861680835291849020805486019055835185815293519193600080516020610940833981519152929081900390910190a3600754600160a060020a0383163110156106c4576007546004546106c491600160a060020a03851631900304610460565b604051600454600754600160a060020a038516926000928431909203919091049082818181858883f150505050505050565b600160a060020a038316600090815260086020526040902054808301101561071d57610002565b600160a060020a038481166000818152600a602090815260408083203390951680845294825280832054938352600b825280832094835293905291909120548301111561076957610002565b600160a060020a03848116600081815260086020908152604080832080548890039055878516808452818420805489019055848452600b835281842033909616845294825291829020805487019055815186815291516000805160206109408339815191529281900390910190a35060019392505050565b600160a060020a038216600081815260096020908152604091829020805460ff1916851790558151928352820183905280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600491909155600555565b600160a060020a03338116600081815260086020908152604080832080548701905530909416808352918490208054869003905583518581529351929391926000805160206109408339815191529281900390910190a350565b30600160a060020a039081166000908152600860205260408082208054850190553390921680825282822080548590039055915160045484029082818181858883f15084815260405130600160a060020a031694935060008051602061094083398151915292509081900360200190a350565b60008054604051600160a060020a03919091169190839082818181858883f150505050505056ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' @@ -56,7 +56,7 @@ tape( ) // contract address // setup the vm const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Homestead }) - const vm = new VM({ common: common }) + const vm = await VM.create({ common: common }) const code = '606060405236156101065760e060020a600035046305fefda7811461013d57806306fdde031461016357806318160ddd146101c057806323b872dd146101c95780632e1a7d4d146101fb578063313ce5671461021e5780633177029f1461022a57806347f1d8d7146102d25780634b750334146102db57806370a08231146102e45780638620410b146102fc5780638da5cb5b1461030557806395d89b4114610317578063a6f2ae3a14610372578063a9059cbb146103a2578063b414d4b6146103d1578063c91d956c146103ec578063dc3080f21461040f578063dd62ed3e14610434578063e4849b3214610459578063e724529c1461048f578063f2fde38b146104b5575b6104d860055434111561013b5760055433600160a060020a031660009081526008602052604090208054349290920490910190555b565b6104d8600435602435600054600160a060020a0390811633919091161461084157610002565b60408051600180546020600282841615610100026000190190921691909104601f81018290048202840182019094528383526104da93908301828280156105db5780601f106105b0576101008083540402835291602001916105db565b61054860065481565b610548600435602435604435600160a060020a038316600090815260086020526040812054829010156106f657610002565b6104d8600435600054600160a060020a0390811633919091161461091957610002565b61055a60035460ff1681565b610548600435602435600160a060020a033381166000818152600a60209081526040808320878616808552925280832086905580517f4889ca880000000000000000000000000000000000000000000000000000000081526004810194909452602484018690523090941660448401529251909285929091634889ca88916064808201928792909190829003018183876161da5a03f115610002575060019695505050505050565b61054860075481565b61054860045481565b61054860043560086020526000908152604090205481565b61054860055481565b610571600054600160a060020a031681565b6040805160028054602060018216156101000260001901909116829004601f81018290048202840182019094528383526104da93908301828280156105db5780601f106105b0576101008083540402835291602001916105db565b60055430600160a060020a03166000908152600860205260409020546104d8913404908190101561084c57610002565b6104d8600435602435600160a060020a033316600090815260086020526040902054819010156105f157610002565b61054860043560096020526000908152604090205460ff1681565b6104d8600435600054600160a060020a039081163391909116146105e357610002565b600b602090815260043560009081526040808220909252602435815220546105489081565b600a602090815260043560009081526040808220909252602435815220546105489081565b6104d86004355b806008600050600033600160a060020a031681526020019081526020016000206000505410156108a657610002565b6104d8600435602435600054600160a060020a039081163391909116146107e157610002565b6104d8600435600054600160a060020a0390811633919091161461058e57610002565b005b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f16801561053a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60408051918252519081900360200190f35b6040805160ff929092168252519081900360200190f35b60408051600160a060020a03929092168252519081900360200190f35b6000805473ffffffffffffffffffffffffffffffffffffffff19168217905550565b820191906000526020600020905b8154815290600101906020018083116105be57829003601f168201915b505050505081565b66038d7ea4c6800002600755565b600160a060020a038216600090815260086020526040902054818101101561061857610002565b600160a060020a03331660009081526009602052604090205460ff161561063e57610002565b600160a060020a0333811660008181526008602090815260408083208054879003905593861680835291849020805486019055835185815293519193600080516020610940833981519152929081900390910190a3600754600160a060020a0383163110156106c4576007546004546106c491600160a060020a03851631900304610460565b604051600454600754600160a060020a038516926000928431909203919091049082818181858883f150505050505050565b600160a060020a038316600090815260086020526040902054808301101561071d57610002565b600160a060020a038481166000818152600a602090815260408083203390951680845294825280832054938352600b825280832094835293905291909120548301111561076957610002565b600160a060020a03848116600081815260086020908152604080832080548890039055878516808452818420805489019055848452600b835281842033909616845294825291829020805487019055815186815291516000805160206109408339815191529281900390910190a35060019392505050565b600160a060020a038216600081815260096020908152604091829020805460ff1916851790558151928352820183905280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600491909155600555565b600160a060020a03338116600081815260086020908152604080832080548701905530909416808352918490208054869003905583518581529351929391926000805160206109408339815191529281900390910190a350565b30600160a060020a039081166000908152600860205260408082208054850190553390921680825282822080548590039055915160045484029082818181858883f15084815260405130600160a060020a031694935060008051602061094083398151915292509081900360200190a350565b60008054604051600160a060020a03919091169190839082818181858883f150505050505056ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' const existingAddress = caller diff --git a/packages/vm/tests/api/utils.ts b/packages/vm/tests/api/utils.ts index 0026404c0a1..36459bd98b2 100644 --- a/packages/vm/tests/api/utils.ts +++ b/packages/vm/tests/api/utils.ts @@ -19,11 +19,11 @@ export async function setBalance(vm: VM, address: Address, balance = BigInt(1000 await vm.stateManager.commit() } -export function setupVM(opts: VMOpts & { genesisBlock?: Block } = {}) { +export async function setupVM(opts: VMOpts & { genesisBlock?: Block } = {}) { const db = level() const { common, genesisBlock } = opts if (!opts.blockchain) { - opts.blockchain = new Blockchain({ + opts.blockchain = await Blockchain.create({ db, validateBlocks: false, validateConsensus: false, @@ -31,9 +31,10 @@ export function setupVM(opts: VMOpts & { genesisBlock?: Block } = {}) { genesisBlock, }) } - return new VM({ + const vm = await VM.create({ ...opts, }) + return vm } export function getTransaction( diff --git a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts index f3cbcc8771a..2a845304ec2 100644 --- a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts +++ b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts @@ -55,7 +55,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: t.ok(genesisBlock.serialize().equals(rlp), 'correct genesis RLP') } - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ db: blockchainDB, common, validateBlocks: true, @@ -76,16 +76,12 @@ export default async function runBlockchainTest(options: any, testData: any, t: const begin = Date.now() - const vm = new VM({ + const vm = await VM.create({ state, blockchain, common, }) - // Need to await the init promise: in some tests, we do not run the iterator (which awaits the initPromise) - // If the initPromise does not finish, the `rawHead` of `blockchain.meta()` is still `undefined`. - await blockchain.initPromise - // set up pre-state await setupPreConditions(vm.stateManager, testData) diff --git a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts index 4ae409227ee..ea6059963a8 100644 --- a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts +++ b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts @@ -69,7 +69,7 @@ async function runTestCase(options: any, testData: any, t: tape.Test) { const common = options.common const state = new Trie() - const vm = new VM({ state, common }) + const vm = await VM.create({ state, common }) await setupPreConditions(vm.stateManager, testData) From 72475ad4148b1f771c4923985033ed7e91fb575e Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Sat, 2 Apr 2022 01:37:47 -0700 Subject: [PATCH 25/44] vm, client: continuing v6 breaking changes (#1815) * vm: v6 breaking changes * update benchmark util to use gasUsed as bigint * VM: fixed gasUsed rebase related bug Co-authored-by: Holger Drewes --- packages/client/lib/execution/receipt.ts | 8 +- .../client/lib/net/protocol/ethprotocol.ts | 8 +- packages/client/lib/rpc/modules/eth.ts | 2 +- .../client/lib/service/fullethereumservice.ts | 2 + packages/client/lib/util/debug.ts | 2 +- .../test/net/protocol/ethprotocol.spec.ts | 6 +- .../test/service/fullethereumservice.spec.ts | 5 +- packages/vm/benchmarks/util.ts | 6 +- packages/vm/src/buildBlock.ts | 2 +- packages/vm/src/evm/eei.ts | 12 +-- packages/vm/src/evm/evm.ts | 46 +++++------- packages/vm/src/index.ts | 7 +- packages/vm/src/runBlock.ts | 75 ++----------------- packages/vm/src/runCode.ts | 2 +- packages/vm/src/runTx.ts | 35 +++++---- packages/vm/src/state/interface.ts | 2 +- packages/vm/src/types.ts | 18 +---- .../EIPs/eip-1283-net-gas-metering.spec.ts | 6 +- packages/vm/tests/api/EIPs/eip-2929.spec.ts | 2 +- packages/vm/tests/api/EIPs/eip-3529.spec.ts | 10 +-- packages/vm/tests/api/buildBlock.spec.ts | 2 +- .../api/evm/precompiles/hardfork.spec.ts | 6 +- packages/vm/tests/api/index.spec.ts | 12 --- .../vm/tests/api/istanbul/eip-2200.spec.ts | 6 +- packages/vm/tests/api/runBlock.spec.ts | 31 ++++---- packages/vm/tests/api/runCall.spec.ts | 26 +++---- packages/vm/tests/api/runCode.spec.ts | 1 + packages/vm/tests/api/runTx.spec.ts | 33 ++++---- .../vm/tests/api/state/accountExists.spec.ts | 8 +- 29 files changed, 137 insertions(+), 244 deletions(-) diff --git a/packages/client/lib/execution/receipt.ts b/packages/client/lib/execution/receipt.ts index f2c049c6007..2b34fadb0a9 100644 --- a/packages/client/lib/execution/receipt.ts +++ b/packages/client/lib/execution/receipt.ts @@ -2,7 +2,7 @@ import { PreByzantiumTxReceipt, PostByzantiumTxReceipt, TxReceipt } from '@ether import { Log } from '@ethereumjs/vm/dist/evm/types' import Bloom from '@ethereumjs/vm/dist/bloom' import { TypedTransaction } from '@ethereumjs/tx' -import { rlp, intToBuffer, bufferToInt } from 'ethereumjs-util' +import { rlp, intToBuffer, bufferToInt, bigIntToBuffer, bufferToBigInt } from 'ethereumjs-util' import { MetaDBManager, DBKey } from './metaDBManager' import type { Block } from '@ethereumjs/block' @@ -302,7 +302,7 @@ export class ReceiptsManager extends MetaDBManager { value.map((r) => [ (r as PreByzantiumTxReceipt).stateRoot ?? intToBuffer((r as PostByzantiumTxReceipt).status), - r.gasUsed, + bigIntToBuffer(r.gasUsed), this.rlp(RlpConvert.Encode, RlpType.Logs, r.logs), ]) ) @@ -315,14 +315,14 @@ export class ReceiptsManager extends MetaDBManager { // Pre-Byzantium Receipt return { stateRoot: r[0], - gasUsed, + gasUsed: bufferToBigInt(gasUsed), logs, } as PreByzantiumTxReceipt } else { // Post-Byzantium Receipt return { status: bufferToInt(r[0]), - gasUsed, + gasUsed: bufferToBigInt(gasUsed), logs, } as PostByzantiumTxReceipt } diff --git a/packages/client/lib/net/protocol/ethprotocol.ts b/packages/client/lib/net/protocol/ethprotocol.ts index d3907219b41..5b825b6cb95 100644 --- a/packages/client/lib/net/protocol/ethprotocol.ts +++ b/packages/client/lib/net/protocol/ethprotocol.ts @@ -233,7 +233,7 @@ export class EthProtocol extends Protocol { let encodedReceipt = rlp.encode([ (receipt as PreByzantiumTxReceipt).stateRoot ?? (receipt as PostByzantiumTxReceipt).status, - receipt.gasUsed, + bigIntToBuffer(receipt.gasUsed), receipt.bitvector, receipt.logs, ]) @@ -252,7 +252,11 @@ export class EthProtocol extends Protocol { // Legacy receipt if r[0] >= 0xc0, otherwise typed receipt with first byte as TransactionType const decoded = rlp.decode(r[0] >= 0xc0 ? r : r.slice(1)) as any const [stateRootOrStatus, cumulativeGasUsed, logsBloom, logs] = decoded - const receipt = { gasUsed: cumulativeGasUsed, bitvector: logsBloom, logs } as TxReceipt + const receipt = { + gasUsed: bufferToBigInt(cumulativeGasUsed), + bitvector: logsBloom, + logs, + } as TxReceipt if (stateRootOrStatus.length === 32) { ;(receipt as PreByzantiumTxReceipt).stateRoot = stateRootOrStatus } else { diff --git a/packages/client/lib/rpc/modules/eth.ts b/packages/client/lib/rpc/modules/eth.ts index 47149778883..67b52dd9857 100644 --- a/packages/client/lib/rpc/modules/eth.ts +++ b/packages/client/lib/rpc/modules/eth.ts @@ -250,7 +250,7 @@ const jsonRpcReceipt = async ( blockNumber: bigIntToHex(block.header.number), from: tx.getSenderAddress().toString(), to: tx.to?.toString() ?? null, - cumulativeGasUsed: bufferToHex(receipt.gasUsed), + cumulativeGasUsed: bigIntToHex(receipt.gasUsed), effectiveGasPrice: bigIntToHex(effectiveGasPrice), gasUsed: bigIntToHex(gasUsed), contractAddress: contractAddress?.toString() ?? null, diff --git a/packages/client/lib/service/fullethereumservice.ts b/packages/client/lib/service/fullethereumservice.ts index 5c431f13cb6..2b4290b14e4 100644 --- a/packages/client/lib/service/fullethereumservice.ts +++ b/packages/client/lib/service/fullethereumservice.ts @@ -1,4 +1,5 @@ import { Hardfork } from '@ethereumjs/common' +import { bigIntToBuffer } from 'ethereumjs-util' import { EthereumService, EthereumServiceOptions } from './ethereumservice' import { TxPool } from './txpool' import { FullSynchronizer } from '../sync/fullsync' @@ -214,6 +215,7 @@ export class FullEthereumService extends EthereumService { let receiptsSize = 0 for (const hash of hashes) { const blockReceipts = await receiptsManager.getReceipts(hash, true, true) + blockReceipts.forEach((r) => (r.gasUsed = bigIntToBuffer(r.gasUsed) as any)) if (!blockReceipts) continue receipts.push(...blockReceipts) receiptsSize += Buffer.byteLength(JSON.stringify(blockReceipts)) diff --git a/packages/client/lib/util/debug.ts b/packages/client/lib/util/debug.ts index d9db31a7b5f..c2c02b24873 100644 --- a/packages/client/lib/util/debug.ts +++ b/packages/client/lib/util/debug.ts @@ -43,7 +43,7 @@ const main = async () => { const stateManager = new DefaultStateManager({ trie, common }) // Ensure we run on the right root stateManager.setStateRoot(Buffer.from('${( - await execution.vm.stateManager.getStateRoot(true) + await execution.vm.stateManager.getStateRoot() ).toString('hex')}', 'hex')) diff --git a/packages/client/test/net/protocol/ethprotocol.spec.ts b/packages/client/test/net/protocol/ethprotocol.spec.ts index 03eae882f6f..53d83387077 100644 --- a/packages/client/test/net/protocol/ethprotocol.spec.ts +++ b/packages/client/test/net/protocol/ethprotocol.spec.ts @@ -5,7 +5,7 @@ import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' import { Chain } from '../../../lib/blockchain/chain' import { Config } from '../../../lib/config' import { EthProtocol } from '../../../lib/net/protocol' -import { bigIntToBuffer, bufferToBigInt, intToBuffer } from 'ethereumjs-util' +import { bigIntToBuffer, bufferToBigInt } from 'ethereumjs-util' tape('[EthProtocol]', (t) => { t.test('should get properties', (t) => { @@ -151,14 +151,14 @@ tape('[EthProtocol]', (t) => { const receipts = [ { status: 1 as 0 | 1, - gasUsed: intToBuffer(100), + gasUsed: BigInt(100), bitvector: Buffer.alloc(256), logs: [[Buffer.alloc(20), [Buffer.alloc(32), Buffer.alloc(32, 1)], Buffer.alloc(10)]], txType: 2, }, { status: 0 as 0 | 1, - gasUsed: intToBuffer(1000), + gasUsed: BigInt(1000), bitvector: Buffer.alloc(256, 1), logs: [[Buffer.alloc(20, 1), [Buffer.alloc(32, 1), Buffer.alloc(32, 1)], Buffer.alloc(10)]], txType: 0, diff --git a/packages/client/test/service/fullethereumservice.spec.ts b/packages/client/test/service/fullethereumservice.spec.ts index 41d039dbe9e..e227b8d696d 100644 --- a/packages/client/test/service/fullethereumservice.spec.ts +++ b/packages/client/test/service/fullethereumservice.spec.ts @@ -1,7 +1,6 @@ import tape from 'tape' import td from 'testdouble' import { Log } from '@ethereumjs/vm/dist/evm/types' -import { intToBuffer } from 'ethereumjs-util' import { Config } from '../../lib/config' import { Event } from '../../lib/types' import { Chain } from '../../lib/blockchain' @@ -126,7 +125,7 @@ tape('[FullEthereumService]', async (t) => { const receipts = [ { status: 1 as 0 | 1, - gasUsed: intToBuffer(100), + gasUsed: BigInt(100), bitvector: Buffer.alloc(256), logs: [ [Buffer.alloc(20), [Buffer.alloc(32), Buffer.alloc(32, 1)], Buffer.alloc(10)], @@ -135,7 +134,7 @@ tape('[FullEthereumService]', async (t) => { }, { status: 0 as 0 | 1, - gasUsed: intToBuffer(1000), + gasUsed: BigInt(1000), bitvector: Buffer.alloc(256, 1), logs: [ [Buffer.alloc(20, 1), [Buffer.alloc(32, 1), Buffer.alloc(32, 1)], Buffer.alloc(10)], diff --git a/packages/vm/benchmarks/util.ts b/packages/vm/benchmarks/util.ts index 193df1a8425..8c549aa6bd3 100644 --- a/packages/vm/benchmarks/util.ts +++ b/packages/vm/benchmarks/util.ts @@ -68,10 +68,10 @@ export const verifyResult = (block: Block, result: RunBlockResult) => { // check if there are receipts const { receipts } = result if (receipts) { - let cumGasUsed = 0 + let cumGasUsed = BigInt(0) for (let index = 0; index < receipts.length; index++) { - let gasUsedExpected = parseInt(receipts[index].gasUsed.toString('hex'), 16) - let cumGasUsedActual = parseInt(receipts[index].gasUsed.toString('hex'), 16) + let gasUsedExpected = receipts[index].gasUsed + let cumGasUsedActual = receipts[index].gasUsed let gasUsed = cumGasUsedActual - cumGasUsed if (gasUsed !== gasUsedExpected) { console.log(`[DEBUG] diff --git a/packages/vm/src/buildBlock.ts b/packages/vm/src/buildBlock.ts index 3b055052b8f..38bd04115b6 100644 --- a/packages/vm/src/buildBlock.ts +++ b/packages/vm/src/buildBlock.ts @@ -226,7 +226,7 @@ export class BlockBuilder { await this.rewardMiner() } - const stateRoot = await this.vm.stateManager.getStateRoot(true) + const stateRoot = await this.vm.stateManager.getStateRoot() const transactionsTrie = await this.transactionsTrie() const receiptTrie = await this.receiptTrie() const logsBloom = this.logsBloom() diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index 9598dd03939..e0959a6e947 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -293,13 +293,7 @@ export default class EEI { getBlockCoinbase(): bigint { let coinbase: Address if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique) { - // Backwards-compatibilty check - // TODO: can be removed along VM v5 release - if ('cliqueSigner' in this._env.block.header) { - coinbase = this._env.block.header.cliqueSigner() - } else { - coinbase = Address.zero() - } + coinbase = this._env.block.header.cliqueSigner() } else { coinbase = this._env.block.header.coinbase } @@ -581,7 +575,7 @@ export default class EEI { } // this should always be safe - this.useGas(results.gasUsed, 'CALL, STATICCALL, DELEGATECALL, CALLCODE') + this.useGas(results.execResult.gasUsed, 'CALL, STATICCALL, DELEGATECALL, CALLCODE') // Set return value if ( @@ -654,7 +648,7 @@ export default class EEI { } // this should always be safe - this.useGas(results.gasUsed, 'CREATE') + this.useGas(results.execResult.gasUsed, 'CREATE') // Set return buffer in case revert happened if ( diff --git a/packages/vm/src/evm/evm.ts b/packages/vm/src/evm/evm.ts index 6e4e79cc4a7..2ac41dceea1 100644 --- a/packages/vm/src/evm/evm.ts +++ b/packages/vm/src/evm/evm.ts @@ -9,6 +9,7 @@ import { MAX_INTEGER, } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' +import { Hardfork } from '@ethereumjs/common' import { ERROR, VmError } from '../exceptions' import { StateManager } from '../state/index' import { PrecompileFunc } from './precompiles' @@ -31,17 +32,17 @@ const debugGas = createDebugLogger('vm:evm:gas') */ export interface EVMResult { /** - * Amount of gas used by the transaction - */ - gasUsed: bigint - /** - * Address of created account durint transaction, if any + * Address of created account during transaction, if any */ createdAddress?: Address /** * Contains the results from running the code, if any, as described in {@link runCode} */ execResult: ExecResult + /** + * Total amount of gas to be refunded from all nested calls. + */ + gasRefund?: bigint } /** @@ -50,7 +51,7 @@ export interface EVMResult { export interface ExecResult { runState?: RunState /** - * Description of the exception, if any occured + * Description of the exception, if any occurred */ exceptionError?: VmError /** @@ -58,7 +59,7 @@ export interface ExecResult { */ gas?: bigint /** - * Amount of gas the code used to run + * Amount of gas the transaction used to run */ gasUsed: bigint /** @@ -73,10 +74,6 @@ export interface ExecResult { * A map from the accounts that have self-destructed to the addresses to send their funds to */ selfdestruct?: { [k: string]: Buffer } - /** - * Total amount of gas to be refunded from all nested calls. - */ - gasRefund?: bigint } export interface NewContractEvent { @@ -195,26 +192,27 @@ export default class EVM { result = await this._executeCreate(message) } if (this._vm.DEBUG) { - const { gasUsed, exceptionError, returnValue, gasRefund } = result.execResult + const { gasUsed, exceptionError, returnValue } = result.execResult debug( `Received message execResult: [ gasUsed=${gasUsed} exceptionError=${ exceptionError ? `'${exceptionError.error}'` : 'none' - } returnValue=0x${short(returnValue)} gasRefund=${gasRefund ?? 0} ]` + } returnValue=0x${short(returnValue)} gasRefund=${result.gasRefund ?? 0} ]` ) } const err = result.execResult.exceptionError // This clause captures any error which happened during execution // If that is the case, then set the _refund tracker to the old refund value if (err) { - // TODO: Move `gasRefund` to a tx-level result object - // instead of `ExecResult`. this._refund = oldRefund result.execResult.selfdestruct = {} } - result.execResult.gasRefund = this._refund + result.gasRefund = this._refund if (err) { - if (this._vm._common.gteHardfork('homestead') || err.error != ERROR.CODESTORE_OUT_OF_GAS) { + if ( + this._vm._common.gteHardfork(Hardfork.Homestead) || + err.error != ERROR.CODESTORE_OUT_OF_GAS + ) { result.execResult.logs = [] await this._state.revert() this._transientStorage.revert() @@ -278,7 +276,6 @@ export default class EVM { } if (exit) { return { - gasUsed: BigInt(0), execResult: { gasUsed: BigInt(0), exceptionError: errorMessage, // Only defined if addToBalance failed @@ -305,7 +302,6 @@ export default class EVM { } return { - gasUsed: result.gasUsed, execResult: result, } } @@ -318,7 +314,6 @@ export default class EVM { if (this._vm._common.isActivatedEIP(3860)) { if (message.data.length > this._vm._common.param('vm', 'maxInitCodeSize')) { return { - gasUsed: message.gasLimit, createdAddress: message.to, execResult: { returnValue: Buffer.alloc(0), @@ -346,7 +341,6 @@ export default class EVM { debug(`Returning on address collision`) } return { - gasUsed: message.gasLimit, createdAddress: message.to, execResult: { returnValue: Buffer.alloc(0), @@ -367,7 +361,7 @@ export default class EVM { toAccount = await this._state.getAccount(message.to) // EIP-161 on account creation and CREATE execution - if (this._vm._common.gteHardfork('spuriousDragon')) { + if (this._vm._common.gteHardfork(Hardfork.SpuriousDragon)) { toAccount.nonce += BigInt(1) } @@ -394,7 +388,6 @@ export default class EVM { } if (exit) { return { - gasUsed: BigInt(0), createdAddress: message.to, execResult: { gasUsed: BigInt(0), @@ -426,7 +419,7 @@ export default class EVM { let allowedCodeSize = true if ( !result.exceptionError && - this._vm._common.gteHardfork('spuriousDragon') && + this._vm._common.gteHardfork(Hardfork.SpuriousDragon) && result.returnValue.length > this._vm._common.param('vm', 'maxCodeSize') ) { allowedCodeSize = false @@ -470,7 +463,7 @@ export default class EVM { result.gasUsed = totalGas } } else { - if (this._vm._common.gteHardfork('homestead')) { + if (this._vm._common.gteHardfork(Hardfork.Homestead)) { if (this._vm.DEBUG) { debug(`Not enough gas or code size not allowed (>= Homestead)`) } @@ -498,7 +491,7 @@ export default class EVM { } } else if (CodestoreOOG) { // This only happens at Frontier. But, let's do a sanity check; - if (!this._vm._common.gteHardfork('homestead')) { + if (!this._vm._common.gteHardfork(Hardfork.Homestead)) { // Pre-Homestead behavior; put an empty contract. // This contract would be considered "DEAD" in later hard forks. // It is thus an unecessary default item, which we have to save to dik @@ -510,7 +503,6 @@ export default class EVM { } return { - gasUsed: result.gasUsed, createdAddress: message.to, execResult: result, } diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index 7837698cdf3..9fe69d8f2bb 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -76,11 +76,6 @@ export interface VMOpts { * A {@link StateManager} instance to use as the state store (Beta API) */ stateManager?: StateManager - /** - * A {@link SecureTrie} instance for the state tree (ignored if stateManager is passed) - * @deprecated will be removed in next major version release - */ - state?: Trie /** * A {@link Blockchain} object for storing/retrieving blocks */ @@ -306,7 +301,7 @@ export default class VM extends AsyncEventEmitter { if (opts.stateManager) { this.stateManager = opts.stateManager } else { - const trie = opts.state ?? new Trie() + const trie = new Trie() this.stateManager = new DefaultStateManager({ trie, common: this._common, diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index faddd41677e..576b84dfb40 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -1,6 +1,6 @@ import { debug as createDebugLogger } from 'debug' import { BaseTrie as Trie } from 'merkle-patricia-tree' -import { Account, Address, bigIntToBuffer, intToBuffer, rlp } from 'ethereumjs-util' +import { Account, Address, intToBuffer, rlp } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import { ConsensusType, Hardfork } from '@ethereumjs/common' import VM from './index' @@ -9,15 +9,8 @@ import { StateManager } from './state' import { short } from './evm/opcodes' import { Capability, TypedTransaction } from '@ethereumjs/tx' import type { RunTxResult } from './runTx' -import type { TxReceipt } from './types' -import * as DAOConfig from './config/dao_fork_accounts_config.json' - -// For backwards compatibility from v5.3.0, -// TxReceipts are exported. These exports are -// deprecated and may be removed soon, please -// update your imports to the new types file. -import { PreByzantiumTxReceipt, PostByzantiumTxReceipt, EIP2930Receipt } from './types' -export { PreByzantiumTxReceipt, PostByzantiumTxReceipt, EIP2930Receipt } +import type { TxReceipt, PreByzantiumTxReceipt, PostByzantiumTxReceipt } from './types' +import DAOConfig from './config/dao_fork_accounts_config.json' const debug = createDebugLogger('vm:block') @@ -184,7 +177,7 @@ export default async function runBlock(this: VM, opts: RunBlockOpts): Promise= Byzantium)` - } else { - // Pre-Byzantium - const stateRoot = await this.stateManager.getStateRoot(true) - txReceipt = { - stateRoot: stateRoot, - ...abstractTxReceipt, - } as PreByzantiumTxReceipt - receiptLog += ` stateRoot=${txReceipt.stateRoot.toString('hex')} (< Byzantium)` - } - encodedReceipt = rlp.encode(Object.values(txReceipt)) - } else { - // EIP2930 Transaction - txReceipt = { - status: txRes.execResult.exceptionError ? 0 : 1, - ...abstractTxReceipt, - } as PostByzantiumTxReceipt - encodedReceipt = Buffer.concat([intToBuffer(tx.type), rlp.encode(Object.values(txReceipt))]) - } - return { - txReceipt, - encodedReceipt, - receiptLog, - } -} - -// apply the DAO fork changes to the VM async function _applyDAOHardfork(state: StateManager) { const DAORefundContractAddress = new Address(Buffer.from(DAORefundContract, 'hex')) if (!state.accountExists(DAORefundContractAddress)) { diff --git a/packages/vm/src/runCode.ts b/packages/vm/src/runCode.ts index 6a3adaebad2..27e9af4ebf8 100644 --- a/packages/vm/src/runCode.ts +++ b/packages/vm/src/runCode.ts @@ -49,7 +49,7 @@ export interface RunCodeOpts { /** * Gas limit */ - gasLimit?: bigint + gasLimit: bigint /** * The value in ether that is being sent to `opt.address`. Defaults to `0` */ diff --git a/packages/vm/src/runTx.ts b/packages/vm/src/runTx.ts index 72b851b86f1..56d21b5bd52 100644 --- a/packages/vm/src/runTx.ts +++ b/packages/vm/src/runTx.ts @@ -1,5 +1,5 @@ import { debug as createDebugLogger } from 'debug' -import { Address, bigIntToBuffer, KECCAK256_NULL, toBuffer } from 'ethereumjs-util' +import { Address, KECCAK256_NULL, toBuffer } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import { ConsensusType } from '@ethereumjs/common' import { @@ -93,6 +93,11 @@ export interface RunTxResult extends EVMResult { */ receipt: TxReceipt + /** + * The amount of gas used in this transaction + */ + gasUsed: bigint + /** * The amount of gas as that was refunded during the transaction (i.e. `gasUsed = totalGasConsumed - gasRefund`) */ @@ -352,8 +357,8 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { } } - let gasPrice - let inclusionFeePerGas + let gasPrice: bigint + let inclusionFeePerGas: bigint // EIP-1559 tx if (tx.supports(Capability.EIP1559FeeMarket)) { const baseFee = block.header.baseFeePerGas! @@ -412,12 +417,12 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { const results = (await evm.executeMessage(message)) as RunTxResult if (this.DEBUG) { - const { gasUsed, exceptionError, returnValue, gasRefund } = results.execResult + const { gasUsed, exceptionError, returnValue } = results.execResult debug('-'.repeat(100)) debug( `Received tx execResult: [ gasUsed=${gasUsed} exceptionError=${ exceptionError ? `'${exceptionError.error}'` : 'none' - } returnValue=0x${short(returnValue)} gasRefund=${gasRefund ?? 0} ]` + } returnValue=0x${short(returnValue)} gasRefund=${results.gasRefund ?? 0} ]` ) } @@ -430,14 +435,14 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { debug(`Generated tx bloom with logs=${results.execResult.logs?.length}`) } - // Caculate the total gas used - results.gasUsed += txBaseFee + // Calculate the total gas used + results.gasUsed = results.execResult.gasUsed + txBaseFee if (this.DEBUG) { debugGas(`tx add baseFee ${txBaseFee} to gasUsed (-> ${results.gasUsed})`) } // Process any gas refund - let gasRefund = results.execResult.gasRefund ?? BigInt(0) + let gasRefund = results.gasRefund ?? BigInt(0) const maxRefundQuotient = BigInt(this._common.param('gasConfig', 'maxRefundQuotient')) if (gasRefund !== BigInt(0)) { const maxRefund = results.gasUsed / maxRefundQuotient @@ -468,13 +473,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { // Update miner's balance let miner if (this._common.consensusType() === ConsensusType.ProofOfAuthority) { - // Backwards-compatibility check - // TODO: can be removed along VM v6 release - if ('cliqueSigner' in block.header) { - miner = block.header.cliqueSigner() - } else { - miner = Address.zero() - } + miner = block.header.cliqueSigner() } else { miner = block.header.coinbase } @@ -482,7 +481,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { const minerAccount = await state.getAccount(miner) // add the amount spent on gas to the miner's account if (this._common.isActivatedEIP(1559)) { - minerAccount.balance += results.gasUsed * inclusionFeePerGas + minerAccount.balance += results.gasUsed * inclusionFeePerGas! } else { minerAccount.balance += results.amountSpent } @@ -571,7 +570,7 @@ export async function generateTxReceipt( cumulativeGasUsed: bigint ): Promise { const baseReceipt: BaseTxReceipt = { - gasUsed: bigIntToBuffer(cumulativeGasUsed), + gasUsed: cumulativeGasUsed, bitvector: txResult.bloom.bitvector, logs: txResult.execResult.logs ?? [], } @@ -597,7 +596,7 @@ export async function generateTxReceipt( } as PostByzantiumTxReceipt } else { // Pre-Byzantium - const stateRoot = await this.stateManager.getStateRoot(true) + const stateRoot = await this.stateManager.getStateRoot() receipt = { stateRoot: stateRoot, ...baseReceipt, diff --git a/packages/vm/src/state/interface.ts b/packages/vm/src/state/interface.ts index 353e7f5d649..87db4474871 100644 --- a/packages/vm/src/state/interface.ts +++ b/packages/vm/src/state/interface.ts @@ -27,7 +27,7 @@ export interface StateManager { checkpoint(): Promise commit(): Promise revert(): Promise - getStateRoot(force?: boolean): Promise + getStateRoot(): Promise setStateRoot(stateRoot: Buffer): Promise dumpStorage(address: Address): Promise hasGenesisState(): Promise diff --git a/packages/vm/src/types.ts b/packages/vm/src/types.ts index 92b62cddd1a..0fdf8ca2a67 100644 --- a/packages/vm/src/types.ts +++ b/packages/vm/src/types.ts @@ -1,6 +1,6 @@ import { Log } from './evm/types' -export type TxReceipt = PreByzantiumTxReceipt | PostByzantiumTxReceipt | EIP2930Receipt +export type TxReceipt = PreByzantiumTxReceipt | PostByzantiumTxReceipt /** * Abstract interface with common transaction receipt fields @@ -9,7 +9,7 @@ export interface BaseTxReceipt { /** * Cumulative gas used in the block including this tx */ - gasUsed: Buffer + gasUsed: bigint /** * Bloom bitvector */ @@ -41,17 +41,3 @@ export interface PostByzantiumTxReceipt extends BaseTxReceipt { */ status: 0 | 1 } - -/** - * EIP2930Receipt, which has the same fields as PostByzantiumTxReceipt - * - * @deprecated Please use PostByzantiumTxReceipt instead - */ -export interface EIP2930Receipt extends PostByzantiumTxReceipt {} - -/** - * EIP1559Receipt, which has the same fields as PostByzantiumTxReceipt - * - * @deprecated Please use PostByzantiumTxReceipt instead - */ -export interface EIP1559Receipt extends PostByzantiumTxReceipt {} diff --git a/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts b/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts index 0af0902196f..56f61d16cfe 100644 --- a/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts @@ -52,9 +52,9 @@ tape('Constantinople: EIP-1283', async (t) => { try { const res = await vm.runCall(runCallArgs) - st.assert(res.execResult.exceptionError === undefined) - st.assert(BigInt(testCase.used) === res.gasUsed) - st.assert(BigInt(testCase.refund) === res.execResult.gasRefund!) + st.equal(res.execResult.exceptionError, undefined) + st.equal(res.execResult.gasUsed, BigInt(testCase.used)) + st.equal(res.gasRefund, BigInt(testCase.refund)) } catch (e: any) { st.fail(e.message) } diff --git a/packages/vm/tests/api/EIPs/eip-2929.spec.ts b/packages/vm/tests/api/EIPs/eip-2929.spec.ts index a23aa2e6cf5..5e7067d5290 100644 --- a/packages/vm/tests/api/EIPs/eip-2929.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2929.spec.ts @@ -99,7 +99,7 @@ tape('EIP 2929: gas cost tests', (t) => { const result = await vm.runTx({ tx }) - st.ok(result.gasUsed == expectedGasUsed) + st.equal(result.gasUsed, expectedGasUsed) } // Checks EXT(codehash,codesize,balance) of precompiles, which should be 100, diff --git a/packages/vm/tests/api/EIPs/eip-3529.spec.ts b/packages/vm/tests/api/EIPs/eip-3529.spec.ts index 17c45918b35..1d9f78adf13 100644 --- a/packages/vm/tests/api/EIPs/eip-3529.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3529.spec.ts @@ -170,9 +170,8 @@ tape('EIP-3529 tests', (t) => { tx, }) - st.equal(result.execResult.exceptionError, undefined, 'transaction executed succesfully') - st.ok(result.execResult.gasRefund !== undefined, 'gas refund is defined') - st.equal(result.execResult.gasRefund, BigInt(0), 'gas refund is zero') + st.equal(result.execResult.exceptionError, undefined, 'transaction executed successfully') + st.equal(result.gasRefund, BigInt(0), 'gas refund is zero') st.end() }) @@ -224,9 +223,8 @@ tape('EIP-3529 tests', (t) => { const actualGasUsed = startGas! - finalGas! + BigInt(21000) const maxRefund = actualGasUsed / BigInt(5) const minGasUsed = actualGasUsed - maxRefund - const gasUsed = result.execResult.gasUsed - st.ok(result.execResult.gasRefund! > maxRefund, 'refund is larger than the max refund') - st.ok(gasUsed >= minGasUsed, 'gas used respects the max refund quotient') + st.ok(result.gasRefund! > maxRefund, 'refund is larger than the max refund') + st.ok(result.gasUsed >= minGasUsed, 'gas used respects the max refund quotient') st.end() }) }) diff --git a/packages/vm/tests/api/buildBlock.spec.ts b/packages/vm/tests/api/buildBlock.spec.ts index 588ec2cf737..597c4a3f5a4 100644 --- a/packages/vm/tests/api/buildBlock.spec.ts +++ b/packages/vm/tests/api/buildBlock.spec.ts @@ -104,7 +104,7 @@ tape('BlockBuilder', async (t) => { await blockBuilder.addTransaction(tx) - const root1 = await vm.stateManager.getStateRoot(true) + const root1 = await vm.stateManager.getStateRoot() st.ok(!root0.equals(root1), 'state root should change after adding a tx') await blockBuilder.revert() diff --git a/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts b/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts index 5676b082bc1..3a1460543c4 100644 --- a/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts @@ -28,7 +28,7 @@ tape('Precompiles: hardfork availability', (t) => { value: BigInt(0), }) - st.assert(result.gasUsed === BigInt(100000)) // check that we are using gas (if address would contain no code we use 0 gas) + st.equal(result.execResult.gasUsed, BigInt(100000)) // check that we are using gas (if address would contain no code we use 0 gas) // Check if ECPAIR is available in future hard forks. const commonPetersburg = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) @@ -47,7 +47,7 @@ tape('Precompiles: hardfork availability', (t) => { value: BigInt(0), }) - st.assert(result.gasUsed === BigInt(100000)) + st.equal(result.execResult.gasUsed, BigInt(100000)) // Check if ECPAIR is not available in Homestead. const commonHomestead = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Homestead }) @@ -68,7 +68,7 @@ tape('Precompiles: hardfork availability', (t) => { value: BigInt(0), }) - st.assert(result.gasUsed === BigInt(0)) // check that we use no gas, because we are calling into an address without code. + st.equal(result.execResult.gasUsed, BigInt(0)) // check that we use no gas, because we are calling into an address without code. st.end() }) diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index 70b1a47c941..c2ef8728da0 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -1,6 +1,5 @@ import tape from 'tape' import { KECCAK256_RLP } from 'ethereumjs-util' -import { SecureTrie as Trie } from 'merkle-patricia-tree' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { DefaultStateManager } from '../../src/state' import VM from '../../src' @@ -179,17 +178,6 @@ tape('VM -> hardforkByBlockNumber, hardforkByTD, state (deprecated), blockchain' st.end() }) - t.test('should work with trie (state) provided', async (st) => { - const trie = new Trie() - const vm = await VM.create({ state: trie, activatePrecompiles: true }) - st.notDeepEqual( - (vm.stateManager as DefaultStateManager)._trie.root, - KECCAK256_RLP, - 'it has different root' - ) - st.end() - }) - t.test('should instantiate', async (st) => { const vm = await setupVM() st.deepEqual( diff --git a/packages/vm/tests/api/istanbul/eip-2200.spec.ts b/packages/vm/tests/api/istanbul/eip-2200.spec.ts index 6d47e76a639..4c6b84b9a0b 100644 --- a/packages/vm/tests/api/istanbul/eip-2200.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-2200.spec.ts @@ -72,10 +72,10 @@ tape('Istanbul: EIP-2200', async (t) => { if (testCase.err) { st.equal(res.execResult.exceptionError?.error, testCase.err) } else { - st.assert(res.execResult.exceptionError === undefined) + st.equal(res.execResult.exceptionError, undefined) } - st.assert(BigInt(testCase.used) === res.gasUsed) - st.assert(BigInt(testCase.refund) === res.execResult.gasRefund!) + st.equal(res.execResult.gasUsed, BigInt(testCase.used)) + st.equal(res.gasRefund!, BigInt(testCase.refund)) } catch (e: any) { st.fail(e.message) } diff --git a/packages/vm/tests/api/runBlock.spec.ts b/packages/vm/tests/api/runBlock.spec.ts index afdc1cd84ea..1d3530a9f93 100644 --- a/packages/vm/tests/api/runBlock.spec.ts +++ b/packages/vm/tests/api/runBlock.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Address, rlp, KECCAK256_RLP, Account, bufferToBigInt } from 'ethereumjs-util' +import { Address, rlp, KECCAK256_RLP, Account } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block } from '@ethereumjs/block' import { @@ -171,14 +171,14 @@ tape('runBlock() -> successful API parameter usage', async (t) => { skipBlockValidation: true, generate: true, }) - st.ok( - txResultChainstart.results[0].gasUsed === - BigInt(21000) + BigInt(68) * BigInt(3) + BigInt(3) + BigInt(50), + st.equal( + txResultChainstart.results[0].gasUsed, + BigInt(21000) + BigInt(68) * BigInt(3) + BigInt(3) + BigInt(50), 'tx charged right gas on chainstart hard fork' ) - st.ok( - txResultMuirGlacier.results[0].gasUsed === - BigInt(21000) + BigInt(32000) + BigInt(16) * BigInt(3) + BigInt(3) + BigInt(800), + st.equal( + txResultMuirGlacier.results[0].gasUsed, + BigInt(21000) + BigInt(32000) + BigInt(16) * BigInt(3) + BigInt(3) + BigInt(800), 'tx charged right gas on muir glacier hard fork' ) }) @@ -302,7 +302,7 @@ tape('runBlock() -> runtime behavior', async (t) => { // verify that the refund account gets the summed balance of the original refund account + two child DAO accounts const msg = 'should transfer balance from DAO children to the Refund DAO account in the DAO fork' - t.ok(DAORefundAccount.balance === BigInt(0x7777), msg) + t.equal(DAORefundAccount.balance, BigInt(0x7777), msg) }) t.test('should allocate to correct clique beneficiary', async (t) => { @@ -393,7 +393,7 @@ tape('should correctly reflect generated fields', async (t) => { t.ok(results.block.header.receiptTrie.equals(KECCAK256_RLP)) t.ok(results.block.header.transactionsTrie.equals(KECCAK256_RLP)) - t.equals(results.block.header.gasUsed, BigInt(0)) + t.equal(results.block.header.gasUsed, BigInt(0)) }) async function runWithHf(hardfork: string) { @@ -457,14 +457,11 @@ tape('runBlock() -> tx types', async (t) => { generate: true, }) - st.ok( - res.gasUsed === - res.receipts - .map((r) => r.gasUsed) - .reduce( - (prevValue: bigint, currValue: Buffer) => prevValue + bufferToBigInt(currValue), - BigInt(0) - ), + st.equal( + res.gasUsed, + res.receipts + .map((r) => r.gasUsed) + .reduce((prevValue, currValue) => prevValue + currValue, BigInt(0)), "gas used should equal transaction's total gasUsed" ) } diff --git a/packages/vm/tests/api/runCall.spec.ts b/packages/vm/tests/api/runCall.spec.ts index 3487adebf9b..fe5d73b911a 100644 --- a/packages/vm/tests/api/runCall.spec.ts +++ b/packages/vm/tests/api/runCall.spec.ts @@ -167,7 +167,7 @@ tape('Ensure that precompile activation creates non-empty accounts', async (t) = const resultNotActivated = await vmNotActivated.runCall(runCallArgs) const resultActivated = await vmActivated.runCall(runCallArgs) - const diff = resultNotActivated.gasUsed - resultActivated.gasUsed + const diff = resultNotActivated.execResult.gasUsed - resultActivated.execResult.gasUsed const expected = BigInt(common.param('gasPrices', 'callNewAccount')) t.equal(diff, expected, 'precompiles are activated') @@ -220,8 +220,8 @@ tape('Ensure that Istanbul sstoreCleanRefundEIP2200 gas is applied correctly', a const result = await vm.runCall(runCallArgs) - t.equal(result.gasUsed, BigInt(5812), 'gas used correct') - t.equal(result.execResult.gasRefund!, BigInt(4200), 'gas refund correct') + t.equal(result.execResult.gasUsed, BigInt(5812), 'gas used correct') + t.equal(result.gasRefund, BigInt(4200), 'gas refund correct') t.end() }) @@ -247,8 +247,8 @@ tape('ensure correct gas for pre-constantinople sstore', async (t) => { const result = await vm.runCall(runCallArgs) - t.equal(result.gasUsed, BigInt(20006), 'gas used correct') - t.equal(result.execResult.gasRefund!, BigInt(0), 'gas refund correct') + t.equal(result.execResult.gasUsed, BigInt(20006), 'gas used correct') + t.equal(result.gasRefund, BigInt(0), 'gas refund correct') t.end() }) @@ -276,8 +276,8 @@ tape('ensure correct gas for calling non-existent accounts in homestead', async // 7x push + gas + sub + call + callNewAccount // 7*3 + 2 + 3 + 40 + 25000 = 25066 - t.equal(result.gasUsed, BigInt(25066), 'gas used correct') - t.equal(result.execResult.gasRefund!, BigInt(0), 'gas refund correct') + t.equal(result.execResult.gasUsed, BigInt(25066), 'gas used correct') + t.equal(result.gasRefund, BigInt(0), 'gas refund correct') t.end() }) @@ -306,8 +306,8 @@ tape( const result = await vm.runCall(runCallArgs) - t.ok(runCallArgs.gasLimit === result.gasUsed, 'gas used correct') - t.equal(result.execResult.gasRefund!, BigInt(0), 'gas refund correct') + t.equal(runCallArgs.gasLimit, result.execResult.gasUsed, 'gas used correct') + t.equal(result.gasRefund, BigInt(0), 'gas refund correct') t.ok(result.execResult.exceptionError!.error == ERROR.OUT_OF_GAS, 'call went out of gas') t.end() @@ -337,9 +337,9 @@ tape('ensure selfdestruct pays for creating new accounts', async (t) => { const result = await vm.runCall(runCallArgs) // gas: 5000 (selfdestruct) + 25000 (call new account) + push (1) = 30003 - t.equal(result.gasUsed, BigInt(30003), 'gas used correct') + t.equal(result.execResult.gasUsed, BigInt(30003), 'gas used correct') // selfdestruct refund - t.equal(result.execResult.gasRefund!, BigInt(24000), 'gas refund correct') + t.equal(result.gasRefund, BigInt(24000), 'gas refund correct') t.end() }) @@ -403,8 +403,8 @@ tape('ensure that sstores pay for the right gas costs pre-byzantium', async (t) } const result = await vm.runCall(runCallArgs) - t.equal(result.gasUsed, BigInt(callData.gas), 'gas used correct') - t.equal(result.execResult.gasRefund, BigInt(callData.refund), 'gas refund correct') + t.equal(result.execResult.gasUsed, BigInt(callData.gas), 'gas used correct') + t.equal(result.gasRefund, BigInt(callData.refund), 'gas refund correct') } t.end() diff --git a/packages/vm/tests/api/runCode.spec.ts b/packages/vm/tests/api/runCode.spec.ts index 0f4543f20d7..aa1d208c3dd 100644 --- a/packages/vm/tests/api/runCode.spec.ts +++ b/packages/vm/tests/api/runCode.spec.ts @@ -102,6 +102,7 @@ tape('VM.runCode: RunCodeOptions', (t) => { const runCodeArgs = { value: BigInt(-10), + gasLimit: BigInt(1000000), } try { diff --git a/packages/vm/tests/api/runTx.spec.ts b/packages/vm/tests/api/runTx.spec.ts index a477da63183..5908a899e81 100644 --- a/packages/vm/tests/api/runTx.spec.ts +++ b/packages/vm/tests/api/runTx.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import { Account, Address, MAX_INTEGER, toBuffer, bufferToBigInt } from 'ethereumjs-util' +import { Account, Address, MAX_INTEGER } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { @@ -67,8 +67,9 @@ tape('runTx() -> successful API parameter usage', async (t) => { const blockGasUsed = BigInt(1000) const res = await vm.runTx({ tx, blockGasUsed }) - t.ok( - bufferToBigInt(res.receipt.gasUsed) === blockGasUsed + res.gasUsed, + t.equal( + res.receipt.gasUsed, + blockGasUsed + res.gasUsed, 'receipt.gasUsed should equal block gas used + tx gas used' ) t.end() @@ -254,7 +255,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { let tx = getTransaction(vm._common, 2, true) as FeeMarketEIP1559Transaction const address = tx.getSenderAddress() tx = Object.create(tx) - const maxCost = tx.gasLimit * tx.maxFeePerGas + const maxCost: bigint = tx.gasLimit * tx.maxFeePerGas await vm.stateManager.putAccount(address, createAccount(BigInt(0), maxCost - BigInt(1))) try { await vm.runTx({ tx }) @@ -451,8 +452,9 @@ tape('runTx() -> API return values', async (t) => { await vm.stateManager.putAccount(caller, acc) const res = await vm.runTx({ tx }) - t.true( - res.execResult.gasUsed === BigInt(0), + t.equal( + res.execResult.gasUsed, + BigInt(0), `execution result -> gasUsed -> 0 (${txType.name})` ) t.equal( @@ -465,10 +467,7 @@ tape('runTx() -> API return values', async (t) => { Buffer.from([]), `execution result -> return value -> empty Buffer (${txType.name})` ) - t.true( - res.execResult.gasRefund! === BigInt(0), - `execution result -> gasRefund -> 0 (${txType.name})` - ) + t.equal(res.gasRefund, BigInt(0), `gasRefund -> 0 (${txType.name})`) } t.end() }) @@ -484,7 +483,7 @@ tape('runTx() -> API return values', async (t) => { const res = await vm.runTx({ tx }) - t.deepEqual( + t.equal( res.gasUsed, tx.getBaseFee(), `runTx result -> gasUsed -> tx.getBaseFee() (${txType.name})` @@ -496,13 +495,13 @@ tape('runTx() -> API return values', async (t) => { ? tx.maxPriorityFeePerGas : tx.maxFeePerGas - baseFee const gasPrice = inclusionFeePerGas + baseFee - t.deepEquals( + t.equal( res.amountSpent, res.gasUsed * gasPrice, `runTx result -> amountSpent -> gasUsed * gasPrice (${txType.name})` ) } else { - t.deepEqual( + t.equal( res.amountSpent, res.gasUsed * (tx).gasPrice, `runTx result -> amountSpent -> gasUsed * gasPrice (${txType.name})` @@ -514,10 +513,10 @@ tape('runTx() -> API return values', async (t) => { Buffer.from('00'.repeat(256), 'hex'), `runTx result -> bloom.bitvector -> should be empty (${txType.name})` ) - t.deepEqual( + t.equal( res.receipt.gasUsed, - toBuffer('0x' + res.gasUsed.toString(16)), - `runTx result -> receipt.gasUsed -> result.gasUsed as Buffer (${txType.name})` + res.gasUsed, + `runTx result -> receipt.gasUsed -> result.gasUsed (${txType.name})` ) t.deepEqual( res.receipt.bitvector, @@ -608,7 +607,7 @@ tape('runTx() -> consensus bugs', async (t) => { const block = Block.fromBlockData({ header: { baseFeePerGas: 0x0c } }, { common }) const result = await vm.runTx({ tx, block }) - t.ok(result.gasUsed === BigInt(66382), 'should use the right amount of gas and not consume all') + t.equal(result.gasUsed, BigInt(66382), 'should use the right amount of gas and not consume all') t.end() }) }) diff --git a/packages/vm/tests/api/state/accountExists.spec.ts b/packages/vm/tests/api/state/accountExists.spec.ts index 538d0932eea..8b3108e1c4d 100644 --- a/packages/vm/tests/api/state/accountExists.spec.ts +++ b/packages/vm/tests/api/state/accountExists.spec.ts @@ -42,7 +42,7 @@ tape('correctly apply new account gas fee on pre-Spurious Dragon hardforks', asy } const result = await vm.runCall(runCallArgs) - t.ok(result.gasUsed === BigInt(53552), 'vm correctly applies new account gas price') + t.equal(result.execResult.gasUsed, BigInt(53552), 'vm correctly applies new account gas price') t.end() }) @@ -87,7 +87,11 @@ tape( } const result = await vm.runCall(runCallArgs) - t.ok(result.gasUsed === BigInt(28552), 'new account price not applied as empty account exists') + t.equal( + result.execResult.gasUsed, + BigInt(28552), + 'new account price not applied as empty account exists' + ) t.end() } ) From a1645db13caa850caff406dff7567a86285c2d17 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Mon, 4 Apr 2022 13:05:43 +0200 Subject: [PATCH 26/44] Implement EIP3074: Authcall (#1789) * add eip3074 * remove extra space * use vm.create instead of new vm Co-authored-by: Ryan Ghods --- packages/common/src/eips/3074.json | 25 + packages/common/src/eips/index.ts | 1 + packages/vm/src/evm/eei.ts | 22 +- packages/vm/src/evm/evm.ts | 4 +- packages/vm/src/evm/message.ts | 6 + packages/vm/src/evm/opcodes/EIP2929.ts | 4 +- packages/vm/src/evm/opcodes/codes.ts | 7 + packages/vm/src/evm/opcodes/functions.ts | 73 +- packages/vm/src/evm/opcodes/gas.ts | 57 ++ packages/vm/src/exceptions.ts | 4 + packages/vm/src/index.ts | 5 +- .../tests/api/EIPs/eip-3074-authcall.spec.ts | 678 ++++++++++++++++++ 12 files changed, 876 insertions(+), 10 deletions(-) create mode 100644 packages/common/src/eips/3074.json create mode 100644 packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts diff --git a/packages/common/src/eips/3074.json b/packages/common/src/eips/3074.json new file mode 100644 index 00000000000..ea14c792a37 --- /dev/null +++ b/packages/common/src/eips/3074.json @@ -0,0 +1,25 @@ +{ + "name": "EIP-3074", + "number": 3074, + "comment": "AUTH and AUTHCALL opcodes", + "url": "https://eips.ethereum.org/EIPS/eip-3074", + "status": "Review", + "minimumHardfork": "london", + "gasConfig": {}, + "gasPrices": { + "auth": { + "v": 3100, + "d": "Gas cost of the AUTH opcode" + }, + "authcall": { + "v": 0, + "d": "Gas cost of the AUTHCALL opcode" + }, + "authcallValueTransfer": { + "v": 6700, + "d": "Paid for CALL when the value transfer is non-zero" + } + }, + "vm": {}, + "pow": {} +} diff --git a/packages/common/src/eips/index.ts b/packages/common/src/eips/index.ts index 979111774f5..2f15f93113c 100644 --- a/packages/common/src/eips/index.ts +++ b/packages/common/src/eips/index.ts @@ -9,6 +9,7 @@ export const EIPs: eipsType = { 2718: require('./2718.json'), 2929: require('./2929.json'), 2930: require('./2930.json'), + 3074: require('./3074.json'), 3198: require('./3198.json'), 3529: require('./3529.json'), 3540: require('./3540.json'), diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index e0959a6e947..5970c5d2efe 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -33,8 +33,8 @@ export interface Env { origin: Address block: Block contract: Account - // Different than address for DELEGATECALL and CALLCODE - codeAddress: Address + codeAddress: Address /** Different than address for DELEGATECALL and CALLCODE */ + auth?: Address /** EIP-3074 AUTH parameter */ } /** @@ -486,6 +486,24 @@ export default class EEI { return this._baseCall(msg) } + /** + * Sends a message with arbitrary data to a given address path. + */ + async authcall(gasLimit: bigint, address: Address, value: bigint, data: Buffer): Promise { + const msg = new Message({ + caller: this._env.auth, + gasLimit, + to: address, + value, + data, + isStatic: this._env.isStatic, + depth: this._env.depth + 1, + authcallOrigin: this._env.address, + }) + + return this._baseCall(msg) + } + /** * Message-call into this account with an alternative account's code. */ diff --git a/packages/vm/src/evm/evm.ts b/packages/vm/src/evm/evm.ts index 2ac41dceea1..9b9c86fe37f 100644 --- a/packages/vm/src/evm/evm.ts +++ b/packages/vm/src/evm/evm.ts @@ -242,7 +242,7 @@ export default class EVM { } async _executeCall(message: Message): Promise { - const account = await this._state.getAccount(message.caller) + const account = await this._state.getAccount(message.authcallOrigin ?? message.caller) // Reduce tx value from sender if (!message.delegatecall) { await this._reduceSenderBalance(account, message) @@ -632,7 +632,7 @@ export default class EVM { async _reduceSenderBalance(account: Account, message: Message): Promise { account.balance -= message.value - const result = this._state.putAccount(message.caller, account) + const result = this._state.putAccount(message.authcallOrigin ?? message.caller, account) if (this._vm.DEBUG) { debug(`Reduced sender (${message.caller}) balance (-> ${account.balance})`) } diff --git a/packages/vm/src/evm/message.ts b/packages/vm/src/evm/message.ts index 7d938ef6e65..267a3c5ba75 100644 --- a/packages/vm/src/evm/message.ts +++ b/packages/vm/src/evm/message.ts @@ -15,6 +15,11 @@ export default class Message { salt: Buffer selfdestruct: any delegatecall: boolean + /** + * This is used to store the origin of the AUTHCALL, + * the purpose is to figure out where `value` should be taken from (not from `caller`) + */ + authcallOrigin?: Address constructor(opts: any) { this.to = opts.to @@ -30,6 +35,7 @@ export default class Message { this.salt = opts.salt // For CREATE2, TODO: Move from here this.selfdestruct = opts.selfdestruct // TODO: Move from here this.delegatecall = opts.delegatecall || false + this.authcallOrigin = opts.authcallOrigin if (this.value < 0) { throw new Error(`value field cannot be negative, received ${this.value}`) diff --git a/packages/vm/src/evm/opcodes/EIP2929.ts b/packages/vm/src/evm/opcodes/EIP2929.ts index f2887cf2eca..48f4bd08247 100644 --- a/packages/vm/src/evm/opcodes/EIP2929.ts +++ b/packages/vm/src/evm/opcodes/EIP2929.ts @@ -18,7 +18,7 @@ export function accessAddressEIP2929( address: Address, common: Common, chargeGas = true, - isSelfdestruct = false + isSelfdestructOrAuthcall = false ): bigint { if (!common.isActivatedEIP(2929)) return BigInt(0) @@ -35,7 +35,7 @@ export function accessAddressEIP2929( return BigInt(common.param('gasPrices', 'coldaccountaccess')) } // Warm: (selfdestruct beneficiary address reads are not charged when warm) - } else if (chargeGas && !isSelfdestruct) { + } else if (chargeGas && !isSelfdestructOrAuthcall) { return BigInt(common.param('gasPrices', 'warmstorageread')) } return BigInt(0) diff --git a/packages/vm/src/evm/opcodes/codes.ts b/packages/vm/src/evm/opcodes/codes.ts index 8b7c77ab177..37bc4db7b33 100644 --- a/packages/vm/src/evm/opcodes/codes.ts +++ b/packages/vm/src/evm/opcodes/codes.ts @@ -279,6 +279,13 @@ const eipOpcodes: { eip: number; opcodes: OpcodeEntry }[] = [ 0x5f: { name: 'PUSH0', isAsync: false, dynamicGas: false }, }, }, + { + eip: 3074, + opcodes: { + 0xf6: { name: 'AUTH', isAsync: true, dynamicGas: false }, + 0xf7: { name: 'AUTHCALL', isAsync: true, dynamicGas: true }, + }, + }, ] /** diff --git a/packages/vm/src/evm/opcodes/functions.ts b/packages/vm/src/evm/opcodes/functions.ts index b737a410656..320f99d69ea 100644 --- a/packages/vm/src/evm/opcodes/functions.ts +++ b/packages/vm/src/evm/opcodes/functions.ts @@ -5,9 +5,12 @@ import { KECCAK256_NULL, TWO_POW256, MAX_INTEGER_BIGINT, - setLengthLeft, bufferToBigInt, bigIntToBuffer, + setLengthLeft, + ecrecover, + publicToAddress, + SECP256K1_ORDER_DIV_2, } from 'ethereumjs-util' import { addressToBuffer, @@ -25,6 +28,8 @@ import { ERROR } from '../../exceptions' import { RunState } from './../interpreter' import { exponentation } from '.' +const EIP3074MAGIC = Buffer.from('03', 'hex') + export interface SyncOpHandler { (runState: RunState, common: Common): void } @@ -1013,7 +1018,71 @@ export const handlers: Map = new Map([ runState.stack.push(ret) }, ], - // 0x06: STATICCALL + // 0xf6: AUTH + [ + 0xf6, + async function (runState) { + const [commitUnpadded, yParity, r, s] = runState.stack.popN(4) + if (s > SECP256K1_ORDER_DIV_2) { + trap(ERROR.AUTH_INVALID_S) + } + + const commit = setLengthLeft(bigIntToBuffer(commitUnpadded), 32) + const paddedInvokerAddress = setLengthLeft(runState.eei._env.address.buf, 32) + const chainId = setLengthLeft(bigIntToBuffer(runState.eei.getChainId()), 32) + const message = Buffer.concat([EIP3074MAGIC, chainId, paddedInvokerAddress, commit]) + const msgHash = keccak256(message) + + let recover + try { + recover = ecrecover(msgHash, Number(yParity) + 27, bigIntToBuffer(r), bigIntToBuffer(s)) + } catch (e) { + // Malformed signature, push 0 on stack, clear auth variable and return + runState.stack.push(BigInt(0)) + runState.eei._env.auth = undefined + return + } + + const addressBuffer = publicToAddress(recover) + const address = new Address(addressBuffer) + runState.eei._env.auth = address + + const addressBigInt = bufferToBigInt(addressBuffer) + runState.stack.push(addressBigInt) + }, + ], + // 0xf7: AUTHCALL + [ + 0xf7, + async function (runState) { + const [ + _currentGasLimit, + addr, + value, + _valueExt, + argsOffset, + argsLength, + retOffset, + retLength, + ] = runState.stack.popN(8) + + const toAddress = new Address(addressToBuffer(addr)) + + const gasLimit = runState.messageGasLimit! + runState.messageGasLimit = undefined + + let data = Buffer.alloc(0) + if (argsLength !== BigInt(0)) { + data = runState.memory.read(Number(argsOffset), Number(argsLength)) + } + + const ret = await runState.eei.authcall(gasLimit, toAddress, value, data) + // Write return data to memory + writeCallOutput(runState, retOffset, retLength) + runState.stack.push(ret) + }, + ], + // 0xfa: STATICCALL [ 0xfa, async function (runState) { diff --git a/packages/vm/src/evm/opcodes/gas.ts b/packages/vm/src/evm/opcodes/gas.ts index e186281c8e2..c9479cf5b76 100644 --- a/packages/vm/src/evm/opcodes/gas.ts +++ b/packages/vm/src/evm/opcodes/gas.ts @@ -440,6 +440,63 @@ export const dynamicGasHandlers: Map { + if (runState.eei._env.auth === undefined) { + trap(ERROR.AUTHCALL_UNSET) + } + + const [ + currentGasLimit, + addr, + value, + valueExt, + argsOffset, + argsLength, + retOffset, + retLength, + ] = runState.stack.peek(8) + + if (valueExt !== 0n) { + trap(ERROR.AUTHCALL_NONZERO_VALUEEXT) + } + + const toAddress = new Address(addressToBuffer(addr)) + + gas += BigInt(common.param('gasPrices', 'warmstorageread')) + + gas += accessAddressEIP2929(runState, toAddress, common, true, true) + + gas += subMemUsage(runState, argsOffset, argsLength, common) + gas += subMemUsage(runState, retOffset, retLength, common) + + if (value > BigInt(0)) { + gas += BigInt(common.param('gasPrices', 'authcallValueTransfer')) + const account = await runState.stateManager.getAccount(toAddress) + if (account.isEmpty()) { + gas += BigInt(common.param('gasPrices', 'callNewAccount')) + } + } + + let gasLimit = maxCallGas( + runState.eei.getGasLeft() - gas, + runState.eei.getGasLeft() - gas, + runState, + common + ) + if (currentGasLimit !== BigInt(0)) { + if (currentGasLimit > gasLimit) { + trap(ERROR.OUT_OF_GAS) + } + gasLimit = currentGasLimit + } + + runState.messageGasLimit = gasLimit + return gas + }, + ], [ /* STATICCALL */ 0xfa, diff --git a/packages/vm/src/exceptions.ts b/packages/vm/src/exceptions.ts index 98e63dbcce9..31239536519 100644 --- a/packages/vm/src/exceptions.ts +++ b/packages/vm/src/exceptions.ts @@ -20,6 +20,10 @@ export enum ERROR { INVALID_EOF_FORMAT = 'invalid EOF format', INITCODE_SIZE_VIOLATION = 'initcode exceeds max initcode size', + AUTHCALL_UNSET = 'attempting to AUTHCALL without AUTH set', + AUTHCALL_NONZERO_VALUEEXT = 'attempting to execute AUTHCALL with nonzero external value', + AUTH_INVALID_S = 'invalid Signature: s-values greater than secp256k1n/2 are considered invalid', + // BLS errors BLS_12_381_INVALID_INPUT_LENGTH = 'invalid input length', BLS_12_381_POINT_NOT_ON_CURVE = 'point not on curve', diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index 9fe69d8f2bb..8ac9e3854bd 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -49,6 +49,7 @@ export interface VMOpts { * - [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) - Typed Transactions * - [EIP-2929](https://eips.ethereum.org/EIPS/eip-2929) - Gas cost increases for state access opcodes * - [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) - Access List Transaction Type + * - [EIP-3074](https://eips.ethereum.org/EIPS/eip-3074) - AUTH and AUTHCALL opcodes * - [EIP-3198](https://eips.ethereum.org/EIPS/eip-3198) - BASEFEE opcode * - [EIP-3529](https://eips.ethereum.org/EIPS/eip-3529) - Reduction in refunds * - [EIP-3540](https://eips.ethereum.org/EIPS/eip-3541) - EVM Object Format (EOF) v1 (`experimental`) @@ -254,8 +255,8 @@ export default class VM extends AsyncEventEmitter { if (opts.common) { // Supported EIPs const supportedEIPs = [ - 1153, 1559, 2315, 2537, 2565, 2718, 2929, 2930, 3198, 3529, 3540, 3541, 3607, 3651, 3670, - 3855, 3860, 4399, + 1153, 1559, 2315, 2537, 2565, 2718, 2929, 2930, 3074, 3198, 3529, 3540, 3541, 3607, 3651, + 3670, 3855, 3860, 4399, ] for (const eip of opts.common.eips()) { if (!supportedEIPs.includes(eip)) { diff --git a/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts b/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts new file mode 100644 index 00000000000..8658dfe46b5 --- /dev/null +++ b/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts @@ -0,0 +1,678 @@ +import tape from 'tape' +import { + Address, + bigIntToBuffer, + bufferToBigInt, + ecsign, + keccak256, + privateToAddress, + setLengthLeft, + toBuffer, + zeros, +} from 'ethereumjs-util' +import Common, { Chain, Hardfork } from '@ethereumjs/common' +import VM from '../../../src' +import { Transaction } from '@ethereumjs/tx' +import { Block } from '@ethereumjs/block' +import { ERROR } from '../../../src/exceptions' +import { InterpreterStep } from '../../../src/evm/interpreter' + +const common = new Common({ + chain: Chain.Mainnet, + hardfork: Hardfork.London, + eips: [3074], +}) + +// setup the accounts for this test +const privateKey = Buffer.from( + 'e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', + 'hex' +) + +const block = Block.fromBlockData( + { + header: { + baseFeePerGas: BigInt(7), + }, + }, + { common } +) + +const callerPrivateKey = Buffer.from('44'.repeat(32), 'hex') +const callerAddress = new Address(privateToAddress(callerPrivateKey)) +const PREBALANCE = BigInt(10000000) + +const address = new Address(privateToAddress(privateKey)) +const contractAddress = new Address(Buffer.from('ff'.repeat(20), 'hex')) +const contractStorageAddress = new Address(Buffer.from('ee'.repeat(20), 'hex')) + +// Bytecode to exit call frame and return the topmost stack item +const RETURNTOP = Buffer.from('60005260206000F3', 'hex') +// Bytecode to store CALLER in slot 0 and GAS in slot 1 and the first 32 bytes of the input in slot 2 +// Returns the entire input as output +const STORECALLER = Buffer.from('5A60015533600055600035600255366000600037366000F3', 'hex') + +/** + * This signs a message to be used for AUTH opcodes + * @param commitUnpadded - The commit which we want to sign + * @param address - The contract address we are using AUTH on + * @param privateKey - The private key of the account to sign + * @returns The signed message + */ +function signMessage(commitUnpadded: Buffer, address: Address, privateKey: Buffer) { + const commit = setLengthLeft(commitUnpadded, 32) + const paddedInvokerAddress = setLengthLeft(address.buf, 32) + const chainId = setLengthLeft(bigIntToBuffer(common.chainId()), 32) + const message = Buffer.concat([Buffer.from('03', 'hex'), chainId, paddedInvokerAddress, commit]) + const msgHash = keccak256(message) + return ecsign(msgHash, privateKey, 0) +} + +/** + * This method returns the bytecode in order to set AUTH + * @param commitUnpadded - The commit + * @param signature - The signature as obtained by `signMessage` + */ +function getAuthCode(commitUnpadded: Buffer, signature: any) { + const commit = setLengthLeft(commitUnpadded, 32) + let v + if (signature.v == 27) { + v = setLengthLeft(Buffer.from('00', 'hex'), 32) + } else if (signature.v == 28) { + v = setLengthLeft(Buffer.from('01', 'hex'), 32) + } else { + setLengthLeft(toBuffer(signature.v), 32) + } + + const PUSH32 = Buffer.from('7F', 'hex') + const AUTH = Buffer.from('F6', 'hex') + // This bytecode setups the stack to be used for AUTH + return Buffer.concat([PUSH32, signature.s, PUSH32, signature.r, PUSH32, v, PUSH32, commit, AUTH]) +} + +// This type has all arguments to be used on AUTHCALL +type AuthcallData = { + gasLimit?: bigint + address: Address + value?: bigint + valueExt?: bigint + argsOffset?: bigint + argsLength?: bigint + retOffset?: bigint + retLength?: bigint +} + +/** + * Returns the bytecode to store a `value` at memory slot `position` + * @param position + * @param value + */ +function MSTORE(position: Buffer, value: Buffer) { + return Buffer.concat([ + Buffer.from('7F', 'hex'), + setLengthLeft(value, 32), + Buffer.from('7F', 'hex'), + setLengthLeft(position, 32), + Buffer.from('52', 'hex'), + ]) +} + +/** + * This method returns the bytecode to invoke AUTHCALL with the desired data + * @param data - The data to be use for AUTHCALL, anything not present will be zeroed out + * @returns - The bytecode to execute AUTHCALL + */ +function getAuthCallCode(data: AuthcallData) { + const ZEROS32 = zeros(32) + const gasLimitBuffer = setLengthLeft(data.gasLimit ? bigIntToBuffer(data.gasLimit) : ZEROS32, 32) + const addressBuffer = setLengthLeft(data.address.buf, 32) + const valueBuffer = setLengthLeft(data.value ? bigIntToBuffer(data.value) : ZEROS32, 32) + const valueExtBuffer = setLengthLeft(data.valueExt ? bigIntToBuffer(data.valueExt) : ZEROS32, 32) + const argsOffsetBuffer = setLengthLeft( + data.argsOffset ? bigIntToBuffer(data.argsOffset) : ZEROS32, + 32 + ) + const argsLengthBuffer = setLengthLeft( + data.argsLength ? bigIntToBuffer(data.argsLength) : ZEROS32, + 32 + ) + const retOffsetBuffer = setLengthLeft( + data.retOffset ? bigIntToBuffer(data.retOffset) : ZEROS32, + 32 + ) + const retLengthBuffer = setLengthLeft( + data.retLength ? bigIntToBuffer(data.retLength) : ZEROS32, + 32 + ) + const PUSH32 = Buffer.from('7f', 'hex') + const AUTHCALL = Buffer.from('f7', 'hex') + const order = [ + retLengthBuffer, + retOffsetBuffer, + argsLengthBuffer, + argsOffsetBuffer, + valueExtBuffer, + valueBuffer, + addressBuffer, + gasLimitBuffer, + ] + const bufferList = [] + order.map((e: Buffer) => { + bufferList.push(PUSH32) + bufferList.push(e) + }) + bufferList.push(AUTHCALL) + return Buffer.concat(bufferList) +} + +// This flips the signature: the result is a signature which has the same public key upon key recovery, +// But the s-value is now > N_DIV_2 +function flipSignature(signature: any) { + const s = bufferToBigInt(signature.s) + const flipped = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n - s + + if (signature.v == 27) { + signature.v = 28 + } else { + signature.v = 27 + } + signature.s = setLengthLeft(bigIntToBuffer(flipped), 32) + return signature +} + +tape('EIP-3074 AUTH', (t) => { + t.test('Should execute AUTH correctly', async (st) => { + const vm = await VM.create({ common }) + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const code = Buffer.concat([getAuthCode(message, signature), RETURNTOP]) + + await vm.stateManager.putContractCode(contractAddress, code) + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + const account = await vm.stateManager.getAccount(callerAddress) + account.balance = BigInt(10000000) + await vm.stateManager.putAccount(callerAddress, account) + + const result = await vm.runTx({ tx, block }) + const buf = result.execResult.returnValue.slice(12) + st.ok(buf.equals(address.buf), 'auth returned right address') + }) + t.test('Should not set AUTH if signature is invalid', async (st) => { + const vm = await VM.create({ common }) + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + signature.r = signature.s + const code = Buffer.concat([getAuthCode(message, signature), RETURNTOP]) + + await vm.stateManager.putContractCode(contractAddress, code) + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + const account = await vm.stateManager.getAccount(callerAddress) + account.balance = BigInt(10000000) + await vm.stateManager.putAccount(callerAddress, account) + + const result = await vm.runTx({ tx, block }) + const buf = result.execResult.returnValue + st.ok(buf.equals(zeros(32)), 'auth puts 0 on stack on invalid signature') + }) + + t.test('Should throw if signature s > N_DIV_2', async (st) => { + const vm = await VM.create({ common }) + const message = Buffer.from('01', 'hex') + const signature = flipSignature(signMessage(message, contractAddress, privateKey)) + const code = Buffer.concat([getAuthCode(message, signature), RETURNTOP]) + + await vm.stateManager.putContractCode(contractAddress, code) + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + const account = await vm.stateManager.getAccount(callerAddress) + account.balance = BigInt(10000000) + await vm.stateManager.putAccount(callerAddress, account) + + const result = await vm.runTx({ tx, block }) + st.equal(result.execResult.exceptionError?.error, ERROR.AUTH_INVALID_S, 'threw correct error') + }) + + t.test('Should be able to call AUTH mutliple times', async (st) => { + const vm = await VM.create({ common }) + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const signature2 = signMessage(message, contractAddress, callerPrivateKey) + const code = Buffer.concat([ + getAuthCode(message, signature), + getAuthCode(message, signature2), + RETURNTOP, + ]) + + await vm.stateManager.putContractCode(contractAddress, code) + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + const account = await vm.stateManager.getAccount(callerAddress) + account.balance = BigInt(10000000) + await vm.stateManager.putAccount(callerAddress, account) + + const result = await vm.runTx({ tx, block }) + const buf = result.execResult.returnValue.slice(12) + st.ok(buf.equals(callerAddress.buf), 'auth returned right address') + }) +}) + +// Setups the environment for the VM, puts `code` at contractAddress and also puts the STORECALLER bytecode at the contractStorageAddress +async function setupVM(code: Buffer) { + const vm = await VM.create({ common }) + await vm.stateManager.putContractCode(contractAddress, code) + await vm.stateManager.putContractCode(contractStorageAddress, STORECALLER) + const account = await vm.stateManager.getAccount(callerAddress) + account.balance = PREBALANCE + await vm.stateManager.modifyAccountFields(callerAddress, { balance: PREBALANCE }) + return vm +} + +tape('EIP-3074 AUTHCALL', (t) => { + t.test('Should execute AUTHCALL correctly', async (st) => { + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const code = Buffer.concat([ + getAuthCode(message, signature), + getAuthCallCode({ + address: contractStorageAddress, + }), + RETURNTOP, + ]) + const vm = await setupVM(code) + + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + const result = await vm.runTx({ tx, block }) + + const buf = result.execResult.returnValue.slice(31) + st.ok(buf.equals(Buffer.from('01', 'hex')), 'authcall success') + + const storage = await vm.stateManager.getContractStorage(contractStorageAddress, zeros(32)) + st.ok(storage.equals(address.buf), 'caller set correctly') + }) + + t.test('Should forward max call gas when gas set to 0', async (st) => { + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const code = Buffer.concat([ + getAuthCode(message, signature), + getAuthCallCode({ + address: contractStorageAddress, + }), + RETURNTOP, + ]) + const vm = await setupVM(code) + + let gas: bigint + + vm.on('step', (e: InterpreterStep) => { + if (e.opcode.name === 'AUTHCALL') { + gas = e.gasLeft + } + }) + + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + await vm.runTx({ tx, block }) + + const gasUsed = await vm.stateManager.getContractStorage( + contractStorageAddress, + Buffer.from('00'.repeat(31) + '01', 'hex') + ) + const gasBigInt = bufferToBigInt(gasUsed) + const preGas = + gas! - + BigInt(common.param('gasPrices', 'warmstorageread')) - + BigInt(common.param('gasPrices', 'coldaccountaccess')) + const expected = preGas - preGas / 64n - 2n + st.equal(gasBigInt, expected, 'forwarded max call gas') + }) + + t.test('Should forward max call gas when gas set to 0 - warm account', async (st) => { + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const code = Buffer.concat([ + getAuthCode(message, signature), + getAuthCallCode({ + address: contractStorageAddress, + }), + getAuthCallCode({ + address: contractStorageAddress, + }), + RETURNTOP, + ]) + const vm = await setupVM(code) + + let gas: bigint + + vm.on('step', async (e: InterpreterStep) => { + if (e.opcode.name === 'AUTHCALL') { + gas = e.gasLeft // This thus overrides the first time AUTHCALL is used and thus the gas for the second call is stored + } + }) + + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + await vm.runTx({ tx, block }) + + const gasUsed = await vm.stateManager.getContractStorage( + contractStorageAddress, + Buffer.from('00'.repeat(31) + '01', 'hex') + ) + const gasBigInt = bufferToBigInt(gasUsed) + const preGas = gas! - BigInt(common.param('gasPrices', 'warmstorageread')) + const expected = preGas - preGas / 64n - 2n + st.equal(gasBigInt, expected, 'forwarded max call gas') + }) + + t.test( + 'Should forward max call gas when gas set to 0 - cold account, nonzero transfer, create new account', + async (st) => { + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const code = Buffer.concat([ + getAuthCode(message, signature), + getAuthCallCode({ + address: new Address(Buffer.from('cc'.repeat(20), 'hex')), + value: 1n, + }), + RETURNTOP, + ]) + const vm = await setupVM(code) + + let gas: bigint + let gasAfterCall: bigint + + vm.on('step', async (e: InterpreterStep) => { + if (gas && gasAfterCall === undefined) { + gasAfterCall = e.gasLeft + } + if (e.opcode.name === 'AUTHCALL') { + gas = e.gasLeft + } + }) + + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 900000, + gasPrice: 10, + value: 1, + }).sign(callerPrivateKey) + + await vm.runTx({ tx, block }) + + const gasBigInt = gas! - gasAfterCall! + const expected = + BigInt(common.param('gasPrices', 'coldaccountaccess')) + + BigInt(common.param('gasPrices', 'warmstorageread')) + + BigInt(common.param('gasPrices', 'callNewAccount')) + + BigInt(common.param('gasPrices', 'authcallValueTransfer')) + + st.equal(gasBigInt, expected, 'forwarded max call gas') + } + ) + + t.test( + 'Should charge value transfer gas when transferring and transfer from contract, not authcall address', + async (st) => { + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const code = Buffer.concat([ + getAuthCode(message, signature), + getAuthCallCode({ + address: contractStorageAddress, + value: 1n, + }), + RETURNTOP, + ]) + const vm = await setupVM(code) + + let gas: bigint + + vm.on('step', (e: InterpreterStep) => { + if (e.opcode.name === 'AUTHCALL') { + gas = e.gasLeft + } + }) + + const value = 3n + const gasPrice = 10n + + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: PREBALANCE / gasPrice - value * gasPrice, + gasPrice, + value, + }).sign(callerPrivateKey) + + const result = await vm.runTx({ tx, block }) + + const gasUsed = await vm.stateManager.getContractStorage( + contractStorageAddress, + Buffer.from('00'.repeat(31) + '01', 'hex') + ) + const gasBigInt = bufferToBigInt(gasUsed) + const preGas = + gas! - + BigInt(common.param('gasPrices', 'warmstorageread')) - + BigInt(common.param('gasPrices', 'authcallValueTransfer')) - + BigInt(common.param('gasPrices', 'coldaccountaccess')) + const expected = preGas - preGas / 64n - 2n + st.equal(gasBigInt, expected, 'forwarded max call gas') + + const expectedBalance = PREBALANCE - result.amountSpent - value + const account = await vm.stateManager.getAccount(callerAddress) + + st.equal(account.balance, expectedBalance, 'caller balance ok') + + const contractAccount = await vm.stateManager.getAccount(contractAddress) + st.equal(contractAccount.balance, 2n, 'contract balance ok') + + const contractStorageAccount = await vm.stateManager.getAccount(contractStorageAddress) + st.equal(contractStorageAccount.balance, 1n, 'storage balance ok') + } + ) + + t.test('Should throw if AUTH not set', async (st) => { + const code = Buffer.concat([ + getAuthCallCode({ + address: contractStorageAddress, + }), + RETURNTOP, + ]) + const vm = await setupVM(code) + + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + const result = await vm.runTx({ tx, block }) + st.equal( + result.execResult.exceptionError?.error, + ERROR.AUTHCALL_UNSET, + 'threw with right error' + ) + st.equal(result.amountSpent, tx.gasPrice * tx.gasLimit, 'spent all gas') + }) + + t.test('Should unset AUTH in case of invalid signature', async (st) => { + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const signature2 = { + v: signature.v, + r: signature.s, + s: signature.s, + } + const code = Buffer.concat([ + getAuthCode(message, signature), + getAuthCallCode({ + address: contractStorageAddress, + }), + getAuthCode(message, signature2), + getAuthCallCode({ + address: contractStorageAddress, + }), + RETURNTOP, + ]) + const vm = await setupVM(code) + + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + const result = await vm.runTx({ tx, block }) + st.equal( + result.execResult.exceptionError?.error, + ERROR.AUTHCALL_UNSET, + 'threw with right error' + ) + st.equal(result.amountSpent, tx.gasPrice * tx.gasLimit, 'spent all gas') + }) + + t.test('Should throw if not enough gas is available', async (st) => { + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const code = Buffer.concat([ + getAuthCode(message, signature), + getAuthCallCode({ + address: contractStorageAddress, + gasLimit: 10000000n, + }), + RETURNTOP, + ]) + const vm = await setupVM(code) + + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + const result = await vm.runTx({ tx, block }) + st.equal(result.amountSpent, tx.gasLimit * tx.gasPrice, 'spent all gas') + st.equal(result.execResult.exceptionError?.error, ERROR.OUT_OF_GAS, 'correct error type') + }) + + t.test('Should throw if valueExt is nonzero', async (st) => { + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const code = Buffer.concat([ + getAuthCode(message, signature), + getAuthCallCode({ + address: contractStorageAddress, + valueExt: 1n, + }), + RETURNTOP, + ]) + const vm = await setupVM(code) + + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + const result = await vm.runTx({ tx, block }) + st.equal(result.amountSpent, tx.gasLimit * tx.gasPrice, 'spent all gas') + st.equal( + result.execResult.exceptionError?.error, + ERROR.AUTHCALL_NONZERO_VALUEEXT, + 'correct error type' + ) + }) + + t.test('Should forward the right amount of gas', async (st) => { + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const code = Buffer.concat([ + getAuthCode(message, signature), + getAuthCallCode({ + address: contractStorageAddress, + gasLimit: 700000n, + }), + RETURNTOP, + ]) + const vm = await setupVM(code) + + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + await vm.runTx({ tx, block }) + const gas = await vm.stateManager.getContractStorage( + contractStorageAddress, + Buffer.from('00'.repeat(31) + '01', 'hex') + ) + const gasBigInt = bufferToBigInt(gas) + st.equals(gasBigInt, BigInt(700000 - 2), 'forwarded the right amount of gas') // The 2 is subtracted due to the GAS opcode base fee + }) + + t.test('Should set input and output correctly', async (st) => { + const message = Buffer.from('01', 'hex') + const signature = signMessage(message, contractAddress, privateKey) + const input = Buffer.from('aa'.repeat(32), 'hex') + const code = Buffer.concat([ + getAuthCode(message, signature), + MSTORE(Buffer.from('20', 'hex'), input), + getAuthCallCode({ + address: contractStorageAddress, + argsOffset: 32n, + argsLength: 32n, + retOffset: 64n, + retLength: 32n, + }), + Buffer.from('60206040F3', 'hex'), // PUSH 32 PUSH 64 RETURN -> This returns the 32 bytes at memory position 64 + ]) + const vm = await setupVM(code) + + const tx = Transaction.fromTxData({ + to: contractAddress, + gasLimit: 1000000, + gasPrice: 10, + }).sign(callerPrivateKey) + + const result = await vm.runTx({ tx, block }) + const callInput = await vm.stateManager.getContractStorage( + contractStorageAddress, + Buffer.from('00'.repeat(31) + '02', 'hex') + ) + st.ok(callInput.equals(input), 'authcall input ok') + st.ok(result.execResult.returnValue.equals(input), 'authcall output ok') + }) +}) From b8c4732efc1e1eea6be922dc30762e27030698e2 Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Mon, 4 Apr 2022 07:46:07 -0400 Subject: [PATCH 27/44] util: move misplaced functions (#1825) * util: move misplaced functions * add unpadBuffer back * Fix tttttttttttttypo * make unpadHexString return Hex String! --- packages/util/src/account.ts | 4 ++-- packages/util/src/bytes.ts | 18 +++++++++++++++++- packages/util/src/types.ts | 22 +--------------------- packages/util/test/bytes.spec.ts | 17 ++++++++++++++++- packages/util/test/types.spec.ts | 14 -------------- 5 files changed, 36 insertions(+), 39 deletions(-) diff --git a/packages/util/src/account.ts b/packages/util/src/account.ts index 0d93356daab..348beb68235 100644 --- a/packages/util/src/account.ts +++ b/packages/util/src/account.ts @@ -2,10 +2,10 @@ import { rlp } from './externals' import { Point, utils } from 'ethereum-cryptography/secp256k1' import { stripHexPrefix } from './internal' import { KECCAK256_RLP, KECCAK256_NULL } from './constants' -import { zeros, bufferToHex, toBuffer, bufferToBigInt } from './bytes' +import { zeros, bufferToHex, toBuffer, bufferToBigInt, bigIntToUnpaddedBuffer } from './bytes' import { keccak, keccak256, keccakFromString, rlphash } from './hash' import { assertIsString, assertIsHexString, assertIsBuffer } from './helpers' -import { BigIntLike, BufferLike, bigIntToUnpaddedBuffer } from './types' +import { BigIntLike, BufferLike } from './types' const _0n = BigInt(0) diff --git a/packages/util/src/bytes.ts b/packages/util/src/bytes.ts index e5a81d33c6d..3b7594b3285 100644 --- a/packages/util/src/bytes.ts +++ b/packages/util/src/bytes.ts @@ -129,7 +129,7 @@ export const unpadArray = function (a: number[]): number[] { export const unpadHexString = function (a: string): string { assertIsHexString(a) a = stripHexPrefix(a) - return stripZeros(a) as string + return ('0x' + stripZeros(a)) as string } export type ToBufferInputTypes = @@ -353,3 +353,19 @@ export function bufArrToArr(arr: Buffer | NestedBufferArray): Uint8Array | Neste } return arr.map((a) => bufArrToArr(a)) } + +/** + * Converts a {@link bigint} to a `0x` prefixed hex string + */ +export const bigIntToHex = (num: bigint) => { + return '0x' + num.toString(16) +} + +/** + * Convert value from bigint to an unpadded Buffer + * (useful for RLP transport) + * @param value value to convert + */ +export function bigIntToUnpaddedBuffer(value: bigint): Buffer { + return unpadBuffer(bigIntToBuffer(value)) +} diff --git a/packages/util/src/types.ts b/packages/util/src/types.ts index 1e54cf60e38..f1a620c8aff 100644 --- a/packages/util/src/types.ts +++ b/packages/util/src/types.ts @@ -1,13 +1,6 @@ import { isHexString } from './internal' import { Address } from './address' -import { - unpadBuffer, - toBuffer, - ToBufferInputTypes, - bigIntToBuffer, - bufferToBigInt, - bufferToHex, -} from './bytes' +import { toBuffer, ToBufferInputTypes, bufferToBigInt, bufferToHex } from './bytes' /* * A type that represents an input that can be converted to a BigInt. @@ -55,15 +48,6 @@ export interface TransformableToBuffer { export type NestedUint8Array = Array export type NestedBufferArray = Array -/** - * Convert value from bigint to an unpadded Buffer - * (useful for RLP transport) - * @param value value to convert - */ -export function bigIntToUnpaddedBuffer(value: bigint): Buffer { - return unpadBuffer(bigIntToBuffer(value)) -} - /** * Type output options */ @@ -134,7 +118,3 @@ export function toType( throw new Error('unknown outputType') } } - -export const bigIntToHex = (num: bigint) => { - return '0x' + num.toString(16) -} diff --git a/packages/util/test/bytes.spec.ts b/packages/util/test/bytes.spec.ts index 95fc5c932dc..6ba432cca40 100644 --- a/packages/util/test/bytes.spec.ts +++ b/packages/util/test/bytes.spec.ts @@ -24,6 +24,8 @@ import { validateNoLeadingZeroes, bufferToBigInt, bigIntToBuffer, + bigIntToUnpaddedBuffer, + bigIntToHex, } from '../src' tape('zeros function', function (t) { @@ -94,7 +96,7 @@ tape('unpadHexString', function (t) { t.test('should unpad a hex prefixed string', function (st) { const str = '0x0000000006600' const r = unpadHexString(str) - st.equal(r, '6600') + st.equal(r, '0x6600') st.end() }) t.test('should throw if input is not hex-prefixed', function (st) { @@ -456,3 +458,16 @@ tape('bigIntToBuffer', (st) => { st.deepEqual(toBuffer('0x123'), bigIntToBuffer(num)) st.end() }) + +tape('bigIntToUnpaddedBuffer', function (t) { + t.test('should equal unpadded buffer value', function (st) { + st.ok(bigIntToUnpaddedBuffer(BigInt(0)).equals(Buffer.from([]))) + st.ok(bigIntToUnpaddedBuffer(BigInt(100)).equals(Buffer.from('64', 'hex'))) + st.end() + }) +}) + +tape('bigIntToHex', (st) => { + st.equal(bigIntToHex(BigInt(1)), '0x1') + st.end() +}) diff --git a/packages/util/test/types.spec.ts b/packages/util/test/types.spec.ts index ec009b22f15..844ba21c26a 100644 --- a/packages/util/test/types.spec.ts +++ b/packages/util/test/types.spec.ts @@ -5,7 +5,6 @@ import { intToBuffer, bufferToHex, intToHex, - bigIntToUnpaddedBuffer, toBuffer, bigIntToHex, bigIntToBuffer, @@ -135,16 +134,3 @@ tape('toType', function (t) { }) }) }) - -tape('bigIntToUnpaddedBuffer', function (t) { - t.test('should equal unpadded buffer value', function (st) { - st.ok(bigIntToUnpaddedBuffer(BigInt(0)).equals(Buffer.from([]))) - st.ok(bigIntToUnpaddedBuffer(BigInt(100)).equals(Buffer.from('64', 'hex'))) - st.end() - }) -}) - -tape('bigIntToHex', (st) => { - st.equal(bigIntToHex(BigInt(1)), '0x1') - st.end() -}) From 54acfe16d37642f7922030593544ce3cbbb32b19 Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Tue, 5 Apr 2022 04:06:12 -0400 Subject: [PATCH 28/44] Blockchain, Client, VM: Head function rename rebase (#1822) * blockchain/tests: remove tests for getHead() * vm: change blockchain.getHead() to blockchain.getIteratorHead() * vm: remove tests for blockchain.getHead() * client: change blockchain.getHead() to blockchain.getIteratorHead() * blockchain: remove setHead() for setIteratorHead() * blockchain: edit text of setIteratorHead() test * blockchain: rename getLatestHeader() to getCanonicalHeadHeader() * blockchain/tests: rename getLatestHeader() to getCanonicalHeadHeader() * client: rename blockchain.getLatestHeader() to blockchain.getCanonicalHeadHeader() * client/tests: rename blockchain.getLatestHeader() to blockchain.getCanonicalHeadHeader() * blockchain/tests: rename getLatestBlock() to getCanonicalHeadBlock() * client: rename blockchain.getLatestBlock to blockchain.getCanonicalBlockHeader() * client/tests: rename blockchain.getLatestBlock to blockchain.getCanonicalBlockHeader() * blockchain: remove get meta() * VM: Remove blockchain.meta from tests * Blockchain: Remove blockchain.meta from tests * blockchain: fix linting errors * BN to BigInt misses from rebase * BN to BigInt fixes + lint * Fix missing name replacement * lint * Add back blockchain testrunner last header check * Add test for call with no gas * Add back correct renamed functions * lint fixes Co-authored-by: ScottyPoi --- packages/blockchain/src/index.ts | 31 +--------- packages/blockchain/test/clique.spec.ts | 4 +- packages/blockchain/test/index.spec.ts | 59 ++++++------------- packages/blockchain/test/pos.spec.ts | 4 +- packages/blockchain/test/reorg.spec.ts | 34 ----------- packages/client/bin/cli.ts | 2 +- packages/client/lib/blockchain/chain.ts | 14 ++--- packages/client/lib/execution/vmexecution.ts | 4 +- packages/client/lib/rpc/modules/admin.ts | 2 +- packages/client/lib/rpc/modules/eth.ts | 9 +-- packages/client/test/blockchain/chain.spec.ts | 9 ++- packages/client/test/miner/miner.spec.ts | 8 +-- .../client/test/miner/pendingBlock.spec.ts | 8 +-- .../client/test/rpc/eth/blockNumber.spec.ts | 2 +- packages/client/test/rpc/eth/call.spec.ts | 15 +++-- .../client/test/rpc/eth/estimateGas.spec.ts | 2 +- .../test/rpc/eth/getBlockByNumber.spec.ts | 4 +- packages/client/test/rpc/eth/getCode.spec.ts | 2 +- packages/client/test/rpc/eth/getProof.spec.ts | 2 +- .../client/test/rpc/eth/getStorageAt.spec.ts | 2 +- .../test/rpc/eth/getTransactionCount.spec.ts | 2 +- .../eth/getUncleCountByBlockNumber.spec.ts | 4 +- packages/client/test/rpc/helpers.ts | 2 +- packages/client/test/rpc/mockBlockchain.ts | 2 +- .../test/sync/execution/vmexecution.spec.ts | 16 ++--- packages/client/test/sync/fullsync.spec.ts | 2 +- packages/client/test/util/rpc.spec.ts | 2 +- ...t-difficulty-opcode-with-prevrando.spec.ts | 2 +- packages/vm/tests/api/runBlockchain.spec.ts | 16 ----- .../tester/runners/BlockchainTestsRunner.ts | 5 +- 30 files changed, 93 insertions(+), 177 deletions(-) diff --git a/packages/blockchain/src/index.ts b/packages/blockchain/src/index.ts index bc0cdf61a13..6027133a01f 100644 --- a/packages/blockchain/src/index.ts +++ b/packages/blockchain/src/index.ts @@ -297,18 +297,6 @@ export default class Blockchain implements BlockchainInterface { } } - /** - * Returns an object with metadata about the Blockchain. It's defined for - * backwards compatibility. - */ - get meta() { - return { - rawHead: this._headHeaderHash, - heads: this._heads, - genesis: this._genesis, - } - } - /** * Returns a deep copy of this {@link Blockchain} instance. * @@ -790,7 +778,7 @@ export default class Blockchain implements BlockchainInterface { /** * Returns the latest header in the canonical chain. */ - async getLatestHeader(): Promise { + async getCanonicalHeadHeader(): Promise { return await this.runWithLock(async () => { if (!this._headHeaderHash) { throw new Error('No head header set') @@ -803,7 +791,7 @@ export default class Blockchain implements BlockchainInterface { /** * Returns the latest full block in the canonical chain. */ - async getLatestBlock(): Promise { + async getCanonicalHeadBlock(): Promise { return this.runWithLock(async () => { if (!this._headBlockHash) { throw new Error('No head block set') @@ -1306,18 +1294,6 @@ export default class Blockchain implements BlockchainInterface { * @param headHash - The head hash to save */ async setIteratorHead(tag: string, headHash: Buffer) { - return await this.setHead(tag, headHash) - } - - /** - * Set header hash of a certain `tag`. - * When calling the iterator, the iterator will start running the first child block after the header hash currently stored. - * @param tag - The tag to save the headHash to - * @param headHash - The head hash to save - * - * @deprecated use {@link Blockchain.setIteratorHead()} instead - */ - async setHead(tag: string, headHash: Buffer) { await this.runWithLock(async () => { this._heads[tag] = headHash await this._saveHeads() @@ -1587,8 +1563,7 @@ export default class Blockchain implements BlockchainInterface { if (signerIndex === -1) { throw new Error('Signer not found') } - const { number } = await this.getLatestHeader() - //eslint-disable-next-line + const { number } = await this.getCanonicalHeadHeader() return (number + BigInt(1)) % BigInt(signers.length) === BigInt(signerIndex) } } diff --git a/packages/blockchain/test/clique.spec.ts b/packages/blockchain/test/clique.spec.ts index 45c954d2150..36daa55d219 100644 --- a/packages/blockchain/test/clique.spec.ts +++ b/packages/blockchain/test/clique.spec.ts @@ -10,8 +10,8 @@ tape('Clique: Initialization', (t) => { const common = new Common({ chain: Chain.Rinkeby, hardfork: Hardfork.Chainstart }) const blockchain = await Blockchain.create({ common }) - const head = await blockchain.getHead() - st.equal(head.hash().toString('hex'), common.genesis().hash.slice(2), 'correct genesis hash') + const head = await blockchain.getIteratorHead() + st.equals(head.hash().toString('hex'), common.genesis().hash.slice(2), 'correct genesis hash') st.deepEquals( blockchain.cliqueActiveSigners(), diff --git a/packages/blockchain/test/index.spec.ts b/packages/blockchain/test/index.spec.ts index bd14e98922e..a0afd3d2d23 100644 --- a/packages/blockchain/test/index.spec.ts +++ b/packages/blockchain/test/index.spec.ts @@ -14,7 +14,7 @@ tape('blockchain test', (t) => { validateBlocks: true, validateConsensus: false, }) - await blockchain.getHead() + await blockchain.getIteratorHead() st.end() }) @@ -22,15 +22,9 @@ tape('blockchain test', (t) => { const common = new Common({ chain: Chain.Ropsten }) let blockchain = await Blockchain.create({ common }) - const head = await blockchain.getHead() const iteratorHead = await blockchain.getIteratorHead() - st.equal( - head.hash().toString('hex'), - common.genesis().hash.slice(2), - 'correct genesis hash (getHead())' - ) - st.equal( + st.equals( iteratorHead.hash().toString('hex'), common.genesis().hash.slice(2), 'correct genesis hash (getIteratorHead())' @@ -52,10 +46,8 @@ tape('blockchain test', (t) => { validateConsensus: false, common, }) - - const head = await blockchain.getHead() - - st.equal(head.header.number, BigInt(5), 'correct block number') + const head = await blockchain.getIteratorHead() + st.equals(head.header.number, BigInt(0), 'correct block number') st.end() }) @@ -81,7 +73,7 @@ tape('blockchain test', (t) => { genesisBlock, }) st.ok( - genesisBlock.hash().equals(blockchain.meta.genesis!), + genesisBlock.hash().equals((await blockchain.getCanonicalHeadHeader()).hash()), 'genesis block hash should be correct' ) st.end() @@ -450,7 +442,7 @@ tape('blockchain test', (t) => { // Note: if st.end() is not called (Promise did not throw), then this test fails, as it does not end. }) - t.test('should test setHead (@deprecated)/setIteratorHead method', async (st) => { + t.test('should test setIteratorHead method', async (st) => { const { blockchain, blocks, error } = await generateBlockchain(25) st.error(error, 'no error') @@ -458,7 +450,7 @@ tape('blockchain test', (t) => { const headHash = blocks[headBlockIndex].hash() await blockchain.setIteratorHead('myHead', headHash) - const currentHeadBlock = await blockchain.getHead('myHead') + const currentHeadBlock = await blockchain.getIteratorHead('myHead') st.ok(headHash.equals(currentHeadBlock.hash()), 'head hash equals the provided head hash') @@ -507,21 +499,6 @@ tape('blockchain test', (t) => { st.end() }) - t.test('should get meta.genesis', async (st) => { - const { blockchain, blocks, error } = await generateBlockchain(25) - st.error(error, 'no error') - st.ok(blockchain.meta.rawHead.equals(blocks[24].hash()), 'should get meta.rawHead') - st.ok(blockchain.meta.genesis.equals(blocks[0].hash()), 'should get meta.genesis') - let i = 0 - await blockchain.iterator('test', (block: Block) => { - if (block.hash().equals(blocks[i + 1].hash())) { - i++ - } - }) - st.ok(blockchain.meta.heads['test'], 'should get meta.heads') - st.end() - }) - t.test('should add fork header and reset stale heads', async (st) => { const { blockchain, blocks, error } = await generateBlockchain(15) st.error(error, 'no error') @@ -634,7 +611,7 @@ tape('blockchain test', (t) => { t.test('should get heads', async (st) => { const [db, genesis] = await createTestDB() const blockchain = await Blockchain.create({ db: db }) - const head = await blockchain.getHead() + const head = await blockchain.getIteratorHead() if (genesis) { st.ok(head.hash().equals(genesis.hash()), 'should get head') st.equal( @@ -736,10 +713,10 @@ tape('blockchain test', (t) => { genesisBlock, }) - const latestHeader = await blockchain.getLatestHeader() + const latestHeader = await blockchain.getCanonicalHeadHeader() st.ok(latestHeader.hash().equals(header.hash()), 'should save headHeader') - const latestBlock = await blockchain.getLatestBlock() + const latestBlock = await blockchain.getCanonicalHeadBlock() st.ok(latestBlock.hash().equals(genesisBlock.hash()), 'should save headBlock') st.end() }) @@ -789,18 +766,18 @@ tape('blockchain test', (t) => { await blockchain.putHeaders(headers) - const latestHeader = await blockchain.getLatestHeader() + const latestHeader = await blockchain.getCanonicalHeadHeader() st.ok(latestHeader.hash().equals(headers[1].hash()), 'should update latest header') - const latestBlock = await blockchain.getLatestBlock() + const latestBlock = await blockchain.getCanonicalHeadBlock() st.ok(latestBlock.hash().equals(genesisBlock.hash()), 'should not change latest block') await blockchain.putBlock(block) - const latestHeader2 = await blockchain.getLatestHeader() + const latestHeader2 = await blockchain.getCanonicalHeadHeader() st.ok(latestHeader2.hash().equals(headers[1].hash()), 'should not change latest header') - const getBlock = await blockchain.getLatestBlock() + const getBlock = await blockchain.getCanonicalHeadBlock() st.ok(getBlock!.hash().equals(block.hash()), 'should update latest block') st.end() }) @@ -868,7 +845,7 @@ tape('initialization tests', (t) => { const blockchain = await Blockchain.create({ common }) st.ok( - (await blockchain.getHead()).hash().equals(genesisHash), + (await blockchain.getIteratorHead()).hash().equals(genesisHash), 'head hash should equal expected ropsten genesis hash' ) @@ -877,7 +854,7 @@ tape('initialization tests', (t) => { const newBlockchain = await Blockchain.create({ db, common }) st.ok( - (await newBlockchain.getHead()).hash().equals(genesisHash), + (await newBlockchain.getIteratorHead()).hash().equals(genesisHash), 'head hash should be read from the provided db' ) st.end() @@ -894,13 +871,13 @@ tape('initialization tests', (t) => { const db = blockchain.db st.ok( - (await blockchain.getHead()).hash().equals(hash), + (await blockchain.getIteratorHead()).hash().equals(hash), 'blockchain should put custom genesis block' ) const newBlockchain = await Blockchain.create({ db, genesisBlock }) st.ok( - (await newBlockchain.getHead()).hash().equals(hash), + (await newBlockchain.getIteratorHead()).hash().equals(hash), 'head hash should be read from the provided db' ) st.end() diff --git a/packages/blockchain/test/pos.spec.ts b/packages/blockchain/test/pos.spec.ts index f0131013660..781f8da92ea 100644 --- a/packages/blockchain/test/pos.spec.ts +++ b/packages/blockchain/test/pos.spec.ts @@ -61,7 +61,7 @@ tape('Proof of Stake - inserting blocks into blockchain', async (t) => { common: s.common, hardforkByHeadBlockNumber: true, }) - const genesisHeader = await blockchain.getLatestHeader() + const genesisHeader = await blockchain.getCanonicalHeadHeader() t.equal( genesisHeader.hash().toString('hex'), @@ -70,7 +70,7 @@ tape('Proof of Stake - inserting blocks into blockchain', async (t) => { ) await buildChain(blockchain, s.common, 15) - const latestHeader = await blockchain.getLatestHeader() + const latestHeader = await blockchain.getCanonicalHeadHeader() t.equal(latestHeader.number, BigInt(15), 'blockchain is at correct height') t.equal( diff --git a/packages/blockchain/test/reorg.spec.ts b/packages/blockchain/test/reorg.spec.ts index 53827f3d533..af5bfc45d00 100644 --- a/packages/blockchain/test/reorg.spec.ts +++ b/packages/blockchain/test/reorg.spec.ts @@ -21,12 +21,6 @@ tape('reorg tests', (t) => { }, { common } ) - const blockchain = await Blockchain.create({ - validateBlocks: true, - validateConsensus: false, - common, - genesisBlock: genesis, - }) const blocks_lowTD: Block[] = [] const blocks_highTD: Block[] = [] @@ -64,23 +58,6 @@ tape('reorg tests', (t) => { 'low TD block should have a higher number than high TD block' ) - await blockchain.putBlocks(blocks_lowTD) - - const head_lowTD = await blockchain.getHead() - - await blockchain.putBlocks(blocks_highTD) - - const head_highTD = await blockchain.getHead() - - t.ok( - head_lowTD.hash().equals(lowTDBlock.hash()), - 'head on the low TD chain should equal the low TD block' - ) - t.ok( - head_highTD.hash().equals(highTDBlock.hash()), - 'head on the high TD chain should equal the high TD block' - ) - st.end() } ) @@ -170,19 +147,8 @@ tape('reorg tests', (t) => { ) await blockchain.putBlocks([block1_low, block2_low]) - const head_low = await blockchain.getHead() await blockchain.putBlocks([block1_high, block2_high, block3_high]) - const head_high = await blockchain.getHead() - - t.ok( - head_low.hash().equals(block2_low.hash()), - 'head on the low chain should equal the low block' - ) - t.ok( - head_high.hash().equals(block3_high.hash()), - 'head on the high chain should equal the high block' - ) let signerStates = (blockchain as any)._cliqueLatestSignerStates t.ok( diff --git a/packages/client/bin/cli.ts b/packages/client/bin/cli.ts index d1e96e58f27..fb3357610fd 100755 --- a/packages/client/bin/cli.ts +++ b/packages/client/bin/cli.ts @@ -327,7 +327,7 @@ async function startBlock(client: EthereumClient) { if (!args.startBlock) return const startBlock = BigInt(args.startBlock) const { blockchain } = client.chain - const height = (await blockchain.getLatestHeader()).number + const height = (await blockchain.getCanonicalHeadHeader()).number if (height === startBlock) return if (height < startBlock) { logger.error(`Cannot start chain higher than current height ${height}`) diff --git a/packages/client/lib/blockchain/chain.ts b/packages/client/lib/blockchain/chain.ts index cf0fa91a673..0c600e9f151 100644 --- a/packages/client/lib/blockchain/chain.ts +++ b/packages/client/lib/blockchain/chain.ts @@ -189,7 +189,7 @@ export class Chain { const block = this.config.chainCommon.hardforkBlock() this.config.logger.info(`New hardfork reached 🪢 ! hardfork=${hardfork} block=${block}`) } else { - const block = await this.getLatestBlock() + const block = await this.getCanonicalHeadBlock() const num = block.header.number const td = await this.blockchain.getTotalDifficulty(block.hash(), num) this.config.logger.info(`Merge hardfork reached 🐼 👉 👈 🐼 ! block=${num} td=${td}`) @@ -228,8 +228,8 @@ export class Chain { height: BigInt(0), } - headers.latest = await this.getLatestHeader() - blocks.latest = await this.getLatestBlock() + headers.latest = await this.getCanonicalHeadHeader() + blocks.latest = await this.getCanonicalHeadBlock() headers.height = headers.latest.number blocks.height = blocks.latest.header.number @@ -353,17 +353,17 @@ export class Chain { /** * Gets the latest header in the canonical chain */ - async getLatestHeader(): Promise { + async getCanonicalHeadHeader(): Promise { if (!this.opened) throw new Error('Chain closed') - return this.blockchain.getLatestHeader() + return this.blockchain.getCanonicalHeadHeader() } /** * Gets the latest block in the canonical chain */ - async getLatestBlock(): Promise { + async getCanonicalHeadBlock(): Promise { if (!this.opened) throw new Error('Chain closed') - return this.blockchain.getLatestBlock() + return this.blockchain.getCanonicalHeadBlock() } /** diff --git a/packages/client/lib/execution/vmexecution.ts b/packages/client/lib/execution/vmexecution.ts index 367ea55cc8a..c406c5c5195 100644 --- a/packages/client/lib/execution/vmexecution.ts +++ b/packages/client/lib/execution/vmexecution.ts @@ -142,7 +142,7 @@ export class VMExecution extends Execution { const { blockchain } = this.vm let startHeadBlock = await blockchain.getIteratorHead() - let canonicalHead = await blockchain.getLatestBlock() + let canonicalHead = await blockchain.getCanonicalHeadBlock() let headBlock: Block | undefined let parentState: Buffer | undefined @@ -276,7 +276,7 @@ export class VMExecution extends Execution { ) } startHeadBlock = endHeadBlock - canonicalHead = await this.vm.blockchain.getLatestBlock() + canonicalHead = await this.vm.blockchain.getCanonicalHeadBlock() } this.running = false return numExecuted as number diff --git a/packages/client/lib/rpc/modules/admin.ts b/packages/client/lib/rpc/modules/admin.ts index 878f4654d26..b80604c9527 100644 --- a/packages/client/lib/rpc/modules/admin.ts +++ b/packages/client/lib/rpc/modules/admin.ts @@ -42,7 +42,7 @@ export class Admin { // TODO version not present in reference.. // const ethVersion = Math.max.apply(Math, this._ethProtocol.versions) - const latestHeader = await this._chain.getLatestHeader() + const latestHeader = await this._chain.getCanonicalHeadHeader() const difficulty = latestHeader.difficulty.toString() const genesis = bufferToHex(this._chain.genesis.hash) const head = bufferToHex(latestHeader.mixHash) diff --git a/packages/client/lib/rpc/modules/eth.ts b/packages/client/lib/rpc/modules/eth.ts index 67b52dd9857..99feade688f 100644 --- a/packages/client/lib/rpc/modules/eth.ts +++ b/packages/client/lib/rpc/modules/eth.ts @@ -278,7 +278,7 @@ const getBlockByOption = async (blockOpt: string, chain: Chain) => { } let block: Block - const latest = chain.blocks.latest ?? (await chain.getLatestBlock()) + const latest = chain.blocks.latest ?? (await chain.getCanonicalHeadBlock()) if (blockOpt === 'latest') { block = latest @@ -519,7 +519,7 @@ export class Eth { if (!transaction.gas) { // If no gas limit is specified use the last block gas limit as an upper bound. - const latest = await this._chain.getLatestHeader() + const latest = await this._chain.getCanonicalHeadHeader() transaction.gas = latest.gasLimit as any } @@ -728,7 +728,7 @@ export class Eth { const [blockNumberHex] = params const blockNumber = BigInt(blockNumberHex) const latest = - this._chain.headers.latest?.number ?? (await this._chain.getLatestHeader()).number + this._chain.headers.latest?.number ?? (await this._chain.getCanonicalHeadHeader()).number if (blockNumber > latest) { throw { @@ -994,7 +994,8 @@ export class Eth { return false } - const currentBlockHeader = this._chain.headers?.latest ?? (await this._chain.getLatestHeader()) + const currentBlockHeader = + this._chain.headers?.latest ?? (await this._chain.getCanonicalHeadHeader()) const currentBlock = bigIntToHex(currentBlockHeader.number) const synchronizer = this.client.services[0].synchronizer diff --git a/packages/client/test/blockchain/chain.spec.ts b/packages/client/test/blockchain/chain.spec.ts index 90cfeaae4f5..4b900442709 100644 --- a/packages/client/test/blockchain/chain.spec.ts +++ b/packages/client/test/blockchain/chain.spec.ts @@ -89,18 +89,23 @@ tape('[Chain]', (t) => { t.pass('threw an error when chain is closed') } try { - await chain.getLatestHeader() + await chain.getCanonicalHeadHeader() t.fail('should error if chain is closed') } catch (error) { t.pass('threw an error when chain is closed') } await chain.close() try { - await chain.getLatestBlock() + await chain.getCanonicalHeadBlock() t.fail('should error if chain is closed') } catch (error) { t.pass('threw an error when chain is closed') } + await chain.getCanonicalHeadHeader() + t.ok(chain.opened, 'chain should open if getCanonicalHeadHeader() called') + await chain.close() + await chain.getCanonicalHeadBlock() + t.ok(chain.opened, 'chain should open if getCanonicalHeadBlock() called') await chain.close() try { await chain.getTd(block.hash(), block.header.number) diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index 9500e840920..fb57b0ef624 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -389,12 +389,12 @@ tape('[Miner]', async (t) => { await wait(100) config.execCommon.setHardforkByBlockNumber(2) t.equal(config.execCommon.hardfork(), Hardfork.Berlin) - const blockHeader2 = await chain.getLatestHeader() + const blockHeader2 = await chain.getCanonicalHeadHeader() // block 3: london await (miner as any).queueNextAssembly(0) await wait(100) - const blockHeader3 = await chain.getLatestHeader() + const blockHeader3 = await chain.getCanonicalHeadHeader() config.execCommon.setHardforkByBlockNumber(3) t.equal(config.execCommon.hardfork(), Hardfork.London) t.equal( @@ -408,7 +408,7 @@ tape('[Miner]', async (t) => { // block 4 await (miner as any).queueNextAssembly(0) await wait(100) - const blockHeader4 = await chain.getLatestHeader() + const blockHeader4 = await chain.getCanonicalHeadHeader() config.execCommon.setHardforkByBlockNumber(4) t.equal(config.execCommon.hardfork(), Hardfork.London) t.equal( @@ -416,7 +416,7 @@ tape('[Miner]', async (t) => { blockHeader3.calcNextBaseFee(), 'baseFee should be as calculated' ) - t.equal((await chain.getLatestHeader()).number, BigInt(4)) + t.ok((await chain.getCanonicalHeadHeader()).number === BigInt(4)) miner.stop() await chain.close() }) diff --git a/packages/client/test/miner/pendingBlock.spec.ts b/packages/client/test/miner/pendingBlock.spec.ts index 58848c205b7..b789e768ce9 100644 --- a/packages/client/test/miner/pendingBlock.spec.ts +++ b/packages/client/test/miner/pendingBlock.spec.ts @@ -85,7 +85,7 @@ tape('[PendingBlock]', async (t) => { const vm = await VM.create({ common }) await setBalance(vm.stateManager, A.address, BigInt(5000000000000000)) await setBalance(vm.stateManager, B.address, BigInt(5000000000000000)) - const parentBlock = await vm.blockchain.getLatestBlock() + const parentBlock = await vm.blockchain.getCanonicalHeadBlock() const payloadId = await pendingBlock.start(vm, parentBlock) t.equal(pendingBlock.pendingPayloads.length, 1, 'should set the pending payload') txPool.add(txB01) @@ -105,7 +105,7 @@ tape('[PendingBlock]', async (t) => { const pendingBlock = new PendingBlock({ config, txPool }) const vm = await VM.create({ common }) await setBalance(vm.stateManager, A.address, BigInt(5000000000000000)) - const parentBlock = await vm.blockchain.getLatestBlock() + const parentBlock = await vm.blockchain.getCanonicalHeadBlock() const payloadId = await pendingBlock.start(vm, parentBlock) t.equal(pendingBlock.pendingPayloads.length, 1, 'should set the pending payload') pendingBlock.stop(payloadId) @@ -133,7 +133,7 @@ tape('[PendingBlock]', async (t) => { const pendingBlock = new PendingBlock({ config, txPool }) const vm = await VM.create({ common }) await setBalance(vm.stateManager, A.address, BigInt(5000000000000000)) - const parentBlock = await vm.blockchain.getLatestBlock() + const parentBlock = await vm.blockchain.getCanonicalHeadBlock() const payloadId = await pendingBlock.start(vm, parentBlock) t.equal(pendingBlock.pendingPayloads.length, 1, 'should set the pending payload') const built = await pendingBlock.build(payloadId) @@ -151,7 +151,7 @@ tape('[PendingBlock]', async (t) => { txPool.add(txA01) const pendingBlock = new PendingBlock({ config, txPool }) const vm = await VM.create({ common }) - const parentBlock = await vm.blockchain.getLatestBlock() + const parentBlock = await vm.blockchain.getCanonicalHeadBlock() const payloadId = await pendingBlock.start(vm, parentBlock) t.equal(pendingBlock.pendingPayloads.length, 1, 'should set the pending payload') const built = await pendingBlock.build(payloadId) diff --git a/packages/client/test/rpc/eth/blockNumber.spec.ts b/packages/client/test/rpc/eth/blockNumber.spec.ts index 65bb8c72f0d..1037b42c9bf 100644 --- a/packages/client/test/rpc/eth/blockNumber.spec.ts +++ b/packages/client/test/rpc/eth/blockNumber.spec.ts @@ -8,7 +8,7 @@ tape(`${method}: call with valid arguments`, async (t) => { const mockBlockNumber = BigInt(123) const mockChain = { headers: { latest: { number: mockBlockNumber } }, - getLatestHeader: async function (): Promise { + getCanonicalHeadHeader: async function (): Promise { return { number: mockBlockNumber, } diff --git a/packages/client/test/rpc/eth/call.spec.ts b/packages/client/test/rpc/eth/call.spec.ts index d7b2bbc97bb..ba39a7394f1 100644 --- a/packages/client/test/rpc/eth/call.spec.ts +++ b/packages/client/test/rpc/eth/call.spec.ts @@ -50,7 +50,7 @@ tape(`${method}: call with valid arguments`, async (t) => { tx.getSenderAddress = () => { return address } - const parent = await blockchain.getLatestHeader() + const parent = await blockchain.getCanonicalHeadHeader() const block = Block.fromBlockData( { header: { @@ -92,12 +92,19 @@ tape(`${method}: call with valid arguments`, async (t) => { }) // verify return value is accurate - const req = params(method, [{ ...estimateTxData, gas: estimateTxData.gasLimit }, 'latest']) - const expectRes = (res: any) => { + let req = params(method, [{ ...estimateTxData, gas: estimateTxData.gasLimit }, 'latest']) + let expectRes = (res: any) => { const msg = 'should return the correct return value' t.equal(res.body.result, bufferToHex(execResult.returnValue), msg) } - await baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes, false) + + req = params(method, [{ ...estimateTxData }, 'latest']) + expectRes = (res: any) => { + const msg = 'should return the correct return value with no gas limit provided' + t.equal(res.body.result, bufferToHex(execResult.returnValue), msg) + } + await baseRequest(t, server, req, 200, expectRes, true) }) tape(`${method}: call with unsupported block argument`, async (t) => { diff --git a/packages/client/test/rpc/eth/estimateGas.spec.ts b/packages/client/test/rpc/eth/estimateGas.spec.ts index b3a7db46d30..d560521f374 100644 --- a/packages/client/test/rpc/eth/estimateGas.spec.ts +++ b/packages/client/test/rpc/eth/estimateGas.spec.ts @@ -51,7 +51,7 @@ tape(`${method}: call with valid arguments`, async (t) => { tx.getSenderAddress = () => { return address } - const parent = await blockchain.getLatestHeader() + const parent = await blockchain.getCanonicalHeadHeader() const block = Block.fromBlockData( { header: { diff --git a/packages/client/test/rpc/eth/getBlockByNumber.spec.ts b/packages/client/test/rpc/eth/getBlockByNumber.spec.ts index f31a0897c79..d34ad819642 100644 --- a/packages/client/test/rpc/eth/getBlockByNumber.spec.ts +++ b/packages/client/test/rpc/eth/getBlockByNumber.spec.ts @@ -61,8 +61,8 @@ function createChain() { return { blocks: { latest: block }, getBlock: () => genesisBlock, - getLatestBlock: () => block, - getLatestHeader: () => block.header, + getCanonicalHeadBlock: () => block, + getCanonicalHeadHeader: () => block.header, getTd: () => BigInt(0), } } diff --git a/packages/client/test/rpc/eth/getCode.spec.ts b/packages/client/test/rpc/eth/getCode.spec.ts index 18e3002ead8..dba1ce2b467 100644 --- a/packages/client/test/rpc/eth/getCode.spec.ts +++ b/packages/client/test/rpc/eth/getCode.spec.ts @@ -67,7 +67,7 @@ tape(`${method}: ensure returns correct code`, async (t) => { tx.getSenderAddress = () => { return address } - const parent = await blockchain.getLatestHeader() + const parent = await blockchain.getCanonicalHeadHeader() const block = Block.fromBlockData( { header: { diff --git a/packages/client/test/rpc/eth/getProof.spec.ts b/packages/client/test/rpc/eth/getProof.spec.ts index be6064884f9..4f5410db3ca 100644 --- a/packages/client/test/rpc/eth/getProof.spec.ts +++ b/packages/client/test/rpc/eth/getProof.spec.ts @@ -74,7 +74,7 @@ tape(`${method}: call with valid arguments`, async (t) => { tx.getSenderAddress = () => { return address } - const parent = await blockchain.getLatestHeader() + const parent = await blockchain.getCanonicalHeadHeader() const block = Block.fromBlockData( { header: { diff --git a/packages/client/test/rpc/eth/getStorageAt.spec.ts b/packages/client/test/rpc/eth/getStorageAt.spec.ts index 298e57cc7f1..b6b6bc8575a 100644 --- a/packages/client/test/rpc/eth/getStorageAt.spec.ts +++ b/packages/client/test/rpc/eth/getStorageAt.spec.ts @@ -55,7 +55,7 @@ tape(`${method}: call with valid arguments`, async (t) => { tx.getSenderAddress = () => { return address } - const parent = await blockchain.getLatestHeader() + const parent = await blockchain.getCanonicalHeadHeader() const block = Block.fromBlockData( { header: { diff --git a/packages/client/test/rpc/eth/getTransactionCount.spec.ts b/packages/client/test/rpc/eth/getTransactionCount.spec.ts index da5cc03dd0e..a4e4dcbfd88 100644 --- a/packages/client/test/rpc/eth/getTransactionCount.spec.ts +++ b/packages/client/test/rpc/eth/getTransactionCount.spec.ts @@ -48,7 +48,7 @@ tape(`${method}: call with valid arguments`, async (t) => { tx.getSenderAddress = () => { return address } - const parent = await blockchain.getLatestHeader() + const parent = await blockchain.getCanonicalHeadHeader() const block = Block.fromBlockData( { header: { diff --git a/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts b/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts index d87f6fac701..0d22fb9fd83 100644 --- a/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts +++ b/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts @@ -16,8 +16,8 @@ function createChain() { blocks: { latest: block }, headers: { latest: block.header }, getBlock: () => block, - getLatestBlock: () => block, - getLatestHeader: () => block.header, + getCanonicalHeadBlock: () => block, + getCanonicalHeadHeader: () => block.header, } } diff --git a/packages/client/test/rpc/helpers.ts b/packages/client/test/rpc/helpers.ts index 77718ccf899..56c16eb47ca 100644 --- a/packages/client/test/rpc/helpers.ts +++ b/packages/client/test/rpc/helpers.ts @@ -233,7 +233,7 @@ export async function runBlockWithTxs( ) { const { vm } = execution // build block with tx - const parentBlock = await chain.getLatestBlock() + const parentBlock = await chain.getCanonicalHeadBlock() const vmCopy = await vm.copy() const blockBuilder = await vmCopy.buildBlock({ parentBlock, diff --git a/packages/client/test/rpc/mockBlockchain.ts b/packages/client/test/rpc/mockBlockchain.ts index 8a1da6bacc5..9a989330ca2 100644 --- a/packages/client/test/rpc/mockBlockchain.ts +++ b/packages/client/test/rpc/mockBlockchain.ts @@ -36,7 +36,7 @@ export function mockBlockchain(options: any = {}) { } return block }, - getLatestHeader: () => { + getCanonicalHeadHeader: () => { return Block.fromBlockData().header }, } diff --git a/packages/client/test/sync/execution/vmexecution.spec.ts b/packages/client/test/sync/execution/vmexecution.spec.ts index 12cf333af8f..c70bb627527 100644 --- a/packages/client/test/sync/execution/vmexecution.spec.ts +++ b/packages/client/test/sync/execution/vmexecution.spec.ts @@ -34,9 +34,9 @@ tape('[VMExecution]', async (t) => { validateConsensus: false, }) let exec = await testSetup(blockchain) - const oldHead = await exec.vm.blockchain.getHead() + const oldHead = await exec.vm.blockchain.getIteratorHead() await exec.run() - let newHead = await exec.vm.blockchain.getHead() + let newHead = await exec.vm.blockchain.getIteratorHead() t.deepEqual(newHead.hash(), oldHead.hash(), 'should not modify blockchain on empty run') blockchain = await Blockchain.fromBlocksData(blocksDataMainnet, { @@ -45,8 +45,8 @@ tape('[VMExecution]', async (t) => { }) exec = await testSetup(blockchain) await exec.run() - newHead = await exec.vm.blockchain.getHead() - t.equal(newHead.header.number, BigInt(5), 'should run all blocks') + newHead = await exec.vm.blockchain.getIteratorHead() + t.equals(newHead.header.number, BigInt(5), 'should run all blocks') const common = new Common({ chain: 'testnet', customChains: [testnet] }) exec = await testSetup(blockchain, common) @@ -64,9 +64,9 @@ tape('[VMExecution]', async (t) => { common, }) let exec = await testSetup(blockchain, common) - const oldHead = await exec.vm.blockchain.getHead() + const oldHead = await exec.vm.blockchain.getIteratorHead() await exec.run() - let newHead = await exec.vm.blockchain.getHead() + let newHead = await exec.vm.blockchain.getIteratorHead() t.deepEqual(newHead.hash(), oldHead.hash(), 'should not modify blockchain on empty run') blockchain = await Blockchain.fromBlocksData(blocksDataGoerli, { @@ -76,8 +76,8 @@ tape('[VMExecution]', async (t) => { }) exec = await testSetup(blockchain, common) await exec.run() - newHead = await exec.vm.blockchain.getHead() - t.deepEqual(newHead.header.number, BigInt(7), 'should run all blocks') + newHead = await exec.vm.blockchain.getIteratorHead() + t.equals(newHead.header.number, BigInt(7), 'should run all blocks') t.end() }) diff --git a/packages/client/test/sync/fullsync.spec.ts b/packages/client/test/sync/fullsync.spec.ts index c4a51473707..f0f39dde7ce 100644 --- a/packages/client/test/sync/fullsync.spec.ts +++ b/packages/client/test/sync/fullsync.spec.ts @@ -212,7 +212,7 @@ tape('[FullSynchronizer]', async (t) => { parentHash: chainTip.hash(), }, }) - chain.getLatestBlock = td.func() + chain.getCanonicalHeadBlock = td.func() chain.putBlocks = td.func() // NewBlock message from Peer 3 await sync.handleNewBlock(newBlock, peers[2] as any) diff --git a/packages/client/test/util/rpc.spec.ts b/packages/client/test/util/rpc.spec.ts index 35cfb4a3519..b42fe4dca9f 100644 --- a/packages/client/test/util/rpc.spec.ts +++ b/packages/client/test/util/rpc.spec.ts @@ -28,7 +28,7 @@ tape('[Util/RPC]', (t) => { server, withEngineMiddleware: { jwtSecret: Buffer.alloc(32) }, }) - const req = { id: 1, method: 'eth_getLatestBlock', params: [] } + const req = { id: 1, method: 'eth_getCanonicalHeadBlock', params: [] } const resp = { id: 1, result: { test: '0x' + Buffer.alloc(64, 1).toString('hex') } } const reqBulk = [req, req] const respBulk = [resp, { id: 2, error: { err0: '456' } }] diff --git a/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts b/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts index 32a10ac8907..c12e9d02c5d 100644 --- a/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts @@ -10,7 +10,7 @@ tape('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', (t) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) const vm = await VM.create({ common }) - const genesis = await vm.blockchain.getLatestBlock() + const genesis = await vm.blockchain.getCanonicalHeadBlock() const header = { number: 1, parentHash: genesis.header.hash(), diff --git a/packages/vm/tests/api/runBlockchain.spec.ts b/packages/vm/tests/api/runBlockchain.spec.ts index 68c2d9262d1..d6d85d5c31d 100644 --- a/packages/vm/tests/api/runBlockchain.spec.ts +++ b/packages/vm/tests/api/runBlockchain.spec.ts @@ -49,8 +49,6 @@ tape('runBlockchain', (t) => { }) const vm = await setupVM({ genesisBlock, blockchain }) - st.ok(blockchain.meta.genesis, 'genesis should be set for blockchain') - // @ts-ignore await vm.runBlockchain() st.end() @@ -70,11 +68,7 @@ tape('runBlockchain', (t) => { const vm = await setupVM({ common, genesisBlock }) - st.equal(vm.blockchain.meta.genesis?.toString('hex'), testData.genesisBlockHeader.hash.slice(2)) - await vm.blockchain.putBlock(block) - const head = await vm.blockchain.getHead() - st.equal(head.hash().toString('hex'), testData.blocks[0].blockHeader.hash.slice(2)) await setupPreConditions(vm.stateManager as DefaultStateManager, testData) @@ -101,11 +95,7 @@ tape('runBlockchain', (t) => { const vm = await setupVM({ common, genesisBlock }) - st.equal(vm.blockchain.meta.genesis?.toString('hex'), testData.genesisBlockHeader.hash.slice(2)) - await vm.blockchain.putBlock(block) - const head = await vm.blockchain.getHead() - st.equal(head.hash().toString('hex'), testData.blocks[0].blockHeader.hash.slice(2)) await setupPreConditions(vm.stateManager as DefaultStateManager, testData) @@ -148,18 +138,12 @@ tape('runBlockchain', (t) => { await blockchain.putBlock(b2) await blockchain.putBlock(b3) - let head = await blockchain.getHead() - st.deepEqual(head.hash(), b3.hash(), 'block3 should be the current head') - try { await vm.runBlockchain() st.fail('should have returned error') } catch (e: any) { st.equal(e.message, 'test') - head = await blockchain.getHead() - st.deepEqual(head.hash(), b2.hash(), 'should have removed invalid block from head') - st.end() } }) diff --git a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts index 2a845304ec2..0756cddae10 100644 --- a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts +++ b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts @@ -159,7 +159,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: // TODO: Add option to `runBlockchain` not to generate genesis state. vm._common.genesis().stateRoot = vm.stateManager._trie.root await vm.runBlockchain() - const headBlock = await vm.blockchain.getHead() + const headBlock = await vm.blockchain.getIteratorHead() // if the test fails, then block.header is the prev because // vm.runBlock has a check that prevents the actual postState from being @@ -191,10 +191,11 @@ export default async function runBlockchainTest(options: any, testData: any, t: } } t.equal( - (blockchain.meta as any).rawHead.toString('hex'), + (blockchain as any)._headHeaderHash.toString('hex'), testData.lastblockhash, 'correct last header block' ) + const end = Date.now() const timeSpent = `${(end - begin) / 1000} secs` t.comment(`Time: ${timeSpent}`) From f8c5d0f0b855f214a2b57ebe7db384ea6350753f Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Tue, 5 Apr 2022 01:57:49 -0700 Subject: [PATCH 29/44] develop: ci fix, some last backwards compatibility removals (#1834) * move ethash depBrowserWorkaround fix for bigint-crypto-utils to blockchain karma.conf.js (karma has trouble with the default browser esm import without es6 transform, so it is easier to tell it to use umd) * new DefaultStateManager will init a trie if not supplied, so we don't need to init one here * remove backwards compatibility note (we will keep this property) * trie: remove old backwards compat methods * client: do undefined check first * vm: undo doc change * client: improve receipt size calculation * vm: resolve more todos * vm: more hardfork enum usage * dedupe receipt rlp encoding * lint * runCall, runCode: add more param typedocs, simplify * also add karma workaround to vm --- packages/blockchain/karma.conf.js | 11 +++- .../client/lib/net/protocol/ethprotocol.ts | 16 +----- .../client/lib/service/fullethereumservice.ts | 6 +- packages/ethash/package.json | 2 - packages/trie/src/baseTrie.ts | 25 +------- packages/trie/src/util/walkController.ts | 4 +- packages/vm/karma.conf.js | 9 ++- packages/vm/src/buildBlock.ts | 2 +- packages/vm/src/evm/evm.ts | 2 +- packages/vm/src/evm/interpreter.ts | 2 +- packages/vm/src/evm/opcodes/codes.ts | 16 +++--- packages/vm/src/evm/opcodes/gas.ts | 25 ++++---- packages/vm/src/evm/opcodes/util.ts | 5 +- packages/vm/src/evm/precompiles/index.ts | 20 +++---- packages/vm/src/index.ts | 3 - packages/vm/src/runBlock.ts | 12 ++-- packages/vm/src/runCall.ts | 50 ++++++++++++++-- packages/vm/src/runCode.ts | 57 +++++++++++-------- packages/vm/src/runTx.ts | 4 +- packages/vm/src/state/baseStateManager.ts | 2 +- 20 files changed, 150 insertions(+), 123 deletions(-) diff --git a/packages/blockchain/karma.conf.js b/packages/blockchain/karma.conf.js index 56de7f34489..521927c6d80 100644 --- a/packages/blockchain/karma.conf.js +++ b/packages/blockchain/karma.conf.js @@ -1,4 +1,4 @@ -module.exports = function(config) { +module.exports = function (config) { config.set({ browserNoActivityTimeout: 60000, frameworks: ['karma-typescript', 'tap'], @@ -11,8 +11,13 @@ module.exports = function(config) { bundlerOptions: { entrypoints: /\.spec\.ts$/, acornOptions: { - ecmaVersion: 11 - } + ecmaVersion: 11, + }, + resolve: { + alias: { + 'bigint-crypto-utils': '../../node_modules/bigint-crypto-utils/dist/bundles/umd.js', + }, + }, }, }, concurrency: 1, diff --git a/packages/client/lib/net/protocol/ethprotocol.ts b/packages/client/lib/net/protocol/ethprotocol.ts index 5b825b6cb95..7495076121f 100644 --- a/packages/client/lib/net/protocol/ethprotocol.ts +++ b/packages/client/lib/net/protocol/ethprotocol.ts @@ -6,7 +6,8 @@ import { BlockBodyBuffer, } from '@ethereumjs/block' import { TransactionFactory, TypedTransaction } from '@ethereumjs/tx' -import { bigIntToBuffer, bufferToBigInt, bufferToInt, intToBuffer, rlp } from 'ethereumjs-util' +import { encodeReceipt } from '@ethereumjs/vm/dist/runBlock' +import { bigIntToBuffer, bufferToBigInt, bufferToInt, rlp } from 'ethereumjs-util' import { Chain } from './../../blockchain' import { Message, Protocol, ProtocolOptions } from './protocol' import type { TxReceiptWithType } from '../../execution/receipt' @@ -230,18 +231,7 @@ export class EthProtocol extends Protocol { encode: ({ reqId, receipts }: { reqId: bigint; receipts: TxReceiptWithType[] }) => { const serializedReceipts = [] for (const receipt of receipts) { - let encodedReceipt = rlp.encode([ - (receipt as PreByzantiumTxReceipt).stateRoot ?? - (receipt as PostByzantiumTxReceipt).status, - bigIntToBuffer(receipt.gasUsed), - receipt.bitvector, - receipt.logs, - ]) - if (receipt.txType > 0) { - // Serialize receipt according to EIP-2718: - // `typed-receipt = tx-type || receipt-data` - encodedReceipt = Buffer.concat([intToBuffer(receipt.txType), encodedReceipt]) - } + const encodedReceipt = encodeReceipt(receipt, receipt.txType) serializedReceipts.push(encodedReceipt) } return [bigIntToBuffer(reqId), serializedReceipts] diff --git a/packages/client/lib/service/fullethereumservice.ts b/packages/client/lib/service/fullethereumservice.ts index 2b4290b14e4..c5fa915448f 100644 --- a/packages/client/lib/service/fullethereumservice.ts +++ b/packages/client/lib/service/fullethereumservice.ts @@ -1,5 +1,5 @@ import { Hardfork } from '@ethereumjs/common' -import { bigIntToBuffer } from 'ethereumjs-util' +import { encodeReceipt } from '@ethereumjs/vm/dist/runBlock' import { EthereumService, EthereumServiceOptions } from './ethereumservice' import { TxPool } from './txpool' import { FullSynchronizer } from '../sync/fullsync' @@ -215,10 +215,10 @@ export class FullEthereumService extends EthereumService { let receiptsSize = 0 for (const hash of hashes) { const blockReceipts = await receiptsManager.getReceipts(hash, true, true) - blockReceipts.forEach((r) => (r.gasUsed = bigIntToBuffer(r.gasUsed) as any)) if (!blockReceipts) continue receipts.push(...blockReceipts) - receiptsSize += Buffer.byteLength(JSON.stringify(blockReceipts)) + const receiptsBuffer = Buffer.concat(receipts.map((r) => encodeReceipt(r, r.txType))) + receiptsSize += Buffer.byteLength(receiptsBuffer) // From spec: The recommended soft limit for Receipts responses is 2 MiB. if (receiptsSize >= 2097152) { break diff --git a/packages/ethash/package.json b/packages/ethash/package.json index ff51302d774..79b6cf13863 100644 --- a/packages/ethash/package.json +++ b/packages/ethash/package.json @@ -18,8 +18,6 @@ "types": "dist/index.d.ts", "browser": "dist.browser/index.js", "scripts": { - "postinstall": "npm run depBrowserWorkaround", - "depBrowserWorkaround": "npx json -I -f ../../node_modules/bigint-crypto-utils/package.json -e \"this.browser='./dist/bundles/umd.js'\"", "build": "npm run build:node && npm run build:browser", "build:node": "../../config/cli/ts-build.sh node", "build:browser": "../../config/cli/ts-build.sh browser", diff --git a/packages/trie/src/baseTrie.ts b/packages/trie/src/baseTrie.ts index b3c77b31c59..7441ef1b09d 100644 --- a/packages/trie/src/baseTrie.ts +++ b/packages/trie/src/baseTrie.ts @@ -104,7 +104,7 @@ export class Trie { */ async checkRoot(root: Buffer): Promise { try { - const value = await this._lookupNode(root) + const value = await this.lookupNode(root) return value !== null } catch (error: any) { if (error.message == 'Missing node in DB') { @@ -244,7 +244,7 @@ export class Trie { } } - // Resolve if _walkTrie finishes without finding any nodes + // Resolve if walkTrie finishes without finding any nodes resolve({ node: null, remaining: [], stack }) }) } @@ -259,16 +259,6 @@ export class Trie { await WalkController.newWalk(onFound, this, root) } - /** - * @hidden - * Backwards compatibility - * @param root - - * @param onFound - - */ - async _walkTrie(root: Buffer, onFound: FoundNodeFunction): Promise { - await this.walkTrie(root, onFound) - } - /** * Creates the initial node from an empty tree. * @private @@ -298,15 +288,6 @@ export class Trie { return foundNode } - /** - * @hidden - * Backwards compatibility - * @param node The node hash to lookup from the DB - */ - async _lookupNode(node: Buffer | Buffer[]): Promise { - return this.lookupNode(node) - } - /** * Updates a node. * @private @@ -517,7 +498,7 @@ export class Trie { const branchNodeKey = branchNodes[0][0] // look up node - const foundNode = await this._lookupNode(branchNode) + const foundNode = await this.lookupNode(branchNode) if (foundNode) { key = processBranchNode( key, diff --git a/packages/trie/src/util/walkController.ts b/packages/trie/src/util/walkController.ts index f96c01972fb..3015eae2340 100644 --- a/packages/trie/src/util/walkController.ts +++ b/packages/trie/src/util/walkController.ts @@ -51,7 +51,7 @@ export class WalkController { this.reject = reject let node try { - node = await this.trie._lookupNode(root) + node = await this.trie.lookupNode(root) } catch (error: any) { return this.reject(error) } @@ -98,7 +98,7 @@ export class WalkController { async (taskFinishedCallback: Function) => { let childNode try { - childNode = await this.trie._lookupNode(nodeRef) + childNode = await this.trie.lookupNode(nodeRef) } catch (error: any) { return this.reject(error) } diff --git a/packages/vm/karma.conf.js b/packages/vm/karma.conf.js index 284832adede..76ea1cdaa9e 100644 --- a/packages/vm/karma.conf.js +++ b/packages/vm/karma.conf.js @@ -24,8 +24,13 @@ module.exports = function (config) { bundlerOptions: { entrypoints: /\.spec\.ts$/, acornOptions: { - ecmaVersion: 11 - } + ecmaVersion: 11, + }, + resolve: { + alias: { + 'bigint-crypto-utils': '../../node_modules/bigint-crypto-utils/dist/bundles/umd.js', + }, + }, }, }, diff --git a/packages/vm/src/buildBlock.ts b/packages/vm/src/buildBlock.ts index 38bd04115b6..599cd8f8328 100644 --- a/packages/vm/src/buildBlock.ts +++ b/packages/vm/src/buildBlock.ts @@ -139,7 +139,7 @@ export class BlockBuilder { const receiptTrie = new Trie() for (const [i, txResult] of this.transactionResults.entries()) { const tx = this.transactions[i] - const encodedReceipt = encodeReceipt(tx, txResult.receipt) + const encodedReceipt = encodeReceipt(txResult.receipt, tx.type) await receiptTrie.put(rlp.encode(i), encodedReceipt) } return receiptTrie.root diff --git a/packages/vm/src/evm/evm.ts b/packages/vm/src/evm/evm.ts index 9b9c86fe37f..64c9a58bccf 100644 --- a/packages/vm/src/evm/evm.ts +++ b/packages/vm/src/evm/evm.ts @@ -59,7 +59,7 @@ export interface ExecResult { */ gas?: bigint /** - * Amount of gas the transaction used to run + * Amount of gas the code used to run */ gasUsed: bigint /** diff --git a/packages/vm/src/evm/interpreter.ts b/packages/vm/src/evm/interpreter.ts index 752fd89b111..5f93648625a 100644 --- a/packages/vm/src/evm/interpreter.ts +++ b/packages/vm/src/evm/interpreter.ts @@ -243,7 +243,7 @@ export default class Interpreter { address: this._eei._env.address, account: this._eei._env.contract, stateManager: this._runState.stateManager, - memory: this._runState.memory._store, // Return underlying array for backwards-compatibility + memory: this._runState.memory._store, memoryWordCount: this._runState.memoryWordCount, codeAddress: this._eei._env.codeAddress, } diff --git a/packages/vm/src/evm/opcodes/codes.ts b/packages/vm/src/evm/opcodes/codes.ts index 37bc4db7b33..11d9c0d2387 100644 --- a/packages/vm/src/evm/opcodes/codes.ts +++ b/packages/vm/src/evm/opcodes/codes.ts @@ -1,4 +1,4 @@ -import Common from '@ethereumjs/common' +import Common, { Hardfork } from '@ethereumjs/common' import { CustomOpcode } from '../types' import { getFullname } from './util' import { AsyncDynamicGasHandler, dynamicGasHandlers, SyncDynamicGasHandler } from './gas' @@ -203,15 +203,15 @@ const opcodes: OpcodeEntry = { // If the base gas cost of any of the operations change, then these should also be added to this list. // If there are context variables changed (such as "warm slot reads") which are not the base gas fees, // Then this does not have to be added. -const hardforkOpcodes: { hardforkName: string; opcodes: OpcodeEntry }[] = [ +const hardforkOpcodes: { hardfork: Hardfork; opcodes: OpcodeEntry }[] = [ { - hardforkName: 'homestead', + hardfork: Hardfork.Homestead, opcodes: { 0xf4: { name: 'DELEGATECALL', isAsync: true, dynamicGas: true }, // EIP 7 }, }, { - hardforkName: 'tangerineWhistle', + hardfork: Hardfork.TangerineWhistle, opcodes: { 0x54: { name: 'SLOAD', isAsync: true, dynamicGas: true }, 0xf1: { name: 'CALL', isAsync: true, dynamicGas: true }, @@ -224,7 +224,7 @@ const hardforkOpcodes: { hardforkName: string; opcodes: OpcodeEntry }[] = [ }, }, { - hardforkName: 'byzantium', + hardfork: Hardfork.Byzantium, opcodes: { 0xfd: { name: 'REVERT', isAsync: false, dynamicGas: true }, // EIP 140 0xfa: { name: 'STATICCALL', isAsync: true, dynamicGas: true }, // EIP 214 @@ -233,7 +233,7 @@ const hardforkOpcodes: { hardforkName: string; opcodes: OpcodeEntry }[] = [ }, }, { - hardforkName: 'constantinople', + hardfork: Hardfork.Constantinople, opcodes: { 0x1b: { name: 'SHL', isAsync: false, dynamicGas: false }, // EIP 145 0x1c: { name: 'SHR', isAsync: false, dynamicGas: false }, // EIP 145 @@ -243,7 +243,7 @@ const hardforkOpcodes: { hardforkName: string; opcodes: OpcodeEntry }[] = [ }, }, { - hardforkName: 'istanbul', + hardfork: Hardfork.Istanbul, opcodes: { 0x46: { name: 'CHAINID', isAsync: false, dynamicGas: false }, // EIP 1344 0x47: { name: 'SELFBALANCE', isAsync: false, dynamicGas: false }, // EIP 1884 @@ -330,7 +330,7 @@ export function getOpcodesForHF(common: Common, customOpcodes?: CustomOpcode[]): const dynamicGasHandlersCopy = new Map(dynamicGasHandlers) for (let fork = 0; fork < hardforkOpcodes.length; fork++) { - if (common.gteHardfork(hardforkOpcodes[fork].hardforkName)) { + if (common.gteHardfork(hardforkOpcodes[fork].hardfork)) { opcodeBuilder = { ...opcodeBuilder, ...hardforkOpcodes[fork].opcodes } } } diff --git a/packages/vm/src/evm/opcodes/gas.ts b/packages/vm/src/evm/opcodes/gas.ts index c9479cf5b76..ed5fbb53f08 100644 --- a/packages/vm/src/evm/opcodes/gas.ts +++ b/packages/vm/src/evm/opcodes/gas.ts @@ -10,7 +10,7 @@ import { import { Address, bigIntToBuffer, setLengthLeft } from 'ethereumjs-util' import { ERROR } from '../../exceptions' import { RunState } from '../interpreter' -import Common from '@ethereumjs/common' +import Common, { Hardfork } from '@ethereumjs/common' import { updateSstoreGasEIP1283 } from './EIP1283' import { updateSstoreGasEIP2200 } from './EIP2200' import { accessAddressEIP2929, accessStorageEIP2929 } from './EIP2929' @@ -201,10 +201,9 @@ export const dynamicGasHandlers: Map BigInt(0)) { @@ -554,7 +553,7 @@ export const dynamicGasHandlers: Map gasAllowed ? gasAllowed : gasLimit } else { diff --git a/packages/vm/src/evm/precompiles/index.ts b/packages/vm/src/evm/precompiles/index.ts index d4cc2ac73a3..065dbfdc8d9 100644 --- a/packages/vm/src/evm/precompiles/index.ts +++ b/packages/vm/src/evm/precompiles/index.ts @@ -1,5 +1,5 @@ import { Address } from 'ethereumjs-util' -import Common from '@ethereumjs/common' +import Common, { Hardfork } from '@ethereumjs/common' import { PrecompileInput, PrecompileFunc } from './types' import { default as p1 } from './01-ecrecover' import { default as p2 } from './02-sha256' @@ -72,39 +72,39 @@ const precompiles: Precompiles = { const precompileAvailability: PrecompileAvailability = { '0000000000000000000000000000000000000001': { type: PrecompileAvailabilityCheck.Hardfork, - param: 'chainstart', + param: Hardfork.Chainstart, }, '0000000000000000000000000000000000000002': { type: PrecompileAvailabilityCheck.Hardfork, - param: 'chainstart', + param: Hardfork.Chainstart, }, [ripemdPrecompileAddress]: { type: PrecompileAvailabilityCheck.Hardfork, - param: 'chainstart', + param: Hardfork.Chainstart, }, '0000000000000000000000000000000000000004': { type: PrecompileAvailabilityCheck.Hardfork, - param: 'chainstart', + param: Hardfork.Chainstart, }, '0000000000000000000000000000000000000005': { type: PrecompileAvailabilityCheck.Hardfork, - param: 'byzantium', + param: Hardfork.Byzantium, }, '0000000000000000000000000000000000000006': { type: PrecompileAvailabilityCheck.Hardfork, - param: 'byzantium', + param: Hardfork.Byzantium, }, '0000000000000000000000000000000000000007': { type: PrecompileAvailabilityCheck.Hardfork, - param: 'byzantium', + param: Hardfork.Byzantium, }, '0000000000000000000000000000000000000008': { type: PrecompileAvailabilityCheck.Hardfork, - param: 'byzantium', + param: Hardfork.Byzantium, }, '0000000000000000000000000000000000000009': { type: PrecompileAvailabilityCheck.Hardfork, - param: 'istanbul', + param: Hardfork.Istanbul, }, '000000000000000000000000000000000000000a': { type: PrecompileAvailabilityCheck.EIP, diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index 8ac9e3854bd..0245c267d75 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -1,4 +1,3 @@ -import { SecureTrie as Trie } from 'merkle-patricia-tree' import { Account, Address, BigIntLike, toType, TypeOutput } from 'ethereumjs-util' import Blockchain from '@ethereumjs/blockchain' import Common, { Chain, Hardfork } from '@ethereumjs/common' @@ -302,9 +301,7 @@ export default class VM extends AsyncEventEmitter { if (opts.stateManager) { this.stateManager = opts.stateManager } else { - const trie = new Trie() this.stateManager = new DefaultStateManager({ - trie, common: this._common, }) } diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index 576b84dfb40..8e8631dcded 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -7,7 +7,6 @@ import VM from './index' import Bloom from './bloom' import { StateManager } from './state' import { short } from './evm/opcodes' -import { Capability, TypedTransaction } from '@ethereumjs/tx' import type { RunTxResult } from './runTx' import type { TxReceipt, PreByzantiumTxReceipt, PostByzantiumTxReceipt } from './types' import DAOConfig from './config/dao_fork_accounts_config.json' @@ -359,7 +358,7 @@ async function applyTransactions(this: VM, block: Block, opts: RunBlockOpts) { // Add receipt to trie to later calculate receipt root receipts.push(txRes.receipt) - const encodedReceipt = encodeReceipt(tx, txRes.receipt) + const encodedReceipt = encodeReceipt(txRes.receipt, tx.type) await receiptTrie.put(rlp.encode(txIdx), encodedReceipt) } @@ -434,7 +433,7 @@ export async function rewardAccount( /** * Returns the encoded tx receipt. */ -export function encodeReceipt(tx: TypedTransaction, receipt: TxReceipt) { +export function encodeReceipt(receipt: TxReceipt, txType: number) { const encoded = rlp.encode([ (receipt as PreByzantiumTxReceipt).stateRoot ?? (receipt as PostByzantiumTxReceipt).status, receipt.gasUsed, @@ -442,12 +441,13 @@ export function encodeReceipt(tx: TypedTransaction, receipt: TxReceipt) { receipt.logs, ]) - if (!tx.supports(Capability.EIP2718TypedTransaction)) { + if (txType === 0) { return encoded } - const type = intToBuffer(tx.type) - return Buffer.concat([type, encoded]) + // Serialize receipt according to EIP-2718: + // `typed-receipt = tx-type || receipt-data` + return Buffer.concat([intToBuffer(txType), encoded]) } /** diff --git a/packages/vm/src/runCall.ts b/packages/vm/src/runCall.ts index e62a92e4f51..f0911b57f55 100644 --- a/packages/vm/src/runCall.ts +++ b/packages/vm/src/runCall.ts @@ -9,23 +9,65 @@ import { default as EVM, EVMResult } from './evm/evm' * Options for running a call (or create) operation */ export interface RunCallOpts { + /** + * The `@ethereumjs/block` the `tx` belongs to. If omitted a default blank block will be used. + */ block?: Block + /** + * The gas price for the call. Defaults to `0` + */ gasPrice?: bigint + /** + * The address where the call originated from. Defaults to the zero address. + */ origin?: Address + /** + * The address that ran this code (`msg.sender`). Defaults to the zero address. + */ caller?: Address + /** + * The gas limit for the call. Defaults to `0xffffff` + */ gasLimit?: bigint + /** + * The to address. Defaults to the zero address. + */ to?: Address + /** + * The value in ether that is being sent to `opts.to`. Defaults to `0` + */ value?: bigint + /** + * The data for the call. + */ data?: Buffer /** * This is for CALLCODE where the code to load is different than the code from the `opts.to` address. */ code?: Buffer + /** + * The call depth. Defaults to `0` + */ depth?: number - compiled?: boolean - static?: boolean + /** + * If the code location is a precompile. + */ + isCompiled?: boolean + /** + * If the call should be executed statically. Defaults to false. + */ + isStatic?: boolean + /** + * An optional salt to pass to CREATE2. + */ salt?: Buffer + /** + * Addresses to selfdestruct. Defaults to none. + */ selfdestruct?: { [k: string]: boolean } + /** + * If the call is a DELEGATECALL. Defaults to false. + */ delegatecall?: boolean } @@ -48,8 +90,8 @@ export default function runCall(this: VM, opts: RunCallOpts): Promise data: opts.data, code: opts.code, depth: opts.depth ?? 0, - isCompiled: opts.compiled ?? false, - isStatic: opts.static ?? false, + isCompiled: opts.isCompiled ?? false, + isStatic: opts.isStatic ?? false, salt: opts.salt ?? null, selfdestruct: opts.selfdestruct ?? {}, delegatecall: opts.delegatecall ?? false, diff --git a/packages/vm/src/runCode.ts b/packages/vm/src/runCode.ts index 27e9af4ebf8..13251375509 100644 --- a/packages/vm/src/runCode.ts +++ b/packages/vm/src/runCode.ts @@ -26,36 +26,49 @@ export interface RunCodeOpts { * The `@ethereumjs/block` the `tx` belongs to. If omitted a default blank block will be used. */ block?: Block + /** + * Pass a custom {@link EVM} to use. If omitted the default {@link EVM} will be used. + */ evm?: EVM - txContext?: TxContext + /** + * The gas price for the call. Defaults to `0` + */ gasPrice?: bigint /** * The address where the call originated from. Defaults to the zero address. */ origin?: Address - message?: Message /** * The address that ran this code (`msg.sender`). Defaults to the zero address. */ caller?: Address /** - * The EVM code to run + * The EVM code to run. */ code?: Buffer /** - * The input data + * The input data. */ data?: Buffer /** - * Gas limit + * The gas limit for the call. */ gasLimit: bigint /** - * The value in ether that is being sent to `opt.address`. Defaults to `0` + * The value in ether that is being sent to `opts.address`. Defaults to `0` */ value?: bigint + /** + * The call depth. Defaults to `0` + */ depth?: number + /** + * If the call should be executed statically. Defaults to false. + */ isStatic?: boolean + /** + * Addresses to selfdestruct. Defaults to none. + */ selfdestruct?: { [k: string]: boolean } /** * The address of the account that is executing this code (`address(this)`). Defaults to the zero address. @@ -73,24 +86,22 @@ export interface RunCodeOpts { export default function runCode(this: VM, opts: RunCodeOpts): Promise { const block = opts.block ?? Block.fromBlockData({}, { common: this._common }) - // Backwards compatibility - const txContext = - opts.txContext ?? - new TxContext(opts.gasPrice ?? BigInt(0), opts.origin ?? opts.caller ?? Address.zero()) + const txContext = new TxContext( + opts.gasPrice ?? BigInt(0), + opts.origin ?? opts.caller ?? Address.zero() + ) - const message = - opts.message ?? - new Message({ - code: opts.code, - data: opts.data, - gasLimit: opts.gasLimit, - to: opts.address ?? Address.zero(), - caller: opts.caller, - value: opts.value, - depth: opts.depth ?? 0, - selfdestruct: opts.selfdestruct ?? {}, - isStatic: opts.isStatic ?? false, - }) + const message = new Message({ + code: opts.code, + data: opts.data, + gasLimit: opts.gasLimit, + to: opts.address ?? Address.zero(), + caller: opts.caller, + value: opts.value, + depth: opts.depth ?? 0, + selfdestruct: opts.selfdestruct ?? {}, + isStatic: opts.isStatic ?? false, + }) const evm = opts.evm ?? new EVM(this, txContext, block) diff --git a/packages/vm/src/runTx.ts b/packages/vm/src/runTx.ts index 56d21b5bd52..d233d9f52eb 100644 --- a/packages/vm/src/runTx.ts +++ b/packages/vm/src/runTx.ts @@ -1,7 +1,7 @@ import { debug as createDebugLogger } from 'debug' import { Address, KECCAK256_NULL, toBuffer } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' -import { ConsensusType } from '@ethereumjs/common' +import { ConsensusType, Hardfork } from '@ethereumjs/common' import { AccessList, AccessListItem, @@ -588,7 +588,7 @@ export async function generateTxReceipt( if (!tx.supports(Capability.EIP2718TypedTransaction)) { // Legacy transaction - if (this._common.gteHardfork('byzantium')) { + if (this._common.gteHardfork(Hardfork.Byzantium)) { // Post-Byzantium receipt = { status: txResult.execResult.exceptionError ? 0 : 1, // Receipts have a 0 as status on error diff --git a/packages/vm/src/state/baseStateManager.ts b/packages/vm/src/state/baseStateManager.ts index 4093978da8a..c4900a9d8a7 100644 --- a/packages/vm/src/state/baseStateManager.ts +++ b/packages/vm/src/state/baseStateManager.ts @@ -370,7 +370,7 @@ export abstract class BaseStateManager { * as defined in EIP-161 (https://eips.ethereum.org/EIPS/eip-161). */ async cleanupTouchedAccounts(): Promise { - if (this._common.gteHardfork('spuriousDragon')) { + if (this._common.gteHardfork(Hardfork.SpuriousDragon)) { const touchedArray = Array.from(this._touched) for (const addressHex of touchedArray) { const address = new Address(Buffer.from(addressHex, 'hex')) From be072a22b1b12e84d5340fb8dcd5d0e5f565824b Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Wed, 6 Apr 2022 10:32:25 -0400 Subject: [PATCH 30/44] Develop rebase fixes (2022-04-07) --- package-lock.json | 1 - packages/client/lib/execution/vmexecution.ts | 5 +- packages/client/lib/rpc/modules/engine.ts | 8 +- packages/client/lib/rpc/modules/eth.ts | 6 +- packages/client/test/blockchain/chain.spec.ts | 5 - packages/vm/src/evm/eei.ts | 2 +- packages/vm/src/evm/opcodes/functions.ts | 12 +- packages/vm/src/index.ts | 2 +- packages/vm/tests/api/EIPs/eip-1153.spec.ts | 383 +++++++++--------- .../api/EIPs/eip-3651-warm-coinbase.spec.ts | 16 +- 10 files changed, 215 insertions(+), 225 deletions(-) diff --git a/package-lock.json b/package-lock.json index fdcc874a9bc..bf16730d7cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19647,7 +19647,6 @@ "packages/ethash": { "name": "@ethereumjs/ethash", "version": "1.1.0", - "hasInstallScript": true, "license": "MPL-2.0", "dependencies": { "@ethereumjs/block": "^3.6.2", diff --git a/packages/client/lib/execution/vmexecution.ts b/packages/client/lib/execution/vmexecution.ts index c406c5c5195..5656578fed4 100644 --- a/packages/client/lib/execution/vmexecution.ts +++ b/packages/client/lib/execution/vmexecution.ts @@ -99,9 +99,10 @@ export class VMExecution extends Execution { } // Bypass updating head by using blockchain db directly const [hash, num] = [block.hash(), block.header.number] - const td = (await this.chain.getTd(block.header.parentHash, block.header.number.subn(1))).add( + const td = + (await this.chain.getTd(block.header.parentHash, block.header.number - BigInt(1))) + block.header.difficulty - ) + await this.chain.blockchain.dbManager.batch([ DBSetTD(td, num, hash), ...DBSetBlockOrHeader(block), diff --git a/packages/client/lib/rpc/modules/engine.ts b/packages/client/lib/rpc/modules/engine.ts index 1b73715b0fa..f5af992daa7 100644 --- a/packages/client/lib/rpc/modules/engine.ts +++ b/packages/client/lib/rpc/modules/engine.ts @@ -516,7 +516,7 @@ export class Engine { const vmHeadHash = this.chain.headers.latest!.hash() if (!vmHeadHash.equals(headBlock.hash())) { let parentBlocks: Block[] = [] - if (this.chain.headers.latest?.number.lt(headBlock.header.number)) { + if (this.chain.headers.latest && this.chain.headers.latest.number < headBlock.header.number) { try { parentBlocks = await recursivelyFindParents( vmHeadHash, @@ -542,12 +542,6 @@ export class Engine { await this.execution.setHead(blocks) this.service.txPool.removeNewBlockTxs(blocks) - // TODO: removed along rebase, 2022-04-05, @holgerd77 - // Analyze if code should be there for some reason - /*for (const block of blocks) { - this.validBlocks.delete(block.hash().toString('hex')) - }*/ - const timeDiff = new Date().getTime() / 1000 - Number(headBlock.header.timestamp) if ( (!this.config.syncTargetHeight || diff --git a/packages/client/lib/rpc/modules/eth.ts b/packages/client/lib/rpc/modules/eth.ts index 99feade688f..a1ec8435544 100644 --- a/packages/client/lib/rpc/modules/eth.ts +++ b/packages/client/lib/rpc/modules/eth.ts @@ -465,9 +465,9 @@ export class Eth { const runCallOpts = { caller: from ? Address.fromString(from) : undefined, to: to ? Address.fromString(to) : undefined, - gasLimit: toType(gasLimit, TypeOutput.BN), - gasPrice: toType(gasPrice, TypeOutput.BN), - value: toType(value, TypeOutput.BN), + gasLimit: toType(gasLimit, TypeOutput.BigInt), + gasPrice: toType(gasPrice, TypeOutput.BigInt), + value: toType(value, TypeOutput.BigInt), data: data ? toBuffer(data) : undefined, } const { execResult } = await vm.runCall(runCallOpts) diff --git a/packages/client/test/blockchain/chain.spec.ts b/packages/client/test/blockchain/chain.spec.ts index 4b900442709..199a2d56ae3 100644 --- a/packages/client/test/blockchain/chain.spec.ts +++ b/packages/client/test/blockchain/chain.spec.ts @@ -101,11 +101,6 @@ tape('[Chain]', (t) => { } catch (error) { t.pass('threw an error when chain is closed') } - await chain.getCanonicalHeadHeader() - t.ok(chain.opened, 'chain should open if getCanonicalHeadHeader() called') - await chain.close() - await chain.getCanonicalHeadBlock() - t.ok(chain.opened, 'chain should open if getCanonicalHeadBlock() called') await chain.close() try { await chain.getTd(block.hash(), block.header.number) diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index 5970c5d2efe..dc28371213c 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -64,7 +64,7 @@ export default class EEI { _evm: EVM _lastReturned: Buffer _common: Common - _gasLeft: BN + _gasLeft: bigint _transientStorage: TransientStorage constructor( diff --git a/packages/vm/src/evm/opcodes/functions.ts b/packages/vm/src/evm/opcodes/functions.ts index 320f99d69ea..883fc0abbd7 100644 --- a/packages/vm/src/evm/opcodes/functions.ts +++ b/packages/vm/src/evm/opcodes/functions.ts @@ -676,7 +676,7 @@ export const handlers: Map = new Map([ function (runState) { const [offset, byte] = runState.stack.popN(2) - const buf = bigIntToBuffer(byte & 0xffn) + const buf = bigIntToBuffer(byte & BigInt(0xff)) const offsetNum = Number(offset) runState.memory.extend(offsetNum, 1) runState.memory.write(offsetNum, 1, buf) @@ -878,9 +878,9 @@ export const handlers: Map = new Map([ 0xb3, function (runState) { const key = runState.stack.pop() - const keyBuf = key.toArrayLike(Buffer, 'be', 32) + const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) const value = runState.eei.transientStorageLoad(keyBuf) - const valueBN = value.length ? new BN(value) : new BN(0) + const valueBN = value.length ? bufferToBigInt(value) : BigInt(0) runState.stack.push(valueBN) }, ], @@ -893,13 +893,13 @@ export const handlers: Map = new Map([ } const [key, val] = runState.stack.popN(2) - const keyBuf = key.toArrayLike(Buffer, 'be', 32) + const keyBuf = setLengthLeft(bigIntToBuffer(key), 32) // NOTE: this should be the shortest representation let value - if (val.isZero()) { + if (val === BigInt(0)) { value = Buffer.from([]) } else { - value = val.toArrayLike(Buffer, 'be') + value = bigIntToBuffer(val) } runState.eei.transientStorageStore(keyBuf, value) diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index 0245c267d75..390b3b01471 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -282,7 +282,7 @@ export default class VM extends AsyncEventEmitter { Hardfork.Berlin, Hardfork.London, Hardfork.ArrowGlacier, - Hardfork.PreMerge, + Hardfork.MergeForkBlock, Hardfork.Merge, ] if (!supportedHardforks.includes(this._common.hardfork() as Hardfork)) { diff --git a/packages/vm/tests/api/EIPs/eip-1153.spec.ts b/packages/vm/tests/api/EIPs/eip-1153.spec.ts index 402efd683c5..3543362c719 100644 --- a/packages/vm/tests/api/EIPs/eip-1153.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-1153.spec.ts @@ -1,11 +1,11 @@ import tape from 'tape' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { Address, BN } from 'ethereumjs-util' +import { Account, Address, bufferToInt, privateToAddress } from 'ethereumjs-util' import { Transaction } from '@ethereumjs/tx' interface Test { - steps: { expectedOpcode: string; expectedGasUsed: number; expectedStack: BN[] }[] + steps: { expectedOpcode: string; expectedGasUsed: number; expectedStack: bigint[] }[] contracts: { code: string; address: Address }[] transactions: Transaction[] } @@ -16,16 +16,16 @@ const senderKey = Buffer.from( ) tape('EIP 1153: transient storage', (t) => { - const initialGas = new BN(0xffffffffff) + const initialGas = BigInt(0xffffffffff) const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin, eips: [1153] }) const runTest = async function (test: Test, st: tape.Test) { let i = 0 let currentGas = initialGas - const vm = new VM({ common }) + const vm = new (VM as any)({ common }) vm.on('step', function (step: any) { - const gasUsed = currentGas.sub(step.gasLeft) + const gasUsed = currentGas - step.gasLeft currentGas = step.gasLeft st.equal( @@ -35,16 +35,15 @@ tape('EIP 1153: transient storage', (t) => { ) st.deepEqual( - step.stack.map((e: BN) => e.toString()), - test.steps[i].expectedStack.map((e: BN) => e.toString()), + step.stack.map((e: bigint) => e.toString()), + test.steps[i].expectedStack.map((e: bigint) => e.toString()), `Expected stack: ${step.stack}` ) if (i > 0) { - const expectedGasUsed = new BN(test.steps[i - 1].expectedGasUsed) - st.equal( - true, - gasUsed.eq(expectedGasUsed), + const expectedGasUsed = BigInt(test.steps[i - 1].expectedGasUsed) + st.ok( + gasUsed === expectedGasUsed, `Opcode: ${ test.steps[i - 1].expectedOpcode }, Gas Used: ${gasUsed}, Expected: ${expectedGasUsed}` @@ -57,6 +56,8 @@ tape('EIP 1153: transient storage', (t) => { await vm.stateManager.putContractCode(address, Buffer.from(code, 'hex')) } + const fromAddress = new Address(privateToAddress(senderKey)) + await vm.stateManager.putAccount(fromAddress, new Account(BigInt(0), BigInt(0xfffffffff))) const results = [] for (const tx of test.transactions) { const result = await vm.runTx({ tx, skipBalance: true }) @@ -73,9 +74,9 @@ tape('EIP 1153: transient storage', (t) => { const address = new Address(Buffer.from('000000000000000000000000636F6E7472616374', 'hex')) const tx = Transaction.fromTxData({ - gasLimit: new BN(21000 + 9000), + gasLimit: BigInt(21000 + 9000), to: address, - value: new BN(1), + value: BigInt(1), }).sign(senderKey) const test = { @@ -83,15 +84,15 @@ tape('EIP 1153: transient storage', (t) => { transactions: [tx], steps: [ { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(2)] }, - { expectedOpcode: 'TSTORE', expectedGasUsed: 100, expectedStack: [new BN(2), new BN(1)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(2)] }, + { expectedOpcode: 'TSTORE', expectedGasUsed: 100, expectedStack: [BigInt(2), BigInt(1)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'TLOAD', expectedGasUsed: 100, expectedStack: [new BN(1)] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(2)] }, - { expectedOpcode: 'MSTORE', expectedGasUsed: 6, expectedStack: [new BN(2), new BN(0)] }, + { expectedOpcode: 'TLOAD', expectedGasUsed: 100, expectedStack: [BigInt(1)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(2)] }, + { expectedOpcode: 'MSTORE', expectedGasUsed: 6, expectedStack: [BigInt(2), BigInt(0)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(32)] }, - { expectedOpcode: 'RETURN', expectedGasUsed: NaN, expectedStack: [new BN(32), new BN(0)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(32)] }, + { expectedOpcode: 'RETURN', expectedGasUsed: NaN, expectedStack: [BigInt(32), BigInt(0)] }, ], } @@ -116,53 +117,53 @@ tape('EIP 1153: transient storage', (t) => { contracts: [{ address, code }], transactions: [ Transaction.fromTxData({ - gasLimit: new BN(15000000), + gasLimit: BigInt(15000000), to: address, data: Buffer.alloc(32), }).sign(senderKey), Transaction.fromTxData({ nonce: 1, - gasLimit: new BN(15000000), + gasLimit: BigInt(15000000), to: address, }).sign(senderKey), ], steps: [ // first tx { expectedOpcode: 'CALLDATASIZE', expectedGasUsed: 2, expectedStack: [] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(32)] }, - { expectedOpcode: 'EQ', expectedGasUsed: 3, expectedStack: [new BN(32), new BN(0)] }, - { expectedOpcode: 'PUSH4', expectedGasUsed: 3, expectedStack: [new BN(0)] }, - { expectedOpcode: 'JUMPI', expectedGasUsed: 10, expectedStack: [new BN(0), new BN(28)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(32)] }, + { expectedOpcode: 'EQ', expectedGasUsed: 3, expectedStack: [BigInt(32), BigInt(0)] }, + { expectedOpcode: 'PUSH4', expectedGasUsed: 3, expectedStack: [BigInt(0)] }, + { expectedOpcode: 'JUMPI', expectedGasUsed: 10, expectedStack: [BigInt(0), BigInt(28)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'PUSH4', expectedGasUsed: 3, expectedStack: [new BN(1)] }, - { expectedOpcode: 'JUMPI', expectedGasUsed: 10, expectedStack: [new BN(1), new BN(18)] }, + { expectedOpcode: 'PUSH4', expectedGasUsed: 3, expectedStack: [BigInt(1)] }, + { expectedOpcode: 'JUMPI', expectedGasUsed: 10, expectedStack: [BigInt(1), BigInt(18)] }, { expectedOpcode: 'JUMPDEST', expectedGasUsed: 1, expectedStack: [] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(255)] }, - { expectedOpcode: 'TSTORE', expectedGasUsed: 100, expectedStack: [new BN(255), new BN(0)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(255)] }, + { expectedOpcode: 'TSTORE', expectedGasUsed: 100, expectedStack: [BigInt(255), BigInt(0)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [new BN(0)] }, - { expectedOpcode: 'RETURN', expectedGasUsed: -278, expectedStack: [new BN(0), new BN(0)] }, + { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [BigInt(0)] }, + { expectedOpcode: 'RETURN', expectedGasUsed: -278, expectedStack: [BigInt(0), BigInt(0)] }, // second tx { expectedOpcode: 'CALLDATASIZE', expectedGasUsed: 2, expectedStack: [] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(0)] }, - { expectedOpcode: 'EQ', expectedGasUsed: 3, expectedStack: [new BN(0), new BN(0)] }, - { expectedOpcode: 'PUSH4', expectedGasUsed: 3, expectedStack: [new BN(1)] }, - { expectedOpcode: 'JUMPI', expectedGasUsed: 10, expectedStack: [new BN(1), new BN(28)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(0)] }, + { expectedOpcode: 'EQ', expectedGasUsed: 3, expectedStack: [BigInt(0), BigInt(0)] }, + { expectedOpcode: 'PUSH4', expectedGasUsed: 3, expectedStack: [BigInt(1)] }, + { expectedOpcode: 'JUMPI', expectedGasUsed: 10, expectedStack: [BigInt(1), BigInt(28)] }, { expectedOpcode: 'JUMPDEST', expectedGasUsed: 1, expectedStack: [] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'TLOAD', expectedGasUsed: 100, expectedStack: [new BN(0)] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(0)] }, - { expectedOpcode: 'MSTORE', expectedGasUsed: 6, expectedStack: [new BN(0), new BN(0)] }, + { expectedOpcode: 'TLOAD', expectedGasUsed: 100, expectedStack: [BigInt(0)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(0)] }, + { expectedOpcode: 'MSTORE', expectedGasUsed: 6, expectedStack: [BigInt(0), BigInt(0)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(32)] }, - { expectedOpcode: 'RETURN', expectedGasUsed: 3, expectedStack: [new BN(32), new BN(0)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(32)] }, + { expectedOpcode: 'RETURN', expectedGasUsed: 3, expectedStack: [BigInt(32), BigInt(0)] }, ], } const [result1, result2] = await runTest(test, st) st.equal(result1.execResult.exceptionError, undefined) - st.deepEqual(new BN(result2.execResult.returnValue).toNumber(), 0x00) + st.equal(bufferToInt(result2.execResult.returnValue), 0) st.end() }) @@ -186,7 +187,7 @@ tape('EIP 1153: transient storage', (t) => { '6362fdb9be600052602060006020600060007f000000000000000000000000ea674fdde714fd979de3edf0f56aa9716b898ec861fffff163afc874d2600052602060006020600060007f000000000000000000000000ea674fdde714fd979de3edf0f56aa9716b898ec861fffff16343ac1c39600052602060006020600060007f000000000000000000000000ea674fdde714fd979de3edf0f56aa9716b898ec861fffff1366000803760206000f3' const unsignedTx = Transaction.fromTxData({ - gasLimit: new BN(15000000), + gasLimit: BigInt(15000000), to: callingAddress, }) @@ -200,464 +201,464 @@ tape('EIP 1153: transient storage', (t) => { transactions: [tx], steps: [ { expectedOpcode: 'PUSH4', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(1660795326)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(1660795326)] }, { expectedOpcode: 'MSTORE', expectedGasUsed: 6, - expectedStack: [new BN(1660795326), new BN(0)], + expectedStack: [BigInt(1660795326), BigInt(0)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(32)] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(32), new BN(0)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(32)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(32), BigInt(0)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(32), new BN(0), new BN(32)], + expectedStack: [BigInt(32), BigInt(0), BigInt(32)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(32), new BN(0), new BN(32), new BN(0)], + expectedStack: [BigInt(32), BigInt(0), BigInt(32), BigInt(0)], }, { expectedOpcode: 'PUSH32', expectedGasUsed: 3, - expectedStack: [new BN(32), new BN(0), new BN(32), new BN(0), new BN(0)], + expectedStack: [BigInt(32), BigInt(0), BigInt(32), BigInt(0), BigInt(0)], }, { expectedOpcode: 'PUSH2', expectedGasUsed: 3, expectedStack: [ - new BN(32), - new BN(0), - new BN(32), - new BN(0), - new BN(0), - new BN('1338207774508379457866452578149304295121587113672'), + BigInt(32), + BigInt(0), + BigInt(32), + BigInt(0), + BigInt(0), + BigInt('1338207774508379457866452578149304295121587113672'), ], }, { expectedOpcode: 'CALL', expectedGasUsed: 14913432, expectedStack: [ - new BN(32), - new BN(0), - new BN(32), - new BN(0), - new BN(0), - new BN('1338207774508379457866452578149304295121587113672'), - new BN('65535'), + BigInt(32), + BigInt(0), + BigInt(32), + BigInt(0), + BigInt(0), + BigInt('1338207774508379457866452578149304295121587113672'), + BigInt('65535'), ], }, { expectedOpcode: 'CALLDATASIZE', expectedGasUsed: 2, expectedStack: [] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(32)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(32)] }, // - { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [new BN(32), new BN(0)] }, + { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [BigInt(32), BigInt(0)] }, { expectedOpcode: 'CALLDATACOPY', expectedGasUsed: 9, - expectedStack: [new BN(32), new BN(0), new BN(0)], + expectedStack: [BigInt(32), BigInt(0), BigInt(0)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'MLOAD', expectedGasUsed: 3, expectedStack: [new BN(0)] }, - { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [new BN(1660795326)] }, + { expectedOpcode: 'MLOAD', expectedGasUsed: 3, expectedStack: [BigInt(0)] }, + { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [BigInt(1660795326)] }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(1660795326), new BN(1660795326)], + expectedStack: [BigInt(1660795326), BigInt(1660795326)], }, { expectedOpcode: 'EQ', expectedGasUsed: 3, - expectedStack: [new BN(1660795326), new BN(1660795326), new BN(2949149906)], + expectedStack: [BigInt(1660795326), BigInt(1660795326), BigInt(2949149906)], }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(1660795326), new BN(0)], + expectedStack: [BigInt(1660795326), BigInt(0)], }, { expectedOpcode: 'JUMPI', expectedGasUsed: 10, - expectedStack: [new BN(1660795326), new BN(0), new BN(52)], + expectedStack: [BigInt(1660795326), BigInt(0), BigInt(52)], }, - { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [new BN(1660795326)] }, + { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [BigInt(1660795326)] }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(1660795326), new BN(1660795326)], + expectedStack: [BigInt(1660795326), BigInt(1660795326)], }, { expectedOpcode: 'EQ', expectedGasUsed: 3, - expectedStack: [new BN(1660795326), new BN(1660795326), new BN(1660795326)], + expectedStack: [BigInt(1660795326), BigInt(1660795326), BigInt(1660795326)], }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(1660795326), new BN(1)], + expectedStack: [BigInt(1660795326), BigInt(1)], }, { expectedOpcode: 'JUMPI', expectedGasUsed: 10, - expectedStack: [new BN(1660795326), new BN(1), new BN(63)], + expectedStack: [BigInt(1660795326), BigInt(1), BigInt(63)], }, - { expectedOpcode: 'JUMPDEST', expectedGasUsed: 1, expectedStack: [new BN(1660795326)] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(1660795326)] }, + { expectedOpcode: 'JUMPDEST', expectedGasUsed: 1, expectedStack: [BigInt(1660795326)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(1660795326)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1660795326), new BN(170)], + expectedStack: [BigInt(1660795326), BigInt(170)], }, { expectedOpcode: 'TSTORE', expectedGasUsed: 100, - expectedStack: [new BN(1660795326), new BN(170), new BN(0)], + expectedStack: [BigInt(1660795326), BigInt(170), BigInt(0)], }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(1660795326)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(1660795326)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1660795326), new BN(0)], + expectedStack: [BigInt(1660795326), BigInt(0)], }, { expectedOpcode: 'RETURN', expectedGasUsed: -14910832, - expectedStack: [new BN(1660795326), new BN(0), new BN(0)], + expectedStack: [BigInt(1660795326), BigInt(0), BigInt(0)], }, - { expectedOpcode: 'PUSH4', expectedGasUsed: 3, expectedStack: [new BN(1)] }, + { expectedOpcode: 'PUSH4', expectedGasUsed: 3, expectedStack: [BigInt(1)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(2949149906)], + expectedStack: [BigInt(1), BigInt(2949149906)], }, { expectedOpcode: 'MSTORE', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(2949149906), new BN(0)], + expectedStack: [BigInt(1), BigInt(2949149906), BigInt(0)], }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(1)] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(1), new BN(32)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(1)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(1), BigInt(32)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(32), new BN(0)], + expectedStack: [BigInt(1), BigInt(32), BigInt(0)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(32), new BN(0), new BN(32)], + expectedStack: [BigInt(1), BigInt(32), BigInt(0), BigInt(32)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(32), new BN(0), new BN(32), new BN(0)], + expectedStack: [BigInt(1), BigInt(32), BigInt(0), BigInt(32), BigInt(0)], }, { expectedOpcode: 'PUSH32', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(32), new BN(0), new BN(32), new BN(0), new BN(0)], + expectedStack: [BigInt(1), BigInt(32), BigInt(0), BigInt(32), BigInt(0), BigInt(0)], }, { expectedOpcode: 'PUSH2', expectedGasUsed: 3, expectedStack: [ - new BN(1), - new BN(32), - new BN(0), - new BN(32), - new BN(0), - new BN(0), - new BN('1338207774508379457866452578149304295121587113672'), + BigInt(1), + BigInt(32), + BigInt(0), + BigInt(32), + BigInt(0), + BigInt(0), + BigInt('1338207774508379457866452578149304295121587113672'), ], }, { expectedOpcode: 'CALL', expectedGasUsed: 14910622, expectedStack: [ - new BN(1), - new BN(32), - new BN(0), - new BN(32), - new BN(0), - new BN(0), - new BN('1338207774508379457866452578149304295121587113672'), - new BN(0xffff), + BigInt(1), + BigInt(32), + BigInt(0), + BigInt(32), + BigInt(0), + BigInt(0), + BigInt('1338207774508379457866452578149304295121587113672'), + BigInt(0xffff), ], }, { expectedOpcode: 'CALLDATASIZE', expectedGasUsed: 2, expectedStack: [] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(32)] }, - { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [new BN(32), new BN(0)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(32)] }, + { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [BigInt(32), BigInt(0)] }, { expectedOpcode: 'CALLDATACOPY', expectedGasUsed: 9, - expectedStack: [new BN(32), new BN(0), new BN(0)], + expectedStack: [BigInt(32), BigInt(0), BigInt(0)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'MLOAD', expectedGasUsed: 3, expectedStack: [new BN(0)] }, - { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [new BN(2949149906)] }, + { expectedOpcode: 'MLOAD', expectedGasUsed: 3, expectedStack: [BigInt(0)] }, + { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [BigInt(2949149906)] }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(2949149906), new BN(2949149906)], + expectedStack: [BigInt(2949149906), BigInt(2949149906)], }, { expectedOpcode: 'EQ', expectedGasUsed: 3, - expectedStack: [new BN(2949149906), new BN(2949149906), new BN(2949149906)], + expectedStack: [BigInt(2949149906), BigInt(2949149906), BigInt(2949149906)], }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(2949149906), new BN(1)], + expectedStack: [BigInt(2949149906), BigInt(1)], }, { expectedOpcode: 'JUMPI', expectedGasUsed: 10, - expectedStack: [new BN(2949149906), new BN(1), new BN(52)], + expectedStack: [BigInt(2949149906), BigInt(1), BigInt(52)], }, - { expectedOpcode: 'JUMPDEST', expectedGasUsed: 1, expectedStack: [new BN(2949149906)] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(2949149906)] }, + { expectedOpcode: 'JUMPDEST', expectedGasUsed: 1, expectedStack: [BigInt(2949149906)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(2949149906)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(2949149906), new BN(255)], + expectedStack: [BigInt(2949149906), BigInt(255)], }, { expectedOpcode: 'TSTORE', expectedGasUsed: 100, - expectedStack: [new BN(2949149906), new BN(255), new BN(0)], + expectedStack: [BigInt(2949149906), BigInt(255), BigInt(0)], }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(2949149906)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(2949149906)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(2949149906), new BN(0)], + expectedStack: [BigInt(2949149906), BigInt(0)], }, { expectedOpcode: 'REVERT', expectedGasUsed: -14910522, - expectedStack: [new BN(2949149906), new BN(0), new BN(0)], + expectedStack: [BigInt(2949149906), BigInt(0), BigInt(0)], }, - { expectedOpcode: 'PUSH4', expectedGasUsed: 3, expectedStack: [new BN(1), new BN(0)] }, + { expectedOpcode: 'PUSH4', expectedGasUsed: 3, expectedStack: [BigInt(1), BigInt(0)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(0), new BN(1135352889)], + expectedStack: [BigInt(1), BigInt(0), BigInt(1135352889)], }, { expectedOpcode: 'MSTORE', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(0), new BN(1135352889), new BN(0)], + expectedStack: [BigInt(1), BigInt(0), BigInt(1135352889), BigInt(0)], }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(1), new BN(0)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(1), BigInt(0)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(0), new BN(32)], + expectedStack: [BigInt(1), BigInt(0), BigInt(32)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(0), new BN(32), new BN(0)], + expectedStack: [BigInt(1), BigInt(0), BigInt(32), BigInt(0)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(0), new BN(32), new BN(0), new BN(32)], + expectedStack: [BigInt(1), BigInt(0), BigInt(32), BigInt(0), BigInt(32)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(0), new BN(32), new BN(0), new BN(32), new BN(0)], + expectedStack: [BigInt(1), BigInt(0), BigInt(32), BigInt(0), BigInt(32), BigInt(0)], }, { expectedOpcode: 'PUSH32', expectedGasUsed: 3, expectedStack: [ - new BN(1), - new BN(0), - new BN(32), - new BN(0), - new BN(32), - new BN(0), - new BN(0), + BigInt(1), + BigInt(0), + BigInt(32), + BigInt(0), + BigInt(32), + BigInt(0), + BigInt(0), ], }, { expectedOpcode: 'PUSH2', expectedGasUsed: 3, expectedStack: [ - new BN(1), - new BN(0), - new BN(32), - new BN(0), - new BN(32), - new BN(0), - new BN(0), - new BN('1338207774508379457866452578149304295121587113672'), + BigInt(1), + BigInt(0), + BigInt(32), + BigInt(0), + BigInt(32), + BigInt(0), + BigInt(0), + BigInt('1338207774508379457866452578149304295121587113672'), ], }, { expectedOpcode: 'CALL', expectedGasUsed: 14910334, expectedStack: [ - new BN(1), - new BN(0), - new BN(32), - new BN(0), - new BN(32), - new BN(0), - new BN(0), - new BN('1338207774508379457866452578149304295121587113672'), - new BN(0xffff), + BigInt(1), + BigInt(0), + BigInt(32), + BigInt(0), + BigInt(32), + BigInt(0), + BigInt(0), + BigInt('1338207774508379457866452578149304295121587113672'), + BigInt(0xffff), ], }, { expectedOpcode: 'CALLDATASIZE', expectedGasUsed: 2, expectedStack: [] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(32)] }, - { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [new BN(32), new BN(0)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(32)] }, + { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [BigInt(32), BigInt(0)] }, { expectedOpcode: 'CALLDATACOPY', expectedGasUsed: 9, - expectedStack: [new BN(32), new BN(0), new BN(0)], + expectedStack: [BigInt(32), BigInt(0), BigInt(0)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [] }, - { expectedOpcode: 'MLOAD', expectedGasUsed: 3, expectedStack: [new BN(0)] }, - { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [new BN(1135352889)] }, + { expectedOpcode: 'MLOAD', expectedGasUsed: 3, expectedStack: [BigInt(0)] }, + { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [BigInt(1135352889)] }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(1135352889)], + expectedStack: [BigInt(1135352889), BigInt(1135352889)], }, { expectedOpcode: 'EQ', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(1135352889), new BN(2949149906)], + expectedStack: [BigInt(1135352889), BigInt(1135352889), BigInt(2949149906)], }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(0)], + expectedStack: [BigInt(1135352889), BigInt(0)], }, { expectedOpcode: 'JUMPI', expectedGasUsed: 10, - expectedStack: [new BN(1135352889), new BN(0), new BN(52)], + expectedStack: [BigInt(1135352889), BigInt(0), BigInt(52)], }, { expectedOpcode: 'DUP1', expectedGasUsed: 3, - expectedStack: [new BN(1135352889)], + expectedStack: [BigInt(1135352889)], }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(1135352889)], + expectedStack: [BigInt(1135352889), BigInt(1135352889)], }, { expectedOpcode: 'EQ', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(1135352889), new BN(1660795326)], + expectedStack: [BigInt(1135352889), BigInt(1135352889), BigInt(1660795326)], }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(0)], + expectedStack: [BigInt(1135352889), BigInt(0)], }, { expectedOpcode: 'JUMPI', expectedGasUsed: 10, - expectedStack: [new BN(1135352889), new BN(0), new BN(63)], + expectedStack: [BigInt(1135352889), BigInt(0), BigInt(63)], }, - { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [new BN(1135352889)] }, + { expectedOpcode: 'DUP1', expectedGasUsed: 3, expectedStack: [BigInt(1135352889)] }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(1135352889)], + expectedStack: [BigInt(1135352889), BigInt(1135352889)], }, { expectedOpcode: 'EQ', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(1135352889), new BN(1135352889)], + expectedStack: [BigInt(1135352889), BigInt(1135352889), BigInt(1135352889)], }, { expectedOpcode: 'PUSH4', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(1)], + expectedStack: [BigInt(1135352889), BigInt(1)], }, { expectedOpcode: 'JUMPI', expectedGasUsed: 10, - expectedStack: [new BN(1135352889), new BN(1), new BN(74)], + expectedStack: [BigInt(1135352889), BigInt(1), BigInt(74)], }, - { expectedOpcode: 'JUMPDEST', expectedGasUsed: 1, expectedStack: [new BN(1135352889)] }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(1135352889)] }, + { expectedOpcode: 'JUMPDEST', expectedGasUsed: 1, expectedStack: [BigInt(1135352889)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(1135352889)] }, { expectedOpcode: 'TLOAD', expectedGasUsed: 100, - expectedStack: [new BN(1135352889), new BN(0)], + expectedStack: [BigInt(1135352889), BigInt(0)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(170)], + expectedStack: [BigInt(1135352889), BigInt(170)], }, { expectedOpcode: 'MSTORE', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(170), new BN(0)], + expectedStack: [BigInt(1135352889), BigInt(170), BigInt(0)], }, - { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [new BN(1135352889)] }, + { expectedOpcode: 'PUSH1', expectedGasUsed: 3, expectedStack: [BigInt(1135352889)] }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1135352889), new BN(32)], + expectedStack: [BigInt(1135352889), BigInt(32)], }, { expectedOpcode: 'RETURN', expectedGasUsed: -14910234, - expectedStack: [new BN(1135352889), new BN(32), new BN(0)], + expectedStack: [BigInt(1135352889), BigInt(32), BigInt(0)], }, { expectedOpcode: 'CALLDATASIZE', expectedGasUsed: 2, - expectedStack: [new BN(1), new BN(0), new BN(1)], + expectedStack: [BigInt(1), BigInt(0), BigInt(1)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(0), new BN(1), new BN(0)], + expectedStack: [BigInt(1), BigInt(0), BigInt(1), BigInt(0)], }, { expectedOpcode: 'DUP1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(0), new BN(1), new BN(0), new BN(0)], + expectedStack: [BigInt(1), BigInt(0), BigInt(1), BigInt(0), BigInt(0)], }, { expectedOpcode: 'CALLDATACOPY', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(0), new BN(1), new BN(0), new BN(0), new BN(0)], + expectedStack: [BigInt(1), BigInt(0), BigInt(1), BigInt(0), BigInt(0), BigInt(0)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(0), new BN(1)], + expectedStack: [BigInt(1), BigInt(0), BigInt(1)], }, { expectedOpcode: 'PUSH1', expectedGasUsed: 3, - expectedStack: [new BN(1), new BN(0), new BN(1), new BN(32)], + expectedStack: [BigInt(1), BigInt(0), BigInt(1), BigInt(32)], }, { expectedOpcode: 'RETURN', expectedGasUsed: NaN, - expectedStack: [new BN(1), new BN(0), new BN(1), new BN(32), new BN(0)], + expectedStack: [BigInt(1), BigInt(0), BigInt(1), BigInt(32), BigInt(0)], }, ], } const [result] = await runTest(test, st) - st.deepEqual(new BN(result.execResult.returnValue).toNumber(), 0xaa) + st.equal(bufferToInt(result.execResult.returnValue), 0xaa) st.end() }) }) diff --git a/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts b/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts index 392ad85afaa..c442ca37db4 100644 --- a/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts @@ -2,10 +2,10 @@ import tape from 'tape' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' -import { Address, BN, privateToAddress } from 'ethereumjs-util' +import { Address, privateToAddress } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' const pkey = Buffer.from('20'.repeat(32), 'hex') -const GWEI = new BN('1000000000') +const GWEI = BigInt(1000000000) const sender = new Address(privateToAddress(pkey)) const coinbase = new Address(Buffer.from('ff'.repeat(20), 'hex')) @@ -30,9 +30,9 @@ const code = Buffer.from('60008080806001415AF100', 'hex') const contractAddress = new Address(Buffer.from('ee'.repeat(20), 'hex')) async function getVM(common: Common) { - const vm = new VM({ common: common }) + const vm = new (VM as any)({ common: common }) const account = await vm.stateManager.getAccount(sender) - const balance = GWEI.muln(21000).muln(10000000) + const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance await vm.stateManager.putAccount(sender, account) @@ -64,9 +64,9 @@ tape('EIP 3651 tests', (t) => { ) const result2 = await vm2.runTx({ block, tx }) - const expectedDiff = new BN(common.param('gasPrices', 'coldaccountaccess')).subn( - common.param('gasPrices', 'warmstorageread') - ) - st.ok(result2.gasUsed.sub(result.gasUsed).eq(expectedDiff), 'gas difference is correct') + const expectedDiff = + BigInt(common.param('gasPrices', 'coldaccountaccess')) - + BigInt(common.param('gasPrices', 'warmstorageread')) + st.equal(result2.gasUsed - result.gasUsed, expectedDiff, 'gas difference is correct') }) }) From 6ff409ea31bf72bfbf2bf0d92c634e8101d7a501 Mon Sep 17 00:00:00 2001 From: g11tech <76567250+g11tech@users.noreply.github.com> Date: Wed, 13 Apr 2022 14:13:08 +0530 Subject: [PATCH 31/44] vm: extract statemanager to own package (#1817) * Abstract stateManager out and add vmState to wrap its context in the vm * Move the baseStateManager to the new package * package cleanup * further cleanup * more cleanup and relocate back transient storage and log type * update package lock * remove statemanager as dependency from client * add the package dependency back without adding the build dependency * remove unused deps * avoid deep linking to docs, as typedoc changes permalinks frequently * simplify tsconfig include * explicitly import `inherits` to fix karma-typescript issue * no need to specify type when default is used (can be inferred) * add statemanager to root readme * add statemanager deps in mermaid graph * fix missing script * update the short utility fn and add some tests Co-authored-by: Ryan Ghods --- .github/workflows/node-versions.yml | 4 + .github/workflows/statemanager-build.yml | 47 + README.md | 43 +- package-lock.json | 2544 ++++++++++------- packages/client/lib/client.ts | 2 +- packages/client/lib/execution/vmexecution.ts | 4 +- packages/client/lib/miner/miner.ts | 2 +- packages/client/lib/miner/pendingBlock.ts | 2 +- packages/client/lib/rpc/modules/eth.ts | 2 +- packages/client/lib/service/txpool.ts | 2 +- packages/client/package.json | 1 + packages/client/test/miner/miner.spec.ts | 30 +- .../client/test/miner/pendingBlock.spec.ts | 2 +- .../client/test/rpc/eth/estimateGas.spec.ts | 2 +- .../client/test/rpc/eth/getBalance.spec.ts | 2 +- packages/client/test/rpc/eth/getCode.spec.ts | 2 +- .../test/rpc/eth/getTransactionCount.spec.ts | 2 +- packages/statemanager/.eslintrc.js | 9 + packages/statemanager/.gitignore | 2 + packages/statemanager/.nycrc | 6 + packages/statemanager/.prettierignore | 8 + packages/statemanager/CHANGELOG.md | 8 + packages/statemanager/DEVELOPER.md | 12 + packages/statemanager/LICENSE | 373 +++ packages/statemanager/README.md | 53 + packages/statemanager/docs/README.md | 13 + .../docs/classes/index.default.md} | 0 .../docs/modules/index.md} | 0 .../docs/modules/state_interface.md | 0 .../docs/modules/state_statemanager.md | 0 packages/statemanager/karma.conf.js | 66 + packages/statemanager/package.json | 70 + packages/statemanager/prettier.config.js | 1 + packages/statemanager/src/baseStateManager.ts | 151 + .../src/state => statemanager/src}/cache.ts | 0 packages/statemanager/src/index.ts | 3 + .../state => statemanager/src}/interface.ts | 28 +- .../src}/stateManager.ts | 7 +- .../tests}/cache.spec.ts | 4 +- .../tests}/proofStateManager.spec.ts | 3 +- .../tests}/stateManager.spec.ts | 479 +--- .../testdata/ropsten_contractWithStorage.json | 0 .../testdata/ropsten_nonexistentAccount.json | 0 .../tests}/testdata/ropsten_validAccount.json | 0 packages/statemanager/tests/util.ts | 5 + packages/statemanager/tsconfig.browser.json | 7 + packages/statemanager/tsconfig.json | 4 + packages/statemanager/tsconfig.prod.json | 14 + packages/statemanager/typedoc.js | 8 + packages/util/src/bytes.ts | 16 + packages/util/test/bytes.spec.ts | 19 + packages/vm/README.md | 6 +- packages/vm/benchmarks/util.ts | 2 +- packages/vm/package.json | 1 + packages/vm/src/buildBlock.ts | 2 +- packages/vm/src/evm/eei.ts | 7 +- packages/vm/src/evm/evm.ts | 9 +- packages/vm/src/evm/interpreter.ts | 15 +- packages/vm/src/evm/opcodes/EIP2929.ts | 17 +- packages/vm/src/evm/opcodes/gas.ts | 4 +- packages/vm/src/evm/opcodes/util.ts | 9 - packages/vm/src/evm/types.ts | 2 +- packages/vm/src/index.ts | 15 +- packages/vm/src/runBlock.ts | 13 +- packages/vm/src/runBlockchain.ts | 2 +- packages/vm/src/runTx.ts | 10 +- packages/vm/src/state/index.ts | 3 - .../{state/baseStateManager.ts => vmState.ts} | 413 ++- packages/vm/tests/api/EIPs/eip-3529.spec.ts | 5 +- packages/vm/tests/api/buildBlock.spec.ts | 8 +- packages/vm/tests/api/evm/eei.spec.ts | 12 +- packages/vm/tests/api/index.spec.ts | 3 +- packages/vm/tests/api/runBlock.spec.ts | 10 +- packages/vm/tests/api/runBlockchain.spec.ts | 6 +- packages/vm/tests/api/runCode.spec.ts | 2 +- packages/vm/tests/api/runTx.spec.ts | 64 +- packages/vm/tests/api/state/vmState.spec.ts | 486 ++++ packages/vm/tests/api/utils.ts | 8 +- .../tester/runners/BlockchainTestsRunner.ts | 2 +- .../tester/runners/GeneralStateTestsRunner.ts | 2 +- packages/vm/tests/util.ts | 4 +- packages/vm/tsconfig.prod.json | 1 + 82 files changed, 3222 insertions(+), 1983 deletions(-) create mode 100644 .github/workflows/statemanager-build.yml create mode 100644 packages/statemanager/.eslintrc.js create mode 100644 packages/statemanager/.gitignore create mode 100644 packages/statemanager/.nycrc create mode 100644 packages/statemanager/.prettierignore create mode 100644 packages/statemanager/CHANGELOG.md create mode 100644 packages/statemanager/DEVELOPER.md create mode 100644 packages/statemanager/LICENSE create mode 100644 packages/statemanager/README.md create mode 100644 packages/statemanager/docs/README.md rename packages/{vm/docs/classes/state_statemanager.default.md => statemanager/docs/classes/index.default.md} (100%) rename packages/{vm/docs/modules/state.md => statemanager/docs/modules/index.md} (100%) rename packages/{vm => statemanager}/docs/modules/state_interface.md (100%) rename packages/{vm => statemanager}/docs/modules/state_statemanager.md (100%) create mode 100644 packages/statemanager/karma.conf.js create mode 100644 packages/statemanager/package.json create mode 100644 packages/statemanager/prettier.config.js create mode 100644 packages/statemanager/src/baseStateManager.ts rename packages/{vm/src/state => statemanager/src}/cache.ts (100%) create mode 100644 packages/statemanager/src/index.ts rename packages/{vm/src/state => statemanager/src}/interface.ts (64%) rename packages/{vm/src/state => statemanager/src}/stateManager.ts (98%) rename packages/{vm/tests/api/state => statemanager/tests}/cache.spec.ts (97%) rename packages/{vm/tests/api/state => statemanager/tests}/proofStateManager.spec.ts (99%) rename packages/{vm/tests/api/state => statemanager/tests}/stateManager.spec.ts (55%) rename packages/{vm/tests/api/state => statemanager/tests}/testdata/ropsten_contractWithStorage.json (100%) rename packages/{vm/tests/api/state => statemanager/tests}/testdata/ropsten_nonexistentAccount.json (100%) rename packages/{vm/tests/api/state => statemanager/tests}/testdata/ropsten_validAccount.json (100%) create mode 100644 packages/statemanager/tests/util.ts create mode 100644 packages/statemanager/tsconfig.browser.json create mode 100644 packages/statemanager/tsconfig.json create mode 100644 packages/statemanager/tsconfig.prod.json create mode 100644 packages/statemanager/typedoc.js rename packages/vm/src/{state/baseStateManager.ts => vmState.ts} (80%) create mode 100644 packages/vm/tests/api/state/vmState.spec.ts diff --git a/.github/workflows/node-versions.yml b/.github/workflows/node-versions.yml index ff5673bf57c..f095d98f283 100644 --- a/.github/workflows/node-versions.yml +++ b/.github/workflows/node-versions.yml @@ -89,6 +89,10 @@ jobs: run: npm run test working-directory: packages/util + - name: Test StateManager + run: npm run test + working-directory: packages/statemanager + - name: Test VM run: npm run test:API working-directory: packages/vm diff --git a/.github/workflows/statemanager-build.yml b/.github/workflows/statemanager-build.yml new file mode 100644 index 00000000000..2f17543a027 --- /dev/null +++ b/.github/workflows/statemanager-build.yml @@ -0,0 +1,47 @@ +name: StateManager +on: + push: + branches: [master, develop] + tags: ['*'] + pull_request: + types: [opened, reopened, synchronize] + +env: + cwd: ${{github.workspace}}/packages/statemanager + +defaults: + run: + working-directory: packages/statemanager + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test-statemanager: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16] + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - run: npm i + working-directory: ${{github.workspace}} + + - run: npm run lint + - run: npm run coverage + + - uses: codecov/codecov-action@v2 + with: + files: ${{ env.cwd }}/coverage/lcov.info + flags: statemanager + if: ${{ matrix.node-version == 16 }} diff --git a/README.md b/README.md index c4d70f4adaa..e88952c8dc1 100644 --- a/README.md +++ b/README.md @@ -11,19 +11,20 @@ This was originally the EthereumJS VM repository. In Q1 2020 we brought some of 🚧 Please note that the `master` branch is updated on a daily basis, and to inspect code related to a specific package version, refer to the [tags](https://github.com/ethereumjs/ethereumjs-monorepo/tags). -| package | npm | issues | tests | coverage | -| -------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| [@ethereumjs/block][block-package] | [![NPM Package][block-npm-badge]][block-npm-link] | [![Block Issues][block-issues-badge]][block-issues-link] | [![Actions Status][block-actions-badge]][block-actions-link] | [![Code Coverage][block-coverage-badge]][block-coverage-link] | -| [@ethereumjs/blockchain][blockchain-package] | [![NPM Package][blockchain-npm-badge]][blockchain-npm-link] | [![Blockchain Issues][blockchain-issues-badge]][blockchain-issues-link] | [![Actions Status][blockchain-actions-badge]][blockchain-actions-link] | [![Code Coverage][blockchain-coverage-badge]][blockchain-coverage-link] | -| [@ethereumjs/client][client-package] | [![NPM Package][client-npm-badge]][client-npm-link] | [![Client Issues][client-issues-badge]][client-issues-link] | [![Actions Status][client-actions-badge]][client-actions-link] | [![Code Coverage][client-coverage-badge]][client-coverage-link] | -| [@ethereumjs/common][common-package] | [![NPM Package][common-npm-badge]][common-npm-link] | [![Common Issues][common-issues-badge]][common-issues-link] | [![Actions Status][common-actions-badge]][common-actions-link] | [![Code Coverage][common-coverage-badge]][common-coverage-link] | -| [@ethereumjs/devp2p][devp2p-package] | [![NPM Package][devp2p-npm-badge]][devp2p-npm-link] | [![Devp2p Issues][devp2p-issues-badge]][devp2p-issues-link] | [![Actions Status][devp2p-actions-badge]][devp2p-actions-link] | [![Code Coverage][devp2p-coverage-badge]][devp2p-coverage-link] | -| [@ethereumjs/ethash][ethash-package] | [![NPM Package][ethash-npm-badge]][ethash-npm-link] | [![Ethash Issues][ethash-issues-badge]][ethash-issues-link] | [![Actions Status][ethash-actions-badge]][ethash-actions-link] | [![Code Coverage][ethash-coverage-badge]][ethash-coverage-link] | -| [merkle-patricia-tree][trie-package] | [![NPM Package][trie-npm-badge]][trie-npm-link] | [![Trie Issues][trie-issues-badge]][trie-issues-link] | [![Actions Status][trie-actions-badge]][trie-actions-link] | [![Code Coverage][trie-coverage-badge]][trie-coverage-link] | -| [rlp][rlp-package] | [![NPM Package][rlp-npm-badge]][rlp-npm-link] | [![rlp Issues][rlp-issues-badge]][rlp-issues-link] | [![Actions Status][rlp-actions-badge]][rlp-actions-link] | [![Code Coverage][rlp-coverage-badge]][rlp-coverage-link] | -| [@ethereumjs/tx][tx-package] | [![NPM Package][tx-npm-badge]][tx-npm-link] | [![Tx Issues][tx-issues-badge]][tx-issues-link] | [![Actions Status][tx-actions-badge]][tx-actions-link] | [![Code Coverage][tx-coverage-badge]][tx-coverage-link] | -| [ethereumjs-util][util-package] | [![NPM Package][util-npm-badge]][util-npm-link] | [![Util Issues][util-issues-badge]][util-issues-link] | [![Actions Status][util-actions-badge]][util-actions-link] | [![Code Coverage][util-coverage-badge]][util-coverage-link] | -| [@ethereumjs/vm][vm-package] | [![NPM Package][vm-npm-badge]][vm-npm-link] | [![VM Issues][vm-issues-badge]][vm-issues-link] | [![Actions Status][vm-actions-badge]][vm-actions-link] | [![Code Coverage][vm-coverage-badge]][vm-coverage-link] | +| package | npm | issues | tests | coverage | +| ------------------------------------------------ | --------------------------------------------------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| [@ethereumjs/block][block-package] | [![NPM Package][block-npm-badge]][block-npm-link] | [![Block Issues][block-issues-badge]][block-issues-link] | [![Actions Status][block-actions-badge]][block-actions-link] | [![Code Coverage][block-coverage-badge]][block-coverage-link] | +| [@ethereumjs/blockchain][blockchain-package] | [![NPM Package][blockchain-npm-badge]][blockchain-npm-link] | [![Blockchain Issues][blockchain-issues-badge]][blockchain-issues-link] | [![Actions Status][blockchain-actions-badge]][blockchain-actions-link] | [![Code Coverage][blockchain-coverage-badge]][blockchain-coverage-link] | +| [@ethereumjs/client][client-package] | [![NPM Package][client-npm-badge]][client-npm-link] | [![Client Issues][client-issues-badge]][client-issues-link] | [![Actions Status][client-actions-badge]][client-actions-link] | [![Code Coverage][client-coverage-badge]][client-coverage-link] | +| [@ethereumjs/common][common-package] | [![NPM Package][common-npm-badge]][common-npm-link] | [![Common Issues][common-issues-badge]][common-issues-link] | [![Actions Status][common-actions-badge]][common-actions-link] | [![Code Coverage][common-coverage-badge]][common-coverage-link] | +| [@ethereumjs/devp2p][devp2p-package] | [![NPM Package][devp2p-npm-badge]][devp2p-npm-link] | [![Devp2p Issues][devp2p-issues-badge]][devp2p-issues-link] | [![Actions Status][devp2p-actions-badge]][devp2p-actions-link] | [![Code Coverage][devp2p-coverage-badge]][devp2p-coverage-link] | +| [@ethereumjs/ethash][ethash-package] | [![NPM Package][ethash-npm-badge]][ethash-npm-link] | [![Ethash Issues][ethash-issues-badge]][ethash-issues-link] | [![Actions Status][ethash-actions-badge]][ethash-actions-link] | [![Code Coverage][ethash-coverage-badge]][ethash-coverage-link] | +| [merkle-patricia-tree][trie-package] | [![NPM Package][trie-npm-badge]][trie-npm-link] | [![Trie Issues][trie-issues-badge]][trie-issues-link] | [![Actions Status][trie-actions-badge]][trie-actions-link] | [![Code Coverage][trie-coverage-badge]][trie-coverage-link] | +| [rlp][rlp-package] | [![NPM Package][rlp-npm-badge]][rlp-npm-link] | [![rlp Issues][rlp-issues-badge]][rlp-issues-link] | [![Actions Status][rlp-actions-badge]][rlp-actions-link] | [![Code Coverage][rlp-coverage-badge]][rlp-coverage-link] | +| [@ethereumjs/statemanager][statemanager-package] | [![NPM Package][statemanager-npm-badge]][statemanager-npm-link] | [![StateManager Issues][statemanager-issues-badge]][statemanager-issues-link] | [![Actions Status][statemanager-actions-badge]][statemanager-actions-link] | [![Code Coverage][statemanager-coverage-badge]][statemanager-coverage-link] | +| [@ethereumjs/tx][tx-package] | [![NPM Package][tx-npm-badge]][tx-npm-link] | [![Tx Issues][tx-issues-badge]][tx-issues-link] | [![Actions Status][tx-actions-badge]][tx-actions-link] | [![Code Coverage][tx-coverage-badge]][tx-coverage-link] | +| [ethereumjs-util][util-package] | [![NPM Package][util-npm-badge]][util-npm-link] | [![Util Issues][util-issues-badge]][util-issues-link] | [![Actions Status][util-actions-badge]][util-actions-link] | [![Code Coverage][util-coverage-badge]][util-coverage-link] | +| [@ethereumjs/vm][vm-package] | [![NPM Package][vm-npm-badge]][vm-npm-link] | [![VM Issues][vm-issues-badge]][vm-issues-link] | [![Actions Status][vm-actions-badge]][vm-actions-link] | [![Code Coverage][vm-coverage-badge]][vm-coverage-link] | ## Coverage report @@ -56,9 +57,12 @@ Detailed version can be seen on [Codecov.io][coverage-link] tx --> block tx --> vm vm --> client - ``` + statemanager --> vm + common --> statemanager + trie --> statemanager +``` - To update the diagram above edit the README file and open a new PR with the changes. +To update the diagram above edit the README file and open a new PR with the changes. ## Getting Started @@ -170,6 +174,15 @@ Most packages are [MPL-2.0](=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.17.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.5.tgz", - "integrity": "sha512-/BBMw4EvjmyquN5O+t5eh0+YqB3XXJkYD2cjKpYtWOfFy4lQ4UozNSmxAcWT8r2XtZs0ewG+zrfsqeR15i1ajA==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.9.tgz", + "integrity": "sha512-5ug+SfZCpDAkVp9SFIZAzlW18rlzsOcJGaetCjkySnrXXDUw9AR8cDUm1iByTmdWM6yxX6/zycaV76w3YTF2gw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-compilation-targets": "^7.16.7", - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helpers": "^7.17.2", - "@babel/parser": "^7.17.3", + "@babel/generator": "^7.17.9", + "@babel/helper-compilation-targets": "^7.17.7", + "@babel/helper-module-transforms": "^7.17.7", + "@babel/helpers": "^7.17.9", + "@babel/parser": "^7.17.9", "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", + "@babel/traverse": "^7.17.9", "@babel/types": "^7.17.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.1.2", + "json5": "^2.2.1", "semver": "^6.3.0" }, "engines": { @@ -93,9 +93,9 @@ } }, "node_modules/@babel/generator": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.3.tgz", - "integrity": "sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.9.tgz", + "integrity": "sha512-rAdDousTwxbIxbz5I7GEQ3lUip+xVCXooZNbsydCWs3xA7ZsYOv+CFRdzGxRX78BmQHu9B1Eso59AOZQOJDEdQ==", "dev": true, "dependencies": { "@babel/types": "^7.17.0", @@ -107,12 +107,12 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", - "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", + "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.16.4", + "@babel/compat-data": "^7.17.7", "@babel/helper-validator-option": "^7.16.7", "browserslist": "^4.17.5", "semver": "^6.3.0" @@ -137,26 +137,13 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", + "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", "dev": true, "dependencies": { - "@babel/helper-get-function-arity": "^7.16.7", "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" @@ -187,14 +174,14 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.17.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.6.tgz", - "integrity": "sha512-2ULmRdqoOMpdvkbT8jONrZML/XALfzxlb052bldftkicAUy8AxSCkD5trDPQcwHNmolcl7wP6ehNqMlyUw6AaA==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", + "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", "@babel/helper-split-export-declaration": "^7.16.7", "@babel/helper-validator-identifier": "^7.16.7", "@babel/template": "^7.16.7", @@ -215,12 +202,12 @@ } }, "node_modules/@babel/helper-simple-access": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", - "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", + "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" @@ -269,13 +256,13 @@ } }, "node_modules/@babel/helpers": { - "version": "7.17.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.2.tgz", - "integrity": "sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.9.tgz", + "integrity": "sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q==", "dev": true, "dependencies": { "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.0", + "@babel/traverse": "^7.17.9", "@babel/types": "^7.17.0" }, "engines": { @@ -283,9 +270,9 @@ } }, "node_modules/@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", + "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.16.7", @@ -359,9 +346,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.3.tgz", - "integrity": "sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", + "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -401,18 +388,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.9.tgz", + "integrity": "sha512-PQO8sDIJ8SIwipTPiR71kJQCKQYB5NGImbOviK8K+kg5xkNSYXLBupuX9QhatFowrsvo9Hj8WgArg3W7ijNAQw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", + "@babel/generator": "^7.17.9", "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", + "@babel/helper-function-name": "^7.17.9", "@babel/helper-hoist-variables": "^7.16.7", "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", + "@babel/parser": "^7.17.9", "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" @@ -435,9 +422,9 @@ } }, "node_modules/@chainsafe/libp2p-noise": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.1.1.tgz", - "integrity": "sha512-/Fz86sZmnvRSf7FHxMPifzakxx9xK4KVYx6yi35KPZughop9ivJslUSCLhx/UqDHiuj3h9i04pVXET6nIjSJyQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.1.2.tgz", + "integrity": "sha512-UvZLWvIS7bAz6M8XfsnC/NhT1c/lg8NNsME1hTvo21kRwyxNFpB8gEhId03Cb5B23oIaHhMySAHBcpuMiSxQ2w==", "dependencies": { "@stablelib/chacha20poly1305": "^1.0.1", "@stablelib/hkdf": "^1.0.1", @@ -540,9 +527,9 @@ } }, "node_modules/@discoveryjs/json-ext": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", - "integrity": "sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true, "engines": { "node": ">=10.0.0" @@ -572,6 +559,10 @@ "resolved": "packages/ethash", "link": true }, + "node_modules/@ethereumjs/statemanager": { + "resolved": "packages/statemanager", + "link": true + }, "node_modules/@ethereumjs/tx": { "resolved": "packages/tx", "link": true @@ -581,9 +572,9 @@ "link": true }, "node_modules/@ethersproject/abi": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz", - "integrity": "sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.0.tgz", + "integrity": "sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg==", "dev": true, "funding": [ { @@ -596,21 +587,21 @@ } ], "dependencies": { - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/hash": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "node_modules/@ethersproject/abstract-provider": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz", - "integrity": "sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz", + "integrity": "sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw==", "dev": true, "funding": [ { @@ -623,19 +614,19 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/networks": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", - "@ethersproject/web": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/web": "^5.6.0" } }, "node_modules/@ethersproject/abstract-signer": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz", - "integrity": "sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz", + "integrity": "sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ==", "dev": true, "funding": [ { @@ -648,17 +639,17 @@ } ], "dependencies": { - "@ethersproject/abstract-provider": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0" + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0" } }, "node_modules/@ethersproject/address": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.5.0.tgz", - "integrity": "sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.0.tgz", + "integrity": "sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ==", "dev": true, "funding": [ { @@ -671,17 +662,17 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/rlp": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/rlp": "^5.6.0" } }, "node_modules/@ethersproject/base64": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.5.0.tgz", - "integrity": "sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.0.tgz", + "integrity": "sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw==", "dev": true, "funding": [ { @@ -694,13 +685,13 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0" + "@ethersproject/bytes": "^5.6.0" } }, "node_modules/@ethersproject/bignumber": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", - "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.0.tgz", + "integrity": "sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA==", "dev": true, "funding": [ { @@ -713,21 +704,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", "bn.js": "^4.11.9" } }, - "node_modules/@ethersproject/bignumber/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, "node_modules/@ethersproject/bytes": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", - "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", + "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", "dev": true, "funding": [ { @@ -740,13 +725,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/constants": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", - "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.0.tgz", + "integrity": "sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA==", "dev": true, "funding": [ { @@ -759,13 +744,13 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0" } }, "node_modules/@ethersproject/hash": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.5.0.tgz", - "integrity": "sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.0.tgz", + "integrity": "sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA==", "dev": true, "funding": [ { @@ -778,20 +763,20 @@ } ], "dependencies": { - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "node_modules/@ethersproject/keccak256": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.5.0.tgz", - "integrity": "sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.0.tgz", + "integrity": "sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w==", "dev": true, "funding": [ { @@ -804,14 +789,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", "js-sha3": "0.8.0" } }, "node_modules/@ethersproject/logger": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", - "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", + "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", "dev": true, "funding": [ { @@ -825,9 +810,9 @@ ] }, "node_modules/@ethersproject/networks": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.5.2.tgz", - "integrity": "sha512-NEqPxbGBfy6O3x4ZTISb90SjEDkWYDUbEeIFhJly0F7sZjoQMnj5KYzMSkMkLKZ+1fGpx00EDpHQCy6PrDupkQ==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.1.tgz", + "integrity": "sha512-b2rrupf3kCTcc3jr9xOWBuHylSFtbpJf79Ga7QR98ienU2UqGimPGEsYMgbI29KHJfA5Us89XwGVmxrlxmSrMg==", "dev": true, "funding": [ { @@ -840,13 +825,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/properties": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", - "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", + "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", "dev": true, "funding": [ { @@ -859,13 +844,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/rlp": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.5.0.tgz", - "integrity": "sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.0.tgz", + "integrity": "sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g==", "dev": true, "funding": [ { @@ -878,14 +863,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/signing-key": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.5.0.tgz", - "integrity": "sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.0.tgz", + "integrity": "sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA==", "dev": true, "funding": [ { @@ -898,24 +883,18 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", "bn.js": "^4.11.9", "elliptic": "6.5.4", "hash.js": "1.1.7" } }, - "node_modules/@ethersproject/signing-key/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, "node_modules/@ethersproject/strings": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", - "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.0.tgz", + "integrity": "sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg==", "dev": true, "funding": [ { @@ -928,15 +907,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/transactions": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.5.0.tgz", - "integrity": "sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.0.tgz", + "integrity": "sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg==", "dev": true, "funding": [ { @@ -949,21 +928,21 @@ } ], "dependencies": { - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/rlp": "^5.5.0", - "@ethersproject/signing-key": "^5.5.0" + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/rlp": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0" } }, "node_modules/@ethersproject/web": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.1.tgz", - "integrity": "sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.0.tgz", + "integrity": "sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg==", "dev": true, "funding": [ { @@ -976,11 +955,11 @@ } ], "dependencies": { - "@ethersproject/base64": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/base64": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "node_modules/@istanbuljs/load-nyc-config": { @@ -1572,9 +1551,9 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "node_modules/@types/jwt-simple": { @@ -1616,9 +1595,9 @@ } }, "node_modules/@types/lodash": { - "version": "4.14.179", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.179.tgz", - "integrity": "sha512-uwc1x90yCKqGcIOAT6DwOSuxnrAbpkdPsUOZtwrXb4D/6wZs+6qG7QnIawDuZWg0sWpxl+ltIKCaLoMlna678w==" + "version": "4.14.181", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.181.tgz", + "integrity": "sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag==" }, "node_modules/@types/long": { "version": "4.0.1", @@ -1702,9 +1681,9 @@ } }, "node_modules/@types/supertest": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.11.tgz", - "integrity": "sha512-uci4Esokrw9qGb9bvhhSVEjd6rkny/dk5PK/Qz4yxKiyppEI+dOPlNrZBahE3i+PoKFYyDxChVXZ/ysS/nrm1Q==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.12.tgz", + "integrity": "sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==", "dev": true, "dependencies": { "@types/superagent": "*" @@ -1772,9 +1751,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1913,9 +1892,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1967,6 +1946,15 @@ "url": "https://opencollective.com/verdaccio" } }, + "node_modules/@verdaccio/commons-api/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/@verdaccio/commons-api/node_modules/http-errors": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", @@ -2084,6 +2072,18 @@ "typedarray-to-buffer": "~3.1.5" } }, + "node_modules/@verdaccio/local-storage/node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, "node_modules/@verdaccio/readme": { "version": "9.7.5", "resolved": "https://registry.npmjs.org/@verdaccio/readme/-/readme-9.7.5.tgz", @@ -2582,9 +2582,9 @@ } }, "node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true, "engines": { "node": ">=6" @@ -2800,14 +2800,15 @@ } }, "node_modules/array.prototype.find": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.1.2.tgz", - "integrity": "sha512-00S1O4ewO95OmmJW7EesWfQlrCrLEL8kZ40w3+GkLX2yTt0m2ggcePPa2uHPJ9KUmJvwRq+lCV9bD8Yim23x/Q==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.2.0.tgz", + "integrity": "sha512-sn40qmUiLYAcRb/1HsIQjTTZ1kCy8II8VtZJpMn2Aoen9twULhbWXisfh3HimGqMlHGUul0/TfKCnXg42LuPpQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "es-abstract": "^1.19.4", + "es-shim-unscopables": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2838,11 +2839,6 @@ "safer-buffer": "^2.1.0" } }, - "node_modules/asn1.js/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, "node_modules/assert": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", @@ -3214,33 +3210,36 @@ } }, "node_modules/blakejs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", - "integrity": "sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" }, "node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, "node_modules/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", + "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" + "on-finished": "2.4.1", + "qs": "6.10.3", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" }, "engines": { - "node": ">= 0.8" + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" } }, "node_modules/body-parser/node_modules/debug": { @@ -3429,6 +3428,12 @@ "randombytes": "^2.0.1" } }, + "node_modules/browserify-rsa/node_modules/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "dev": true + }, "node_modules/browserify-sign": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", @@ -3446,6 +3451,12 @@ "safe-buffer": "^5.2.0" } }, + "node_modules/browserify-sign/node_modules/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "dev": true + }, "node_modules/browserify-zlib": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", @@ -3502,13 +3513,23 @@ } }, "node_modules/browserslist": { - "version": "4.19.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.3.tgz", - "integrity": "sha512-XK3X4xtKJ+Txj8G5c30B4gsm71s69lqXlkYui4s6EkKxuv49qjYlY6oVd+IFJ73d4YymtM3+djvvt/R/iJwwDg==", + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", + "integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], "dependencies": { - "caniuse-lite": "^1.0.30001312", - "electron-to-chromium": "^1.4.71", + "caniuse-lite": "^1.0.30001317", + "electron-to-chromium": "^1.4.84", "escalade": "^3.1.1", "node-releases": "^2.0.2", "picocolors": "^1.0.0" @@ -3518,10 +3539,6 @@ }, "engines": { "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" } }, "node_modules/buffer": { @@ -3693,14 +3710,20 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001313", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001313.tgz", - "integrity": "sha512-rI1UN0koZUiKINjysQDuRi2VeSCce3bYJNmDcj3PIKREiAmjakugBul1QSkg/fPrlULYl6oWfGg3PbgOSY9X4Q==", + "version": "1.0.30001328", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001328.tgz", + "integrity": "sha512-Ue55jHkR/s4r00FLNiX+hGMMuwml/QGqqzVeMQ5thUewznU2EdULFvI3JR7JJid6OrjJNfFvHY2G2dIjmRaDDQ==", "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - } + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] }, "node_modules/caseless": { "version": "0.12.0", @@ -4320,15 +4343,6 @@ "node": ">= 0.8" } }, - "node_modules/cookies/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/core-js": { "version": "2.6.12", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", @@ -4381,13 +4395,9 @@ } }, "node_modules/crc-32": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.1.tgz", - "integrity": "sha512-Dn/xm/1vFFgs3nfrpEVScHoIslO9NZRITWGz/1E/St6u4xw99vfZzVkW0OSnzx2h9egej9xwMCEut6sqwokM/w==", - "dependencies": { - "exit-on-epipe": "~1.0.1", - "printj": "~1.3.1" - }, + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", "bin": { "crc32": "bin/crc32.njs" }, @@ -4405,12 +4415,6 @@ "elliptic": "^6.5.3" } }, - "node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, "node_modules/create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -4764,9 +4768,9 @@ } }, "node_modules/date-format": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.4.tgz", - "integrity": "sha512-/jyf4rhB17ge328HJuJjAcmRtCsGd+NDeAtahRBTaK6vSPR6MO5HlrAit3Nn7dVjaa6sowW0WXt8yQtLyZQFRg==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.6.tgz", + "integrity": "sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw==", "dev": true, "engines": { "node": ">=4.0" @@ -4794,9 +4798,9 @@ "dev": true }, "node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { "ms": "2.1.2" }, @@ -4967,11 +4971,11 @@ } }, "node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "engines": { - "node": ">= 0.6" + "node": ">= 0.8" } }, "node_modules/deps-sort": { @@ -5000,10 +5004,13 @@ } }, "node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } }, "node_modules/detect-node": { "version": "2.1.0", @@ -5062,12 +5069,6 @@ "randombytes": "^2.0.0" } }, - "node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -5306,9 +5307,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.76", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.76.tgz", - "integrity": "sha512-3Vftv7cenJtQb+k00McEBZ2vVmZ/x+HEF7pcZONZIkOsESqAqVuACmBxMv0JhzX7u0YltU0vSqRqgBSTAhFUjA==", + "version": "1.4.107", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.107.tgz", + "integrity": "sha512-Huen6taaVrUrSy8o7mGStByba8PfOWWluHNxSHGBrCgEdFVLtvdQDBr9LBCF9Uci8SYxh28QNNMO0oC17wbGAg==", "dev": true }, "node_modules/elliptic": { @@ -5325,11 +5326,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -5516,9 +5512,9 @@ } }, "node_modules/es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", + "version": "1.19.4", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.4.tgz", + "integrity": "sha512-flV8e5g9/xulChMG48Fygk1ptpo4lQRJ0eJYtxJFgi7pklLx7EFcOJ34jnvr8pbWlaFN/AT1cZpe0hiFel9Hqg==", "dependencies": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", @@ -5526,15 +5522,15 @@ "get-intrinsic": "^1.1.1", "get-symbol-description": "^1.0.0", "has": "^1.0.3", - "has-symbols": "^1.0.2", + "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", + "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", + "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", @@ -5573,6 +5569,15 @@ "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", "dev": true }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + } + }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -5590,14 +5595,18 @@ } }, "node_modules/es5-ext": { - "version": "0.10.53", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "version": "0.10.60", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.60.tgz", + "integrity": "sha512-jpKNXIt60htYG59/9FGf2PYT3pwMpnEbNKysU+k/4FGwyGtMotOvcZOuW+EmXXYASRqYSXQfGL5cVIthOTgbkg==", "dev": true, + "hasInstallScript": true, "dependencies": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" + }, + "engines": { + "node": ">=0.10" } }, "node_modules/es6-error": { @@ -6491,14 +6500,6 @@ "node": ">=0.10.0" } }, - "node_modules/exit-on-epipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz", - "integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==", - "engines": { - "node": ">=0.8" - } - }, "node_modules/express": { "version": "4.17.1", "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", @@ -6588,6 +6589,15 @@ "ms": "2.0.0" } }, + "node_modules/express/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/express/node_modules/http-errors": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", @@ -6616,6 +6626,18 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "node_modules/express/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/express/node_modules/qs": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", @@ -6791,9 +6813,9 @@ } }, "node_modules/fecha": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", - "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==" + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.2.tgz", + "integrity": "sha512-5rOQWkBVz3FnYWTi/ELZmq4CoK1Pb+xKNZWuJRsOwo0+8DrP43CrWJtyLVvb5U7z7ggE5llahfDbLjaVNzXVJQ==" }, "node_modules/figures": { "version": "3.2.0", @@ -6887,6 +6909,17 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "node_modules/finalhandler/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/find-cache-dir": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", @@ -7434,9 +7467,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "node_modules/handlebars": { "version": "4.7.7", @@ -7694,18 +7727,26 @@ } }, "node_modules/http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dependencies": { - "depd": "~1.1.2", + "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", + "statuses": "2.0.1", "toidentifier": "1.0.1" }, "engines": { - "node": ">= 0.6" + "node": ">= 0.8" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" } }, "node_modules/http-proxy": { @@ -8398,9 +8439,9 @@ } }, "node_modules/is-number-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", - "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -8477,9 +8518,12 @@ } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", - "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dependencies": { + "call-bind": "^1.0.2" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -8607,9 +8651,9 @@ "dev": true }, "node_modules/isbinaryfile": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.8.tgz", - "integrity": "sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", + "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", "dev": true, "engines": { "node": ">= 8.0.0" @@ -9327,9 +9371,9 @@ } }, "node_modules/jayson/node_modules/@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==" + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==" }, "node_modules/jayson/node_modules/commander": { "version": "2.20.3", @@ -9555,13 +9599,10 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "node_modules/json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, "bin": { "json5": "lib/cli.js" }, @@ -9825,9 +9866,9 @@ } }, "node_modules/karma-chrome-launcher": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz", - "integrity": "sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.1.tgz", + "integrity": "sha512-hsIglcq1vtboGPAN+DGCISCFOxW+ZVnIqhDQcCMqqCp+4dmJ0Qpq5QAjkbA0X2L9Mi6OBkHi2Srrbmm7pUKkzQ==", "dev": true, "dependencies": { "which": "^1.2.1" @@ -10549,9 +10590,9 @@ } }, "node_modules/libp2p-bootstrap/node_modules/node-forge": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.2.1.tgz", - "integrity": "sha512-Fcvtbb+zBcZXbTTVwqGA5W+MKBj56UjVRevvchv5XrcyXbmNdesfZL37nlcWOfpgHhgmxApw3tQbTr4CqNmX4w==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", "engines": { "node": ">= 6.13.0" } @@ -11521,9 +11562,9 @@ } }, "node_modules/loader-runner": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", - "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", "dev": true, "engines": { "node": ">=6.11.5" @@ -11666,16 +11707,16 @@ "dev": true }, "node_modules/log4js": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.2.tgz", - "integrity": "sha512-k80cggS2sZQLBwllpT1p06GtfvzMmSdUCkW96f0Hj83rKGJDAu2vZjt9B9ag2vx8Zz1IXzxoLgqvRJCdMKybGg==", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.4.tgz", + "integrity": "sha512-ncaWPsuw9Vl1CKA406hVnJLGQKy1OHx6buk8J4rE2lVW+NW5Y82G5/DIloO7NkqLOUtNPEANaWC1kZYVjXssPw==", "dev": true, "dependencies": { - "date-format": "^4.0.4", - "debug": "^4.3.3", + "date-format": "^4.0.6", + "debug": "^4.3.4", "flatted": "^3.2.5", "rfdc": "^1.3.0", - "streamroller": "^3.0.4" + "streamroller": "^3.0.6" }, "engines": { "node": ">=8.0" @@ -11836,9 +11877,9 @@ "dev": true }, "node_modules/marked": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.12.tgz", - "integrity": "sha512-hgibXWrEDNBWgGiK18j/4lkS6ihTe9sxtV4Q1OQppb/0zzyPSzoFANBa5MfsG/zgsWklmNnhm0XACZOH/0HBiQ==", + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.14.tgz", + "integrity": "sha512-HL5sSPE/LP6U9qKgngIIPTthuxC0jrfxpYMZ3LdGDD3vTnLs59m2Z7r6+LNDR3ToqEQdkKd6YaaEfJhodJmijQ==", "dev": true, "bin": { "marked": "bin/marked.js" @@ -11958,13 +11999,13 @@ } }, "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.2", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" @@ -11983,12 +12024,6 @@ "miller-rabin": "bin/miller-rabin" } }, - "node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, "node_modules/mime": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", @@ -12002,19 +12037,19 @@ } }, "node_modules/mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dependencies": { - "mime-db": "1.51.0" + "mime-db": "1.52.0" }, "engines": { "node": ">= 0.6" @@ -12050,17 +12085,17 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, "dependencies": { - "minimist": "^1.2.5" + "minimist": "^1.2.6" }, "bin": { "mkdirp": "bin/cmd.js" @@ -12138,9 +12173,9 @@ } }, "node_modules/moment": { - "version": "2.29.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", - "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==", + "version": "2.29.2", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.2.tgz", + "integrity": "sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg==", "engines": { "node": "*" } @@ -12597,9 +12632,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz", + "integrity": "sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -12667,9 +12702,9 @@ } }, "node_modules/next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, "node_modules/nice-try": { @@ -12769,9 +12804,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", - "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -12791,9 +12826,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz", - "integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.3.tgz", + "integrity": "sha512-maHFz6OLqYxz+VQyCAtA3PTX4UP/53pa05fyDNc9CwjvJ0yEh6+xBwKsgCxMNhS8taUKBFYxfuiaD9U/55iFaw==", "dev": true }, "node_modules/normalize-html-whitespace": { @@ -13110,9 +13145,9 @@ } }, "node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { "ee-first": "1.1.1" }, @@ -14156,15 +14191,18 @@ } }, "node_modules/prettier": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", - "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", "dev": true, "bin": { "prettier": "bin-prettier.js" }, "engines": { "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/prettier-linter-helpers": { @@ -14244,17 +14282,6 @@ "xtend": ">=4.0.0 <4.1.0-0" } }, - "node_modules/printj": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/printj/-/printj-1.3.1.tgz", - "integrity": "sha512-GA3TdL8szPK4AQ2YnOe/b+Y1jUFwmmGMMK/qbY7VcE3Z7FU8JstbKiKRzO6CIiAKPhTO8m01NoQ0V5f3jc4OGg==", - "bin": { - "printj": "bin/printj.njs" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/private-ip": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/private-ip/-/private-ip-2.3.3.tgz", @@ -14405,12 +14432,6 @@ "safe-buffer": "^5.1.2" } }, - "node_modules/public-encrypt/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, "node_modules/pull-pair": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pull-pair/-/pull-pair-1.1.0.tgz", @@ -14472,9 +14493,12 @@ } }, "node_modules/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "dependencies": { + "side-channel": "^1.0.4" + }, "engines": { "node": ">=0.6" }, @@ -14575,12 +14599,12 @@ } }, "node_modules/raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "dependencies": { "bytes": "3.1.2", - "http-errors": "1.8.1", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" }, @@ -15258,6 +15282,21 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "node_modules/send/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/send/node_modules/destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, "node_modules/send/node_modules/http-errors": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", @@ -15292,6 +15331,18 @@ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, + "node_modules/send/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/send/node_modules/setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", @@ -15721,9 +15772,9 @@ } }, "node_modules/solc": { - "version": "0.8.12", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.12.tgz", - "integrity": "sha512-TU3anAhKWBQ/WrerJ9EcHrNwGOA1y5vIk5Flz7dBNamLDkX9VQTIwcKd3FiZsT0Ew8rSU7RTmJyGNHRGzP5TBA==", + "version": "0.8.13", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.13.tgz", + "integrity": "sha512-C0yTN+rjEOGO6uVOXI8+EKa75SFMuZpQ2tryex4QxWIg0HRWZvCHKfVPuLZ5wx06Sb6GBp6uQA5yqQyXZnXOJw==", "dev": true, "dependencies": { "command-exists": "^1.2.8", @@ -16476,9 +16527,9 @@ } }, "node_modules/standard/node_modules/table/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true, "engines": { "node": ">=4" @@ -16684,13 +16735,13 @@ } }, "node_modules/streamroller": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.4.tgz", - "integrity": "sha512-GI9NzeD+D88UFuIlJkKNDH/IsuR+qIN7Qh8EsmhoRZr9bQoehTraRgwtLUkZbpcAw+hLPfHOypmppz8YyGK68w==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.6.tgz", + "integrity": "sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg==", "dev": true, "dependencies": { - "date-format": "^4.0.4", - "debug": "^4.3.3", + "date-format": "^4.0.6", + "debug": "^4.3.4", "fs-extra": "^10.0.1" }, "engines": { @@ -16851,9 +16902,10 @@ } }, "node_modules/superagent": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.1.1.tgz", - "integrity": "sha512-CQ2weSS6M+doIwwYFoMatklhRbx6sVNdB99OEJ5czcP3cng76Ljqus694knFWgOj3RkrtxZqIgpe6vhe0J7QWQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.1.2.tgz", + "integrity": "sha512-o9/fP6dww7a4xmEF5a484o2rG34UUGo8ztDlv7vbCWuqPhpndMi0f7eXxdlryk5U12Kzy46nh8eNpLAJ93Alsg==", + "deprecated": "Deprecated due to bug in CI build https://github.com/visionmedia/superagent/pull/1677\\#issuecomment-1081361876", "dev": true, "dependencies": { "component-emitter": "^1.3.0", @@ -16898,25 +16950,10 @@ "node": ">=10" } }, - "node_modules/superagent/node_modules/qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/superagent/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -17064,9 +17101,9 @@ } }, "node_modules/tape": { - "version": "4.15.0", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.15.0.tgz", - "integrity": "sha512-SfRmG2I8QGGgJE/MCiLH8c11L5XxyUXxwK9xLRD0uiK5fehRkkSZGmR6Y1pxOt8vJ19m3sY+POTQpiaVv45/LQ==", + "version": "4.15.1", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.15.1.tgz", + "integrity": "sha512-k7F5pyr91n9D/yjSJwbLLYDCrTWXxMSXbbmHX2n334lSIc2rxeXyFkaBv4UuUd2gBYMrAOalPutAiCxC6q1qbw==", "dev": true, "dependencies": { "call-bind": "~1.0.2", @@ -17078,7 +17115,7 @@ "has": "~1.0.3", "inherits": "~2.0.4", "is-regex": "~1.1.4", - "minimist": "~1.2.5", + "minimist": "~1.2.6", "object-inspect": "~1.12.0", "resolve": "~1.22.0", "resumer": "~0.0.0", @@ -17090,9 +17127,9 @@ } }, "node_modules/terser": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.0.tgz", - "integrity": "sha512-R3AUhNBGWiFc77HXag+1fXpAxTAFRQTJemlJKjAgD9r8xXTpjNKqIXwHM/o7Rh+O0kUJtS3WQVdBeMKFk5sw9A==", + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", + "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", "dev": true, "dependencies": { "acorn": "^8.5.0", @@ -17443,9 +17480,9 @@ } }, "node_modules/ts-node": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.6.0.tgz", - "integrity": "sha512-CJen6+dfOXolxudBQXnVjRVvYTmTWbyz7cn+xq2XTsvnaXbHqr4gXSCNbS2Jj8yTZMuGwUoBESLaOkLascVVvg==", + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", + "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "0.7.0", @@ -17465,6 +17502,7 @@ "bin": { "ts-node": "dist/bin.js", "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" @@ -17629,16 +17667,16 @@ } }, "node_modules/typedoc": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.12.tgz", - "integrity": "sha512-FcyC+YuaOpr3rB9QwA1IHOi9KnU2m50sPJW5vcNRPCIdecp+3bFkh7Rq5hBU1Fyn29UR2h4h/H7twZHWDhL0sw==", + "version": "0.22.15", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.15.tgz", + "integrity": "sha512-CMd1lrqQbFvbx6S9G6fL4HKp3GoIuhujJReWqlIvSb2T26vGai+8Os3Mde7Pn832pXYemd9BMuuYWhFpL5st0Q==", "dev": true, "dependencies": { "glob": "^7.2.0", "lunr": "^2.3.9", - "marked": "^4.0.10", - "minimatch": "^3.0.4", - "shiki": "^0.10.0" + "marked": "^4.0.12", + "minimatch": "^5.0.1", + "shiki": "^0.10.1" }, "bin": { "typedoc": "bin/typedoc" @@ -17647,13 +17685,13 @@ "node": ">= 12.10.0" }, "peerDependencies": { - "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x" + "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x || 4.6.x" } }, "node_modules/typedoc-plugin-markdown": { - "version": "3.11.14", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.11.14.tgz", - "integrity": "sha512-lh47OQvl0079nB18YL9wuTRRhMpjo300SZKfx/xpQY8qG+GINeSxTod95QBELeI0NP81sNtUbemRDrn5nyef4Q==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.12.0.tgz", + "integrity": "sha512-yKl7/KWD8nP6Ot6OzMLLc8wBzN3CmkBoI/YQzxT62a9xmDgxyeTxGbHbkUoSzhKFqMI3SR0AqV6prAhVKbYnxw==", "dev": true, "dependencies": { "handlebars": "^4.7.7" @@ -17662,10 +17700,31 @@ "typedoc": ">=0.22.0" } }, + "node_modules/typedoc/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/typedoc/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/typescript": { - "version": "4.5.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", - "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", + "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -17695,9 +17754,9 @@ } }, "node_modules/uglify-js": { - "version": "3.15.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.2.tgz", - "integrity": "sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==", + "version": "3.15.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.4.tgz", + "integrity": "sha512-vMOPGDuvXecPs34V74qDKk4iJ/SN4vL3Ow/23ixafENYvtrNvtbcgUeugTcUGRGsOF/5fU8/NYSL5Hyb3l1OJA==", "dev": true, "optional": true, "bin": { @@ -17923,10 +17982,9 @@ } }, "node_modules/verdaccio": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/verdaccio/-/verdaccio-4.12.2.tgz", - "integrity": "sha512-ZIvakoKZuJNQ1PFbrx7qTcTLSgSS1GfdTbNZhFPBORxUZjAdTPDS1WmuIS2CvWwrEK/UxikbQIyD9nMsAL2NkQ==", - "deprecated": "upgrade to v5.x, security support for 4.x has expired", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/verdaccio/-/verdaccio-4.13.0.tgz", + "integrity": "sha512-kipaE7VeHNKelrbHlO1I7yjh2V97qn9Fg6r3tMyDveTXHwKUcAjynmWOFqKx/a566xJYClKc4t4z6UCVVs3gAQ==", "dev": true, "dependencies": { "@verdaccio/commons-api": "9.7.1", @@ -18012,6 +18070,15 @@ "url": "https://opencollective.com/verdaccio" } }, + "node_modules/verdaccio-htpasswd/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/verdaccio-htpasswd/node_modules/http-errors": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", @@ -18116,6 +18183,15 @@ "ms": "2.0.0" } }, + "node_modules/verdaccio/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/verdaccio/node_modules/http-errors": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", @@ -18180,12 +18256,36 @@ "node": "*" } }, + "node_modules/verdaccio/node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, "node_modules/verdaccio/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "node_modules/verdaccio/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/verdaccio/node_modules/qs": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", @@ -18451,9 +18551,9 @@ "dev": true }, "node_modules/webpack": { - "version": "5.70.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.70.0.tgz", - "integrity": "sha512-ZMWWy8CeuTTjCxbeaQI21xSswseF2oNOwc70QSKNePvmxE7XW36i7vpBMYZFAUHPwQiEbNGCEYIOOlyRbdGmxw==", + "version": "5.72.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.72.0.tgz", + "integrity": "sha512-qmSmbspI0Qo5ld49htys8GY9XhS9CGqFoHTsOVAnjBdg0Zn79y135R+k4IR4rKK6+eKaabMhJwiVB7xw0SJu5w==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -18731,9 +18831,9 @@ "dev": true }, "node_modules/winston": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.6.0.tgz", - "integrity": "sha512-9j8T75p+bcN6D00sF/zjFVmPp+t8KMPB1MzbbzYjeN9VWxdsYnTB40TkbNUEXAmILEfChMvAMgidlX64OG3p6w==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.7.2.tgz", + "integrity": "sha512-QziIqtojHBoyzUOdQvQiar1DH0Xp9nF1A1y7NVy2DGEsz82SBDtOalS0ulTRGVT14xPX3WRWkCsdcJKqNflKng==", "dependencies": { "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", @@ -18958,9 +19058,9 @@ } }, "node_modules/yargs": { - "version": "17.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "version": "17.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", + "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -19070,9 +19170,9 @@ } }, "packages/block/node_modules/tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "dependencies": { "array.prototype.every": "^1.1.3", @@ -19087,7 +19187,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19174,9 +19274,9 @@ } }, "packages/blockchain/node_modules/tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "dependencies": { "array.prototype.every": "^1.1.3", @@ -19191,7 +19291,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19217,6 +19317,7 @@ "@ethereumjs/common": "^2.6.3", "@ethereumjs/devp2p": "^4.2.1", "@ethereumjs/ethash": "^1.1.0", + "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", "@ethereumjs/vm": "^5.8.0", "body-parser": "^1.19.2", @@ -19332,9 +19433,9 @@ } }, "packages/client/node_modules/tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "dependencies": { "array.prototype.every": "^1.1.3", @@ -19349,7 +19450,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19428,9 +19529,9 @@ } }, "packages/common/node_modules/tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "dependencies": { "array.prototype.every": "^1.1.3", @@ -19445,7 +19546,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19613,9 +19714,9 @@ } }, "packages/devp2p/node_modules/tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "dependencies": { "array.prototype.every": "^1.1.3", @@ -19630,7 +19731,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19708,9 +19809,9 @@ } }, "packages/ethash/node_modules/tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "dependencies": { "array.prototype.every": "^1.1.3", @@ -19725,7 +19826,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19800,9 +19901,9 @@ } }, "packages/rlp/node_modules/tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "dependencies": { "array.prototype.every": "^1.1.3", @@ -19817,7 +19918,107 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", + "object-inspect": "^1.12.0", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "resolve": "^2.0.0-next.3", + "resumer": "^0.0.0", + "string.prototype.trim": "^1.2.5", + "through": "^2.3.8" + }, + "bin": { + "tape": "bin/tape" + } + }, + "packages/statemanager": { + "name": "@ethereumjs/statemanager", + "version": "1.0.0", + "license": "MPL-2.0", + "dependencies": { + "@ethereumjs/common": "^2.6.3", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.4", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^4.2.4" + }, + "devDependencies": { + "@types/node": "^16.11.7", + "@types/tape": "^4.13.2", + "eslint": "^6.8.0", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-tap": "^4.2.0", + "karma-typescript": "^5.5.3", + "nyc": "^15.1.0", + "prettier": "^2.0.5", + "standard": "^10.0.0", + "tape": "^5.3.1", + "ts-node": "^10.2.1", + "typedoc": "^0.22.4", + "typescript": "^4.4.2" + } + }, + "packages/statemanager/node_modules/deep-equal": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", + "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "es-get-iterator": "^1.1.1", + "get-intrinsic": "^1.0.1", + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.2", + "is-regex": "^1.1.1", + "isarray": "^2.0.5", + "object-is": "^1.1.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "regexp.prototype.flags": "^1.3.0", + "side-channel": "^1.0.3", + "which-boxed-primitive": "^1.0.1", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/statemanager/node_modules/resolve": { + "version": "2.0.0-next.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", + "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", + "dev": true, + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/statemanager/node_modules/tape": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "dev": true, + "dependencies": { + "array.prototype.every": "^1.1.3", + "call-bind": "^1.0.2", + "deep-equal": "^2.0.5", + "defined": "^1.0.0", + "dotignore": "^0.1.2", + "for-each": "^0.3.3", + "get-package-type": "^0.1.0", + "glob": "^7.2.0", + "has": "^1.0.3", + "has-dynamic-import": "^2.0.1", + "inherits": "^2.0.4", + "is-regex": "^1.1.4", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19903,9 +20104,9 @@ } }, "packages/trie/node_modules/tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "dependencies": { "array.prototype.every": "^1.1.3", @@ -19920,7 +20121,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -20002,9 +20203,9 @@ } }, "packages/tx/node_modules/tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "dependencies": { "array.prototype.every": "^1.1.3", @@ -20019,7 +20220,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -20062,6 +20263,11 @@ "node": ">=10.0.0" } }, + "packages/util/node_modules/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, "packages/util/node_modules/rlp": { "version": "2.2.7", "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", @@ -20081,6 +20287,7 @@ "@ethereumjs/block": "^3.6.2", "@ethereumjs/blockchain": "^5.5.2", "@ethereumjs/common": "^2.6.3", + "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", @@ -20161,9 +20368,9 @@ } }, "packages/vm/node_modules/tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "dependencies": { "array.prototype.every": "^1.1.3", @@ -20178,7 +20385,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -20213,38 +20420,38 @@ } }, "@babel/compat-data": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.0.tgz", - "integrity": "sha512-392byTlpGWXMv4FbyWw3sAZ/FrW/DrwqLGXpy0mbyNe9Taqv1mg9yON5/o0cnr8XYCkFTZbC1eV+c+LAROgrng==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", + "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==", "dev": true }, "@babel/core": { - "version": "7.17.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.5.tgz", - "integrity": "sha512-/BBMw4EvjmyquN5O+t5eh0+YqB3XXJkYD2cjKpYtWOfFy4lQ4UozNSmxAcWT8r2XtZs0ewG+zrfsqeR15i1ajA==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.9.tgz", + "integrity": "sha512-5ug+SfZCpDAkVp9SFIZAzlW18rlzsOcJGaetCjkySnrXXDUw9AR8cDUm1iByTmdWM6yxX6/zycaV76w3YTF2gw==", "dev": true, "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-compilation-targets": "^7.16.7", - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helpers": "^7.17.2", - "@babel/parser": "^7.17.3", + "@babel/generator": "^7.17.9", + "@babel/helper-compilation-targets": "^7.17.7", + "@babel/helper-module-transforms": "^7.17.7", + "@babel/helpers": "^7.17.9", + "@babel/parser": "^7.17.9", "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", + "@babel/traverse": "^7.17.9", "@babel/types": "^7.17.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.1.2", + "json5": "^2.2.1", "semver": "^6.3.0" } }, "@babel/generator": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.3.tgz", - "integrity": "sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.9.tgz", + "integrity": "sha512-rAdDousTwxbIxbz5I7GEQ3lUip+xVCXooZNbsydCWs3xA7ZsYOv+CFRdzGxRX78BmQHu9B1Eso59AOZQOJDEdQ==", "dev": true, "requires": { "@babel/types": "^7.17.0", @@ -20253,12 +20460,12 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", - "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", + "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", "dev": true, "requires": { - "@babel/compat-data": "^7.16.4", + "@babel/compat-data": "^7.17.7", "@babel/helper-validator-option": "^7.16.7", "browserslist": "^4.17.5", "semver": "^6.3.0" @@ -20274,23 +20481,13 @@ } }, "@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", + "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.16.7", "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", - "dev": true, - "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.17.0" } }, "@babel/helper-hoist-variables": { @@ -20312,14 +20509,14 @@ } }, "@babel/helper-module-transforms": { - "version": "7.17.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.6.tgz", - "integrity": "sha512-2ULmRdqoOMpdvkbT8jONrZML/XALfzxlb052bldftkicAUy8AxSCkD5trDPQcwHNmolcl7wP6ehNqMlyUw6AaA==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", + "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", "@babel/helper-split-export-declaration": "^7.16.7", "@babel/helper-validator-identifier": "^7.16.7", "@babel/template": "^7.16.7", @@ -20334,12 +20531,12 @@ "dev": true }, "@babel/helper-simple-access": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", - "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", + "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.17.0" } }, "@babel/helper-skip-transparent-expression-wrappers": { @@ -20373,20 +20570,20 @@ "dev": true }, "@babel/helpers": { - "version": "7.17.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.2.tgz", - "integrity": "sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.9.tgz", + "integrity": "sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q==", "dev": true, "requires": { "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.0", + "@babel/traverse": "^7.17.9", "@babel/types": "^7.17.0" } }, "@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", + "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.16.7", @@ -20447,9 +20644,9 @@ } }, "@babel/parser": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.3.tgz", - "integrity": "sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", + "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", "dev": true }, "@babel/plugin-transform-spread": { @@ -20474,18 +20671,18 @@ } }, "@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.9.tgz", + "integrity": "sha512-PQO8sDIJ8SIwipTPiR71kJQCKQYB5NGImbOviK8K+kg5xkNSYXLBupuX9QhatFowrsvo9Hj8WgArg3W7ijNAQw==", "dev": true, "requires": { "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", + "@babel/generator": "^7.17.9", "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", + "@babel/helper-function-name": "^7.17.9", "@babel/helper-hoist-variables": "^7.16.7", "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", + "@babel/parser": "^7.17.9", "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" @@ -20502,9 +20699,9 @@ } }, "@chainsafe/libp2p-noise": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.1.1.tgz", - "integrity": "sha512-/Fz86sZmnvRSf7FHxMPifzakxx9xK4KVYx6yi35KPZughop9ivJslUSCLhx/UqDHiuj3h9i04pVXET6nIjSJyQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.1.2.tgz", + "integrity": "sha512-UvZLWvIS7bAz6M8XfsnC/NhT1c/lg8NNsME1hTvo21kRwyxNFpB8gEhId03Cb5B23oIaHhMySAHBcpuMiSxQ2w==", "requires": { "@stablelib/chacha20poly1305": "^1.0.1", "@stablelib/hkdf": "^1.0.1", @@ -20593,9 +20790,9 @@ } }, "@discoveryjs/json-ext": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", - "integrity": "sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true }, "@ethereumjs/block": { @@ -20656,9 +20853,9 @@ } }, "tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -20673,7 +20870,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -20749,9 +20946,9 @@ } }, "tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -20766,7 +20963,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -20789,6 +20986,7 @@ "@ethereumjs/common": "^2.6.3", "@ethereumjs/devp2p": "^4.2.1", "@ethereumjs/ethash": "^1.1.0", + "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", "@ethereumjs/vm": "^5.8.0", "@types/body-parser": "^1.19.2", @@ -20889,9 +21087,9 @@ } }, "tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -20906,7 +21104,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -20974,9 +21172,9 @@ } }, "tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -20991,7 +21189,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -21133,9 +21331,9 @@ } }, "tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -21150,7 +21348,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -21217,9 +21415,9 @@ } }, "tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -21234,7 +21432,96 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", + "object-inspect": "^1.12.0", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "resolve": "^2.0.0-next.3", + "resumer": "^0.0.0", + "string.prototype.trim": "^1.2.5", + "through": "^2.3.8" + } + } + } + }, + "@ethereumjs/statemanager": { + "version": "file:packages/statemanager", + "requires": { + "@ethereumjs/common": "^2.6.3", + "@types/node": "^16.11.7", + "@types/tape": "^4.13.2", + "debug": "^4.3.3", + "eslint": "^6.8.0", + "ethereumjs-util": "^7.1.4", + "functional-red-black-tree": "^1.0.1", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-tap": "^4.2.0", + "karma-typescript": "^5.5.3", + "merkle-patricia-tree": "^4.2.4", + "nyc": "^15.1.0", + "prettier": "^2.0.5", + "standard": "^10.0.0", + "tape": "^5.3.1", + "ts-node": "^10.2.1", + "typedoc": "^0.22.4", + "typescript": "^4.4.2" + }, + "dependencies": { + "deep-equal": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", + "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "es-get-iterator": "^1.1.1", + "get-intrinsic": "^1.0.1", + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.2", + "is-regex": "^1.1.1", + "isarray": "^2.0.5", + "object-is": "^1.1.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "regexp.prototype.flags": "^1.3.0", + "side-channel": "^1.0.3", + "which-boxed-primitive": "^1.0.1", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.2" + } + }, + "resolve": { + "version": "2.0.0-next.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", + "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, + "tape": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "dev": true, + "requires": { + "array.prototype.every": "^1.1.3", + "call-bind": "^1.0.2", + "deep-equal": "^2.0.5", + "defined": "^1.0.0", + "dotignore": "^0.1.2", + "for-each": "^0.3.3", + "get-package-type": "^0.1.0", + "glob": "^7.2.0", + "has": "^1.0.3", + "has-dynamic-import": "^2.0.1", + "inherits": "^2.0.4", + "is-regex": "^1.1.4", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -21305,9 +21592,9 @@ } }, "tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -21322,7 +21609,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -21341,6 +21628,7 @@ "@ethereumjs/block": "^3.6.2", "@ethereumjs/blockchain": "^5.5.2", "@ethereumjs/common": "^2.6.3", + "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", "@ethersproject/abi": "^5.0.12", "@types/benchmark": "^1.0.33", @@ -21413,9 +21701,9 @@ } }, "tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -21430,7 +21718,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -21444,230 +21732,214 @@ } }, "@ethersproject/abi": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz", - "integrity": "sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.0.tgz", + "integrity": "sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg==", "dev": true, "requires": { - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/hash": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "@ethersproject/abstract-provider": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz", - "integrity": "sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz", + "integrity": "sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/networks": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", - "@ethersproject/web": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/web": "^5.6.0" } }, "@ethersproject/abstract-signer": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz", - "integrity": "sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz", + "integrity": "sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ==", "dev": true, "requires": { - "@ethersproject/abstract-provider": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0" + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0" } }, "@ethersproject/address": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.5.0.tgz", - "integrity": "sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.0.tgz", + "integrity": "sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/rlp": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/rlp": "^5.6.0" } }, "@ethersproject/base64": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.5.0.tgz", - "integrity": "sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.0.tgz", + "integrity": "sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0" + "@ethersproject/bytes": "^5.6.0" } }, "@ethersproject/bignumber": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", - "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.0.tgz", + "integrity": "sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", "bn.js": "^4.11.9" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } } }, "@ethersproject/bytes": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", - "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", + "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", "dev": true, "requires": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/constants": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", - "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.0.tgz", + "integrity": "sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0" } }, "@ethersproject/hash": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.5.0.tgz", - "integrity": "sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.0.tgz", + "integrity": "sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA==", "dev": true, "requires": { - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "@ethersproject/keccak256": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.5.0.tgz", - "integrity": "sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.0.tgz", + "integrity": "sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", "js-sha3": "0.8.0" } }, "@ethersproject/logger": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", - "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", + "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", "dev": true }, "@ethersproject/networks": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.5.2.tgz", - "integrity": "sha512-NEqPxbGBfy6O3x4ZTISb90SjEDkWYDUbEeIFhJly0F7sZjoQMnj5KYzMSkMkLKZ+1fGpx00EDpHQCy6PrDupkQ==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.1.tgz", + "integrity": "sha512-b2rrupf3kCTcc3jr9xOWBuHylSFtbpJf79Ga7QR98ienU2UqGimPGEsYMgbI29KHJfA5Us89XwGVmxrlxmSrMg==", "dev": true, "requires": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/properties": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", - "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", + "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", "dev": true, "requires": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/rlp": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.5.0.tgz", - "integrity": "sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.0.tgz", + "integrity": "sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/signing-key": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.5.0.tgz", - "integrity": "sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.0.tgz", + "integrity": "sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", "bn.js": "^4.11.9", "elliptic": "6.5.4", "hash.js": "1.1.7" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } } }, "@ethersproject/strings": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", - "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.0.tgz", + "integrity": "sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/transactions": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.5.0.tgz", - "integrity": "sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.0.tgz", + "integrity": "sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg==", "dev": true, "requires": { - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/rlp": "^5.5.0", - "@ethersproject/signing-key": "^5.5.0" + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/rlp": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0" } }, "@ethersproject/web": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.1.tgz", - "integrity": "sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.0.tgz", + "integrity": "sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg==", "dev": true, "requires": { - "@ethersproject/base64": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/base64": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "@istanbuljs/load-nyc-config": { @@ -22205,9 +22477,9 @@ } }, "@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "@types/jwt-simple": { @@ -22249,9 +22521,9 @@ } }, "@types/lodash": { - "version": "4.14.179", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.179.tgz", - "integrity": "sha512-uwc1x90yCKqGcIOAT6DwOSuxnrAbpkdPsUOZtwrXb4D/6wZs+6qG7QnIawDuZWg0sWpxl+ltIKCaLoMlna678w==" + "version": "4.14.181", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.181.tgz", + "integrity": "sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag==" }, "@types/long": { "version": "4.0.1", @@ -22335,9 +22607,9 @@ } }, "@types/supertest": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.11.tgz", - "integrity": "sha512-uci4Esokrw9qGb9bvhhSVEjd6rkny/dk5PK/Qz4yxKiyppEI+dOPlNrZBahE3i+PoKFYyDxChVXZ/ysS/nrm1Q==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.12.tgz", + "integrity": "sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==", "dev": true, "requires": { "@types/superagent": "*" @@ -22386,9 +22658,9 @@ } }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -22469,9 +22741,9 @@ } }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -22505,6 +22777,12 @@ "http-status-codes": "1.4.0" }, "dependencies": { + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, "http-errors": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", @@ -22596,6 +22874,15 @@ "ltgt": "^2.1.2", "typedarray-to-buffer": "~3.1.5" } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } } } }, @@ -23007,9 +23294,9 @@ } }, "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true }, "ansi-styles": { @@ -23182,14 +23469,15 @@ } }, "array.prototype.find": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.1.2.tgz", - "integrity": "sha512-00S1O4ewO95OmmJW7EesWfQlrCrLEL8kZ40w3+GkLX2yTt0m2ggcePPa2uHPJ9KUmJvwRq+lCV9bD8Yim23x/Q==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.2.0.tgz", + "integrity": "sha512-sn40qmUiLYAcRb/1HsIQjTTZ1kCy8II8VtZJpMn2Aoen9twULhbWXisfh3HimGqMlHGUul0/TfKCnXg42LuPpQ==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "es-abstract": "^1.19.4", + "es-shim-unscopables": "^1.0.0" } }, "asap": { @@ -23215,13 +23503,6 @@ "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0", "safer-buffer": "^2.1.0" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - } } }, "assert": { @@ -23529,30 +23810,32 @@ } }, "blakejs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", - "integrity": "sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" }, "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, "body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", + "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" + "on-finished": "2.4.1", + "qs": "6.10.3", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" }, "dependencies": { "debug": { @@ -23779,6 +24062,14 @@ "requires": { "bn.js": "^5.0.0", "randombytes": "^2.0.1" + }, + "dependencies": { + "bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "dev": true + } } }, "browserify-sign": { @@ -23796,6 +24087,14 @@ "parse-asn1": "^5.1.5", "readable-stream": "^3.6.0", "safe-buffer": "^5.2.0" + }, + "dependencies": { + "bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "dev": true + } } }, "browserify-zlib": { @@ -23808,13 +24107,13 @@ } }, "browserslist": { - "version": "4.19.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.3.tgz", - "integrity": "sha512-XK3X4xtKJ+Txj8G5c30B4gsm71s69lqXlkYui4s6EkKxuv49qjYlY6oVd+IFJ73d4YymtM3+djvvt/R/iJwwDg==", + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", + "integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001312", - "electron-to-chromium": "^1.4.71", + "caniuse-lite": "^1.0.30001317", + "electron-to-chromium": "^1.4.84", "escalade": "^3.1.1", "node-releases": "^2.0.2", "picocolors": "^1.0.0" @@ -23957,9 +24256,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001313", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001313.tgz", - "integrity": "sha512-rI1UN0koZUiKINjysQDuRi2VeSCce3bYJNmDcj3PIKREiAmjakugBul1QSkg/fPrlULYl6oWfGg3PbgOSY9X4Q==", + "version": "1.0.30001328", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001328.tgz", + "integrity": "sha512-Ue55jHkR/s4r00FLNiX+hGMMuwml/QGqqzVeMQ5thUewznU2EdULFvI3JR7JJid6OrjJNfFvHY2G2dIjmRaDDQ==", "dev": true }, "caseless": { @@ -24493,14 +24792,6 @@ "requires": { "depd": "~2.0.0", "keygrip": "~1.1.0" - }, - "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true - } } }, "core-js": { @@ -24542,13 +24833,9 @@ } }, "crc-32": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.1.tgz", - "integrity": "sha512-Dn/xm/1vFFgs3nfrpEVScHoIslO9NZRITWGz/1E/St6u4xw99vfZzVkW0OSnzx2h9egej9xwMCEut6sqwokM/w==", - "requires": { - "exit-on-epipe": "~1.0.1", - "printj": "~1.3.1" - } + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==" }, "create-ecdh": { "version": "4.0.4", @@ -24558,14 +24845,6 @@ "requires": { "bn.js": "^4.1.0", "elliptic": "^6.5.3" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } } }, "create-hash": { @@ -24913,9 +25192,9 @@ } }, "date-format": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.4.tgz", - "integrity": "sha512-/jyf4rhB17ge328HJuJjAcmRtCsGd+NDeAtahRBTaK6vSPR6MO5HlrAit3Nn7dVjaa6sowW0WXt8yQtLyZQFRg==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.6.tgz", + "integrity": "sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw==", "dev": true }, "dateformat": { @@ -24937,9 +25216,9 @@ "dev": true }, "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { "ms": "2.1.2" }, @@ -25073,9 +25352,9 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" }, "deps-sort": { "version": "2.0.1", @@ -25100,10 +25379,9 @@ } }, "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, "detect-node": { "version": "2.1.0", @@ -25151,14 +25429,6 @@ "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", "randombytes": "^2.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } } }, "dir-glob": { @@ -25383,9 +25653,9 @@ } }, "electron-to-chromium": { - "version": "1.4.76", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.76.tgz", - "integrity": "sha512-3Vftv7cenJtQb+k00McEBZ2vVmZ/x+HEF7pcZONZIkOsESqAqVuACmBxMv0JhzX7u0YltU0vSqRqgBSTAhFUjA==", + "version": "1.4.107", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.107.tgz", + "integrity": "sha512-Huen6taaVrUrSy8o7mGStByba8PfOWWluHNxSHGBrCgEdFVLtvdQDBr9LBCF9Uci8SYxh28QNNMO0oC17wbGAg==", "dev": true }, "elliptic": { @@ -25400,13 +25670,6 @@ "inherits": "^2.0.4", "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - } } }, "emoji-regex": { @@ -25555,9 +25818,9 @@ } }, "es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", + "version": "1.19.4", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.4.tgz", + "integrity": "sha512-flV8e5g9/xulChMG48Fygk1ptpo4lQRJ0eJYtxJFgi7pklLx7EFcOJ34jnvr8pbWlaFN/AT1cZpe0hiFel9Hqg==", "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", @@ -25565,15 +25828,15 @@ "get-intrinsic": "^1.1.1", "get-symbol-description": "^1.0.0", "has": "^1.0.3", - "has-symbols": "^1.0.2", + "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", + "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", + "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", @@ -25603,6 +25866,15 @@ "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", "dev": true }, + "es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -25614,14 +25886,14 @@ } }, "es5-ext": { - "version": "0.10.53", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "version": "0.10.60", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.60.tgz", + "integrity": "sha512-jpKNXIt60htYG59/9FGf2PYT3pwMpnEbNKysU+k/4FGwyGtMotOvcZOuW+EmXXYASRqYSXQfGL5cVIthOTgbkg==", "dev": true, "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" } }, "es6-error": { @@ -26237,6 +26509,11 @@ "typescript": "^4.4.2" }, "dependencies": { + "bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, "rlp": { "version": "2.2.7", "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", @@ -26357,11 +26634,6 @@ "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", "dev": true }, - "exit-on-epipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz", - "integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==" - }, "express": { "version": "4.17.1", "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", @@ -26439,6 +26711,12 @@ "ms": "2.0.0" } }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, "http-errors": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", @@ -26464,6 +26742,15 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, "qs": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", @@ -26619,9 +26906,9 @@ } }, "fecha": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", - "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==" + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.2.tgz", + "integrity": "sha512-5rOQWkBVz3FnYWTi/ELZmq4CoK1Pb+xKNZWuJRsOwo0+8DrP43CrWJtyLVvb5U7z7ggE5llahfDbLjaVNzXVJQ==" }, "figures": { "version": "3.2.0", @@ -26699,6 +26986,14 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } } } }, @@ -27094,9 +27389,9 @@ } }, "graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "handlebars": { "version": "4.7.7", @@ -27294,15 +27589,22 @@ "dev": true }, "http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "requires": { - "depd": "~1.1.2", + "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", + "statuses": "2.0.1", "toidentifier": "1.0.1" + }, + "dependencies": { + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" + } } }, "http-proxy": { @@ -27817,9 +28119,9 @@ "dev": true }, "is-number-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", - "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "requires": { "has-tostringtag": "^1.0.0" } @@ -27872,9 +28174,12 @@ "dev": true }, "is-shared-array-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", - "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "requires": { + "call-bind": "^1.0.2" + } }, "is-stream": { "version": "2.0.1", @@ -27960,9 +28265,9 @@ "dev": true }, "isbinaryfile": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.8.tgz", - "integrity": "sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", + "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", "dev": true }, "isexe": { @@ -28496,9 +28801,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==" + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==" }, "commander": { "version": "2.20.3", @@ -28689,13 +28994,10 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true }, "jsonc-parser": { "version": "3.0.0", @@ -28959,9 +29261,9 @@ } }, "karma-chrome-launcher": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz", - "integrity": "sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.1.tgz", + "integrity": "sha512-hsIglcq1vtboGPAN+DGCISCFOxW+ZVnIqhDQcCMqqCp+4dmJ0Qpq5QAjkbA0X2L9Mi6OBkHi2Srrbmm7pUKkzQ==", "dev": true, "requires": { "which": "^1.2.1" @@ -29640,9 +29942,9 @@ } }, "node-forge": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.2.1.tgz", - "integrity": "sha512-Fcvtbb+zBcZXbTTVwqGA5W+MKBj56UjVRevvchv5XrcyXbmNdesfZL37nlcWOfpgHhgmxApw3tQbTr4CqNmX4w==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==" }, "peer-id": { "version": "0.16.0", @@ -30306,9 +30608,9 @@ } }, "loader-runner": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", - "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", "dev": true }, "loader-utils": { @@ -30442,16 +30744,16 @@ "dev": true }, "log4js": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.2.tgz", - "integrity": "sha512-k80cggS2sZQLBwllpT1p06GtfvzMmSdUCkW96f0Hj83rKGJDAu2vZjt9B9ag2vx8Zz1IXzxoLgqvRJCdMKybGg==", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.4.tgz", + "integrity": "sha512-ncaWPsuw9Vl1CKA406hVnJLGQKy1OHx6buk8J4rE2lVW+NW5Y82G5/DIloO7NkqLOUtNPEANaWC1kZYVjXssPw==", "dev": true, "requires": { - "date-format": "^4.0.4", - "debug": "^4.3.3", + "date-format": "^4.0.6", + "debug": "^4.3.4", "flatted": "^3.2.5", "rfdc": "^1.3.0", - "streamroller": "^3.0.4" + "streamroller": "^3.0.6" }, "dependencies": { "flatted": { @@ -30607,9 +30909,9 @@ "dev": true }, "marked": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.12.tgz", - "integrity": "sha512-hgibXWrEDNBWgGiK18j/4lkS6ihTe9sxtV4Q1OQppb/0zzyPSzoFANBa5MfsG/zgsWklmNnhm0XACZOH/0HBiQ==", + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.14.tgz", + "integrity": "sha512-HL5sSPE/LP6U9qKgngIIPTthuxC0jrfxpYMZ3LdGDD3vTnLs59m2Z7r6+LNDR3ToqEQdkKd6YaaEfJhodJmijQ==", "dev": true }, "mcl-wasm": { @@ -30755,9 +31057,9 @@ } }, "tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -30772,7 +31074,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -30792,13 +31094,13 @@ "dev": true }, "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.2", + "picomatch": "^2.3.1" } }, "miller-rabin": { @@ -30809,14 +31111,6 @@ "requires": { "bn.js": "^4.0.0", "brorand": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } } }, "mime": { @@ -30826,16 +31120,16 @@ "dev": true }, "mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==" + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" }, "mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "requires": { - "mime-db": "1.51.0" + "mime-db": "1.52.0" } }, "mimic-fn": { @@ -30862,17 +31156,17 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, "requires": { - "minimist": "^1.2.5" + "minimist": "^1.2.6" } }, "mkdirp-classic": { @@ -30943,9 +31237,9 @@ } }, "moment": { - "version": "2.29.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", - "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" + "version": "2.29.2", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.2.tgz", + "integrity": "sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg==" }, "morphdom": { "version": "2.6.1", @@ -31339,9 +31633,9 @@ } }, "nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz", + "integrity": "sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==" }, "napi-macros": { "version": "2.0.0", @@ -31390,9 +31684,9 @@ "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==" }, "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, "nice-try": { @@ -31475,9 +31769,9 @@ "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" }, "node-gyp-build": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", - "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==" + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==" }, "node-preload": { "version": "0.2.1", @@ -31489,9 +31783,9 @@ } }, "node-releases": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz", - "integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.3.tgz", + "integrity": "sha512-maHFz6OLqYxz+VQyCAtA3PTX4UP/53pa05fyDNc9CwjvJ0yEh6+xBwKsgCxMNhS8taUKBFYxfuiaD9U/55iFaw==", "dev": true }, "normalize-html-whitespace": { @@ -31729,9 +32023,9 @@ } }, "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "requires": { "ee-first": "1.1.1" } @@ -32524,9 +32818,9 @@ "dev": true }, "prettier": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", - "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", "dev": true }, "prettier-linter-helpers": { @@ -32599,11 +32893,6 @@ } } }, - "printj": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/printj/-/printj-1.3.1.tgz", - "integrity": "sha512-GA3TdL8szPK4AQ2YnOe/b+Y1jUFwmmGMMK/qbY7VcE3Z7FU8JstbKiKRzO6CIiAKPhTO8m01NoQ0V5f3jc4OGg==" - }, "private-ip": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/private-ip/-/private-ip-2.3.3.tgz", @@ -32733,14 +33022,6 @@ "parse-asn1": "^5.0.0", "randombytes": "^2.0.1", "safe-buffer": "^5.1.2" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } } }, "pull-pair": { @@ -32800,9 +33081,12 @@ "dev": true }, "qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==" + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "requires": { + "side-channel": "^1.0.4" + } }, "querystring": { "version": "0.2.0", @@ -32869,12 +33153,12 @@ "dev": true }, "raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "requires": { "bytes": "3.1.2", - "http-errors": "1.8.1", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" } @@ -33284,9 +33568,9 @@ } }, "tape": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.2.tgz", - "integrity": "sha512-N9Ss672dFE3QlppiXGh2ieux8Ophau/HSAQguW5cXQworKxV0QvnZCYI35W1OYySTJk0OC9OPuS+0xNO6lhiTQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -33301,7 +33585,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -33480,6 +33764,18 @@ } } }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, "http-errors": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", @@ -33505,6 +33801,15 @@ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", @@ -33861,9 +34166,9 @@ } }, "solc": { - "version": "0.8.12", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.12.tgz", - "integrity": "sha512-TU3anAhKWBQ/WrerJ9EcHrNwGOA1y5vIk5Flz7dBNamLDkX9VQTIwcKd3FiZsT0Ew8rSU7RTmJyGNHRGzP5TBA==", + "version": "0.8.13", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.13.tgz", + "integrity": "sha512-C0yTN+rjEOGO6uVOXI8+EKa75SFMuZpQ2tryex4QxWIg0HRWZvCHKfVPuLZ5wx06Sb6GBp6uQA5yqQyXZnXOJw==", "dev": true, "requires": { "command-exists": "^1.2.8", @@ -34443,9 +34748,9 @@ }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true }, "is-fullwidth-code-point": { @@ -34655,13 +34960,13 @@ "integrity": "sha512-nEs6hBGIPsVz6uq6pscGGKfoPDQWrDQW0b0UHurtSDysekfKLmkPg7FQVRE2sj3Rad6yUo9E1sGTxOWyYsHQ/g==" }, "streamroller": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.4.tgz", - "integrity": "sha512-GI9NzeD+D88UFuIlJkKNDH/IsuR+qIN7Qh8EsmhoRZr9bQoehTraRgwtLUkZbpcAw+hLPfHOypmppz8YyGK68w==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.6.tgz", + "integrity": "sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg==", "dev": true, "requires": { - "date-format": "^4.0.4", - "debug": "^4.3.3", + "date-format": "^4.0.6", + "debug": "^4.3.4", "fs-extra": "^10.0.1" } }, @@ -34781,9 +35086,9 @@ } }, "superagent": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.1.1.tgz", - "integrity": "sha512-CQ2weSS6M+doIwwYFoMatklhRbx6sVNdB99OEJ5czcP3cng76Ljqus694knFWgOj3RkrtxZqIgpe6vhe0J7QWQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.1.2.tgz", + "integrity": "sha512-o9/fP6dww7a4xmEF5a484o2rG34UUGo8ztDlv7vbCWuqPhpndMi0f7eXxdlryk5U12Kzy46nh8eNpLAJ93Alsg==", "dev": true, "requires": { "component-emitter": "^1.3.0", @@ -34819,19 +35124,10 @@ "yallist": "^4.0.0" } }, - "qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", - "dev": true, - "requires": { - "side-channel": "^1.0.4" - } - }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -34945,9 +35241,9 @@ "dev": true }, "tape": { - "version": "4.15.0", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.15.0.tgz", - "integrity": "sha512-SfRmG2I8QGGgJE/MCiLH8c11L5XxyUXxwK9xLRD0uiK5fehRkkSZGmR6Y1pxOt8vJ19m3sY+POTQpiaVv45/LQ==", + "version": "4.15.1", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.15.1.tgz", + "integrity": "sha512-k7F5pyr91n9D/yjSJwbLLYDCrTWXxMSXbbmHX2n334lSIc2rxeXyFkaBv4UuUd2gBYMrAOalPutAiCxC6q1qbw==", "dev": true, "requires": { "call-bind": "~1.0.2", @@ -34959,7 +35255,7 @@ "has": "~1.0.3", "inherits": "~2.0.4", "is-regex": "~1.1.4", - "minimist": "~1.2.5", + "minimist": "~1.2.6", "object-inspect": "~1.12.0", "resolve": "~1.22.0", "resumer": "~0.0.0", @@ -34968,9 +35264,9 @@ } }, "terser": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.0.tgz", - "integrity": "sha512-R3AUhNBGWiFc77HXag+1fXpAxTAFRQTJemlJKjAgD9r8xXTpjNKqIXwHM/o7Rh+O0kUJtS3WQVdBeMKFk5sw9A==", + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", + "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", "dev": true, "requires": { "acorn": "^8.5.0", @@ -35238,9 +35534,9 @@ } }, "ts-node": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.6.0.tgz", - "integrity": "sha512-CJen6+dfOXolxudBQXnVjRVvYTmTWbyz7cn+xq2XTsvnaXbHqr4gXSCNbS2Jj8yTZMuGwUoBESLaOkLascVVvg==", + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", + "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, "requires": { "@cspotcode/source-map-support": "0.7.0", @@ -35369,31 +35665,51 @@ } }, "typedoc": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.12.tgz", - "integrity": "sha512-FcyC+YuaOpr3rB9QwA1IHOi9KnU2m50sPJW5vcNRPCIdecp+3bFkh7Rq5hBU1Fyn29UR2h4h/H7twZHWDhL0sw==", + "version": "0.22.15", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.15.tgz", + "integrity": "sha512-CMd1lrqQbFvbx6S9G6fL4HKp3GoIuhujJReWqlIvSb2T26vGai+8Os3Mde7Pn832pXYemd9BMuuYWhFpL5st0Q==", "dev": true, "requires": { "glob": "^7.2.0", "lunr": "^2.3.9", - "marked": "^4.0.10", - "minimatch": "^3.0.4", - "shiki": "^0.10.0" + "marked": "^4.0.12", + "minimatch": "^5.0.1", + "shiki": "^0.10.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "typedoc-plugin-markdown": { - "version": "3.11.14", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.11.14.tgz", - "integrity": "sha512-lh47OQvl0079nB18YL9wuTRRhMpjo300SZKfx/xpQY8qG+GINeSxTod95QBELeI0NP81sNtUbemRDrn5nyef4Q==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.12.0.tgz", + "integrity": "sha512-yKl7/KWD8nP6Ot6OzMLLc8wBzN3CmkBoI/YQzxT62a9xmDgxyeTxGbHbkUoSzhKFqMI3SR0AqV6prAhVKbYnxw==", "dev": true, "requires": { "handlebars": "^4.7.7" } }, "typescript": { - "version": "4.5.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", - "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", + "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", "dev": true }, "ua-parser-js": { @@ -35403,9 +35719,9 @@ "dev": true }, "uglify-js": { - "version": "3.15.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.2.tgz", - "integrity": "sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==", + "version": "3.15.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.4.tgz", + "integrity": "sha512-vMOPGDuvXecPs34V74qDKk4iJ/SN4vL3Ow/23ixafENYvtrNvtbcgUeugTcUGRGsOF/5fU8/NYSL5Hyb3l1OJA==", "dev": true, "optional": true }, @@ -35597,9 +35913,9 @@ "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, "verdaccio": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/verdaccio/-/verdaccio-4.12.2.tgz", - "integrity": "sha512-ZIvakoKZuJNQ1PFbrx7qTcTLSgSS1GfdTbNZhFPBORxUZjAdTPDS1WmuIS2CvWwrEK/UxikbQIyD9nMsAL2NkQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/verdaccio/-/verdaccio-4.13.0.tgz", + "integrity": "sha512-kipaE7VeHNKelrbHlO1I7yjh2V97qn9Fg6r3tMyDveTXHwKUcAjynmWOFqKx/a566xJYClKc4t4z6UCVVs3gAQ==", "dev": true, "requires": { "@verdaccio/commons-api": "9.7.1", @@ -35709,6 +36025,12 @@ "ms": "2.0.0" } }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, "http-errors": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", @@ -35752,12 +36074,30 @@ "brace-expansion": "^1.1.7" } }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, "qs": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", @@ -35901,6 +36241,12 @@ "unix-crypt-td-js": "1.1.4" }, "dependencies": { + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, "http-errors": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", @@ -36034,9 +36380,9 @@ "dev": true }, "webpack": { - "version": "5.70.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.70.0.tgz", - "integrity": "sha512-ZMWWy8CeuTTjCxbeaQI21xSswseF2oNOwc70QSKNePvmxE7XW36i7vpBMYZFAUHPwQiEbNGCEYIOOlyRbdGmxw==", + "version": "5.72.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.72.0.tgz", + "integrity": "sha512-qmSmbspI0Qo5ld49htys8GY9XhS9CGqFoHTsOVAnjBdg0Zn79y135R+k4IR4rKK6+eKaabMhJwiVB7xw0SJu5w==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.3", @@ -36237,9 +36583,9 @@ "dev": true }, "winston": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.6.0.tgz", - "integrity": "sha512-9j8T75p+bcN6D00sF/zjFVmPp+t8KMPB1MzbbzYjeN9VWxdsYnTB40TkbNUEXAmILEfChMvAMgidlX64OG3p6w==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.7.2.tgz", + "integrity": "sha512-QziIqtojHBoyzUOdQvQiar1DH0Xp9nF1A1y7NVy2DGEsz82SBDtOalS0ulTRGVT14xPX3WRWkCsdcJKqNflKng==", "requires": { "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", @@ -36409,9 +36755,9 @@ "dev": true }, "yargs": { - "version": "17.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "version": "17.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", + "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", diff --git a/packages/client/lib/client.ts b/packages/client/lib/client.ts index 0f73e3a6b74..be058e6fda3 100644 --- a/packages/client/lib/client.ts +++ b/packages/client/lib/client.ts @@ -182,7 +182,7 @@ export default class EthereumClient { const parentBlock = await vm.blockchain.getBlock(block.header.parentHash) // Set the correct state root - await vm.stateManager.setStateRoot(parentBlock.header.stateRoot) + await vm.vmState.setStateRoot(parentBlock.header.stateRoot) const td = await vm.blockchain.getTotalDifficulty(block.header.parentHash) vm._common.setHardforkByBlockNumber(blockNumber, td) diff --git a/packages/client/lib/execution/vmexecution.ts b/packages/client/lib/execution/vmexecution.ts index 5656578fed4..c26996535c0 100644 --- a/packages/client/lib/execution/vmexecution.ts +++ b/packages/client/lib/execution/vmexecution.ts @@ -7,7 +7,7 @@ import { import { ConsensusType, Hardfork } from '@ethereumjs/common' import VM from '@ethereumjs/vm' import { bufferToHex } from 'ethereumjs-util' -import { DefaultStateManager } from '@ethereumjs/vm/dist/state' +import { DefaultStateManager } from '@ethereumjs/statemanager' import { SecureTrie as Trie } from 'merkle-patricia-tree' import { short } from '../util' import { debugCodeReplayBlock } from '../util/debug' @@ -75,7 +75,7 @@ export class VMExecution extends Execution { this.hardfork = this.config.execCommon.hardfork() this.config.logger.info(`Initializing VM execution hardfork=${this.hardfork}`) if (number === BigInt(0)) { - await this.vm.stateManager.generateCanonicalGenesis() + await this.vm.vmState.generateCanonicalGenesis() } } diff --git a/packages/client/lib/miner/miner.ts b/packages/client/lib/miner/miner.ts index 3a7e522f30f..b7cf3dda437 100644 --- a/packages/client/lib/miner/miner.ts +++ b/packages/client/lib/miner/miner.ts @@ -206,7 +206,7 @@ export class Miner { // Set the state root to ensure the resulting state // is based on the parent block's state - await vmCopy.stateManager.setStateRoot(parentBlock.header.stateRoot) + await vmCopy.vmState.setStateRoot(parentBlock.header.stateRoot) let difficulty let cliqueSigner diff --git a/packages/client/lib/miner/pendingBlock.ts b/packages/client/lib/miner/pendingBlock.ts index 32f8fb809d3..fd4e8d27651 100644 --- a/packages/client/lib/miner/pendingBlock.ts +++ b/packages/client/lib/miner/pendingBlock.ts @@ -45,7 +45,7 @@ export class PendingBlock { // Set the state root to ensure the resulting state // is based on the parent block's state - await vm.stateManager.setStateRoot(parentBlock.header.stateRoot) + await vm.vmState.setStateRoot(parentBlock.header.stateRoot) const td = await vm.blockchain.getTotalDifficulty(parentBlock.hash()) vm._common.setHardforkByBlockNumber(parentBlock.header.number, td) diff --git a/packages/client/lib/rpc/modules/eth.ts b/packages/client/lib/rpc/modules/eth.ts index a1ec8435544..2bc02ad9b28 100644 --- a/packages/client/lib/rpc/modules/eth.ts +++ b/packages/client/lib/rpc/modules/eth.ts @@ -31,7 +31,7 @@ import type { TxReceipt, } from '@ethereumjs/vm/dist/types' import type { Log } from '@ethereumjs/vm/dist/evm/types' -import type { Proof } from '@ethereumjs/vm/dist/state' +import type { Proof } from '@ethereumjs/statemanager' import type { EthereumClient } from '../..' import type { Chain } from '../../blockchain' import type { EthProtocol } from '../../net/protocol' diff --git a/packages/client/lib/service/txpool.ts b/packages/client/lib/service/txpool.ts index 4d417f0c057..9dbab1050a9 100644 --- a/packages/client/lib/service/txpool.ts +++ b/packages/client/lib/service/txpool.ts @@ -498,7 +498,7 @@ export class TxPool { .map((obj) => obj.tx) .sort((a, b) => Number(a.nonce - b.nonce)) // Check if the account nonce matches the lowest known tx nonce - const { nonce } = await this.vm.stateManager.getAccount( + const { nonce } = await this.vm.vmState.getAccount( new Address(Buffer.from(address, 'hex')) ) if (!txsSortedByNonce[0].nonce !== nonce) { diff --git a/packages/client/package.json b/packages/client/package.json index 6d6b2fc77be..69cb90addfc 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -55,6 +55,7 @@ "@ethereumjs/common": "^2.6.4", "@ethereumjs/devp2p": "^4.2.2", "@ethereumjs/ethash": "^1.1.0", + "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", "@ethereumjs/vm": "^5.9.0", "body-parser": "^1.19.2", diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index fb57b0ef624..f1958e699f5 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -3,8 +3,10 @@ import td from 'testdouble' import Common, { Chain as CommonChain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction, Transaction } from '@ethereumjs/tx' import { Block, BlockHeader } from '@ethereumjs/block' -import { DefaultStateManager, StateManager } from '@ethereumjs/vm/dist/state' +import { VmState } from '@ethereumjs/vm/dist/vmState' import { Address } from 'ethereumjs-util' +import VM from '@ethereumjs/vm' + import { Config } from '../../lib/config' import { FullEthereumService } from '../../lib/service' import { Chain } from '../../lib/blockchain' @@ -28,10 +30,10 @@ const B = { ), } -const setBalance = async (stateManager: StateManager, address: Address, balance: bigint) => { - await stateManager.checkpoint() - await stateManager.modifyAccountFields(address, { balance }) - await stateManager.commit() +const setBalance = async (vm: VM, address: Address, balance: bigint) => { + await vm.vmState.checkpoint() + await vm.vmState.modifyAccountFields(address, { balance }) + await vm.vmState.commit() } tape('[Miner]', async (t) => { @@ -39,9 +41,9 @@ tape('[Miner]', async (t) => { BlockHeader.prototype.validate = td.func() td.replace('@ethereumjs/block', { BlockHeader }) - const originalSetStateRoot = DefaultStateManager.prototype.setStateRoot - DefaultStateManager.prototype.setStateRoot = td.func() - td.replace('@ethereumjs/vm/dist/state', { DefaultStateManager }) + const originalSetStateRoot = VmState.prototype.setStateRoot + VmState.prototype.setStateRoot = td.func() + td.replace('@ethereumjs/vm/dist/vmState', { VmState }) class FakeChain { open() {} @@ -148,7 +150,7 @@ tape('[Miner]', async (t) => { txPool.start() miner.start() - await setBalance(vm.stateManager, A.address, BigInt('200000000000001')) + await setBalance(vm, A.address, BigInt('200000000000001')) // add tx txPool.add(txA01) @@ -180,8 +182,8 @@ tape('[Miner]', async (t) => { txPool.start() miner.start() - await setBalance(vm.stateManager, A.address, BigInt('400000000000001')) - await setBalance(vm.stateManager, B.address, BigInt('400000000000001')) + await setBalance(vm, A.address, BigInt('400000000000001')) + await setBalance(vm, B.address, BigInt('400000000000001')) // add txs txPool.add(txA01) @@ -282,7 +284,7 @@ tape('[Miner]', async (t) => { txPool.start() miner.start() - await setBalance(vm.stateManager, A.address, BigInt('200000000000001')) + await setBalance(vm, A.address, BigInt('200000000000001')) // add txs const data = '0xfe' // INVALID opcode, consumes all gas @@ -328,7 +330,7 @@ tape('[Miner]', async (t) => { txPool.start() miner.start() - await setBalance(vm.stateManager, A.address, BigInt('200000000000001')) + await setBalance(vm, A.address, BigInt('200000000000001')) // add many txs to slow assembling for (let i = 0; i < 1000; i++) { @@ -452,7 +454,7 @@ tape('[Miner]', async (t) => { // mocking indirect dependencies is not properly supported, but it works for us in this file, // so we will replace the original functions to avoid issues in other tests that come after BlockHeader.prototype.validate = originalValidate - DefaultStateManager.prototype.setStateRoot = originalSetStateRoot + VmState.prototype.setStateRoot = originalSetStateRoot t.end() }) }) diff --git a/packages/client/test/miner/pendingBlock.spec.ts b/packages/client/test/miner/pendingBlock.spec.ts index b789e768ce9..925db1e3057 100644 --- a/packages/client/test/miner/pendingBlock.spec.ts +++ b/packages/client/test/miner/pendingBlock.spec.ts @@ -4,7 +4,7 @@ import Common, { Chain as CommonChain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' import { BlockHeader } from '@ethereumjs/block' import VM from '@ethereumjs/vm' -import { DefaultStateManager, StateManager } from '@ethereumjs/vm/dist/state' +import { DefaultStateManager, StateManager } from '@ethereumjs/statemanager' import { Address } from 'ethereumjs-util' import { Config } from '../../lib/config' import { TxPool } from '../../lib/service/txpool' diff --git a/packages/client/test/rpc/eth/estimateGas.spec.ts b/packages/client/test/rpc/eth/estimateGas.spec.ts index d560521f374..c44f4602c05 100644 --- a/packages/client/test/rpc/eth/estimateGas.spec.ts +++ b/packages/client/test/rpc/eth/estimateGas.spec.ts @@ -26,7 +26,7 @@ tape(`${method}: call with valid arguments`, async (t) => { const { execution } = client.services.find((s) => s.name === 'eth') as FullEthereumService t.notEqual(execution, undefined, 'should have valid execution') const { vm } = execution - await vm.stateManager.generateCanonicalGenesis() + await vm.vmState.generateCanonicalGenesis() // genesis address with balance const address = Address.fromString('0xccfd725760a68823ff1e062f4cc97e1360e8d997') diff --git a/packages/client/test/rpc/eth/getBalance.spec.ts b/packages/client/test/rpc/eth/getBalance.spec.ts index 66b370dc956..a237cb0ef57 100644 --- a/packages/client/test/rpc/eth/getBalance.spec.ts +++ b/packages/client/test/rpc/eth/getBalance.spec.ts @@ -26,7 +26,7 @@ tape(`${method}: ensure balance deducts after a tx`, async (t) => { // since synchronizer.run() is not executed in the mock setup, // manually run stateManager.generateCanonicalGenesis() - await vm.stateManager.generateCanonicalGenesis() + await vm.vmState.generateCanonicalGenesis() // genesis address with balance const address = Address.fromString('0xccfd725760a68823ff1e062f4cc97e1360e8d997') diff --git a/packages/client/test/rpc/eth/getCode.spec.ts b/packages/client/test/rpc/eth/getCode.spec.ts index dba1ce2b467..55556173f4c 100644 --- a/packages/client/test/rpc/eth/getCode.spec.ts +++ b/packages/client/test/rpc/eth/getCode.spec.ts @@ -23,7 +23,7 @@ tape(`${method}: call with valid arguments`, async (t) => { const { execution } = client.services.find((s) => s.name === 'eth') as FullEthereumService t.notEqual(execution, undefined, 'should have valid execution') const { vm } = execution - await vm.stateManager.generateCanonicalGenesis() + await vm.vmState.generateCanonicalGenesis() // genesis address const address = Address.fromString('0xccfd725760a68823ff1e062f4cc97e1360e8d997') diff --git a/packages/client/test/rpc/eth/getTransactionCount.spec.ts b/packages/client/test/rpc/eth/getTransactionCount.spec.ts index a4e4dcbfd88..09359b69a07 100644 --- a/packages/client/test/rpc/eth/getTransactionCount.spec.ts +++ b/packages/client/test/rpc/eth/getTransactionCount.spec.ts @@ -30,7 +30,7 @@ tape(`${method}: call with valid arguments`, async (t) => { // since synchronizer.run() is not executed in the mock setup, // manually run stateManager.generateCanonicalGenesis() - await vm.stateManager.generateCanonicalGenesis() + await vm.vmState.generateCanonicalGenesis() // a genesis address const address = Address.fromString('0xccfd725760a68823ff1e062f4cc97e1360e8d997') diff --git a/packages/statemanager/.eslintrc.js b/packages/statemanager/.eslintrc.js new file mode 100644 index 00000000000..9a851285ec5 --- /dev/null +++ b/packages/statemanager/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: '../../config/eslint.js', + ignorePatterns: ['scripts', 'benchmarks', 'examples', 'karma.conf.js'], + rules: { + '@typescript-eslint/no-use-before-define': 'off', + 'no-invalid-this': 'off', + 'no-restricted-syntax': 'off', + }, +} diff --git a/packages/statemanager/.gitignore b/packages/statemanager/.gitignore new file mode 100644 index 00000000000..3ed4090b20d --- /dev/null +++ b/packages/statemanager/.gitignore @@ -0,0 +1,2 @@ +.cachedb +benchmarks/*.js diff --git a/packages/statemanager/.nycrc b/packages/statemanager/.nycrc new file mode 100644 index 00000000000..288fee59d72 --- /dev/null +++ b/packages/statemanager/.nycrc @@ -0,0 +1,6 @@ +{ + "extends": "../../config/nyc.json", + "include": [ + "src/**/*.ts" + ] +} diff --git a/packages/statemanager/.prettierignore b/packages/statemanager/.prettierignore new file mode 100644 index 00000000000..7508c091e27 --- /dev/null +++ b/packages/statemanager/.prettierignore @@ -0,0 +1,8 @@ +*.json +.nyc_output +.vscode +coverage +dist +dist.browser +docs +node_modules diff --git a/packages/statemanager/CHANGELOG.md b/packages/statemanager/CHANGELOG.md new file mode 100644 index 00000000000..6fbbb609fd3 --- /dev/null +++ b/packages/statemanager/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +(modification: no type change headlines) and this project adheres to +[Semantic Versioning](http://semver.org/spec/v2.0.0.html). + diff --git a/packages/statemanager/DEVELOPER.md b/packages/statemanager/DEVELOPER.md new file mode 100644 index 00000000000..97e0eb6e489 --- /dev/null +++ b/packages/statemanager/DEVELOPER.md @@ -0,0 +1,12 @@ +# Developer Documentation + +## TESTING + +### Running Tests + +Tests can be found in the `tests` directory. The StateManager can be tested as: +`npm run test` + +### CI Test Integration + +Tests and checks are run in CI using [Github Actions](https://github.com/ethereumjs/ethereumjs-monorepo/actions). The configuration can be found in `.github/workflows`. diff --git a/packages/statemanager/LICENSE b/packages/statemanager/LICENSE new file mode 100644 index 00000000000..14e2f777f6c --- /dev/null +++ b/packages/statemanager/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/packages/statemanager/README.md b/packages/statemanager/README.md new file mode 100644 index 00000000000..fabb104a472 --- /dev/null +++ b/packages/statemanager/README.md @@ -0,0 +1,53 @@ +# @ethereumjs/statemanager + +[![NPM Package][statemanager-npm-badge]][statemanager-npm-link] +[![GitHub Issues][statemanager-issues-badge]][statemanager-issues-link] +[![Actions Status][statemanager-actions-badge]][statemanager-actions-link] +[![Code Coverage][statemanager-coverage-badge]][statemanager-coverage-link] +[![Discord][discord-badge]][discord-link] + +| TypeScript implementation of the Ethereum StateManager. | +| ------------------------------------------------------- | + +# INSTALL + +`npm install @ethereumjs/statemanager` + +# USAGE + +```typescript +import { DefaultStateManager } from '@ethereumjs/statemanager' +``` + +## Example + +# API + +## StateManager + +Documentation on the `StateManager` can be found [here](./docs). If you want to provide your own `StateManager` you can implement the dedicated interface to ensure that your implementation conforms with the current API. + +# DEVELOPMENT + +Developer documentation - currently mainly with information on testing and debugging - can be found [here](./DEVELOPER.md). + +# EthereumJS + +See our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices. + +If you want to join for work or do improvements on the libraries have a look at our [contribution guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html). + +# LICENSE + +[MPL-2.0](https://www.mozilla.org/MPL/2.0/) + +[discord-badge]: https://img.shields.io/static/v1?logo=discord&label=discord&message=Join&color=blue +[discord-link]: https://discord.gg/TNwARpR +[statemanager-npm-badge]: https://img.shields.io/npm/v/@ethereumjs/statemanager.svg +[statemanager-npm-link]: https://www.npmjs.com/package/@ethereumjs/statemanager +[statemanager-issues-badge]: https://img.shields.io/github/issues/ethereumjs/ethereumjs-monorepo/package:%20statemanager?label=issues +[statemanager-issues-link]: https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aopen+is%3Aissue+label%3A"package%3A+statemanager" +[statemanager-actions-badge]: https://github.com/ethereumjs/ethereumjs-monorepo/workflows/Statemanager/badge.svg +[statemanager-actions-link]: https://github.com/ethereumjs/ethereumjs-monorepo/actions?query=workflow%3A%22Statemanager%22 +[statemanager-coverage-badge]: https://codecov.io/gh/ethereumjs/ethereumjs-monorepo/branch/master/graph/badge.svg?flag=statemanager +[statemanager-coverage-link]: https://codecov.io/gh/ethereumjs/ethereumjs-monorepo/tree/master/packages/statemanager diff --git a/packages/statemanager/docs/README.md b/packages/statemanager/docs/README.md new file mode 100644 index 00000000000..0b5965b7ef8 --- /dev/null +++ b/packages/statemanager/docs/README.md @@ -0,0 +1,13 @@ +[@ethereumjs/statemanager](README.md) / Exports + +# @ethereumjs/statemanager + +## Table of contents + +### Modules + +- [index](modules/index.md) +- [state](modules/state.md) +- [state/interface](modules/state_interface.md) +- [state/stateManager](modules/state_stateManager.md) +- [types](modules/types.md) diff --git a/packages/vm/docs/classes/state_statemanager.default.md b/packages/statemanager/docs/classes/index.default.md similarity index 100% rename from packages/vm/docs/classes/state_statemanager.default.md rename to packages/statemanager/docs/classes/index.default.md diff --git a/packages/vm/docs/modules/state.md b/packages/statemanager/docs/modules/index.md similarity index 100% rename from packages/vm/docs/modules/state.md rename to packages/statemanager/docs/modules/index.md diff --git a/packages/vm/docs/modules/state_interface.md b/packages/statemanager/docs/modules/state_interface.md similarity index 100% rename from packages/vm/docs/modules/state_interface.md rename to packages/statemanager/docs/modules/state_interface.md diff --git a/packages/vm/docs/modules/state_statemanager.md b/packages/statemanager/docs/modules/state_statemanager.md similarity index 100% rename from packages/vm/docs/modules/state_statemanager.md rename to packages/statemanager/docs/modules/state_statemanager.md diff --git a/packages/statemanager/karma.conf.js b/packages/statemanager/karma.conf.js new file mode 100644 index 00000000000..5117d2f82ba --- /dev/null +++ b/packages/statemanager/karma.conf.js @@ -0,0 +1,66 @@ +// Karma configuration +// Generated on Fri Mar 01 2019 22:02:29 GMT+0100 (CET) + +module.exports = function (config) { + config.set({ + // frameworks to use + // available frameworks: https://www.npmjs.com/browse/keyword/karma-adapter + frameworks: ['karma-typescript', 'tap'], + + // list of files / patterns to load in the browser + files: ['./src/**/*.ts', './tests/**/*.ts'], + + // list of files / patterns to exclude + exclude: [], + + // preprocess matching files before serving them to the browser + // available preprocessors: https://www.npmjs.com/browse/keyword/karma-preprocessor + preprocessors: { + '**/*.ts': ['karma-typescript'], + }, + + karmaTypescriptConfig: { + tsconfig: './tsconfig.json', + bundlerOptions: { + entrypoints: /\.spec\.ts$/, + acornOptions: { + ecmaVersion: 11 + } + }, + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://www.npmjs.com/browse/keyword/karma-reporter + reporters: ['progress'], + + // web server port + port: 9876, + + // enable / disable colors in the output (reporters and logs) + colors: true, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, + + // start these browsers + // available browser launchers: https://www.npmjs.com/browse/keyword/karma-launcher + browsers: ['FirefoxHeadless', 'ChromeHeadless'], + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: true, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: 1, + + // Fail after timeout + browserDisconnectTimeout: 100000, + browserNoActivityTimeout: 100000, + }) +} diff --git a/packages/statemanager/package.json b/packages/statemanager/package.json new file mode 100644 index 00000000000..56831ffb72e --- /dev/null +++ b/packages/statemanager/package.json @@ -0,0 +1,70 @@ +{ + "name": "@ethereumjs/statemanager", + "version": "1.0.0", + "description": "An Ethereum statemanager implementation", + "license": "MPL-2.0", + "author": "EthereumJS Team", + "keywords": [ + "ethereum", + "statemanager" + ], + "files": [ + "dist", + "dist.browser", + "src" + ], + "main": "dist/index.js", + "types": "dist/index.d.ts", + "browser": "dist.browser/index.js", + "scripts": { + "build": "npm run build:node && npm run build:browser", + "build:node": "../../config/cli/ts-build.sh node", + "build:browser": "../../config/cli/ts-build.sh browser", + "prepublishOnly": "../../config/cli/prepublish.sh && npm run test:node", + "clean": "../../config/cli/clean-package.sh", + "coverage": "../../config/cli/coverage.sh", + "docs:build": "typedoc --options typedoc.js", + "tsc": "../../config/cli/ts-compile.sh", + "lint": "../../config/cli/lint.sh", + "lint:fix": "../../config/cli/lint-fix.sh", + "tape": "tape -r ts-node/register", + "test": "npm run test:node && npm run test:browser", + "test:node": "npm run tape -- tests/*.spec.ts", + "test:browser": "karma start karma.conf.js" + }, + "dependencies": { + "@ethereumjs/common": "^2.6.3", + "merkle-patricia-tree": "^4.2.4", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.4", + "functional-red-black-tree": "^1.0.1" + }, + "devDependencies": { + "@types/node": "^16.11.7", + "@types/tape": "^4.13.2", + "eslint": "^6.8.0", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-tap": "^4.2.0", + "karma-typescript": "^5.5.3", + "nyc": "^15.1.0", + "prettier": "^2.0.5", + "standard": "^10.0.0", + "tape": "^5.3.1", + "ts-node": "^10.2.1", + "typedoc": "^0.22.4", + "typescript": "^4.4.2" + }, + "contributors": [ + "g11tech " + ], + "repository": { + "type": "git", + "url": "https://github.com/ethereumjs/ethereumjs-monorepo.git" + }, + "homepage": "https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/statemanager#readme", + "bugs": { + "url": "https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aissue+label%3A%22package%3A+statemanager%22" + } +} diff --git a/packages/statemanager/prettier.config.js b/packages/statemanager/prettier.config.js new file mode 100644 index 00000000000..c9d6eaa3df1 --- /dev/null +++ b/packages/statemanager/prettier.config.js @@ -0,0 +1 @@ +module.exports = require("../../config/prettier.config") \ No newline at end of file diff --git a/packages/statemanager/src/baseStateManager.ts b/packages/statemanager/src/baseStateManager.ts new file mode 100644 index 00000000000..3aeec8d5ea5 --- /dev/null +++ b/packages/statemanager/src/baseStateManager.ts @@ -0,0 +1,151 @@ +import Common, { Chain, Hardfork } from '@ethereumjs/common' +import { debug as createDebugLogger, Debugger } from 'debug' +import { Account, Address } from 'ethereumjs-util' +import Cache from './cache' +import { AccountFields } from './interface' +import { DefaultStateManagerOpts } from './stateManager' + +/** + * Abstract BaseStateManager class for the non-storage-backend + * related functionality parts of a StateManager like keeping + * track of accessed storage (`EIP-2929`) or touched accounts + * (`EIP-158`). + * + * This is not a full StateManager implementation in itself but + * can be used to ease implementing an own StateManager. + * + * Note that the implementation is pretty new (October 2021) + * and we cannot guarantee a stable interface yet. + */ +export abstract class BaseStateManager { + _common: Common + _debug: Debugger + _cache!: Cache + + /** + * StateManager is run in DEBUG mode (default: false) + * Taken from DEBUG environment variable + * + * Safeguards on debug() calls are added for + * performance reasons to avoid string literal evaluation + * @hidden + */ + protected readonly DEBUG: boolean = false + + /** + * Needs to be called from the subclass constructor + */ + constructor(opts: DefaultStateManagerOpts) { + let common = opts.common + if (!common) { + common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) + } + this._common = common + + // Safeguard if "process" is not available (browser) + if (process !== undefined && process.env.DEBUG) { + this.DEBUG = true + } + this._debug = createDebugLogger('statemanager:statemanager') + } + + /** + * Gets the account associated with `address`. Returns an empty account if the account does not exist. + * @param address - Address of the `account` to get + */ + async getAccount(address: Address): Promise { + const account = await this._cache.getOrLoad(address) + return account + } + + /** + * Saves an account into state under the provided `address`. + * @param address - Address under which to store `account` + * @param account - The account to store + */ + async putAccount(address: Address, account: Account): Promise { + if (this.DEBUG) { + this._debug( + `Save account address=${address} nonce=${account.nonce} balance=${ + account.balance + } contract=${account.isContract() ? 'yes' : 'no'} empty=${account.isEmpty() ? 'yes' : 'no'}` + ) + } + this._cache.put(address, account) + } + + /** + * Gets the account associated with `address`, modifies the given account + * fields, then saves the account into state. Account fields can include + * `nonce`, `balance`, `stateRoot`, and `codeHash`. + * @param address - Address of the account to modify + * @param accountFields - Object containing account fields and values to modify + */ + async modifyAccountFields(address: Address, accountFields: AccountFields): Promise { + const account = await this.getAccount(address) + account.nonce = accountFields.nonce ?? account.nonce + account.balance = accountFields.balance ?? account.balance + account.stateRoot = accountFields.stateRoot ?? account.stateRoot + account.codeHash = accountFields.codeHash ?? account.codeHash + await this.putAccount(address, account) + } + + /** + * Deletes an account from state under the provided `address`. The account will also be removed from the state trie. + * @param address - Address of the account which should be deleted + */ + async deleteAccount(address: Address) { + if (this.DEBUG) { + this._debug(`Delete account ${address}`) + } + this._cache.del(address) + } + + async accountIsEmpty(address: Address): Promise { + const account = await this.getAccount(address) + return account.isEmpty() + } + + abstract putContractCode(address: Address, value: Buffer): Promise + abstract getContractStorage(address: Address, key: Buffer): Promise + abstract putContractStorage(address: Address, key: Buffer, value: Buffer): Promise + + /** + * Checkpoints the current state of the StateManager instance. + * State changes that follow can then be committed by calling + * `commit` or `reverted` by calling rollback. + * + * Partial implementation, called from the subclass. + */ + async checkpoint(): Promise { + this._cache.checkpoint() + } + + /** + * Commits the current change-set to the instance since the + * last call to checkpoint. + * + * Partial implementation, called from the subclass. + */ + async commit(): Promise { + // setup cache checkpointing + this._cache.commit() + } + + /** + * Reverts the current change-set to the instance since the + * last call to checkpoint. + * + * Partial implementation , called from the subclass. + */ + async revert(): Promise { + // setup cache checkpointing + this._cache.revert() + } + + async flush(): Promise { + await this._cache.flush() + } + + abstract hasGenesisState(): Promise +} diff --git a/packages/vm/src/state/cache.ts b/packages/statemanager/src/cache.ts similarity index 100% rename from packages/vm/src/state/cache.ts rename to packages/statemanager/src/cache.ts diff --git a/packages/statemanager/src/index.ts b/packages/statemanager/src/index.ts new file mode 100644 index 00000000000..129d4ebb353 --- /dev/null +++ b/packages/statemanager/src/index.ts @@ -0,0 +1,3 @@ +export { StateManager, AccountFields, StateAccess } from './interface' +export { BaseStateManager } from './baseStateManager' +export { default as DefaultStateManager, Proof } from './stateManager' diff --git a/packages/vm/src/state/interface.ts b/packages/statemanager/src/interface.ts similarity index 64% rename from packages/vm/src/state/interface.ts rename to packages/statemanager/src/interface.ts index 87db4474871..14d9670b0e3 100644 --- a/packages/vm/src/state/interface.ts +++ b/packages/statemanager/src/interface.ts @@ -1,5 +1,4 @@ import { Account, Address } from 'ethereumjs-util' -import { AccessList } from '@ethereumjs/tx' import { Proof } from './stateManager' /** @@ -11,17 +10,16 @@ export interface StorageDump { export type AccountFields = Partial> -export interface StateManager { - copy(): StateManager +export interface StateAccess { + accountExists(address: Address): Promise getAccount(address: Address): Promise putAccount(address: Address, account: Account): Promise + accountIsEmpty(address: Address): Promise deleteAccount(address: Address): Promise - touchAccount(address: Address): void modifyAccountFields(address: Address, accountFields: AccountFields): Promise putContractCode(address: Address, value: Buffer): Promise getContractCode(address: Address): Promise getContractStorage(address: Address, key: Buffer): Promise - getOriginalContractStorage(address: Address, key: Buffer): Promise putContractStorage(address: Address, key: Buffer, value: Buffer): Promise clearContractStorage(address: Address): Promise checkpoint(): Promise @@ -29,23 +27,13 @@ export interface StateManager { revert(): Promise getStateRoot(): Promise setStateRoot(stateRoot: Buffer): Promise - dumpStorage(address: Address): Promise - hasGenesisState(): Promise - generateCanonicalGenesis(): Promise - generateGenesis(initState: any): Promise - accountIsEmpty(address: Address): Promise - accountExists(address: Address): Promise - cleanupTouchedAccounts(): Promise - clearOriginalStorageCache(): void getProof?(address: Address, storageSlots: Buffer[]): Promise verifyProof?(proof: Proof): Promise } -export interface EIP2929StateManager extends StateManager { - addWarmedAddress(address: Buffer): void - isWarmedAddress(address: Buffer): boolean - addWarmedStorage(address: Buffer, slot: Buffer): void - isWarmedStorage(address: Buffer, slot: Buffer): boolean - clearWarmedAccounts(): void - generateAccessList?(addressesRemoved: Address[], addressesOnlyStorage: Address[]): AccessList +export interface StateManager extends StateAccess { + copy(): StateManager + flush(): Promise + dumpStorage(address: Address): Promise + hasGenesisState(): Promise } diff --git a/packages/vm/src/state/stateManager.ts b/packages/statemanager/src/stateManager.ts similarity index 98% rename from packages/vm/src/state/stateManager.ts rename to packages/statemanager/src/stateManager.ts index 388e1fbfd83..aca8eecfb68 100644 --- a/packages/vm/src/state/stateManager.ts +++ b/packages/statemanager/src/stateManager.ts @@ -12,12 +12,12 @@ import { bigIntToHex, KECCAK256_RLP, setLengthLeft, + short, } from 'ethereumjs-util' import Common from '@ethereumjs/common' import { StateManager, StorageDump } from './interface' import Cache, { getCb, putCb } from './cache' import { BaseStateManager } from './' -import { short } from '../evm/opcodes' type StorageProof = { key: PrefixedHexString @@ -227,7 +227,6 @@ export default class DefaultStateManager extends BaseStateManager implements Sta contract.stateRoot = storageTrie.root await this.putAccount(address, contract) - this.touchAccount(address) resolve() }) }) @@ -439,10 +438,6 @@ export default class DefaultStateManager extends BaseStateManager implements Sta * @param stateRoot - The state-root to reset the instance to */ async setStateRoot(stateRoot: Buffer): Promise { - if (this._checkpointCount !== 0) { - throw new Error('Cannot set state root with uncommitted checkpoints') - } - await this._cache.flush() if (!stateRoot.equals(this._trie.EMPTY_TRIE_ROOT)) { diff --git a/packages/vm/tests/api/state/cache.spec.ts b/packages/statemanager/tests/cache.spec.ts similarity index 97% rename from packages/vm/tests/api/state/cache.spec.ts rename to packages/statemanager/tests/cache.spec.ts index 4cc31bff880..b13815518ee 100644 --- a/packages/vm/tests/api/state/cache.spec.ts +++ b/packages/statemanager/tests/cache.spec.ts @@ -1,8 +1,8 @@ import tape from 'tape' import { SecureTrie as Trie } from 'merkle-patricia-tree' import { Account, Address } from 'ethereumjs-util' -import Cache, { getCb, putCb } from '../../../src/state/cache' -import { createAccount } from '../utils' +import Cache, { getCb, putCb } from '../src/cache' +import { createAccount } from './util' tape('cache initialization', (t) => { t.test('should initialize', async (st) => { diff --git a/packages/vm/tests/api/state/proofStateManager.spec.ts b/packages/statemanager/tests/proofStateManager.spec.ts similarity index 99% rename from packages/vm/tests/api/state/proofStateManager.spec.ts rename to packages/statemanager/tests/proofStateManager.spec.ts index 42cfa7d1350..f2d9c2f7298 100644 --- a/packages/vm/tests/api/state/proofStateManager.spec.ts +++ b/packages/statemanager/tests/proofStateManager.spec.ts @@ -1,7 +1,7 @@ import tape from 'tape' import { Address, keccak256, toBuffer, zeros } from 'ethereumjs-util' import { SecureTrie } from 'merkle-patricia-tree' -import { DefaultStateManager } from '../../../src/state' +import { DefaultStateManager } from '../src' import ropsten_validAccount from './testdata/ropsten_validAccount.json' import ropsten_nonexistentAccount from './testdata/ropsten_nonexistentAccount.json' import ropsten_contractWithStorage from './testdata/ropsten_contractWithStorage.json' @@ -25,6 +25,7 @@ tape('ProofStateManager', (t) => { account.nonce = BigInt(2) await stateManager.putAccount(address2, account2) await stateManager.commit() + await stateManager.flush() const proof = await stateManager.getProof(address, [key]) st.ok(await stateManager.verifyProof(proof)) diff --git a/packages/vm/tests/api/state/stateManager.spec.ts b/packages/statemanager/tests/stateManager.spec.ts similarity index 55% rename from packages/vm/tests/api/state/stateManager.spec.ts rename to packages/statemanager/tests/stateManager.spec.ts index 4733929b068..3b80ab27039 100644 --- a/packages/vm/tests/api/state/stateManager.spec.ts +++ b/packages/statemanager/tests/stateManager.spec.ts @@ -10,12 +10,11 @@ import { zeros, } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { DefaultStateManager } from '../../../src/state' -import { getSingleFile } from '../../tester/testLoader' -import { isRunningInKarma } from '../../util' -import { createAccount } from '../utils' +import { DefaultStateManager } from '../src' +import { createAccount } from './util' -const StateManager = DefaultStateManager +// explicitly import `inherits` to fix karma-typescript issue +import { inherits } from 'util' // eslint-disable-line tape('StateManager', (t) => { t.test('should instantiate', async (st) => { @@ -38,6 +37,7 @@ tape('StateManager', (t) => { await stateManager.checkpoint() await stateManager.putAccount(address, account) await stateManager.commit() + await stateManager.flush() st.ok(!stateManager._trie.root.equals(KECCAK256_RLP), 'it has a new root') // set state root to empty trie root @@ -245,65 +245,6 @@ tape('StateManager', (t) => { } ) - t.test( - 'should generate the genesis state root correctly for mainnet from ethereum/tests data', - async (st) => { - if (isRunningInKarma()) { - st.skip('skip slow test when running in karma') - return st.end() - } - const genesisData = getSingleFile('BasicTests/genesishashestest.json') - - const stateManager = new StateManager() - await stateManager.generateCanonicalGenesis() - const stateRoot = await stateManager.getStateRoot() - st.equal( - stateRoot.toString('hex'), - genesisData.genesis_state_root, - 'generateCanonicalGenesis should produce correct state root for mainnet from ethereum/tests data' - ) - st.end() - } - ) - - t.test('should generate the genesis state root correctly for mainnet from common', async (st) => { - if (isRunningInKarma()) { - st.skip('skip slow test when running in karma') - return st.end() - } - const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) - const expectedStateRoot = Buffer.from(common.genesis().stateRoot.slice(2), 'hex') - const stateManager = new StateManager({ common: common }) - - await stateManager.generateCanonicalGenesis() - const stateRoot = await stateManager.getStateRoot() - - st.true( - stateRoot.equals(expectedStateRoot), - `generateCanonicalGenesis should produce correct state root for mainnet from common` - ) - st.end() - }) - - t.test('should generate the genesis state root correctly for all other chains', async (st) => { - const chains = [Chain.Ropsten, Chain.Rinkeby, Chain.Kovan, Chain.Goerli] - - for (const chain of chains) { - const common = new Common({ chain: chain, hardfork: Hardfork.Petersburg }) - const expectedStateRoot = Buffer.from(common.genesis().stateRoot.slice(2), 'hex') - const stateManager = new DefaultStateManager({ common: common }) - - await stateManager.generateCanonicalGenesis() - const stateRoot = await stateManager.getStateRoot() - - st.true( - stateRoot.equals(expectedStateRoot), - `generateCanonicalGenesis should produce correct state root for ${chain}` - ) - } - st.end() - }) - t.test('should dump storage', async (st) => { const stateManager = new DefaultStateManager() const address = new Address(Buffer.from('a94f5374fce5edbc8e2a8697c15331677e6ebf0b', 'hex')) @@ -435,98 +376,6 @@ tape('StateManager', (t) => { }) }) -tape('Original storage cache', async (t) => { - const stateManager = new DefaultStateManager() - - const address = new Address(Buffer.from('a94f5374fce5edbc8e2a8697c15331677e6ebf0b', 'hex')) - const account = createAccount() - await stateManager.putAccount(address, account) - - const key = Buffer.from('1234567890123456789012345678901234567890123456789012345678901234', 'hex') - const value = Buffer.from('1234', 'hex') - - t.test('should initially have empty storage value', async (st) => { - await stateManager.checkpoint() - const res = await stateManager.getContractStorage(address, key) - st.deepEqual(res, Buffer.alloc(0)) - - const origRes = await stateManager.getOriginalContractStorage(address, key) - st.deepEqual(origRes, Buffer.alloc(0)) - - await stateManager.commit() - - st.end() - }) - - t.test('should set original storage value', async (st) => { - await stateManager.putContractStorage(address, key, value) - const res = await stateManager.getContractStorage(address, key) - st.deepEqual(res, value) - - st.end() - }) - - t.test('should get original storage value', async (st) => { - const res = await stateManager.getOriginalContractStorage(address, key) - st.deepEqual(res, value) - st.end() - }) - - t.test('should return correct original value after modification', async (st) => { - const newValue = Buffer.from('1235', 'hex') - await stateManager.putContractStorage(address, key, newValue) - const res = await stateManager.getContractStorage(address, key) - st.deepEqual(res, newValue) - - const origRes = await stateManager.getOriginalContractStorage(address, key) - st.deepEqual(origRes, value) - st.end() - }) - - t.test('should cache keys separately', async (st) => { - const key2 = Buffer.from( - '0000000000000000000000000000000000000000000000000000000000000012', - 'hex' - ) - const value2 = Buffer.from('12', 'hex') - const value3 = Buffer.from('123', 'hex') - await stateManager.putContractStorage(address, key2, value2) - - let res = await stateManager.getContractStorage(address, key2) - st.deepEqual(res, value2) - let origRes = await stateManager.getOriginalContractStorage(address, key2) - st.deepEqual(origRes, value2) - - await stateManager.putContractStorage(address, key2, value3) - - res = await stateManager.getContractStorage(address, key2) - st.deepEqual(res, value3) - origRes = await stateManager.getOriginalContractStorage(address, key2) - st.deepEqual(origRes, value2) - - // Check previous key - res = await stateManager.getContractStorage(address, key) - st.deepEqual(res, Buffer.from('1235', 'hex')) - origRes = await stateManager.getOriginalContractStorage(address, key) - st.deepEqual(origRes, value) - - st.end() - }) - - t.test("getOriginalContractStorage should validate the key's length", async (st) => { - try { - await stateManager.getOriginalContractStorage(address, Buffer.alloc(12)) - } catch (e: any) { - st.equal(e.message, 'Storage key must be 32 bytes long') - st.end() - return - } - - st.fail('Should have failed') - st.end() - }) -}) - tape('StateManager - Contract code', (tester) => { const it = tester.test it('should set and get code', async (t) => { @@ -658,321 +507,3 @@ tape('StateManager - Contract storage', (tester) => { t.end() }) }) - -tape('StateManager - generateAccessList', (tester) => { - const it = tester.test - - // Only use 0..9 - function a(n: number) { - return Buffer.from(`ff${'00'.repeat(18)}0${n}`, 'hex') - } - - // Only use 0..9 - function s(n: number) { - return Buffer.from(`${'00'.repeat(31)}0${n}`, 'hex') - } - - function getStateManagerAliases() { - const stateManager = new DefaultStateManager() - const addA = stateManager.addWarmedAddress.bind(stateManager) - const addS = stateManager.addWarmedStorage.bind(stateManager) - const gen = stateManager.generateAccessList.bind(stateManager) - const sm = stateManager - return { addA, addS, gen, sm } - } - - it('one frame, simple', async (t) => { - const { addA, addS, gen } = getStateManagerAliases() - addA(a(1)) - addS(a(1), s(1)) - const json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - ] - t.deepEqual(gen(), json) - t.end() - }) - - it('one frame, unsorted slots', async (t) => { - const { addA, addS, gen } = getStateManagerAliases() - addA(a(1)) - addS(a(1), s(2)) - addS(a(1), s(1)) - const json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: [ - '0x0000000000000000000000000000000000000000000000000000000000000001', - '0x0000000000000000000000000000000000000000000000000000000000000002', - ], - }, - ] - t.deepEqual(gen(), json) - t.end() - }) - - it('one frame, unsorted addresses', async (t) => { - const { addA, addS, gen } = getStateManagerAliases() - addA(a(2)) - addS(a(2), s(1)) - addA(a(1)) - addS(a(1), s(1)) - const json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - { - address: '0xff00000000000000000000000000000000000002', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - ] - t.deepEqual(gen(), json) - t.end() - }) - - it('one frame, more complex', async (t) => { - const { addA, addS, gen } = getStateManagerAliases() - addA(a(1)) - addS(a(1), s(1)) - addA(a(2)) - addA(a(3)) - addS(a(3), s(1)) - addS(a(3), s(2)) - let json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - { - address: '0xff00000000000000000000000000000000000002', - storageKeys: [], - }, - { - address: '0xff00000000000000000000000000000000000003', - storageKeys: [ - '0x0000000000000000000000000000000000000000000000000000000000000001', - '0x0000000000000000000000000000000000000000000000000000000000000002', - ], - }, - ] - t.deepEqual(gen(), json) - - json = [ - { - address: '0xff00000000000000000000000000000000000002', - storageKeys: [], - }, - { - address: '0xff00000000000000000000000000000000000003', - storageKeys: [ - '0x0000000000000000000000000000000000000000000000000000000000000001', - '0x0000000000000000000000000000000000000000000000000000000000000002', - ], - }, - ] - const aRemoved = new Address(a(1)) - t.deepEqual(gen([aRemoved]), json, 'address removed') - - json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - { - address: '0xff00000000000000000000000000000000000002', - storageKeys: [], - }, - { - address: '0xff00000000000000000000000000000000000003', - storageKeys: [ - '0x0000000000000000000000000000000000000000000000000000000000000001', - '0x0000000000000000000000000000000000000000000000000000000000000002', - ], - }, - ] - const aOnlyStorageKept = new Address(a(3)) - t.deepEqual(gen([], [aOnlyStorageKept]), json, 'addressesOnlyStorage, kept') - - json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - { - address: '0xff00000000000000000000000000000000000003', - storageKeys: [ - '0x0000000000000000000000000000000000000000000000000000000000000001', - '0x0000000000000000000000000000000000000000000000000000000000000002', - ], - }, - ] - const aOnlyStorageRemoved = new Address(a(2)) - t.deepEqual(gen([], [aOnlyStorageRemoved]), json, 'addressesOnlyStorage, removed') - t.end() - }) - - it('two frames, simple', async (t) => { - const { addA, addS, gen, sm } = getStateManagerAliases() - addA(a(1)) - addS(a(1), s(1)) - await sm.checkpoint() - addA(a(2)) - addA(a(3)) - addS(a(3), s(1)) - addS(a(3), s(2)) - const json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - { - address: '0xff00000000000000000000000000000000000002', - storageKeys: [], - }, - { - address: '0xff00000000000000000000000000000000000003', - storageKeys: [ - '0x0000000000000000000000000000000000000000000000000000000000000001', - '0x0000000000000000000000000000000000000000000000000000000000000002', - ], - }, - ] - t.deepEqual(gen(), json) - t.end() - }) - - it('two frames, same address with different storage slots', async (t) => { - const { addA, addS, gen, sm } = getStateManagerAliases() - addA(a(1)) - addS(a(1), s(1)) - await sm.checkpoint() - addA(a(1)) - addS(a(1), s(2)) - const json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: [ - '0x0000000000000000000000000000000000000000000000000000000000000001', - '0x0000000000000000000000000000000000000000000000000000000000000002', - ], - }, - ] - t.deepEqual(gen(), json) - t.end() - }) - - it('two frames, same address with same storage slots', async (t) => { - const { addA, addS, gen, sm } = getStateManagerAliases() - addA(a(1)) - addS(a(1), s(1)) - await sm.checkpoint() - addA(a(1)) - addS(a(1), s(1)) - const json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - ] - t.deepEqual(gen(), json) - t.end() - }) - - it('three frames, no accesses on level two', async (t) => { - const { addA, addS, gen, sm } = getStateManagerAliases() - addA(a(1)) - addS(a(1), s(1)) - await sm.checkpoint() - await sm.checkpoint() - addA(a(2)) - addS(a(2), s(2)) - const json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - { - address: '0xff00000000000000000000000000000000000002', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000002'], - }, - ] - t.deepEqual(gen(), json) - t.end() - }) - - it('one frame, one revert frame', async (t) => { - const { addA, addS, gen, sm } = getStateManagerAliases() - await sm.checkpoint() - addA(a(1)) - addS(a(1), s(1)) - await sm.revert() - addA(a(2)) - addS(a(2), s(2)) - const json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - { - address: '0xff00000000000000000000000000000000000002', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000002'], - }, - ] - t.deepEqual(gen(), json) - t.end() - }) - - it('one frame, one revert frame, same address, different slots', async (t) => { - const { addA, addS, gen, sm } = getStateManagerAliases() - await sm.checkpoint() - addA(a(1)) - addS(a(1), s(1)) - await sm.revert() - addA(a(1)) - addS(a(1), s(2)) - const json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: [ - '0x0000000000000000000000000000000000000000000000000000000000000001', - '0x0000000000000000000000000000000000000000000000000000000000000002', - ], - }, - ] - t.deepEqual(gen(), json) - t.end() - }) - - it('one frame, two revert frames', async (t) => { - const { addA, addS, gen, sm } = getStateManagerAliases() - await sm.checkpoint() - await sm.checkpoint() - addA(a(1)) - addS(a(1), s(1)) - await sm.revert() - addA(a(2)) - addS(a(2), s(1)) - await sm.revert() - addA(a(3)) - addS(a(3), s(1)) - const json = [ - { - address: '0xff00000000000000000000000000000000000001', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - { - address: '0xff00000000000000000000000000000000000002', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - { - address: '0xff00000000000000000000000000000000000003', - storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], - }, - ] - t.deepEqual(gen(), json) - t.end() - }) -}) diff --git a/packages/vm/tests/api/state/testdata/ropsten_contractWithStorage.json b/packages/statemanager/tests/testdata/ropsten_contractWithStorage.json similarity index 100% rename from packages/vm/tests/api/state/testdata/ropsten_contractWithStorage.json rename to packages/statemanager/tests/testdata/ropsten_contractWithStorage.json diff --git a/packages/vm/tests/api/state/testdata/ropsten_nonexistentAccount.json b/packages/statemanager/tests/testdata/ropsten_nonexistentAccount.json similarity index 100% rename from packages/vm/tests/api/state/testdata/ropsten_nonexistentAccount.json rename to packages/statemanager/tests/testdata/ropsten_nonexistentAccount.json diff --git a/packages/vm/tests/api/state/testdata/ropsten_validAccount.json b/packages/statemanager/tests/testdata/ropsten_validAccount.json similarity index 100% rename from packages/vm/tests/api/state/testdata/ropsten_validAccount.json rename to packages/statemanager/tests/testdata/ropsten_validAccount.json diff --git a/packages/statemanager/tests/util.ts b/packages/statemanager/tests/util.ts new file mode 100644 index 00000000000..302e834fc96 --- /dev/null +++ b/packages/statemanager/tests/util.ts @@ -0,0 +1,5 @@ +import { Account } from 'ethereumjs-util' + +export function createAccount(nonce = BigInt(0), balance = BigInt(0xfff384)) { + return new Account(nonce, balance) +} diff --git a/packages/statemanager/tsconfig.browser.json b/packages/statemanager/tsconfig.browser.json new file mode 100644 index 00000000000..2db1cc17866 --- /dev/null +++ b/packages/statemanager/tsconfig.browser.json @@ -0,0 +1,7 @@ +{ + "extends": "../../config/tsconfig.browser.json", + "include": ["src/**/*.ts", "src/**/*.json"], + "compilerOptions": { + "outDir": "./dist.browser", + } +} diff --git a/packages/statemanager/tsconfig.json b/packages/statemanager/tsconfig.json new file mode 100644 index 00000000000..e3bfabfbc49 --- /dev/null +++ b/packages/statemanager/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../config/tsconfig.json", + "include": ["src/**/*.ts", "src/**/*.json", "tests/**/*.ts"], +} \ No newline at end of file diff --git a/packages/statemanager/tsconfig.prod.json b/packages/statemanager/tsconfig.prod.json new file mode 100644 index 00000000000..fa930389ae6 --- /dev/null +++ b/packages/statemanager/tsconfig.prod.json @@ -0,0 +1,14 @@ +{ + "extends": "../../config/tsconfig.prod.json", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./dist", + "composite": true, + }, + "include": ["src/**/*.ts"], + "references": [ + { "path": "../common/tsconfig.prod.json" }, + { "path": "../trie/tsconfig.prod.json" }, + { "path": "../util/tsconfig.prod.json" } + ], +} diff --git a/packages/statemanager/typedoc.js b/packages/statemanager/typedoc.js new file mode 100644 index 00000000000..a0faf20dcae --- /dev/null +++ b/packages/statemanager/typedoc.js @@ -0,0 +1,8 @@ +module.exports = { + extends: '../../config/typedoc.js', + entryPoints: ['src'], + out: 'docs', + exclude: [ + 'tests/**/*.ts', + ], +} \ No newline at end of file diff --git a/packages/util/src/bytes.ts b/packages/util/src/bytes.ts index 3b7594b3285..db237ce9a0a 100644 --- a/packages/util/src/bytes.ts +++ b/packages/util/src/bytes.ts @@ -262,6 +262,22 @@ export const addHexPrefix = function (str: string): string { return isHexPrefixed(str) ? str : '0x' + str } +/** + * Shortens a string or buffer's hex string representation to maxLength (default 50). + * + * Examples: + * + * Input: '657468657265756d000000000000000000000000000000000000000000000000' + * Output: '657468657265756d0000000000000000000000000000000000…' + */ +export function short(buffer: Buffer | string, maxLength: number = 50): string { + const bufferStr = Buffer.isBuffer(buffer) ? buffer.toString('hex') : buffer + if (bufferStr.length <= maxLength) { + return bufferStr + } + return bufferStr.slice(0, maxLength) + '…' +} + /** * Returns the utf8 string representation from a hex string. * diff --git a/packages/util/test/bytes.spec.ts b/packages/util/test/bytes.spec.ts index 6ba432cca40..ff6cb898c96 100644 --- a/packages/util/test/bytes.spec.ts +++ b/packages/util/test/bytes.spec.ts @@ -17,6 +17,7 @@ import { toUnsigned, toUtf8, addHexPrefix, + short, toBuffer, baToJSON, intToBuffer, @@ -229,6 +230,24 @@ tape('hex prefix', function (t) { }) }) +tape('short', function (t) { + const string = '657468657265756d000000000000000000000000000000000000000000000000' + const shortened = '657468657265756d0000000000000000000000000000000000…' + const shortenedToTen = '6574686572…' + t.test('should short string', function (st) { + st.equal(short(string), shortened) + st.end() + }) + t.test('should short buffer', function (st) { + st.equal(short(Buffer.from(string, 'hex')), shortened) + st.end() + }) + t.test('should short buffer to 10 chars', function (st) { + st.equal(short(Buffer.from(string, 'hex'), 10), shortenedToTen) + st.end() + }) +}) + tape('toUtf8', function (t) { t.test('toUtf8', (st) => { let input = Buffer.from('hello').toString('hex') // '68656c6c6f' diff --git a/packages/vm/README.md b/packages/vm/README.md index 2ead52ecd29..63120edb51c 100644 --- a/packages/vm/README.md +++ b/packages/vm/README.md @@ -63,11 +63,9 @@ All of the examples have their own `README.md` explaining how to run them. For documentation on `VM` instantiation, exposed API and emitted `events` see generated [API docs](./docs/README.md). -## StateManager +## VmState -Documentation on the `StateManager` can be found [here](./docs/classes/_state_statemanager_.defaultstatemanager.md). If you want to provide your own `StateManager` you can implement the dedicated [interface](./docs/interfaces/_state_interface_.statemanager.md) to ensure that your implementation conforms with the current API. - -Note: along the `EIP-2929` (Gas cost increases for state access opcodes) implementation released in `v5.2.0` a new `EIP2929StateManager` interface has been introduced inheriting from the base `StateManager` interface. The methods introduced there will be merged into the base state manager on the next breaking release. +The VmState is the wrapper class that manages the context around the underlying state while executing the VM like `EIP-2929`(Gas cost increases for state access opcodes). A Custom implementation of the `StateManager` can be plugged in the VmState # BROWSER diff --git a/packages/vm/benchmarks/util.ts b/packages/vm/benchmarks/util.ts index 8c549aa6bd3..53094b7769d 100644 --- a/packages/vm/benchmarks/util.ts +++ b/packages/vm/benchmarks/util.ts @@ -1,7 +1,7 @@ import { Account, Address, toBuffer } from 'ethereumjs-util' import Common from '@ethereumjs/common' import { Block } from '@ethereumjs/block' -import { StateManager, DefaultStateManager } from '../dist/state' +import { StateManager, DefaultStateManager } from '@ethereumjs/statemanager' import { RunBlockResult } from '../dist/runBlock' import Mockchain from './mockchain' diff --git a/packages/vm/package.json b/packages/vm/package.json index c5f07a9df48..dd39c505abc 100644 --- a/packages/vm/package.json +++ b/packages/vm/package.json @@ -50,6 +50,7 @@ "@ethereumjs/block": "^3.6.2", "@ethereumjs/blockchain": "^5.5.2", "@ethereumjs/common": "^2.6.4", + "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", "merkle-patricia-tree": "^4.2.4", "async-eventemitter": "^0.2.4", diff --git a/packages/vm/src/buildBlock.ts b/packages/vm/src/buildBlock.ts index 599cd8f8328..025c4be4240 100644 --- a/packages/vm/src/buildBlock.ts +++ b/packages/vm/src/buildBlock.ts @@ -154,7 +154,7 @@ export class BlockBuilder { const coinbase = this.headerData.coinbase ? new Address(toBuffer(this.headerData.coinbase)) : Address.zero() - await rewardAccount(this.vm.stateManager, coinbase, reward) + await rewardAccount(this.vm.vmState, coinbase, reward) } /** diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index dc28371213c..e525bac40f5 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -3,7 +3,8 @@ import { Account, Address, MAX_UINT64, bufferToBigInt } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { ConsensusAlgorithm } from '@ethereumjs/common' -import { StateManager } from '../state/index' + +import { VmState } from '../vmState' import { VmError, ERROR } from '../exceptions' import Message from './message' import EVM, { EVMResult } from './evm' @@ -60,7 +61,7 @@ export interface RunResult { export default class EEI { _env: Env _result: RunResult - _state: StateManager + _state: VmState _evm: EVM _lastReturned: Buffer _common: Common @@ -69,7 +70,7 @@ export default class EEI { constructor( env: Env, - state: StateManager, + state: VmState, evm: EVM, common: Common, gasLeft: bigint, diff --git a/packages/vm/src/evm/evm.ts b/packages/vm/src/evm/evm.ts index 64c9a58bccf..fa730bb880c 100644 --- a/packages/vm/src/evm/evm.ts +++ b/packages/vm/src/evm/evm.ts @@ -7,17 +7,18 @@ import { generateAddress2, KECCAK256_NULL, MAX_INTEGER, + short, } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import { Hardfork } from '@ethereumjs/common' + import { ERROR, VmError } from '../exceptions' -import { StateManager } from '../state/index' +import { VmState } from '../vmState' import { PrecompileFunc } from './precompiles' import TxContext from './txContext' import Message from './message' import EEI from './eei' // eslint-disable-next-line -import { short } from './opcodes/util' import * as eof from './opcodes/eof' import { Log } from './types' import { default as Interpreter, InterpreterOpts, RunState } from './interpreter' @@ -130,7 +131,7 @@ export function VmErrorResult(error: VmError, gasUsed: bigint): ExecResult { */ export default class EVM { _vm: VM - _state: StateManager + _state: VmState _tx: TxContext _block: Block /** @@ -141,7 +142,7 @@ export default class EVM { constructor(vm: VM, txContext: TxContext, block: Block) { this._vm = vm - this._state = this._vm.stateManager + this._state = this._vm.vmState this._tx = txContext this._block = block this._refund = BigInt(0) diff --git a/packages/vm/src/evm/interpreter.ts b/packages/vm/src/evm/interpreter.ts index 5f93648625a..9819113651a 100644 --- a/packages/vm/src/evm/interpreter.ts +++ b/packages/vm/src/evm/interpreter.ts @@ -1,6 +1,7 @@ import { debug as createDebugLogger } from 'debug' import { Account, Address, bigIntToHex, intToHex } from 'ethereumjs-util' -import { StateManager } from '../state/index' +import { VmState } from '../vmState' + import { ERROR, VmError } from '../exceptions' import Memory from './memory' import Stack from './stack' @@ -23,7 +24,7 @@ export interface RunState { code: Buffer shouldDoJumpAnalysis: boolean validJumps: Uint8Array // array of values where validJumps[index] has value 0 (default), 1 (jumpdest), 2 (beginsub) - stateManager: StateManager + vmState: VmState eei: EEI messageGasLimit?: bigint // Cache value from `gas.ts` to save gas limit for a message call } @@ -36,7 +37,7 @@ export interface InterpreterResult { export interface InterpreterStep { gasLeft: bigint gasRefund: bigint - stateManager: StateManager + vmState: VmState stack: bigint[] returnStack: bigint[] pc: number @@ -59,7 +60,7 @@ export interface InterpreterStep { */ export default class Interpreter { _vm: any - _state: StateManager + _state: VmState _runState: RunState _eei: EEI @@ -68,7 +69,7 @@ export default class Interpreter { constructor(vm: any, eei: EEI) { this._vm = vm - this._state = vm.stateManager + this._state = vm.vmState this._eei = eei this._runState = { programCounter: 0, @@ -80,7 +81,7 @@ export default class Interpreter { returnStack: new Stack(1023), // 1023 return stack height limit per EIP 2315 spec code: Buffer.alloc(0), validJumps: Uint8Array.from([]), - stateManager: this._state, + vmState: this._state, eei: this._eei, shouldDoJumpAnalysis: true, } @@ -242,7 +243,7 @@ export default class Interpreter { depth: this._eei._env.depth, address: this._eei._env.address, account: this._eei._env.contract, - stateManager: this._runState.stateManager, + vmState: this._runState.vmState, memory: this._runState.memory._store, memoryWordCount: this._runState.memoryWordCount, codeAddress: this._eei._env.codeAddress, diff --git a/packages/vm/src/evm/opcodes/EIP2929.ts b/packages/vm/src/evm/opcodes/EIP2929.ts index 48f4bd08247..353dcbe7ca6 100644 --- a/packages/vm/src/evm/opcodes/EIP2929.ts +++ b/packages/vm/src/evm/opcodes/EIP2929.ts @@ -1,6 +1,5 @@ import Common from '@ethereumjs/common' import { Address } from 'ethereumjs-util' -import { EIP2929StateManager } from '../../state/interface' import { RunState } from './../interpreter' /** @@ -22,12 +21,12 @@ export function accessAddressEIP2929( ): bigint { if (!common.isActivatedEIP(2929)) return BigInt(0) - const stateManager = runState.stateManager as EIP2929StateManager + const vmState = runState.vmState const addressStr = address.buf // Cold - if (!stateManager.isWarmedAddress(addressStr)) { - stateManager.addWarmedAddress(addressStr) + if (!vmState.isWarmedAddress(addressStr)) { + vmState.addWarmedAddress(addressStr) // CREATE, CREATE2 opcodes have the address warmed for free. // selfdestruct beneficiary address reads are charged an *additional* cold access @@ -57,13 +56,13 @@ export function accessStorageEIP2929( ): bigint { if (!common.isActivatedEIP(2929)) return BigInt(0) - const stateManager = runState.stateManager as EIP2929StateManager + const vmState = runState.vmState const address = runState.eei.getAddress().buf - const slotIsCold = !stateManager.isWarmedStorage(address, key) + const slotIsCold = !vmState.isWarmedStorage(address, key) // Cold (SLOAD and SSTORE) if (slotIsCold) { - stateManager.addWarmedStorage(address, key) + vmState.addWarmedStorage(address, key) return BigInt(common.param('gasPrices', 'coldsload')) } else if (!isSstore) { return BigInt(common.param('gasPrices', 'warmstorageread')) @@ -90,12 +89,12 @@ export function adjustSstoreGasEIP2929( ): bigint { if (!common.isActivatedEIP(2929)) return defaultCost - const stateManager = runState.stateManager as EIP2929StateManager + const vmState = runState.vmState const address = runState.eei.getAddress().buf const warmRead = BigInt(common.param('gasPrices', 'warmstorageread')) const coldSload = BigInt(common.param('gasPrices', 'coldsload')) - if (stateManager.isWarmedStorage(address, key)) { + if (vmState.isWarmedStorage(address, key)) { switch (costName) { case 'noop': return warmRead diff --git a/packages/vm/src/evm/opcodes/gas.ts b/packages/vm/src/evm/opcodes/gas.ts index ed5fbb53f08..a73274d14c3 100644 --- a/packages/vm/src/evm/opcodes/gas.ts +++ b/packages/vm/src/evm/opcodes/gas.ts @@ -473,7 +473,7 @@ export const dynamicGasHandlers: Map BigInt(0)) { gas += BigInt(common.param('gasPrices', 'authcallValueTransfer')) - const account = await runState.stateManager.getAccount(toAddress) + const account = await runState.vmState.getAccount(toAddress) if (account.isEmpty()) { gas += BigInt(common.param('gasPrices', 'callNewAccount')) } @@ -555,7 +555,7 @@ export const dynamicGasHandlers: Map { - const state = this.stateManager + const state = this.vmState const { root } = opts let { block } = opts const generateFields = !!opts.generate @@ -379,7 +378,7 @@ async function assignBlockRewards(this: VM, block: Block): Promise { if (this.DEBUG) { debug(`Assign block rewards`) } - const state = this.stateManager + const state = this.vmState const minerReward = BigInt(this._common.param('pow', 'minerReward')) const ommers = block.uncleHeaders // Reward ommers @@ -420,7 +419,7 @@ export function calculateMinerReward(minerReward: bigint, ommersNum: number): bi } export async function rewardAccount( - state: StateManager, + state: VmState, address: Address, reward: bigint ): Promise { @@ -453,7 +452,7 @@ export function encodeReceipt(receipt: TxReceipt, txType: number) { /** * Apply the DAO fork changes to the VM */ -async function _applyDAOHardfork(state: StateManager) { +async function _applyDAOHardfork(state: VmState) { const DAORefundContractAddress = new Address(Buffer.from(DAORefundContract, 'hex')) if (!state.accountExists(DAORefundContractAddress)) { await state.putAccount(DAORefundContractAddress, new Account()) diff --git a/packages/vm/src/runBlockchain.ts b/packages/vm/src/runBlockchain.ts index cd8d9eb2adf..4a61a9d2670 100644 --- a/packages/vm/src/runBlockchain.ts +++ b/packages/vm/src/runBlockchain.ts @@ -26,7 +26,7 @@ export default async function runBlockchain( // generate genesis state if we are at the genesis block // we don't have the genesis state if (!headBlock) { - await this.stateManager.generateCanonicalGenesis() + await this.vmState.generateCanonicalGenesis() } else { parentState = headBlock.header.stateRoot } diff --git a/packages/vm/src/runTx.ts b/packages/vm/src/runTx.ts index d233d9f52eb..6b954a81651 100644 --- a/packages/vm/src/runTx.ts +++ b/packages/vm/src/runTx.ts @@ -1,5 +1,5 @@ import { debug as createDebugLogger } from 'debug' -import { Address, KECCAK256_NULL, toBuffer } from 'ethereumjs-util' +import { Address, KECCAK256_NULL, toBuffer, short } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' import { ConsensusType, Hardfork } from '@ethereumjs/common' import { @@ -14,10 +14,8 @@ import { import VM from './index' import Bloom from './bloom' import { default as EVM, EVMResult } from './evm/evm' -import { short } from './evm/opcodes/util' import Message from './evm/message' import TxContext from './evm/txContext' -import { EIP2929StateManager } from './state/interface' import type { TxReceipt, BaseTxReceipt, @@ -133,8 +131,7 @@ export default async function runTx(this: VM, opts: RunTxOpts): Promise { - // Have to cast as `EIP2929StateManager` to access the EIP2929 methods - const state = this.stateManager as EIP2929StateManager + const state = this.vmState const { tx, block } = opts diff --git a/packages/vm/src/state/index.ts b/packages/vm/src/state/index.ts index 5893f77e71e..7f3ffcc1a27 100644 --- a/packages/vm/src/state/index.ts +++ b/packages/vm/src/state/index.ts @@ -1,4 +1 @@ -export { StateManager, EIP2929StateManager } from './interface' -export { BaseStateManager } from './baseStateManager' -export { default as DefaultStateManager, Proof } from './stateManager' export { default as TransientStorage } from './transientStorage' diff --git a/packages/vm/src/state/baseStateManager.ts b/packages/vm/src/vmState.ts similarity index 80% rename from packages/vm/src/state/baseStateManager.ts rename to packages/vm/src/vmState.ts index c4900a9d8a7..75600bc4680 100644 --- a/packages/vm/src/state/baseStateManager.ts +++ b/packages/vm/src/vmState.ts @@ -1,35 +1,36 @@ -const Set = require('core-js-pure/es/set') import Common, { Chain, Hardfork } from '@ethereumjs/common' import { AccessList, AccessListItem } from '@ethereumjs/tx' -import { debug as createDebugLogger, Debugger } from 'debug' import { Account, Address, toBuffer } from 'ethereumjs-util' -import { ripemdPrecompileAddress } from '../evm/precompiles' -import Cache from './cache' -import { AccountFields } from './interface' -import { DefaultStateManagerOpts } from './stateManager' +const Set = require('core-js-pure/es/set') + +import { StateManager, StateAccess, AccountFields } from '@ethereumjs/statemanager' + +import { ripemdPrecompileAddress } from './evm/precompiles' +import { debug as createDebugLogger, Debugger } from 'debug' type AddressHex = string -/** - * Abstract BaseStateManager class for the non-storage-backend - * related functionality parts of a StateManager like keeping - * track of accessed storage (`EIP-2929`) or touched accounts - * (`EIP-158`). - * - * This is not a full StateManager implementation in itself but - * can be used to ease implementing an own StateManager. - * - * Note that the implementation is pretty new (October 2021) - * and we cannot guarantee a stable interface yet. - */ -export abstract class BaseStateManager { +interface VmStateAccess extends StateAccess { + touchAccount(address: Address): void + addWarmedAddress(address: Buffer): void + isWarmedAddress(address: Buffer): boolean + addWarmedStorage(address: Buffer, slot: Buffer): void + isWarmedStorage(address: Buffer, slot: Buffer): boolean + clearWarmedAccounts(): void + generateAccessList?(addressesRemoved: Address[], addressesOnlyStorage: Address[]): AccessList + getOriginalContractStorage(address: Address, key: Buffer): Promise + clearOriginalStorageCache(): void + cleanupTouchedAccounts(): Promise +} + +export class VmState implements VmStateAccess { _common: Common _debug: Debugger - _cache!: Cache + _checkpointCount: number + _stateManager: StateManager _touched: Set _touchedStack: Set[] - _originalStorageCache: Map> // EIP-2929 address/storage trackers. // This maps both the accessed accounts and the accessed storage slots. @@ -45,37 +46,20 @@ export abstract class BaseStateManager { // to also include on access list generation _accessedStorageReverted: Map>[] - _checkpointCount: number + _originalStorageCache: Map> - /** - * StateManager is run in DEBUG mode (default: false) - * Taken from DEBUG environment variable - * - * Safeguards on debug() calls are added for - * performance reasons to avoid string literal evaluation - * @hidden - */ protected readonly DEBUG: boolean = false - /** - * Needs to be called from the subclass constructor - */ - constructor(opts: DefaultStateManagerOpts) { - let common = opts.common - if (!common) { - common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) - } - this._common = common - + constructor({ common, stateManager }: { common?: Common; stateManager: StateManager }) { + this._checkpointCount = 0 + this._stateManager = stateManager + this._common = common ?? new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) this._touched = new Set() this._touchedStack = [] this._originalStorageCache = new Map() - this._accessedStorage = [new Map()] this._accessedStorageReverted = [new Map()] - this._checkpointCount = 0 - // Safeguard if "process" is not available (browser) if (process !== undefined && process.env.DEBUG) { this.DEBUG = true @@ -84,45 +68,94 @@ export abstract class BaseStateManager { } /** - * Gets the account associated with `address`. Returns an empty account if the account does not exist. - * @param address - Address of the `account` to get + * Checkpoints the current state of the StateManager instance. + * State changes that follow can then be committed by calling + * `commit` or `reverted` by calling rollback. + * + * Partial implementation, called from the subclass. */ - async getAccount(address: Address): Promise { - const account = await this._cache.getOrLoad(address) - return account + async checkpoint(): Promise { + this._touchedStack.push(new Set(Array.from(this._touched))) + this._accessedStorage.push(new Map()) + await this._stateManager.checkpoint() + this._checkpointCount++ + + if (this.DEBUG) { + this._debug('-'.repeat(100)) + this._debug(`message checkpoint`) + } + } + + async commit(): Promise { + // setup cache checkpointing + this._touchedStack.pop() + // Copy the contents of the map of the current level to a map higher. + const storageMap = this._accessedStorage.pop() + if (storageMap) { + this._accessedStorageMerge(this._accessedStorage, storageMap) + } + await this._stateManager.commit() + this._checkpointCount-- + + if (this._checkpointCount === 0) { + await this._stateManager.flush() + this._clearOriginalStorageCache() + } + + if (this.DEBUG) { + this._debug(`message checkpoint committed`) + } } /** - * Saves an account into state under the provided `address`. - * @param address - Address under which to store `account` - * @param account - The account to store + * Reverts the current change-set to the instance since the + * last call to checkpoint. + * + * Partial implementation , called from the subclass. */ - async putAccount(address: Address, account: Account): Promise { + async revert(): Promise { + // setup cache checkpointing + const lastItem = this._accessedStorage.pop() + if (lastItem) { + this._accessedStorageReverted.push(lastItem) + } + const touched = this._touchedStack.pop() + if (!touched) { + throw new Error('Reverting to invalid state checkpoint failed') + } + // Exceptional case due to consensus issue in Geth and Parity. + // See [EIP issue #716](https://github.com/ethereum/EIPs/issues/716) for context. + // The RIPEMD precompile has to remain *touched* even when the call reverts, + // and be considered for deletion. + if (this._touched.has(ripemdPrecompileAddress)) { + touched.add(ripemdPrecompileAddress) + } + this._touched = touched + await this._stateManager.revert() + + this._checkpointCount-- + + if (this._checkpointCount === 0) { + await this._stateManager.flush() + this._clearOriginalStorageCache() + } + if (this.DEBUG) { - this._debug( - `Save account address=${address} nonce=${account.nonce} balance=${ - account.balance - } contract=${account.isContract() ? 'yes' : 'no'} empty=${account.isEmpty() ? 'yes' : 'no'}` - ) + this._debug(`message checkpoint reverted`) } - this._cache.put(address, account) + } + + async getAccount(address: Address): Promise { + return await this._stateManager.getAccount(address) + } + + async putAccount(address: Address, account: Account): Promise { + await this._stateManager.putAccount(address, account) this.touchAccount(address) } - /** - * Gets the account associated with `address`, modifies the given account - * fields, then saves the account into state. Account fields can include - * `nonce`, `balance`, `stateRoot`, and `codeHash`. - * @param address - Address of the account to modify - * @param accountFields - Object containing account fields and values to modify - */ async modifyAccountFields(address: Address, accountFields: AccountFields): Promise { - const account = await this.getAccount(address) - account.nonce = accountFields.nonce ?? account.nonce - account.balance = accountFields.balance ?? account.balance - account.stateRoot = accountFields.stateRoot ?? account.stateRoot - account.codeHash = accountFields.codeHash ?? account.codeHash - await this.putAccount(address, account) + return this._stateManager.modifyAccountFields(address, accountFields) } /** @@ -130,91 +163,56 @@ export abstract class BaseStateManager { * @param address - Address of the account which should be deleted */ async deleteAccount(address: Address) { - if (this.DEBUG) { - this._debug(`Delete account ${address}`) - } - this._cache.del(address) + await this._stateManager.deleteAccount(address) this.touchAccount(address) } - /** - * Marks an account as touched, according to the definition - * in [EIP-158](https://eips.ethereum.org/EIPS/eip-158). - * This happens when the account is triggered for a state-changing - * event. Touched accounts that are empty will be cleared - * at the end of the tx. - */ - touchAccount(address: Address): void { - this._touched.add(address.buf.toString('hex')) + async getContractCode(address: Address): Promise { + return await this._stateManager.getContractCode(address) } - abstract putContractCode(address: Address, value: Buffer): Promise - - abstract getContractStorage(address: Address, key: Buffer): Promise - - abstract putContractStorage(address: Address, key: Buffer, value: Buffer): Promise + async putContractCode(address: Address, value: Buffer): Promise { + return await this._stateManager.putContractCode(address, value) + } - /** - * Caches the storage value associated with the provided `address` and `key` - * on first invocation, and returns the cached (original) value from then - * onwards. This is used to get the original value of a storage slot for - * computing gas costs according to EIP-1283. - * @param address - Address of the account to get the storage for - * @param key - Key in the account's storage to get the value for. Must be 32 bytes long. - */ - async getOriginalContractStorage(address: Address, key: Buffer): Promise { - if (key.length !== 32) { - throw new Error('Storage key must be 32 bytes long') - } + async getContractStorage(address: Address, key: Buffer): Promise { + return await this._stateManager.getContractStorage(address, key) + } - const addressHex = address.buf.toString('hex') - const keyHex = key.toString('hex') + async putContractStorage(address: Address, key: Buffer, value: Buffer) { + await this._stateManager.putContractStorage(address, key, value) + this.touchAccount(address) + } - let map: Map - if (!this._originalStorageCache.has(addressHex)) { - map = new Map() - this._originalStorageCache.set(addressHex, map) - } else { - map = this._originalStorageCache.get(addressHex)! - } + async clearContractStorage(address: Address) { + await this._stateManager.clearContractStorage(address) + this.touchAccount(address) + } - if (map.has(keyHex)) { - return map.get(keyHex)! - } else { - const current = await this.getContractStorage(address, key) - map.set(keyHex, current) - return current - } + async accountExists(address: Address): Promise { + return await this._stateManager.accountExists(address) } - /** - * Clears the original storage cache. Refer to {@link StateManager.getOriginalContractStorage} - * for more explanation. - */ - _clearOriginalStorageCache(): void { - this._originalStorageCache = new Map() + async setStateRoot(stateRoot: Buffer): Promise { + if (this._checkpointCount !== 0) { + throw new Error('Cannot set state root with uncommitted checkpoints') + } + return await this._stateManager.setStateRoot(stateRoot) } - /** - * Clears the original storage cache. Refer to {@link StateManager.getOriginalContractStorage} - * for more explanation. Alias of the internal {@link StateManager._clearOriginalStorageCache} - */ - clearOriginalStorageCache(): void { - this._clearOriginalStorageCache() + async getStateRoot(): Promise { + return await this._stateManager.getStateRoot() } /** - * Checkpoints the current state of the StateManager instance. - * State changes that follow can then be committed by calling - * `commit` or `reverted` by calling rollback. - * - * Partial implementation, called from the subclass. + * Marks an account as touched, according to the definition + * in [EIP-158](https://eips.ethereum.org/EIPS/eip-158). + * This happens when the account is triggered for a state-changing + * event. Touched accounts that are empty will be cleared + * at the end of the tx. */ - async checkpoint(): Promise { - this._cache.checkpoint() - this._touchedStack.push(new Set(Array.from(this._touched))) - this._accessedStorage.push(new Map()) - this._checkpointCount++ + touchAccount(address: Address): void { + this._touched.add(address.buf.toString('hex')) } /** @@ -241,65 +239,6 @@ export abstract class BaseStateManager { } } - /** - * Commits the current change-set to the instance since the - * last call to checkpoint. - * - * Partial implementation, called from the subclass. - */ - async commit(): Promise { - // setup cache checkpointing - this._cache.commit() - this._touchedStack.pop() - this._checkpointCount-- - - // Copy the contents of the map of the current level to a map higher. - const storageMap = this._accessedStorage.pop() - if (storageMap) { - this._accessedStorageMerge(this._accessedStorage, storageMap) - } - - if (this._checkpointCount === 0) { - await this._cache.flush() - this._clearOriginalStorageCache() - } - } - - /** - * Reverts the current change-set to the instance since the - * last call to checkpoint. - * - * Partial implementation , called from the subclass. - */ - async revert(): Promise { - // setup cache checkpointing - this._cache.revert() - const lastItem = this._accessedStorage.pop() - if (lastItem) { - this._accessedStorageReverted.push(lastItem) - } - const touched = this._touchedStack.pop() - if (!touched) { - throw new Error('Reverting to invalid state checkpoint failed') - } - // Exceptional case due to consensus issue in Geth and Parity. - // See [EIP issue #716](https://github.com/ethereum/EIPs/issues/716) for context. - // The RIPEMD precompile has to remain *touched* even when the call reverts, - // and be considered for deletion. - if (this._touched.has(ripemdPrecompileAddress)) { - touched.add(ripemdPrecompileAddress) - } - this._touched = touched - this._checkpointCount-- - - if (this._checkpointCount === 0) { - await this._cache.flush() - this._clearOriginalStorageCache() - } - } - - abstract hasGenesisState(): Promise - /** * Generates a canonical genesis state on the instance based on the * configured chain parameters. Will error if there are uncommitted @@ -310,7 +249,7 @@ export abstract class BaseStateManager { throw new Error('Cannot create genesis state with uncommitted checkpoints') } - const genesis = await this.hasGenesisState() + const genesis = await this._stateManager.hasGenesisState() if (!genesis) { await this.generateGenesis(this._common.genesisState()) } @@ -351,18 +290,7 @@ export abstract class BaseStateManager { } } } - await this._cache.flush() - } - - /** - * Checks if the `account` corresponding to `address` - * is empty or non-existent as defined in - * EIP-161 (https://eips.ethereum.org/EIPS/eip-161). - * @param address - Address to check - */ - async accountIsEmpty(address: Address): Promise { - const account = await this.getAccount(address) - return account.isEmpty() + await this._stateManager.flush() } /** @@ -370,13 +298,13 @@ export abstract class BaseStateManager { * as defined in EIP-161 (https://eips.ethereum.org/EIPS/eip-161). */ async cleanupTouchedAccounts(): Promise { - if (this._common.gteHardfork(Hardfork.SpuriousDragon)) { + if (this._common.gteHardfork('spuriousDragon')) { const touchedArray = Array.from(this._touched) for (const addressHex of touchedArray) { const address = new Address(Buffer.from(addressHex, 'hex')) const empty = await this.accountIsEmpty(address) if (empty) { - this._cache.del(address) + await this._stateManager.deleteAccount(address) if (this.DEBUG) { this._debug(`Cleanup touched account address=${address} (>= SpuriousDragon)`) } @@ -386,6 +314,55 @@ export abstract class BaseStateManager { this._touched.clear() } + /** + * Caches the storage value associated with the provided `address` and `key` + * on first invocation, and returns the cached (original) value from then + * onwards. This is used to get the original value of a storage slot for + * computing gas costs according to EIP-1283. + * @param address - Address of the account to get the storage for + * @param key - Key in the account's storage to get the value for. Must be 32 bytes long. + */ + async getOriginalContractStorage(address: Address, key: Buffer): Promise { + if (key.length !== 32) { + throw new Error('Storage key must be 32 bytes long') + } + + const addressHex = address.buf.toString('hex') + const keyHex = key.toString('hex') + + let map: Map + if (!this._originalStorageCache.has(addressHex)) { + map = new Map() + this._originalStorageCache.set(addressHex, map) + } else { + map = this._originalStorageCache.get(addressHex)! + } + + if (map.has(keyHex)) { + return map.get(keyHex)! + } else { + const current = await this.getContractStorage(address, key) + map.set(keyHex, current) + return current + } + } + + /** + * Clears the original storage cache. Refer to {@link StateManager.getOriginalContractStorage} + * for more explanation. + */ + _clearOriginalStorageCache(): void { + this._originalStorageCache = new Map() + } + + /** + * Clears the original storage cache. Refer to {@link StateManager.getOriginalContractStorage} + * for more explanation. Alias of the internal {@link StateManager._clearOriginalStorageCache} + */ + clearOriginalStorageCache(): void { + this._clearOriginalStorageCache() + } + /** EIP-2929 logic * This should only be called from within the EVM */ @@ -515,4 +492,14 @@ export abstract class BaseStateManager { return accessList } + + /** + * Checks if the `account` corresponding to `address` + * is empty or non-existent as defined in + * EIP-161 (https://eips.ethereum.org/EIPS/eip-161). + * @param address - Address to check + */ + async accountIsEmpty(address: Address): Promise { + return this._stateManager.accountIsEmpty(address) + } } diff --git a/packages/vm/tests/api/EIPs/eip-3529.spec.ts b/packages/vm/tests/api/EIPs/eip-3529.spec.ts index 1d9f78adf13..2e76dd51cfb 100644 --- a/packages/vm/tests/api/EIPs/eip-3529.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3529.spec.ts @@ -3,7 +3,6 @@ import { Address } from 'ethereumjs-util' import VM from '../../../src' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { InterpreterStep } from '../../../src/evm/interpreter' -import { EIP2929StateManager } from '../../../src/state/interface' import { Transaction } from '@ethereumjs/tx' const address = new Address(Buffer.from('11'.repeat(20), 'hex')) @@ -137,7 +136,7 @@ tape('EIP-3529 tests', (t) => { ) await vm.stateManager.getContractStorage(address, key) - ;(vm.stateManager).addWarmedStorage(address.toBuffer(), key) + vm.vmState.addWarmedStorage(address.toBuffer(), key) await vm.runCode({ code, @@ -152,7 +151,7 @@ tape('EIP-3529 tests', (t) => { st.equal(gasUsed, BigInt(testCase.usedGas), 'correct used gas') // clear the storage cache, otherwise next test will use current original value - vm.stateManager.clearOriginalStorageCache() + vm.vmState.clearOriginalStorageCache() } st.end() diff --git a/packages/vm/tests/api/buildBlock.spec.ts b/packages/vm/tests/api/buildBlock.spec.ts index 597c4a3f5a4..efe1204a9b2 100644 --- a/packages/vm/tests/api/buildBlock.spec.ts +++ b/packages/vm/tests/api/buildBlock.spec.ts @@ -89,7 +89,7 @@ tape('BlockBuilder', async (t) => { const address = Address.fromString('0xccfd725760a68823ff1e062f4cc97e1360e8d997') await setBalance(vm, address) - const root0 = await vm.stateManager.getStateRoot() + const root0 = await vm.vmState.getStateRoot() const blockBuilder = await vm.buildBlock({ parentBlock: genesisBlock }) @@ -104,11 +104,11 @@ tape('BlockBuilder', async (t) => { await blockBuilder.addTransaction(tx) - const root1 = await vm.stateManager.getStateRoot() + const root1 = await vm.vmState.getStateRoot() st.ok(!root0.equals(root1), 'state root should change after adding a tx') await blockBuilder.revert() - const root2 = await vm.stateManager.getStateRoot() + const root2 = await vm.vmState.getStateRoot() st.ok(root2.equals(root0), 'state root should revert to before the tx was run') st.end() @@ -176,7 +176,7 @@ tape('BlockBuilder', async (t) => { const vm = await VM.create({ common, blockchain }) // add balance for tx - await vm.stateManager.putAccount(signer.address, Account.fromAccountData({ balance: 100000 })) + await vm.vmState.putAccount(signer.address, Account.fromAccountData({ balance: 100000 })) const blockBuilder = await vm.buildBlock({ parentBlock: genesisBlock, diff --git a/packages/vm/tests/api/evm/eei.spec.ts b/packages/vm/tests/api/evm/eei.spec.ts index a6dd84856ca..de21c2a4979 100644 --- a/packages/vm/tests/api/evm/eei.spec.ts +++ b/packages/vm/tests/api/evm/eei.spec.ts @@ -1,8 +1,10 @@ import tape from 'tape' import { Account, Address } from 'ethereumjs-util' +import { DefaultStateManager as StateManager } from '@ethereumjs/statemanager' + import EEI from '../../../src/evm/eei' -import StateManager from '../../../src/state/stateManager' import { TransientStorage } from '../../../src/state' +import { VmState } from '../../../src/vmState' const ZeroAddress = Address.zero() @@ -10,7 +12,7 @@ tape('EEI', (t) => { t.test('should return false on non-existing accounts', async (st) => { const eei = new EEI( undefined!, - new StateManager(), + new VmState({ stateManager: new StateManager() }), undefined!, undefined!, undefined!, @@ -26,7 +28,7 @@ tape('EEI', (t) => { async (st) => { const eei = new EEI( undefined!, - new StateManager(), + new VmState({ stateManager: new StateManager() }), undefined!, undefined!, undefined!, @@ -48,7 +50,7 @@ tape('EEI', (t) => { t.test('should return true on existing accounts', async (st) => { const eei = new EEI( undefined!, - new StateManager(), + new VmState({ stateManager: new StateManager() }), undefined!, undefined!, undefined!, @@ -67,7 +69,7 @@ tape('EEI', (t) => { t.test('should work with transient storage', async (st) => { const eei = new EEI( undefined!, - new StateManager(), + new VmState({ stateManager: new StateManager() }), undefined!, undefined!, undefined!, diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index c2ef8728da0..a8ee2ff7db8 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -1,7 +1,8 @@ import tape from 'tape' import { KECCAK256_RLP } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { DefaultStateManager } from '../../src/state' +import { DefaultStateManager } from '@ethereumjs/statemanager' + import VM from '../../src' import { isRunningInKarma } from '../util' import { setupVM } from './utils' diff --git a/packages/vm/tests/api/runBlock.spec.ts b/packages/vm/tests/api/runBlock.spec.ts index 1d3530a9f93..8294ad9ae95 100644 --- a/packages/vm/tests/api/runBlock.spec.ts +++ b/packages/vm/tests/api/runBlock.spec.ts @@ -29,7 +29,7 @@ tape('runBlock() -> successful API parameter usage', async (t) => { const block = Block.fromRLPSerializedBlock(blockRlp) //@ts-ignore - await setupPreConditions(vm.stateManager, testData) + await setupPreConditions(vm.vmState, testData) st.ok( //@ts-ignore @@ -55,7 +55,7 @@ tape('runBlock() -> successful API parameter usage', async (t) => { const testData = require('./testdata/uncleData.json') //@ts-ignore - await setupPreConditions(vm.stateManager, testData) + await setupPreConditions(vm.vmState, testData) const block1Rlp = testData.blocks[0].rlp const block1 = Block.fromRLPSerializedBlock(block1Rlp) @@ -263,7 +263,7 @@ tape('runBlock() -> runtime behavior', async (t) => { block1[0][12] = Buffer.from('dao-hard-fork') const block = Block.fromValuesArray(block1, { common }) // @ts-ignore - await setupPreConditions(vm.stateManager, testData) + await setupPreConditions(vm.vmState, testData) // fill two original DAO child-contracts with funds and the recovery account with funds in order to verify that the balance gets summed correctly const fundBalance1 = BigInt('0x1111') @@ -404,7 +404,7 @@ async function runWithHf(hardfork: string) { const block = Block.fromRLPSerializedBlock(blockRlp, { common }) // @ts-ignore - await setupPreConditions(vm.stateManager, testData) + await setupPreConditions(vm.vmState, testData) const res = await vm.runBlock({ block, @@ -449,7 +449,7 @@ tape('runBlock() -> tx types', async (t) => { } //@ts-ignore - await setupPreConditions(vm.stateManager, testData) + await setupPreConditions(vm.vmState, testData) const res = await vm.runBlock({ block, diff --git a/packages/vm/tests/api/runBlockchain.spec.ts b/packages/vm/tests/api/runBlockchain.spec.ts index d6d85d5c31d..1b8563b091a 100644 --- a/packages/vm/tests/api/runBlockchain.spec.ts +++ b/packages/vm/tests/api/runBlockchain.spec.ts @@ -6,7 +6,7 @@ import Blockchain from '@ethereumjs/blockchain' import { setupVM } from './utils' import { setupPreConditions } from '../util' import * as testData from './testdata/blockchain.json' -import { DefaultStateManager } from '../../src/state' +import { VmState } from '../../src/vmState' const level = require('level-mem') @@ -70,7 +70,7 @@ tape('runBlockchain', (t) => { await vm.blockchain.putBlock(block) - await setupPreConditions(vm.stateManager as DefaultStateManager, testData) + await setupPreConditions(vm.vmState as VmState, testData) vm.runBlock = async () => new Promise((resolve, reject) => reject(new Error('test'))) @@ -97,7 +97,7 @@ tape('runBlockchain', (t) => { await vm.blockchain.putBlock(block) - await setupPreConditions(vm.stateManager as DefaultStateManager, testData) + await setupPreConditions(vm.vmState as VmState, testData) await vm.runBlockchain() diff --git a/packages/vm/tests/api/runCode.spec.ts b/packages/vm/tests/api/runCode.spec.ts index aa1d208c3dd..43d867f1cce 100644 --- a/packages/vm/tests/api/runCode.spec.ts +++ b/packages/vm/tests/api/runCode.spec.ts @@ -1,6 +1,6 @@ import tape from 'tape' import VM from '../../src' -import { DefaultStateManager } from '../../src/state' +import { DefaultStateManager } from '@ethereumjs/statemanager' const STOP = '00' const JUMP = '56' diff --git a/packages/vm/tests/api/runTx.spec.ts b/packages/vm/tests/api/runTx.spec.ts index 5908a899e81..b07f56a2b2a 100644 --- a/packages/vm/tests/api/runTx.spec.ts +++ b/packages/vm/tests/api/runTx.spec.ts @@ -36,7 +36,7 @@ tape('runTx() -> successful API parameter usage', async (t) => { const caller = tx.getSenderAddress() const acc = createAccount() - await vm.stateManager.putAccount(caller, acc) + await vm.vmState.putAccount(caller, acc) const res = await vm.runTx({ tx }) st.true(res.gasUsed > BigInt(0), `${msg} (${txType.name})`) @@ -63,7 +63,7 @@ tape('runTx() -> successful API parameter usage', async (t) => { const caller = tx.getSenderAddress() const acc = createAccount() - await vm.stateManager.putAccount(caller, acc) + await vm.vmState.putAccount(caller, acc) const blockGasUsed = BigInt(1000) const res = await vm.runTx({ tx, blockGasUsed }) @@ -83,7 +83,7 @@ tape('runTx() -> successful API parameter usage', async (t) => { const caller = tx.getSenderAddress() const acc = createAccount() - await vm.stateManager.putAccount(caller, acc) + await vm.vmState.putAccount(caller, acc) const res = await vm.runTx({ tx }) t.true( @@ -107,8 +107,8 @@ tape('runTx() -> successful API parameter usage', async (t) => { const address = Address.fromPrivateKey(privateKey) const initialBalance = BigInt(10) ** BigInt(18) - const account = await vm.stateManager.getAccount(address) - await vm.stateManager.putAccount( + const account = await vm.vmState.getAccount(address) + await vm.vmState.putAccount( address, Account.fromAccountData({ ...account, balance: initialBalance }) ) @@ -146,7 +146,7 @@ tape('runTx() -> successful API parameter usage', async (t) => { skipBlockGasLimitValidation: true, }) - const coinbaseAccount = await vm.stateManager.getAccount(new Address(coinbase)) + const coinbaseAccount = await vm.vmState.getAccount(new Address(coinbase)) // calculate expected coinbase balance const baseFee = block.header.baseFeePerGas! @@ -190,7 +190,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { const caller = tx.getSenderAddress() const acc = createAccount() - await vm.stateManager.putAccount(caller, acc) + await vm.vmState.putAccount(caller, acc) try { await vm.runTx({ tx }) @@ -213,7 +213,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { const caller = tx.getSenderAddress() const acc = createAccount() - await vm.stateManager.putAccount(caller, acc) + await vm.vmState.putAccount(caller, acc) const res = await vm.runTx({ tx, reportAccessList: true }) t.true( @@ -256,7 +256,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { const address = tx.getSenderAddress() tx = Object.create(tx) const maxCost: bigint = tx.gasLimit * tx.maxFeePerGas - await vm.stateManager.putAccount(address, createAccount(BigInt(0), maxCost - BigInt(1))) + await vm.vmState.putAccount(address, createAccount(BigInt(0), maxCost - BigInt(1))) try { await vm.runTx({ tx }) t.fail('should throw error') @@ -264,7 +264,7 @@ tape('runTx() -> API parameter usage/data errors', (t) => { t.ok(e.message.toLowerCase().includes('max cost'), `should fail if max cost exceeds balance`) } // set sufficient balance - await vm.stateManager.putAccount(address, createAccount(BigInt(0), maxCost)) + await vm.vmState.putAccount(address, createAccount(BigInt(0), maxCost)) const res = await vm.runTx({ tx }) t.ok(res, 'should pass if balance is sufficient') @@ -275,12 +275,12 @@ tape('runTx() -> API parameter usage/data errors', (t) => { const vm = await VM.create({ common }) const tx = getTransaction(common, 2, true, '0x0', false) const address = tx.getSenderAddress() - const account = await vm.stateManager.getAccount(address) + const account = await vm.vmState.getAccount(address) account.balance = BigInt(9000000) // This is the maxFeePerGas multiplied with the gasLimit of 90000 - await vm.stateManager.putAccount(address, account) + await vm.vmState.putAccount(address, account) await vm.runTx({ tx }) account.balance = BigInt(9000000) - await vm.stateManager.putAccount(address, account) + await vm.vmState.putAccount(address, account) const tx2 = getTransaction(common, 2, true, '0x64', false) // Send 100 wei; now balance < maxFeePerGas*gasLimit + callvalue try { await vm.runTx({ tx: tx2 }) @@ -295,10 +295,10 @@ tape('runTx() -> API parameter usage/data errors', (t) => { const vm = await VM.create({ common }) const tx = getTransaction(common, 2, true, '0x0', false) const address = tx.getSenderAddress() - const account = await vm.stateManager.getAccount(address) + const account = await vm.vmState.getAccount(address) account.balance = BigInt(9000000) // This is the maxFeePerGas multiplied with the gasLimit of 90000 account.nonce = BigInt(1) - await vm.stateManager.putAccount(address, account) + await vm.vmState.putAccount(address, account) try { await vm.runTx({ tx }) t.fail('cannot reach this') @@ -346,8 +346,8 @@ tape('runTx() -> runtime behavior', async (t) => { */ const code = Buffer.from('6001600055FE', 'hex') const address = new Address(Buffer.from('00000000000000000000000000000000000000ff', 'hex')) - await vm.stateManager.putContractCode(address, code) - await vm.stateManager.putContractStorage( + await vm.vmState.putContractCode(address, code) + await vm.vmState.putContractStorage( address, Buffer.from('00'.repeat(32), 'hex'), Buffer.from('00'.repeat(31) + '01', 'hex') @@ -365,12 +365,12 @@ tape('runTx() -> runtime behavior', async (t) => { } const tx = TransactionFactory.fromTxData(txParams, { common }).sign(privateKey) - await vm.stateManager.putAccount(tx.getSenderAddress(), createAccount()) + await vm.vmState.putAccount(tx.getSenderAddress(), createAccount()) await vm.runTx({ tx }) // this tx will fail, but we have to ensure that the cache is cleared t.equal( - (vm.stateManager)._originalStorageCache.size, + (vm.vmState)._originalStorageCache.size, 0, `should clear storage cache after every ${txType.name}` ) @@ -387,10 +387,10 @@ tape('runTx() -> runtime errors', async (t) => { const caller = tx.getSenderAddress() const from = createAccount() - await vm.stateManager.putAccount(caller, from) + await vm.vmState.putAccount(caller, from) const to = createAccount(BigInt(0), MAX_INTEGER) - await vm.stateManager.putAccount(tx.to!, to) + await vm.vmState.putAccount(tx.to!, to) const res = await vm.runTx({ tx }) @@ -400,7 +400,7 @@ tape('runTx() -> runtime errors', async (t) => { `result should have 'value overflow' error set (${txType.name})` ) t.equal( - (vm.stateManager)._checkpointCount, + (vm.vmState)._checkpointCount, 0, `checkpoint count should be 0 (${txType.name})` ) @@ -415,13 +415,13 @@ tape('runTx() -> runtime errors', async (t) => { const caller = tx.getSenderAddress() const from = createAccount() - await vm.stateManager.putAccount(caller, from) + await vm.vmState.putAccount(caller, from) const contractAddress = new Address( Buffer.from('61de9dc6f6cff1df2809480882cfd3c2364b28f7', 'hex') ) const to = createAccount(BigInt(0), MAX_INTEGER) - await vm.stateManager.putAccount(contractAddress, to) + await vm.vmState.putAccount(contractAddress, to) const res = await vm.runTx({ tx }) @@ -431,7 +431,7 @@ tape('runTx() -> runtime errors', async (t) => { `result should have 'value overflow' error set (${txType.name})` ) t.equal( - (vm.stateManager)._checkpointCount, + (vm.vmState)._checkpointCount, 0, `checkpoint count should be 0 (${txType.name})` ) @@ -449,7 +449,7 @@ tape('runTx() -> API return values', async (t) => { const caller = tx.getSenderAddress() const acc = createAccount() - await vm.stateManager.putAccount(caller, acc) + await vm.vmState.putAccount(caller, acc) const res = await vm.runTx({ tx }) t.equal( @@ -479,7 +479,7 @@ tape('runTx() -> API return values', async (t) => { const caller = tx.getSenderAddress() const acc = createAccount() - await vm.stateManager.putAccount(caller, acc) + await vm.vmState.putAccount(caller, acc) const res = await vm.runTx({ tx }) @@ -560,15 +560,15 @@ tape('runTx() -> consensus bugs', async (t) => { const vm = await VM.create({ common }) const addr = Address.fromString('0xd3563d8f19a85c95beab50901fd59ca4de69174c') - const acc = await vm.stateManager.getAccount(addr) + const acc = await vm.vmState.getAccount(addr) acc.balance = beforeBalance acc.nonce = BigInt(2) - await vm.stateManager.putAccount(addr, acc) + await vm.vmState.putAccount(addr, acc) const tx = Transaction.fromTxData(txData, { common }) await vm.runTx({ tx }) - const newBalance = (await vm.stateManager.getAccount(addr)).balance + const newBalance = (await vm.vmState.getAccount(addr)).balance t.equals(newBalance, afterBalance) t.end() }) @@ -598,9 +598,9 @@ tape('runTx() -> consensus bugs', async (t) => { const vm = await VM.create({ common }) const addr = Address.fromPrivateKey(pkey) - const acc = await vm.stateManager.getAccount(addr) + const acc = await vm.vmState.getAccount(addr) acc.balance = BigInt(10000000000000) - await vm.stateManager.putAccount(addr, acc) + await vm.vmState.putAccount(addr, acc) const tx = FeeMarketEIP1559Transaction.fromTxData(txData, { common }).sign(pkey) diff --git a/packages/vm/tests/api/state/vmState.spec.ts b/packages/vm/tests/api/state/vmState.spec.ts new file mode 100644 index 00000000000..aeb8f320880 --- /dev/null +++ b/packages/vm/tests/api/state/vmState.spec.ts @@ -0,0 +1,486 @@ +import tape from 'tape' +import { Address } from 'ethereumjs-util' +import Common, { Chain, Hardfork } from '@ethereumjs/common' +import { DefaultStateManager } from '@ethereumjs/statemanager' + +import { VmState } from '../../../src/vmState' +import { getSingleFile } from '../../tester/testLoader' +import { isRunningInKarma } from '../../util' +import { createAccount } from '../utils' + +const StateManager = DefaultStateManager + +tape('vmState', (t) => { + t.test( + 'should generate the genesis state root correctly for mainnet from ethereum/tests data', + async (st) => { + if (isRunningInKarma()) { + st.skip('skip slow test when running in karma') + return st.end() + } + const genesisData = getSingleFile('BasicTests/genesishashestest.json') + + const vmState = new VmState({ stateManager: new StateManager() }) + await vmState.generateCanonicalGenesis() + const stateRoot = await vmState.getStateRoot() + st.equal( + stateRoot.toString('hex'), + genesisData.genesis_state_root, + 'generateCanonicalGenesis should produce correct state root for mainnet from ethereum/tests data' + ) + st.end() + } + ) + + t.test('should generate the genesis state root correctly for mainnet from common', async (st) => { + if (isRunningInKarma()) { + st.skip('skip slow test when running in karma') + return st.end() + } + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) + const expectedStateRoot = Buffer.from(common.genesis().stateRoot.slice(2), 'hex') + const stateManager = new StateManager({ common }) + + const vmState = new VmState({ stateManager, common }) + await vmState.generateCanonicalGenesis() + const stateRoot = await vmState.getStateRoot() + + st.true( + stateRoot.equals(expectedStateRoot), + `generateCanonicalGenesis should produce correct state root for mainnet from common` + ) + st.end() + }) + + t.test('should generate the genesis state root correctly for all other chains', async (st) => { + const chains = [Chain.Ropsten, Chain.Rinkeby, Chain.Kovan, Chain.Goerli] + + for (const chain of chains) { + const common = new Common({ chain: chain, hardfork: Hardfork.Petersburg }) + const expectedStateRoot = Buffer.from(common.genesis().stateRoot.slice(2), 'hex') + const stateManager = new DefaultStateManager({ common }) + const vmState = new VmState({ stateManager, common }) + + await vmState.generateCanonicalGenesis() + const stateRoot = await vmState.getStateRoot() + + st.true( + stateRoot.equals(expectedStateRoot), + `generateCanonicalGenesis should produce correct state root for ${chain}` + ) + } + st.end() + }) +}) + +tape('Original storage cache', async (t) => { + const stateManager = new DefaultStateManager() + const vmState = new VmState({ stateManager }) + + const address = new Address(Buffer.from('a94f5374fce5edbc8e2a8697c15331677e6ebf0b', 'hex')) + const account = createAccount() + await vmState.putAccount(address, account) + + const key = Buffer.from('1234567890123456789012345678901234567890123456789012345678901234', 'hex') + const value = Buffer.from('1234', 'hex') + + t.test('should initially have empty storage value', async (st) => { + await vmState.checkpoint() + const res = await vmState.getContractStorage(address, key) + st.deepEqual(res, Buffer.alloc(0)) + + const origRes = await vmState.getOriginalContractStorage(address, key) + st.deepEqual(origRes, Buffer.alloc(0)) + + await vmState.commit() + + st.end() + }) + + t.test('should set original storage value', async (st) => { + await vmState.putContractStorage(address, key, value) + const res = await vmState.getContractStorage(address, key) + st.deepEqual(res, value) + + st.end() + }) + + t.test('should get original storage value', async (st) => { + const res = await vmState.getOriginalContractStorage(address, key) + st.deepEqual(res, value) + st.end() + }) + + t.test('should return correct original value after modification', async (st) => { + const newValue = Buffer.from('1235', 'hex') + await vmState.putContractStorage(address, key, newValue) + const res = await vmState.getContractStorage(address, key) + st.deepEqual(res, newValue) + + const origRes = await vmState.getOriginalContractStorage(address, key) + st.deepEqual(origRes, value) + st.end() + }) + + t.test('should cache keys separately', async (st) => { + const key2 = Buffer.from( + '0000000000000000000000000000000000000000000000000000000000000012', + 'hex' + ) + const value2 = Buffer.from('12', 'hex') + const value3 = Buffer.from('123', 'hex') + await vmState.putContractStorage(address, key2, value2) + + let res = await vmState.getContractStorage(address, key2) + st.deepEqual(res, value2) + let origRes = await vmState.getOriginalContractStorage(address, key2) + st.deepEqual(origRes, value2) + + await vmState.putContractStorage(address, key2, value3) + + res = await vmState.getContractStorage(address, key2) + st.deepEqual(res, value3) + origRes = await vmState.getOriginalContractStorage(address, key2) + st.deepEqual(origRes, value2) + + // Check previous key + res = await vmState.getContractStorage(address, key) + st.deepEqual(res, Buffer.from('1235', 'hex')) + origRes = await vmState.getOriginalContractStorage(address, key) + st.deepEqual(origRes, value) + + st.end() + }) + + t.test("getOriginalContractStorage should validate the key's length", async (st) => { + try { + await vmState.getOriginalContractStorage(address, Buffer.alloc(12)) + } catch (e: any) { + st.equal(e.message, 'Storage key must be 32 bytes long') + st.end() + return + } + + st.fail('Should have failed') + st.end() + }) +}) + +tape('StateManager - generateAccessList', (tester) => { + const it = tester.test + + // Only use 0..9 + function a(n: number) { + return Buffer.from(`ff${'00'.repeat(18)}0${n}`, 'hex') + } + + // Only use 0..9 + function s(n: number) { + return Buffer.from(`${'00'.repeat(31)}0${n}`, 'hex') + } + + function getStateManagerAliases() { + const stateManager = new DefaultStateManager() + const vmState = new VmState({ stateManager }) + const addA = vmState.addWarmedAddress.bind(vmState) + const addS = vmState.addWarmedStorage.bind(vmState) + const gen = vmState.generateAccessList.bind(vmState) + const sm = vmState + return { addA, addS, gen, sm } + } + + it('one frame, simple', async (t) => { + const { addA, addS, gen } = getStateManagerAliases() + addA(a(1)) + addS(a(1), s(1)) + const json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + ] + t.deepEqual(gen(), json) + t.end() + }) + + it('one frame, unsorted slots', async (t) => { + const { addA, addS, gen } = getStateManagerAliases() + addA(a(1)) + addS(a(1), s(2)) + addS(a(1), s(1)) + const json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: [ + '0x0000000000000000000000000000000000000000000000000000000000000001', + '0x0000000000000000000000000000000000000000000000000000000000000002', + ], + }, + ] + t.deepEqual(gen(), json) + t.end() + }) + + it('one frame, unsorted addresses', async (t) => { + const { addA, addS, gen } = getStateManagerAliases() + addA(a(2)) + addS(a(2), s(1)) + addA(a(1)) + addS(a(1), s(1)) + const json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + { + address: '0xff00000000000000000000000000000000000002', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + ] + t.deepEqual(gen(), json) + t.end() + }) + + it('one frame, more complex', async (t) => { + const { addA, addS, gen } = getStateManagerAliases() + addA(a(1)) + addS(a(1), s(1)) + addA(a(2)) + addA(a(3)) + addS(a(3), s(1)) + addS(a(3), s(2)) + let json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + { + address: '0xff00000000000000000000000000000000000002', + storageKeys: [], + }, + { + address: '0xff00000000000000000000000000000000000003', + storageKeys: [ + '0x0000000000000000000000000000000000000000000000000000000000000001', + '0x0000000000000000000000000000000000000000000000000000000000000002', + ], + }, + ] + t.deepEqual(gen(), json) + + json = [ + { + address: '0xff00000000000000000000000000000000000002', + storageKeys: [], + }, + { + address: '0xff00000000000000000000000000000000000003', + storageKeys: [ + '0x0000000000000000000000000000000000000000000000000000000000000001', + '0x0000000000000000000000000000000000000000000000000000000000000002', + ], + }, + ] + const aRemoved = new Address(a(1)) + t.deepEqual(gen([aRemoved]), json, 'address removed') + + json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + { + address: '0xff00000000000000000000000000000000000002', + storageKeys: [], + }, + { + address: '0xff00000000000000000000000000000000000003', + storageKeys: [ + '0x0000000000000000000000000000000000000000000000000000000000000001', + '0x0000000000000000000000000000000000000000000000000000000000000002', + ], + }, + ] + const aOnlyStorageKept = new Address(a(3)) + t.deepEqual(gen([], [aOnlyStorageKept]), json, 'addressesOnlyStorage, kept') + + json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + { + address: '0xff00000000000000000000000000000000000003', + storageKeys: [ + '0x0000000000000000000000000000000000000000000000000000000000000001', + '0x0000000000000000000000000000000000000000000000000000000000000002', + ], + }, + ] + const aOnlyStorageRemoved = new Address(a(2)) + t.deepEqual(gen([], [aOnlyStorageRemoved]), json, 'addressesOnlyStorage, removed') + t.end() + }) + + it('two frames, simple', async (t) => { + const { addA, addS, gen, sm } = getStateManagerAliases() + addA(a(1)) + addS(a(1), s(1)) + await sm.checkpoint() + addA(a(2)) + addA(a(3)) + addS(a(3), s(1)) + addS(a(3), s(2)) + const json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + { + address: '0xff00000000000000000000000000000000000002', + storageKeys: [], + }, + { + address: '0xff00000000000000000000000000000000000003', + storageKeys: [ + '0x0000000000000000000000000000000000000000000000000000000000000001', + '0x0000000000000000000000000000000000000000000000000000000000000002', + ], + }, + ] + t.deepEqual(gen(), json) + t.end() + }) + + it('two frames, same address with different storage slots', async (t) => { + const { addA, addS, gen, sm } = getStateManagerAliases() + addA(a(1)) + addS(a(1), s(1)) + await sm.checkpoint() + addA(a(1)) + addS(a(1), s(2)) + const json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: [ + '0x0000000000000000000000000000000000000000000000000000000000000001', + '0x0000000000000000000000000000000000000000000000000000000000000002', + ], + }, + ] + t.deepEqual(gen(), json) + t.end() + }) + + it('two frames, same address with same storage slots', async (t) => { + const { addA, addS, gen, sm } = getStateManagerAliases() + addA(a(1)) + addS(a(1), s(1)) + await sm.checkpoint() + addA(a(1)) + addS(a(1), s(1)) + const json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + ] + t.deepEqual(gen(), json) + t.end() + }) + + it('three frames, no accesses on level two', async (t) => { + const { addA, addS, gen, sm } = getStateManagerAliases() + addA(a(1)) + addS(a(1), s(1)) + await sm.checkpoint() + await sm.checkpoint() + addA(a(2)) + addS(a(2), s(2)) + const json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + { + address: '0xff00000000000000000000000000000000000002', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000002'], + }, + ] + t.deepEqual(gen(), json) + t.end() + }) + + it('one frame, one revert frame', async (t) => { + const { addA, addS, gen, sm } = getStateManagerAliases() + await sm.checkpoint() + addA(a(1)) + addS(a(1), s(1)) + await sm.revert() + addA(a(2)) + addS(a(2), s(2)) + const json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + { + address: '0xff00000000000000000000000000000000000002', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000002'], + }, + ] + t.deepEqual(gen(), json) + t.end() + }) + + it('one frame, one revert frame, same address, different slots', async (t) => { + const { addA, addS, gen, sm } = getStateManagerAliases() + await sm.checkpoint() + addA(a(1)) + addS(a(1), s(1)) + await sm.revert() + addA(a(1)) + addS(a(1), s(2)) + const json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: [ + '0x0000000000000000000000000000000000000000000000000000000000000001', + '0x0000000000000000000000000000000000000000000000000000000000000002', + ], + }, + ] + t.deepEqual(gen(), json) + t.end() + }) + + it('one frame, two revert frames', async (t) => { + const { addA, addS, gen, sm } = getStateManagerAliases() + await sm.checkpoint() + await sm.checkpoint() + addA(a(1)) + addS(a(1), s(1)) + await sm.revert() + addA(a(2)) + addS(a(2), s(1)) + await sm.revert() + addA(a(3)) + addS(a(3), s(1)) + const json = [ + { + address: '0xff00000000000000000000000000000000000001', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + { + address: '0xff00000000000000000000000000000000000002', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + { + address: '0xff00000000000000000000000000000000000003', + storageKeys: ['0x0000000000000000000000000000000000000000000000000000000000000001'], + }, + ] + t.deepEqual(gen(), json) + t.end() + }) +}) diff --git a/packages/vm/tests/api/utils.ts b/packages/vm/tests/api/utils.ts index 36459bd98b2..e689b52f437 100644 --- a/packages/vm/tests/api/utils.ts +++ b/packages/vm/tests/api/utils.ts @@ -8,15 +8,15 @@ import Common from '@ethereumjs/common' const level = require('level-mem') -export function createAccount(nonce: bigint = BigInt(0), balance: bigint = BigInt(0xfff384)) { +export function createAccount(nonce = BigInt(0), balance = BigInt(0xfff384)) { return new Account(nonce, balance) } export async function setBalance(vm: VM, address: Address, balance = BigInt(100000000)) { const account = createAccount(BigInt(0), balance) - await vm.stateManager.checkpoint() - await vm.stateManager.putAccount(address, account) - await vm.stateManager.commit() + await vm.vmState.checkpoint() + await vm.vmState.putAccount(address, account) + await vm.vmState.commit() } export async function setupVM(opts: VMOpts & { genesisBlock?: Block } = {}) { diff --git a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts index 0756cddae10..2f02f886937 100644 --- a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts +++ b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts @@ -83,7 +83,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: }) // set up pre-state - await setupPreConditions(vm.stateManager, testData) + await setupPreConditions(vm.vmState, testData) t.ok(vm.stateManager._trie.root.equals(genesisBlock.header.stateRoot), 'correct pre stateRoot') diff --git a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts index ea6059963a8..1787dc5b303 100644 --- a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts +++ b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts @@ -71,7 +71,7 @@ async function runTestCase(options: any, testData: any, t: tape.Test) { const state = new Trie() const vm = await VM.create({ state, common }) - await setupPreConditions(vm.stateManager, testData) + await setupPreConditions(vm.vmState, testData) let execInfo = '' let tx diff --git a/packages/vm/tests/util.ts b/packages/vm/tests/util.ts index 208ac903936..a61d6bdcc3f 100644 --- a/packages/vm/tests/util.ts +++ b/packages/vm/tests/util.ts @@ -19,7 +19,7 @@ import { bufferToHex, isHexPrefixed, } from 'ethereumjs-util' -import { DefaultStateManager } from '../src/state' +import { VmState } from '../src/vmState' export function dumpState(state: any, cb: Function) { function readAccounts(state: any) { @@ -313,7 +313,7 @@ export function makeBlockFromEnv(env: any, opts?: BlockOptions): Block { * @param state - the state DB/trie * @param testData - JSON from tests repo */ -export async function setupPreConditions(state: DefaultStateManager, testData: any) { +export async function setupPreConditions(state: VmState, testData: any) { await state.checkpoint() for (const addressStr of Object.keys(testData.pre)) { const { nonce, balance, code, storage } = testData.pre[addressStr] diff --git a/packages/vm/tsconfig.prod.json b/packages/vm/tsconfig.prod.json index b320b369386..d35348b0c47 100644 --- a/packages/vm/tsconfig.prod.json +++ b/packages/vm/tsconfig.prod.json @@ -10,6 +10,7 @@ { "path": "../block/tsconfig.prod.json" }, { "path": "../blockchain/tsconfig.prod.json" }, { "path": "../common/tsconfig.prod.json" }, + { "path": "../statemanager/tsconfig.prod.json" }, { "path": "../trie/tsconfig.prod.json" }, { "path": "../tx/tsconfig.prod.json" }, { "path": "../util/tsconfig.prod.json" } From eccc50b7d96dd95b255729a4a1b242419f721bc9 Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Thu, 14 Apr 2022 10:16:08 +0200 Subject: [PATCH 32/44] Blockchain: encapsulate consensus mechanism (new) (#1841) * blockchain: encapsulate consensus WIP * blockchain: fix lint errors * blockchain: move initialization to constructor in ethash consensus class * blockchain: refactor to consensus interface only * block: update header for consensus class changes in blockchain * client: update miner for consensus class changes in blockchain * blockchain: lint cleanup * vm: update examples for consensus class changes in blockchain * blockchain: re-export consensus classes * client: use CliqueConsensus class in miner * client: use CliqueConsensus class in miner * Rebase fixes * blockchain: rebase reconcile * Update packages/client/lib/miner/miner.ts Co-authored-by: Ryan Ghods * block: fix error text in validateCliqueDifficulty Co-authored-by: Emerson Macro Co-authored-by: emersonmacro <77563348+emersonmacro@users.noreply.github.com> Co-authored-by: Ryan Ghods --- packages/block/src/header.ts | 6 +- packages/block/test/mockchain.ts | 8 +- packages/block/test/poaMockchain.ts | 10 +- packages/blockchain/src/clique.ts | 18 - packages/blockchain/src/consensus/casper.ts | 18 + packages/blockchain/src/consensus/clique.ts | 535 ++++++++++++++++++ packages/blockchain/src/consensus/ethash.ts | 28 + packages/blockchain/src/consensus/index.ts | 6 + .../blockchain/src/consensus/interface.ts | 43 ++ packages/blockchain/src/db/constants.ts | 18 - packages/blockchain/src/db/manager.ts | 65 +-- packages/blockchain/src/db/operation.ts | 15 - packages/blockchain/src/index.ts | 515 ++--------------- packages/blockchain/test/clique.spec.ts | 128 +++-- packages/blockchain/test/reorg.spec.ts | 14 +- packages/client/lib/miner/miner.ts | 11 +- packages/client/test/miner/miner.spec.ts | 11 +- packages/vm/examples/run-blockchain.ts | 4 +- .../tester/runners/BlockchainTestsRunner.ts | 4 +- 19 files changed, 805 insertions(+), 652 deletions(-) delete mode 100644 packages/blockchain/src/clique.ts create mode 100644 packages/blockchain/src/consensus/casper.ts create mode 100644 packages/blockchain/src/consensus/clique.ts create mode 100644 packages/blockchain/src/consensus/ethash.ts create mode 100644 packages/blockchain/src/consensus/index.ts create mode 100644 packages/blockchain/src/consensus/interface.ts diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index 6d0467eb0a7..cd0aa0dde90 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -518,13 +518,13 @@ export class BlockHeader { ) throw new Error(msg) } - if ('cliqueActiveSigners' in blockchain === false) { + if ('cliqueActiveSigners' in (blockchain as any).consensus === false) { const msg = this._errorMsg( - 'PoA blockchain requires method blockchain.cliqueActiveSigners() to validate clique difficulty' + 'PoA blockchain requires method blockchain.consensus.cliqueActiveSigners() to validate clique difficulty' ) throw new Error(msg) } - const signers = (blockchain as any).cliqueActiveSigners() + const signers = (blockchain as any).consensus.cliqueActiveSigners() if (signers.length === 0) { // abort if signers are unavailable return true diff --git a/packages/block/test/mockchain.ts b/packages/block/test/mockchain.ts index ebb2a3c4eb1..5f04fe9f120 100644 --- a/packages/block/test/mockchain.ts +++ b/packages/block/test/mockchain.ts @@ -4,13 +4,15 @@ import { Block, Blockchain } from '../src' export class Mockchain implements Blockchain { private HashMap: { [key: string]: Block } = {} + public consensus = { + cliqueActiveSigners() { + return [] + }, + } async getBlock(hash: Buffer) { return this.HashMap[hash.toString('hex')] } async putBlock(block: Block) { this.HashMap[block.hash().toString('hex')] = block } - cliqueActiveSigners() { - return [] - } } diff --git a/packages/block/test/poaMockchain.ts b/packages/block/test/poaMockchain.ts index e4aeb223fbe..79cca0b321b 100644 --- a/packages/block/test/poaMockchain.ts +++ b/packages/block/test/poaMockchain.ts @@ -5,14 +5,16 @@ import { Block, Blockchain } from '../src' export class PoaMockchain implements Blockchain { private HashMap: { [key: string]: Block } = {} + public consensus = { + cliqueActiveSigners() { + const signer = new Address(Buffer.from('0b90087d864e82a284dca15923f3776de6bb016f', 'hex')) + return [signer] + }, + } async getBlock(hash: Buffer) { return this.HashMap[hash.toString('hex')] } async putBlock(block: Block) { this.HashMap[block.hash().toString('hex')] = block } - cliqueActiveSigners() { - const signer = new Address(Buffer.from('0b90087d864e82a284dca15923f3776de6bb016f', 'hex')) - return [signer] - } } diff --git a/packages/blockchain/src/clique.ts b/packages/blockchain/src/clique.ts deleted file mode 100644 index 563f9ee2852..00000000000 --- a/packages/blockchain/src/clique.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Address } from 'ethereumjs-util' - -// Clique Signer State: [blockNumber, signers] -export type CliqueSignerState = [bigint, Address[]] -export type CliqueLatestSignerStates = CliqueSignerState[] - -// Clique Vote: [blockNumber, [signer, beneficiary, cliqueNonce]] -export type CliqueVote = [bigint, [Address, Address, Buffer]] -export type CliqueLatestVotes = CliqueVote[] - -// Clique Block Signer: [blockNumber, signer] -export type CliqueBlockSigner = [bigint, Address] -export type CliqueLatestBlockSigners = CliqueBlockSigner[] - -// Magic nonce number to vote on adding a new signer -export const CLIQUE_NONCE_AUTH = Buffer.from('ffffffffffffffff', 'hex') -// Magic nonce number to vote on removing a signer. -export const CLIQUE_NONCE_DROP = Buffer.alloc(8) diff --git a/packages/blockchain/src/consensus/casper.ts b/packages/blockchain/src/consensus/casper.ts new file mode 100644 index 00000000000..c2dedfe4f71 --- /dev/null +++ b/packages/blockchain/src/consensus/casper.ts @@ -0,0 +1,18 @@ +import Blockchain from '..' +import { Consensus, ConsensusOptions } from './interface' + +/** + * This class encapsulates Casper-related consensus functionality when used with the Blockchain class. + */ +export class CasperConsensus implements Consensus { + blockchain: Blockchain + + constructor({ blockchain }: ConsensusOptions) { + this.blockchain = blockchain + } + + public async genesisInit(): Promise {} + public async setup(): Promise {} + public async validate(): Promise {} + public async newBlock(): Promise {} +} diff --git a/packages/blockchain/src/consensus/clique.ts b/packages/blockchain/src/consensus/clique.ts new file mode 100644 index 00000000000..a939a1011e3 --- /dev/null +++ b/packages/blockchain/src/consensus/clique.ts @@ -0,0 +1,535 @@ +import { debug as createDebugLogger } from 'debug' +import { Block, BlockHeader } from '@ethereumjs/block' +import { Address, rlp, bigIntToBuffer, bufferToBigInt } from 'ethereumjs-util' +import Blockchain from '..' +import { Consensus, ConsensusOptions } from './interface' + +const debug = createDebugLogger('blockchain:clique') + +// Clique Signer State +type CliqueSignerState = [blockNumber: bigint, signers: Address[]] +type CliqueLatestSignerStates = CliqueSignerState[] + +// Clique Vote +type CliqueVote = [ + blockNumber: bigint, + vote: [signer: Address, beneficiary: Address, cliqueNonce: Buffer] +] +type CliqueLatestVotes = CliqueVote[] + +// Clique Block Signer +type CliqueBlockSigner = [blockNumber: bigint, signer: Address] +type CliqueLatestBlockSigners = CliqueBlockSigner[] + +// Magic nonce number to vote on adding a new signer +export const CLIQUE_NONCE_AUTH = Buffer.from('ffffffffffffffff', 'hex') +// Magic nonce number to vote on removing a signer. +export const CLIQUE_NONCE_DROP = Buffer.alloc(8) + +const CLIQUE_SIGNERS_KEY = 'CliqueSigners' +const CLIQUE_VOTES_KEY = 'CliqueVotes' +const CLIQUE_BLOCK_SIGNERS_SNAPSHOT_KEY = 'CliqueBlockSignersSnapshot' + +const DB_OPTS = { + keyEncoding: 'binary', + valueEncoding: 'binary', +} + +/** + * This class encapsulates Clique-related consensus functionality when used with the Blockchain class. + */ +export class CliqueConsensus implements Consensus { + blockchain: Blockchain + + /** + * Keep signer history data (signer states and votes) + * for all block numbers >= HEAD_BLOCK - CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT + * + * This defines a limit for reorgs on PoA clique chains. + */ + private CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT = 100 + + /** + * List with the latest signer states checkpointed on blocks where + * a change (added new or removed a signer) occurred. + * + * Format: + * [ [BLOCK_NUMBER_1, [SIGNER1, SIGNER 2,]], [BLOCK_NUMBER2, [SIGNER1, SIGNER3]], ...] + * + * The top element from the array represents the list of current signers. + * On reorgs elements from the array are removed until BLOCK_NUMBER > REORG_BLOCK. + * + * Always keep at least one item on the stack. + */ + public _cliqueLatestSignerStates: CliqueLatestSignerStates = [] + + /** + * List with the latest signer votes. + * + * Format: + * [ [BLOCK_NUMBER_1, [SIGNER, BENEFICIARY, AUTH]], [BLOCK_NUMBER_1, [SIGNER, BENEFICIARY, AUTH]] ] + * where AUTH = CLIQUE_NONCE_AUTH | CLIQUE_NONCE_DROP + * + * For votes all elements here must be taken into account with a + * block number >= LAST_EPOCH_BLOCK + * (nevertheless keep entries with blocks before EPOCH_BLOCK in case a reorg happens + * during an epoch change) + * + * On reorgs elements from the array are removed until BLOCK_NUMBER > REORG_BLOCK. + */ + public _cliqueLatestVotes: CliqueLatestVotes = [] + + /** + * List of signers for the last consecutive {@link Blockchain.cliqueSignerLimit} blocks. + * Kept as a snapshot for quickly checking for "recently signed" error. + * Format: [ [BLOCK_NUMBER, SIGNER_ADDRESS], ...] + * + * On reorgs elements from the array are removed until BLOCK_NUMBER > REORG_BLOCK. + */ + public _cliqueLatestBlockSigners: CliqueLatestBlockSigners = [] + + constructor({ blockchain }: ConsensusOptions) { + this.blockchain = blockchain + } + + async setup(): Promise { + this._cliqueLatestSignerStates = await this.getCliqueLatestSignerStates() + this._cliqueLatestVotes = await this.getCliqueLatestVotes() + this._cliqueLatestBlockSigners = await this.getCliqueLatestBlockSigners() + } + + async genesisInit(genesisBlock: Block): Promise { + await this.cliqueSaveGenesisSigners(genesisBlock) + } + + async validate(block: Block): Promise { + const { header } = block + const valid = header.cliqueVerifySignature(this.cliqueActiveSigners()) + if (!valid) { + throw new Error('invalid PoA block signature (clique)') + } + if (this.cliqueCheckRecentlySigned(header)) { + throw new Error('recently signed') + } + + // validate checkpoint signers towards active signers on epoch transition blocks + if (header.cliqueIsEpochTransition()) { + // note: keep votes on epoch transition blocks in case of reorgs. + // only active (non-stale) votes will counted (if vote.blockNumber >= lastEpochBlockNumber + + const checkpointSigners = header.cliqueEpochTransitionSigners() + const activeSigners = this.cliqueActiveSigners() + for (const [i, cSigner] of checkpointSigners.entries()) { + if (!activeSigners[i] || !activeSigners[i].equals(cSigner)) { + throw new Error( + `checkpoint signer not found in active signers list at index ${i}: ${cSigner}` + ) + } + } + } + } + + async newBlock(block: Block, commonAncestor: BlockHeader | undefined): Promise { + // Clique: update signer votes and state + const { header } = block + const commonAncestorNumber = commonAncestor?.number + if (commonAncestorNumber !== undefined) { + await this._cliqueDeleteSnapshots(commonAncestorNumber! + BigInt(1)) + for ( + let number = commonAncestorNumber! + BigInt(1); + number <= header.number; + number += BigInt(1) + ) { + const canonicalHeader = await this.blockchain.getCanonicalHeader(number) + await this._cliqueBuildSnapshots(canonicalHeader) + } + } + } + + /** + * Save genesis signers to db + * @param genesisBlock genesis block + * @hidden + */ + private async cliqueSaveGenesisSigners(genesisBlock: Block) { + const genesisSignerState: CliqueSignerState = [ + BigInt(0), + genesisBlock.header.cliqueEpochTransitionSigners(), + ] + await this.cliqueUpdateSignerStates(genesisSignerState) + debug(`[Block 0] Genesis block -> update signer states`) + await this.cliqueUpdateVotes() + } + + /** + * Save signer state to db + * @param signerState + * @hidden + */ + private async cliqueUpdateSignerStates(signerState?: CliqueSignerState) { + if (signerState) { + this._cliqueLatestSignerStates.push(signerState) + } + + // trim to CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT + const limit = this.CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT + const blockSigners = this._cliqueLatestBlockSigners + const lastBlockNumber = blockSigners[blockSigners.length - 1]?.[0] + if (lastBlockNumber) { + const blockLimit = lastBlockNumber - BigInt(limit) + const states = this._cliqueLatestSignerStates + const lastItem = states[states.length - 1] + this._cliqueLatestSignerStates = states.filter((state) => state[0] >= blockLimit) + if (this._cliqueLatestSignerStates.length === 0) { + // always keep at least one item on the stack + this._cliqueLatestSignerStates.push(lastItem) + } + } + + // save to db + const formatted = this._cliqueLatestSignerStates.map((state) => [ + bigIntToBuffer(state[0]), + state[1].map((a) => a.toBuffer()), + ]) + await this.blockchain.db.put(CLIQUE_SIGNERS_KEY, rlp.encode(formatted), DB_OPTS) + // Output active signers for debugging purposes + let i = 0 + for (const signer of this.cliqueActiveSigners()) { + debug(`Clique signer [${i}]: ${signer}`) + i++ + } + } + + /** + * Update clique votes and save to db + * @param header BlockHeader + * @hidden + */ + private async cliqueUpdateVotes(header?: BlockHeader) { + // Block contains a vote on a new signer + if (header && !header.coinbase.isZero()) { + const signer = header.cliqueSigner() + const beneficiary = header.coinbase + const nonce = header.nonce + const latestVote: CliqueVote = [header.number, [signer, beneficiary, nonce]] + + // Do two rounds here, one to execute on a potential previously reached consensus + // on the newly touched beneficiary, one with the added new vote + for (let round = 1; round <= 2; round++) { + // See if there is a new majority consensus to update the signer list + const lastEpochBlockNumber = + header.number - (header.number % BigInt(this.blockchain._common.consensusConfig().epoch)) + const limit = this.cliqueSignerLimit() + let activeSigners = this.cliqueActiveSigners() + let consensus = false + + // AUTH vote analysis + let votes = this._cliqueLatestVotes.filter((vote) => { + return ( + vote[0] >= BigInt(lastEpochBlockNumber) && + !vote[1][0].equals(signer) && + vote[1][1].equals(beneficiary) && + vote[1][2].equals(CLIQUE_NONCE_AUTH) + ) + }) + const beneficiaryVotesAUTH: Address[] = [] + for (const vote of votes) { + const num = beneficiaryVotesAUTH.filter((voteCMP) => { + return voteCMP.equals(vote[1][0]) + }).length + if (num === 0) { + beneficiaryVotesAUTH.push(vote[1][0]) + } + } + let numBeneficiaryVotesAUTH = beneficiaryVotesAUTH.length + if (round === 2 && nonce.equals(CLIQUE_NONCE_AUTH)) { + numBeneficiaryVotesAUTH += 1 + } + // Majority consensus + if (numBeneficiaryVotesAUTH >= limit) { + consensus = true + // Authorize new signer + activeSigners.push(beneficiary) + activeSigners.sort((a, b) => { + // Sort by buffer size + return a.toBuffer().compare(b.toBuffer()) + }) + // Discard votes for added signer + this._cliqueLatestVotes = this._cliqueLatestVotes.filter( + (vote) => !vote[1][1].equals(beneficiary) + ) + debug(`[Block ${header.number}] Clique majority consensus (AUTH ${beneficiary})`) + } + // DROP vote + votes = this._cliqueLatestVotes.filter((vote) => { + return ( + vote[0] >= BigInt(lastEpochBlockNumber) && + !vote[1][0].equals(signer) && + vote[1][1].equals(beneficiary) && + vote[1][2].equals(CLIQUE_NONCE_DROP) + ) + }) + const beneficiaryVotesDROP: Address[] = [] + for (const vote of votes) { + const num = beneficiaryVotesDROP.filter((voteCMP) => { + return voteCMP.equals(vote[1][0]) + }).length + if (num === 0) { + beneficiaryVotesDROP.push(vote[1][0]) + } + } + let numBeneficiaryVotesDROP = beneficiaryVotesDROP.length + + if (round === 2 && nonce.equals(CLIQUE_NONCE_DROP)) { + numBeneficiaryVotesDROP += 1 + } + // Majority consensus + if (numBeneficiaryVotesDROP >= limit) { + consensus = true + // Drop signer + activeSigners = activeSigners.filter((signer) => !signer.equals(beneficiary)) + this._cliqueLatestVotes = this._cliqueLatestVotes.filter( + // Discard votes from removed signer and for removed signer + (vote) => !vote[1][0].equals(beneficiary) && !vote[1][1].equals(beneficiary) + ) + debug(`[Block ${header.number}] Clique majority consensus (DROP ${beneficiary})`) + } + if (round === 1) { + // Always add the latest vote to the history no matter if already voted + // the same vote or not + this._cliqueLatestVotes.push(latestVote) + debug( + `[Block ${header.number}] New clique vote: ${signer} -> ${beneficiary} ${ + nonce.equals(CLIQUE_NONCE_AUTH) ? 'AUTH' : 'DROP' + }` + ) + } + if (consensus) { + if (round === 1) { + debug( + `[Block ${header.number}] Clique majority consensus on existing votes -> update signer states` + ) + } else { + debug( + `[Block ${header.number}] Clique majority consensus on new vote -> update signer states` + ) + } + const newSignerState: CliqueSignerState = [header.number, activeSigners] + await this.cliqueUpdateSignerStates(newSignerState) + return + } + } + } + + // trim to lastEpochBlockNumber - CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT + const limit = this.CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT + const blockSigners = this._cliqueLatestBlockSigners + const lastBlockNumber = blockSigners[blockSigners.length - 1]?.[0] + if (lastBlockNumber) { + const lastEpochBlockNumber = + lastBlockNumber - + (lastBlockNumber % BigInt(this.blockchain._common.consensusConfig().epoch)) + const blockLimit = lastEpochBlockNumber - BigInt(limit) + this._cliqueLatestVotes = this._cliqueLatestVotes.filter((state) => state[0] >= blockLimit) + } + + // save votes to db + const formatted = this._cliqueLatestVotes.map((v) => [ + bigIntToBuffer(v[0]), + [v[1][0].toBuffer(), v[1][1].toBuffer(), v[1][2]], + ]) + await this.blockchain.db.put(CLIQUE_VOTES_KEY, rlp.encode(formatted), DB_OPTS) + } + + /** + * Returns a list with the current block signers + * (only clique PoA, throws otherwise) + */ + cliqueActiveSigners(): Address[] { + const signers = this._cliqueLatestSignerStates + if (signers.length === 0) { + return [] + } + return [...signers[signers.length - 1][1]] + } + + /** + * Number of consecutive blocks out of which a signer may only sign one. + * Defined as `Math.floor(SIGNER_COUNT / 2) + 1` to enforce majority consensus. + * signer count -> signer limit: + * 1 -> 1, 2 -> 2, 3 -> 2, 4 -> 2, 5 -> 3, ... + * @hidden + */ + private cliqueSignerLimit() { + return Math.floor(this.cliqueActiveSigners().length / 2) + 1 + } + + /** + * Checks if signer was recently signed. + * Returns true if signed too recently: more than once per {@link CliqueConsensus.cliqueSignerLimit} consecutive blocks. + * @param header BlockHeader + * @hidden + */ + private cliqueCheckRecentlySigned(header: BlockHeader): boolean { + if (header.isGenesis() || header.number === BigInt(1)) { + // skip genesis, first block + return false + } + const limit = this.cliqueSignerLimit() + // construct recent block signers list with this block + let signers = this._cliqueLatestBlockSigners + signers = signers.slice(signers.length < limit ? 0 : 1) + signers.push([header.number, header.cliqueSigner()]) + const seen = signers.filter((s) => s[1].equals(header.cliqueSigner())).length + return seen > 1 + } + + /** + * Remove clique snapshots with blockNumber higher than input. + * @param blockNumber - the block number from which we start deleting + * @hidden + */ + private async _cliqueDeleteSnapshots(blockNumber: bigint) { + // remove blockNumber from clique snapshots + // (latest signer states, latest votes, latest block signers) + this._cliqueLatestSignerStates = this._cliqueLatestSignerStates.filter( + (s) => s[0] <= blockNumber + ) + await this.cliqueUpdateSignerStates() + + this._cliqueLatestVotes = this._cliqueLatestVotes.filter((v) => v[0] <= blockNumber) + await this.cliqueUpdateVotes() + + this._cliqueLatestBlockSigners = this._cliqueLatestBlockSigners.filter( + (s) => s[0] <= blockNumber + ) + await this.cliqueUpdateLatestBlockSigners() + } + + /** + * Update snapshot of latest clique block signers. + * Used for checking for 'recently signed' error. + * Length trimmed to {@link Blockchain.cliqueSignerLimit}. + * @param header BlockHeader + * @hidden + */ + private async cliqueUpdateLatestBlockSigners(header?: BlockHeader) { + if (header) { + if (header.isGenesis()) { + return + } + // add this block's signer + const signer: CliqueBlockSigner = [header.number, header.cliqueSigner()] + this._cliqueLatestBlockSigners.push(signer) + + // trim length to `this.cliqueSignerLimit()` + const length = this._cliqueLatestBlockSigners.length + const limit = this.cliqueSignerLimit() + if (length > limit) { + this._cliqueLatestBlockSigners = this._cliqueLatestBlockSigners.slice( + length - limit, + length + ) + } + } + + // save to db + const formatted = this._cliqueLatestBlockSigners.map((b) => [ + bigIntToBuffer(b[0]), + b[1].toBuffer(), + ]) + await this.blockchain.db.put(CLIQUE_BLOCK_SIGNERS_SNAPSHOT_KEY, rlp.encode(formatted), DB_OPTS) + } + + /** + * Fetches clique signers. + * @hidden + */ + private async getCliqueLatestSignerStates(): Promise { + try { + const signerStates = await this.blockchain.db.get(CLIQUE_SIGNERS_KEY, DB_OPTS) + const states = (rlp.decode(signerStates)) as [Buffer, Buffer[]] + return states.map((state) => { + const blockNum = bufferToBigInt(state[0] as Buffer) + const addrs = (state[1]).map((buf: Buffer) => new Address(buf)) + return [blockNum, addrs] + }) as CliqueLatestSignerStates + } catch (error: any) { + if (error.type === 'NotFoundError') { + return [] + } + throw error + } + } + + /** + * Fetches clique votes. + * @hidden + */ + private async getCliqueLatestVotes(): Promise { + try { + const signerVotes = await this.blockchain.db.get(CLIQUE_VOTES_KEY, DB_OPTS) + const votes = (rlp.decode(signerVotes)) as [Buffer, [Buffer, Buffer, Buffer]] + return votes.map((vote) => { + const blockNum = bufferToBigInt(vote[0] as Buffer) + const signer = new Address((vote[1] as any)[0]) + const beneficiary = new Address((vote[1] as any)[1]) + const nonce = (vote[1] as any)[2] + return [blockNum, [signer, beneficiary, nonce]] + }) as CliqueLatestVotes + } catch (error: any) { + if (error.type === 'NotFoundError') { + return [] + } + throw error + } + } + + /** + * Fetches snapshot of clique signers. + * @hidden + */ + private async getCliqueLatestBlockSigners(): Promise { + try { + const blockSigners = await this.blockchain.db.get(CLIQUE_BLOCK_SIGNERS_SNAPSHOT_KEY, DB_OPTS) + const signers = (rlp.decode(blockSigners)) as [Buffer, Buffer][] + return signers.map((s) => { + const blockNum = bufferToBigInt(s[0] as Buffer) + const signer = new Address(s[1] as any) + return [blockNum, signer] + }) as CliqueLatestBlockSigners + } catch (error: any) { + if (error.type === 'NotFoundError') { + return [] + } + throw error + } + } + + /** + * Build clique snapshots. + * @param header - the new block header + * @hidden + */ + private async _cliqueBuildSnapshots(header: BlockHeader) { + if (!header.cliqueIsEpochTransition()) { + await this.cliqueUpdateVotes(header) + } + await this.cliqueUpdateLatestBlockSigners(header) + } + + /** + * Helper to determine if a signer is in or out of turn for the next block. + * @param signer The signer address + */ + async cliqueSignerInTurn(signer: Address): Promise { + const signers = this.cliqueActiveSigners() + const signerIndex = signers.findIndex((address) => address.equals(signer)) + if (signerIndex === -1) { + throw new Error('Signer not found') + } + const { number } = await this.blockchain.getCanonicalHeadHeader() + //eslint-disable-next-line + return (number + BigInt(1)) % BigInt(signers.length) === BigInt(signerIndex) + } +} diff --git a/packages/blockchain/src/consensus/ethash.ts b/packages/blockchain/src/consensus/ethash.ts new file mode 100644 index 00000000000..537ab4cf24e --- /dev/null +++ b/packages/blockchain/src/consensus/ethash.ts @@ -0,0 +1,28 @@ +import { Block } from '@ethereumjs/block' +import Ethash from '@ethereumjs/ethash' +import Blockchain from '..' +import { Consensus, ConsensusOptions } from './interface' + +/** + * This class encapsulates Ethash-related consensus functionality when used with the Blockchain class. + */ +export class EthashConsensus implements Consensus { + blockchain: Blockchain + _ethash: Ethash + + constructor({ blockchain }: ConsensusOptions) { + this.blockchain = blockchain + this._ethash = new Ethash(this.blockchain.db) + } + + async validate(block: Block): Promise { + const valid = await this._ethash.verifyPOW(block) + if (!valid) { + throw new Error('invalid POW') + } + } + + public async genesisInit(): Promise {} + public async setup(): Promise {} + public async newBlock(): Promise {} +} diff --git a/packages/blockchain/src/consensus/index.ts b/packages/blockchain/src/consensus/index.ts new file mode 100644 index 00000000000..171aa9127c2 --- /dev/null +++ b/packages/blockchain/src/consensus/index.ts @@ -0,0 +1,6 @@ +import { CasperConsensus } from './casper' +import { CliqueConsensus } from './clique' +import { Consensus } from './interface' +import { EthashConsensus } from './ethash' + +export { CasperConsensus, CliqueConsensus, Consensus, EthashConsensus } diff --git a/packages/blockchain/src/consensus/interface.ts b/packages/blockchain/src/consensus/interface.ts new file mode 100644 index 00000000000..e762180069e --- /dev/null +++ b/packages/blockchain/src/consensus/interface.ts @@ -0,0 +1,43 @@ +import { Block, BlockHeader } from '@ethereumjs/block' +import Blockchain from '..' + +/** + * Interface that a consensus class needs to implement. + */ +export interface Consensus { + /** + * Initialize genesis for consensus mechanism + * @param genesisBlock genesis block + */ + genesisInit(genesisBlock: Block): Promise + + /** + * Set up consensus mechanism + */ + setup(): Promise + + /** + * Validate block + * @param block block to be validated + */ + validate(block: Block): Promise + + /** + * Update consensus on new block + * @param block new block + * @param commonAncestor common ancestor block header (optional) + * @param ancientHeaders array of ancestor block headers (optional) + */ + newBlock( + block: Block, + commonAncestor?: BlockHeader, + ancientHeaders?: BlockHeader[] + ): Promise +} + +/** + * Options when initializing a class that implements the Consensus interface. + */ +export interface ConsensusOptions { + blockchain: Blockchain +} diff --git a/packages/blockchain/src/db/constants.ts b/packages/blockchain/src/db/constants.ts index 2b0cbda70d2..859ecc47108 100644 --- a/packages/blockchain/src/db/constants.ts +++ b/packages/blockchain/src/db/constants.ts @@ -14,21 +14,6 @@ const HEAD_HEADER_KEY = 'LastHeader' */ const HEAD_BLOCK_KEY = 'LastBlock' -/** - * Cique signers - */ -const CLIQUE_SIGNERS_KEY = 'CliqueSigners' - -/** - * Clique votes - */ -const CLIQUE_VOTES_KEY = 'CliqueVotes' - -/** - * Cique block signers (snapshot) - */ -const CLIQUE_BLOCK_SIGNERS_KEY = 'CliqueBlockSignersSnapshot' - /** * headerPrefix + number + hash -> header */ @@ -79,9 +64,6 @@ export { HEADS_KEY, HEAD_HEADER_KEY, HEAD_BLOCK_KEY, - CLIQUE_SIGNERS_KEY, - CLIQUE_VOTES_KEY, - CLIQUE_BLOCK_SIGNERS_KEY, bufBE8, tdKey, headerKey, diff --git a/packages/blockchain/src/db/manager.ts b/packages/blockchain/src/db/manager.ts index f89e00f1b22..52c559266a0 100644 --- a/packages/blockchain/src/db/manager.ts +++ b/packages/blockchain/src/db/manager.ts @@ -1,7 +1,6 @@ -import { Address, rlp, bufferToBigInt } from 'ethereumjs-util' +import { bufferToBigInt, rlp } from 'ethereumjs-util' import { Block, BlockHeader, BlockOptions, BlockBuffer, BlockBodyBuffer } from '@ethereumjs/block' import Common from '@ethereumjs/common' -import { CliqueLatestSignerStates, CliqueLatestVotes, CliqueLatestBlockSigners } from '../clique' import Cache from './cache' import { DatabaseKey, DBOp, DBTarget, DBOpData } from './operation' @@ -67,68 +66,6 @@ export class DBManager { return this.get(DBTarget.HeadBlock) } - /** - * Fetches clique signers. - */ - async getCliqueLatestSignerStates(): Promise { - try { - const signerStates = await this.get(DBTarget.CliqueSignerStates) - const states = (rlp.decode(signerStates)) as [Buffer, Buffer[]] - return states.map((state) => { - const blockNum = bufferToBigInt(state[0] as Buffer) - const addrs = (state[1]).map((buf: Buffer) => new Address(buf)) - return [blockNum, addrs] - }) as CliqueLatestSignerStates - } catch (error: any) { - if (error.type === 'NotFoundError') { - return [] - } - throw error - } - } - - /** - * Fetches clique votes. - */ - async getCliqueLatestVotes(): Promise { - try { - const signerVotes = await this.get(DBTarget.CliqueVotes) - const votes = (rlp.decode(signerVotes)) as [Buffer, [Buffer, Buffer, Buffer]] - return votes.map((vote) => { - const blockNum = bufferToBigInt(vote[0] as Buffer) - const signer = new Address((vote[1] as any)[0]) - const beneficiary = new Address((vote[1] as any)[1]) - const nonce = (vote[1] as any)[2] - return [blockNum, [signer, beneficiary, nonce]] - }) as CliqueLatestVotes - } catch (error: any) { - if (error.type === 'NotFoundError') { - return [] - } - throw error - } - } - - /** - * Fetches snapshot of clique signers. - */ - async getCliqueLatestBlockSigners(): Promise { - try { - const blockSigners = await this.get(DBTarget.CliqueBlockSigners) - const signers = (rlp.decode(blockSigners)) as [Buffer, Buffer][] - return signers.map((s) => { - const blockNum = bufferToBigInt(s[0] as Buffer) - const signer = new Address(s[1] as any) - return [blockNum, signer] - }) as CliqueLatestBlockSigners - } catch (error: any) { - if (error.type === 'NotFoundError') { - return [] - } - throw error - } - } - /** * Fetches a block (header and body) given a block id, * which can be either its hash or its number. diff --git a/packages/blockchain/src/db/operation.ts b/packages/blockchain/src/db/operation.ts index 254463dc932..0e7e74a454f 100644 --- a/packages/blockchain/src/db/operation.ts +++ b/packages/blockchain/src/db/operation.ts @@ -7,9 +7,6 @@ import { bodyKey, numberToHashKey, hashToNumberKey, - CLIQUE_SIGNERS_KEY as CLIQUE_SIGNER_STATES_KEY, - CLIQUE_VOTES_KEY, - CLIQUE_BLOCK_SIGNERS_KEY, } from './constants' import { CacheMap } from './manager' @@ -102,18 +99,6 @@ export class DBOp { this.cacheString = 'header' break } - case DBTarget.CliqueSignerStates: { - this.baseDBOp.key = CLIQUE_SIGNER_STATES_KEY - break - } - case DBTarget.CliqueVotes: { - this.baseDBOp.key = CLIQUE_VOTES_KEY - break - } - case DBTarget.CliqueBlockSigners: { - this.baseDBOp.key = CLIQUE_BLOCK_SIGNERS_KEY - break - } } } diff --git a/packages/blockchain/src/index.ts b/packages/blockchain/src/index.ts index 6027133a01f..19f100778c6 100644 --- a/packages/blockchain/src/index.ts +++ b/packages/blockchain/src/index.ts @@ -1,28 +1,15 @@ -import { debug as createDebugLogger } from 'debug' import Semaphore from 'semaphore-async-await' -import { Address, rlp, bigIntToBuffer } from 'ethereumjs-util' import { Block, BlockData, BlockHeader } from '@ethereumjs/block' -import Ethash from '@ethereumjs/ethash' import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '@ethereumjs/common' import { DBManager } from './db/manager' import { DBOp, DBSetBlockOrHeader, DBSetTD, DBSetHashToNumber, DBSaveLookups } from './db/helpers' import { DBTarget } from './db/operation' -import { - CliqueSignerState, - CliqueLatestSignerStates, - CliqueVote, - CliqueLatestVotes, - CliqueBlockSigner, - CliqueLatestBlockSigners, - CLIQUE_NONCE_AUTH, - CLIQUE_NONCE_DROP, -} from './clique' +import { CasperConsensus, CliqueConsensus, Consensus, EthashConsensus } from './consensus' + // eslint-disable-next-line implicit-dependencies/no-implicit import type { LevelUp } from 'levelup' const level = require('level-mem') -const debug = createDebugLogger('blockchain:clique') - type OnBlock = (block: Block, reorg: boolean) => Promise | void export interface BlockchainInterface { @@ -124,6 +111,7 @@ export interface BlockchainOptions { * This class stores and interacts with blocks. */ export default class Blockchain implements BlockchainInterface { + consensus: Consensus db: LevelUp dbManager: DBManager @@ -150,60 +138,11 @@ export default class Blockchain implements BlockchainInterface { protected _isInitialized = false private _lock: Semaphore - private _common: Common + _common: Common private _hardforkByHeadBlockNumber: boolean private readonly _validateConsensus: boolean private readonly _validateBlocks: boolean - _ethash?: Ethash - - /** - * Keep signer history data (signer states and votes) - * for all block numbers >= HEAD_BLOCK - CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT - * - * This defines a limit for reorgs on PoA clique chains. - */ - private CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT = 100 - - /** - * List with the latest signer states checkpointed on blocks where - * a change (added new or removed a signer) occurred. - * - * Format: - * [ [BLOCK_NUMBER_1, [SIGNER1, SIGNER 2,]], [BLOCK_NUMBER2, [SIGNER1, SIGNER3]], ...] - * - * The top element from the array represents the list of current signers. - * On reorgs elements from the array are removed until BLOCK_NUMBER > REORG_BLOCK. - * - * Always keep at least one item on the stack. - */ - private _cliqueLatestSignerStates: CliqueLatestSignerStates = [] - - /** - * List with the latest signer votes. - * - * Format: - * [ [BLOCK_NUMBER_1, [SIGNER, BENEFICIARY, AUTH]], [BLOCK_NUMBER_1, [SIGNER, BENEFICIARY, AUTH]] ] - * where AUTH = CLIQUE_NONCE_AUTH | CLIQUE_NONCE_DROP - * - * For votes all elements here must be taken into account with a - * block number >= LAST_EPOCH_BLOCK - * (nevertheless keep entries with blocks before EPOCH_BLOCK in case a reorg happens - * during an epoch change) - * - * On reorgs elements from the array are removed until BLOCK_NUMBER > REORG_BLOCK. - */ - private _cliqueLatestVotes: CliqueLatestVotes = [] - - /** - * List of signers for the last consecutive {@link Blockchain.cliqueSignerLimit} blocks. - * Kept as a snapshot for quickly checking for "recently signed" error. - * Format: [ [BLOCK_NUMBER, SIGNER_ADDRESS], ...] - * - * On reorgs elements from the array are removed until BLOCK_NUMBER > REORG_BLOCK. - */ - private _cliqueLatestBlockSigners: CliqueLatestBlockSigners = [] - /** * Safe creation of a new Blockchain object awaiting the initialization function, * encouraged method to use when creating a blockchain object. @@ -271,12 +210,24 @@ export default class Blockchain implements BlockchainInterface { this.db = opts.db ? opts.db : level() this.dbManager = new DBManager(this.db, this._common) + switch (this._common.consensusAlgorithm()) { + case ConsensusAlgorithm.Casper: + this.consensus = new CasperConsensus({ blockchain: this }) + break + case ConsensusAlgorithm.Clique: + this.consensus = new CliqueConsensus({ blockchain: this }) + break + case ConsensusAlgorithm.Ethash: + this.consensus = new EthashConsensus({ blockchain: this }) + break + default: + throw new Error(`consensus algorithm ${this._common.consensusAlgorithm()} not supported`) + } + if (this._validateConsensus) { if (this._common.consensusType() === ConsensusType.ProofOfWork) { if (this._common.consensusAlgorithm() !== ConsensusAlgorithm.Ethash) { throw new Error('consensus validation only supported for pow ethash algorithm') - } else { - this._ethash = new Ethash(this.db) } } if (this._common.consensusType() === ConsensusType.ProofOfAuthority) { @@ -362,17 +313,10 @@ export default class Blockchain implements BlockchainInterface { await this.dbManager.batch(dbOps) - if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique) { - await this.cliqueSaveGenesisSigners(genesisBlock) - } + await this.consensus.genesisInit(genesisBlock) } - // Clique: read current signer states, signer votes, and block signers - if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique) { - this._cliqueLatestSignerStates = await this.dbManager.getCliqueLatestSignerStates() - this._cliqueLatestVotes = await this.dbManager.getCliqueLatestVotes() - this._cliqueLatestBlockSigners = await this.dbManager.getCliqueLatestBlockSigners() - } + await this.consensus.setup() // At this point, we can safely set genesisHash as the _genesis hash in this // object: it is either the one we put in the DB, or it is equal to the one @@ -438,296 +382,6 @@ export default class Blockchain implements BlockchainInterface { } } - private _requireClique() { - if (this._common.consensusAlgorithm() !== ConsensusAlgorithm.Clique) { - throw new Error('Function call only supported for clique PoA networks') - } - } - - /** - * Checks if signer was recently signed. - * Returns true if signed too recently: more than once per {@link Blockchain.cliqueSignerLimit} consecutive blocks. - * @param header BlockHeader - * @hidden - */ - private cliqueCheckRecentlySigned(header: BlockHeader): boolean { - if (header.isGenesis() || header.number === BigInt(1)) { - // skip genesis, first block - return false - } - const limit = this.cliqueSignerLimit() - // construct recent block signers list with this block - let signers = this._cliqueLatestBlockSigners - signers = signers.slice(signers.length < limit ? 0 : 1) - signers.push([header.number, header.cliqueSigner()]) - const seen = signers.filter((s) => s[1].equals(header.cliqueSigner())).length - return seen > 1 - } - - /** - * Save genesis signers to db - * @param genesisBlock genesis block - * @hidden - */ - private async cliqueSaveGenesisSigners(genesisBlock: Block) { - const genesisSignerState: CliqueSignerState = [ - BigInt(0), - genesisBlock.header.cliqueEpochTransitionSigners(), - ] - await this.cliqueUpdateSignerStates(genesisSignerState) - debug(`[Block 0] Genesis block -> update signer states`) - await this.cliqueUpdateVotes() - } - - /** - * Save signer state to db - * @param signerState - * @hidden - */ - private async cliqueUpdateSignerStates(signerState?: CliqueSignerState) { - const dbOps: DBOp[] = [] - - if (signerState) { - this._cliqueLatestSignerStates.push(signerState) - } - - // trim to CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT - const limit = this.CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT - const blockSigners = this._cliqueLatestBlockSigners - const lastBlockNumber = blockSigners[blockSigners.length - 1]?.[0] - if (lastBlockNumber) { - const blockLimit = lastBlockNumber - BigInt(limit) - const states = this._cliqueLatestSignerStates - const lastItem = states[states.length - 1] - this._cliqueLatestSignerStates = states.filter((state) => state[0] >= blockLimit) - if (this._cliqueLatestSignerStates.length === 0) { - // always keep at least one item on the stack - this._cliqueLatestSignerStates.push(lastItem) - } - } - - // save to db - const formatted = this._cliqueLatestSignerStates.map((state) => [ - bigIntToBuffer(state[0]), - state[1].map((a) => a.toBuffer()), - ]) - dbOps.push(DBOp.set(DBTarget.CliqueSignerStates, rlp.encode(formatted))) - - await this.dbManager.batch(dbOps) - // Output active signers for debugging purposes - let i = 0 - for (const signer of this.cliqueActiveSigners()) { - debug(`Clique signer [${i}]: ${signer}`) - i++ - } - } - - /** - * Update clique votes and save to db - * @param header BlockHeader - * @hidden - */ - private async cliqueUpdateVotes(header?: BlockHeader) { - // Block contains a vote on a new signer - if (header && !header.coinbase.isZero()) { - const signer = header.cliqueSigner() - const beneficiary = header.coinbase - const nonce = header.nonce - const latestVote: CliqueVote = [header.number, [signer, beneficiary, nonce]] - - // Do two rounds here, one to execute on a potential previously reached consensus - // on the newly touched beneficiary, one with the added new vote - for (let round = 1; round <= 2; round++) { - // See if there is a new majority consensus to update the signer list - const lastEpochBlockNumber = - header.number - (header.number % BigInt(this._common.consensusConfig().epoch)) - const limit = this.cliqueSignerLimit() - let activeSigners = this.cliqueActiveSigners() - let consensus = false - - // AUTH vote analysis - let votes = this._cliqueLatestVotes.filter((vote) => { - return ( - vote[0] >= BigInt(lastEpochBlockNumber) && - !vote[1][0].equals(signer) && - vote[1][1].equals(beneficiary) && - vote[1][2].equals(CLIQUE_NONCE_AUTH) - ) - }) - const beneficiaryVotesAUTH: Address[] = [] - for (const vote of votes) { - const num = beneficiaryVotesAUTH.filter((voteCMP) => { - return voteCMP.equals(vote[1][0]) - }).length - if (num === 0) { - beneficiaryVotesAUTH.push(vote[1][0]) - } - } - let numBeneficiaryVotesAUTH = beneficiaryVotesAUTH.length - if (round === 2 && nonce.equals(CLIQUE_NONCE_AUTH)) { - numBeneficiaryVotesAUTH += 1 - } - // Majority consensus - if (numBeneficiaryVotesAUTH >= limit) { - consensus = true - // Authorize new signer - activeSigners.push(beneficiary) - activeSigners.sort((a, b) => { - // Sort by buffer size - return a.toBuffer().compare(b.toBuffer()) - }) - // Discard votes for added signer - this._cliqueLatestVotes = this._cliqueLatestVotes.filter( - (vote) => !vote[1][1].equals(beneficiary) - ) - debug(`[Block ${header.number}] Clique majority consensus (AUTH ${beneficiary})`) - } - // DROP vote - votes = this._cliqueLatestVotes.filter((vote) => { - return ( - vote[0] >= BigInt(lastEpochBlockNumber) && - !vote[1][0].equals(signer) && - vote[1][1].equals(beneficiary) && - vote[1][2].equals(CLIQUE_NONCE_DROP) - ) - }) - const beneficiaryVotesDROP: Address[] = [] - for (const vote of votes) { - const num = beneficiaryVotesDROP.filter((voteCMP) => { - return voteCMP.equals(vote[1][0]) - }).length - if (num === 0) { - beneficiaryVotesDROP.push(vote[1][0]) - } - } - let numBeneficiaryVotesDROP = beneficiaryVotesDROP.length - - if (round === 2 && nonce.equals(CLIQUE_NONCE_DROP)) { - numBeneficiaryVotesDROP += 1 - } - // Majority consensus - if (numBeneficiaryVotesDROP >= limit) { - consensus = true - // Drop signer - activeSigners = activeSigners.filter((signer) => !signer.equals(beneficiary)) - this._cliqueLatestVotes = this._cliqueLatestVotes.filter( - // Discard votes from removed signer and for removed signer - (vote) => !vote[1][0].equals(beneficiary) && !vote[1][1].equals(beneficiary) - ) - debug(`[Block ${header.number}] Clique majority consensus (DROP ${beneficiary})`) - } - if (round === 1) { - // Always add the latest vote to the history no matter if already voted - // the same vote or not - this._cliqueLatestVotes.push(latestVote) - debug( - `[Block ${header.number}] New clique vote: ${signer} -> ${beneficiary} ${ - nonce.equals(CLIQUE_NONCE_AUTH) ? 'AUTH' : 'DROP' - }` - ) - } - if (consensus) { - if (round === 1) { - debug( - `[Block ${header.number}] Clique majority consensus on existing votes -> update signer states` - ) - } else { - debug( - `[Block ${header.number}] Clique majority consensus on new vote -> update signer states` - ) - } - const newSignerState: CliqueSignerState = [header.number, activeSigners] - await this.cliqueUpdateSignerStates(newSignerState) - return - } - } - } - - // trim to lastEpochBlockNumber - CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT - const limit = this.CLIQUE_SIGNER_HISTORY_BLOCK_LIMIT - const blockSigners = this._cliqueLatestBlockSigners - const lastBlockNumber = blockSigners[blockSigners.length - 1]?.[0] - if (lastBlockNumber) { - const lastEpochBlockNumber = - lastBlockNumber - (lastBlockNumber % BigInt(this._common.consensusConfig().epoch)) - const blockLimit = lastEpochBlockNumber - BigInt(limit) - this._cliqueLatestVotes = this._cliqueLatestVotes.filter((state) => state[0] >= blockLimit) - } - - // save votes to db - const dbOps: DBOp[] = [] - const formatted = this._cliqueLatestVotes.map((v) => [ - bigIntToBuffer(v[0]), - [v[1][0].toBuffer(), v[1][1].toBuffer(), v[1][2]], - ]) - dbOps.push(DBOp.set(DBTarget.CliqueVotes, rlp.encode(formatted))) - - await this.dbManager.batch(dbOps) - } - - /** - * Update snapshot of latest clique block signers. - * Used for checking for 'recently signed' error. - * Length trimmed to {@link Blockchain.cliqueSignerLimit}. - * @param header BlockHeader - * @hidden - */ - private async cliqueUpdateLatestBlockSigners(header?: BlockHeader) { - const dbOps: DBOp[] = [] - - if (header) { - if (header.isGenesis()) { - return - } - // add this block's signer - const signer: CliqueBlockSigner = [header.number, header.cliqueSigner()] - this._cliqueLatestBlockSigners.push(signer) - - // trim length to `this.cliqueSignerLimit()` - const length = this._cliqueLatestBlockSigners.length - const limit = this.cliqueSignerLimit() - if (length > limit) { - this._cliqueLatestBlockSigners = this._cliqueLatestBlockSigners.slice( - length - limit, - length - ) - } - } - - // save to db - const formatted = this._cliqueLatestBlockSigners.map((b) => [ - bigIntToBuffer(b[0]), - b[1].toBuffer(), - ]) - dbOps.push(DBOp.set(DBTarget.CliqueBlockSigners, rlp.encode(formatted))) - - await this.dbManager.batch(dbOps) - } - - /** - * Returns a list with the current block signers - * (only clique PoA, throws otherwise) - */ - public cliqueActiveSigners(): Address[] { - this._requireClique() - const signers = this._cliqueLatestSignerStates - if (signers.length === 0) { - return [] - } - return [...signers[signers.length - 1][1]] - } - - /** - * Number of consecutive blocks out of which a signer may only sign one. - * Defined as `Math.floor(SIGNER_COUNT / 2) + 1` to enforce majority consensus. - * signer count -> signer limit: - * 1 -> 1, 2 -> 2, 3 -> 2, 4 -> 2, 5 -> 3, ... - * @hidden - */ - private cliqueSignerLimit() { - return Math.floor(this.cliqueActiveSigners().length / 2) + 1 - } - /** * Returns the specified iterator head. * @@ -901,40 +555,7 @@ export default class Blockchain implements BlockchainInterface { } if (this._validateConsensus) { - if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Ethash) { - const valid = await this._ethash!.verifyPOW(block) - if (!valid) { - throw new Error('invalid POW') - } - } - - if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique) { - const valid = header.cliqueVerifySignature(this.cliqueActiveSigners()) - if (!valid) { - throw new Error('invalid PoA block signature (clique)') - } - if (this.cliqueCheckRecentlySigned(header)) { - throw new Error('recently signed') - } - } - } - - if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique) { - // validate checkpoint signers towards active signers on epoch transition blocks - if (header.cliqueIsEpochTransition()) { - // note: keep votes on epoch transition blocks in case of reorgs. - // only active (non-stale) votes will counted (if vote.blockNumber >= lastEpochBlockNumber - - const checkpointSigners = header.cliqueEpochTransitionSigners() - const activeSigners = this.cliqueActiveSigners() - for (const [i, cSigner] of checkpointSigners.entries()) { - if (!activeSigners[i] || !activeSigners[i].equals(cSigner)) { - throw new Error( - `checkpoint signer not found in active signers list at index ${i}: ${cSigner}` - ) - } - } - } + await this.consensus.validate(block) } // set total difficulty in the current context scope @@ -958,16 +579,17 @@ export default class Blockchain implements BlockchainInterface { // save header/block to the database dbOps = dbOps.concat(DBSetBlockOrHeader(block)) - let ancientHeaderNumber: undefined | bigint + let commonAncestor: undefined | BlockHeader + let ancestorHeaders: undefined | BlockHeader[] // if total difficulty is higher than current, add it to canonical chain if ( block.isGenesis() || (block._common.consensusType() !== ConsensusType.ProofOfStake && td > currentTd.header) || block._common.consensusType() === ConsensusType.ProofOfStake ) { - if (this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique) { - ancientHeaderNumber = (await this._findAncient(header)).number - } + const foundCommon = await this.findCommonAncestor(header) + commonAncestor = foundCommon.commonAncestor + ancestorHeaders = foundCommon.ancestorHeaders this._headHeaderHash = blockHash if (item instanceof Block) { @@ -1002,21 +624,7 @@ export default class Blockchain implements BlockchainInterface { const ops = dbOps.concat(this._saveHeadOps()) await this.dbManager.batch(ops) - // Clique: update signer votes and state - if ( - this._common.consensusAlgorithm() === ConsensusAlgorithm.Clique && - ancientHeaderNumber !== undefined - ) { - await this._cliqueDeleteSnapshots(ancientHeaderNumber! + BigInt(1)) - for ( - let number = ancientHeaderNumber! + BigInt(1); - number <= header.number; - number += BigInt(1) - ) { - const canonicalHeader = await this._getCanonicalHeader(number) - await this._cliqueBuildSnapshots(canonicalHeader) - } - } + await this.consensus.newBlock(block, commonAncestor, ancestorHeaders) }) } @@ -1221,7 +829,7 @@ export default class Blockchain implements BlockchainInterface { } try { - const childHeader = await this._getCanonicalHeader(blockNumber + BigInt(1)) + const childHeader = await this.getCanonicalHeader(blockNumber + BigInt(1)) await this._delChild(childHeader.hash(), childHeader.number, headHash, ops) } catch (error: any) { if (error.type !== 'NotFoundError') { @@ -1306,62 +914,39 @@ export default class Blockchain implements BlockchainInterface { * Find the common ancestor of the new block and the old block. * @param newHeader - the new block header */ - private async _findAncient(newHeader: BlockHeader) { + private async findCommonAncestor(newHeader: BlockHeader) { if (!this._headHeaderHash) { throw new Error('No head header set') } + const ancestorHeaders = new Set() + let { header } = await this._getBlock(this._headHeaderHash) if (header.number > newHeader.number) { - header = await this._getCanonicalHeader(newHeader.number) + header = await this.getCanonicalHeader(newHeader.number) + ancestorHeaders.add(header) } else { while (header.number !== newHeader.number && newHeader.number > BigInt(0)) { newHeader = await this._getHeader(newHeader.parentHash, newHeader.number - BigInt(1)) + ancestorHeaders.add(newHeader) } } if (header.number !== newHeader.number) { throw new Error('Failed to find ancient header') } while (!header.hash().equals(newHeader.hash()) && header.number > BigInt(0)) { - header = await this._getCanonicalHeader(header.number - BigInt(1)) + header = await this.getCanonicalHeader(header.number - BigInt(1)) + ancestorHeaders.add(header) newHeader = await this._getHeader(newHeader.parentHash, newHeader.number - BigInt(1)) + ancestorHeaders.add(newHeader) } if (!header.hash().equals(newHeader.hash())) { throw new Error('Failed to find ancient header') } - return header - } - - /** - * Build clique snapshots. - * @param header - the new block header - */ - private async _cliqueBuildSnapshots(header: BlockHeader) { - if (!header.cliqueIsEpochTransition()) { - await this.cliqueUpdateVotes(header) + return { + commonAncestor: header, + ancestorHeaders: Array.from(ancestorHeaders), } - await this.cliqueUpdateLatestBlockSigners(header) - } - - /** - * Remove clique snapshots with blockNumber higher than input. - * @param blockNumber - the block number from which we start deleting - */ - private async _cliqueDeleteSnapshots(blockNumber: bigint) { - // remove blockNumber from clique snapshots - // (latest signer states, latest votes, latest block signers) - this._cliqueLatestSignerStates = this._cliqueLatestSignerStates.filter( - (s) => s[0] <= blockNumber - ) - await this.cliqueUpdateSignerStates() - - this._cliqueLatestVotes = this._cliqueLatestVotes.filter((v) => v[0] <= blockNumber) - await this.cliqueUpdateVotes() - - this._cliqueLatestBlockSigners = this._cliqueLatestBlockSigners.filter( - (s) => s[0] <= blockNumber - ) - await this.cliqueUpdateLatestBlockSigners() } /** @@ -1527,10 +1112,8 @@ export default class Blockchain implements BlockchainInterface { /** * Gets a header by number. Header must be in the canonical chain - * - * @hidden */ - private async _getCanonicalHeader(number: bigint) { + async getCanonicalHeader(number: bigint) { const hash = await this.dbManager.numberToHash(number) return this._getHeader(hash, number) } @@ -1552,18 +1135,6 @@ export default class Blockchain implements BlockchainInterface { return false } } - - /** - * Helper to determine if a signer is in or out of turn for the next block. - * @param signer The signer address - */ - async cliqueSignerInTurn(signer: Address): Promise { - const signers = this.cliqueActiveSigners() - const signerIndex = signers.findIndex((address) => address.equals(signer)) - if (signerIndex === -1) { - throw new Error('Signer not found') - } - const { number } = await this.getCanonicalHeadHeader() - return (number + BigInt(1)) % BigInt(signers.length) === BigInt(signerIndex) - } } + +export { Consensus, CasperConsensus, CliqueConsensus, EthashConsensus } diff --git a/packages/blockchain/test/clique.spec.ts b/packages/blockchain/test/clique.spec.ts index 36daa55d219..c32f74b9936 100644 --- a/packages/blockchain/test/clique.spec.ts +++ b/packages/blockchain/test/clique.spec.ts @@ -3,7 +3,7 @@ import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '@eth import { Address } from 'ethereumjs-util' import tape from 'tape' import Blockchain from '../src' -import { CLIQUE_NONCE_AUTH, CLIQUE_NONCE_DROP } from '../src/clique' +import { CliqueConsensus, CLIQUE_NONCE_AUTH, CLIQUE_NONCE_DROP } from '../src/consensus/clique' tape('Clique: Initialization', (t) => { t.test('should initialize a clique blockchain', async (st) => { @@ -14,7 +14,7 @@ tape('Clique: Initialization', (t) => { st.equals(head.hash().toString('hex'), common.genesis().hash.slice(2), 'correct genesis hash') st.deepEquals( - blockchain.cliqueActiveSigners(), + (blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), head.header.cliqueEpochTransitionSigners(), 'correct genesis signers' ) @@ -166,7 +166,7 @@ tape('Clique: Initialization', (t) => { } // calculate difficulty - const signers = blockchain.cliqueActiveSigners() + const signers = (blockchain.consensus as CliqueConsensus).cliqueActiveSigners() const signerIndex = signers.findIndex((address: Address) => address.equals(signer.address)) const inTurn = number % signers.length === signerIndex blockData.header.difficulty = inTurn ? BigInt(2) : BigInt(1) @@ -184,7 +184,8 @@ tape('Clique: Initialization', (t) => { t.test('should throw if signer in epoch checkpoint is not active', async (st) => { const { blockchain } = await initWithSigners([A]) ;(blockchain as any)._validateBlocks = false - ;(blockchain as any)._validateConsensus = false + // _validateConsensus needs to be true to trigger this test condition + ;(blockchain as any)._validateConsensus = true const number = COMMON.consensusConfig().epoch const unauthorizedSigner = Address.fromString('0x00a839de7922491683f547a67795204763ff8237') const extraData = Buffer.concat([ @@ -193,7 +194,10 @@ tape('Clique: Initialization', (t) => { unauthorizedSigner.toBuffer(), Buffer.alloc(65), ]) - const block = Block.fromBlockData({ header: { number, extraData } }, { common: COMMON }) + const block = Block.fromBlockData( + { header: { number, extraData } }, + { common: COMMON, cliqueSigner: A.privateKey } + ) try { await blockchain.putBlock(block) st.fail('should fail') @@ -273,7 +277,7 @@ tape('Clique: Initialization', (t) => { const { blocks, blockchain } = await initWithSigners([A]) const block = await addNextBlock(blockchain, blocks, A) st.equal(block.header.number, BigInt(1)) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address]) + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [A.address]) st.end() }) @@ -283,7 +287,7 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, B) await addNextBlock(blockchain, blocks, A, [C, true]) st.deepEqual( - blockchain.cliqueActiveSigners(), + (blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [A.address, B.address], 'only accept first, second needs 2 votes' ) @@ -301,7 +305,7 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, B, [E, true]) st.deepEqual( - blockchain.cliqueActiveSigners(), + (blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [A.address, B.address, C.address, D.address], 'only accept first two, third needs 3 votes already' ) @@ -313,7 +317,7 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, A, [A, false]) st.deepEqual( - blockchain.cliqueActiveSigners(), + (blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [], 'weird, but one less cornercase by explicitly allowing this' ) @@ -326,7 +330,11 @@ tape('Clique: Initialization', (t) => { const { blocks, blockchain } = await initWithSigners([A, B]) await addNextBlock(blockchain, blocks, A, [B, false]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address], 'not fulfilled') + st.deepEqual( + (blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), + [A.address, B.address], + 'not fulfilled' + ) st.end() } ) @@ -338,7 +346,11 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, A, [B, false]) await addNextBlock(blockchain, blocks, B, [B, false]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address], 'fulfilled') + st.deepEqual( + (blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), + [A.address], + 'fulfilled' + ) st.end() } ) @@ -348,7 +360,10 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, A, [C, false]) await addNextBlock(blockchain, blocks, B, [C, false]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address]) + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [ + A.address, + B.address, + ]) st.end() }) @@ -359,7 +374,12 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, A, [C, false]) await addNextBlock(blockchain, blocks, B, [C, false]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address, C.address, D.address]) + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [ + A.address, + B.address, + C.address, + D.address, + ]) st.end() } ) @@ -372,7 +392,11 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, B, [D, false]) await addNextBlock(blockchain, blocks, C, [D, false]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address, C.address]) + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [ + A.address, + B.address, + C.address, + ]) st.end() } ) @@ -385,7 +409,10 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, B) await addNextBlock(blockchain, blocks, A, [C, true]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address]) + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [ + A.address, + B.address, + ]) st.end() }) @@ -400,7 +427,12 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, A) await addNextBlock(blockchain, blocks, B, [C, true]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address, C.address, D.address]) + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [ + A.address, + B.address, + C.address, + D.address, + ]) st.end() }) @@ -412,7 +444,10 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, B) await addNextBlock(blockchain, blocks, A, [B, false]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address]) + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [ + A.address, + B.address, + ]) st.end() }) @@ -430,7 +465,10 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, A) await addNextBlock(blockchain, blocks, B, [C, false]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address]) + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [ + A.address, + B.address, + ]) st.end() }) @@ -441,7 +479,11 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, B, [C, false]) await addNextBlock(blockchain, blocks, A, [B, false]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address], 'deauth votes') + st.deepEqual( + (blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), + [A.address, B.address], + 'deauth votes' + ) st.end() }) @@ -452,7 +494,11 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, B, [C, false]) await addNextBlock(blockchain, blocks, A, [D, true]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address], 'auth votes') + st.deepEqual( + (blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), + [A.address, B.address], + 'auth votes' + ) st.end() }) @@ -472,7 +518,10 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, A) await addNextBlock(blockchain, blocks, C, [C, true]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address]) + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [ + A.address, + B.address, + ]) st.end() } ) @@ -493,7 +542,11 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, A) await addNextBlock(blockchain, blocks, B, [C, true]) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address, C.address]) + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [ + A.address, + B.address, + C.address, + ]) st.end() } ) @@ -520,7 +573,7 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, D, [A, false]) await addNextBlock(blockchain, blocks, B, [F, true]) // Finish authorizing F, 3/3 votes needed - st.deepEqual(blockchain.cliqueActiveSigners(), [ + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [ B.address, C.address, D.address, @@ -556,7 +609,10 @@ tape('Clique: Initialization', (t) => { await addNextBlock(blockchain, blocks, A, undefined, [A, B], common) await addNextBlock(blockchain, blocks, B, [C, true], undefined, common) - st.deepEqual(blockchain.cliqueActiveSigners(), [A.address, B.address]) + st.deepEqual((blockchain.consensus as CliqueConsensus).cliqueActiveSigners(), [ + A.address, + B.address, + ]) st.end() } ) @@ -637,24 +693,24 @@ tape('Clique: Initialization', (t) => { const { blocks, blockchain } = await initWithSigners([A, B, C]) // block 1: B, next signer: C await addNextBlock(blockchain, blocks, B) - st.notOk(await blockchain.cliqueSignerInTurn(A.address)) - st.notOk(await blockchain.cliqueSignerInTurn(B.address)) - st.ok(await blockchain.cliqueSignerInTurn(C.address)) + st.notOk(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(A.address)) + st.notOk(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(B.address)) + st.ok(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(C.address)) // block 2: C, next signer: A await addNextBlock(blockchain, blocks, C) - st.ok(await blockchain.cliqueSignerInTurn(A.address)) - st.notOk(await blockchain.cliqueSignerInTurn(B.address)) - st.notOk(await blockchain.cliqueSignerInTurn(C.address)) + st.ok(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(A.address)) + st.notOk(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(B.address)) + st.notOk(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(C.address)) // block 3: A, next signer: B await addNextBlock(blockchain, blocks, A) - st.notOk(await blockchain.cliqueSignerInTurn(A.address)) - st.ok(await blockchain.cliqueSignerInTurn(B.address)) - st.notOk(await blockchain.cliqueSignerInTurn(C.address)) + st.notOk(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(A.address)) + st.ok(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(B.address)) + st.notOk(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(C.address)) // block 4: B, next signer: C await addNextBlock(blockchain, blocks, B) - st.notOk(await blockchain.cliqueSignerInTurn(A.address)) - st.notOk(await blockchain.cliqueSignerInTurn(B.address)) - st.ok(await blockchain.cliqueSignerInTurn(C.address)) + st.notOk(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(A.address)) + st.notOk(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(B.address)) + st.ok(await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn(C.address)) st.end() }) }) diff --git a/packages/blockchain/test/reorg.spec.ts b/packages/blockchain/test/reorg.spec.ts index af5bfc45d00..667bb53eee2 100644 --- a/packages/blockchain/test/reorg.spec.ts +++ b/packages/blockchain/test/reorg.spec.ts @@ -3,7 +3,7 @@ import { Block } from '@ethereumjs/block' import { Address } from 'ethereumjs-util' import tape from 'tape' import Blockchain from '../src' -import { CLIQUE_NONCE_AUTH } from '../src/clique' +import { CliqueConsensus, CLIQUE_NONCE_AUTH } from '../src/consensus/clique' import { generateConsecutiveBlock } from './util' tape('reorg tests', (t) => { @@ -150,7 +150,7 @@ tape('reorg tests', (t) => { await blockchain.putBlocks([block1_high, block2_high, block3_high]) - let signerStates = (blockchain as any)._cliqueLatestSignerStates + let signerStates = (blockchain.consensus as CliqueConsensus)._cliqueLatestSignerStates t.ok( !signerStates.find( (s: any) => s[0] === BigInt(2) && s[1].find((a: Address) => a.equals(beneficiary1)) @@ -158,7 +158,7 @@ tape('reorg tests', (t) => { 'should not find reorged signer state' ) - let signerVotes = (blockchain as any)._cliqueLatestVotes + let signerVotes = (blockchain.consensus as CliqueConsensus)._cliqueLatestVotes t.ok( !signerVotes.find( (v: any) => @@ -170,7 +170,7 @@ tape('reorg tests', (t) => { 'should not find reorged clique vote' ) - let blockSigners = (blockchain as any)._cliqueLatestBlockSigners + let blockSigners = (blockchain.consensus as CliqueConsensus)._cliqueLatestBlockSigners t.ok( !blockSigners.find( (s: any) => s[0] === BigInt(1) && s[1].equals(block1_low.header.cliqueSigner()) @@ -178,7 +178,7 @@ tape('reorg tests', (t) => { 'should not find reorged block signer' ) - signerStates = (blockchain as any)._cliqueLatestSignerStates + signerStates = (blockchain.consensus as CliqueConsensus)._cliqueLatestSignerStates t.ok( !!signerStates.find( (s: any) => s[0] === BigInt(3) && s[1].find((a: Address) => a.equals(beneficiary2)) @@ -186,10 +186,10 @@ tape('reorg tests', (t) => { 'should find reorged signer state' ) - signerVotes = (blockchain as any)._cliqueLatestVotes + signerVotes = (blockchain.consensus as CliqueConsensus)._cliqueLatestVotes t.ok(signerVotes.length === 0, 'votes should be empty') - blockSigners = (blockchain as any)._cliqueLatestBlockSigners + blockSigners = (blockchain.consensus as CliqueConsensus)._cliqueLatestBlockSigners t.ok( !!blockSigners.find( (s: any) => s[0] === BigInt(3) && s[1].equals(block3_high.header.cliqueSigner()) diff --git a/packages/client/lib/miner/miner.ts b/packages/client/lib/miner/miner.ts index b7cf3dda437..8ca5f6c129f 100644 --- a/packages/client/lib/miner/miner.ts +++ b/packages/client/lib/miner/miner.ts @@ -1,5 +1,6 @@ import Ethash, { Solution, Miner as EthashMiner } from '@ethereumjs/ethash' import { BlockHeader } from '@ethereumjs/block' +import { CliqueConsensus } from '@ethereumjs/blockchain' import { ConsensusType, Hardfork } from '@ethereumjs/common' import { Event } from '../types' import { Config } from '../config' @@ -85,9 +86,9 @@ export class Miner { // delay signing by rand(SIGNER_COUNT * 500ms) const [signerAddress] = this.config.accounts[0] const { blockchain } = this.service.chain - const inTurn = await blockchain.cliqueSignerInTurn(signerAddress) + const inTurn = await blockchain.consensus.cliqueSignerInTurn(signerAddress) if (!inTurn) { - const signerCount = blockchain.cliqueActiveSigners().length + const signerCount = blockchain.consensus.cliqueActiveSigners().length timeout += Math.random() * signerCount * 500 } } @@ -185,7 +186,7 @@ export class Miner { { number }, { common: this.config.chainCommon, cliqueSigner } ) - if ((this.service.chain.blockchain as any).cliqueCheckRecentlySigned(header)) { + if ((this.service.chain.blockchain as any).consensus.cliqueCheckRecentlySigned(header)) { this.config.logger.info(`Miner: We have too recently signed, waiting for next block`) this.assembling = false return @@ -215,7 +216,9 @@ export class Miner { const [signerAddress, signerPrivKey] = this.config.accounts[0] cliqueSigner = signerPrivKey // Determine if signer is INTURN (2) or NOTURN (1) - inTurn = await vmCopy.blockchain.cliqueSignerInTurn(signerAddress) + inTurn = await (vmCopy.blockchain.consensus as CliqueConsensus).cliqueSignerInTurn( + signerAddress + ) difficulty = inTurn ? 2 : 1 } diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index f1958e699f5..bb227fc2add 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -4,6 +4,7 @@ import Common, { Chain as CommonChain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction, Transaction } from '@ethereumjs/tx' import { Block, BlockHeader } from '@ethereumjs/block' import { VmState } from '@ethereumjs/vm/dist/vmState' +import { CliqueConsensus } from '@ethereumjs/blockchain' import { Address } from 'ethereumjs-util' import VM from '@ethereumjs/vm' @@ -63,9 +64,11 @@ tape('[Miner]', async (t) => { } blockchain: any = { putBlock: async () => {}, - cliqueActiveSigners: () => [A.address], - cliqueSignerInTurn: async () => true, - cliqueCheckRecentlySigned: () => false, + consensus: { + cliqueActiveSigners: () => [A.address], + cliqueSignerInTurn: async () => true, + cliqueCheckRecentlySigned: () => false, + }, // eslint-disable-next-line no-invalid-this copy: () => this.blockchain, _init: async () => undefined, @@ -370,7 +373,7 @@ tape('[Miner]', async (t) => { const miner = new Miner({ config, service }) const { vm } = service.execution - vm.blockchain.cliqueActiveSigners = () => [A.address] // stub + ;(vm.blockchain.consensus as CliqueConsensus).cliqueActiveSigners = () => [A.address] // stub ;(miner as any).chainUpdated = async () => {} // stub miner.start() await wait(100) diff --git a/packages/vm/examples/run-blockchain.ts b/packages/vm/examples/run-blockchain.ts index 552165c6843..54d70626ed3 100644 --- a/packages/vm/examples/run-blockchain.ts +++ b/packages/vm/examples/run-blockchain.ts @@ -8,7 +8,7 @@ import { Account, Address, toBuffer, setLengthLeft } from 'ethereumjs-util' import { Block } from '@ethereumjs/block' -import Blockchain from '@ethereumjs/blockchain' +import Blockchain, { EthashConsensus } from '@ethereumjs/blockchain' import Common, { ConsensusType } from '@ethereumjs/common' import VM from '../' import { testData } from './helpers/blockchain-mock-data' @@ -31,7 +31,7 @@ async function main() { // Note that this optimization is a bit hacky and might // not be working in the future though. :-) if (validatePow) { - blockchain._ethash!.cacheDB = level('./.cachedb') + (blockchain.consensus as EthashConsensus)._ethash.cacheDB = level('./.cachedb') } const vm = await VM.create({ blockchain, common }) diff --git a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts index 2f02f886937..074c2b10098 100644 --- a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts +++ b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts @@ -1,6 +1,6 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' -import Blockchain from '@ethereumjs/blockchain' +import Blockchain, { EthashConsensus } from '@ethereumjs/blockchain' import Common, { ConsensusAlgorithm } from '@ethereumjs/common' import { TransactionFactory } from '@ethereumjs/tx' import { toBuffer, rlp, stripHexPrefix, bufferToBigInt, isHexPrefixed } from 'ethereumjs-util' @@ -64,7 +64,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: }) if (validatePow) { - blockchain._ethash!.cacheDB = cacheDB + ;(blockchain.consensus as EthashConsensus)._ethash.cacheDB = cacheDB } let VM From 66aa7bdf80aabf437502670bc577c03314bd487d Mon Sep 17 00:00:00 2001 From: harkamal Date: Sat, 30 Apr 2022 13:55:00 +0530 Subject: [PATCH 33/44] Develop rebase fixes (2022-05-04) --- package-lock.json | 38 ++++++------ packages/block/src/block.ts | 2 +- packages/block/src/header.ts | 2 +- packages/client/lib/client.ts | 58 ------------------- packages/client/lib/config.ts | 2 +- packages/client/lib/execution/vmexecution.ts | 2 +- packages/client/lib/miner/miner.ts | 6 +- packages/client/lib/rpc/modules/engine.ts | 3 +- packages/client/lib/service/txpool.ts | 11 ++-- .../lib/sync/fetcher/blockfetcherbase.ts | 21 +++++-- packages/client/lib/sync/fullsync.ts | 20 ++++--- packages/client/lib/sync/lightsync.ts | 9 ++- packages/client/lib/sync/sync.ts | 3 +- .../client/test/miner/pendingBlock.spec.ts | 33 ++++++----- .../test/sync/fetcher/blockfetcher.spec.ts | 19 +++--- packages/client/test/sync/sync.spec.ts | 2 +- packages/client/test/sync/txpool.spec.ts | 4 +- packages/vm/src/index.ts | 6 +- packages/vm/src/runTx.ts | 3 +- .../vm/tests/api/customPrecompiles.spec.ts | 38 ++++++------ 20 files changed, 123 insertions(+), 159 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2828d6883f9..e224c037ecd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19107,7 +19107,7 @@ "version": "3.6.2", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/tx": "^3.5.1", "ethereumjs-util": "^7.1.4", "merkle-patricia-tree": "^4.2.4" @@ -19207,7 +19207,7 @@ "license": "MPL-2.0", "dependencies": { "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/ethash": "^1.1.0", "debug": "^4.3.3", "ethereumjs-util": "^7.1.4", @@ -19307,19 +19307,19 @@ }, "packages/client": { "name": "@ethereumjs/client", - "version": "0.4.0", + "version": "0.4.1", "hasInstallScript": true, "license": "MPL-2.0", "dependencies": { "@chainsafe/libp2p-noise": "^4.1.1", "@ethereumjs/block": "^3.6.2", "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/devp2p": "^4.2.1", "@ethereumjs/ethash": "^1.1.0", "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", - "@ethereumjs/vm": "^5.8.0", + "@ethereumjs/vm": "^5.9.0", "body-parser": "^1.19.2", "chalk": "^4.1.2", "connect": "^3.7.0", @@ -19466,7 +19466,7 @@ }, "packages/common": { "name": "@ethereumjs/common", - "version": "2.6.3", + "version": "2.6.4", "license": "MIT", "dependencies": { "crc-32": "^1.2.0", @@ -19565,7 +19565,7 @@ "version": "4.2.1", "license": "MIT", "dependencies": { - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@types/bl": "^2.1.0", "@types/k-bucket": "^5.0.0", "@types/lru-cache": "^5.1.0", @@ -19757,7 +19757,7 @@ "ethereumjs-util": "^7.1.4" }, "devDependencies": { - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@types/tape": "^4.13.2", "eslint": "^6.8.0", "level-mem": "^5.0.1", @@ -20140,7 +20140,7 @@ "version": "3.5.1", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "ethereumjs-util": "^7.1.4" }, "devDependencies": { @@ -20281,12 +20281,12 @@ }, "packages/vm": { "name": "@ethereumjs/vm", - "version": "5.8.0", + "version": "5.9.0", "license": "MPL-2.0", "dependencies": { "@ethereumjs/block": "^3.6.2", "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", "async-eventemitter": "^0.2.4", @@ -20798,7 +20798,7 @@ "@ethereumjs/block": { "version": "file:packages/block", "requires": { - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/tx": "^3.5.1", "@types/lru-cache": "^5.1.0", "@types/node": "^16.11.7", @@ -20887,7 +20887,7 @@ "version": "file:packages/blockchain", "requires": { "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/ethash": "^1.1.0", "@types/async": "^2.4.1", "@types/lru-cache": "^5.1.0", @@ -20983,12 +20983,12 @@ "@chainsafe/libp2p-noise": "^4.1.1", "@ethereumjs/block": "^3.6.2", "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/devp2p": "^4.2.1", "@ethereumjs/ethash": "^1.1.0", "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", - "@ethereumjs/vm": "^5.8.0", + "@ethereumjs/vm": "^5.9.0", "@types/body-parser": "^1.19.2", "@types/connect": "^3.4.35", "@types/fs-extra": "^8.1.0", @@ -21206,7 +21206,7 @@ "version": "file:packages/devp2p", "requires": { "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/tx": "^3.5.1", "@types/async": "^2.4.1", "@types/bl": "^2.1.0", @@ -21365,7 +21365,7 @@ "version": "file:packages/ethash", "requires": { "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@types/levelup": "^4.3.0", "@types/tape": "^4.13.2", "bigint-crypto-utils": "^3.0.23", @@ -21537,7 +21537,7 @@ "@ethereumjs/tx": { "version": "file:packages/tx", "requires": { - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@types/minimist": "^1.2.0", "@types/node": "^16.11.7", "@types/tape": "^4.13.2", @@ -21627,7 +21627,7 @@ "requires": { "@ethereumjs/block": "^3.6.2", "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", "@ethersproject/abi": "^5.0.12", diff --git a/packages/block/src/block.ts b/packages/block/src/block.ts index 0113845e8d6..54d180fd5c2 100644 --- a/packages/block/src/block.ts +++ b/packages/block/src/block.ts @@ -436,7 +436,7 @@ export class Block { const includedUncles: { [key: string]: boolean } = {} // Due to the header validation check above, we know that `getBlocks` is between 1 and 8 inclusive. - const getBlocks = this.header.number - lowestUncleNumber + BigInt(1) + const getBlocks = Number(this.header.number - lowestUncleNumber + BigInt(1)) // See Geth: https://github.com/ethereum/go-ethereum/blob/b63bffe8202d46ea10ac8c4f441c582642193ac8/consensus/ethash/consensus.go#L207 // Here we get the necessary blocks from the chain. diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index cd0aa0dde90..79cc63ebf1c 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -237,7 +237,7 @@ export class BlockHeader { if (this._common.isActivatedEIP(1559)) { if (baseFeePerGas === undefined) { const londonHfBlock = this._common.hardforkBlock(Hardfork.London) - const isInitialEIP1559Block = londonHfBlock && number === londonHfBlock + const isInitialEIP1559Block = number === londonHfBlock if (isInitialEIP1559Block) { baseFeePerGas = BigInt(this._common.param('gasConfig', 'initialBaseFee')) } else { diff --git a/packages/client/lib/client.ts b/packages/client/lib/client.ts index be058e6fda3..b2d2bbb2319 100644 --- a/packages/client/lib/client.ts +++ b/packages/client/lib/client.ts @@ -161,62 +161,4 @@ export default class EthereumClient { server(name: string) { return this.config.servers.find((s) => s.name === name) } - - /** - * Execute a range of blocks on a copy of the VM - * without changing any chain or client state - * - * Possible input formats: - * - * - Single block, '5' - * - Range of blocks, '5-10' - * - */ - async executeBlocks(first: number, last: number, txHashes: string[]) { - this.config.logger.info('Preparing for block execution (debug mode, no services started)...') - if (!this.execution) throw new Error('executeBlocks requires execution') - const vm = await this.execution.vm.copy() - - for (let blockNumber = first; blockNumber <= last; blockNumber++) { - const block = await vm.blockchain.getBlock(blockNumber) - const parentBlock = await vm.blockchain.getBlock(block.header.parentHash) - - // Set the correct state root - await vm.vmState.setStateRoot(parentBlock.header.stateRoot) - - const td = await vm.blockchain.getTotalDifficulty(block.header.parentHash) - vm._common.setHardforkByBlockNumber(blockNumber, td) - - if (txHashes.length === 0) { - const res = await vm.runBlock({ block }) - this.config.logger.info( - `Executed block num=${blockNumber} hash=0x${block.hash().toString('hex')} txs=${ - block.transactions.length - } gasUsed=${res.gasUsed} ` - ) - } else { - let count = 0 - // Special verbose tx execution mode triggered by BLOCK_NUMBER[*] - // Useful e.g. to trace slow txs - const allTxs = txHashes.length === 1 && txHashes[0] === '*' ? true : false - for (const tx of block.transactions) { - const txHash = bufferToHex(tx.hash()) - if (allTxs || txHashes.includes(txHash)) { - const res = await vm.runTx({ block, tx }) - this.config.logger.info( - `Executed tx hash=${txHash} gasUsed=${res.gasUsed} from block num=${blockNumber}` - ) - count += 1 - } - } - if (count === 0) { - if (!allTxs) { - this.config.logger.warn(`Block number ${first} contains no txs with provided hashes`) - } else { - this.config.logger.info(`Block has 0 transactions (no execution)`) - } - } - } - } - } } diff --git a/packages/client/lib/config.ts b/packages/client/lib/config.ts index e76ef700d72..92d9b8761d6 100644 --- a/packages/client/lib/config.ts +++ b/packages/client/lib/config.ts @@ -1,7 +1,7 @@ import Common, { Hardfork } from '@ethereumjs/common' import VM from '@ethereumjs/vm' import { genPrivateKey } from '@ethereumjs/devp2p' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { Multiaddr } from 'multiaddr' import { Logger, getLogger } from './logging' import { Libp2pServer, RlpxServer } from './net/server' diff --git a/packages/client/lib/execution/vmexecution.ts b/packages/client/lib/execution/vmexecution.ts index c26996535c0..f470a55787e 100644 --- a/packages/client/lib/execution/vmexecution.ts +++ b/packages/client/lib/execution/vmexecution.ts @@ -307,7 +307,7 @@ export class VMExecution extends Execution { */ async executeBlocks(first: number, last: number, txHashes: string[]) { this.config.logger.info('Preparing for block execution (debug mode, no services started)...') - const vm = this.vm.copy() + const vm = await this.vm.copy() for (let blockNumber = first; blockNumber <= last; blockNumber++) { const block = await vm.blockchain.getBlock(blockNumber) diff --git a/packages/client/lib/miner/miner.ts b/packages/client/lib/miner/miner.ts index 8ca5f6c129f..9d85a70db75 100644 --- a/packages/client/lib/miner/miner.ts +++ b/packages/client/lib/miner/miner.ts @@ -86,9 +86,11 @@ export class Miner { // delay signing by rand(SIGNER_COUNT * 500ms) const [signerAddress] = this.config.accounts[0] const { blockchain } = this.service.chain - const inTurn = await blockchain.consensus.cliqueSignerInTurn(signerAddress) + const inTurn = await (blockchain.consensus as CliqueConsensus).cliqueSignerInTurn( + signerAddress + ) if (!inTurn) { - const signerCount = blockchain.consensus.cliqueActiveSigners().length + const signerCount = (blockchain.consensus as CliqueConsensus).cliqueActiveSigners().length timeout += Math.random() * signerCount * 500 } } diff --git a/packages/client/lib/rpc/modules/engine.ts b/packages/client/lib/rpc/modules/engine.ts index f5af992daa7..a8a7011ad15 100644 --- a/packages/client/lib/rpc/modules/engine.ts +++ b/packages/client/lib/rpc/modules/engine.ts @@ -544,8 +544,7 @@ export class Engine { const timeDiff = new Date().getTime() / 1000 - Number(headBlock.header.timestamp) if ( - (!this.config.syncTargetHeight || - this.config.syncTargetHeight < headBlock.header.number) && + (!this.config.syncTargetHeight || this.config.syncTargetHeight < headBlock.header.number) && timeDiff < 30 ) { this.config.synchronized = true diff --git a/packages/client/lib/service/txpool.ts b/packages/client/lib/service/txpool.ts index 9dbab1050a9..99dbb63a681 100644 --- a/packages/client/lib/service/txpool.ts +++ b/packages/client/lib/service/txpool.ts @@ -172,8 +172,9 @@ export class TxPool { if (this.running || !this.config.syncTargetHeight) return // If height gte target, we are close enough to the // head of the chain that the tx pool can be started - const target = this.config.syncTargetHeight.subn(this.BLOCKS_BEFORE_TARGET_HEIGHT_ACTIVATION) - if (this.service.chain.headers.height.gte(target)) { + const target = + this.config.syncTargetHeight - BigInt(this.BLOCKS_BEFORE_TARGET_HEIGHT_ACTIVATION) + if (this.service.chain.headers.height >= target) { this.start() } } @@ -498,10 +499,8 @@ export class TxPool { .map((obj) => obj.tx) .sort((a, b) => Number(a.nonce - b.nonce)) // Check if the account nonce matches the lowest known tx nonce - const { nonce } = await this.vm.vmState.getAccount( - new Address(Buffer.from(address, 'hex')) - ) - if (!txsSortedByNonce[0].nonce !== nonce) { + const { nonce } = await this.vm.vmState.getAccount(new Address(Buffer.from(address, 'hex'))) + if (txsSortedByNonce[0].nonce !== nonce) { // Account nonce does not match the lowest known tx nonce, // therefore no txs from this address are currently exectuable continue diff --git a/packages/client/lib/sync/fetcher/blockfetcherbase.ts b/packages/client/lib/sync/fetcher/blockfetcherbase.ts index 68bab09ec1f..486bec4c98a 100644 --- a/packages/client/lib/sync/fetcher/blockfetcherbase.ts +++ b/packages/client/lib/sync/fetcher/blockfetcherbase.ts @@ -58,7 +58,8 @@ export abstract class BlockFetcherBase extends Fetcher< const max = this.config.maxPerRequest const tasks: JobTask[] = [] let debugStr = `first=${first}` - const pushedCount = BigInt(0) + let pushedCount = BigInt(0) + const startedWith = first while (count >= BigInt(max) && tasks.length < maxTasks) { tasks.push({ first: first, count: max }) @@ -70,6 +71,14 @@ export abstract class BlockFetcherBase extends Fetcher< tasks.push({ first: first, count: Number(count) }) pushedCount += count } + + // If we started with where this.first was, i.e. there are no gaps and hence + // we can move this.first to where its now, and reduce count by pushedCount + if (startedWith === this.first) { + this.first = first + this.count = this.count - pushedCount + } + debugStr += ` count=${pushedCount}` this.debug(`Created new tasks num=${tasks.length} ${debugStr}`) return tasks @@ -99,11 +108,11 @@ export abstract class BlockFetcherBase extends Fetcher< while (this.in.length > 0) { const job = this.in.remove() if (!job) break - if (job.task.first.lt(first)) { + if (job.task.first < first) { first = job.task.first } - const jobLast = job.task.first.addn(job.task.count).subn(1) - if (jobLast.gt(last)) { + const jobLast = job.task.first + BigInt(job.task.count) - BigInt(1) + if (jobLast > last) { last = jobLast } } @@ -129,12 +138,12 @@ export abstract class BlockFetcherBase extends Fetcher< const last = this.first + this.count - BigInt(1) let updateHeightStr = '' if (max > last) { - this.count += (max - last) + this.count += max - last updateHeightStr = `updated height=${max}` } // Re-enqueue the numbers which are less than `first` to refetch them, // else they will be fetched in the future with the jobs created by `nextTasks`. - numberList = numberList.filter((num) => num.lte(this.first)) + numberList = numberList.filter((num) => num <= this.first) const numBlocks = numberList.length let bulkRequest = true let seqCheckNum = min diff --git a/packages/client/lib/sync/fullsync.ts b/packages/client/lib/sync/fullsync.ts index c3e5b24bbfa..dccc5c4bb96 100644 --- a/packages/client/lib/sync/fullsync.ts +++ b/packages/client/lib/sync/fullsync.ts @@ -115,13 +115,13 @@ export class FullSynchronizer extends Synchronizer { * Checks if tx pool should be started */ checkTxPoolState() { - if (!this.syncTargetHeight || this.txPool.running) { + if (!this.config.syncTargetHeight || this.txPool.running) { return } // If height gte target, we are close enough to the // head of the chain that the tx pool can be started const target = - this.syncTargetHeight - BigInt(this.txPool.BLOCKS_BEFORE_TARGET_HEIGHT_ACTIVATION) + this.config.syncTargetHeight - BigInt(this.txPool.BLOCKS_BEFORE_TARGET_HEIGHT_ACTIVATION) if (this.chain.headers.height >= target) { this.txPool.start() } @@ -144,7 +144,10 @@ export class FullSynchronizer extends Synchronizer { // Start fetcher from a safe distance behind because if the previous fetcher exited // due to a reorg, it would make sense to step back and refetch. - const first = this.chain.blocks.height >= BigInt(this.config.safeReorgDistance): this.chain.blocks.height - BigInt(this.config.safeReorgDistance) + BigInt(1) : BigInt(1); + const first = + this.chain.blocks.height >= BigInt(this.config.safeReorgDistance) + ? this.chain.blocks.height - BigInt(this.config.safeReorgDistance) + BigInt(1) + : BigInt(1) const count = height - first + BigInt(1) if (count < BigInt(0)) return false if (!this.fetcher || this.fetcher.errored) { @@ -159,8 +162,8 @@ export class FullSynchronizer extends Synchronizer { }) } else { const fetcherHeight = this.fetcher.first + this.fetcher.count - BigInt(1) - if (height > fetcherHeight){ - this.fetcher.count += (height - fetcherHeight) + if (height > fetcherHeight) { + this.fetcher.count += height - fetcherHeight this.config.logger.info(`Updated fetcher target to height=${height} peer=${peer} `) } } @@ -186,7 +189,6 @@ export class FullSynchronizer extends Synchronizer { return } - const first = BigInt(blocks[0].header.number) const last = BigInt(blocks[blocks.length - 1].header.number) const hash = short(blocks[0].hash()) @@ -298,7 +300,7 @@ export class FullSynchronizer extends Synchronizer { // Check if new sync target height can be set const blockNumber = block.header.number if (!this.config.syncTargetHeight || blockNumber > this.config.syncTargetHeight) { - this.syncTargetHeight = blockNumber + this.config.syncTargetHeight = blockNumber } } else { // Call handleNewBlockHashes to retrieve all blocks between chain tip and new block @@ -320,9 +322,9 @@ export class FullSynchronizer extends Synchronizer { handleNewBlockHashes(data: [Buffer, bigint][]) { if (!data.length || !this.fetcher || this.fetcher.errored) return let min = BigInt(-1) - let newSyncHeight + let newSyncHeight: [Buffer, bigint] | undefined const blockNumberList: bigint[] = [] - data.forEach((value) => { + for (const value of data) { const blockNumber = value[1] blockNumberList.push(blockNumber) if (min === BigInt(-1) || blockNumber < min) { diff --git a/packages/client/lib/sync/lightsync.ts b/packages/client/lib/sync/lightsync.ts index 95484b3796f..8ed2cadf54a 100644 --- a/packages/client/lib/sync/lightsync.ts +++ b/packages/client/lib/sync/lightsync.ts @@ -96,7 +96,10 @@ export class LightSynchronizer extends Synchronizer { // Start fetcher from a safe distance behind because if the previous fetcher exited // due to a reorg, it would make sense to step back and refetch. - const first = this.chain.headers.height >= BigInt(this.config.safeReorgDistance)? this.chain.headers.height - BigInt(this.config.safeReorgDistance) + BigInt(1): BigInt(1); + const first = + this.chain.headers.height >= BigInt(this.config.safeReorgDistance) + ? this.chain.headers.height - BigInt(this.config.safeReorgDistance) + BigInt(1) + : BigInt(1) const count = height - first + BigInt(1) if (count < BigInt(0)) return false if (!this.fetcher || this.fetcher.errored) { @@ -112,8 +115,8 @@ export class LightSynchronizer extends Synchronizer { }) } else { const fetcherHeight = this.fetcher.first + this.fetcher.count - BigInt(1) - if (height > fetcherHeight){ - this.fetcher.count += (height - fetcherHeight) + if (height > fetcherHeight) { + this.fetcher.count += height - fetcherHeight this.config.logger.info(`Updated fetcher target to height=${height} peer=${peer} `) } } diff --git a/packages/client/lib/sync/sync.ts b/packages/client/lib/sync/sync.ts index a44171657a2..e559b1a2ff1 100644 --- a/packages/client/lib/sync/sync.ts +++ b/packages/client/lib/sync/sync.ts @@ -49,7 +49,6 @@ export abstract class Synchronizer { public fetcher: BlockFetcher | HeaderFetcher | null public opened: boolean public running: boolean - protected forceSync: boolean public startingBlock: bigint // Time (in ms) after which the synced state is reset @@ -146,7 +145,7 @@ export abstract class Synchronizer { if (!this.config.syncTargetHeight) { return } - if (this.chain.headers.height >= this.syncTargetHeight) { + if (this.chain.headers.height >= this.config.syncTargetHeight) { if (!this.config.synchronized) { const hash = this.chain.headers.latest?.hash() this.config.logger.info( diff --git a/packages/client/test/miner/pendingBlock.spec.ts b/packages/client/test/miner/pendingBlock.spec.ts index 925db1e3057..97a701164a9 100644 --- a/packages/client/test/miner/pendingBlock.spec.ts +++ b/packages/client/test/miner/pendingBlock.spec.ts @@ -4,8 +4,8 @@ import Common, { Chain as CommonChain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' import { BlockHeader } from '@ethereumjs/block' import VM from '@ethereumjs/vm' -import { DefaultStateManager, StateManager } from '@ethereumjs/statemanager' -import { Address } from 'ethereumjs-util' +import { VmState } from '@ethereumjs/vm/dist/vmState' +import { Address, Account } from 'ethereumjs-util' import { Config } from '../../lib/config' import { TxPool } from '../../lib/service/txpool' import { PendingBlock } from '../../lib/miner' @@ -26,10 +26,10 @@ const B = { ), } -const setBalance = async (stateManager: StateManager, address: Address, balance: bigint) => { - await stateManager.checkpoint() - await stateManager.modifyAccountFields(address, { balance }) - await stateManager.commit() +const setBalance = async (vm: VM, address: Address, balance: bigint) => { + await vm.vmState.checkpoint() + await vm.vmState.modifyAccountFields(address, { balance }) + await vm.vmState.commit() } const common = new Common({ chain: CommonChain.Rinkeby, hardfork: Hardfork.Berlin }) @@ -37,8 +37,8 @@ const config = new Config({ transports: [], common }) const setup = () => { const service: any = { - chain: { headers: { height: new BN(0) } }, - execution: { vm: { stateManager: { getAccount: () => new Account() } } }, + chain: { headers: { height: BigInt(0) } }, + execution: { vm: { vmState: { getAccount: () => new Account() } } }, } const txPool = new TxPool({ config, service }) return { txPool } @@ -49,9 +49,9 @@ tape('[PendingBlock]', async (t) => { BlockHeader.prototype.validate = td.func() td.replace('@ethereumjs/block', { BlockHeader }) - const originalSetStateRoot = DefaultStateManager.prototype.setStateRoot - DefaultStateManager.prototype.setStateRoot = td.func() - td.replace('@ethereumjs/vm/dist/state', { DefaultStateManager }) + const originalSetStateRoot = VmState.prototype.setStateRoot + VmState.prototype.setStateRoot = td.func() + td.replace('@ethereumjs/vm/dist/vmState', { VmState }) const createTx = ( from = A, @@ -83,8 +83,9 @@ tape('[PendingBlock]', async (t) => { txPool.add(txA02) const pendingBlock = new PendingBlock({ config, txPool }) const vm = await VM.create({ common }) - await setBalance(vm.stateManager, A.address, BigInt(5000000000000000)) - await setBalance(vm.stateManager, B.address, BigInt(5000000000000000)) + + await setBalance(vm, A.address, BigInt(5000000000000000)) + await setBalance(vm, B.address, BigInt(5000000000000000)) const parentBlock = await vm.blockchain.getCanonicalHeadBlock() const payloadId = await pendingBlock.start(vm, parentBlock) t.equal(pendingBlock.pendingPayloads.length, 1, 'should set the pending payload') @@ -104,7 +105,7 @@ tape('[PendingBlock]', async (t) => { txPool.add(txA01) const pendingBlock = new PendingBlock({ config, txPool }) const vm = await VM.create({ common }) - await setBalance(vm.stateManager, A.address, BigInt(5000000000000000)) + await setBalance(vm, A.address, BigInt(5000000000000000)) const parentBlock = await vm.blockchain.getCanonicalHeadBlock() const payloadId = await pendingBlock.start(vm, parentBlock) t.equal(pendingBlock.pendingPayloads.length, 1, 'should set the pending payload') @@ -132,7 +133,7 @@ tape('[PendingBlock]', async (t) => { txPool.add(txA03) const pendingBlock = new PendingBlock({ config, txPool }) const vm = await VM.create({ common }) - await setBalance(vm.stateManager, A.address, BigInt(5000000000000000)) + await setBalance(vm, A.address, BigInt(5000000000000000)) const parentBlock = await vm.blockchain.getCanonicalHeadBlock() const payloadId = await pendingBlock.start(vm, parentBlock) t.equal(pendingBlock.pendingPayloads.length, 1, 'should set the pending payload') @@ -174,7 +175,7 @@ tape('[PendingBlock]', async (t) => { // mocking indirect dependencies is not properly supported, but it works for us in this file, // so we will replace the original functions to avoid issues in other tests that come after BlockHeader.prototype.validate = originalValidate - DefaultStateManager.prototype.setStateRoot = originalSetStateRoot + VmState.prototype.setStateRoot = originalSetStateRoot t.end() }) }) diff --git a/packages/client/test/sync/fetcher/blockfetcher.spec.ts b/packages/client/test/sync/fetcher/blockfetcher.spec.ts index 0e162b3ef1a..982e08ffd27 100644 --- a/packages/client/test/sync/fetcher/blockfetcher.spec.ts +++ b/packages/client/test/sync/fetcher/blockfetcher.spec.ts @@ -55,18 +55,23 @@ tape('[BlockFetcher]', async (t) => { t.equals((fetcher as any).in.size(), 2, 'added 2 tasks') await wait(100) - let blockNumberList = [new BigInt(11), new BigInt(12)] - let min = new BigInt(11) - let max = new BigInt(12) + let blockNumberList = [BigInt(11), BigInt(12)] + let min = BigInt(11) + let max = BigInt(12) fetcher.enqueueByNumberList(blockNumberList, min, max) + t.equals((fetcher as any).in.size(), 3, '1 new task for two subsequent block numbers') - blockNumberList = [new BigInt(13), new BigInt(15)] - min = new BigInt(13) - max = new BigInt(15) + blockNumberList = [BigInt(13), BigInt(15)] + min = BigInt(13) + max = BigInt(15) fetcher.enqueueByNumberList(blockNumberList, min, max) t.equals((fetcher as any).in.size(), 3, 'no new task added only the height changed') - t.equals(fetcher.first + fetcher.count - BigInt(1) === BigInt(15), true, 'height should now be 15') + t.equals( + fetcher.first + fetcher.count - BigInt(1) === BigInt(15), + true, + 'height should now be 15' + ) // Clear fetcher queue for next test of gap when following head fetcher.clear() diff --git a/packages/client/test/sync/sync.spec.ts b/packages/client/test/sync/sync.spec.ts index 597eb648135..15de60acf21 100644 --- a/packages/client/test/sync/sync.spec.ts +++ b/packages/client/test/sync/sync.spec.ts @@ -27,7 +27,7 @@ tape('[Synchronizer]', async (t) => { t.test('should sync', async (t) => { const config = new Config({ transports: [] }) - config.syncTargetHeight = new BigInt(1) + config.syncTargetHeight = BigInt(1) const pool = new PeerPool() as any const chain = new Chain({ config }) const sync = new SynchronizerTest({ config, pool, chain }) diff --git a/packages/client/test/sync/txpool.spec.ts b/packages/client/test/sync/txpool.spec.ts index dbe8c9e6ccd..f155ccc12b2 100644 --- a/packages/client/test/sync/txpool.spec.ts +++ b/packages/client/test/sync/txpool.spec.ts @@ -2,7 +2,7 @@ import tape from 'tape' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' import { Block } from '@ethereumjs/block' -import { Account, BN } from 'ethereumjs-util' +import { Account } from 'ethereumjs-util' import { PeerPool } from '../../lib/net/peerpool' import { TxPool } from '../../lib/service/txpool' import { Config } from '../../lib/config' @@ -10,7 +10,7 @@ import { Config } from '../../lib/config' const setup = () => { const config = new Config({ transports: [] }) const service: any = { - chain: { headers: { height: new BN(0) } }, + chain: { headers: { height: BigInt(0) } }, execution: { vm: { stateManager: { getAccount: () => new Account() } } }, } const pool = new TxPool({ config, service }) diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index cb3f2503fef..952ce72d56e 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -284,7 +284,7 @@ export default class VM extends AsyncEventEmitter { Hardfork.Berlin, Hardfork.London, Hardfork.ArrowGlacier, - Hardfork.MergeForkBlock, + Hardfork.MergeForkIdTransition, Hardfork.Merge, ] if (!supportedHardforks.includes(this._common.hardfork() as Hardfork)) { @@ -295,10 +295,12 @@ export default class VM extends AsyncEventEmitter { this._common.on('hardforkChanged', () => { this.getActiveOpcodes() + this._precompiles = getActivePrecompiles(this._common, this._customPrecompiles) }) - // Initialize the opcode data + // Set list of opcodes based on HF this.getActiveOpcodes() + this._precompiles = getActivePrecompiles(this._common, this._customPrecompiles) if (opts.stateManager) { this.stateManager = opts.stateManager diff --git a/packages/vm/src/runTx.ts b/packages/vm/src/runTx.ts index 6b954a81651..99ed9a7c50a 100644 --- a/packages/vm/src/runTx.ts +++ b/packages/vm/src/runTx.ts @@ -262,7 +262,8 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { if (this._common.isActivatedEIP(2929)) { // Add origin and precompiles to warm addresses - for (const [addressStr] of this.precompiles) { + const activePrecompiles = this.precompiles + for (const [addressStr] of activePrecompiles.entries()) { state.addWarmedAddress(Buffer.from(addressStr, 'hex')) } state.addWarmedAddress(caller.buf) diff --git a/packages/vm/tests/api/customPrecompiles.spec.ts b/packages/vm/tests/api/customPrecompiles.spec.ts index 0f8f62a4399..ce534d7b18f 100644 --- a/packages/vm/tests/api/customPrecompiles.spec.ts +++ b/packages/vm/tests/api/customPrecompiles.spec.ts @@ -1,6 +1,6 @@ import tape from 'tape' import VM from '../../src' -import { Address, BN } from 'ethereumjs-util' +import { Address } from 'ethereumjs-util' import { PrecompileInput } from '../../src/evm/precompiles' import { ExecResult } from '../../src/evm/evm' @@ -8,7 +8,7 @@ const sender = new Address(Buffer.from('44'.repeat(20), 'hex')) const newPrecompile = new Address(Buffer.from('ff'.repeat(20), 'hex')) const shaAddress = new Address(Buffer.from('0000000000000000000000000000000000000002', 'hex')) const expectedReturn = Buffer.from('1337', 'hex') -const expectedGas = new BN(10) +const expectedGas = BigInt(10) function customPrecompile(_input: PrecompileInput): ExecResult { return { @@ -19,7 +19,7 @@ function customPrecompile(_input: PrecompileInput): ExecResult { tape('VM -> custom precompiles', (t) => { t.test('should override existing precompiles', async (st) => { - const VMOverride = new VM({ + const VMOverride = await VM.create({ customPrecompiles: [ { address: shaAddress, @@ -29,16 +29,16 @@ tape('VM -> custom precompiles', (t) => { }) const result = await VMOverride.runCall({ to: shaAddress, - gasLimit: new BN(30000), + gasLimit: BigInt(30000), data: Buffer.from(''), caller: sender, }) st.ok(result.execResult.returnValue.equals(expectedReturn), 'return value is correct') - st.ok(result.execResult.gasUsed.eq(expectedGas), 'gas used is correct') + st.ok(result.execResult.gasUsed === expectedGas, 'gas used is correct') }) t.test('should delete existing precompiles', async (st) => { - const VMOverride = new VM({ + const VMOverride = await VM.create({ customPrecompiles: [ { address: shaAddress, @@ -47,16 +47,16 @@ tape('VM -> custom precompiles', (t) => { }) const result = await VMOverride.runCall({ to: shaAddress, - gasLimit: new BN(30000), + gasLimit: BigInt(30000), data: Buffer.from(''), caller: sender, }) st.ok(result.execResult.returnValue.equals(Buffer.from('')), 'return value is correct') - st.ok(result.execResult.gasUsed.eqn(0), 'gas used is correct') + st.ok(result.execResult.gasUsed === BigInt(0), 'gas used is correct') }) t.test('should add precompiles', async (st) => { - const VMOverride = new VM({ + const VMOverride = await VM.create({ customPrecompiles: [ { address: newPrecompile, @@ -66,23 +66,23 @@ tape('VM -> custom precompiles', (t) => { }) const result = await VMOverride.runCall({ to: newPrecompile, - gasLimit: new BN(30000), + gasLimit: BigInt(30000), data: Buffer.from(''), caller: sender, }) st.ok(result.execResult.returnValue.equals(expectedReturn), 'return value is correct') - st.ok(result.execResult.gasUsed.eq(expectedGas), 'gas used is correct') + st.ok(result.execResult.gasUsed === expectedGas, 'gas used is correct') }) t.test('should not persist changes to precompiles', async (st) => { - let VMSha = new VM() + let VMSha = await VM.create() const shaResult = await VMSha.runCall({ to: shaAddress, - gasLimit: new BN(30000), + gasLimit: BigInt(30000), data: Buffer.from(''), caller: sender, }) - const VMOverride = new VM({ + const VMOverride = await VM.create({ customPrecompiles: [ { address: shaAddress, @@ -92,17 +92,17 @@ tape('VM -> custom precompiles', (t) => { }) const result = await VMOverride.runCall({ to: shaAddress, - gasLimit: new BN(30000), + gasLimit: BigInt(30000), data: Buffer.from(''), caller: sender, }) // sanity: check we have overridden st.ok(result.execResult.returnValue.equals(expectedReturn), 'return value is correct') - st.ok(result.execResult.gasUsed.eq(expectedGas), 'gas used is correct') - VMSha = new VM() + st.ok(result.execResult.gasUsed === expectedGas, 'gas used is correct') + VMSha = await VM.create() const shaResult2 = await VMSha.runCall({ to: shaAddress, - gasLimit: new BN(30000), + gasLimit: BigInt(30000), data: Buffer.from(''), caller: sender, }) @@ -111,7 +111,7 @@ tape('VM -> custom precompiles', (t) => { 'restored sha precompile - returndata correct' ) st.ok( - shaResult.execResult.gasUsed.eq(shaResult2.execResult.gasUsed), + shaResult.execResult.gasUsed === shaResult2.execResult.gasUsed, 'restored sha precompile - gas correct' ) }) From 441e3d95629a620968c95b3c9ecd34bb8279b612 Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Mon, 2 May 2022 05:37:37 -0700 Subject: [PATCH 34/44] trie: convert constructor to options interface, remove deprecated setRoot (#1874) * trie: add constructor options interface * remove assert use, remove deprecated setRoot --- packages/client/lib/execution/vmexecution.ts | 2 +- packages/client/lib/util/debug.ts | 2 +- packages/trie/README.md | 6 +-- packages/trie/src/baseTrie.ts | 55 +++++++++++--------- packages/trie/src/checkpointDb.ts | 2 +- packages/trie/src/checkpointTrie.ts | 14 +++-- packages/trie/src/db.ts | 2 +- packages/trie/src/secure.ts | 10 ++-- packages/trie/src/verifyRangeProof.ts | 4 +- packages/trie/test/index.spec.ts | 8 +-- 10 files changed, 56 insertions(+), 49 deletions(-) diff --git a/packages/client/lib/execution/vmexecution.ts b/packages/client/lib/execution/vmexecution.ts index f470a55787e..525f202321e 100644 --- a/packages/client/lib/execution/vmexecution.ts +++ b/packages/client/lib/execution/vmexecution.ts @@ -36,7 +36,7 @@ export class VMExecution extends Execution { super(options) if (!this.config.vm) { - const trie = new Trie(this.stateDB) + const trie = new Trie({ db: this.stateDB }) const stateManager = new DefaultStateManager({ common: this.config.execCommon, diff --git a/packages/client/lib/util/debug.ts b/packages/client/lib/util/debug.ts index c2c02b24873..8607f9c5bbf 100644 --- a/packages/client/lib/util/debug.ts +++ b/packages/client/lib/util/debug.ts @@ -39,7 +39,7 @@ const main = async () => { .toString('hex')}', 'hex'), { common }) const stateDB = level('${execution.config.getDataDirectory(DataDirectory.State)}') - const trie = new Trie(stateDB) + const trie = new Trie({ db: stateDB }) const stateManager = new DefaultStateManager({ trie, common }) // Ensure we run on the right root stateManager.setStateRoot(Buffer.from('${( diff --git a/packages/trie/README.md b/packages/trie/README.md index 92157227aba..b7f3fa1b3e6 100644 --- a/packages/trie/README.md +++ b/packages/trie/README.md @@ -29,7 +29,7 @@ import level from 'level' import { BaseTrie as Trie } from 'merkle-patricia-tree' const db = level('./testdb') -const trie = new Trie(db) +const trie = new Trie({ db }) async function test() { await trie.put(Buffer.from('test'), Buffer.from('one')) @@ -120,7 +120,7 @@ const stateRoot = '0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580 // Convert the state root to a Buffer (strip the 0x prefix) const stateRootBuffer = Buffer.from(stateRoot.slice(2), 'hex') // Initialize trie -const trie = new Trie(db, stateRootBuffer) +const trie = new Trie({ db, root: stateRootBuffer }) trie .createReadStream() @@ -140,7 +140,7 @@ import { SecureTrie as Trie } from 'merkle-patricia-tree' const stateRoot = 'STATE_ROOT_OF_A_BLOCK' const db = level('YOUR_PATH_TO_THE_GETH_CHAINDATA_FOLDER') -const trie = new Trie(db, stateRoot) +const trie = new Trie({ db, root: stateRoot }) const address = 'AN_ETHEREUM_ACCOUNT_ADDRESS' diff --git a/packages/trie/src/baseTrie.ts b/packages/trie/src/baseTrie.ts index 7441ef1b09d..d75d661b6eb 100644 --- a/packages/trie/src/baseTrie.ts +++ b/packages/trie/src/baseTrie.ts @@ -18,7 +18,6 @@ import { import { verifyRangeProof } from './verifyRangeProof' // eslint-disable-next-line implicit-dependencies/no-implicit import type { LevelUp } from 'levelup' -const assert = require('assert') export type Proof = Buffer[] @@ -35,6 +34,24 @@ export type FoundNodeFunction = ( walkController: WalkController ) => void +export interface TrieOpts { + /** + * A [levelup](https://github.com/Level/levelup) instance. + * By default (if the db is `null` or left undefined) creates an + * in-memory [memdown](https://github.com/Level/memdown) instance. + */ + db?: LevelUp | null + /** + * A `Buffer` for the root of a previously stored trie + */ + root?: Buffer + /** + * Delete nodes from DB on delete operations (disallows switching to an older state root) + * Default: `false` + */ + deleteFromDB?: boolean +} + /** * The basic trie interface, use with `import { BaseTrie as Trie } from 'merkle-patricia-tree'`. * In Ethereum applications stick with the {@link SecureTrie} overlay. @@ -51,22 +68,19 @@ export class Trie { private _deleteFromDB: boolean /** - * test - * @param db - A [levelup](https://github.com/Level/levelup) instance. By default (if the db is `null` or - * left undefined) creates an in-memory [memdown](https://github.com/Level/memdown) instance. - * @param root - A `Buffer` for the root of a previously stored trie - * @param deleteFromDB - Delete nodes from DB on delete operations (disallows switching to an older state root) (default: `false`) + * Create a new trie + * @param opts Options for instantiating the trie */ - constructor(db?: LevelUp | null, root?: Buffer, deleteFromDB: boolean = false) { + constructor(opts: TrieOpts = {}) { this.EMPTY_TRIE_ROOT = KECCAK256_RLP this.lock = new Semaphore(1) - this.db = db ? new DB(db) : new DB() + this.db = opts.db ? new DB(opts.db) : new DB() this._root = this.EMPTY_TRIE_ROOT - this._deleteFromDB = deleteFromDB + this._deleteFromDB = opts.deleteFromDB ?? false - if (root) { - this.root = root + if (opts.root) { + this.root = opts.root } } @@ -77,7 +91,7 @@ export class Trie { if (!value) { value = this.EMPTY_TRIE_ROOT } - assert(value.length === 32, 'Invalid root length. Roots are 32 bytes') + if (value.length !== 32) throw new Error('Invalid root length. Roots are 32 bytes') this._root = value } @@ -88,17 +102,6 @@ export class Trie { return this._root } - /** - * This method is deprecated. - * Please use {@link Trie.root} instead. - * - * @param value - * @deprecated - */ - setRoot(value?: Buffer) { - this.root = value ?? this.EMPTY_TRIE_ROOT - } - /** * Checks if a given root exists. */ @@ -458,7 +461,7 @@ export class Trie { } let lastNode = stack.pop() as TrieNode - assert(lastNode) + if (!lastNode) throw new Error('missing last node') let parentNode = stack.pop() const opStack: BatchDBOp[] = [] @@ -683,7 +686,7 @@ export class Trie { * @returns The value from the key, or null if valid proof of non-existence. */ static async verifyProof(rootHash: Buffer, key: Buffer, proof: Proof): Promise { - let proofTrie = new Trie(null, rootHash) + let proofTrie = new Trie({ root: rootHash }) try { proofTrie = await Trie.fromProof(proof, proofTrie) } catch (e: any) { @@ -735,7 +738,7 @@ export class Trie { */ copy(): Trie { const db = this.db.copy() - return new Trie(db._leveldb, this.root) + return new Trie({ db: db._leveldb, root: this.root, deleteFromDB: this._deleteFromDB }) } /** diff --git a/packages/trie/src/checkpointDb.ts b/packages/trie/src/checkpointDb.ts index 97814e56e2d..b5fdd341d05 100644 --- a/packages/trie/src/checkpointDb.ts +++ b/packages/trie/src/checkpointDb.ts @@ -21,7 +21,7 @@ export class CheckpointDB extends DB { * defaults to an [in-memory store](https://github.com/Level/memdown). * @param leveldb - An abstract-leveldown compliant store */ - constructor(leveldb?: LevelUp) { + constructor(leveldb?: LevelUp | null) { super(leveldb) // Roots of trie at the moment of checkpoint this.checkpoints = [] diff --git a/packages/trie/src/checkpointTrie.ts b/packages/trie/src/checkpointTrie.ts index 73daeb8f1ef..e7d0bd3b9af 100644 --- a/packages/trie/src/checkpointTrie.ts +++ b/packages/trie/src/checkpointTrie.ts @@ -1,4 +1,4 @@ -import { Trie as BaseTrie } from './baseTrie' +import { Trie as BaseTrie, TrieOpts } from './baseTrie' import { CheckpointDB } from './checkpointDb' /** @@ -7,9 +7,9 @@ import { CheckpointDB } from './checkpointDb' export class CheckpointTrie extends BaseTrie { db: CheckpointDB - constructor(...args: any) { - super(...args) - this.db = new CheckpointDB(...args) + constructor(opts: TrieOpts = {}) { + super(opts) + this.db = new CheckpointDB(opts.db) } /** @@ -63,7 +63,11 @@ export class CheckpointTrie extends BaseTrie { */ copy(includeCheckpoints = true): CheckpointTrie { const db = this.db.copy() - const trie = new CheckpointTrie(db._leveldb, this.root) + const trie = new CheckpointTrie({ + db: db._leveldb, + root: this.root, + deleteFromDB: (this as any)._deleteFromDB, + }) if (includeCheckpoints && this.isCheckpoint) { trie.db.checkpoints = [...this.db.checkpoints] } diff --git a/packages/trie/src/db.ts b/packages/trie/src/db.ts index b69c75e51ef..22d20682416 100644 --- a/packages/trie/src/db.ts +++ b/packages/trie/src/db.ts @@ -27,7 +27,7 @@ export class DB { * defaults to an [in-memory store](https://github.com/Level/memdown). * @param leveldb - An abstract-leveldown compliant store */ - constructor(leveldb?: LevelUp) { + constructor(leveldb?: LevelUp | null) { this._leveldb = leveldb ?? level() } diff --git a/packages/trie/src/secure.ts b/packages/trie/src/secure.ts index 15210d8b332..6f1a09967aa 100644 --- a/packages/trie/src/secure.ts +++ b/packages/trie/src/secure.ts @@ -11,10 +11,6 @@ import { Proof } from './baseTrie' * @public */ export class SecureTrie extends CheckpointTrie { - constructor(...args: any) { - super(...args) - } - /** * Gets a value given a `key` * @param key - the key to search for @@ -110,7 +106,11 @@ export class SecureTrie extends CheckpointTrie { */ copy(includeCheckpoints = true): SecureTrie { const db = this.db.copy() - const secureTrie = new SecureTrie(db._leveldb, this.root) + const secureTrie = new SecureTrie({ + db: db._leveldb, + root: this.root, + deleteFromDB: (this as any)._deleteFromDB, + }) if (includeCheckpoints && this.isCheckpoint) { secureTrie.db.checkpoints = [...this.db.checkpoints] } diff --git a/packages/trie/src/verifyRangeProof.ts b/packages/trie/src/verifyRangeProof.ts index 789e6c2d4b2..bf428175578 100644 --- a/packages/trie/src/verifyRangeProof.ts +++ b/packages/trie/src/verifyRangeProof.ts @@ -317,7 +317,7 @@ async function verifyProof( key: Buffer, proof: Buffer[] ): Promise<{ value: Buffer | null; trie: Trie }> { - let proofTrie = new Trie(null, rootHash) + let proofTrie = new Trie({ root: rootHash }) try { proofTrie = await Trie.fromProof(proof, proofTrie) } catch (e) { @@ -483,7 +483,7 @@ export async function verifyRangeProof( ) } - let trie = new Trie(null, rootHash) + let trie = new Trie({ root: rootHash }) trie = await Trie.fromProof(proof, trie) // Remove all nodes between two edge proofs diff --git a/packages/trie/test/index.spec.ts b/packages/trie/test/index.spec.ts index 71e7ee9e07d..2dfa97855ed 100644 --- a/packages/trie/test/index.spec.ts +++ b/packages/trie/test/index.spec.ts @@ -14,7 +14,7 @@ tape('simple save and retrieve', function (tester) { '3f4399b08efe68945c1cf90ffe85bbe3ce978959da753f9e649f034015b8817d', 'hex' ) - const trie = new CheckpointTrie(null, root) + const trie = new CheckpointTrie({ root }) const value = await trie.get(Buffer.from('test')) t.equal(value, null) t.end() @@ -165,7 +165,7 @@ tape('testing deletion cases', function (tester) { msg: 'without DB delete', } const trieSetupWithDBDelete = { - trie: new CheckpointTrie(undefined, undefined, true), + trie: new CheckpointTrie({ deleteFromDB: true }), msg: 'with DB delete', } const trieSetups = [trieSetupWithoutDBDelete, trieSetupWithDBDelete] @@ -311,12 +311,12 @@ tape('setting back state root (deleteFromDB)', async (t) => { const trieSetups = [ { - trie: new BaseTrie(undefined, undefined, false), + trie: new BaseTrie({ deleteFromDB: false }), expected: v1, msg: 'should return v1 when setting back the state root when deleteFromDB=false', }, { - trie: new BaseTrie(undefined, undefined, true), + trie: new BaseTrie({ deleteFromDB: true }), expected: null, msg: 'should return null when setting back the state root when deleteFromDB=true', }, From 2fd2f48150d995469a7bee7913b61691520dbc1f Mon Sep 17 00:00:00 2001 From: emersonmacro <77563348+emersonmacro@users.noreply.github.com> Date: Tue, 3 May 2022 19:28:24 -0700 Subject: [PATCH 35/44] util: replace hash module with ethereum-cryptography (#1859) * util: replace hash module with ethereum-cryptography * util: refactor to use bytesToHex * util: fix build with DOM lib in tsconfig Co-authored-by: Ryan Ghods --- config/tsconfig.json | 2 +- packages/block/package.json | 1 + packages/block/src/block.ts | 5 +- packages/block/src/header.ts | 8 +- packages/block/test/block.spec.ts | 7 +- packages/block/test/util.ts | 5 +- packages/client/lib/rpc/modules/web3.ts | 7 +- packages/client/lib/util/parse.ts | 4 +- packages/client/package.json | 1 + .../client/test/rpc/eth/getStorageAt.spec.ts | 15 +- packages/ethash/package.json | 1 + packages/ethash/src/index.ts | 24 +- packages/ethash/src/util.ts | 5 +- packages/statemanager/package.json | 1 + packages/statemanager/src/stateManager.ts | 6 +- .../tests/proofStateManager.spec.ts | 17 +- .../statemanager/tests/stateManager.spec.ts | 5 +- packages/trie/benchmarks/random.ts | 7 +- packages/trie/package.json | 1 + packages/trie/src/baseTrie.ts | 7 +- packages/trie/src/secure.ts | 19 +- packages/trie/src/trieNode.ts | 9 +- packages/tx/package.json | 1 + packages/tx/src/eip1559Transaction.ts | 8 +- packages/tx/src/eip2930Transaction.ts | 8 +- packages/tx/src/legacyTransaction.ts | 10 +- packages/util/src/account.ts | 16 +- packages/util/src/hash.ts | 162 ---------- packages/util/src/index.ts | 5 - packages/util/src/signature.ts | 4 +- packages/util/test/hash.spec.ts | 281 ------------------ packages/vm/package.json | 1 + packages/vm/src/bloom/index.ts | 7 +- packages/vm/src/evm/opcodes/functions.ts | 10 +- packages/vm/src/evm/opcodes/util.ts | 6 +- packages/vm/src/evm/precompiles/02-sha256.ts | 5 +- .../vm/src/evm/precompiles/03-ripemd160.ts | 5 +- .../tests/api/EIPs/eip-3074-authcall.spec.ts | 4 +- packages/vm/tests/api/runCall.spec.ts | 7 +- packages/vm/tests/util.ts | 10 +- 40 files changed, 145 insertions(+), 562 deletions(-) delete mode 100644 packages/util/src/hash.ts delete mode 100644 packages/util/test/hash.spec.ts diff --git a/config/tsconfig.json b/config/tsconfig.json index 989b8b35269..71ae9808d1f 100644 --- a/config/tsconfig.json +++ b/config/tsconfig.json @@ -12,6 +12,6 @@ "downlevelIteration": true, "strict": true, "target": "es2020", - "lib": ["ES2020"] + "lib": ["ES2020", "DOM"] } } diff --git a/packages/block/package.json b/packages/block/package.json index 6d33c2ccd23..77fecdb4da0 100644 --- a/packages/block/package.json +++ b/packages/block/package.json @@ -36,6 +36,7 @@ "@ethereumjs/common": "^2.6.4", "merkle-patricia-tree": "^4.2.4", "@ethereumjs/tx": "^3.5.1", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4" }, "devDependencies": { diff --git a/packages/block/src/block.ts b/packages/block/src/block.ts index 54d180fd5c2..abb3c9b06df 100644 --- a/packages/block/src/block.ts +++ b/packages/block/src/block.ts @@ -1,5 +1,6 @@ import { BaseTrie as Trie } from 'merkle-patricia-tree' -import { rlp, keccak256, KECCAK256_RLP, bufferToHex } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { rlp, KECCAK256_RLP, bufferToHex, toBuffer } from 'ethereumjs-util' import Common, { ConsensusType } from '@ethereumjs/common' import { TransactionFactory, @@ -322,7 +323,7 @@ export class Block { */ validateUnclesHash(): boolean { const raw = rlp.encode(this.uncleHeaders.map((uh) => uh.raw())) - return keccak256(raw).equals(this.header.uncleHash) + return toBuffer(keccak256(raw)).equals(this.header.uncleHash) } /** diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index 79cc63ebf1c..275c44b9659 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -1,4 +1,5 @@ import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '@ethereumjs/common' +import { keccak256 } from 'ethereum-cryptography/keccak' import { Address, bigIntToHex, @@ -9,7 +10,6 @@ import { KECCAK256_RLP_ARRAY, KECCAK256_RLP, rlp, - rlphash, toBuffer, zeros, bufferToHex, @@ -795,12 +795,12 @@ export class BlockHeader { hash(): Buffer { if (Object.isFrozen(this)) { if (!this.cache.hash) { - this.cache.hash = rlphash(this.raw()) + this.cache.hash = toBuffer(keccak256(rlp.encode(this.raw()))) } return this.cache.hash } - return rlphash(this.raw()) + return toBuffer(keccak256(rlp.encode(this.raw()))) } /** @@ -826,7 +826,7 @@ export class BlockHeader { this._requireClique('cliqueSigHash') const raw = this.raw() raw[12] = this.extraData.slice(0, this.extraData.length - CLIQUE_EXTRA_SEAL) - return rlphash(raw) + return toBuffer(keccak256(rlp.encode(raw))) } /** diff --git a/packages/block/test/block.spec.ts b/packages/block/test/block.spec.ts index a0e9009f233..5175781c7de 100644 --- a/packages/block/test/block.spec.ts +++ b/packages/block/test/block.spec.ts @@ -1,5 +1,7 @@ import tape from 'tape' -import { keccak256, rlp, zeros, toBuffer } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { bytesToHex } from 'ethereum-cryptography/utils' +import { rlp, zeros, toBuffer } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block, BlockBuffer, BlockHeader } from '../src' import blockFromRpc from '../src/from-rpc' @@ -594,8 +596,7 @@ tape('[Block]: block functions', function (t) { common: new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }), }) - forkBlock2HeaderData.uncleHash = - '0x' + keccak256(rlp.encode([uncleHeader.raw()])).toString('hex') + forkBlock2HeaderData.uncleHash = '0x' + bytesToHex(keccak256(rlp.encode([uncleHeader.raw()]))) const forkBlock_ValidCommon = Block.fromBlockData( { diff --git a/packages/block/test/util.ts b/packages/block/test/util.ts index 1b250b314be..f21892bfaea 100644 --- a/packages/block/test/util.ts +++ b/packages/block/test/util.ts @@ -1,5 +1,6 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { rlp, keccak256 } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { rlp, toBuffer } from 'ethereumjs-util' import { Block, BlockHeader } from '../src' /** @@ -36,7 +37,7 @@ function createBlock( timestamp, gasLimit: BigInt(5000), extraData: Buffer.from(extraData), - uncleHash: keccak256(rlp.encode(uncles.map((uh) => uh.raw()))), + uncleHash: toBuffer(keccak256(rlp.encode(uncles.map((uh) => uh.raw())))), baseFeePerGas, }, uncleHeaders: uncles, diff --git a/packages/client/lib/rpc/modules/web3.ts b/packages/client/lib/rpc/modules/web3.ts index 150c5412f76..6972f618184 100644 --- a/packages/client/lib/rpc/modules/web3.ts +++ b/packages/client/lib/rpc/modules/web3.ts @@ -1,4 +1,6 @@ -import { addHexPrefix, keccak, toBuffer } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { bytesToHex } from 'ethereum-cryptography/utils' +import { addHexPrefix, toBuffer } from 'ethereumjs-util' import { middleware, validators } from '../validation' import { getClientVersion } from '../../util' import type { EthereumClient } from '../..' @@ -38,8 +40,7 @@ export class Web3 { * @param params The data to convert into a SHA3 hash */ sha3(params: string[]) { - const rawDigest = keccak(toBuffer(params[0])) - const hexEncodedDigest = addHexPrefix(rawDigest.toString('hex')) + const hexEncodedDigest = addHexPrefix(bytesToHex(keccak256(toBuffer(params[0])))) return hexEncodedDigest } } diff --git a/packages/client/lib/util/parse.ts b/packages/client/lib/util/parse.ts index 7681ea92063..af3a6a32148 100644 --- a/packages/client/lib/util/parse.ts +++ b/packages/client/lib/util/parse.ts @@ -2,10 +2,10 @@ import { URL } from 'url' import { Multiaddr, multiaddr } from 'multiaddr' import { BlockHeader } from '@ethereumjs/block' import Common, { Hardfork } from '@ethereumjs/common' +import { keccak256 } from 'ethereum-cryptography/keccak' import { SecureTrie as Trie } from 'merkle-patricia-tree' import { Account, - keccak, rlp, toBuffer, unpadBuffer, @@ -121,7 +121,7 @@ async function createGethGenesisStateTrie(alloc: any) { account.balance = BigInt(balance) } if (code) { - account.codeHash = keccak(toBuffer(code)) + account.codeHash = toBuffer(keccak256(toBuffer(code))) } if (storage) { const storageTrie = await createStorageTrie(storage) diff --git a/packages/client/package.json b/packages/client/package.json index 69cb90addfc..4304ea9ae7a 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -63,6 +63,7 @@ "connect": "^3.7.0", "cors": "^2.8.5", "debug": "^4.3.3", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "fs-extra": "^10.0.0", "it-pipe": "^1.1.0", diff --git a/packages/client/test/rpc/eth/getStorageAt.spec.ts b/packages/client/test/rpc/eth/getStorageAt.spec.ts index b6b6bc8575a..ca36f43933e 100644 --- a/packages/client/test/rpc/eth/getStorageAt.spec.ts +++ b/packages/client/test/rpc/eth/getStorageAt.spec.ts @@ -3,7 +3,8 @@ import { Block } from '@ethereumjs/block' import Blockchain from '@ethereumjs/blockchain' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction } from '@ethereumjs/tx' -import { Address, bigIntToHex, bufferToHex, keccak } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { Address, bigIntToHex, bufferToHex, toBuffer } from 'ethereumjs-util' import { INVALID_PARAMS } from '../../../lib/rpc/error-code' import { startRPC, createManager, createClient, params, baseRequest } from '../helpers' import { checkError } from '../util' @@ -120,11 +121,13 @@ tape(`${method}: call with valid arguments`, async (t) => { // verify storage of pos1 is accurate // pos1["0xccfd725760a68823ff1e062f4cc97e1360e8d997"] - const key = keccak( - Buffer.from( - '000000000000000000000000ccfd725760a68823ff1e062f4cc97e1360e8d997' + - '0000000000000000000000000000000000000000000000000000000000000001', - 'hex' + const key = toBuffer( + keccak256( + Buffer.from( + '000000000000000000000000ccfd725760a68823ff1e062f4cc97e1360e8d997' + + '0000000000000000000000000000000000000000000000000000000000000001', + 'hex' + ) ) ) req = params(method, [createdAddress!.toString(), bufferToHex(key), 'latest']) diff --git a/packages/ethash/package.json b/packages/ethash/package.json index 79b6cf13863..7a8d0257850 100644 --- a/packages/ethash/package.json +++ b/packages/ethash/package.json @@ -35,6 +35,7 @@ "@types/levelup": "^4.3.0", "bigint-crypto-utils": "^3.0.23", "buffer-xor": "^2.0.1", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4" }, "devDependencies": { diff --git a/packages/ethash/src/index.ts b/packages/ethash/src/index.ts index 7249fd86662..8fafffadbd9 100644 --- a/packages/ethash/src/index.ts +++ b/packages/ethash/src/index.ts @@ -1,12 +1,12 @@ +import { keccak256, keccak512 } from 'ethereum-cryptography/keccak' import { - keccak, - keccak256, - rlphash, + rlp, zeros, TWO_POW256, bigIntToBuffer, bufferToBigInt, setLengthLeft, + toBuffer, } from 'ethereumjs-util' import { params, @@ -161,17 +161,17 @@ export default class Ethash { mkcache(cacheSize: number, seed: Buffer) { // console.log(`generating cache\nsize: ${cacheSize}\nseed: ${seed.toString('hex')}`) const n = Math.floor(cacheSize / params.HASH_BYTES) - const o = [keccak(seed, 512)] + const o = [toBuffer(keccak512(seed))] let i for (i = 1; i < n; i++) { - o.push(keccak(o[o.length - 1], 512)) + o.push(toBuffer(keccak512(o[o.length - 1]))) } for (let _ = 0; _ < params.CACHE_ROUNDS; _++) { for (i = 0; i < n; i++) { const v = o[i].readUInt32LE(0) % n - o[i] = keccak(xor(o[(i - 1 + n) % n], o[v]), 512) + o[i] = toBuffer(keccak512(xor(o[(i - 1 + n) % n], o[v]))) } } @@ -184,12 +184,12 @@ export default class Ethash { const r = Math.floor(params.HASH_BYTES / params.WORD_BYTES) let mix = Buffer.from(this.cache[i % n]) mix.writeInt32LE(mix.readUInt32LE(0) ^ i, 0) - mix = keccak(mix, 512) + mix = toBuffer(keccak512(mix)) for (let j = 0; j < params.DATASET_PARENTS; j++) { const cacheIndex = fnv(i ^ j, mix.readUInt32LE((j % r) * 4)) mix = fnvBuffer(mix, this.cache[cacheIndex % n]) } - return keccak(mix, 512) + return toBuffer(keccak512(mix)) } run(val: Buffer, nonce: Buffer, fullSize?: number) { @@ -201,7 +201,7 @@ export default class Ethash { } const n = Math.floor(fullSize / params.HASH_BYTES) const w = Math.floor(params.MIX_BYTES / params.WORD_BYTES) - const s = keccak(Buffer.concat([val, bufReverse(nonce)]), 512) + const s = toBuffer(keccak512(Buffer.concat([val, bufReverse(nonce)]))) const mixhashes = Math.floor(params.MIX_BYTES / params.HASH_BYTES) let mix = Buffer.concat(Array(mixhashes).fill(s)) @@ -227,16 +227,16 @@ export default class Ethash { return { mix: cmix, - hash: keccak256(Buffer.concat([s, cmix])), + hash: toBuffer(keccak256(Buffer.concat([s, cmix]))), } } cacheHash() { - return keccak256(Buffer.concat(this.cache)) + return toBuffer(keccak256(Buffer.concat(this.cache))) } headerHash(rawHeader: Buffer[]) { - return rlphash(rawHeader.slice(0, -2)) + return toBuffer(keccak256(rlp.encode(rawHeader.slice(0, -2)))) } /** diff --git a/packages/ethash/src/util.ts b/packages/ethash/src/util.ts index 5a45e899460..97927b05b7c 100644 --- a/packages/ethash/src/util.ts +++ b/packages/ethash/src/util.ts @@ -1,5 +1,6 @@ import { isProbablyPrime } from 'bigint-crypto-utils' -import { keccak256 } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { toBuffer } from 'ethereumjs-util' export const params = { DATASET_BYTES_INIT: 1073741824, // 2^30 @@ -50,7 +51,7 @@ export function getEpoc(blockNumber: bigint) { */ export function getSeed(seed: Buffer, begin: number, end: number) { for (let i = begin; i < end; i++) { - seed = keccak256(seed) + seed = toBuffer(keccak256(seed)) } return seed } diff --git a/packages/statemanager/package.json b/packages/statemanager/package.json index 56831ffb72e..617a197048d 100644 --- a/packages/statemanager/package.json +++ b/packages/statemanager/package.json @@ -36,6 +36,7 @@ "@ethereumjs/common": "^2.6.3", "merkle-patricia-tree": "^4.2.4", "debug": "^4.3.3", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1" }, diff --git a/packages/statemanager/src/stateManager.ts b/packages/statemanager/src/stateManager.ts index aca8eecfb68..4ee25733600 100644 --- a/packages/statemanager/src/stateManager.ts +++ b/packages/statemanager/src/stateManager.ts @@ -1,9 +1,9 @@ +import { keccak256 } from 'ethereum-cryptography/keccak' import { SecureTrie as Trie } from 'merkle-patricia-tree' import { Account, Address, toBuffer, - keccak256, KECCAK256_NULL, rlp, unpadBuffer, @@ -122,7 +122,7 @@ export default class DefaultStateManager extends BaseStateManager implements Sta * @param value - The value of the `code` */ async putContractCode(address: Address, value: Buffer): Promise { - const codeHash = keccak256(value) + const codeHash = toBuffer(keccak256(value)) if (codeHash.equals(KECCAK256_NULL)) { return @@ -355,7 +355,7 @@ export default class DefaultStateManager extends BaseStateManager implements Sta * @param proof the proof to prove */ async verifyProof(proof: Proof): Promise { - const rootHash = keccak256(toBuffer(proof.accountProof[0])) + const rootHash = toBuffer(keccak256(toBuffer(proof.accountProof[0]))) const key = toBuffer(proof.address) const accountProof = proof.accountProof.map((rlpString: PrefixedHexString) => toBuffer(rlpString) diff --git a/packages/statemanager/tests/proofStateManager.spec.ts b/packages/statemanager/tests/proofStateManager.spec.ts index f2d9c2f7298..7f46b81fc1a 100644 --- a/packages/statemanager/tests/proofStateManager.spec.ts +++ b/packages/statemanager/tests/proofStateManager.spec.ts @@ -1,5 +1,6 @@ import tape from 'tape' -import { Address, keccak256, toBuffer, zeros } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { Address, toBuffer, zeros } from 'ethereumjs-util' import { SecureTrie } from 'merkle-patricia-tree' import { DefaultStateManager } from '../src' import ropsten_validAccount from './testdata/ropsten_validAccount.json' @@ -44,7 +45,7 @@ tape('ProofStateManager', (t) => { let stateRoot: Buffer | undefined for (const proofData of ropsten_validAccount.accountProof) { const bufferData = toBuffer(proofData) - const key = keccak256(bufferData) + const key = toBuffer(keccak256(bufferData)) if (stateRoot === undefined) { stateRoot = key } @@ -71,7 +72,7 @@ tape('ProofStateManager', (t) => { let stateRoot: Buffer | undefined for (const proofData of ropsten_nonexistentAccount.accountProof) { const bufferData = toBuffer(proofData) - const key = keccak256(bufferData) + const key = toBuffer(keccak256(bufferData)) if (stateRoot === undefined) { stateRoot = key } @@ -99,7 +100,7 @@ tape('ProofStateManager', (t) => { let stateRoot: Buffer | undefined for (const proofData of ropsten_contractWithStorage.accountProof) { const bufferData = toBuffer(proofData) - const key = keccak256(bufferData) + const key = toBuffer(keccak256(bufferData)) if (stateRoot === undefined) { stateRoot = key } @@ -111,7 +112,7 @@ tape('ProofStateManager', (t) => { for (const storageProofsData of ropsten_contractWithStorage.storageProof) { storageKeys.push(toBuffer(storageProofsData.key)) for (const storageProofData of storageProofsData.proof) { - const key = keccak256(toBuffer(storageProofData)) + const key = toBuffer(keccak256(toBuffer(storageProofData))) await storageTrie.db.put(key, toBuffer(storageProofData)) } } @@ -139,7 +140,7 @@ tape('ProofStateManager', (t) => { let stateRoot: Buffer | undefined for (const proofData of ropsten_contractWithStorage.accountProof) { const bufferData = toBuffer(proofData) - const key = keccak256(bufferData) + const key = toBuffer(keccak256(bufferData)) if (stateRoot === undefined) { stateRoot = key } @@ -151,7 +152,7 @@ tape('ProofStateManager', (t) => { for (const storageProofsData of ropsten_contractWithStorage.storageProof) { storageKeys.push(toBuffer(storageProofsData.key)) for (const storageProofData of storageProofsData.proof) { - const key = keccak256(toBuffer(storageProofData)) + const key = toBuffer(keccak256(toBuffer(storageProofData))) await storageTrie.db.put(key, toBuffer(storageProofData)) } } @@ -206,7 +207,7 @@ tape('ProofStateManager', (t) => { let stateRoot: Buffer | undefined for (const proofData of ropsten_nonexistentAccount.accountProof) { const bufferData = toBuffer(proofData) - const key = keccak256(bufferData) + const key = toBuffer(keccak256(bufferData)) if (stateRoot === undefined) { stateRoot = key } diff --git a/packages/statemanager/tests/stateManager.spec.ts b/packages/statemanager/tests/stateManager.spec.ts index 3b80ab27039..6815a93101e 100644 --- a/packages/statemanager/tests/stateManager.spec.ts +++ b/packages/statemanager/tests/stateManager.spec.ts @@ -1,9 +1,10 @@ import tape from 'tape' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { bytesToHex } from 'ethereum-cryptography/utils' import { Account, Address, toBuffer, - keccak256, KECCAK256_RLP, KECCAK256_RLP_S, unpadBuffer, @@ -257,7 +258,7 @@ tape('StateManager', (t) => { await stateManager.putContractStorage(address, key, value) const data = await stateManager.dumpStorage(address) - const expect = { [keccak256(key).toString('hex')]: '0a' } + const expect = { [bytesToHex(keccak256(key))]: '0a' } st.deepEqual(data, expect, 'should dump storage value') st.end() diff --git a/packages/trie/benchmarks/random.ts b/packages/trie/benchmarks/random.ts index 943aa6f7a46..b7804b55547 100644 --- a/packages/trie/benchmarks/random.ts +++ b/packages/trie/benchmarks/random.ts @@ -1,5 +1,6 @@ 'use strict' -import { keccak256 } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { toBuffer } from 'ethereumjs-util' import { CheckpointTrie as Trie } from '../dist' // References: @@ -14,12 +15,12 @@ export const runTrie = async (eraSize = 9, symmetric = false) => { let key = Buffer.alloc(KEY_SIZE) for (let i = 0; i <= ROUNDS; i++) { - key = keccak256(key) + key = toBuffer(keccak256(key)) if (symmetric) { await trie.put(key, key) } else { - const val = keccak256(key) + const val = toBuffer(keccak256(key)) await trie.put(key, val) } diff --git a/packages/trie/package.json b/packages/trie/package.json index f614873cc55..ffd5f98000b 100644 --- a/packages/trie/package.json +++ b/packages/trie/package.json @@ -38,6 +38,7 @@ }, "dependencies": { "@types/levelup": "^4.3.0", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", "level-ws": "^2.0.0", diff --git a/packages/trie/src/baseTrie.ts b/packages/trie/src/baseTrie.ts index d75d661b6eb..b557dba7d50 100644 --- a/packages/trie/src/baseTrie.ts +++ b/packages/trie/src/baseTrie.ts @@ -1,5 +1,6 @@ import Semaphore from 'semaphore-async-await' -import { keccak, KECCAK256_RLP } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { toBuffer, KECCAK256_RLP } from 'ethereumjs-util' import { DB, BatchDBOp, PutBatch } from './db' import { TrieReadStream as ReadStream } from './readStream' import { bufferToNibbles, matchingNibbleLength, doKeysMatch } from './util/nibbles' @@ -579,7 +580,7 @@ export class Trie { if (rlpNode.length >= 32 || topLevel) { // Do not use TrieNode.hash() here otherwise serialize() // is applied twice (performance) - const hashRoot = keccak(rlpNode) + const hashRoot = toBuffer(keccak256(rlpNode)) if (remove) { if (this._deleteFromDB) { @@ -638,7 +639,7 @@ export class Trie { const opStack = proof.map((nodeValue) => { return { type: 'put', - key: keccak(nodeValue), + key: toBuffer(keccak256(nodeValue)), value: nodeValue, } as PutBatch }) diff --git a/packages/trie/src/secure.ts b/packages/trie/src/secure.ts index 6f1a09967aa..4429df91bd8 100644 --- a/packages/trie/src/secure.ts +++ b/packages/trie/src/secure.ts @@ -1,4 +1,5 @@ -import { keccak256 } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { toBuffer } from 'ethereumjs-util' import { CheckpointTrie } from './checkpointTrie' import { Proof } from './baseTrie' @@ -17,7 +18,7 @@ export class SecureTrie extends CheckpointTrie { * @returns A Promise that resolves to `Buffer` if a value was found or `null` if no value was found. */ async get(key: Buffer): Promise { - const hash = keccak256(key) + const hash = toBuffer(keccak256(key)) const value = await super.get(hash) return value } @@ -32,7 +33,7 @@ export class SecureTrie extends CheckpointTrie { if (!val || val.toString() === '') { await this.del(key) } else { - const hash = keccak256(key) + const hash = toBuffer(keccak256(key)) await super.put(hash, val) } } @@ -42,7 +43,7 @@ export class SecureTrie extends CheckpointTrie { * @param key */ async del(key: Buffer): Promise { - const hash = keccak256(key) + const hash = toBuffer(keccak256(key)) await super.del(hash) } @@ -62,7 +63,7 @@ export class SecureTrie extends CheckpointTrie { * @param key */ static createProof(trie: SecureTrie, key: Buffer): Promise { - const hash = keccak256(key) + const hash = toBuffer(keccak256(key)) return super.createProof(trie, hash) } @@ -75,7 +76,7 @@ export class SecureTrie extends CheckpointTrie { * @returns The value from the key. */ static async verifyProof(rootHash: Buffer, key: Buffer, proof: Proof): Promise { - const hash = keccak256(key) + const hash = toBuffer(keccak256(key)) return super.verifyProof(rootHash, hash, proof) } @@ -92,9 +93,9 @@ export class SecureTrie extends CheckpointTrie { ): Promise { return super.verifyRangeProof( rootHash, - firstKey && keccak256(firstKey), - lastKey && keccak256(lastKey), - keys.map(keccak256), + firstKey && toBuffer(keccak256(firstKey)), + lastKey && toBuffer(keccak256(lastKey)), + keys.map((k) => toBuffer(keccak256(k))), values, proof ) diff --git a/packages/trie/src/trieNode.ts b/packages/trie/src/trieNode.ts index 10b5c7fd153..07d12af8fd5 100644 --- a/packages/trie/src/trieNode.ts +++ b/packages/trie/src/trieNode.ts @@ -1,4 +1,5 @@ -import { keccak256, rlp } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { toBuffer, rlp } from 'ethereumjs-util' import { bufferToNibbles, nibblesToBuffer } from './util/nibbles' import { isTerminator, addHexPrefix, removeHexPrefix } from './util/hex' @@ -45,7 +46,7 @@ export class BranchNode { } hash(): Buffer { - return keccak256(this.serialize()) + return toBuffer(keccak256(this.serialize())) } getBranch(i: number) { @@ -119,7 +120,7 @@ export class ExtensionNode { } hash(): Buffer { - return keccak256(this.serialize()) + return toBuffer(keccak256(this.serialize())) } } @@ -173,7 +174,7 @@ export class LeafNode { } hash(): Buffer { - return keccak256(this.serialize()) + return toBuffer(keccak256(this.serialize())) } } diff --git a/packages/tx/package.json b/packages/tx/package.json index 0326b0fd19e..892e3299d10 100644 --- a/packages/tx/package.json +++ b/packages/tx/package.json @@ -35,6 +35,7 @@ }, "dependencies": { "@ethereumjs/common": "^2.6.4", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4" }, "devDependencies": { diff --git a/packages/tx/src/eip1559Transaction.ts b/packages/tx/src/eip1559Transaction.ts index faf5926dbf8..c906e6159bf 100644 --- a/packages/tx/src/eip1559Transaction.ts +++ b/packages/tx/src/eip1559Transaction.ts @@ -1,9 +1,9 @@ +import { keccak256 } from 'ethereum-cryptography/keccak' import { bigIntToHex, bigIntToUnpaddedBuffer, bufferToBigInt, ecrecover, - keccak256, MAX_INTEGER, rlp, toBuffer, @@ -290,7 +290,7 @@ export default class FeeMarketEIP1559Transaction extends BaseTransaction { getMessageToSign(hashMessage = true) { const message = this._getMessageToSign() if (hashMessage) { - return rlphash(message) + return toBuffer(keccak256(rlp.encode(message))) } else { return message } @@ -272,12 +272,12 @@ export default class Transaction extends BaseTransaction { if (Object.isFrozen(this)) { if (!this.cache.hash) { - this.cache.hash = rlphash(this.raw()) + this.cache.hash = toBuffer(keccak256(rlp.encode(this.raw()))) } return this.cache.hash } - return rlphash(this.raw()) + return toBuffer(keccak256(rlp.encode(this.raw()))) } /** @@ -289,7 +289,7 @@ export default class Transaction extends BaseTransaction { throw new Error(msg) } const message = this._getMessageToSign() - return rlphash(message) + return toBuffer(keccak256(rlp.encode(message))) } /** diff --git a/packages/util/src/account.ts b/packages/util/src/account.ts index 348beb68235..4c478bb9850 100644 --- a/packages/util/src/account.ts +++ b/packages/util/src/account.ts @@ -1,9 +1,10 @@ -import { rlp } from './externals' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { bytesToHex } from 'ethereum-cryptography/utils' import { Point, utils } from 'ethereum-cryptography/secp256k1' import { stripHexPrefix } from './internal' import { KECCAK256_RLP, KECCAK256_NULL } from './constants' import { zeros, bufferToHex, toBuffer, bufferToBigInt, bigIntToUnpaddedBuffer } from './bytes' -import { keccak, keccak256, keccakFromString, rlphash } from './hash' +import { rlp } from './externals' import { assertIsString, assertIsHexString, assertIsBuffer } from './helpers' import { BigIntLike, BufferLike } from './types' @@ -151,7 +152,8 @@ export const toChecksumAddress = function ( prefix = chainId.toString() + '0x' } - const hash = keccakFromString(prefix + address).toString('hex') + const buf = Buffer.from(prefix + address, 'utf8') + const hash = bytesToHex(keccak256(buf)) let ret = '0x' for (let i = 0; i < address.length; i++) { @@ -189,11 +191,11 @@ export const generateAddress = function (from: Buffer, nonce: Buffer): Buffer { if (bufferToBigInt(nonce) === BigInt(0)) { // in RLP we want to encode null in the case of zero nonce // read the RLP documentation for an answer if you dare - return rlphash([from, null]).slice(-20) + return toBuffer(keccak256(rlp.encode([from, null]))).slice(-20) } // Only take the lower 160bits of the hash - return rlphash([from, nonce]).slice(-20) + return toBuffer(keccak256(rlp.encode([from, nonce]))).slice(-20) } /** @@ -218,7 +220,7 @@ export const generateAddress2 = function (from: Buffer, salt: Buffer, initCode: Buffer.concat([Buffer.from('ff', 'hex'), from, salt, keccak256(initCode)]) ) - return address.slice(-20) + return toBuffer(address).slice(-20) } /** @@ -274,7 +276,7 @@ export const pubToAddress = function (pubKey: Buffer, sanitize: boolean = false) throw new Error('Expected pubKey to be of length 64') } // Only take the lower 160bits of the hash - return keccak(pubKey).slice(-20) + return toBuffer(keccak256(pubKey)).slice(-20) } export const publicToAddress = pubToAddress diff --git a/packages/util/src/hash.ts b/packages/util/src/hash.ts deleted file mode 100644 index 31934faa46b..00000000000 --- a/packages/util/src/hash.ts +++ /dev/null @@ -1,162 +0,0 @@ -import { keccak224, keccak384, keccak256 as k256, keccak512 } from 'ethereum-cryptography/keccak' -import { ripemd160 as rmd160 } from 'ethereum-cryptography/ripemd160' -import { sha256 as s256 } from 'ethereum-cryptography/sha256' -import { rlp } from './externals' -import { toBuffer, setLengthLeft } from './bytes' -import { assertIsString, assertIsBuffer, assertIsArray, assertIsHexString } from './helpers' - -const _keccak = function (a: Buffer, bits: number): Uint8Array { - switch (bits) { - case 224: { - return keccak224(a) - } - case 256: { - return k256(a) - } - case 384: { - return keccak384(a) - } - case 512: { - return keccak512(a) - } - default: { - throw new Error(`Invald algorithm: keccak${bits}`) - } - } -} -/** - * Creates Keccak hash of a Buffer input - * @param a The input data (Buffer) - * @param bits (number = 256) The Keccak width - */ -export const keccak = function (a: Buffer, bits: number = 256): Buffer { - assertIsBuffer(a) - return toBuffer(_keccak(a, bits)) -} - -/** - * Creates Keccak-256 hash of the input, alias for keccak(a, 256). - * @param a The input data (Buffer) - */ -export const keccak256 = function (a: Buffer): Buffer { - return keccak(a) -} - -/** - * Creates Keccak hash of a utf-8 string input - * @param a The input data (String) - * @param bits (number = 256) The Keccak width - */ -export const keccakFromString = function (a: string, bits: number = 256) { - assertIsString(a) - const buf = Buffer.from(a, 'utf8') - return keccak(buf, bits) -} - -/** - * Creates Keccak hash of an 0x-prefixed string input - * @param a The input data (String) - * @param bits (number = 256) The Keccak width - */ -export const keccakFromHexString = function (a: string, bits: number = 256) { - assertIsHexString(a) - return keccak(toBuffer(a), bits) -} - -/** - * Creates Keccak hash of a number array input - * @param a The input data (number[]) - * @param bits (number = 256) The Keccak width - */ -export const keccakFromArray = function (a: number[], bits: number = 256) { - assertIsArray(a) - return keccak(toBuffer(a), bits) -} - -/** - * Creates SHA256 hash of an input. - * @param a The input data (Buffer|Array|String) - */ -const _sha256 = function (a: Uint8Array): Buffer { - return toBuffer(s256(a)) -} - -/** - * Creates SHA256 hash of a Buffer input. - * @param a The input data (Buffer) - */ -export const sha256 = function (a: Buffer): Buffer { - assertIsBuffer(a) - return _sha256(a) -} - -/** - * Creates SHA256 hash of a string input. - * @param a The input data (string) - */ -export const sha256FromString = function (a: string): Buffer { - assertIsHexString(a) - return _sha256(toBuffer(a)) -} - -/** - * Creates SHA256 hash of a number[] input. - * @param a The input data (number[]) - */ -export const sha256FromArray = function (a: number[]): Buffer { - assertIsArray(a) - return _sha256(Uint8Array.from(a)) -} - -/** - * Creates RIPEMD160 hash of the input. - * @param a The input data (Buffer|Array|String|Number) - * @param padded Whether it should be padded to 256 bits or not - */ -const _ripemd160 = function (a: any, padded: boolean): Buffer { - a = toBuffer(a) - const hash = toBuffer(rmd160(a)) - if (padded === true) { - return setLengthLeft(hash, 32) - } else { - return hash - } -} - -/** - * Creates RIPEMD160 hash of a Buffer input. - * @param a The input data (Buffer) - * @param padded Whether it should be padded to 256 bits or not - */ -export const ripemd160 = function (a: Buffer, padded: boolean): Buffer { - assertIsBuffer(a) - return _ripemd160(a, padded) -} - -/** - * Creates RIPEMD160 hash of a string input. - * @param a The input data (String) - * @param padded Whether it should be padded to 256 bits or not - */ -export const ripemd160FromString = function (a: string, padded: boolean): Buffer { - assertIsString(a) - return _ripemd160(a, padded) -} - -/** - * Creates RIPEMD160 hash of a number[] input. - * @param a The input data (number[]) - * @param padded Whether it should be padded to 256 bits or not - */ -export const ripemd160FromArray = function (a: number[], padded: boolean): Buffer { - assertIsArray(a) - return _ripemd160(a, padded) -} - -/** - * Creates SHA-3 hash of the RLP encoded version of the input. - * @param a The input data - */ -export const rlphash = function (a: rlp.Input): Buffer { - return keccak(rlp.encode(a)) -} diff --git a/packages/util/src/index.ts b/packages/util/src/index.ts index 41ed8537480..02689a8106b 100644 --- a/packages/util/src/index.ts +++ b/packages/util/src/index.ts @@ -13,11 +13,6 @@ export * from './account' */ export * from './address' -/** - * Hash functions - */ -export * from './hash' - /** * ECDSA signature */ diff --git a/packages/util/src/signature.ts b/packages/util/src/signature.ts index cd3bd4d36ba..d137bd1356e 100644 --- a/packages/util/src/signature.ts +++ b/packages/util/src/signature.ts @@ -1,3 +1,4 @@ +import { keccak256 } from 'ethereum-cryptography/keccak' import { signSync, recoverPublicKey } from 'ethereum-cryptography/secp256k1' import { toBuffer, @@ -8,7 +9,6 @@ import { bufferToBigInt, } from './bytes' import { SECP256K1_ORDER, SECP256K1_ORDER_DIV_2 } from './constants' -import { keccak } from './hash' import { assertIsBuffer } from './helpers' import { BigIntLike, toType, TypeOutput } from './types' @@ -217,5 +217,5 @@ export const isValidSignature = function ( export const hashPersonalMessage = function (message: Buffer): Buffer { assertIsBuffer(message) const prefix = Buffer.from(`\u0019Ethereum Signed Message:\n${message.length}`, 'utf-8') - return keccak(Buffer.concat([prefix, message])) + return toBuffer(keccak256(Buffer.concat([prefix, message]))) } diff --git a/packages/util/test/hash.spec.ts b/packages/util/test/hash.spec.ts deleted file mode 100644 index 03fd99dfe67..00000000000 --- a/packages/util/test/hash.spec.ts +++ /dev/null @@ -1,281 +0,0 @@ -import tape from 'tape' -import { - keccak, - keccak256, - keccakFromString, - keccakFromHexString, - keccakFromArray, - sha256, - sha256FromString, - sha256FromArray, - ripemd160, - ripemd160FromString, - ripemd160FromArray, - rlphash, - toBuffer, -} from '../src' - -tape('keccak', function (t) { - t.test('should produce a keccak224 hash', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '9e66938bd8f32c8610444bb524630db496bd58b689f9733182df63ba' - const hash = keccak(toBuffer(msg), 224) - st.equal(hash.toString('hex'), r) - st.end() - }) - t.test('should produce a keccak256 hash', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '82ff40c0a986c6a5cfad4ddf4c3aa6996f1a7837f9c398e17e5de5cbd5a12b28' - const hash = keccak(toBuffer(msg)) - st.equal(hash.toString('hex'), r) - st.end() - }) - t.test('should produce a keccak384 hash', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = - '923e0f6a1c324a698139c3f3abbe88ac70bf2e7c02b26192c6124732555a32cef18e81ac91d5d97ce969745409c5bbc6' - const hash = keccak(toBuffer(msg), 384) - st.equal(hash.toString('hex'), r) - st.end() - }) - t.test('should produce a keccak512 hash', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = - '36fdacd0339307068e9ed191773a6f11f6f9f99016bd50f87fd529ab7c87e1385f2b7ef1ac257cc78a12dcb3e5804254c6a7b404a6484966b831eadc721c3d24' - const hash = keccak(toBuffer(msg), 512) - st.equal(hash.toString('hex'), r) - st.end() - }) - t.test('should error if input is not Buffer', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - st.throws(function () { - keccak((msg) as Buffer) - }) - st.end() - }) - t.test('should error if provided incorrect bits', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - st.throws(function () { - keccak(toBuffer(msg), 1024) - }) - st.end() - }) -}) - -tape('keccak256', function (t) { - t.test('should produce a hash (keccak(a, 256) alias)', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '82ff40c0a986c6a5cfad4ddf4c3aa6996f1a7837f9c398e17e5de5cbd5a12b28' - const hash = keccak256(toBuffer(msg)) - st.equal(hash.toString('hex'), r) - st.end() - }) -}) - -tape('keccakFromString', function (t) { - t.test('should produce a hash', function (st) { - const msg = '3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '22ae1937ff93ec72c4d46ff3e854661e3363440acd6f6e4adf8f1a8978382251' - const hash = keccakFromString(msg) - st.equal(hash.toString('hex'), r) - st.end() - }) - t.test('should throw if input is not a string', function (st) { - const buf = toBuffer('0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1') - st.throws(function () { - keccakFromString((buf) as string) - }) - st.end() - }) -}) - -tape('keccakFromHexString', function (t) { - t.test('should produce a hash', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '82ff40c0a986c6a5cfad4ddf4c3aa6996f1a7837f9c398e17e5de5cbd5a12b28' - const hash = keccakFromHexString(msg) - st.equal(hash.toString('hex'), r) - st.end() - }) - t.test('should throw if input is not hex-prefixed', function (st) { - const msg = '3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - st.throws(function () { - keccakFromHexString(msg) - }) - st.end() - }) - t.test('should throw if input is not a string', function (st) { - const buf = toBuffer('0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1') - st.throws(function () { - keccakFromHexString((buf) as string) - }) - st.end() - }) -}) - -tape('keccakFromArray', function (t) { - t.test('should produce a hash', function (st) { - const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 0] - const r = 'fba8669bd39e3257e64752758f3a0d3218865a15757c6b0bc48b8ef95bc8bfd5' - const hash = keccakFromArray(arr) - st.equal(hash.toString('hex'), r) - st.end() - }) - t.test('should throw if input is not an array', function (st) { - const buf = toBuffer([0, 1, 2, 3, 4, 5, 6, 7, 8, 0]) - st.throws(function () { - keccakFromArray((buf) as number[]) - }) - st.end() - }) -}) - -tape('keccak-512', function (t) { - t.test('should produce a hash', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = - '36fdacd0339307068e9ed191773a6f11f6f9f99016bd50f87fd529ab7c87e1385f2b7ef1ac257cc78a12dcb3e5804254c6a7b404a6484966b831eadc721c3d24' - const hash = keccak(toBuffer(msg), 512) - st.equal(hash.toString('hex'), r) - st.end() - }) -}) - -tape('sha256', function (t) { - t.test('should produce a sha256', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '58bbda5e10bc11a32d808e40f9da2161a64f00b5557762a161626afe19137445' - const hash = sha256(toBuffer(msg)) - st.equal(hash.toString('hex'), r) - st.end() - }) - t.test('should error if input is not Buffer', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - st.throws(function () { - sha256((msg) as Buffer) - }) - st.end() - }) -}) - -tape('sha256FromString', function (t) { - t.test('should produce a sha256', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '58bbda5e10bc11a32d808e40f9da2161a64f00b5557762a161626afe19137445' - const hash = sha256FromString(msg) - st.equal(hash.toString('hex'), r) - st.end() - }) - t.test('should error if input is not Buffer', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - st.throws(function () { - sha256FromString((toBuffer(msg)) as string) - }) - st.end() - }) -}) - -tape('sha256FromArray', function (t) { - t.test('should produce a sha256', function (st) { - const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 0] - const r = '5443c487d45d01c56150d91e7a071c69a97939b1c57874b73989a9ff7875e86b' - const hash = sha256FromArray(arr) - st.equal(hash.toString('hex'), r) - st.end() - }) - t.test('should error if input is not Buffer', function (st) { - const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 0] - st.throws(function () { - sha256FromArray((toBuffer(arr)) as number[]) - }) - st.end() - }) -}) - -tape('ripemd160', function (t) { - t.test('should produce a ripemd160', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '4bb0246cbfdfddbe605a374f1187204c896fabfd' - const hash = ripemd160(toBuffer(msg), false) - st.equal(hash.toString('hex'), r) - st.end() - }) - - t.test('should produce a padded ripemd160', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '0000000000000000000000004bb0246cbfdfddbe605a374f1187204c896fabfd' - const hash = ripemd160(toBuffer(msg), true) - st.equal(hash.toString('hex'), r) - st.end() - }) - - t.test('should error if input is not Buffer', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - st.throws(function () { - ripemd160((msg) as Buffer, false) - }) - st.end() - }) -}) - -tape('ripemd160FromString', function (t) { - t.test('should produce a ripemd160', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '4bb0246cbfdfddbe605a374f1187204c896fabfd' - const hash = ripemd160FromString(msg, false) - st.equal(hash.toString('hex'), r) - st.end() - }) - - t.test('should produce a padded ripemd160', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '0000000000000000000000004bb0246cbfdfddbe605a374f1187204c896fabfd' - const hash = ripemd160FromString(msg, true) - st.equal(hash.toString('hex'), r) - st.end() - }) - - t.test('should error if input is not a string', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - st.throws(function () { - ripemd160FromString((toBuffer(msg)) as string, false) - }) - st.end() - }) -}) - -tape('ripemd160FromArray', function (t) { - t.test('should produce a ripemd160', function (st) { - const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 0] - const r = 'ddbb5062318b209e3dbfc389fe61840363050071' - const hash = ripemd160FromArray(arr, false) - st.equal(hash.toString('hex'), r) - st.end() - }) - - t.test('should produce a padded ripemd160', function (st) { - const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 0] - const r = '000000000000000000000000ddbb5062318b209e3dbfc389fe61840363050071' - const hash = ripemd160FromArray(arr, true) - st.equal(hash.toString('hex'), r) - st.end() - }) - - t.test('should error if input is not an array', function (st) { - const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 0] - st.throws(function () { - ripemd160FromArray((toBuffer(arr)) as number[], false) - }) - st.end() - }) -}) - -tape('rlphash', function (t) { - t.test('should produce a keccak-256 hash of the rlp data', function (st) { - const msg = '0x3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1' - const r = '33f491f24abdbdbf175e812b94e7ede338d1c7f01efb68574acd279a15a39cbe' - const hash = rlphash(msg) - st.equal(hash.toString('hex'), r) - st.end() - }) -}) diff --git a/packages/vm/package.json b/packages/vm/package.json index dd39c505abc..f7952ea9f02 100644 --- a/packages/vm/package.json +++ b/packages/vm/package.json @@ -56,6 +56,7 @@ "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", "debug": "^4.3.3", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", diff --git a/packages/vm/src/bloom/index.ts b/packages/vm/src/bloom/index.ts index e9c8b34fc3e..20774f99b74 100644 --- a/packages/vm/src/bloom/index.ts +++ b/packages/vm/src/bloom/index.ts @@ -1,5 +1,6 @@ import assert from 'assert' -import { zeros, keccak256 } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { toBuffer, zeros } from 'ethereumjs-util' const BYTE_SIZE = 256 @@ -24,7 +25,7 @@ export default class Bloom { */ add(e: Buffer) { assert(Buffer.isBuffer(e), 'Element should be buffer') - e = keccak256(e) + e = toBuffer(keccak256(e)) const mask = 2047 // binary 11111111111 for (let i = 0; i < 3; i++) { @@ -42,7 +43,7 @@ export default class Bloom { */ check(e: Buffer): boolean { assert(Buffer.isBuffer(e), 'Element should be Buffer') - e = keccak256(e) + e = toBuffer(keccak256(e)) const mask = 2047 // binary 11111111111 let match = true diff --git a/packages/vm/src/evm/opcodes/functions.ts b/packages/vm/src/evm/opcodes/functions.ts index 883fc0abbd7..3db6c308b94 100644 --- a/packages/vm/src/evm/opcodes/functions.ts +++ b/packages/vm/src/evm/opcodes/functions.ts @@ -1,7 +1,9 @@ import Common from '@ethereumjs/common' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { bytesToHex } from 'ethereum-cryptography/utils' import { Address, - keccak256, + toBuffer, KECCAK256_NULL, TWO_POW256, MAX_INTEGER_BIGINT, @@ -379,7 +381,7 @@ export const handlers: Map = new Map([ if (length !== BigInt(0)) { data = runState.memory.read(Number(offset), Number(length)) } - const r = bufferToBigInt(keccak256(data)) + const r = BigInt('0x' + bytesToHex(keccak256(data))) runState.stack.push(r) }, ], @@ -532,7 +534,7 @@ export const handlers: Map = new Map([ return } - runState.stack.push(bufferToBigInt(keccak256(code))) + runState.stack.push(BigInt('0x' + bytesToHex(keccak256(code)))) }, ], // 0x3d: RETURNDATASIZE @@ -1031,7 +1033,7 @@ export const handlers: Map = new Map([ const paddedInvokerAddress = setLengthLeft(runState.eei._env.address.buf, 32) const chainId = setLengthLeft(bigIntToBuffer(runState.eei.getChainId()), 32) const message = Buffer.concat([EIP3074MAGIC, chainId, paddedInvokerAddress, commit]) - const msgHash = keccak256(message) + const msgHash = toBuffer(keccak256(message)) let recover try { diff --git a/packages/vm/src/evm/opcodes/util.ts b/packages/vm/src/evm/opcodes/util.ts index eac943e156a..7ea35ae8a01 100644 --- a/packages/vm/src/evm/opcodes/util.ts +++ b/packages/vm/src/evm/opcodes/util.ts @@ -1,5 +1,7 @@ import Common, { Hardfork } from '@ethereumjs/common' -import { keccak256, setLengthRight, setLengthLeft, bigIntToBuffer } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { bytesToHex } from 'ethereum-cryptography/utils' +import { setLengthRight, setLengthLeft, bigIntToBuffer } from 'ethereumjs-util' import { ERROR, VmError } from './../../exceptions' import { RunState } from './../interpreter' @@ -39,7 +41,7 @@ export function addressToBuffer(address: bigint | Buffer) { * Error message helper - generates location string */ export function describeLocation(runState: RunState): string { - const hash = keccak256(runState.eei.getCode()).toString('hex') + const hash = bytesToHex(keccak256(runState.eei.getCode())) const address = runState.eei.getAddress().buf.toString('hex') const pc = runState.programCounter - 1 return `${hash}/${address}:${pc}` diff --git a/packages/vm/src/evm/precompiles/02-sha256.ts b/packages/vm/src/evm/precompiles/02-sha256.ts index 6779547aec3..263f5af7b67 100644 --- a/packages/vm/src/evm/precompiles/02-sha256.ts +++ b/packages/vm/src/evm/precompiles/02-sha256.ts @@ -1,4 +1,5 @@ -import { sha256 } from 'ethereumjs-util' +import { sha256 } from 'ethereum-cryptography/sha256' +import { toBuffer } from 'ethereumjs-util' import { PrecompileInput } from './types' import { OOGResult, ExecResult } from '../evm' const assert = require('assert') @@ -18,6 +19,6 @@ export default function (opts: PrecompileInput): ExecResult { return { gasUsed, - returnValue: sha256(data), + returnValue: toBuffer(sha256(data)), } } diff --git a/packages/vm/src/evm/precompiles/03-ripemd160.ts b/packages/vm/src/evm/precompiles/03-ripemd160.ts index c979072e7af..503820ba5af 100644 --- a/packages/vm/src/evm/precompiles/03-ripemd160.ts +++ b/packages/vm/src/evm/precompiles/03-ripemd160.ts @@ -1,4 +1,5 @@ -import { ripemd160 } from 'ethereumjs-util' +import { ripemd160 } from 'ethereum-cryptography/ripemd160' +import { setLengthLeft, toBuffer } from 'ethereumjs-util' import { PrecompileInput } from './types' import { OOGResult, ExecResult } from '../evm' const assert = require('assert') @@ -18,6 +19,6 @@ export default function (opts: PrecompileInput): ExecResult { return { gasUsed, - returnValue: ripemd160(data, true), + returnValue: setLengthLeft(toBuffer(ripemd160(data)), 32), } } diff --git a/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts b/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts index 8658dfe46b5..f027d4feb66 100644 --- a/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts @@ -1,10 +1,10 @@ import tape from 'tape' +import { keccak256 } from 'ethereum-cryptography/keccak' import { Address, bigIntToBuffer, bufferToBigInt, ecsign, - keccak256, privateToAddress, setLengthLeft, toBuffer, @@ -64,7 +64,7 @@ function signMessage(commitUnpadded: Buffer, address: Address, privateKey: Buffe const paddedInvokerAddress = setLengthLeft(address.buf, 32) const chainId = setLengthLeft(bigIntToBuffer(common.chainId()), 32) const message = Buffer.concat([Buffer.from('03', 'hex'), chainId, paddedInvokerAddress, commit]) - const msgHash = keccak256(message) + const msgHash = toBuffer(keccak256(message)) return ecsign(msgHash, privateKey, 0) } diff --git a/packages/vm/tests/api/runCall.spec.ts b/packages/vm/tests/api/runCall.spec.ts index fe5d73b911a..ec91ca33cb8 100644 --- a/packages/vm/tests/api/runCall.spec.ts +++ b/packages/vm/tests/api/runCall.spec.ts @@ -1,5 +1,6 @@ import tape from 'tape' -import { Account, Address, keccak256, MAX_UINT64, padToEven } from 'ethereumjs-util' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { Account, Address, toBuffer, MAX_UINT64, padToEven } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../src' import { ERROR } from '../../src/exceptions' @@ -8,7 +9,7 @@ import { ERROR } from '../../src/exceptions' function create2address(sourceAddress: Address, codeHash: Buffer, salt: Buffer): Address { const rlp_proc_buffer = Buffer.from('ff', 'hex') const hashBuffer = Buffer.concat([rlp_proc_buffer, sourceAddress.buf, salt, codeHash]) - return new Address(keccak256(hashBuffer).slice(12)) + return new Address(toBuffer(keccak256(hashBuffer)).slice(12)) } /* @@ -45,7 +46,7 @@ tape('Constantinople: EIP-1014 CREATE2 creates the right contract address', asyn await vm.stateManager.putContractCode(contractAddress, Buffer.from(code, 'hex')) // setup the contract code await vm.stateManager.putAccount(caller, new Account(BigInt(0), BigInt(0x11111111))) // give the calling account a big balance so we don't run out of funds - const codeHash = keccak256(Buffer.from('')) + const codeHash = toBuffer(keccak256(Buffer.from(''))) for (let value = 0; value <= 1000; value += 20) { // setup the call arguments const runCallArgs = { diff --git a/packages/vm/tests/util.ts b/packages/vm/tests/util.ts index a61d6bdcc3f..644f21370af 100644 --- a/packages/vm/tests/util.ts +++ b/packages/vm/tests/util.ts @@ -7,10 +7,11 @@ import { Transaction, TxOptions, } from '@ethereumjs/tx' +import { keccak256 } from 'ethereum-cryptography/keccak' +import { bytesToHex } from 'ethereum-cryptography/utils' import { Account, rlp, - keccak256, stripHexPrefix, setLengthLeft, toBuffer, @@ -131,7 +132,7 @@ export async function verifyPostConditions(state: any, testData: any, t: tape.Te const keyMap: any = {} for (const key in testData) { - const hash = keccak256(Buffer.from(stripHexPrefix(key), 'hex')).toString('hex') + const hash = bytesToHex(keccak256(Buffer.from(stripHexPrefix(key), 'hex'))) hashedAccounts[hash] = testData[key] keyMap[hash] = key } @@ -191,9 +192,8 @@ export function verifyAccountPostConditions( const hashedStorage: any = {} for (const key in acctData.storage) { - hashedStorage[ - keccak256(setLengthLeft(Buffer.from(key.slice(2), 'hex'), 32)).toString('hex') - ] = acctData.storage[key] + hashedStorage[bytesToHex(keccak256(setLengthLeft(Buffer.from(key.slice(2), 'hex'), 32)))] = + acctData.storage[key] } if (storageKeys.length > 0) { From 7168c41cb297d0abaaf1b3d13cd8a9c9610b0eda Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Wed, 4 May 2022 04:01:46 -0400 Subject: [PATCH 36/44] vm: Improve `skipBalance` logic (#1849) * Add better skipBalance handling * New runCall check for insufficient balance * Move skipbalance check to top * Add coverage for insufficient balance check * Make skipBalance adjust just + balance * Test more cases with skipBalance * update docs * Doc nits * Requested fixes * Add missing nonce check * Update packages/vm/src/runTx.ts * nits * improve comments * remove leftover tape.only Co-authored-by: Ryan Ghods --- packages/vm/src/evm/evm.ts | 11 +++++-- packages/vm/src/exceptions.ts | 1 + packages/vm/src/runCall.ts | 20 ++++++++++-- packages/vm/src/runTx.ts | 11 +++++-- packages/vm/tests/api/runCall.spec.ts | 44 +++++++++++++++++++++++++++ packages/vm/tests/api/runTx.spec.ts | 32 +++++++++++++++++++ 6 files changed, 111 insertions(+), 8 deletions(-) diff --git a/packages/vm/src/evm/evm.ts b/packages/vm/src/evm/evm.ts index fa730bb880c..7dba3b6e16b 100644 --- a/packages/vm/src/evm/evm.ts +++ b/packages/vm/src/evm/evm.ts @@ -244,14 +244,18 @@ export default class EVM { async _executeCall(message: Message): Promise { const account = await this._state.getAccount(message.authcallOrigin ?? message.caller) + let errorMessage // Reduce tx value from sender if (!message.delegatecall) { - await this._reduceSenderBalance(account, message) + try { + await this._reduceSenderBalance(account, message) + } catch (e) { + errorMessage = e + } } // Load `to` account const toAccount = await this._state.getAccount(message.to) // Add tx value to the `to` account - let errorMessage if (!message.delegatecall) { try { await this._addToBalance(toAccount, message) @@ -633,6 +637,9 @@ export default class EVM { async _reduceSenderBalance(account: Account, message: Message): Promise { account.balance -= message.value + if (account.balance < BigInt(0)) { + throw new VmError(ERROR.INSUFFICIENT_BALANCE) + } const result = this._state.putAccount(message.authcallOrigin ?? message.caller, account) if (this._vm.DEBUG) { debug(`Reduced sender (${message.caller}) balance (-> ${account.balance})`) diff --git a/packages/vm/src/exceptions.ts b/packages/vm/src/exceptions.ts index 31239536519..159b0223423 100644 --- a/packages/vm/src/exceptions.ts +++ b/packages/vm/src/exceptions.ts @@ -13,6 +13,7 @@ export enum ERROR { STOP = 'stop', REFUND_EXHAUSTED = 'refund exhausted', VALUE_OVERFLOW = 'value overflow', + INSUFFICIENT_BALANCE = 'insufficient balance', INVALID_BEGINSUB = 'invalid BEGINSUB', INVALID_RETURNSUB = 'invalid RETURNSUB', INVALID_JUMPSUB = 'invalid JUMPSUB', diff --git a/packages/vm/src/runCall.ts b/packages/vm/src/runCall.ts index f0911b57f55..16798816828 100644 --- a/packages/vm/src/runCall.ts +++ b/packages/vm/src/runCall.ts @@ -65,6 +65,10 @@ export interface RunCallOpts { * Addresses to selfdestruct. Defaults to none. */ selfdestruct?: { [k: string]: boolean } + /** + * Skip balance checks if true. Adds transaction value to balance to ensure execution doesn't fail. + */ + skipBalance?: boolean /** * If the call is a DELEGATECALL. Defaults to false. */ @@ -74,7 +78,7 @@ export interface RunCallOpts { /** * @ignore */ -export default function runCall(this: VM, opts: RunCallOpts): Promise { +export default async function runCall(this: VM, opts: RunCallOpts): Promise { const block = opts.block ?? Block.fromBlockData({}, { common: this._common }) const txContext = new TxContext( @@ -82,11 +86,21 @@ export default function runCall(this: VM, opts: RunCallOpts): Promise opts.origin ?? opts.caller ?? Address.zero() ) + const caller = opts.caller ?? Address.zero() + const value = opts.value ?? BigInt(0) + + if (opts.skipBalance) { + // if skipBalance, add `value` to caller balance to ensure sufficient funds + const callerAccount = await this.stateManager.getAccount(caller) + callerAccount.balance += value + await this.stateManager.putAccount(caller, callerAccount) + } + const message = new Message({ - caller: opts.caller ?? Address.zero(), + caller, gasLimit: opts.gasLimit ?? BigInt(0xffffff), to: opts.to ?? undefined, - value: opts.value, + value, data: opts.data, code: opts.code, depth: opts.depth ?? 0, diff --git a/packages/vm/src/runTx.ts b/packages/vm/src/runTx.ts index 99ed9a7c50a..b2f1840a66b 100644 --- a/packages/vm/src/runTx.ts +++ b/packages/vm/src/runTx.ts @@ -44,7 +44,7 @@ export interface RunTxOpts { */ skipNonce?: boolean /** - * If true, skips the balance check + * Skip balance checks if true. Adds transaction cost to balance to ensure execution doesn't fail. */ skipBalance?: boolean @@ -315,8 +315,12 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { throw new Error(msg) } - if (!opts.skipBalance) { - const cost = tx.getUpfrontCost(block.header.baseFeePerGas) + const cost = tx.getUpfrontCost(block.header.baseFeePerGas) + if (opts.skipBalance) { + // if skipBalance, add tx cost to sender balance to ensure sufficient funds + fromAccount.balance += cost + await this.stateManager.putAccount(caller, fromAccount) + } else { if (balance < cost) { const msg = _errorMsg( `sender doesn't have enough funds to send tx. The upfront cost is: ${cost} and the sender's account (${caller}) only has: ${balance}`, @@ -326,6 +330,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { ) throw new Error(msg) } + if (tx.supports(Capability.EIP1559FeeMarket)) { // EIP-1559 spec: // The signer must be able to afford the transaction diff --git a/packages/vm/tests/api/runCall.spec.ts b/packages/vm/tests/api/runCall.spec.ts index ec91ca33cb8..3425f557dec 100644 --- a/packages/vm/tests/api/runCall.spec.ts +++ b/packages/vm/tests/api/runCall.spec.ts @@ -525,3 +525,47 @@ tape('Throws on negative call value', async (t) => { t.end() }) + +tape('runCall() -> skipBalance behavior', async (t) => { + t.plan(7) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }) + const vm = await VM.create({ common }) + + // runCall against a contract to reach `_reduceSenderBalance` + const contractCode = Buffer.from('00', 'hex') // 00: STOP + const contractAddress = Address.fromString('0x000000000000000000000000636F6E7472616374') + await vm.stateManager.putContractCode(contractAddress, contractCode) + const senderKey = Buffer.from( + 'e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', + 'hex' + ) + const sender = Address.fromPrivateKey(senderKey) + + const runCallArgs = { + gasLimit: BigInt(21000), + value: BigInt(6), + from: sender, + to: contractAddress, + skipBalance: true, + } + + for (const balance of [undefined, BigInt(5)]) { + await vm.stateManager.modifyAccountFields(sender, { nonce: BigInt(0), balance }) + const res = await vm.runCall(runCallArgs) + t.pass('runCall should not throw with no balance and skipBalance') + const senderBalance = (await vm.stateManager.getAccount(sender)).balance + t.equal( + senderBalance, + balance ?? BigInt(0), + 'sender balance should be the same before and after call execution with skipBalance' + ) + t.equal(res.execResult.exceptionError, undefined, 'no exceptionError with skipBalance') + } + + const res2 = await vm.runCall({ ...runCallArgs, skipBalance: false }) + t.equal( + res2.execResult.exceptionError?.error, + 'insufficient balance', + 'runCall reverts when insufficient sender balance and skipBalance is false' + ) +}) diff --git a/packages/vm/tests/api/runTx.spec.ts b/packages/vm/tests/api/runTx.spec.ts index b07f56a2b2a..a4432b27b39 100644 --- a/packages/vm/tests/api/runTx.spec.ts +++ b/packages/vm/tests/api/runTx.spec.ts @@ -640,3 +640,35 @@ tape('runTx() -> RunTxOptions', (t) => { t.end() }) }) + +tape('runTx() -> skipBalance behavior', async (t) => { + t.plan(6) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }) + const vm = await VM.create({ common }) + const senderKey = Buffer.from( + 'e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', + 'hex' + ) + const sender = Address.fromPrivateKey(senderKey) + + for (const balance of [undefined, BigInt(5)]) { + if (balance) { + await vm.stateManager.modifyAccountFields(sender, { nonce: BigInt(0), balance }) + } + const tx = Transaction.fromTxData({ + gasLimit: BigInt(21000), + value: BigInt(1), + to: Address.zero(), + }).sign(senderKey) + + const res = await vm.runTx({ tx, skipBalance: true }) + t.pass('runTx should not throw with no balance and skipBalance') + const afterTxBalance = (await vm.stateManager.getAccount(sender)).balance + t.equal( + afterTxBalance, + balance ?? BigInt(0), + `sender balance before and after transaction should be equal with skipBalance` + ) + t.equal(res.execResult.exceptionError, undefined, 'no exceptionError with skipBalance') + } +}) From 6df7b563f0e7d69053680cd30f54b9aad2e0112d Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Wed, 4 May 2022 04:47:34 -0400 Subject: [PATCH 37/44] Migrate `common.param` (and friends) to return `BigInt` (#1854) * Common: Return BigInt for param() functionality Fixes #1846 * Change param getters to throw on non-existent value * Fixes * switch return to bigint or undefined * Switch param getters to return undefined and fix common tests * tx: changes to accomodate param getters * More changes * More adjustments * Fix NaN bug in opcode fee builder * Hack to fix EIP-2537 edge case * client: fix test syntax * lint * Return 0 when param doesn't exist * Spelling, dedup param usage * Update `paramByEip` to allow undefined * Hardcode EIP-2537 gas discount array * uncomment test --- packages/block/src/header.ts | 38 +++-- packages/block/test/eip1559block.spec.ts | 19 +-- packages/client/lib/miner/miner.ts | 5 +- packages/client/test/miner/miner.spec.ts | 2 +- packages/common/src/index.ts | 30 ++-- packages/common/tests/params.spec.ts | 48 ++++--- packages/tx/src/baseTransaction.ts | 13 +- packages/tx/src/util.ts | 5 +- packages/tx/test/typedTxsAndEIP2930.spec.ts | 14 +- packages/vm/src/buildBlock.ts | 2 +- packages/vm/src/evm/eei.ts | 8 +- packages/vm/src/evm/evm.ts | 7 +- packages/vm/src/evm/opcodes/EIP1283.ts | 18 +-- packages/vm/src/evm/opcodes/EIP2200.ts | 20 +-- packages/vm/src/evm/opcodes/EIP2929.ts | 16 +-- packages/vm/src/evm/opcodes/codes.ts | 5 +- packages/vm/src/evm/opcodes/functions.ts | 4 +- packages/vm/src/evm/opcodes/gas.ts | 36 ++--- packages/vm/src/evm/opcodes/util.ts | 12 +- .../vm/src/evm/precompiles/01-ecrecover.ts | 2 +- packages/vm/src/evm/precompiles/02-sha256.ts | 5 +- .../vm/src/evm/precompiles/03-ripemd160.ts | 5 +- .../vm/src/evm/precompiles/04-identity.ts | 5 +- packages/vm/src/evm/precompiles/05-modexp.ts | 2 +- packages/vm/src/evm/precompiles/06-ecadd.ts | 2 +- packages/vm/src/evm/precompiles/07-ecmul.ts | 2 +- .../vm/src/evm/precompiles/08-ecpairing.ts | 9 +- packages/vm/src/evm/precompiles/09-blake2f.ts | 2 +- .../vm/src/evm/precompiles/0a-bls12-g1add.ts | 2 +- .../vm/src/evm/precompiles/0b-bls12-g1mul.ts | 2 +- .../evm/precompiles/0c-bls12-g1multiexp.ts | 8 +- .../vm/src/evm/precompiles/0d-bls12-g2add.ts | 2 +- .../vm/src/evm/precompiles/0e-bls12-g2mul.ts | 2 +- .../evm/precompiles/0f-bls12-g2multiexp.ts | 5 +- .../src/evm/precompiles/10-bls12-pairing.ts | 8 +- .../evm/precompiles/11-bls12-map-fp-to-g1.ts | 2 +- .../evm/precompiles/12-bls12-map-fp2-to-g2.ts | 2 +- .../vm/src/evm/precompiles/util/bls12_381.ts | 131 ++++++++++++++++++ packages/vm/src/runBlock.ts | 5 +- packages/vm/src/runTx.ts | 2 +- packages/vm/tests/api/EIPs/eip-2929.spec.ts | 14 +- .../tests/api/EIPs/eip-3074-authcall.spec.ts | 20 +-- .../api/EIPs/eip-3651-warm-coinbase.spec.ts | 4 +- packages/vm/tests/api/EIPs/eip-3855.spec.ts | 8 +- packages/vm/tests/api/index.spec.ts | 5 +- packages/vm/tests/api/runCall.spec.ts | 2 +- 46 files changed, 353 insertions(+), 207 deletions(-) diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index 275c44b9659..ff2763eaf17 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -239,7 +239,7 @@ export class BlockHeader { const londonHfBlock = this._common.hardforkBlock(Hardfork.London) const isInitialEIP1559Block = number === londonHfBlock if (isInitialEIP1559Block) { - baseFeePerGas = BigInt(this._common.param('gasConfig', 'initialBaseFee')) + baseFeePerGas = this._common.param('gasConfig', 'initialBaseFee') } else { // Minimum possible value for baseFeePerGas is 7, // so we use it as the default if the field is missing. @@ -435,11 +435,9 @@ export class BlockHeader { const hardfork = this._common.hardfork() const blockTs = this.timestamp const { timestamp: parentTs, difficulty: parentDif } = parentBlockHeader - const minimumDifficulty = BigInt( - this._common.paramByHardfork('pow', 'minimumDifficulty', hardfork) - ) + const minimumDifficulty = this._common.paramByHardfork('pow', 'minimumDifficulty', hardfork) const offset = - parentDif / BigInt(this._common.paramByHardfork('pow', 'difficultyBoundDivisor', hardfork)) + parentDif / this._common.paramByHardfork('pow', 'difficultyBoundDivisor', hardfork) let num = this.number // We use a ! here as TS cannot follow this hardfork-dependent logic, but it always gets assigned @@ -459,7 +457,7 @@ export class BlockHeader { if (this._common.hardforkGteHardfork(hardfork, Hardfork.Byzantium)) { // Get delay as parameter from common - num = num - BigInt(this._common.param('pow', 'difficultyBombDelay')) + num = num - this._common.param('pow', 'difficultyBombDelay') if (num < BigInt(0)) { num = BigInt(0) } @@ -474,10 +472,7 @@ export class BlockHeader { dif = parentDif + offset * a } else { // pre-homestead - if ( - parentTs + BigInt(this._common.paramByHardfork('pow', 'durationLimit', hardfork)) > - blockTs - ) { + if (parentTs + this._common.paramByHardfork('pow', 'durationLimit', hardfork) > blockTs) { dif = offset + parentDif } else { dif = parentDif - offset @@ -552,22 +547,21 @@ export class BlockHeader { // to adopt to the new gas target centered logic const londonHardforkBlock = this._common.hardforkBlock(Hardfork.London) if (londonHardforkBlock && this.number === londonHardforkBlock) { - const elasticity = BigInt(this._common.param('gasConfig', 'elasticityMultiplier')) + const elasticity = this._common.param('gasConfig', 'elasticityMultiplier') parentGasLimit = parentGasLimit * elasticity } const gasLimit = this.gasLimit const hardfork = this._common.hardfork() const a = - parentGasLimit / - BigInt(this._common.paramByHardfork('gasConfig', 'gasLimitBoundDivisor', hardfork)) + parentGasLimit / this._common.paramByHardfork('gasConfig', 'gasLimitBoundDivisor', hardfork) const maxGasLimit = parentGasLimit + a const minGasLimit = parentGasLimit - a const result = gasLimit < maxGasLimit && gasLimit > minGasLimit && - gasLimit >= BigInt(this._common.paramByHardfork('gasConfig', 'minGasLimit', hardfork)) + gasLimit >= this._common.paramByHardfork('gasConfig', 'minGasLimit', hardfork) return result } @@ -703,7 +697,7 @@ export class BlockHeader { const londonHfBlock = this._common.hardforkBlock(Hardfork.London) const isInitialEIP1559Block = londonHfBlock && this.number === londonHfBlock if (isInitialEIP1559Block) { - const initialBaseFee = BigInt(this._common.param('gasConfig', 'initialBaseFee')) + const initialBaseFee = this._common.param('gasConfig', 'initialBaseFee') if (this.baseFeePerGas! !== initialBaseFee) { const msg = this._errorMsg('Initial EIP1559 block does not have initial base fee') throw new Error(msg) @@ -731,25 +725,29 @@ export class BlockHeader { throw new Error(msg) } let nextBaseFee: bigint - const elasticity = BigInt(this._common.param('gasConfig', 'elasticityMultiplier')) + const elasticity = this._common.param('gasConfig', 'elasticityMultiplier') const parentGasTarget = this.gasLimit / elasticity if (parentGasTarget === this.gasUsed) { nextBaseFee = this.baseFeePerGas! } else if (this.gasUsed > parentGasTarget) { const gasUsedDelta = this.gasUsed - parentGasTarget - const baseFeeMaxChangeDenominator = BigInt( - this._common.param('gasConfig', 'baseFeeMaxChangeDenominator') + const baseFeeMaxChangeDenominator = this._common.param( + 'gasConfig', + 'baseFeeMaxChangeDenominator' ) + const calculatedDelta = (this.baseFeePerGas! * gasUsedDelta) / parentGasTarget / baseFeeMaxChangeDenominator nextBaseFee = (calculatedDelta > BigInt(1) ? calculatedDelta : BigInt(1)) + this.baseFeePerGas! } else { const gasUsedDelta = parentGasTarget - this.gasUsed - const baseFeeMaxChangeDenominator = BigInt( - this._common.param('gasConfig', 'baseFeeMaxChangeDenominator') + const baseFeeMaxChangeDenominator = this._common.param( + 'gasConfig', + 'baseFeeMaxChangeDenominator' ) + const calculatedDelta = (this.baseFeePerGas! * gasUsedDelta) / parentGasTarget / baseFeeMaxChangeDenominator nextBaseFee = diff --git a/packages/block/test/eip1559block.spec.ts b/packages/block/test/eip1559block.spec.ts index a367ebb158c..b34f1d2ced8 100644 --- a/packages/block/test/eip1559block.spec.ts +++ b/packages/block/test/eip1559block.spec.ts @@ -131,7 +131,7 @@ tape('EIP1559 tests', function (t) { parentHash: genesis.hash(), gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block timestamp: BigInt(1), - baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), + baseFeePerGas: common.param('gasConfig', 'initialBaseFee'), }, }, { @@ -202,9 +202,10 @@ tape('EIP1559 tests', function (t) { timestamp: BigInt(1), gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block gasUsed: - genesis.header.gasLimit * BigInt(common.param('gasConfig', 'elasticityMultiplier')) + + genesis.header.gasLimit * + (common.param('gasConfig', 'elasticityMultiplier') ?? BigInt(0)) + BigInt(1), - baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), + baseFeePerGas: common.param('gasConfig', 'initialBaseFee'), }, { calcDifficultyFromHeader: genesis.header, @@ -229,7 +230,7 @@ tape('EIP1559 tests', function (t) { timestamp: BigInt(1), gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block gasUsed: genesis.header.gasLimit * BigInt(2), - baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), + baseFeePerGas: common.param('gasConfig', 'initialBaseFee'), }, { calcDifficultyFromHeader: genesis.header, @@ -250,7 +251,7 @@ tape('EIP1559 tests', function (t) { parentHash: genesis.hash(), timestamp: BigInt(1), gasLimit: parentGasLimit + parentGasLimit / BigInt(1024) - BigInt(1), - baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), + baseFeePerGas: common.param('gasConfig', 'initialBaseFee'), }, { calcDifficultyFromHeader: genesis.header, @@ -266,7 +267,7 @@ tape('EIP1559 tests', function (t) { parentHash: genesis.hash(), timestamp: BigInt(1), gasLimit: parentGasLimit - parentGasLimit / BigInt(1024) + BigInt(1), - baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), + baseFeePerGas: common.param('gasConfig', 'initialBaseFee'), }, { calcDifficultyFromHeader: genesis.header, @@ -319,7 +320,7 @@ tape('EIP1559 tests', function (t) { parentHash: genesis.hash(), timestamp: BigInt(1), gasLimit: parentGasLimit + parentGasLimit / BigInt(1024), - baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), + baseFeePerGas: common.param('gasConfig', 'initialBaseFee'), }, { calcDifficultyFromHeader: genesis.header, @@ -370,7 +371,7 @@ tape('EIP1559 tests', function (t) { parentHash: genesis.hash(), timestamp: BigInt(1), gasLimit: parentGasLimit - parentGasLimit / BigInt(1024), - baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), + baseFeePerGas: common.param('gasConfig', 'initialBaseFee'), }, { calcDifficultyFromHeader: genesis.header, @@ -428,7 +429,7 @@ tape('EIP1559 tests', function (t) { parentHash: genesis.hash(), gasLimit: genesis.header.gasLimit * BigInt(2), // Special case on EIP-1559 transition block timestamp: BigInt(1), - baseFeePerGas: BigInt(common.param('gasConfig', 'initialBaseFee')), + baseFeePerGas: common.param('gasConfig', 'initialBaseFee'), }, transactions: [ { diff --git a/packages/client/lib/miner/miner.ts b/packages/client/lib/miner/miner.ts index 9d85a70db75..486a9d324a7 100644 --- a/packages/client/lib/miner/miner.ts +++ b/packages/client/lib/miner/miner.ts @@ -229,9 +229,8 @@ export class Miner { const isInitialEIP1559Block = londonHardforkBlock && number === londonHardforkBlock if (isInitialEIP1559Block) { // Get baseFeePerGas from `paramByEIP` since 1559 not currently active on common - baseFeePerGas = BigInt( - this.config.chainCommon.paramByEIP('gasConfig', 'initialBaseFee', 1559) - ) + baseFeePerGas = + this.config.chainCommon.paramByEIP('gasConfig', 'initialBaseFee', 1559) ?? BigInt(0) // Set initial EIP1559 block gas limit to 2x parent gas limit per logic in `block.validateGasLimit` gasLimit = gasLimit * BigInt(2) } else if (this.config.chainCommon.isActivatedEIP(1559)) { diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index bb227fc2add..8a4ccaa3586 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -407,7 +407,7 @@ tape('[Miner]', async (t) => { blockHeader3.gasLimit, 'gas limit should be double previous block' ) - const initialBaseFee = BigInt(config.execCommon.paramByEIP('gasConfig', 'initialBaseFee', 1559)) + const initialBaseFee = config.execCommon.paramByEIP('gasConfig', 'initialBaseFee', 1559)! t.equal(blockHeader3.baseFeePerGas!, initialBaseFee, 'baseFee should be initial value') // block 4 diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index 579acf64925..1427a896d9a 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -550,17 +550,15 @@ export default class Common extends EventEmitter { * * @param topic Parameter topic ('gasConfig', 'gasPrices', 'vm', 'pow') * @param name Parameter name (e.g. 'minGasLimit' for 'gasConfig' topic) - * @returns The value requested or `null` if not found + * @returns The value requested or `BigInt(0)` if not found */ - param(topic: string, name: string): any { + param(topic: string, name: string): bigint { // TODO: consider the case that different active EIPs // can change the same parameter - let value = null + let value for (const eip of this._eips) { value = this.paramByEIP(topic, name, eip) - if (value !== null) { - return value - } + if (value !== undefined) return value } return this.paramByHardfork(topic, name, this._hardfork) } @@ -570,9 +568,9 @@ export default class Common extends EventEmitter { * @param topic Parameter topic ('gasConfig', 'gasPrices', 'vm', 'pow') * @param name Parameter name (e.g. 'minGasLimit' for 'gasConfig' topic) * @param hardfork Hardfork name - * @returns The value requested or `null` if not found + * @returns The value requested or `BigInt(0)` if not found */ - paramByHardfork(topic: string, name: string, hardfork: string | Hardfork): any { + paramByHardfork(topic: string, name: string, hardfork: string | Hardfork): bigint { let value = null for (const hfChanges of HARDFORK_CHANGES) { // EIP-referencing HF file (e.g. berlin.json) @@ -580,7 +578,7 @@ export default class Common extends EventEmitter { const hfEIPs = hfChanges[1]['eips'] for (const eip of hfEIPs) { const valueEIP = this.paramByEIP(topic, name, eip) - value = valueEIP !== null ? valueEIP : value + value = valueEIP !== undefined ? valueEIP : value } // Paramater-inlining HF file (e.g. istanbul.json) } else { @@ -593,7 +591,8 @@ export default class Common extends EventEmitter { } if (hfChanges[0] === hardfork) break } - return value + if (!value) return BigInt(0) + return BigInt(value) } /** @@ -601,9 +600,9 @@ export default class Common extends EventEmitter { * @param topic Parameter topic ('gasConfig', 'gasPrices', 'vm', 'pow') * @param name Parameter name (e.g. 'minGasLimit' for 'gasConfig' topic) * @param eip Number of the EIP - * @returns The value requested or `null` if not found + * @returns The value requested or `undefined` if not found */ - paramByEIP(topic: string, name: string, eip: number): any { + paramByEIP(topic: string, name: string, eip: number): bigint | undefined { if (!(eip in EIPs)) { throw new Error(`${eip} not supported`) } @@ -613,10 +612,10 @@ export default class Common extends EventEmitter { throw new Error(`Topic ${topic} not defined`) } if (eipParams[topic][name] === undefined) { - return null + return undefined } const value = eipParams[topic][name].v - return value + return BigInt(value) } /** @@ -626,8 +625,9 @@ export default class Common extends EventEmitter { * @param name Parameter name * @param blockNumber Block number * @param td Total difficulty + * * @returns The value requested or `BigInt(0)` if not found */ - paramByBlock(topic: string, name: string, blockNumber: BigIntLike, td?: BigIntLike): any { + paramByBlock(topic: string, name: string, blockNumber: BigIntLike, td?: BigIntLike): bigint { const hardfork = this.getHardforkByBlockNumber(blockNumber, td) return this.paramByHardfork(topic, name, hardfork) } diff --git a/packages/common/tests/params.spec.ts b/packages/common/tests/params.spec.ts index d823dd3308f..85d2eac7271 100644 --- a/packages/common/tests/params.spec.ts +++ b/packages/common/tests/params.spec.ts @@ -5,19 +5,19 @@ tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: t t.test('Basic usage', function (st: tape.Test) { const c = new Common({ chain: Chain.Mainnet, eips: [2537] }) let msg = 'Should return correct value when HF directly provided' - st.equal(c.paramByHardfork('gasPrices', 'ecAdd', 'byzantium'), 500, msg) + st.equal(c.paramByHardfork('gasPrices', 'ecAdd', 'byzantium'), BigInt(500), msg) msg = 'Should return correct value for HF set in class' c.setHardfork(Hardfork.Byzantium) - st.equal(c.param('gasPrices', 'ecAdd'), 500, msg) + st.equal(c.param('gasPrices', 'ecAdd'), BigInt(500), msg) c.setHardfork(Hardfork.Istanbul) - st.equal(c.param('gasPrices', 'ecAdd'), 150, msg) + st.equal(c.param('gasPrices', 'ecAdd'), BigInt(150), msg) c.setHardfork(Hardfork.MuirGlacier) - st.equal(c.param('gasPrices', 'ecAdd'), 150, msg) + st.equal(c.param('gasPrices', 'ecAdd'), BigInt(150), msg) - msg = 'Should return null for non-existing value' - st.equal(c.param('gasPrices', 'notexistingvalue'), null, msg) - st.equal(c.paramByHardfork('gasPrices', 'notexistingvalue', 'byzantium'), null, msg) + msg = 'Should return 0n for non-existing value' + st.equals(c.param('gasPrices', 'notexistingvalue'), BigInt(0), msg) + st.equals(c.paramByHardfork('gasPrices', 'notexistingvalue', 'byzantium'), BigInt(0), msg) /* // Manual test since no test triggering EIP config available @@ -41,7 +41,11 @@ tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: t st.throws(f, /Topic gasPrizes not defined$/, msg) c.setHardfork(Hardfork.Byzantium) - st.equal(c.param('gasPrices', 'ecAdd'), 500, 'Should return correct value for HF set in class') + st.equal( + c.param('gasPrices', 'ecAdd'), + BigInt(500), + 'Should return correct value for HF set in class' + ) st.end() }) @@ -50,16 +54,20 @@ tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: t const c = new Common({ chain: Chain.Mainnet }) let msg = 'Should return correct value for chain start' - st.equal(c.paramByHardfork('pow', 'minerReward', 'chainstart'), '5000000000000000000', msg) + st.equal( + c.paramByHardfork('pow', 'minerReward', 'chainstart'), + BigInt(5000000000000000000), + msg + ) msg = 'Should reflect HF update changes' - st.equal(c.paramByHardfork('pow', 'minerReward', 'byzantium'), '3000000000000000000', msg) + st.equal(c.paramByHardfork('pow', 'minerReward', 'byzantium'), BigInt(3000000000000000000), msg) msg = 'Should return updated sstore gas prices for constantinople' - st.equal(c.paramByHardfork('gasPrices', 'netSstoreNoopGas', 'constantinople'), 200, msg) + st.equal(c.paramByHardfork('gasPrices', 'netSstoreNoopGas', 'constantinople'), BigInt(200), msg) msg = 'Should nullify SSTORE related values for petersburg' - st.equal(c.paramByHardfork('gasPrices', 'netSstoreNoopGas', 'petersburg'), null, msg) + st.equals(c.paramByHardfork('gasPrices', 'netSstoreNoopGas', 'petersburg'), BigInt(0), msg) st.end() }) @@ -67,14 +75,14 @@ tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: t t.test('Access by block number, paramByBlock()', function (st: tape.Test) { const c = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Byzantium }) let msg = 'Should correctly translate block numbers into HF states (updated value)' - st.equal(c.paramByBlock('pow', 'minerReward', 4370000), '3000000000000000000', msg) + st.equal(c.paramByBlock('pow', 'minerReward', 4370000), BigInt(3000000000000000000), msg) msg = 'Should correctly translate block numbers into HF states (original value)' - st.equal(c.paramByBlock('pow', 'minerReward', 4369999), '5000000000000000000', msg) + st.equal(c.paramByBlock('pow', 'minerReward', 4369999), BigInt(5000000000000000000), msg) msg = 'Should correctly translate total difficulty into HF states' const td = BigInt('1196768507891266117779') - st.equal(c.paramByBlock('pow', 'minerReward', 4370000, td), '3000000000000000000', msg) + st.equal(c.paramByBlock('pow', 'minerReward', 4370000, td), BigInt(3000000000000000000), msg) st.comment('-----------------------------------------------------------------') st.end() @@ -83,8 +91,8 @@ tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: t t.test('EIP param access, paramByEIP()', function (st: tape.Test) { const c = new Common({ chain: Chain.Mainnet }) - let msg = 'Should return null for non-existing value' - st.equal(c.paramByEIP('gasPrices', 'notexistingvalue', 2537), null, msg) + let msg = 'Should return undefined for non-existing value' + st.equals(c.paramByEIP('gasPrices', 'notexistingvalue', 2537), undefined, msg) const UNSUPPORTED_EIP = 1000000 let f = function () { @@ -100,7 +108,7 @@ tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: t st.throws(f, /not defined$/, msg) msg = 'Should return Bls12381G1AddGas gas price for EIP2537' - st.equal(c.paramByEIP('gasPrices', 'Bls12381G1AddGas', 2537), 600, msg) + st.equal(c.paramByEIP('gasPrices', 'Bls12381G1AddGas', 2537), BigInt(600), msg) st.end() }) @@ -108,10 +116,10 @@ tape('[Common]: Parameter access for param(), paramByHardfork()', function (t: t for (const fork of [Hardfork.MuirGlacier, Hardfork.Berlin]) { const c = new Common({ chain: Chain.Mainnet, hardfork: fork }) let delay = c.param('pow', 'difficultyBombDelay') - st.equal(delay, 9000000) + st.equal(delay, BigInt(9000000)) c.setEIPs([3554]) delay = c.param('pow', 'difficultyBombDelay') - st.equal(delay, 9500000) + st.equal(delay, BigInt(9500000)) } st.end() }) diff --git a/packages/tx/src/baseTransaction.ts b/packages/tx/src/baseTransaction.ts index b091686381b..0495b6b378e 100644 --- a/packages/tx/src/baseTransaction.ts +++ b/packages/tx/src/baseTransaction.ts @@ -187,9 +187,12 @@ export abstract class BaseTransaction { * The minimum amount of gas the tx must have (DataFee + TxFee + Creation Fee) */ getBaseFee(): bigint { - let fee = this.getDataFee() + BigInt(this.common.param('gasPrices', 'tx')) + const txFee = this.common.param('gasPrices', 'tx') + let fee = this.getDataFee() + if (txFee) fee += txFee if (this.common.gteHardfork('homestead') && this.toCreationAddress()) { - fee += BigInt(this.common.param('gasPrices', 'txCreation')) + const txCreationFee = this.common.param('gasPrices', 'txCreation') + if (txCreationFee) fee += txCreationFee } return fee } @@ -201,18 +204,18 @@ export abstract class BaseTransaction { const txDataZero = this.common.param('gasPrices', 'txDataZero') const txDataNonZero = this.common.param('gasPrices', 'txDataNonZero') - let cost = 0 + let cost = BigInt(0) for (let i = 0; i < this.data.length; i++) { this.data[i] === 0 ? (cost += txDataZero) : (cost += txDataNonZero) } if ((this.to === undefined || this.to === null) && this.common.isActivatedEIP(3860)) { - const dataLength = Math.ceil(this.data.length / 32) + const dataLength = BigInt(Math.ceil(this.data.length / 32)) const initCodeCost = this.common.param('gasPrices', 'initCodeWordCost') * dataLength cost += initCodeCost } - return BigInt(cost) + return cost } /** diff --git a/packages/tx/src/util.ts b/packages/tx/src/util.ts index 184d25cb5ca..adea93268a2 100644 --- a/packages/tx/src/util.ts +++ b/packages/tx/src/util.ts @@ -3,7 +3,8 @@ import { bufferToHex, setLengthLeft, toBuffer } from 'ethereumjs-util' import { AccessList, AccessListBuffer, AccessListItem, isAccessList } from './types' export function checkMaxInitCodeSize(common: Common, length: number) { - if (length > common.param('vm', 'maxInitCodeSize')) { + const maxInitCodeSize = common.param('vm', 'maxInitCodeSize') + if (maxInitCodeSize && BigInt(length) > maxInitCodeSize) { throw new Error( `the initcode size of this transaction is too large: it is ${length} while the max is ${common.param( 'vm', @@ -108,6 +109,6 @@ export class AccessLists { } const addresses = accessList.length - return addresses * accessListAddressCost + slots * accessListStorageKeyCost + return addresses * Number(accessListAddressCost) + slots * Number(accessListStorageKeyCost) } } diff --git a/packages/tx/test/typedTxsAndEIP2930.spec.ts b/packages/tx/test/typedTxsAndEIP2930.spec.ts index 68faa178013..e389313eb81 100644 --- a/packages/tx/test/typedTxsAndEIP2930.spec.ts +++ b/packages/tx/test/typedTxsAndEIP2930.spec.ts @@ -382,12 +382,14 @@ tape('[AccessListEIP2930Transaction] -> Class Specific Tests', function (t) { ) // Cost should be: // Base fee + 2*TxDataNonZero + TxDataZero + AccessListAddressCost + AccessListSlotCost - const txDataZero: number = common.param('gasPrices', 'txDataZero') - const txDataNonZero: number = common.param('gasPrices', 'txDataNonZero') - const accessListStorageKeyCost: number = common.param('gasPrices', 'accessListStorageKeyCost') - const accessListAddressCost: number = common.param('gasPrices', 'accessListAddressCost') - const baseFee: number = common.param('gasPrices', 'tx') - const creationFee: number = common.param('gasPrices', 'txCreation') + const txDataZero: number = Number(common.param('gasPrices', 'txDataZero')) + const txDataNonZero: number = Number(common.param('gasPrices', 'txDataNonZero')) + const accessListStorageKeyCost: number = Number( + common.param('gasPrices', 'accessListStorageKeyCost') + ) + const accessListAddressCost: number = Number(common.param('gasPrices', 'accessListAddressCost')) + const baseFee: number = Number(common.param('gasPrices', 'tx')) + const creationFee: number = Number(common.param('gasPrices', 'txCreation')) st.ok( tx.getBaseFee() === diff --git a/packages/vm/src/buildBlock.ts b/packages/vm/src/buildBlock.ts index 025c4be4240..7059227ea30 100644 --- a/packages/vm/src/buildBlock.ts +++ b/packages/vm/src/buildBlock.ts @@ -149,7 +149,7 @@ export class BlockBuilder { * Adds the block miner reward to the coinbase account. */ private async rewardMiner() { - const minerReward = BigInt(this.vm._common.param('pow', 'minerReward')) + const minerReward = this.vm._common.param('pow', 'minerReward') const reward = calculateMinerReward(minerReward, 0) const coinbase = this.headerData.coinbase ? new Address(toBuffer(this.headerData.coinbase)) diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index e525bac40f5..5c83e3e6d82 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -436,7 +436,7 @@ export default class EEI { async _selfDestruct(toAddress: Address): Promise { // only add to refund if this is the first selfdestruct for the address if (!this._result.selfdestruct[this._env.address.buf.toString('hex')]) { - this.refundGas(BigInt(this._common.param('gasPrices', 'selfdestructRefund'))) + this.refundGas(this._common.param('gasPrices', 'selfdestructRefund')) } this._result.selfdestruct[this._env.address.buf.toString('hex')] = toAddress.buf @@ -581,7 +581,7 @@ export default class EEI { // Check if account has enough ether and max depth not exceeded if ( - this._env.depth >= this._common.param('vm', 'stackLimit') || + this._env.depth >= Number(this._common.param('vm', 'stackLimit')) || (msg.delegatecall !== true && this._env.contract.balance < msg.value) ) { return BigInt(0) @@ -640,7 +640,7 @@ export default class EEI { // Check if account has enough ether and max depth not exceeded if ( - this._env.depth >= this._common.param('vm', 'stackLimit') || + this._env.depth >= Number(this._common.param('vm', 'stackLimit')) || (msg.delegatecall !== true && this._env.contract.balance < msg.value) ) { return BigInt(0) @@ -655,7 +655,7 @@ export default class EEI { await this._state.putAccount(this._env.address, this._env.contract) if (this._common.isActivatedEIP(3860)) { - if (msg.data.length > this._common.param('vm', 'maxInitCodeSize')) { + if (msg.data.length > Number(this._common.param('vm', 'maxInitCodeSize'))) { return BigInt(0) } } diff --git a/packages/vm/src/evm/evm.ts b/packages/vm/src/evm/evm.ts index 7dba3b6e16b..f7833c2e9a7 100644 --- a/packages/vm/src/evm/evm.ts +++ b/packages/vm/src/evm/evm.ts @@ -317,7 +317,7 @@ export default class EVM { await this._reduceSenderBalance(account, message) if (this._vm._common.isActivatedEIP(3860)) { - if (message.data.length > this._vm._common.param('vm', 'maxInitCodeSize')) { + if (message.data.length > Number(this._vm._common.param('vm', 'maxInitCodeSize'))) { return { createdAddress: message.to, execResult: { @@ -412,8 +412,7 @@ export default class EVM { let returnFee = BigInt(0) if (!result.exceptionError) { returnFee = - BigInt(result.returnValue.length) * - BigInt(this._vm._common.param('gasPrices', 'createData')) + BigInt(result.returnValue.length) * this._vm._common.param('gasPrices', 'createData') totalGas = totalGas + returnFee if (this._vm.DEBUG) { debugGas(`Add return value size fee (${returnFee} to gas used (-> ${totalGas}))`) @@ -425,7 +424,7 @@ export default class EVM { if ( !result.exceptionError && this._vm._common.gteHardfork(Hardfork.SpuriousDragon) && - result.returnValue.length > this._vm._common.param('vm', 'maxCodeSize') + result.returnValue.length > Number(this._vm._common.param('vm', 'maxCodeSize')) ) { allowedCodeSize = false } diff --git a/packages/vm/src/evm/opcodes/EIP1283.ts b/packages/vm/src/evm/opcodes/EIP1283.ts index 2967f0c9243..d530db9c4ef 100644 --- a/packages/vm/src/evm/opcodes/EIP1283.ts +++ b/packages/vm/src/evm/opcodes/EIP1283.ts @@ -19,24 +19,24 @@ export function updateSstoreGasEIP1283( ) { if (currentStorage.equals(value)) { // If current value equals new value (this is a no-op), 200 gas is deducted. - return BigInt(common.param('gasPrices', 'netSstoreNoopGas')) + return common.param('gasPrices', 'netSstoreNoopGas') } // If current value does not equal new value if (originalStorage.equals(currentStorage)) { // If original value equals current value (this storage slot has not been changed by the current execution context) if (originalStorage.length === 0) { // If original value is 0, 20000 gas is deducted. - return BigInt(common.param('gasPrices', 'netSstoreInitGas')) + return common.param('gasPrices', 'netSstoreInitGas') } if (value.length === 0) { // If new value is 0, add 15000 gas to refund counter. runState.eei.refundGas( - BigInt(common.param('gasPrices', 'netSstoreClearRefund')), + common.param('gasPrices', 'netSstoreClearRefund'), 'EIP-1283 -> netSstoreClearRefund' ) } // Otherwise, 5000 gas is deducted. - return BigInt(common.param('gasPrices', 'netSstoreCleanGas')) + return common.param('gasPrices', 'netSstoreCleanGas') } // If original value does not equal current value (this storage slot is dirty), 200 gas is deducted. Apply both of the following clauses. if (originalStorage.length !== 0) { @@ -44,13 +44,13 @@ export function updateSstoreGasEIP1283( if (currentStorage.length === 0) { // If current value is 0 (also means that new value is not 0), remove 15000 gas from refund counter. We can prove that refund counter will never go below 0. runState.eei.subRefund( - BigInt(common.param('gasPrices', 'netSstoreClearRefund')), + common.param('gasPrices', 'netSstoreClearRefund'), 'EIP-1283 -> netSstoreClearRefund' ) } else if (value.length === 0) { // If new value is 0 (also means that current value is not 0), add 15000 gas to refund counter. runState.eei.refundGas( - BigInt(common.param('gasPrices', 'netSstoreClearRefund')), + common.param('gasPrices', 'netSstoreClearRefund'), 'EIP-1283 -> netSstoreClearRefund' ) } @@ -60,16 +60,16 @@ export function updateSstoreGasEIP1283( if (originalStorage.length === 0) { // If original value is 0, add 19800 gas to refund counter. runState.eei.refundGas( - BigInt(common.param('gasPrices', 'netSstoreResetClearRefund')), + common.param('gasPrices', 'netSstoreResetClearRefund'), 'EIP-1283 -> netSstoreResetClearRefund' ) } else { // Otherwise, add 4800 gas to refund counter. runState.eei.refundGas( - BigInt(common.param('gasPrices', 'netSstoreResetRefund')), + common.param('gasPrices', 'netSstoreResetRefund'), 'EIP-1283 -> netSstoreResetRefund' ) } } - return BigInt(common.param('gasPrices', 'netSstoreDirtyGas')) + return common.param('gasPrices', 'netSstoreDirtyGas') } diff --git a/packages/vm/src/evm/opcodes/EIP2200.ts b/packages/vm/src/evm/opcodes/EIP2200.ts index 59a502eafd0..6aecb0061a2 100644 --- a/packages/vm/src/evm/opcodes/EIP2200.ts +++ b/packages/vm/src/evm/opcodes/EIP2200.ts @@ -22,41 +22,41 @@ export function updateSstoreGasEIP2200( common: Common ) { // Fail if not enough gas is left - if (runState.eei.getGasLeft() <= BigInt(common.param('gasPrices', 'sstoreSentryGasEIP2200'))) { + if (runState.eei.getGasLeft() <= common.param('gasPrices', 'sstoreSentryGasEIP2200')) { trap(ERROR.OUT_OF_GAS) } // Noop if (currentStorage.equals(value)) { - const sstoreNoopCost = BigInt(common.param('gasPrices', 'sstoreNoopGasEIP2200')) + const sstoreNoopCost = common.param('gasPrices', 'sstoreNoopGasEIP2200') return adjustSstoreGasEIP2929(runState, key, sstoreNoopCost, 'noop', common) } if (originalStorage.equals(currentStorage)) { // Create slot if (originalStorage.length === 0) { - return BigInt(common.param('gasPrices', 'sstoreInitGasEIP2200')) + return common.param('gasPrices', 'sstoreInitGasEIP2200') } // Delete slot if (value.length === 0) { runState.eei.refundGas( - BigInt(common.param('gasPrices', 'sstoreClearRefundEIP2200')), + common.param('gasPrices', 'sstoreClearRefundEIP2200'), 'EIP-2200 -> sstoreClearRefundEIP2200' ) } // Write existing slot - return BigInt(common.param('gasPrices', 'sstoreCleanGasEIP2200')) + return common.param('gasPrices', 'sstoreCleanGasEIP2200') } if (originalStorage.length > 0) { if (currentStorage.length === 0) { // Recreate slot runState.eei.subRefund( - BigInt(common.param('gasPrices', 'sstoreClearRefundEIP2200')), + common.param('gasPrices', 'sstoreClearRefundEIP2200'), 'EIP-2200 -> sstoreClearRefundEIP2200' ) } else if (value.length === 0) { // Delete slot runState.eei.refundGas( - BigInt(common.param('gasPrices', 'sstoreClearRefundEIP2200')), + common.param('gasPrices', 'sstoreClearRefundEIP2200'), 'EIP-2200 -> sstoreClearRefundEIP2200' ) } @@ -64,14 +64,14 @@ export function updateSstoreGasEIP2200( if (originalStorage.equals(value)) { if (originalStorage.length === 0) { // Reset to original non-existent slot - const sstoreInitRefund = BigInt(common.param('gasPrices', 'sstoreInitRefundEIP2200')) + const sstoreInitRefund = common.param('gasPrices', 'sstoreInitRefundEIP2200') runState.eei.refundGas( adjustSstoreGasEIP2929(runState, key, sstoreInitRefund, 'initRefund', common), 'EIP-2200 -> initRefund' ) } else { // Reset to original existing slot - const sstoreCleanRefund = BigInt(common.param('gasPrices', 'sstoreCleanRefundEIP2200')) + const sstoreCleanRefund = common.param('gasPrices', 'sstoreCleanRefundEIP2200') runState.eei.refundGas( BigInt(adjustSstoreGasEIP2929(runState, key, sstoreCleanRefund, 'cleanRefund', common)), 'EIP-2200 -> cleanRefund' @@ -79,5 +79,5 @@ export function updateSstoreGasEIP2200( } } // Dirty update - return BigInt(common.param('gasPrices', 'sstoreDirtyGasEIP2200')) + return common.param('gasPrices', 'sstoreDirtyGasEIP2200') } diff --git a/packages/vm/src/evm/opcodes/EIP2929.ts b/packages/vm/src/evm/opcodes/EIP2929.ts index 353dcbe7ca6..57b228a2096 100644 --- a/packages/vm/src/evm/opcodes/EIP2929.ts +++ b/packages/vm/src/evm/opcodes/EIP2929.ts @@ -31,11 +31,11 @@ export function accessAddressEIP2929( // CREATE, CREATE2 opcodes have the address warmed for free. // selfdestruct beneficiary address reads are charged an *additional* cold access if (chargeGas) { - return BigInt(common.param('gasPrices', 'coldaccountaccess')) + return common.param('gasPrices', 'coldaccountaccess') } // Warm: (selfdestruct beneficiary address reads are not charged when warm) } else if (chargeGas && !isSelfdestructOrAuthcall) { - return BigInt(common.param('gasPrices', 'warmstorageread')) + return common.param('gasPrices', 'warmstorageread') } return BigInt(0) } @@ -63,9 +63,9 @@ export function accessStorageEIP2929( // Cold (SLOAD and SSTORE) if (slotIsCold) { vmState.addWarmedStorage(address, key) - return BigInt(common.param('gasPrices', 'coldsload')) + return common.param('gasPrices', 'coldsload') } else if (!isSstore) { - return BigInt(common.param('gasPrices', 'warmstorageread')) + return common.param('gasPrices', 'warmstorageread') } return BigInt(0) } @@ -91,17 +91,17 @@ export function adjustSstoreGasEIP2929( const vmState = runState.vmState const address = runState.eei.getAddress().buf - const warmRead = BigInt(common.param('gasPrices', 'warmstorageread')) - const coldSload = BigInt(common.param('gasPrices', 'coldsload')) + const warmRead = common.param('gasPrices', 'warmstorageread') + const coldSload = common.param('gasPrices', 'coldsload') if (vmState.isWarmedStorage(address, key)) { switch (costName) { case 'noop': return warmRead case 'initRefund': - return BigInt(common.param('gasPrices', 'sstoreInitGasEIP2200')) - warmRead + return common.param('gasPrices', 'sstoreInitGasEIP2200') - warmRead case 'cleanRefund': - return BigInt(common.param('gasPrices', 'sstoreReset')) - coldSload - warmRead + return common.param('gasPrices', 'sstoreReset') - coldSload - warmRead } } diff --git a/packages/vm/src/evm/opcodes/codes.ts b/packages/vm/src/evm/opcodes/codes.ts index 11d9c0d2387..01d1c1c498e 100644 --- a/packages/vm/src/evm/opcodes/codes.ts +++ b/packages/vm/src/evm/opcodes/codes.ts @@ -298,6 +298,7 @@ function createOpcodes(opcodes: OpcodeEntryFee): OpcodeList { const result: OpcodeList = new Map() for (const [key, value] of Object.entries(opcodes)) { const code = parseInt(key, 10) + if (isNaN(value.fee)) value.fee = 0 result.set( code, new Opcode({ @@ -341,12 +342,12 @@ export function getOpcodesForHF(common: Common, customOpcodes?: CustomOpcode[]): } for (const key in opcodeBuilder) { - const baseFee = common.param('gasPrices', opcodeBuilder[key].name.toLowerCase()) + const baseFee = Number(common.param('gasPrices', opcodeBuilder[key].name.toLowerCase())) // explicitly verify that we have defined a base fee if (baseFee === undefined) { throw new Error(`base fee not defined for: ${opcodeBuilder[key].name}`) } - opcodeBuilder[key].fee = common.param('gasPrices', opcodeBuilder[key].name.toLowerCase()) + opcodeBuilder[key].fee = baseFee } if (customOpcodes) { diff --git a/packages/vm/src/evm/opcodes/functions.ts b/packages/vm/src/evm/opcodes/functions.ts index 3db6c308b94..aceae053e9a 100644 --- a/packages/vm/src/evm/opcodes/functions.ts +++ b/packages/vm/src/evm/opcodes/functions.ts @@ -179,8 +179,8 @@ export const handlers: Map = new Map([ trap(ERROR.OUT_OF_RANGE) } const gasPrice = common.param('gasPrices', 'expByte') - const amount = byteLength * gasPrice - runState.eei.useGas(BigInt(amount), 'EXP opcode') + const amount = BigInt(byteLength) * gasPrice + runState.eei.useGas(amount, 'EXP opcode') if (base === BigInt(0)) { runState.stack.push(base) diff --git a/packages/vm/src/evm/opcodes/gas.ts b/packages/vm/src/evm/opcodes/gas.ts index a73274d14c3..27d13c84122 100644 --- a/packages/vm/src/evm/opcodes/gas.ts +++ b/packages/vm/src/evm/opcodes/gas.ts @@ -40,7 +40,7 @@ export const dynamicGasHandlers: Map { const [offset, length] = runState.stack.peek(2) gas += subMemUsage(runState, offset, length, common) - gas += BigInt(common.param('gasPrices', 'sha3Word')) * divCeil(length, BigInt(32)) + gas += common.param('gasPrices', 'sha3Word') * divCeil(length, BigInt(32)) return gas }, ], @@ -64,7 +64,7 @@ export const dynamicGasHandlers: Map BigInt(0)) { - gas += BigInt(common.param('gasPrices', 'authcallValueTransfer')) + gas += common.param('gasPrices', 'authcallValueTransfer') const account = await runState.vmState.getAccount(toAddress) if (account.isEmpty()) { - gas += BigInt(common.param('gasPrices', 'callNewAccount')) + gas += common.param('gasPrices', 'callNewAccount') } } @@ -561,7 +561,7 @@ export const dynamicGasHandlers: Map 0 && currentStorage.length > 0) ) { - const gas = BigInt(common.param('gasPrices', 'sstoreReset')) + const gas = common.param('gasPrices', 'sstoreReset') return gas } else if (value.length === 0 && currentStorage.length > 0) { - const gas = BigInt(common.param('gasPrices', 'sstoreReset')) - runState.eei.refundGas(BigInt(common.param('gasPrices', 'sstoreRefund')), 'updateSstoreGas') + const gas = common.param('gasPrices', 'sstoreReset') + runState.eei.refundGas(common.param('gasPrices', 'sstoreRefund'), 'updateSstoreGas') return gas } else { /* @@ -219,7 +219,7 @@ export function updateSstoreGas( -> Value is zero, but slot is nonzero Thus, the remaining case is where value is nonzero, but slot is zero, which is this clause */ - return BigInt(common.param('gasPrices', 'sstoreSet')) + return common.param('gasPrices', 'sstoreSet') } } diff --git a/packages/vm/src/evm/precompiles/01-ecrecover.ts b/packages/vm/src/evm/precompiles/01-ecrecover.ts index 8d94ba6698c..1d965b873c5 100644 --- a/packages/vm/src/evm/precompiles/01-ecrecover.ts +++ b/packages/vm/src/evm/precompiles/01-ecrecover.ts @@ -12,7 +12,7 @@ const assert = require('assert') export default function (opts: PrecompileInput): ExecResult { assert(opts.data) - const gasUsed = BigInt(opts._common.param('gasPrices', 'ecRecover')) + const gasUsed = opts._common.param('gasPrices', 'ecRecover') if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/02-sha256.ts b/packages/vm/src/evm/precompiles/02-sha256.ts index 263f5af7b67..888268fae66 100644 --- a/packages/vm/src/evm/precompiles/02-sha256.ts +++ b/packages/vm/src/evm/precompiles/02-sha256.ts @@ -9,9 +9,8 @@ export default function (opts: PrecompileInput): ExecResult { const data = opts.data - let gasUsed = BigInt(opts._common.param('gasPrices', 'sha256')) - gasUsed += - BigInt(opts._common.param('gasPrices', 'sha256Word')) * BigInt(Math.ceil(data.length / 32)) + let gasUsed = opts._common.param('gasPrices', 'sha256') + gasUsed += opts._common.param('gasPrices', 'sha256Word') * BigInt(Math.ceil(data.length / 32)) if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/03-ripemd160.ts b/packages/vm/src/evm/precompiles/03-ripemd160.ts index 503820ba5af..f52c7f70646 100644 --- a/packages/vm/src/evm/precompiles/03-ripemd160.ts +++ b/packages/vm/src/evm/precompiles/03-ripemd160.ts @@ -9,9 +9,8 @@ export default function (opts: PrecompileInput): ExecResult { const data = opts.data - let gasUsed = BigInt(opts._common.param('gasPrices', 'ripemd160')) - gasUsed += - BigInt(opts._common.param('gasPrices', 'ripemd160Word')) * BigInt(Math.ceil(data.length / 32)) + let gasUsed = opts._common.param('gasPrices', 'ripemd160') + gasUsed += opts._common.param('gasPrices', 'ripemd160Word') * BigInt(Math.ceil(data.length / 32)) if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/04-identity.ts b/packages/vm/src/evm/precompiles/04-identity.ts index 7890e3efca2..0866bbee668 100644 --- a/packages/vm/src/evm/precompiles/04-identity.ts +++ b/packages/vm/src/evm/precompiles/04-identity.ts @@ -7,9 +7,8 @@ export default function (opts: PrecompileInput): ExecResult { const data = opts.data - let gasUsed = BigInt(opts._common.param('gasPrices', 'identity')) - gasUsed += - BigInt(opts._common.param('gasPrices', 'identityWord')) * BigInt(Math.ceil(data.length / 32)) + let gasUsed = opts._common.param('gasPrices', 'identity') + gasUsed += opts._common.param('gasPrices', 'identityWord') * BigInt(Math.ceil(data.length / 32)) if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/05-modexp.ts b/packages/vm/src/evm/precompiles/05-modexp.ts index e64ab6c3c9a..23b57280202 100644 --- a/packages/vm/src/evm/precompiles/05-modexp.ts +++ b/packages/vm/src/evm/precompiles/05-modexp.ts @@ -92,7 +92,7 @@ export default function (opts: PrecompileInput): ExecResult { if (maxLen < mLen) { maxLen = mLen } - const Gquaddivisor = BigInt(opts._common.param('gasPrices', 'modexpGquaddivisor')) + const Gquaddivisor = opts._common.param('gasPrices', 'modexpGquaddivisor') let gasUsed const bStart = BigInt(96) diff --git a/packages/vm/src/evm/precompiles/06-ecadd.ts b/packages/vm/src/evm/precompiles/06-ecadd.ts index f1046ca5904..5307d503e94 100644 --- a/packages/vm/src/evm/precompiles/06-ecadd.ts +++ b/packages/vm/src/evm/precompiles/06-ecadd.ts @@ -8,7 +8,7 @@ export default function (opts: PrecompileInput): ExecResult { const inputData = opts.data - const gasUsed = BigInt(opts._common.param('gasPrices', 'ecAdd')) + const gasUsed = opts._common.param('gasPrices', 'ecAdd') if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) } diff --git a/packages/vm/src/evm/precompiles/07-ecmul.ts b/packages/vm/src/evm/precompiles/07-ecmul.ts index e436315c638..34033d52061 100644 --- a/packages/vm/src/evm/precompiles/07-ecmul.ts +++ b/packages/vm/src/evm/precompiles/07-ecmul.ts @@ -7,7 +7,7 @@ export default function (opts: PrecompileInput): ExecResult { assert(opts.data) const inputData = opts.data - const gasUsed = BigInt(opts._common.param('gasPrices', 'ecMul')) + const gasUsed = opts._common.param('gasPrices', 'ecMul') if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/08-ecpairing.ts b/packages/vm/src/evm/precompiles/08-ecpairing.ts index f799f67847d..641f494dc02 100644 --- a/packages/vm/src/evm/precompiles/08-ecpairing.ts +++ b/packages/vm/src/evm/precompiles/08-ecpairing.ts @@ -8,11 +8,10 @@ export default function (opts: PrecompileInput): ExecResult { const inputData = opts.data // no need to care about non-divisible-by-192, because bn128.pairing will properly fail in that case - const inputDataSize = Math.floor(inputData.length / 192) - const gasUsed = BigInt( - opts._common.param('gasPrices', 'ecPairing') + - inputDataSize * opts._common.param('gasPrices', 'ecPairingWord') - ) + const inputDataSize = BigInt(Math.floor(inputData.length / 192)) + const gasUsed = + opts._common.param('gasPrices', 'ecPairing') + + inputDataSize * opts._common.param('gasPrices', 'ecPairingWord') if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/09-blake2f.ts b/packages/vm/src/evm/precompiles/09-blake2f.ts index 3b044b6f5b9..0b13bfb73ad 100644 --- a/packages/vm/src/evm/precompiles/09-blake2f.ts +++ b/packages/vm/src/evm/precompiles/09-blake2f.ts @@ -181,7 +181,7 @@ export default function (opts: PrecompileInput): ExecResult { // final const f = lastByte === 1 - let gasUsed = BigInt(opts._common.param('gasPrices', 'blake2Round')) + let gasUsed = opts._common.param('gasPrices', 'blake2Round') gasUsed *= BigInt(rounds) if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts b/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts index c50230108b9..a69ccb131f3 100644 --- a/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts +++ b/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts @@ -12,7 +12,7 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G1AddGas', 2537)) + const gasUsed = opts._common.paramByEIP('gasPrices', 'Bls12381G1AddGas', 2537) ?? BigInt(0) if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts b/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts index 7e2c445a08c..619729840df 100644 --- a/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts +++ b/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts @@ -16,7 +16,7 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G1MulGas', 2537)) + const gasUsed = opts._common.paramByEIP('gasPrices', 'Bls12381G1MulGas', 2537) ?? BigInt(0) if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts b/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts index 6f2cb1225a4..1c217bdbbda 100644 --- a/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts +++ b/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts @@ -21,8 +21,12 @@ export default async function (opts: PrecompileInput): Promise { const numPairs = Math.floor(inputData.length / 160) - const gasUsedPerPair = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G1MulGas', 2537)) - const gasDiscountArray = opts._common.paramByEIP('gasPrices', 'Bls12381MultiExpGasDiscount', 2537) + const gasUsedPerPair = opts._common.paramByEIP('gasPrices', 'Bls12381G1MulGas', 2537) ?? BigInt(0) + const gasDiscountArray = opts._common.paramByEIP( + 'gasPrices', + 'Bls12381MultiExpGasDiscount', + 2537 + ) as any const gasDiscountMax = gasDiscountArray[gasDiscountArray.length - 1][1] let gasDiscountMultiplier diff --git a/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts b/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts index 3bd46c77e81..8b1f5811530 100644 --- a/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts +++ b/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts @@ -12,7 +12,7 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G2AddGas', 2537)) + const gasUsed = opts._common.paramByEIP('gasPrices', 'Bls12381G2AddGas', 2537) ?? BigInt(0) if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts b/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts index 0eb10e0ad53..1e0aa4414fd 100644 --- a/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts +++ b/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts @@ -16,7 +16,7 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G2MulGas', 2537)) + const gasUsed = opts._common.paramByEIP('gasPrices', 'Bls12381G2MulGas', 2537) ?? BigInt(0) if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts b/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts index 79d3a762ad5..3d07e27752a 100644 --- a/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts +++ b/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts @@ -1,6 +1,7 @@ import { PrecompileInput } from './types' import { VmErrorResult, ExecResult, OOGResult } from '../evm' import { ERROR, VmError } from '../../exceptions' +import { gasDiscountPairs } from './util/bls12_381' const assert = require('assert') const { BLS12_381_ToG2Point, @@ -21,8 +22,8 @@ export default async function (opts: PrecompileInput): Promise { const numPairs = Math.floor(inputData.length / 288) - const gasUsedPerPair = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381G2MulGas', 2537)) - const gasDiscountArray = opts._common.paramByEIP('gasPrices', 'Bls12381MultiExpGasDiscount', 2537) + const gasUsedPerPair = opts._common.paramByEIP('gasPrices', 'Bls12381G2MulGas', 2537) ?? BigInt(0) + const gasDiscountArray = gasDiscountPairs const gasDiscountMax = gasDiscountArray[gasDiscountArray.length - 1][1] let gasDiscountMultiplier diff --git a/packages/vm/src/evm/precompiles/10-bls12-pairing.ts b/packages/vm/src/evm/precompiles/10-bls12-pairing.ts index 0a516dca389..7488af2eb9b 100644 --- a/packages/vm/src/evm/precompiles/10-bls12-pairing.ts +++ b/packages/vm/src/evm/precompiles/10-bls12-pairing.ts @@ -14,15 +14,15 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data - const baseGas = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381PairingBaseGas', 2537)) + const baseGas = opts._common.paramByEIP('gasPrices', 'Bls12381PairingBaseGas', 2537) ?? BigInt(0) if (inputData.length == 0) { return VmErrorResult(new VmError(ERROR.BLS_12_381_INPUT_EMPTY), opts.gasLimit) } - const gasUsedPerPair = BigInt( - opts._common.paramByEIP('gasPrices', 'Bls12381PairingPerPairGas', 2537) - ) + const gasUsedPerPair = + opts._common.paramByEIP('gasPrices', 'Bls12381PairingPerPairGas', 2537) ?? BigInt(0) + const gasUsed = baseGas + gasUsedPerPair * BigInt(Math.floor(inputData.length / 384)) if (inputData.length % 384 != 0) { diff --git a/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts b/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts index ab30545c853..b069643c210 100644 --- a/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts +++ b/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts @@ -12,7 +12,7 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381MapG1Gas', 2537)) + const gasUsed = opts._common.paramByEIP('gasPrices', 'Bls12381MapG1Gas', 2537) ?? BigInt(0) if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts b/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts index 01748b6ae87..e321eb6c26e 100644 --- a/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts +++ b/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts @@ -12,7 +12,7 @@ export default async function (opts: PrecompileInput): Promise { const inputData = opts.data // note: the gas used is constant; even if the input is incorrect. - const gasUsed = BigInt(opts._common.paramByEIP('gasPrices', 'Bls12381MapG2Gas', 2537)) + const gasUsed = opts._common.paramByEIP('gasPrices', 'Bls12381MapG2Gas', 2537) ?? BigInt(0) if (opts.gasLimit < gasUsed) { return OOGResult(opts.gasLimit) diff --git a/packages/vm/src/evm/precompiles/util/bls12_381.ts b/packages/vm/src/evm/precompiles/util/bls12_381.ts index a9d5dbdc81d..c67daf25796 100644 --- a/packages/vm/src/evm/precompiles/util/bls12_381.ts +++ b/packages/vm/src/evm/precompiles/util/bls12_381.ts @@ -6,6 +6,137 @@ const fieldModulus = BigInt( '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab' ) +// gas discount pairs taken from EIP-2537 `Bls12381MultiExpGasDiscount` parameter +export const gasDiscountPairs = [ + [1, 1200], + [2, 888], + [3, 764], + [4, 641], + [5, 594], + [6, 547], + [7, 500], + [8, 453], + [9, 438], + [10, 423], + [11, 408], + [12, 394], + [13, 379], + [14, 364], + [15, 349], + [16, 334], + [17, 330], + [18, 326], + [19, 322], + [20, 318], + [21, 314], + [22, 310], + [23, 306], + [24, 302], + [25, 298], + [26, 294], + [27, 289], + [28, 285], + [29, 281], + [30, 277], + [31, 273], + [32, 269], + [33, 268], + [34, 266], + [35, 265], + [36, 263], + [37, 262], + [38, 260], + [39, 259], + [40, 257], + [41, 256], + [42, 254], + [43, 253], + [44, 251], + [45, 250], + [46, 248], + [47, 247], + [48, 245], + [49, 244], + [50, 242], + [51, 241], + [52, 239], + [53, 238], + [54, 236], + [55, 235], + [56, 233], + [57, 232], + [58, 231], + [59, 229], + [60, 228], + [61, 226], + [62, 225], + [63, 223], + [64, 222], + [65, 221], + [66, 220], + [67, 219], + [68, 219], + [69, 218], + [70, 217], + [71, 216], + [72, 216], + [73, 215], + [74, 214], + [75, 213], + [76, 213], + [77, 212], + [78, 211], + [79, 211], + [80, 210], + [81, 209], + [82, 208], + [83, 208], + [84, 207], + [85, 206], + [86, 205], + [87, 205], + [88, 204], + [89, 203], + [90, 202], + [91, 202], + [92, 201], + [93, 200], + [94, 199], + [95, 199], + [96, 198], + [97, 197], + [98, 196], + [99, 196], + [100, 195], + [101, 194], + [102, 193], + [103, 193], + [104, 192], + [105, 191], + [106, 191], + [107, 190], + [108, 189], + [109, 188], + [110, 188], + [111, 187], + [112, 186], + [113, 185], + [114, 185], + [115, 184], + [116, 183], + [117, 182], + [118, 182], + [119, 181], + [120, 180], + [121, 179], + [122, 179], + [123, 178], + [124, 177], + [125, 176], + [126, 176], + [127, 175], + [128, 174], +] // convert an input Buffer to a mcl G1 point // this does /NOT/ do any input checks. the input Buffer needs to be of length 128 // it does raise an error if the point is not on the curve. diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index c2490f6d9ac..0cbc330f88c 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -320,8 +320,7 @@ async function applyTransactions(this: VM, block: Block, opts: RunBlockOpts) { let maxGasLimit if (this._common.isActivatedEIP(1559)) { - maxGasLimit = - block.header.gasLimit * BigInt(this._common.param('gasConfig', 'elasticityMultiplier')) + maxGasLimit = block.header.gasLimit * this._common.param('gasConfig', 'elasticityMultiplier') } else { maxGasLimit = block.header.gasLimit } @@ -379,7 +378,7 @@ async function assignBlockRewards(this: VM, block: Block): Promise { debug(`Assign block rewards`) } const state = this.vmState - const minerReward = BigInt(this._common.param('pow', 'minerReward')) + const minerReward = this._common.param('pow', 'minerReward') const ommers = block.uncleHeaders // Reward ommers for (const ommer of ommers) { diff --git a/packages/vm/src/runTx.ts b/packages/vm/src/runTx.ts index b2f1840a66b..0e652539959 100644 --- a/packages/vm/src/runTx.ts +++ b/packages/vm/src/runTx.ts @@ -445,7 +445,7 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { // Process any gas refund let gasRefund = results.gasRefund ?? BigInt(0) - const maxRefundQuotient = BigInt(this._common.param('gasConfig', 'maxRefundQuotient')) + const maxRefundQuotient = this._common.param('gasConfig', 'maxRefundQuotient') if (gasRefund !== BigInt(0)) { const maxRefund = results.gasUsed / maxRefundQuotient gasRefund = gasRefund < maxRefund ? gasRefund : maxRefund diff --git a/packages/vm/tests/api/EIPs/eip-2929.spec.ts b/packages/vm/tests/api/EIPs/eip-2929.spec.ts index 5e7067d5290..06c4dfc95dd 100644 --- a/packages/vm/tests/api/EIPs/eip-2929.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2929.spec.ts @@ -41,7 +41,7 @@ tape('EIP 2929: gas cost tests', (t) => { gasUsed === expectedGasUsed, `Opcode: ${ test.steps[i - 1].expectedOpcode - }, Gase Used: ${gasUsed}, Expected: ${expectedGasUsed}` + }, Gas Used: ${gasUsed}, Expected: ${expectedGasUsed}` ) } } @@ -258,7 +258,7 @@ tape('EIP 2929: gas cost tests', (t) => { st.end() }) - tape('ensure warm addresses/slots are tracked transaction-wide', async (t) => { + t.test('ensure warm addresses/slots are tracked transaction-wide', async (st) => { // Note: these tests were manually analyzed to check if these are correct. // The gas cost has been taken from these tests. @@ -272,21 +272,21 @@ tape('EIP 2929: gas cost tests', (t) => { // SLOAD or CALL operations. // load same storage slot twice (also in inner call) - await runCodeTest('60005460003415601357600080808080305AF15B00', BigInt(23369), t) + await runCodeTest('60005460003415601357600080808080305AF15B00', BigInt(23369), st) // call to contract, load slot 0, revert inner call. load slot 0 in outer call. - await runCodeTest('341515600D57600054600080FD5B600080808080305AF160005400', BigInt(25374), t) + await runCodeTest('341515600D57600054600080FD5B600080808080305AF160005400', BigInt(25374), st) // call to address 0xFFFF..FF const callFF = '6000808080806000195AF1' // call address 0xFF..FF, now call same contract again, call 0xFF..FF again (it is now warm) - await runCodeTest(callFF + '60003415601B57600080808080305AF15B00', BigInt(23909), t) + await runCodeTest(callFF + '60003415601B57600080808080305AF15B00', BigInt(23909), st) // call to contract, call 0xFF..FF, revert, call 0xFF..FF (should be cold) await runCodeTest( '341515601557' + callFF + '600080FD5B600080808080305AF1' + callFF + '00', BigInt(26414), - t + st ) - t.end() + st.end() }) }) diff --git a/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts b/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts index f027d4feb66..4c004895b97 100644 --- a/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts @@ -348,8 +348,8 @@ tape('EIP-3074 AUTHCALL', (t) => { const gasBigInt = bufferToBigInt(gasUsed) const preGas = gas! - - BigInt(common.param('gasPrices', 'warmstorageread')) - - BigInt(common.param('gasPrices', 'coldaccountaccess')) + common.param('gasPrices', 'warmstorageread')! - + common.param('gasPrices', 'coldaccountaccess')! const expected = preGas - preGas / 64n - 2n st.equal(gasBigInt, expected, 'forwarded max call gas') }) @@ -390,7 +390,7 @@ tape('EIP-3074 AUTHCALL', (t) => { Buffer.from('00'.repeat(31) + '01', 'hex') ) const gasBigInt = bufferToBigInt(gasUsed) - const preGas = gas! - BigInt(common.param('gasPrices', 'warmstorageread')) + const preGas = gas! - common.param('gasPrices', 'warmstorageread')! const expected = preGas - preGas / 64n - 2n st.equal(gasBigInt, expected, 'forwarded max call gas') }) @@ -433,10 +433,10 @@ tape('EIP-3074 AUTHCALL', (t) => { const gasBigInt = gas! - gasAfterCall! const expected = - BigInt(common.param('gasPrices', 'coldaccountaccess')) + - BigInt(common.param('gasPrices', 'warmstorageread')) + - BigInt(common.param('gasPrices', 'callNewAccount')) + - BigInt(common.param('gasPrices', 'authcallValueTransfer')) + common.param('gasPrices', 'coldaccountaccess')! + + common.param('gasPrices', 'warmstorageread')! + + common.param('gasPrices', 'callNewAccount')! + + common.param('gasPrices', 'authcallValueTransfer')! st.equal(gasBigInt, expected, 'forwarded max call gas') } @@ -484,9 +484,9 @@ tape('EIP-3074 AUTHCALL', (t) => { const gasBigInt = bufferToBigInt(gasUsed) const preGas = gas! - - BigInt(common.param('gasPrices', 'warmstorageread')) - - BigInt(common.param('gasPrices', 'authcallValueTransfer')) - - BigInt(common.param('gasPrices', 'coldaccountaccess')) + common.param('gasPrices', 'warmstorageread')! - + common.param('gasPrices', 'authcallValueTransfer')! - + common.param('gasPrices', 'coldaccountaccess')! const expected = preGas - preGas / 64n - 2n st.equal(gasBigInt, expected, 'forwarded max call gas') diff --git a/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts b/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts index c442ca37db4..785744f0a10 100644 --- a/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts @@ -65,8 +65,8 @@ tape('EIP 3651 tests', (t) => { const result2 = await vm2.runTx({ block, tx }) const expectedDiff = - BigInt(common.param('gasPrices', 'coldaccountaccess')) - - BigInt(common.param('gasPrices', 'warmstorageread')) + common.param('gasPrices', 'coldaccountaccess')! - + common.param('gasPrices', 'warmstorageread')! st.equal(result2.gasUsed - result.gasUsed, expectedDiff, 'gas difference is correct') }) }) diff --git a/packages/vm/tests/api/EIPs/eip-3855.spec.ts b/packages/vm/tests/api/EIPs/eip-3855.spec.ts index b493f86a4c7..7bc71823dc6 100644 --- a/packages/vm/tests/api/EIPs/eip-3855.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3855.spec.ts @@ -30,7 +30,7 @@ tape('EIP 3541 tests', (t) => { st.ok(stack!.length == 1) st.equal(stack![0], BigInt(0)) - st.equal(result.gasUsed, BigInt(common.param('gasPrices', 'push0'))) + st.equal(result.gasUsed, common.param('gasPrices', 'push0')) st.end() }) @@ -42,7 +42,7 @@ tape('EIP 3541 tests', (t) => { stack = e.stack }) - const depth = common.param('vm', 'stackLimit') + const depth = Number(common.param('vm', 'stackLimit')) const result = await vm.runCode({ code: Buffer.from('5F'.repeat(depth), 'hex'), @@ -55,14 +55,14 @@ tape('EIP 3541 tests', (t) => { st.fail('stack element is not 0') } }) - st.equal(result.gasUsed, BigInt(common.param('gasPrices', 'push0') * depth)) + st.equal(result.gasUsed, common.param('gasPrices', 'push0')! * BigInt(depth)) st.end() }) t.test('should correctly use push0 to create a stack with stack limit + 1 length', async (st) => { const vm = await VM.create({ common }) - const depth = common.param('vm', 'stackLimit') + 1 + const depth = Number(common.param('vm', 'stackLimit')!) + 1 const result = await vm.runCode({ code: Buffer.from('5F'.repeat(depth), 'hex'), diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index a8ee2ff7db8..902ecfdd29c 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -98,7 +98,10 @@ tape('VM -> common (chain, HFs, EIPs)', (t) => { t.test('should only accept valid chain and fork', async (st) => { let common = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) let vm = await VM.create({ common }) - st.equal((vm.stateManager as DefaultStateManager)._common.param('gasPrices', 'ecAdd'), 500) + st.equal( + (vm.stateManager as DefaultStateManager)._common.param('gasPrices', 'ecAdd'), + BigInt(500) + ) try { common = new Common({ chain: 'mainchain', hardfork: Hardfork.Homestead }) diff --git a/packages/vm/tests/api/runCall.spec.ts b/packages/vm/tests/api/runCall.spec.ts index 3425f557dec..8105ee57c83 100644 --- a/packages/vm/tests/api/runCall.spec.ts +++ b/packages/vm/tests/api/runCall.spec.ts @@ -169,7 +169,7 @@ tape('Ensure that precompile activation creates non-empty accounts', async (t) = const resultActivated = await vmActivated.runCall(runCallArgs) const diff = resultNotActivated.execResult.gasUsed - resultActivated.execResult.gasUsed - const expected = BigInt(common.param('gasPrices', 'callNewAccount')) + const expected = common.param('gasPrices', 'callNewAccount') t.equal(diff, expected, 'precompiles are activated') From 9f5824dddb8f739e6ba0183b548271b454079b21 Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Thu, 12 May 2022 03:30:41 -0700 Subject: [PATCH 38/44] rlp: v3 integration for monorepo packages (#1662) * block: update to rlp v3 * blockchain: update to rlp v3 * client: update to rlp v3 * devp2p: update to rlp v3 * ethash: fix test to pass buffer * trie: update to rlp v3 * tx: update to rlp v3 * util: update to rlp v3 * vm: update to rlp v3 * lint, etc. fixes and update package-lock * address review comments --- .github/workflows/e2e-hardhat.yml | 2 +- package-lock.json | 10946 ++++------------ packages/block/package.json | 3 +- packages/block/src/block.ts | 14 +- packages/block/src/header.ts | 20 +- packages/block/test/block.spec.ts | 12 +- packages/block/test/header.spec.ts | 17 +- packages/block/test/util.ts | 7 +- packages/block/tsconfig.prod.json | 1 + packages/blockchain/package.json | 1 + packages/blockchain/src/consensus/clique.ts | 30 +- packages/blockchain/src/db/helpers.ts | 7 +- packages/blockchain/src/db/manager.ts | 7 +- packages/blockchain/test/util.ts | 7 +- packages/blockchain/tsconfig.prod.json | 1 + packages/client/lib/execution/receipt.ts | 40 +- .../client/lib/net/protocol/ethprotocol.ts | 11 +- .../client/lib/net/protocol/libp2psender.ts | 11 +- packages/client/lib/rpc/modules/engine.ts | 5 +- packages/client/lib/rpc/modules/eth.ts | 8 +- packages/client/lib/util/parse.ts | 22 +- packages/client/package.json | 1 + .../test/net/protocol/libp2psender.spec.ts | 4 +- packages/client/tsconfig.prod.json | 1 + .../devp2p/examples/peer-communication.ts | 10 +- packages/devp2p/package.json | 1 + packages/devp2p/src/dns/enr.ts | 11 +- packages/devp2p/src/dpt/message.ts | 8 +- packages/devp2p/src/protocol/eth.ts | 20 +- packages/devp2p/src/protocol/les.ts | 16 +- packages/devp2p/src/rlpx/ecies.ts | 10 +- packages/devp2p/src/rlpx/peer.ts | 26 +- packages/devp2p/src/util.ts | 6 +- packages/devp2p/tsconfig.prod.json | 1 + packages/ethash/package.json | 3 +- packages/ethash/src/index.ts | 22 +- packages/ethash/src/util.ts | 3 +- packages/ethash/test/block.spec.ts | 3 +- packages/ethash/tsconfig.json | 3 +- packages/ethash/tsconfig.prod.json | 1 + packages/statemanager/package.json | 3 +- packages/statemanager/src/stateManager.ts | 17 +- .../tests/proofStateManager.spec.ts | 14 +- packages/trie/README.md | 5 +- packages/trie/benchmarks/random.ts | 5 +- packages/trie/package.json | 1 + packages/trie/src/baseTrie.ts | 6 +- packages/trie/src/secure.ts | 17 +- packages/trie/src/trieNode.ts | 17 +- packages/trie/test/index.spec.ts | 5 +- packages/trie/tsconfig.prod.json | 5 +- packages/tx/README.md | 5 +- packages/tx/examples/transactions.ts | 6 +- packages/tx/package.json | 3 +- packages/tx/src/eip1559Transaction.ts | 22 +- packages/tx/src/eip2930Transaction.ts | 22 +- packages/tx/src/legacyTransaction.ts | 21 +- packages/tx/test/eip1559.spec.ts | 5 +- packages/tx/test/legacy.spec.ts | 11 +- packages/tx/tsconfig.prod.json | 1 + packages/util/README.md | 4 - packages/util/package.json | 2 +- packages/util/src/account.ts | 22 +- packages/util/src/externals.ts | 12 - packages/util/src/index.ts | 5 - packages/util/src/signature.ts | 2 +- packages/util/test/account.spec.ts | 6 +- packages/util/test/externals.spec.ts | 99 - packages/util/tsconfig.prod.json | 5 +- packages/vm/package.json | 1 + packages/vm/src/bloom/index.ts | 6 +- packages/vm/src/buildBlock.ts | 7 +- packages/vm/src/evm/opcodes/functions.ts | 3 +- packages/vm/src/runBlock.ts | 26 +- .../tests/api/EIPs/eip-3074-authcall.spec.ts | 2 +- packages/vm/tests/api/runBlock.spec.ts | 25 +- packages/vm/tests/api/runCall.spec.ts | 6 +- .../tester/runners/BlockchainTestsRunner.ts | 5 +- packages/vm/tests/util.ts | 10 +- packages/vm/tsconfig.prod.json | 1 + 80 files changed, 3168 insertions(+), 8594 deletions(-) delete mode 100644 packages/util/src/externals.ts delete mode 100644 packages/util/test/externals.spec.ts diff --git a/.github/workflows/e2e-hardhat.yml b/.github/workflows/e2e-hardhat.yml index 71869d67c7b..565ec9dab81 100644 --- a/.github/workflows/e2e-hardhat.yml +++ b/.github/workflows/e2e-hardhat.yml @@ -1,7 +1,7 @@ name: E2E Hardhat Tests on: push: - branches: [master, develop] + branches: [master] tags: ['*'] pull_request: types: [opened, reopened, synchronize] diff --git a/package-lock.json b/package-lock.json index e224c037ecd..2fd8cd89397 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,9 +31,8 @@ }, "node_modules/@ampproject/remapping": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.1.2.tgz", - "integrity": "sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@jridgewell/trace-mapping": "^0.3.0" }, @@ -43,9 +42,8 @@ }, "node_modules/@babel/code-frame": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/highlight": "^7.16.7" }, @@ -55,33 +53,31 @@ }, "node_modules/@babel/compat-data": { "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", - "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.9.tgz", - "integrity": "sha512-5ug+SfZCpDAkVp9SFIZAzlW18rlzsOcJGaetCjkySnrXXDUw9AR8cDUm1iByTmdWM6yxX6/zycaV76w3YTF2gw==", + "version": "7.17.8", "dev": true, + "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.9", + "@babel/generator": "^7.17.7", "@babel/helper-compilation-targets": "^7.17.7", "@babel/helper-module-transforms": "^7.17.7", - "@babel/helpers": "^7.17.9", - "@babel/parser": "^7.17.9", + "@babel/helpers": "^7.17.8", + "@babel/parser": "^7.17.8", "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.9", + "@babel/traverse": "^7.17.3", "@babel/types": "^7.17.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.1", + "json5": "^2.1.2", "semver": "^6.3.0" }, "engines": { @@ -93,10 +89,9 @@ } }, "node_modules/@babel/generator": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.9.tgz", - "integrity": "sha512-rAdDousTwxbIxbz5I7GEQ3lUip+xVCXooZNbsydCWs3xA7ZsYOv+CFRdzGxRX78BmQHu9B1Eso59AOZQOJDEdQ==", + "version": "7.17.7", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.17.0", "jsesc": "^2.5.1", @@ -108,9 +103,8 @@ }, "node_modules/@babel/helper-compilation-targets": { "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", - "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", "dev": true, + "license": "MIT", "dependencies": { "@babel/compat-data": "^7.17.7", "@babel/helper-validator-option": "^7.16.7", @@ -126,9 +120,8 @@ }, "node_modules/@babel/helper-environment-visitor": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.16.7" }, @@ -137,13 +130,24 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", - "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", + "version": "7.16.7", "dev": true, + "license": "MIT", "dependencies": { + "@babel/helper-get-function-arity": "^7.16.7", "@babel/template": "^7.16.7", - "@babel/types": "^7.17.0" + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-get-function-arity": { + "version": "7.16.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -151,9 +155,8 @@ }, "node_modules/@babel/helper-hoist-variables": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.16.7" }, @@ -163,9 +166,8 @@ }, "node_modules/@babel/helper-module-imports": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", - "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.16.7" }, @@ -175,9 +177,8 @@ }, "node_modules/@babel/helper-module-transforms": { "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", - "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-module-imports": "^7.16.7", @@ -194,18 +195,16 @@ }, "node_modules/@babel/helper-plugin-utils": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", - "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", - "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.17.0" }, @@ -215,9 +214,8 @@ }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", - "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.16.0" }, @@ -227,9 +225,8 @@ }, "node_modules/@babel/helper-split-export-declaration": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.16.7" }, @@ -239,30 +236,27 @@ }, "node_modules/@babel/helper-validator-identifier": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", - "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.9.tgz", - "integrity": "sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q==", + "version": "7.17.8", "dev": true, + "license": "MIT", "dependencies": { "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.9", + "@babel/traverse": "^7.17.3", "@babel/types": "^7.17.0" }, "engines": { @@ -270,10 +264,9 @@ } }, "node_modules/@babel/highlight": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", - "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", + "version": "7.16.10", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", @@ -285,9 +278,8 @@ }, "node_modules/@babel/highlight/node_modules/ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -297,9 +289,8 @@ }, "node_modules/@babel/highlight/node_modules/chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -311,33 +302,29 @@ }, "node_modules/@babel/highlight/node_modules/color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "1.1.3" } }, "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/@babel/highlight/node_modules/supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -346,10 +333,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", - "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", + "version": "7.17.8", "dev": true, + "license": "MIT", "bin": { "parser": "bin/babel-parser.js" }, @@ -359,9 +345,8 @@ }, "node_modules/@babel/plugin-transform-spread": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz", - "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.16.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" @@ -375,9 +360,8 @@ }, "node_modules/@babel/template": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.16.7", "@babel/parser": "^7.16.7", @@ -388,18 +372,17 @@ } }, "node_modules/@babel/traverse": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.9.tgz", - "integrity": "sha512-PQO8sDIJ8SIwipTPiR71kJQCKQYB5NGImbOviK8K+kg5xkNSYXLBupuX9QhatFowrsvo9Hj8WgArg3W7ijNAQw==", + "version": "7.17.3", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.9", + "@babel/generator": "^7.17.3", "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.17.9", + "@babel/helper-function-name": "^7.16.7", "@babel/helper-hoist-variables": "^7.16.7", "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.9", + "@babel/parser": "^7.17.3", "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" @@ -410,9 +393,8 @@ }, "node_modules/@babel/types": { "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" @@ -423,8 +405,7 @@ }, "node_modules/@chainsafe/libp2p-noise": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.1.2.tgz", - "integrity": "sha512-UvZLWvIS7bAz6M8XfsnC/NhT1c/lg8NNsME1hTvo21kRwyxNFpB8gEhId03Cb5B23oIaHhMySAHBcpuMiSxQ2w==", + "license": "MIT", "dependencies": { "@stablelib/chacha20poly1305": "^1.0.1", "@stablelib/hkdf": "^1.0.1", @@ -444,13 +425,11 @@ }, "node_modules/@chainsafe/libp2p-noise/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/@chainsafe/libp2p-noise/node_modules/peer-id": { "version": "0.15.4", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.15.4.tgz", - "integrity": "sha512-MDoBIMZYwQIAHaZQUwsIcvoFgdbIl5GtZMwSkXpIYvc5v0TSDv+u8WsTKrKt2Vv28tHFFDJQdVzu3T4qTPzK+w==", + "license": "MIT", "dependencies": { "class-is": "^1.1.0", "libp2p-crypto": "^0.20.0", @@ -468,8 +447,7 @@ }, "node_modules/@chainsafe/libp2p-noise/node_modules/peer-id/node_modules/libp2p-crypto": { "version": "0.20.0", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.20.0.tgz", - "integrity": "sha512-WgIW9rYcWaO/5j2T6NW3R6Q46yvp2ZfFErqRMbi4/pOTL3T7+OROYpL/1iWVksWkXyurU/t2qFsIijWMxR5C4Q==", + "license": "MIT", "dependencies": { "err-code": "^3.0.1", "iso-random-stream": "^2.0.0", @@ -489,26 +467,23 @@ }, "node_modules/@colors/colors": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "license": "MIT", "engines": { "node": ">=0.1.90" } }, "node_modules/@cspotcode/source-map-consumer": { "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", - "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">= 12" } }, "node_modules/@cspotcode/source-map-support": { "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", - "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", "dev": true, + "license": "MIT", "dependencies": { "@cspotcode/source-map-consumer": "0.8.0" }, @@ -518,8 +493,7 @@ }, "node_modules/@dabh/diagnostics": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", - "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", + "license": "MIT", "dependencies": { "colorspace": "1.1.x", "enabled": "2.0.x", @@ -528,9 +502,8 @@ }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" } @@ -573,8 +546,6 @@ }, "node_modules/@ethersproject/abi": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.0.tgz", - "integrity": "sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg==", "dev": true, "funding": [ { @@ -586,6 +557,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/address": "^5.6.0", "@ethersproject/bignumber": "^5.6.0", @@ -600,8 +572,6 @@ }, "node_modules/@ethersproject/abstract-provider": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz", - "integrity": "sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw==", "dev": true, "funding": [ { @@ -613,6 +583,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/bignumber": "^5.6.0", "@ethersproject/bytes": "^5.6.0", @@ -625,8 +596,6 @@ }, "node_modules/@ethersproject/abstract-signer": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz", - "integrity": "sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ==", "dev": true, "funding": [ { @@ -638,6 +607,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/abstract-provider": "^5.6.0", "@ethersproject/bignumber": "^5.6.0", @@ -648,8 +618,6 @@ }, "node_modules/@ethersproject/address": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.0.tgz", - "integrity": "sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ==", "dev": true, "funding": [ { @@ -661,6 +629,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/bignumber": "^5.6.0", "@ethersproject/bytes": "^5.6.0", @@ -671,8 +640,6 @@ }, "node_modules/@ethersproject/base64": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.0.tgz", - "integrity": "sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw==", "dev": true, "funding": [ { @@ -684,14 +651,13 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.0" } }, "node_modules/@ethersproject/bignumber": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.0.tgz", - "integrity": "sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA==", "dev": true, "funding": [ { @@ -703,16 +669,20 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.0", "@ethersproject/logger": "^5.6.0", "bn.js": "^4.11.9" } }, + "node_modules/@ethersproject/bignumber/node_modules/bn.js": { + "version": "4.12.0", + "dev": true, + "license": "MIT" + }, "node_modules/@ethersproject/bytes": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", - "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", + "version": "5.6.0", "dev": true, "funding": [ { @@ -724,14 +694,13 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/constants": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.0.tgz", - "integrity": "sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA==", "dev": true, "funding": [ { @@ -743,14 +712,13 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/bignumber": "^5.6.0" } }, "node_modules/@ethersproject/hash": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.0.tgz", - "integrity": "sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA==", "dev": true, "funding": [ { @@ -762,6 +730,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/abstract-signer": "^5.6.0", "@ethersproject/address": "^5.6.0", @@ -775,8 +744,6 @@ }, "node_modules/@ethersproject/keccak256": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.0.tgz", - "integrity": "sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w==", "dev": true, "funding": [ { @@ -788,6 +755,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.0", "js-sha3": "0.8.0" @@ -795,8 +763,6 @@ }, "node_modules/@ethersproject/logger": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", - "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", "dev": true, "funding": [ { @@ -807,12 +773,11 @@ "type": "individual", "url": "https://www.buymeacoffee.com/ricmoo" } - ] + ], + "license": "MIT" }, "node_modules/@ethersproject/networks": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.1.tgz", - "integrity": "sha512-b2rrupf3kCTcc3jr9xOWBuHylSFtbpJf79Ga7QR98ienU2UqGimPGEsYMgbI29KHJfA5Us89XwGVmxrlxmSrMg==", + "version": "5.6.0", "dev": true, "funding": [ { @@ -824,14 +789,13 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/properties": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", - "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", "dev": true, "funding": [ { @@ -843,14 +807,13 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/rlp": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.0.tgz", - "integrity": "sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g==", "dev": true, "funding": [ { @@ -862,6 +825,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.0", "@ethersproject/logger": "^5.6.0" @@ -869,8 +833,6 @@ }, "node_modules/@ethersproject/signing-key": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.0.tgz", - "integrity": "sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA==", "dev": true, "funding": [ { @@ -882,6 +844,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.0", "@ethersproject/logger": "^5.6.0", @@ -891,10 +854,13 @@ "hash.js": "1.1.7" } }, + "node_modules/@ethersproject/signing-key/node_modules/bn.js": { + "version": "4.12.0", + "dev": true, + "license": "MIT" + }, "node_modules/@ethersproject/strings": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.0.tgz", - "integrity": "sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg==", "dev": true, "funding": [ { @@ -906,6 +872,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.0", "@ethersproject/constants": "^5.6.0", @@ -914,8 +881,6 @@ }, "node_modules/@ethersproject/transactions": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.0.tgz", - "integrity": "sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg==", "dev": true, "funding": [ { @@ -927,6 +892,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/address": "^5.6.0", "@ethersproject/bignumber": "^5.6.0", @@ -941,8 +907,6 @@ }, "node_modules/@ethersproject/web": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.0.tgz", - "integrity": "sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg==", "dev": true, "funding": [ { @@ -954,6 +918,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@ethersproject/base64": "^5.6.0", "@ethersproject/bytes": "^5.6.0", @@ -964,9 +929,8 @@ }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, + "license": "ISC", "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", @@ -980,42 +944,37 @@ }, "node_modules/@istanbuljs/load-nyc-config/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, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@jridgewell/resolve-uri": { "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", - "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -1023,8 +982,7 @@ }, "node_modules/@motrix/nat-api": { "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@motrix/nat-api/-/nat-api-0.3.2.tgz", - "integrity": "sha512-T3LSHnEUULbSU1o1zCZZ1ul8l8Jm98f0fz/0BeF7DhNvrV63YllLCD4vUR9hFZWu/+WTIVPnbH8dBK5Ckuveuw==", + "license": "MIT", "dependencies": { "async": "^3.2.0", "debug": "^4.3.1", @@ -1039,24 +997,21 @@ }, "node_modules/@motrix/nat-api/node_modules/async": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" + "license": "MIT" }, "node_modules/@multiformats/base-x": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@multiformats/base-x/-/base-x-4.0.1.tgz", - "integrity": "sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw==" + "license": "MIT" }, "node_modules/@noble/ed25519": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@noble/ed25519/-/ed25519-1.6.0.tgz", - "integrity": "sha512-UKju89WV37IUALIMfKhKW3psO8AqmrE/GvH6QbPKjzolQ98zM7WmGUeY+xdIgSf5tqPFf75ZCYMgym6E9Jsw3Q==", "funding": [ { "type": "individual", "url": "https://paulmillr.com/funding/" } - ] + ], + "license": "MIT" }, "node_modules/@noble/hashes": { "version": "1.0.0", @@ -1065,20 +1020,18 @@ }, "node_modules/@noble/secp256k1": { "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.5.5.tgz", - "integrity": "sha512-sZ1W6gQzYnu45wPrWx8D3kwI2/U29VYTx9OjbDAd7jwRItJ0cSTMPRL/C8AWZFn9kWFLQGqEXVEE86w4Z8LpIQ==", "funding": [ { "type": "individual", "url": "https://paulmillr.com/funding/" } - ] + ], + "license": "MIT" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1089,18 +1042,16 @@ }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1111,28 +1062,23 @@ }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -1140,28 +1086,23 @@ }, "node_modules/@protobufjs/float": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + "license": "BSD-3-Clause" }, "node_modules/@scure/base": { "version": "1.0.0", @@ -1207,24 +1148,21 @@ }, "node_modules/@sinonjs/commons": { "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "license": "BSD-3-Clause", "dependencies": { "type-detect": "4.0.8" } }, "node_modules/@sinonjs/fake-timers": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^1.7.0" } }, "node_modules/@sinonjs/samsam": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz", - "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==", + "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^1.6.0", "lodash.get": "^4.4.2", @@ -1233,40 +1171,34 @@ }, "node_modules/@sinonjs/text-encoding": { "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==" + "license": "(Unlicense OR Apache-2.0)" }, "node_modules/@socket.io/base64-arraybuffer": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", - "integrity": "sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6.0" } }, "node_modules/@stablelib/aead": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/aead/-/aead-1.0.1.tgz", - "integrity": "sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==" + "license": "MIT" }, "node_modules/@stablelib/binary": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", - "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", + "license": "MIT", "dependencies": { "@stablelib/int": "^1.0.1" } }, "node_modules/@stablelib/bytes": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/bytes/-/bytes-1.0.1.tgz", - "integrity": "sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ==" + "license": "MIT" }, "node_modules/@stablelib/chacha": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz", - "integrity": "sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==", + "license": "MIT", "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -1274,8 +1206,7 @@ }, "node_modules/@stablelib/chacha20poly1305": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha20poly1305/-/chacha20poly1305-1.0.1.tgz", - "integrity": "sha512-MmViqnqHd1ymwjOQfghRKw2R/jMIGT3wySN7cthjXCBdO+qErNPUBnRzqNpnvIwg7JBCg3LdeCZZO4de/yEhVA==", + "license": "MIT", "dependencies": { "@stablelib/aead": "^1.0.1", "@stablelib/binary": "^1.0.1", @@ -1287,18 +1218,15 @@ }, "node_modules/@stablelib/constant-time": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/constant-time/-/constant-time-1.0.1.tgz", - "integrity": "sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==" + "license": "MIT" }, "node_modules/@stablelib/hash": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hash/-/hash-1.0.1.tgz", - "integrity": "sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==" + "license": "MIT" }, "node_modules/@stablelib/hkdf": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hkdf/-/hkdf-1.0.1.tgz", - "integrity": "sha512-SBEHYE16ZXlHuaW5RcGk533YlBj4grMeg5TooN80W3NpcHRtLZLLXvKyX0qcRFxf+BGDobJLnwkvgEwHIDBR6g==", + "license": "MIT", "dependencies": { "@stablelib/hash": "^1.0.1", "@stablelib/hmac": "^1.0.1", @@ -1307,8 +1235,7 @@ }, "node_modules/@stablelib/hmac": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hmac/-/hmac-1.0.1.tgz", - "integrity": "sha512-V2APD9NSnhVpV/QMYgCVMIYKiYG6LSqw1S65wxVoirhU/51ACio6D4yDVSwMzuTJXWZoVHbDdINioBwKy5kVmA==", + "license": "MIT", "dependencies": { "@stablelib/constant-time": "^1.0.1", "@stablelib/hash": "^1.0.1", @@ -1317,21 +1244,18 @@ }, "node_modules/@stablelib/int": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", - "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" + "license": "MIT" }, "node_modules/@stablelib/keyagreement": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/keyagreement/-/keyagreement-1.0.1.tgz", - "integrity": "sha512-VKL6xBwgJnI6l1jKrBAfn265cspaWBPAPEc62VBQrWHLqVgNRE09gQ/AnOEyKUWrrqfD+xSQ3u42gJjLDdMDQg==", + "license": "MIT", "dependencies": { "@stablelib/bytes": "^1.0.1" } }, "node_modules/@stablelib/poly1305": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/poly1305/-/poly1305-1.0.1.tgz", - "integrity": "sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==", + "license": "MIT", "dependencies": { "@stablelib/constant-time": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -1339,8 +1263,7 @@ }, "node_modules/@stablelib/random": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/random/-/random-1.0.1.tgz", - "integrity": "sha512-zOh+JHX3XG9MSfIB0LZl/YwPP9w3o6WBiJkZvjPoKKu5LKFW4OLV71vMxWp9qG5T43NaWyn0QQTWgqCdO+yOBQ==", + "license": "MIT", "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -1348,8 +1271,7 @@ }, "node_modules/@stablelib/sha256": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/sha256/-/sha256-1.0.1.tgz", - "integrity": "sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ==", + "license": "MIT", "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/hash": "^1.0.1", @@ -1358,13 +1280,11 @@ }, "node_modules/@stablelib/wipe": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", - "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" + "license": "MIT" }, "node_modules/@stablelib/x25519": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@stablelib/x25519/-/x25519-1.0.2.tgz", - "integrity": "sha512-wTR0t0Bp1HABLFRbYaE3vFLuco2QbAg6QvxBnzi5j9qjhYezWHW7OiCZyaWbt25UkSaoolUUT4Il0nS/2vcbSw==", + "license": "MIT", "dependencies": { "@stablelib/keyagreement": "^1.0.1", "@stablelib/random": "^1.0.1", @@ -1373,67 +1293,57 @@ }, "node_modules/@tsconfig/node10": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node12": { "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node14": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node16": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/abstract-leveldown": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", - "integrity": "sha512-q5veSX6zjUy/DlDhR4Y4cU0k2Ar+DT2LUraP00T19WLmTO6Se1djepCCaqU6nQrwcJ5Hyo/CWqxTzrrFg8eqbQ==" + "license": "MIT" }, "node_modules/@types/async": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@types/async/-/async-2.4.2.tgz", - "integrity": "sha512-bWBbC7VG2jdjbgZMX0qpds8U/3h3anfIqE81L8jmVrgFZw/urEDnBA78ymGGKTTK6ciBXmmJ/xlok+Re41S8ww==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/benchmark": { "version": "1.0.33", - "resolved": "https://registry.npmjs.org/@types/benchmark/-/benchmark-1.0.33.tgz", - "integrity": "sha512-rG7Ieasa9UfZJnL72qiFvY9ivhEIYjCGgfcLLb5tJ/EL9+Mcxernj6W3HVCv/cOfJYuwNUwvVVhnrKl8iT8aqA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/bl": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/bl/-/bl-2.1.0.tgz", - "integrity": "sha512-1TdA9IXOy4sdqn8vgieQ6GZAiHiPNrOiO1s2GJjuYPw4QVY7gYoVjkW049avj33Ez7IcIvu43hQsMsoUFbCn2g==", + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/bn.js": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", - "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/body-parser": { "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", "dev": true, + "license": "MIT", "dependencies": { "@types/connect": "*", "@types/node": "*" @@ -1441,66 +1351,56 @@ }, "node_modules/@types/chalk": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@types/chalk/-/chalk-2.2.0.tgz", - "integrity": "sha512-1zzPV9FDe1I/WHhRkf9SNgqtRJWZqrBWgu7JGveuHmmyR9CnAPCie2N/x+iHrgnpYBIcCJWHBoMRv2TRWktsvw==", - "deprecated": "This is a stub types definition for chalk (https://github.com/chalk/chalk). chalk provides its own type definitions, so you don't need @types/chalk installed!", "dev": true, + "license": "MIT", "dependencies": { "chalk": "*" } }, "node_modules/@types/component-emitter": { "version": "1.2.11", - "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", - "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/connect": { "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/cookie": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/cookiejar": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/core-js": { "version": "2.5.5", - "resolved": "https://registry.npmjs.org/@types/core-js/-/core-js-2.5.5.tgz", - "integrity": "sha512-C4vwOHrhsvxn7UFyk4NDQNUpgNKdWsT/bL39UWyD75KSEOObZSKa9mYDOCM5FGeJG2qtbG0XiEbUKND2+j0WOg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/cors": { "version": "2.8.12", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/debug": { "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", "dev": true, + "license": "MIT", "dependencies": { "@types/ms": "*" } }, "node_modules/@types/eslint": { "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", - "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "*", "@types/json-schema": "*" @@ -1508,9 +1408,8 @@ }, "node_modules/@types/eslint-scope": { "version": "3.7.3", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", "dev": true, + "license": "MIT", "dependencies": { "@types/eslint": "*", "@types/estree": "*" @@ -1518,14 +1417,12 @@ }, "node_modules/@types/estree": { "version": "0.0.51", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", - "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/express-serve-static-core": { "version": "4.17.28", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", - "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "license": "MIT", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -1534,60 +1431,52 @@ }, "node_modules/@types/fs-extra": { "version": "8.1.2", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.2.tgz", - "integrity": "sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/ip": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@types/ip/-/ip-1.1.0.tgz", - "integrity": "sha512-dwNe8gOoF70VdL6WJBwVHtQmAX4RMd62M+mAB9HQFjG1/qiCLM/meRy95Pd14FYBbEDwCq7jgJs89cHpLBu4HQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true + "version": "7.0.10", + "dev": true, + "license": "MIT" }, "node_modules/@types/jwt-simple": { "version": "0.5.33", - "resolved": "https://registry.npmjs.org/@types/jwt-simple/-/jwt-simple-0.5.33.tgz", - "integrity": "sha1-+4Ocq+gUN5VPfQzQF2CtgJbsUm4=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/k-bucket": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@types/k-bucket/-/k-bucket-5.0.1.tgz", - "integrity": "sha512-HjWSV4fBIRlZNbp7e+IQlHOY9MZhBcY+9Jf8vhZv5qGHJMlkCQQBKiX/n69/3YvTF34jsm+WKmro7eyG6FbYww==", + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/keccak": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/keccak/-/keccak-3.0.1.tgz", - "integrity": "sha512-/MxAVmtyyeOvZ6dGf3ciLwFRuV5M8DRIyYNFGHYI6UyBW4/XqyO0LZw+JFMvaeY3cHItQAkELclBU1x5ank6mg==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/level-errors": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/level-errors/-/level-errors-3.0.0.tgz", - "integrity": "sha512-/lMtoq/Cf/2DVOm6zE6ORyOM+3ZVm/BvzEZVxUhf6bgh8ZHglXlBqxbxSlJeVp8FCbD3IVvk/VbsaNmDjrQvqQ==" + "license": "MIT" }, "node_modules/@types/levelup": { "version": "4.3.3", - "resolved": "https://registry.npmjs.org/@types/levelup/-/levelup-4.3.3.tgz", - "integrity": "sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA==", + "license": "MIT", "dependencies": { "@types/abstract-leveldown": "*", "@types/level-errors": "*", @@ -1595,86 +1484,72 @@ } }, "node_modules/@types/lodash": { - "version": "4.14.181", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.181.tgz", - "integrity": "sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag==" + "version": "4.14.180", + "license": "MIT" }, "node_modules/@types/long": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", - "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" + "license": "MIT" }, "node_modules/@types/lru-cache": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==" + "license": "MIT" }, "node_modules/@types/minimatch": { "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" + "license": "MIT" }, "node_modules/@types/minimist": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/ms": { "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { "version": "16.11.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.26.tgz", - "integrity": "sha512-GZ7bu5A6+4DtG7q9GsoHXy3ALcgeIHP4NnL0Vv2wu0uUB/yQex26v0tf6/na1mm0+bS9Uw+0DFex7aaKr2qawQ==" + "license": "MIT" }, "node_modules/@types/node-dir": { "version": "0.0.34", - "resolved": "https://registry.npmjs.org/@types/node-dir/-/node-dir-0.0.34.tgz", - "integrity": "sha512-FwNgAbQyXvMP/kTsi/lH7Cpz+2xny+/ZhpDMophHcZerMxYvM+eqa8an1isNbykSQ9VCZutdbmMx2FLp5ufeMw==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/parse-json": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/qs": { "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + "license": "MIT" }, "node_modules/@types/retry": { "version": "0.12.1", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", - "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==" + "license": "MIT" }, "node_modules/@types/secp256k1": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/superagent": { "version": "4.1.15", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.15.tgz", - "integrity": "sha512-mu/N4uvfDN2zVQQ5AYJI/g4qxn2bHB6521t1UuH09ShNWjebTqN0ZFuYK9uYjcgmI0dTQEs+Owi1EO6U0OkOZQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/cookiejar": "*", "@types/node": "*" @@ -1682,35 +1557,31 @@ }, "node_modules/@types/supertest": { "version": "2.0.12", - "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.12.tgz", - "integrity": "sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/superagent": "*" } }, "node_modules/@types/tape": { "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@types/tape/-/tape-4.13.2.tgz", - "integrity": "sha512-V1ez/RtYRGN9cNYApw5xf27DpMkTB0033X6a2i3KUmKhSojBfbWN0i3EgZxboUG96WJLHLdOyZ01aiZwVW5aSA==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/ws": { "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", - "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/experimental-utils": "4.33.0", "@typescript-eslint/scope-manager": "4.33.0", @@ -1740,9 +1611,8 @@ }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -1751,10 +1621,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.5", "dev": true, + "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -1767,15 +1636,13 @@ }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/@typescript-eslint/experimental-utils": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", - "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.7", "@typescript-eslint/scope-manager": "4.33.0", @@ -1797,9 +1664,8 @@ }, "node_modules/@typescript-eslint/parser": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", - "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "4.33.0", "@typescript-eslint/types": "4.33.0", @@ -1824,9 +1690,8 @@ }, "node_modules/@typescript-eslint/scope-manager": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", - "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/types": "4.33.0", "@typescript-eslint/visitor-keys": "4.33.0" @@ -1841,9 +1706,8 @@ }, "node_modules/@typescript-eslint/types": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", - "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", "dev": true, + "license": "MIT", "engines": { "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, @@ -1854,9 +1718,8 @@ }, "node_modules/@typescript-eslint/typescript-estree": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", - "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "4.33.0", "@typescript-eslint/visitor-keys": "4.33.0", @@ -1881,9 +1744,8 @@ }, "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -1892,10 +1754,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.5", "dev": true, + "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -1908,15 +1769,13 @@ }, "node_modules/@typescript-eslint/typescript-estree/node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/@typescript-eslint/visitor-keys": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", - "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/types": "4.33.0", "eslint-visitor-keys": "^2.0.0" @@ -1931,9 +1790,8 @@ }, "node_modules/@verdaccio/commons-api": { "version": "9.7.1", - "resolved": "https://registry.npmjs.org/@verdaccio/commons-api/-/commons-api-9.7.1.tgz", - "integrity": "sha512-s2uD3s325C0UsQ9uQTmf15dXFsGVo23IM6pSUTukCRuurCok89e/k1Adz2CaoXpEu1qpxQ6Sv0dcNpGl7Q7hwQ==", "dev": true, + "license": "MIT", "dependencies": { "http-errors": "1.8.0", "http-status-codes": "1.4.0" @@ -1946,20 +1804,10 @@ "url": "https://opencollective.com/verdaccio" } }, - "node_modules/@verdaccio/commons-api/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/@verdaccio/commons-api/node_modules/http-errors": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", - "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", "dev": true, + "license": "MIT", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.4", @@ -1973,18 +1821,16 @@ }, "node_modules/@verdaccio/commons-api/node_modules/toidentifier": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.6" } }, "node_modules/@verdaccio/file-locking": { "version": "9.7.2", - "resolved": "https://registry.npmjs.org/@verdaccio/file-locking/-/file-locking-9.7.2.tgz", - "integrity": "sha512-y9yLk8+9wdQH1bDyeR7Cu80dKQMiiva9ddNbXllV6h0uxaqVOxDyyE0OWdyvUy0xdA4lUD/y0DxHOInDOhdKaw==", "dev": true, + "license": "MIT", "dependencies": { "lockfile": "1.0.4" }, @@ -1998,9 +1844,8 @@ }, "node_modules/@verdaccio/local-storage": { "version": "9.7.5", - "resolved": "https://registry.npmjs.org/@verdaccio/local-storage/-/local-storage-9.7.5.tgz", - "integrity": "sha512-Hur5GGvy6L7lrKmITC+t+VgdRuUGA1Y2/j3DC726NC0obtOlNsOkXTPQTUgSlvao0KnnHSzfm1+MZ7ZlwCMYew==", "dev": true, + "license": "MIT", "dependencies": { "@verdaccio/commons-api": "^9.7.1", "@verdaccio/file-locking": "^9.7.2", @@ -2020,9 +1865,8 @@ }, "node_modules/@verdaccio/local-storage/node_modules/abstract-leveldown": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz", - "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==", "dev": true, + "license": "MIT", "dependencies": { "level-concat-iterator": "~2.0.0", "xtend": "~4.0.0" @@ -2033,22 +1877,19 @@ }, "node_modules/@verdaccio/local-storage/node_modules/async": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@verdaccio/local-storage/node_modules/immediate": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@verdaccio/local-storage/node_modules/level": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/level/-/level-5.0.1.tgz", - "integrity": "sha512-wcak5OQeA4rURGacqS62R/xNHjCYnJSQDBOlm4KNUGJVE9bWv2B04TclqReYejN+oD65PzD4FsqeWoI5wNC5Lg==", "dev": true, "hasInstallScript": true, + "license": "MIT", "dependencies": { "level-js": "^4.0.0", "level-packager": "^5.0.0", @@ -2061,9 +1902,8 @@ }, "node_modules/@verdaccio/local-storage/node_modules/level-js": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-js/-/level-js-4.0.2.tgz", - "integrity": "sha512-PeGjZsyMG4O89KHiez1zoMJxStnkM+oBIqgACjoo5PJqFiSUUm3GNod/KcbqN5ktyZa8jkG7I1T0P2u6HN9lIg==", "dev": true, + "license": "MIT", "dependencies": { "abstract-leveldown": "~6.0.1", "immediate": "~3.2.3", @@ -2074,9 +1914,8 @@ }, "node_modules/@verdaccio/local-storage/node_modules/mkdirp": { "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.5" }, @@ -2086,9 +1925,8 @@ }, "node_modules/@verdaccio/readme": { "version": "9.7.5", - "resolved": "https://registry.npmjs.org/@verdaccio/readme/-/readme-9.7.5.tgz", - "integrity": "sha512-1CXqpXHCcmrCzFk++Cs7S1gcj/pSSUozVIuUPNrnp+GWAbM+kmalC1H6mpYCK2zR8jA3EkwLSyPbzK21E/B4tQ==", "dev": true, + "license": "MIT", "dependencies": { "dompurify": "^2.2.6", "jsdom": "15.2.1", @@ -2101,9 +1939,8 @@ }, "node_modules/@verdaccio/readme/node_modules/marked": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz", - "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==", "dev": true, + "license": "MIT", "bin": { "marked": "bin/marked" }, @@ -2113,9 +1950,8 @@ }, "node_modules/@verdaccio/streams": { "version": "9.7.2", - "resolved": "https://registry.npmjs.org/@verdaccio/streams/-/streams-9.7.2.tgz", - "integrity": "sha512-SoCG1btVFPxOcrs8w9wLJCfe8nfE6EaEXCXyRwGbh+Sr3NLEG0R8JOugGJbuSE+zIRuUs5JaUKjzSec+JKLvZw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8", "npm": ">=5" @@ -2127,15 +1963,13 @@ }, "node_modules/@verdaccio/ui-theme": { "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@verdaccio/ui-theme/-/ui-theme-1.15.1.tgz", - "integrity": "sha512-CSd/NnVuqWQo7RnmL7ehZeAEYUbvGM33VmWGzoO91Ujny2tbhlg7kdpbfiEIoKl8Yc2wd9bVMd1HJATDF2uHGw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/ast": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/helper-numbers": "1.11.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.1" @@ -2143,27 +1977,23 @@ }, "node_modules/@webassemblyjs/floating-point-hex-parser": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/helper-api-error": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/helper-buffer": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", - "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/helper-numbers": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/floating-point-hex-parser": "1.11.1", "@webassemblyjs/helper-api-error": "1.11.1", @@ -2172,15 +2002,13 @@ }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/helper-wasm-section": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", - "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.11.1", "@webassemblyjs/helper-buffer": "1.11.1", @@ -2190,33 +2018,29 @@ }, "node_modules/@webassemblyjs/ieee754": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", - "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", "dev": true, + "license": "MIT", "dependencies": { "@xtuc/ieee754": "^1.2.0" } }, "node_modules/@webassemblyjs/leb128": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", - "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", - "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/wasm-edit": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", - "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.11.1", "@webassemblyjs/helper-buffer": "1.11.1", @@ -2230,9 +2054,8 @@ }, "node_modules/@webassemblyjs/wasm-gen": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", - "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.11.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.1", @@ -2243,9 +2066,8 @@ }, "node_modules/@webassemblyjs/wasm-opt": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", - "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.11.1", "@webassemblyjs/helper-buffer": "1.11.1", @@ -2255,9 +2077,8 @@ }, "node_modules/@webassemblyjs/wasm-parser": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", - "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.11.1", "@webassemblyjs/helper-api-error": "1.11.1", @@ -2269,9 +2090,8 @@ }, "node_modules/@webassemblyjs/wast-printer": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", - "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.11.1", "@xtuc/long": "4.2.2" @@ -2279,9 +2099,8 @@ }, "node_modules/@webpack-cli/configtest": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.1.tgz", - "integrity": "sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg==", "dev": true, + "license": "MIT", "peerDependencies": { "webpack": "4.x.x || 5.x.x", "webpack-cli": "4.x.x" @@ -2289,9 +2108,8 @@ }, "node_modules/@webpack-cli/info": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.1.tgz", - "integrity": "sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA==", "dev": true, + "license": "MIT", "dependencies": { "envinfo": "^7.7.3" }, @@ -2301,9 +2119,8 @@ }, "node_modules/@webpack-cli/serve": { "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.1.tgz", - "integrity": "sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw==", "dev": true, + "license": "MIT", "peerDependencies": { "webpack-cli": "4.x.x" }, @@ -2315,27 +2132,23 @@ }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/@xtuc/long": { "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/@zxing/text-encoding": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", - "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", + "license": "(Unlicense OR Apache-2.0)", "optional": true }, "node_modules/0x": { "version": "4.11.0", - "resolved": "https://registry.npmjs.org/0x/-/0x-4.11.0.tgz", - "integrity": "sha512-AdEFfertRHzlGq5RWdF6kxHwNbpVBoCB5kIvIqXfgWu37UcP0mFK3P9FKundVauPvNpGCmA9YcJsPxt9+8MRoQ==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.9.2", "browserify": "^16.2.3", @@ -2375,23 +2188,20 @@ }, "node_modules/0x/node_modules/semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver" } }, "node_modules/abab": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/abort-controller": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" }, @@ -2401,16 +2211,14 @@ }, "node_modules/abortable-iterator": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-3.0.2.tgz", - "integrity": "sha512-qVP8HFfTpUQI2F+f1tpTriKDIZ4XrmwCrBCrQeRKO7DKWF3kgoT6NXiNDv2krrGcHxPwmI63eGQiec81sEaWIw==", + "license": "MIT", "dependencies": { "get-iterator": "^1.0.2" } }, "node_modules/abstract-leveldown": { "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "license": "MIT", "dependencies": { "buffer": "^5.5.0", "immediate": "^3.2.3", @@ -2424,8 +2232,6 @@ }, "node_modules/abstract-leveldown/node_modules/buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -2440,6 +2246,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -2447,9 +2254,8 @@ }, "node_modules/accepts": { "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, + "license": "MIT", "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -2460,9 +2266,8 @@ }, "node_modules/acorn": { "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -2472,9 +2277,8 @@ }, "node_modules/acorn-globals": { "version": "4.3.4", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", - "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==", "dev": true, + "license": "MIT", "dependencies": { "acorn": "^6.0.1", "acorn-walk": "^6.0.1" @@ -2482,9 +2286,8 @@ }, "node_modules/acorn-globals/node_modules/acorn": { "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -2494,27 +2297,24 @@ }, "node_modules/acorn-globals/node_modules/acorn-walk": { "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", - "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/acorn-jsx": { "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/acorn-node": { "version": "1.8.2", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", - "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", "dev": true, + "license": "Apache-2.0", "dependencies": { "acorn": "^7.0.0", "acorn-walk": "^7.0.0", @@ -2523,17 +2323,15 @@ }, "node_modules/acorn-walk": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/aggregate-error": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "license": "MIT", "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -2544,8 +2342,7 @@ }, "node_modules/ajv": { "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -2559,18 +2356,16 @@ }, "node_modules/ajv-keywords": { "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "dev": true, + "license": "MIT", "peerDependencies": { "ajv": "^6.9.1" } }, "node_modules/ansi-escapes": { "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.21.3" }, @@ -2583,17 +2378,15 @@ }, "node_modules/ansi-regex": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -2606,14 +2399,12 @@ }, "node_modules/ansicolors": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.2.1.tgz", - "integrity": "sha1-vgiVmQl7dKXJxKhKDNvNtivYeu8=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/any-signal": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/any-signal/-/any-signal-2.1.2.tgz", - "integrity": "sha512-B+rDnWasMi/eWcajPcCWSlYc7muXOrcYrqgyzcdKisl2H/WTlQ0gip1KyQfr0ZlxJdsuWCj/LWwQm7fhyhRfIQ==", + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "native-abort-controller": "^1.0.3" @@ -2621,9 +2412,8 @@ }, "node_modules/anymatch": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, + "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -2634,18 +2424,16 @@ }, "node_modules/apache-md5": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/apache-md5/-/apache-md5-1.1.2.tgz", - "integrity": "sha1-7klza2ObTxCLbp5ibG2pkwa0FpI=", "dev": true, + "license": "MIT", "engines": { "node": ">=4.6.1" } }, "node_modules/append-transform": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", - "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, + "license": "MIT", "dependencies": { "default-require-extensions": "^3.0.0" }, @@ -2655,30 +2443,26 @@ }, "node_modules/archy": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/arg": { "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/argparse": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, + "license": "MIT", "dependencies": { "sprintf-js": "~1.0.2" } }, "node_modules/args": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/args/-/args-5.0.1.tgz", - "integrity": "sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==", "dev": true, + "license": "MIT", "dependencies": { "camelcase": "5.0.0", "chalk": "2.4.2", @@ -2691,9 +2475,8 @@ }, "node_modules/args/node_modules/ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -2703,18 +2486,16 @@ }, "node_modules/args/node_modules/camelcase": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/args/node_modules/chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -2726,33 +2507,29 @@ }, "node_modules/args/node_modules/color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "1.1.3" } }, "node_modules/args/node_modules/color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/args/node_modules/has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/args/node_modules/supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -2762,30 +2539,26 @@ }, "node_modules/array-equal": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/array-flatten": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/array-union": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/array.prototype.every": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.3.tgz", - "integrity": "sha512-vWnriJI//SOMOWtXbU/VXhJ/InfnNHPF6BLKn5WfY8xXy+NWql0fUy20GO3sdqBhCAO+qw8S/E5nJiZX+QFdCA==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", @@ -2800,15 +2573,13 @@ } }, "node_modules/array.prototype.find": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.2.0.tgz", - "integrity": "sha512-sn40qmUiLYAcRb/1HsIQjTTZ1kCy8II8VtZJpMn2Aoen9twULhbWXisfh3HimGqMlHGUul0/TfKCnXg42LuPpQ==", + "version": "2.1.2", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.19.4", - "es-shim-unscopables": "^1.0.0" + "es-abstract": "^1.19.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2816,22 +2587,19 @@ }, "node_modules/asap": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/asn1": { "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "license": "MIT", "dependencies": { "safer-buffer": "~2.1.0" } }, "node_modules/asn1.js": { "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "license": "MIT", "dependencies": { "bn.js": "^4.0.0", "inherits": "^2.0.1", @@ -2839,11 +2607,14 @@ "safer-buffer": "^2.1.0" } }, + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "license": "MIT" + }, "node_modules/assert": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", "dev": true, + "license": "MIT", "dependencies": { "object-assign": "^4.1.1", "util": "0.10.3" @@ -2851,78 +2622,68 @@ }, "node_modules/assert-plus": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "license": "MIT", "engines": { "node": ">=0.8" } }, "node_modules/assert/node_modules/inherits": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/assert/node_modules/util": { "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, + "license": "MIT", "dependencies": { "inherits": "2.0.1" } }, "node_modules/assertion-error": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "license": "MIT", "engines": { "node": "*" } }, "node_modules/astral-regex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/async": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "license": "MIT", "dependencies": { "lodash": "^4.17.14" } }, "node_modules/async-eventemitter": { "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "license": "MIT", "dependencies": { "async": "^2.4.0" } }, "node_modules/asynckit": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "license": "MIT" }, "node_modules/atomic-sleep": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", - "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.0.0" } }, "node_modules/available-typed-arrays": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -2932,22 +2693,19 @@ }, "node_modules/aws-sign2": { "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "license": "Apache-2.0", "engines": { "node": "*" } }, "node_modules/aws4": { "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" + "license": "MIT" }, "node_modules/babel-code-frame": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^1.1.3", "esutils": "^2.0.2", @@ -2956,27 +2714,24 @@ }, "node_modules/babel-code-frame/node_modules/ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/babel-code-frame/node_modules/ansi-styles": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/babel-code-frame/node_modules/chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", @@ -2990,15 +2745,13 @@ }, "node_modules/babel-code-frame/node_modules/js-tokens": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/babel-code-frame/node_modules/strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^2.0.0" }, @@ -3008,18 +2761,16 @@ }, "node_modules/babel-code-frame/node_modules/supports-color": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } }, "node_modules/babel-polyfill": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", - "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", "dev": true, + "license": "MIT", "dependencies": { "babel-runtime": "^6.26.0", "core-js": "^2.5.0", @@ -3028,9 +2779,8 @@ }, "node_modules/babel-runtime": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, + "license": "MIT", "dependencies": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" @@ -3038,27 +2788,22 @@ }, "node_modules/babel-runtime/node_modules/regenerator-runtime": { "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/balanced-match": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "license": "MIT" }, "node_modules/base32.js": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/base32.js/-/base32.js-0.1.0.tgz", - "integrity": "sha1-tYLexpPC8R6JPPBk7mrFthMaIgI=", + "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/base64-js": { "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "funding": [ { "type": "github", @@ -3072,44 +2817,40 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/base64id": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "dev": true, + "license": "MIT", "engines": { "node": "^4.5.0 || >= 5.9" } }, "node_modules/base64url": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/base64url/-/base64url-3.0.1.tgz", - "integrity": "sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==", + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "license": "BSD-3-Clause", "dependencies": { "tweetnacl": "^0.14.3" } }, "node_modules/bcryptjs": { "version": "2.4.3", - "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", - "integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/benchmark": { "version": "2.1.4", - "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", - "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", "dev": true, + "license": "MIT", "dependencies": { "lodash": "^4.17.4", "platform": "^1.3.3" @@ -3117,17 +2858,16 @@ }, "node_modules/big.js": { "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, "node_modules/bigint-crypto-utils": { - "version": "3.0.23", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.0.23.tgz", - "integrity": "sha512-ecCXGRhpfm6gOMlNymoojOXnASyx8lwk3Z8f76lANPAnR/rgo/OKVMajxN5TbfT/BaEfcBXskpIUiRz8HPDKoQ==", + "version": "3.0.24", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.0.24.tgz", + "integrity": "sha512-TZZ04h0BCfE5kAR5VTiUp+8eWHcclXFCI+4EFL5Y8z0++XJqqUnEjgwzBbVIpMHbSBu3Gjv7VT6msIXJzzSfTg==", "dependencies": { "bigint-mod-arith": "^3.0.1" }, @@ -3145,33 +2885,29 @@ }, "node_modules/bignumber.js": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", - "integrity": "sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==", + "license": "MIT", "engines": { "node": "*" } }, "node_modules/binary-extensions": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/bindings": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", "dependencies": { "file-uri-to-path": "1.0.0" } }, "node_modules/bl": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", - "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", + "license": "MIT", "dependencies": { "readable-stream": "^2.3.5", "safe-buffer": "^5.1.1" @@ -3179,13 +2915,11 @@ }, "node_modules/bl/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "license": "MIT" }, "node_modules/bl/node_modules/readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -3198,67 +2932,57 @@ }, "node_modules/bl/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "license": "MIT" }, "node_modules/bl/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/blakejs": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + "license": "MIT" }, "node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "version": "5.2.0", + "dev": true, + "license": "MIT" }, "node_modules/body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.19.2", + "license": "MIT", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", + "depd": "~1.1.2", + "http-errors": "1.8.1", "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.10.3", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" + "on-finished": "~2.3.0", + "qs": "6.9.7", + "raw-body": "2.4.3", + "type-is": "~1.6.18" }, "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" + "node": ">= 0.8" } }, "node_modules/body-parser/node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/body-parser/node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "license": "MIT" }, "node_modules/brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3266,9 +2990,8 @@ }, "node_modules/braces": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, + "license": "MIT", "dependencies": { "fill-range": "^7.0.1" }, @@ -3278,14 +3001,12 @@ }, "node_modules/brorand": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "license": "MIT" }, "node_modules/browser-pack": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", - "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", "dev": true, + "license": "MIT", "dependencies": { "combine-source-map": "~0.8.0", "defined": "^1.0.0", @@ -3300,24 +3021,21 @@ }, "node_modules/browser-process-hrtime": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", - "dev": true + "dev": true, + "license": "BSD-2-Clause" }, "node_modules/browser-resolve": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", - "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", "dev": true, + "license": "MIT", "dependencies": { "resolve": "^1.17.0" } }, "node_modules/browserify": { "version": "16.5.2", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.5.2.tgz", - "integrity": "sha512-TkOR1cQGdmXU9zW4YukWzWVSJwrxmNdADFbqbE3HFgQWe5wqZmOawqZ7J/8MPCwk/W8yY7Y0h+7mOtcZxLP23g==", "dev": true, + "license": "MIT", "dependencies": { "assert": "^1.4.0", "browser-pack": "^6.0.1", @@ -3377,9 +3095,8 @@ }, "node_modules/browserify-aes": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, + "license": "MIT", "dependencies": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -3391,15 +3108,13 @@ }, "node_modules/browserify-aes/node_modules/buffer-xor": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/browserify-cipher": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", "dev": true, + "license": "MIT", "dependencies": { "browserify-aes": "^1.0.4", "browserify-des": "^1.0.0", @@ -3408,9 +3123,8 @@ }, "node_modules/browserify-des": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", "dev": true, + "license": "MIT", "dependencies": { "cipher-base": "^1.0.1", "des.js": "^1.0.0", @@ -3420,25 +3134,17 @@ }, "node_modules/browserify-rsa": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", "dev": true, + "license": "MIT", "dependencies": { "bn.js": "^5.0.0", "randombytes": "^2.0.1" } }, - "node_modules/browserify-rsa/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", - "dev": true - }, "node_modules/browserify-sign": { "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", "dev": true, + "license": "ISC", "dependencies": { "bn.js": "^5.1.1", "browserify-rsa": "^4.0.1", @@ -3451,32 +3157,23 @@ "safe-buffer": "^5.2.0" } }, - "node_modules/browserify-sign/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", - "dev": true - }, "node_modules/browserify-zlib": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dev": true, + "license": "MIT", "dependencies": { "pako": "~1.0.5" } }, "node_modules/browserify/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/browserify/node_modules/readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -3489,15 +3186,13 @@ }, "node_modules/browserify/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/browserify/node_modules/stream-browserify": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "~2.0.1", "readable-stream": "^2.0.2" @@ -3505,17 +3200,14 @@ }, "node_modules/browserify/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/browserslist": { "version": "4.20.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", - "integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==", "dev": true, "funding": [ { @@ -3527,6 +3219,7 @@ "url": "https://tidelift.com/funding/github/npm/browserslist" } ], + "license": "MIT", "dependencies": { "caniuse-lite": "^1.0.30001317", "electron-to-chromium": "^1.4.84", @@ -3543,9 +3236,8 @@ }, "node_modules/buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", "dev": true, + "license": "MIT", "dependencies": { "base64-js": "^1.0.2", "ieee754": "^1.1.4" @@ -3553,47 +3245,41 @@ }, "node_modules/buffer-equal-constant-time": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/buffer-from": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/buffer-xor": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", - "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", + "license": "MIT", "dependencies": { "safe-buffer": "^5.1.1" } }, "node_modules/builtin-modules": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/builtin-status-codes": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/bunyan": { "version": "1.8.15", - "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.15.tgz", - "integrity": "sha512-0tECWShh6wUysgucJcBAoYegf3JJoZWibxdqhTm7OHPeT42qdjkZ29QCMcKwbgU1kiH+auSIasNRXMLWXafXig==", "dev": true, "engines": [ "node >=0.10.0" ], + "license": "MIT", "bin": { "bunyan": "bin/bunyan" }, @@ -3606,23 +3292,20 @@ }, "node_modules/bytes": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/cached-path-relative": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz", - "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/caching-transform": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, + "license": "MIT", "dependencies": { "hasha": "^5.0.0", "make-dir": "^3.0.0", @@ -3635,9 +3318,8 @@ }, "node_modules/caching-transform/node_modules/make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^6.0.0" }, @@ -3650,8 +3332,7 @@ }, "node_modules/call-bind": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -3662,9 +3343,8 @@ }, "node_modules/caller-path": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "dev": true, + "license": "MIT", "dependencies": { "callsites": "^0.2.0" }, @@ -3674,27 +3354,24 @@ }, "node_modules/caller-path/node_modules/callsites": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/callsites": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/camel-case": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", "dev": true, + "license": "MIT", "dependencies": { "no-case": "^2.2.0", "upper-case": "^1.1.1" @@ -3702,17 +3379,14 @@ }, "node_modules/camelcase": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/caniuse-lite": { - "version": "1.0.30001328", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001328.tgz", - "integrity": "sha512-Ue55jHkR/s4r00FLNiX+hGMMuwml/QGqqzVeMQ5thUewznU2EdULFvI3JR7JJid6OrjJNfFvHY2G2dIjmRaDDQ==", + "version": "1.0.30001319", "dev": true, "funding": [ { @@ -3723,17 +3397,16 @@ "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/caseless": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "license": "Apache-2.0" }, "node_modules/chai": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", - "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", + "license": "MIT", "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", @@ -3749,13 +3422,11 @@ }, "node_modules/chai-checkmark": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/chai-checkmark/-/chai-checkmark-1.0.1.tgz", - "integrity": "sha1-n7s8mtkQHwl+8ogyjTD0In10//s=" + "license": "ISC" }, "node_modules/chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3769,22 +3440,18 @@ }, "node_modules/chardet": { "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/check-error": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "license": "MIT", "engines": { "node": "*" } }, "node_modules/chokidar": { "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "funding": [ { @@ -3792,6 +3459,7 @@ "url": "https://paulmillr.com/funding/" } ], + "license": "MIT", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -3810,24 +3478,20 @@ }, "node_modules/chrome-trace-event": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0" } }, "node_modules/ci-info": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cids": { "version": "1.1.9", - "resolved": "https://registry.npmjs.org/cids/-/cids-1.1.9.tgz", - "integrity": "sha512-l11hWRfugIcbGuTZwAM5PwpjPPjyb6UZOGwlHSnOBV5o07XhQ4gNpBN67FbODvpjyHtd+0Xs6KNvUcGBiDRsdg==", - "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", "dependencies": { "multibase": "^4.0.1", "multicodec": "^3.0.1", @@ -3841,9 +3505,7 @@ }, "node_modules/cids/node_modules/multicodec": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-3.2.1.tgz", - "integrity": "sha512-+expTPftro8VAW8kfvcuNNNBgb9gPeNYV9dn+z1kJRWF2vih+/S79f2RVeIwmrJBUJ6NT9IUPWnZDQvegEh5pw==", - "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", "dependencies": { "uint8arrays": "^3.0.0", "varint": "^6.0.0" @@ -3851,9 +3513,8 @@ }, "node_modules/cipher-base": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -3861,29 +3522,24 @@ }, "node_modules/circular-json": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "deprecated": "CircularJSON is in maintenance only, flatted is its successor.", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/class-is": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", - "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==" + "license": "MIT" }, "node_modules/clean-stack": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/cli-cursor": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, + "license": "MIT", "dependencies": { "restore-cursor": "^3.1.0" }, @@ -3893,17 +3549,15 @@ }, "node_modules/cli-width": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true, + "license": "ISC", "engines": { "node": ">= 10" } }, "node_modules/cliui": { "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -3912,16 +3566,14 @@ }, "node_modules/cliui/node_modules/ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/cliui/node_modules/strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -3931,18 +3583,16 @@ }, "node_modules/clone": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8" } }, "node_modules/clone-deep": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", "dev": true, + "license": "MIT", "dependencies": { "is-plain-object": "^2.0.4", "kind-of": "^6.0.2", @@ -3954,9 +3604,8 @@ }, "node_modules/co": { "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true, + "license": "MIT", "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -3964,17 +3613,15 @@ }, "node_modules/code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/color": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", - "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "license": "MIT", "dependencies": { "color-convert": "^1.9.3", "color-string": "^1.6.0" @@ -3982,8 +3629,7 @@ }, "node_modules/color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -3993,13 +3639,11 @@ }, "node_modules/color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "license": "MIT" }, "node_modules/color-string": { "version": "1.9.0", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.0.tgz", - "integrity": "sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ==", + "license": "MIT", "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" @@ -4007,27 +3651,22 @@ }, "node_modules/color/node_modules/color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", "dependencies": { "color-name": "1.1.3" } }, "node_modules/color/node_modules/color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "license": "MIT" }, "node_modules/colorette": { "version": "2.0.16", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", - "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/colors": { "version": "0.6.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", "dev": true, "engines": { "node": ">=0.1.90" @@ -4035,8 +3674,7 @@ }, "node_modules/colorspace": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", - "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", + "license": "MIT", "dependencies": { "color": "^3.1.3", "text-hex": "1.0.x" @@ -4044,9 +3682,8 @@ }, "node_modules/combine-source-map": { "version": "0.8.0", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", "dev": true, + "license": "MIT", "dependencies": { "convert-source-map": "~1.1.0", "inline-source-map": "~0.6.0", @@ -4056,14 +3693,12 @@ }, "node_modules/combine-source-map/node_modules/convert-source-map": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/combined-stream": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -4073,14 +3708,11 @@ }, "node_modules/command-exists": { "version": "1.2.9", - "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", - "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/commander": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", - "integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E=", "dev": true, "engines": { "node": ">= 0.6.x" @@ -4088,27 +3720,23 @@ }, "node_modules/commondir": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/compare-versions": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/component-emitter": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/compressible": { "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", "dev": true, + "license": "MIT", "dependencies": { "mime-db": ">= 1.43.0 < 2" }, @@ -4118,9 +3746,8 @@ }, "node_modules/compression": { "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", "dev": true, + "license": "MIT", "dependencies": { "accepts": "~1.3.5", "bytes": "3.0.0", @@ -4136,47 +3763,41 @@ }, "node_modules/compression/node_modules/bytes": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/compression/node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/compression/node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/compression/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "license": "MIT" }, "node_modules/concat-stream": { "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "engines": [ "node >= 0.8" ], + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", @@ -4186,15 +3807,13 @@ }, "node_modules/concat-stream/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/concat-stream/node_modules/readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -4207,23 +3826,20 @@ }, "node_modules/concat-stream/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/concat-stream/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/connect": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", - "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "license": "MIT", "dependencies": { "debug": "2.6.9", "finalhandler": "1.1.2", @@ -4236,43 +3852,36 @@ }, "node_modules/connect/node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/connect/node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "license": "MIT" }, "node_modules/console-browserify": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", "dev": true }, "node_modules/constants-browserify": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/contains-path": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/content-disposition": { "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "5.1.2" }, @@ -4282,59 +3891,51 @@ }, "node_modules/content-disposition/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/content-type": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/convert-source-map": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.1" } }, "node_modules/convert-source-map/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cookie": { "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/cookie-signature": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cookiejar": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", - "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cookies": { "version": "0.8.0", - "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz", - "integrity": "sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==", "dev": true, + "license": "MIT", "dependencies": { "depd": "~2.0.0", "keygrip": "~1.1.0" @@ -4343,19 +3944,24 @@ "node": ">= 0.8" } }, + "node_modules/cookies/node_modules/depd": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/core-js": { "version": "2.6.12", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", - "deprecated": "core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.", "dev": true, - "hasInstallScript": true + "hasInstallScript": true, + "license": "MIT" }, "node_modules/core-js-pure": { "version": "3.21.1", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.21.1.tgz", - "integrity": "sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ==", "hasInstallScript": true, + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" @@ -4363,13 +3969,11 @@ }, "node_modules/core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "license": "MIT" }, "node_modules/cors": { "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", "dependencies": { "object-assign": "^4", "vary": "^1" @@ -4380,9 +3984,8 @@ }, "node_modules/cosmiconfig": { "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", @@ -4395,9 +3998,12 @@ } }, "node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "version": "1.2.1", + "license": "Apache-2.0", + "dependencies": { + "exit-on-epipe": "~1.0.1", + "printj": "~1.3.1" + }, "bin": { "crc32": "bin/crc32.njs" }, @@ -4407,19 +4013,22 @@ }, "node_modules/create-ecdh": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", "dev": true, + "license": "MIT", "dependencies": { "bn.js": "^4.1.0", "elliptic": "^6.5.3" } }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "dev": true, + "license": "MIT" + }, "node_modules/create-hash": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, + "license": "MIT", "dependencies": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -4430,9 +4039,8 @@ }, "node_modules/create-hmac": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, + "license": "MIT", "dependencies": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -4444,15 +4052,13 @@ }, "node_modules/create-require": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cross-spawn": { "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, + "license": "MIT", "dependencies": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -4466,18 +4072,16 @@ }, "node_modules/cross-spawn/node_modules/semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver" } }, "node_modules/crypto-browserify": { "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "dev": true, + "license": "MIT", "dependencies": { "browserify-cipher": "^1.0.0", "browserify-sign": "^4.0.0", @@ -4497,15 +4101,13 @@ }, "node_modules/cssom": { "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cssstyle": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", "dev": true, + "license": "MIT", "dependencies": { "cssom": "~0.3.6" }, @@ -4515,21 +4117,18 @@ }, "node_modules/cssstyle/node_modules/cssom": { "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/custom-event": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/d": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", "dev": true, + "license": "ISC", "dependencies": { "es5-ext": "^0.10.50", "type": "^1.0.1" @@ -4537,30 +4136,26 @@ }, "node_modules/d3-array": { "version": "2.12.1", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", - "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "internmap": "^1.0.0" } }, "node_modules/d3-color": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", - "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/d3-dispatch": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", - "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/d3-drag": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-1.2.5.tgz", - "integrity": "sha512-rD1ohlkKQwMZYkQlYVCrSFxsWPzI97+W+PaEIBNTMxRuxz9RF0Hi5nJWHGVJ3Om9d2fRTe1yOBINJyy/ahV95w==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "d3-dispatch": "1", "d3-selection": "1" @@ -4568,15 +4163,13 @@ }, "node_modules/d3-ease": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz", - "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/d3-fg": { "version": "6.14.0", - "resolved": "https://registry.npmjs.org/d3-fg/-/d3-fg-6.14.0.tgz", - "integrity": "sha512-M4QpFZOEvAq4ZDzwabJp2inL+KXS85T2SQl00zWwjnolaCJR+gHxUbT7Ha4GxTeW1NXwzbykhv/38I1fxQqbyg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "d3-array": "^2.2.0", "d3-dispatch": "^1.0.5", @@ -4591,30 +4184,26 @@ }, "node_modules/d3-format": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-2.0.0.tgz", - "integrity": "sha512-Ab3S6XuE/Q+flY96HXT0jOXcM4EAClYFnRGY5zsjRGNy6qCYrQsMffs7cV5Q9xejb35zxW5hf/guKw34kvIKsA==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/d3-hierarchy": { "version": "1.1.9", - "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz", - "integrity": "sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/d3-interpolate": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz", - "integrity": "sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "d3-color": "1 - 2" } }, "node_modules/d3-scale": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", - "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "d3-array": "^2.3.0", "d3-format": "1 - 2", @@ -4625,39 +4214,34 @@ }, "node_modules/d3-selection": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz", - "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/d3-time": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", - "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "d3-array": "2" } }, "node_modules/d3-time-format": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-3.0.0.tgz", - "integrity": "sha512-UXJh6EKsHBTjopVqZBhFysQcoXSv/5yLONZvkQ5Kk3qbwiUYkdX17Xa1PT6U1ZWXGGfB1ey5L8dKMlFq2DO0Ag==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "d3-time": "1 - 2" } }, "node_modules/d3-timer": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", - "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/d3-transition": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.3.2.tgz", - "integrity": "sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "d3-color": "1", "d3-dispatch": "1", @@ -4669,24 +4253,21 @@ }, "node_modules/d3-transition/node_modules/d3-color": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", - "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/d3-transition/node_modules/d3-interpolate": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "d3-color": "1" } }, "node_modules/d3-zoom": { "version": "1.8.3", - "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-1.8.3.tgz", - "integrity": "sha512-VoLXTK4wvy1a0JpH2Il+F2CiOhVu7VRXWF5M/LroMIh3/zBAC3WAt7QoIvPibOavVo20hN6/37vwAsdBejLyKQ==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "d3-dispatch": "1", "d3-drag": "1", @@ -4697,29 +4278,25 @@ }, "node_modules/d3-zoom/node_modules/d3-color": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", - "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/d3-zoom/node_modules/d3-interpolate": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "d3-color": "1" } }, "node_modules/dash-ast": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", - "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/dashdash": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" }, @@ -4729,9 +4306,8 @@ }, "node_modules/data-urls": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", - "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", "dev": true, + "license": "MIT", "dependencies": { "abab": "^2.0.0", "whatwg-mimetype": "^2.2.0", @@ -4740,27 +4316,24 @@ }, "node_modules/data-urls/node_modules/punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/data-urls/node_modules/tr46": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", "dev": true, + "license": "MIT", "dependencies": { "punycode": "^2.1.0" } }, "node_modules/data-urls/node_modules/whatwg-url": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", "dev": true, + "license": "MIT", "dependencies": { "lodash.sortby": "^4.7.0", "tr46": "^1.0.1", @@ -4769,38 +4342,33 @@ }, "node_modules/date-format": { "version": "4.0.6", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.6.tgz", - "integrity": "sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw==", "dev": true, + "license": "MIT", "engines": { "node": ">=4.0" } }, "node_modules/dateformat": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, "node_modules/dayjs": { "version": "1.10.4", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.4.tgz", - "integrity": "sha512-RI/Hh4kqRc1UKLOAf/T5zdMMX5DQIlDxwUe3wSyMMnEbGunnpENCdbUgM+dW7kXidZqCttBrmw7BhN4TMddkCw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/debounce": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", - "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/debug": { "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -4815,31 +4383,27 @@ }, "node_modules/debug-log": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", - "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/debug/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "license": "MIT" }, "node_modules/decamelize": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/deep-eql": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "license": "MIT", "dependencies": { "type-detect": "^4.0.0" }, @@ -4849,9 +4413,8 @@ }, "node_modules/deep-equal": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", "dev": true, + "license": "MIT", "dependencies": { "is-arguments": "^1.0.4", "is-date-object": "^1.0.1", @@ -4866,14 +4429,12 @@ }, "node_modules/deep-is": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/default-gateway": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", - "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", + "license": "BSD-2-Clause", "dependencies": { "execa": "^5.0.0" }, @@ -4883,9 +4444,8 @@ }, "node_modules/default-require-extensions": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", - "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", "dev": true, + "license": "MIT", "dependencies": { "strip-bom": "^4.0.0" }, @@ -4895,17 +4455,15 @@ }, "node_modules/defaults": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", "dev": true, + "license": "MIT", "dependencies": { "clone": "^1.0.2" } }, "node_modules/deferred-leveldown": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", + "license": "MIT", "dependencies": { "abstract-leveldown": "~6.2.1", "inherits": "^2.0.3" @@ -4916,8 +4474,7 @@ }, "node_modules/define-properties": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "license": "MIT", "dependencies": { "object-keys": "^1.0.12" }, @@ -4927,15 +4484,13 @@ }, "node_modules/defined": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/deglob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.1.tgz", - "integrity": "sha512-2kjwuGGonL7gWE1XU4Fv79+vVzpoQCl0V+boMwWtOQJV2AGDabCwez++nB1Nli/8BabAfZQ/UuHPlp6AymKdWw==", "dev": true, + "license": "ISC", "dependencies": { "find-root": "^1.0.0", "glob": "^7.0.5", @@ -4947,14 +4502,12 @@ }, "node_modules/deglob/node_modules/ignore": { "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/delay": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", - "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -4964,25 +4517,22 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "version": "1.1.2", + "license": "MIT", "engines": { - "node": ">= 0.8" + "node": ">= 0.6" } }, "node_modules/deps-sort": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", - "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", "dev": true, + "license": "MIT", "dependencies": { "JSONStream": "^1.0.3", "shasum-object": "^1.0.0", @@ -4995,33 +4545,26 @@ }, "node_modules/des.js": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" } }, "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } + "version": "1.0.4", + "dev": true, + "license": "MIT" }, "node_modules/detect-node": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==" + "license": "MIT" }, "node_modules/detective": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", - "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==", "dev": true, + "license": "MIT", "dependencies": { "acorn-node": "^1.6.1", "defined": "^1.0.0", @@ -5036,9 +4579,8 @@ }, "node_modules/dezalgo": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz", - "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=", "dev": true, + "license": "ISC", "dependencies": { "asap": "^2.0.0", "wrappy": "1" @@ -5046,34 +4588,35 @@ }, "node_modules/di": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", - "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/diff": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, "node_modules/diffie-hellman": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, + "license": "MIT", "dependencies": { "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", "randombytes": "^2.0.0" } }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "dev": true, + "license": "MIT" + }, "node_modules/dir-glob": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, + "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -5083,16 +4626,14 @@ }, "node_modules/dirty-chai": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/dirty-chai/-/dirty-chai-2.0.1.tgz", - "integrity": "sha512-ys79pWKvDMowIDEPC6Fig8d5THiC0DJ2gmTeGzVAoEH18J8OzLud0Jh7I9IWg3NSk8x2UocznUuFmfHCXYZx9w==", + "license": "MIT", "peerDependencies": { "chai": ">=2.2.1 <5" } }, "node_modules/dns-over-http-resolver": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/dns-over-http-resolver/-/dns-over-http-resolver-1.2.3.tgz", - "integrity": "sha512-miDiVSI6KSNbi4SVifzO/reD8rMnxgrlnkrlkugOLQpWQTe2qMdHsZp5DmfKjxNE+/T3VAAYLQUZMv9SMr6+AA==", + "license": "MIT", "dependencies": { "debug": "^4.3.1", "native-fetch": "^3.0.0", @@ -5101,9 +4642,8 @@ }, "node_modules/doctrine": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, + "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, @@ -5113,9 +4653,8 @@ }, "node_modules/dom-serialize": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", - "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", "dev": true, + "license": "MIT", "dependencies": { "custom-event": "~1.0.0", "ent": "~2.2.0", @@ -5125,9 +4664,8 @@ }, "node_modules/domain-browser": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4", "npm": ">=1.2" @@ -5135,24 +4673,21 @@ }, "node_modules/domexception": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", "dev": true, + "license": "MIT", "dependencies": { "webidl-conversions": "^4.0.2" } }, "node_modules/dompurify": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.6.tgz", - "integrity": "sha512-OFP2u/3T1R5CEgWCEONuJ1a5+MFKnOYpkywpUSxv/dj1LeBT1erK+JwM7zK0ROy2BRhqVCf0LRw/kHqKuMkVGg==", - "dev": true + "dev": true, + "license": "(MPL-2.0 OR Apache-2.0)" }, "node_modules/dotignore": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", - "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", "dev": true, + "license": "MIT", "dependencies": { "minimatch": "^3.0.4" }, @@ -5162,10 +4697,9 @@ }, "node_modules/dtrace-provider": { "version": "0.8.8", - "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz", - "integrity": "sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==", "dev": true, "hasInstallScript": true, + "license": "BSD-2-Clause", "optional": true, "dependencies": { "nan": "^2.14.0" @@ -5176,24 +4710,21 @@ }, "node_modules/duplexer2": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "readable-stream": "^2.0.2" } }, "node_modules/duplexer2/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/duplexer2/node_modules/readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -5206,24 +4737,21 @@ }, "node_modules/duplexer2/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/duplexer2/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/duplexify": { "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", "dev": true, + "license": "MIT", "dependencies": { "end-of-stream": "^1.0.0", "inherits": "^2.0.1", @@ -5233,15 +4761,13 @@ }, "node_modules/duplexify/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/duplexify/node_modules/readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -5254,23 +4780,20 @@ }, "node_modules/duplexify/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/duplexify/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/ecc-jsbn": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "license": "MIT", "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -5278,27 +4801,23 @@ }, "node_modules/ecc-jsbn/node_modules/jsbn": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "license": "MIT" }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" } }, "node_modules/ee-first": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + "license": "MIT" }, "node_modules/electron-fetch": { "version": "1.7.4", - "resolved": "https://registry.npmjs.org/electron-fetch/-/electron-fetch-1.7.4.tgz", - "integrity": "sha512-+fBLXEy4CJWQ5bz8dyaeSG1hD6JJ15kBZyj3eh24pIVrd3hLM47H/umffrdQfS6GZ0falF0g9JT9f3Rs6AVUhw==", + "license": "MIT", "dependencies": { "encoding": "^0.1.13" }, @@ -5307,15 +4826,13 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.107", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.107.tgz", - "integrity": "sha512-Huen6taaVrUrSy8o7mGStByba8PfOWWluHNxSHGBrCgEdFVLtvdQDBr9LBCF9Uci8SYxh28QNNMO0oC17wbGAg==", - "dev": true + "version": "1.4.90", + "dev": true, + "license": "ISC" }, "node_modules/elliptic": { "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "license": "MIT", "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -5326,45 +4843,43 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "license": "MIT" + }, "node_modules/emoji-regex": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "license": "MIT" }, "node_modules/emojis-list": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/enabled": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", - "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" + "license": "MIT" }, "node_modules/encodeurl": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/encoding": { "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "license": "MIT", "dependencies": { "iconv-lite": "^0.6.2" } }, "node_modules/encoding-down": { "version": "6.3.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", - "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", + "license": "MIT", "dependencies": { "abstract-leveldown": "^6.2.1", "inherits": "^2.0.3", @@ -5377,8 +4892,7 @@ }, "node_modules/encoding/node_modules/iconv-lite": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -5388,18 +4902,16 @@ }, "node_modules/end-of-stream": { "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, + "license": "MIT", "dependencies": { "once": "^1.4.0" } }, "node_modules/engine.io": { "version": "6.1.3", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.3.tgz", - "integrity": "sha512-rqs60YwkvWTLLnfazqgZqLa/aKo+9cueVfEi/dZ8PyGyaf8TLOxj++4QMIgeG3Gn0AhrWiFXvghsoY9L9h25GA==", "dev": true, + "license": "MIT", "dependencies": { "@types/cookie": "^0.4.1", "@types/cors": "^2.8.12", @@ -5418,9 +4930,8 @@ }, "node_modules/engine.io-parser": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.3.tgz", - "integrity": "sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg==", "dev": true, + "license": "MIT", "dependencies": { "@socket.io/base64-arraybuffer": "~1.0.2" }, @@ -5430,9 +4941,8 @@ }, "node_modules/engine.io/node_modules/ws": { "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -5451,9 +4961,8 @@ }, "node_modules/enhanced-resolve": { "version": "5.9.2", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.9.2.tgz", - "integrity": "sha512-GIm3fQfwLJ8YZx2smuHpBKkXC1yOk+OBEmKckVyL0i/ea8mqDEykK3ld5dgH1QYPNyT/lIllxV2LULnxCHaHkA==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -5464,21 +4973,18 @@ }, "node_modules/ent": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/env-string": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/env-string/-/env-string-1.0.1.tgz", - "integrity": "sha512-/DhCJDf5DSFK32joQiWRpWrT0h7p3hVQfMKxiBb7Nt8C8IF8BYyPtclDnuGGLOoj16d/8udKeiE7JbkotDmorQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/envinfo": { "version": "7.7.4", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.4.tgz", - "integrity": "sha512-TQXTYFVVwwluWSFis6K2XKxgrD22jEv0FTuLCQI+OjH7rn93+iY0fSSFM5lrSxFY+H1+B0/cvvlamr3UsBivdQ==", "dev": true, + "license": "MIT", "bin": { "envinfo": "dist/cli.js" }, @@ -5488,13 +4994,11 @@ }, "node_modules/err-code": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" + "license": "MIT" }, "node_modules/errno": { "version": "0.1.8", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", - "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "license": "MIT", "dependencies": { "prr": "~1.0.1" }, @@ -5504,17 +5008,15 @@ }, "node_modules/error-ex": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, + "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" } }, "node_modules/es-abstract": { - "version": "1.19.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.4.tgz", - "integrity": "sha512-flV8e5g9/xulChMG48Fygk1ptpo4lQRJ0eJYtxJFgi7pklLx7EFcOJ34jnvr8pbWlaFN/AT1cZpe0hiFel9Hqg==", + "version": "1.19.1", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", @@ -5522,15 +5024,15 @@ "get-intrinsic": "^1.1.1", "get-symbol-description": "^1.0.0", "has": "^1.0.3", - "has-symbols": "^1.0.3", + "has-symbols": "^1.0.2", "internal-slot": "^1.0.3", "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.2", + "is-negative-zero": "^2.0.1", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.1", "is-string": "^1.0.7", - "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "is-weakref": "^1.0.1", + "object-inspect": "^1.11.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", @@ -5546,9 +5048,8 @@ }, "node_modules/es-get-iterator": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz", - "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.0", @@ -5565,23 +5066,12 @@ }, "node_modules/es-module-lexer": { "version": "0.9.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", - "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", - "dev": true - }, - "node_modules/es-shim-unscopables": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", "dev": true, - "dependencies": { - "has": "^1.0.3" - } + "license": "MIT" }, "node_modules/es-to-primitive": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "license": "MIT", "dependencies": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -5595,11 +5085,10 @@ } }, "node_modules/es5-ext": { - "version": "0.10.60", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.60.tgz", - "integrity": "sha512-jpKNXIt60htYG59/9FGf2PYT3pwMpnEbNKysU+k/4FGwyGtMotOvcZOuW+EmXXYASRqYSXQfGL5cVIthOTgbkg==", + "version": "0.10.59", "dev": true, "hasInstallScript": true, + "license": "ISC", "dependencies": { "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.3", @@ -5611,15 +5100,13 @@ }, "node_modules/es6-error": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/es6-iterator": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "dev": true, + "license": "MIT", "dependencies": { "d": "1", "es5-ext": "^0.10.35", @@ -5628,9 +5115,8 @@ }, "node_modules/es6-map": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", - "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", "dev": true, + "license": "MIT", "dependencies": { "d": "1", "es5-ext": "~0.10.14", @@ -5642,28 +5128,24 @@ }, "node_modules/es6-object-assign": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", - "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/es6-promise": { "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + "license": "MIT" }, "node_modules/es6-promisify": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "license": "MIT", "dependencies": { "es6-promise": "^4.0.3" } }, "node_modules/es6-set": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", - "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", "dev": true, + "license": "MIT", "dependencies": { "d": "1", "es5-ext": "~0.10.14", @@ -5674,9 +5156,8 @@ }, "node_modules/es6-set/node_modules/es6-symbol": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", "dev": true, + "license": "MIT", "dependencies": { "d": "1", "es5-ext": "~0.10.14" @@ -5684,9 +5165,8 @@ }, "node_modules/es6-symbol": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", "dev": true, + "license": "ISC", "dependencies": { "d": "^1.0.1", "ext": "^1.1.2" @@ -5694,9 +5174,8 @@ }, "node_modules/es6-weak-map": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", "dev": true, + "license": "ISC", "dependencies": { "d": "1", "es5-ext": "^0.10.46", @@ -5706,31 +5185,27 @@ }, "node_modules/escalade": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/escape-html": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + "license": "MIT" }, "node_modules/escape-string-regexp": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } }, "node_modules/escodegen": { "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esprima": "^4.0.1", "estraverse": "^4.2.0", @@ -5750,9 +5225,8 @@ }, "node_modules/escodegen/node_modules/source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "optional": true, "engines": { "node": ">=0.10.0" @@ -5760,9 +5234,8 @@ }, "node_modules/escope": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "es6-map": "^0.1.3", "es6-weak-map": "^2.0.1", @@ -5775,9 +5248,8 @@ }, "node_modules/eslint": { "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", "ajv": "^6.10.0", @@ -5829,9 +5301,8 @@ }, "node_modules/eslint-config-prettier": { "version": "6.15.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz", - "integrity": "sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==", "dev": true, + "license": "MIT", "dependencies": { "get-stdin": "^6.0.0" }, @@ -5844,9 +5315,8 @@ }, "node_modules/eslint-config-typestrict": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/eslint-config-typestrict/-/eslint-config-typestrict-1.0.2.tgz", - "integrity": "sha512-P9gOX90JFMlwoFd9SAebfHasJxkNyTAsoOiZHwd1sQz3EhGGUes/KrR/p7XieAPjoZGEypxkayKhlql2CHYgfw==", "dev": true, + "license": "MIT", "peerDependencies": { "@typescript-eslint/eslint-plugin": "^4.6.1", "eslint-plugin-sonarjs": "^0.5.0" @@ -5854,9 +5324,8 @@ }, "node_modules/eslint-import-resolver-node": { "version": "0.2.3", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz", - "integrity": "sha1-Wt2BBujJKNssuiMrzZ76hG49oWw=", "dev": true, + "license": "MIT", "dependencies": { "debug": "^2.2.0", "object-assign": "^4.0.1", @@ -5865,24 +5334,21 @@ }, "node_modules/eslint-import-resolver-node/node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/eslint-import-resolver-node/node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/eslint-module-utils": { "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.2.7", "find-up": "^2.1.0" @@ -5893,18 +5359,16 @@ }, "node_modules/eslint-module-utils/node_modules/debug": { "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-module-utils/node_modules/find-up": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^2.0.0" }, @@ -5914,9 +5378,8 @@ }, "node_modules/eslint-module-utils/node_modules/locate-path": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" @@ -5927,15 +5390,13 @@ }, "node_modules/eslint-module-utils/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/eslint-module-utils/node_modules/p-limit": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, + "license": "MIT", "dependencies": { "p-try": "^1.0.0" }, @@ -5945,9 +5406,8 @@ }, "node_modules/eslint-module-utils/node_modules/p-locate": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^1.1.0" }, @@ -5957,27 +5417,24 @@ }, "node_modules/eslint-module-utils/node_modules/p-try": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/eslint-module-utils/node_modules/path-exists": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/eslint-plugin-implicit-dependencies": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-implicit-dependencies/-/eslint-plugin-implicit-dependencies-1.1.1.tgz", - "integrity": "sha512-/EbKwaWTASieQR+hWeSIYaNRUCwIn/wAuPNFsiZZTMKYLXegVJyHvepDnJIIpfYWpqtYcrukNLQDit1yfmGD/A==", "dev": true, + "license": "MIT", "dependencies": { "builtin-modules": "^1.1.1", "findup": "^0.1.5" @@ -5985,9 +5442,8 @@ }, "node_modules/eslint-plugin-node": { "version": "4.2.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-4.2.3.tgz", - "integrity": "sha512-vIUQPuwbVYdz/CYnlTLsJrRy7iXHQjdEe5wz0XhhdTym3IInM/zZLlPf9nZ2mThsH0QcsieCOWs2vOeCy/22LQ==", "dev": true, + "license": "MIT", "dependencies": { "ignore": "^3.0.11", "minimatch": "^3.0.2", @@ -6004,24 +5460,21 @@ }, "node_modules/eslint-plugin-node/node_modules/ignore": { "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/eslint-plugin-node/node_modules/semver": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver" } }, "node_modules/eslint-plugin-prettier": { "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz", - "integrity": "sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g==", "dev": true, + "license": "MIT", "dependencies": { "prettier-linter-helpers": "^1.0.0" }, @@ -6040,18 +5493,16 @@ }, "node_modules/eslint-plugin-promise": { "version": "3.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz", - "integrity": "sha1-ePu2/+BHIBYnVp6FpsU3OvKmj8o=", "dev": true, + "license": "ISC", "engines": { "node": ">=4" } }, "node_modules/eslint-plugin-sonarjs": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.5.0.tgz", - "integrity": "sha512-XW5MnzlRjhXpIdbULC/qAdJYHWw3rRLws/DyawdlPU/IdVr9AmRK1r2LaCvabwKOAW2XYYSo3kDX58E4MrB7PQ==", "dev": true, + "license": "LGPL-3.0", "engines": { "node": ">=6" }, @@ -6061,18 +5512,16 @@ }, "node_modules/eslint-plugin-standard": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz", - "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", "dev": true, + "license": "MIT", "peerDependencies": { "eslint": ">=3.19.0" } }, "node_modules/eslint-scope": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -6083,9 +5532,8 @@ }, "node_modules/eslint-utils": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, + "license": "MIT", "dependencies": { "eslint-visitor-keys": "^2.0.0" }, @@ -6101,18 +5549,16 @@ }, "node_modules/eslint-visitor-keys": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=10" } }, "node_modules/eslint/node_modules/ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -6122,9 +5568,8 @@ }, "node_modules/eslint/node_modules/chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -6136,24 +5581,21 @@ }, "node_modules/eslint/node_modules/color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "1.1.3" } }, "node_modules/eslint/node_modules/color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/eslint/node_modules/eslint-utils": { "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", "dev": true, + "license": "MIT", "dependencies": { "eslint-visitor-keys": "^1.1.0" }, @@ -6163,18 +5605,16 @@ }, "node_modules/eslint/node_modules/eslint-visitor-keys": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=4" } }, "node_modules/eslint/node_modules/globals": { "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.8.1" }, @@ -6187,36 +5627,32 @@ }, "node_modules/eslint/node_modules/has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/eslint/node_modules/ignore": { "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/eslint/node_modules/regexpp": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.5.0" } }, "node_modules/eslint/node_modules/supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -6226,18 +5662,16 @@ }, "node_modules/eslint/node_modules/type-fest": { "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=8" } }, "node_modules/espree": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "acorn": "^7.1.1", "acorn-jsx": "^5.2.0", @@ -6249,18 +5683,16 @@ }, "node_modules/espree/node_modules/eslint-visitor-keys": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=4" } }, "node_modules/esprima": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, + "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -6271,9 +5703,8 @@ }, "node_modules/esquery": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -6283,18 +5714,16 @@ }, "node_modules/esquery/node_modules/estraverse": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } }, "node_modules/esrecurse": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -6304,42 +5733,37 @@ }, "node_modules/esrecurse/node_modules/estraverse": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } }, "node_modules/estraverse": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } }, "node_modules/estree-is-member-expression": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/estree-is-member-expression/-/estree-is-member-expression-1.0.0.tgz", - "integrity": "sha512-Ec+X44CapIGExvSZN+pGkmr5p7HwUVQoPQSd458Lqwvaf4/61k/invHSh4BYK8OXnCkfEhWuIoG5hayKLQStIg==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/esutils": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/etag": { "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -6361,9 +5785,8 @@ }, "node_modules/event-emitter": { "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", "dev": true, + "license": "MIT", "dependencies": { "d": "1", "es5-ext": "~0.10.14" @@ -6371,36 +5794,31 @@ }, "node_modules/event-iterator": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/event-iterator/-/event-iterator-2.0.0.tgz", - "integrity": "sha512-KGft0ldl31BZVV//jj+IAIGCxkvvUkkON+ScH6zfoX+l+omX6001ggyRSpI0Io2Hlro0ThXotswCtfzS8UkIiQ==" + "license": "MIT" }, "node_modules/event-target-shim": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/eventemitter3": { "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + "license": "MIT" }, "node_modules/events": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz", - "integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.x" } }, "node_modules/evp_bytestokey": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, + "license": "MIT", "dependencies": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" @@ -6408,8 +5826,7 @@ }, "node_modules/execa": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -6430,8 +5847,7 @@ }, "node_modules/execa/node_modules/cross-spawn": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -6443,16 +5859,14 @@ }, "node_modules/execa/node_modules/path-key": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/execa/node_modules/shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -6462,16 +5876,14 @@ }, "node_modules/execa/node_modules/shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/execa/node_modules/which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -6484,27 +5896,31 @@ }, "node_modules/execspawn": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/execspawn/-/execspawn-1.0.1.tgz", - "integrity": "sha1-gob53efOzeeQX73ATiTzaPI/jaY=", "dev": true, + "license": "MIT", "dependencies": { "util-extend": "^1.0.1" } }, "node_modules/exit-hook": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/exit-on-epipe": { + "version": "1.0.1", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, "node_modules/express": { "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", "dev": true, + "license": "MIT", "dependencies": { "accepts": "~1.3.7", "array-flatten": "1.1.1", @@ -6543,9 +5959,8 @@ }, "node_modules/express/node_modules/body-parser": { "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "dev": true, + "license": "MIT", "dependencies": { "bytes": "3.1.0", "content-type": "~1.0.4", @@ -6564,45 +5979,32 @@ }, "node_modules/express/node_modules/bytes": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/express/node_modules/cookie": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/express/node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } }, - "node_modules/express/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/express/node_modules/http-errors": { "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "dev": true, + "license": "MIT", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.3", @@ -6616,42 +6018,26 @@ }, "node_modules/express/node_modules/inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/express/node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/express/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", "dev": true, - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } + "license": "MIT" }, "node_modules/express/node_modules/qs": { "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.6" } }, "node_modules/express/node_modules/raw-body": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", "dev": true, + "license": "MIT", "dependencies": { "bytes": "3.1.0", "http-errors": "1.7.2", @@ -6664,50 +6050,43 @@ }, "node_modules/express/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/express/node_modules/setprototypeof": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/express/node_modules/toidentifier": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.6" } }, "node_modules/ext": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", - "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", "dev": true, + "license": "ISC", "dependencies": { "type": "^2.5.0" } }, "node_modules/ext/node_modules/type": { "version": "2.6.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz", - "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/extend": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "license": "MIT" }, "node_modules/external-editor": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, + "license": "MIT", "dependencies": { "chardet": "^0.7.0", "iconv-lite": "^0.4.24", @@ -6719,41 +6098,34 @@ }, "node_modules/extsprintf": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", "engines": [ "node >=0.6.0" - ] + ], + "license": "MIT" }, "node_modules/eyes": { "version": "0.1.8", - "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", "engines": { "node": "> 0.1.90" } }, "node_modules/fast-deep-equal": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "license": "MIT" }, "node_modules/fast-diff": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/fast-fifo": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.1.0.tgz", - "integrity": "sha512-Kl29QoNbNvn4nhDsLYjyIAaIqaJB6rBx5p3sL9VjaefJ+eMFBWVZiaoguaoZfzEKr5RhAti0UgM8703akGPJ6g==" + "license": "MIT" }, "node_modules/fast-glob": { "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -6767,61 +6139,52 @@ }, "node_modules/fast-json-parse": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/fast-json-parse/-/fast-json-parse-1.0.3.tgz", - "integrity": "sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-redact": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-2.1.0.tgz", - "integrity": "sha512-0LkHpTLyadJavq9sRzzyqIoMZemWli77K2/MGOkafrR64B9ItrvZ9aT+jluvNDsv0YEHjSNhlMBtbokuoqii4A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/fast-safe-stringify": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fastest-levenshtein": { "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", - "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fastq": { "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } }, "node_modules/fecha": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.2.tgz", - "integrity": "sha512-5rOQWkBVz3FnYWTi/ELZmq4CoK1Pb+xKNZWuJRsOwo0+8DrP43CrWJtyLVvb5U7z7ggE5llahfDbLjaVNzXVJQ==" + "version": "4.2.1", + "license": "MIT" }, "node_modules/figures": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, + "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -6834,9 +6197,8 @@ }, "node_modules/file-entry-cache": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, + "license": "MIT", "dependencies": { "flat-cache": "^2.0.1" }, @@ -6846,9 +6208,8 @@ }, "node_modules/file-replace-loader": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/file-replace-loader/-/file-replace-loader-1.4.0.tgz", - "integrity": "sha512-qXbFaCuUHXNRWo2elkioNDnGAXHM/hy9brlhjRGiEwo47VxtP4fGFyxF0p6yWK3xS94FLphO/oDB7lGymWIt1w==", "dev": true, + "license": "MIT", "dependencies": { "loader-utils": "^2.0.0", "schema-utils": "^2.7.1" @@ -6856,22 +6217,19 @@ }, "node_modules/file-stream-rotator": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/file-stream-rotator/-/file-stream-rotator-0.6.1.tgz", - "integrity": "sha512-u+dBid4PvZw17PmDeRcNOtCP9CCK/9lRN2w+r1xIS7yOL9JFrIBKTvrYsxT4P0pGtThYTn++QS5ChHaUov3+zQ==", + "license": "MIT", "dependencies": { "moment": "^2.29.1" } }, "node_modules/file-uri-to-path": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + "license": "MIT" }, "node_modules/fill-range": { "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -6881,8 +6239,7 @@ }, "node_modules/finalhandler": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "license": "MIT", "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -6898,33 +6255,19 @@ }, "node_modules/finalhandler/node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/finalhandler/node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/finalhandler/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } + "license": "MIT" }, "node_modules/find-cache-dir": { "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, + "license": "MIT", "dependencies": { "commondir": "^1.0.1", "make-dir": "^3.0.2", @@ -6939,9 +6282,8 @@ }, "node_modules/find-cache-dir/node_modules/make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^6.0.0" }, @@ -6954,9 +6296,8 @@ }, "node_modules/find-cache-dir/node_modules/pkg-dir": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, + "license": "MIT", "dependencies": { "find-up": "^4.0.0" }, @@ -6966,15 +6307,13 @@ }, "node_modules/find-root": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/find-up": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -6985,9 +6324,8 @@ }, "node_modules/find-versions": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", "dev": true, + "license": "MIT", "dependencies": { "semver-regex": "^3.1.2" }, @@ -7000,8 +6338,6 @@ }, "node_modules/findup": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/findup/-/findup-0.1.5.tgz", - "integrity": "sha1-itkpozk7rGJ5V6fl3kYjsGsOLOs=", "dev": true, "dependencies": { "colors": "~0.6.0-1", @@ -7016,9 +6352,8 @@ }, "node_modules/flat-cache": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, + "license": "MIT", "dependencies": { "flatted": "^2.0.0", "rimraf": "2.6.3", @@ -7030,25 +6365,20 @@ }, "node_modules/flatstr": { "version": "1.0.12", - "resolved": "https://registry.npmjs.org/flatstr/-/flatstr-1.0.12.tgz", - "integrity": "sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/flatted": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/fn.name": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", - "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" + "license": "MIT" }, "node_modules/follow-redirects": { "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", "dev": true, "funding": [ { @@ -7056,6 +6386,7 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -7067,23 +6398,20 @@ }, "node_modules/for-each": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, + "license": "MIT", "dependencies": { "is-callable": "^1.1.3" } }, "node_modules/foreach": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" + "license": "MIT" }, "node_modules/foreground-child": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", "dev": true, + "license": "ISC", "dependencies": { "cross-spawn": "^7.0.0", "signal-exit": "^3.0.2" @@ -7094,9 +6422,8 @@ }, "node_modules/foreground-child/node_modules/cross-spawn": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -7108,18 +6435,16 @@ }, "node_modules/foreground-child/node_modules/path-key": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/foreground-child/node_modules/shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -7129,18 +6454,16 @@ }, "node_modules/foreground-child/node_modules/shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/foreground-child/node_modules/which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -7153,16 +6476,14 @@ }, "node_modules/forever-agent": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "license": "Apache-2.0", "engines": { "node": "*" } }, "node_modules/form-data": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -7174,9 +6495,8 @@ }, "node_modules/formidable": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.0.1.tgz", - "integrity": "sha512-rjTMNbp2BpfQShhFbR3Ruk3qk2y9jKpvMW78nJgx8QKtxjDVrwbZG+wvDOmVbifHyOUOQJXxqEy6r0faRrPzTQ==", "dev": true, + "license": "MIT", "dependencies": { "dezalgo": "1.0.3", "hexoid": "1.0.0", @@ -7189,9 +6509,8 @@ }, "node_modules/formidable/node_modules/qs": { "version": "6.9.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.3.tgz", - "integrity": "sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.6" }, @@ -7201,26 +6520,22 @@ }, "node_modules/forwarded": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/fresh": { "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/fromentries": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", - "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", "dev": true, "funding": [ { @@ -7235,12 +6550,12 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/fs-extra": { "version": "10.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", - "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -7252,16 +6567,13 @@ }, "node_modules/fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/fsevents": { "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -7272,67 +6584,58 @@ }, "node_modules/function-bind": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "license": "MIT" }, "node_modules/functional-red-black-tree": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + "license": "MIT" }, "node_modules/generate-function": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", - "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", "dev": true, + "license": "MIT", "dependencies": { "is-property": "^1.0.2" } }, "node_modules/generate-object-property": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", "dev": true, + "license": "MIT", "dependencies": { "is-property": "^1.0.0" } }, "node_modules/gensync": { "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/get-assigned-identifiers": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", - "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/get-caller-file": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-func-name": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "license": "MIT", "engines": { "node": "*" } }, "node_modules/get-intrinsic": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -7344,31 +6647,27 @@ }, "node_modules/get-iterator": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-1.0.2.tgz", - "integrity": "sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==" + "license": "MIT" }, "node_modules/get-package-type": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.0.0" } }, "node_modules/get-stdin": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/get-stream": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -7378,8 +6677,7 @@ }, "node_modules/get-symbol-description": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -7393,17 +6691,15 @@ }, "node_modules/getpass": { "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" } }, "node_modules/glob": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -7421,9 +6717,8 @@ }, "node_modules/glob-parent": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -7433,24 +6728,21 @@ }, "node_modules/glob-to-regexp": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true + "dev": true, + "license": "BSD-2-Clause" }, "node_modules/globals": { "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/globby": { "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -7467,15 +6759,13 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + "version": "4.2.9", + "license": "ISC" }, "node_modules/handlebars": { "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.0", @@ -7494,26 +6784,22 @@ }, "node_modules/handlebars/node_modules/source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/har-schema": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "license": "ISC", "engines": { "node": ">=4" } }, "node_modules/har-validator": { "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", + "license": "MIT", "dependencies": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -7524,8 +6810,7 @@ }, "node_modules/has": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.1" }, @@ -7535,9 +6820,8 @@ }, "node_modules/has-ansi": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^2.0.0" }, @@ -7547,26 +6831,23 @@ }, "node_modules/has-ansi/node_modules/ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/has-bigints": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-dynamic-import": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz", - "integrity": "sha512-X3fbtsZmwb6W7fJGR9o7x65fZoodygCrZ3TVycvghP62yYQfS0t4RS0Qcz+j5tQYUKeSWS09tHkWW6WhFV3XhQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -7577,16 +6858,14 @@ }, "node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/has-symbols": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7596,8 +6875,7 @@ }, "node_modules/has-tostringtag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" }, @@ -7610,15 +6888,13 @@ }, "node_modules/has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/hash-base": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "^2.0.4", "readable-stream": "^3.6.0", @@ -7630,8 +6906,7 @@ }, "node_modules/hash.js": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -7639,9 +6914,8 @@ }, "node_modules/hasha": { "version": "5.2.2", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", - "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, + "license": "MIT", "dependencies": { "is-stream": "^2.0.0", "type-fest": "^0.8.0" @@ -7655,41 +6929,35 @@ }, "node_modules/hasha/node_modules/type-fest": { "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=8" } }, "node_modules/hashlru": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/hashlru/-/hashlru-2.3.0.tgz", - "integrity": "sha512-0cMsjjIC8I+D3M44pOQdsy0OHXGLVz6Z0beRuufhKa0KfaD2wGwAev6jILzXsd3/vpnNQJmWyZtIILqM1N+n5A==" + "license": "MIT" }, "node_modules/heap": { "version": "0.2.7", - "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz", - "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==" + "license": "MIT" }, "node_modules/hexoid": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", - "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/hi-base32": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/hi-base32/-/hi-base32-0.5.1.tgz", - "integrity": "sha512-EmBBpvdYh/4XxsnUybsPag6VikPYnN30td+vQk+GI3qpahVEG9+gTkG0aXVxTjBqQ5T6ijbWIu77O+C5WFWsnA==" + "license": "MIT" }, "node_modules/hmac-drbg": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "license": "MIT", "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -7698,62 +6966,48 @@ }, "node_modules/hsl-to-rgb-for-reals": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/hsl-to-rgb-for-reals/-/hsl-to-rgb-for-reals-1.1.1.tgz", - "integrity": "sha512-LgOWAkrN0rFaQpfdWBQlv/VhkOxb5AsBjk6NQVx4yEzWS923T07X0M1Y0VNko2H52HeSpZrZNNMJ0aFqsdVzQg==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/html-encoding-sniffer": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", "dev": true, + "license": "MIT", "dependencies": { "whatwg-encoding": "^1.0.1" } }, "node_modules/html-escaper": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/htmlescape": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10" } }, "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "version": "1.8.1", + "license": "MIT", "dependencies": { - "depd": "2.0.0", + "depd": "~1.1.2", "inherits": "2.0.4", "setprototypeof": "1.2.0", - "statuses": "2.0.1", + "statuses": ">= 1.5.0 < 2", "toidentifier": "1.0.1" }, "engines": { - "node": ">= 0.8" - } - }, - "node_modules/http-errors/node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" + "node": ">= 0.6" } }, "node_modules/http-proxy": { "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, + "license": "MIT", "dependencies": { "eventemitter3": "^4.0.0", "follow-redirects": "^1.0.0", @@ -7765,8 +7019,7 @@ }, "node_modules/http-signature": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -7779,30 +7032,26 @@ }, "node_modules/http-status-codes": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-1.4.0.tgz", - "integrity": "sha512-JrT3ua+WgH8zBD3HEJYbeEgnuQaAnUeRRko/YojPAJjGmIfGD3KPU/asLdsLwKjfxOmQe5nXMQ0pt/7MyapVbQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/https-browserify": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/human-signals": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "license": "Apache-2.0", "engines": { "node": ">=10.17.0" } }, "node_modules/husky": { "version": "4.3.8", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz", - "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", "dev": true, "hasInstallScript": true, + "license": "MIT", "dependencies": { "chalk": "^4.0.0", "ci-info": "^2.0.0", @@ -7829,23 +7078,20 @@ }, "node_modules/hyperscript-attribute-to-property": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/hyperscript-attribute-to-property/-/hyperscript-attribute-to-property-1.0.2.tgz", - "integrity": "sha512-oerMul16jZCmrbNsUw8QgrtDzF8lKgFri1bKQjReLw1IhiiNkI59CWuzZjJDGT79UQ1YiWqXhJMv/tRMVqgtkA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/hyperx": { "version": "2.5.4", - "resolved": "https://registry.npmjs.org/hyperx/-/hyperx-2.5.4.tgz", - "integrity": "sha512-iOkSh7Yse7lsN/B9y7OsevLWjeXPqGuHQ5SbwaiJM5xAhWFqhoN6erpK1dQsS12OFU36lyai1pnx1mmzWLQqcA==", "dev": true, + "license": "BSD", "dependencies": { "hyperscript-attribute-to-property": "^1.0.0" } }, "node_modules/iconv-lite": { "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -7855,8 +7101,6 @@ }, "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", @@ -7870,27 +7114,25 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "BSD-3-Clause" }, "node_modules/ignore": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/immediate": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", - "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" + "license": "MIT" }, "node_modules/import-fresh": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -7904,9 +7146,8 @@ }, "node_modules/import-local": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", "dev": true, + "license": "MIT", "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" @@ -7923,9 +7164,8 @@ }, "node_modules/import-local/node_modules/pkg-dir": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, + "license": "MIT", "dependencies": { "find-up": "^4.0.0" }, @@ -7935,26 +7175,23 @@ }, "node_modules/imurmurhash": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.19" } }, "node_modules/indent-string": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -7962,23 +7199,20 @@ }, "node_modules/inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "license": "ISC" }, "node_modules/inline-source-map": { "version": "0.6.2", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", "dev": true, + "license": "MIT", "dependencies": { "source-map": "~0.5.3" } }, "node_modules/inquirer": { "version": "7.3.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-escapes": "^4.2.1", "chalk": "^4.1.0", @@ -8000,18 +7234,16 @@ }, "node_modules/inquirer/node_modules/ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/inquirer/node_modules/strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -8021,9 +7253,8 @@ }, "node_modules/insert-module-globals": { "version": "7.2.1", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", - "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", "dev": true, + "license": "MIT", "dependencies": { "acorn-node": "^1.5.2", "combine-source-map": "^0.8.0", @@ -8042,8 +7273,7 @@ }, "node_modules/interface-datastore": { "version": "3.0.6", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-3.0.6.tgz", - "integrity": "sha512-ruF9CVmtKCNfzCZYW6YeEKDRDbgFaiKGrSWof19BVCv6Qx/WrL1jRV4sCQUHCaXwJI7FCFknhw++PGafWCXvfw==", + "license": "MIT", "dependencies": { "err-code": "^3.0.1", "ipfs-utils": "^6.0.0", @@ -8055,13 +7285,11 @@ }, "node_modules/interface-datastore/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/internal-slot": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.0", "has": "^1.0.3", @@ -8073,28 +7301,24 @@ }, "node_modules/internmap": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", - "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/interpret": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.10" } }, "node_modules/ip": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" + "license": "MIT" }, "node_modules/ip-address": { "version": "6.4.0", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-6.4.0.tgz", - "integrity": "sha512-c5uxc2WUTuRBVHT/6r4m7HIr/DfV0bF6DvLH3iZGSK8wp8iMwwZSgIq2do0asFf8q9ECug0SE+6+1ACMe4sorA==", + "license": "MIT", "dependencies": { "jsbn": "1.1.0", "lodash.find": "4.6.0", @@ -8110,29 +7334,25 @@ }, "node_modules/ip-address/node_modules/sprintf-js": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" + "license": "BSD-3-Clause" }, "node_modules/ip-regex": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", - "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/ipaddr.js": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", - "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==", + "license": "MIT", "engines": { "node": ">= 10" } }, "node_modules/ipfs-utils": { "version": "6.0.8", - "resolved": "https://registry.npmjs.org/ipfs-utils/-/ipfs-utils-6.0.8.tgz", - "integrity": "sha512-mDDQaDisI/uWk+X08wyw+jBcq76IXwMjgyaoyEgJDb/Izb+QbBCSJjo9q+EvbMxh6/l6q0NiAfbbsxEyQYPW9w==", + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "any-signal": "^2.1.0", @@ -8153,8 +7373,6 @@ }, "node_modules/ipfs-utils/node_modules/buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -8169,6 +7387,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -8176,13 +7395,11 @@ }, "node_modules/ipfs-utils/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/is-arguments": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -8196,14 +7413,12 @@ }, "node_modules/is-arrayish": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-bigint": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "license": "MIT", "dependencies": { "has-bigints": "^1.0.1" }, @@ -8213,9 +7428,8 @@ }, "node_modules/is-binary-path": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, + "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -8225,14 +7439,12 @@ }, "node_modules/is-boolean-attribute": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/is-boolean-attribute/-/is-boolean-attribute-0.0.1.tgz", - "integrity": "sha1-JKtZt9y52jYSx3PmDGVlZeWgmAw=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-boolean-object": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -8246,14 +7458,12 @@ }, "node_modules/is-buffer": { "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-callable": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -8263,9 +7473,8 @@ }, "node_modules/is-core-module": { "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", "dev": true, + "license": "MIT", "dependencies": { "has": "^1.0.3" }, @@ -8275,8 +7484,7 @@ }, "node_modules/is-date-object": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -8289,9 +7497,8 @@ }, "node_modules/is-docker": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, + "license": "MIT", "bin": { "is-docker": "cli.js" }, @@ -8304,38 +7511,33 @@ }, "node_modules/is-electron": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.1.tgz", - "integrity": "sha512-r8EEQQsqT+Gn0aXFx7lTFygYQhILLCB+wn0WCDL5LZRINeLH/Rvw1j2oKodELLXYNImQ3CRlVsY8wW4cGOsyuw==" + "license": "MIT" }, "node_modules/is-extglob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-fn": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fn/-/is-fn-1.0.0.tgz", - "integrity": "sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw=", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/is-generator-function": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -8348,9 +7550,8 @@ }, "node_modules/is-glob": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -8360,8 +7561,7 @@ }, "node_modules/is-ip": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-3.1.0.tgz", - "integrity": "sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==", + "license": "MIT", "dependencies": { "ip-regex": "^4.0.0" }, @@ -8371,29 +7571,25 @@ }, "node_modules/is-loopback-addr": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-1.0.1.tgz", - "integrity": "sha512-DhWU/kqY7X2F6KrrVTu7mHlbd2Pbo4D1YkAzasBMjQs6lJAoefxaA6m6CpSX0K6pjt9D0b9PNFI5zduy/vzOYw==" + "license": "MIT" }, "node_modules/is-map": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-my-ip-valid": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.1.tgz", - "integrity": "sha512-jxc8cBcOWbNK2i2aTkCZP6i7wkHF1bqKFrwEHuN5Jtg5BSaZHUZQ/JTOJwoV41YvHnOaRyWWh72T/KvfNz9DJg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-my-json-valid": { "version": "2.20.6", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.6.tgz", - "integrity": "sha512-1JQwulVNjx8UqkPE/bqDaxtH4PXCe/2VRh/y3p99heOV87HG4Id5/VfDswd+YiAfHcRTfDlWgISycnHuhZq1aw==", "dev": true, + "license": "MIT", "dependencies": { "generate-function": "^2.0.0", "generate-object-property": "^1.1.0", @@ -8404,9 +7600,8 @@ }, "node_modules/is-nan": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", - "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" @@ -8420,8 +7615,7 @@ }, "node_modules/is-negative-zero": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -8431,17 +7625,15 @@ }, "node_modules/is-number": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "version": "1.0.6", + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -8454,17 +7646,15 @@ }, "node_modules/is-plain-obj": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/is-plain-object": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, + "license": "MIT", "dependencies": { "isobject": "^3.0.1" }, @@ -8474,14 +7664,12 @@ }, "node_modules/is-property": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-regex": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -8495,43 +7683,35 @@ }, "node_modules/is-regexp": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", - "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-resolvable": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/is-set": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", - "dependencies": { - "call-bind": "^1.0.2" - }, + "version": "1.0.1", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-stream": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", "engines": { "node": ">=8" }, @@ -8541,8 +7721,7 @@ }, "node_modules/is-string": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -8555,8 +7734,7 @@ }, "node_modules/is-symbol": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" }, @@ -8569,8 +7747,7 @@ }, "node_modules/is-typed-array": { "version": "1.1.8", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.8.tgz", - "integrity": "sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA==", + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -8587,22 +7764,19 @@ }, "node_modules/is-typedarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "license": "MIT" }, "node_modules/is-weakmap": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-weakref": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2" }, @@ -8612,9 +7786,8 @@ }, "node_modules/is-weakset": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", - "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -8625,18 +7798,16 @@ }, "node_modules/is-windows": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-wsl": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, + "license": "MIT", "dependencies": { "is-docker": "^2.0.0" }, @@ -8646,15 +7817,13 @@ }, "node_modules/isarray": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/isbinaryfile": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", - "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", + "version": "4.0.8", "dev": true, + "license": "MIT", "engines": { "node": ">= 8.0.0" }, @@ -8664,13 +7833,11 @@ }, "node_modules/isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "license": "ISC" }, "node_modules/iso-random-stream": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/iso-random-stream/-/iso-random-stream-2.0.2.tgz", - "integrity": "sha512-yJvs+Nnelic1L2vH2JzWvvPQFA4r7kSTnpST/+LkAQjSz0hos2oqLD+qIVi9Qk38Hoe7mNDt3j0S27R58MVjLQ==", + "license": "MIT", "dependencies": { "events": "^3.3.0", "readable-stream": "^3.4.0" @@ -8681,56 +7848,49 @@ }, "node_modules/iso-random-stream/node_modules/events": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", "engines": { "node": ">=0.8.x" } }, "node_modules/iso-url": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/iso-url/-/iso-url-1.2.1.tgz", - "integrity": "sha512-9JPDgCN4B7QPkLtYAAOrEuAWvP9rWvR5offAr0/SeF046wIkglqH3VXgYYP6NcsKslH80UIVgmPqNe3j7tG2ng==", + "license": "MIT", "engines": { "node": ">=12" } }, "node_modules/isobject": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/isomorphic-ws": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "license": "MIT", "peerDependencies": { "ws": "*" } }, "node_modules/isstream": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "license": "MIT" }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-hook": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", - "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "append-transform": "^2.0.0" }, @@ -8740,9 +7900,8 @@ }, "node_modules/istanbul-lib-instrument": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@babel/core": "^7.7.5", "@istanbuljs/schema": "^0.1.2", @@ -8755,9 +7914,8 @@ }, "node_modules/istanbul-lib-processinfo": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", - "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", "dev": true, + "license": "ISC", "dependencies": { "archy": "^1.0.0", "cross-spawn": "^7.0.0", @@ -8773,9 +7931,8 @@ }, "node_modules/istanbul-lib-processinfo/node_modules/cross-spawn": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -8787,9 +7944,8 @@ }, "node_modules/istanbul-lib-processinfo/node_modules/make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^6.0.0" }, @@ -8802,9 +7958,8 @@ }, "node_modules/istanbul-lib-processinfo/node_modules/p-map": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, + "license": "MIT", "dependencies": { "aggregate-error": "^3.0.0" }, @@ -8814,18 +7969,16 @@ }, "node_modules/istanbul-lib-processinfo/node_modules/path-key": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-processinfo/node_modules/rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -8838,9 +7991,8 @@ }, "node_modules/istanbul-lib-processinfo/node_modules/shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -8850,28 +8002,24 @@ }, "node_modules/istanbul-lib-processinfo/node_modules/shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-processinfo/node_modules/uuid": { "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "dev": true, + "license": "MIT", "bin": { "uuid": "bin/uuid" } }, "node_modules/istanbul-lib-processinfo/node_modules/which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -8884,9 +8032,8 @@ }, "node_modules/istanbul-lib-report": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^3.0.0", @@ -8898,9 +8045,8 @@ }, "node_modules/istanbul-lib-report/node_modules/make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^6.0.0" }, @@ -8913,9 +8059,8 @@ }, "node_modules/istanbul-lib-source-maps": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", @@ -8927,18 +8072,16 @@ }, "node_modules/istanbul-lib-source-maps/node_modules/source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/istanbul-reports": { "version": "3.1.4", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.4.tgz", - "integrity": "sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -8949,13 +8092,11 @@ }, "node_modules/it-all": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/it-all/-/it-all-1.0.6.tgz", - "integrity": "sha512-3cmCc6Heqe3uWi3CVM/k51fa/XbMFpQVzFoDsV0IZNHSQDyAXl3c4MjHkFX5kF3922OGj7Myv1nSEUgRtcuM1A==" + "license": "ISC" }, "node_modules/it-buffer": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/it-buffer/-/it-buffer-0.1.3.tgz", - "integrity": "sha512-9a2/9SYVwG7bcn3tpRDR4bXbtuMLXnDK48KVC+GXiQg97ZOOdWz2nIITBsOQ19b+gj01Rw8RNwtiLDLI8P8oiQ==", + "license": "MPL-2.0", "dependencies": { "bl": "^5.0.0", "buffer": "^6.0.3" @@ -8963,8 +8104,7 @@ }, "node_modules/it-buffer/node_modules/bl": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", - "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", + "license": "MIT", "dependencies": { "buffer": "^6.0.3", "inherits": "^2.0.4", @@ -8973,8 +8113,6 @@ }, "node_modules/it-buffer/node_modules/buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -8989,6 +8127,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -8996,23 +8135,19 @@ }, "node_modules/it-drain": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-1.0.5.tgz", - "integrity": "sha512-r/GjkiW1bZswC04TNmUnLxa6uovme7KKwPhc+cb1hHU65E3AByypHH6Pm91WHuvqfFsm+9ws0kPtDBV3/8vmIg==" + "license": "ISC" }, "node_modules/it-filter": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/it-filter/-/it-filter-1.0.3.tgz", - "integrity": "sha512-EI3HpzUrKjTH01miLHWmhNWy3Xpbx4OXMXltgrNprL5lDpF3giVpHIouFpr5l+evXw6aOfxhnt01BIB+4VQA+w==" + "license": "ISC" }, "node_modules/it-first": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/it-first/-/it-first-1.0.7.tgz", - "integrity": "sha512-nvJKZoBpZD/6Rtde6FXqwDqDZGF1sCADmr2Zoc0hZsIvnE449gRFnGctxDf09Bzc/FWnHXAdaHVIetY6lrE0/g==" + "license": "ISC" }, "node_modules/it-glob": { "version": "0.0.14", - "resolved": "https://registry.npmjs.org/it-glob/-/it-glob-0.0.14.tgz", - "integrity": "sha512-TKKzs9CglbsihSpcwJPXN5DBUssu4akRzPlp8QJRCoLrKoaOpyY2V1qDlxx+UMivn0i114YyTd4AawWl7eqIdw==", + "license": "ISC", "dependencies": { "@types/minimatch": "^3.0.4", "minimatch": "^3.0.4" @@ -9020,16 +8155,13 @@ }, "node_modules/it-goodbye": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/it-goodbye/-/it-goodbye-2.0.2.tgz", - "integrity": "sha512-k56lqArpxkIU0yyhnPhvnyOBpzRQn+4VEyd+dUBWhN5kvCgPBeC0XMuHiA71iU98sDpCrJrT/X+81ajT0AOQtQ==", + "license": "MIT", "dependencies": { "buffer": "^5.6.0" } }, "node_modules/it-goodbye/node_modules/buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -9044,6 +8176,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -9051,8 +8184,7 @@ }, "node_modules/it-handshake": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/it-handshake/-/it-handshake-2.0.0.tgz", - "integrity": "sha512-K4q+mz8aLlCK3vTjtgNdHC9c/JbuOATsfogarjMsLcBZC5vYfKbX3Gq3AWcCdjIsIrPqzTlhPKSxl64LJkrt2w==", + "license": "MIT", "dependencies": { "it-pushable": "^1.4.0", "it-reader": "^3.0.0", @@ -9061,8 +8193,7 @@ }, "node_modules/it-length-prefixed": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-5.0.3.tgz", - "integrity": "sha512-b+jDHLcnOnPDQN79ronmzF5jeBjdJsy0ce2O6i6X4J5tnaO8Fd146ZA/tMbzaLlKnTpXa0eKtofpYhumXGENeg==", + "license": "MIT", "dependencies": { "bl": "^5.0.0", "buffer": "^6.0.3", @@ -9071,8 +8202,7 @@ }, "node_modules/it-length-prefixed/node_modules/bl": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", - "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", + "license": "MIT", "dependencies": { "buffer": "^6.0.3", "inherits": "^2.0.4", @@ -9081,8 +8211,6 @@ }, "node_modules/it-length-prefixed/node_modules/buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -9097,6 +8225,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -9104,29 +8233,25 @@ }, "node_modules/it-map": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/it-map/-/it-map-1.0.6.tgz", - "integrity": "sha512-XT4/RM6UHIFG9IobGlQPFQUrlEKkU4eBUFG3qhWhfAdh1JfF2x11ShCrKCdmZ0OiZppPfoLuzcfA4cey6q3UAQ==" + "license": "ISC" }, "node_modules/it-merge": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/it-merge/-/it-merge-1.0.0.tgz", - "integrity": "sha512-bs40LMjG/9JMOcJ7pgyGLoOeWBpw28ZoMmZIk/1NCa5SUxd4elXCuadAr2qSjPiHz2GxrqoWGFAP7SePGddatw==", + "license": "ISC", "dependencies": { "it-pushable": "^1.4.0" } }, "node_modules/it-pair": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/it-pair/-/it-pair-1.0.0.tgz", - "integrity": "sha512-9raOiDu5OAuDOahtMtapKQDrQTxBfzlzrNcB6o7JARHkt+7Bb1dMkW/TpYdAjBJE77KH3e2zGzwpGUP9tXbLww==", + "license": "MIT", "dependencies": { "get-iterator": "^1.0.2" } }, "node_modules/it-pb-rpc": { "version": "0.1.13", - "resolved": "https://registry.npmjs.org/it-pb-rpc/-/it-pb-rpc-0.1.13.tgz", - "integrity": "sha512-aZ4FNJsDgNepVVTmYXgXbQabIiOQyqYWUhdfovaHDcPSM5KjegwJihJEWMJjMyj+oLSKcZl0vmHgHxXWJ9/ufw==", + "license": "MPL-2.0", "dependencies": { "is-buffer": "^2.0.5", "it-handshake": "^2.0.0", @@ -9135,8 +8260,6 @@ }, "node_modules/it-pb-rpc/node_modules/is-buffer": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", "funding": [ { "type": "github", @@ -9151,19 +8274,18 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/it-pipe": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/it-pipe/-/it-pipe-1.1.0.tgz", - "integrity": "sha512-lF0/3qTVeth13TOnHVs0BTFaziwQF7m5Gg+E6JV0BXcLKutC92YjSi7bASgkPOXaLEb+YvNZrPorGMBIJvZfxg==" + "license": "MIT" }, "node_modules/it-protocol-buffers": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/it-protocol-buffers/-/it-protocol-buffers-0.2.1.tgz", - "integrity": "sha512-UbezSc9BZTw0DU7mFS6iG9PXeycJfTDJlFAlniI3x1CRrKeDP+IW6ERPAFskHI3O+wij18Mk7eHgDtFz4Zk65A==", + "license": "MIT", "dependencies": { "it-buffer": "^0.1.1", "it-length-prefixed": "^3.0.0" @@ -9171,8 +8293,7 @@ }, "node_modules/it-protocol-buffers/node_modules/bl": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -9181,8 +8302,6 @@ }, "node_modules/it-protocol-buffers/node_modules/buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -9197,6 +8316,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -9204,8 +8324,7 @@ }, "node_modules/it-protocol-buffers/node_modules/it-length-prefixed": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-3.1.0.tgz", - "integrity": "sha512-E5GwT6qfZEwh3/XThyYwgjKJ4/hxvTC9kdbj3gxXDeUDKtC7+K2T647sPeX7xDEWqunsnoQyvOrjoHPegaT3uw==", + "license": "MIT", "dependencies": { "@types/bl": "^2.1.0", "bl": "^4.0.2", @@ -9215,29 +8334,25 @@ }, "node_modules/it-protocol-buffers/node_modules/varint": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "license": "MIT" }, "node_modules/it-pushable": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-1.4.2.tgz", - "integrity": "sha512-vVPu0CGRsTI8eCfhMknA7KIBqqGFolbRx+1mbQ6XuZ7YCz995Qj7L4XUviwClFunisDq96FdxzF5FnAbw15afg==", + "license": "MIT", "dependencies": { "fast-fifo": "^1.0.0" } }, "node_modules/it-reader": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-3.0.0.tgz", - "integrity": "sha512-NxR40odATeaBmSefn6Xn43DplYvn2KtEKQzn4jrTRuPYXMky5M4e+KQ7aTJh0k0vkytLyeenGO1I1GXlGm4laQ==", + "license": "MIT", "dependencies": { "bl": "^5.0.0" } }, "node_modules/it-reader/node_modules/bl": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", - "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", + "license": "MIT", "dependencies": { "buffer": "^6.0.3", "inherits": "^2.0.4", @@ -9246,8 +8361,6 @@ }, "node_modules/it-reader/node_modules/buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -9262,6 +8375,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -9269,13 +8383,11 @@ }, "node_modules/it-take": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/it-take/-/it-take-1.0.0.tgz", - "integrity": "sha512-zfr2iAtekTGhHVWzCqqqgDnHhmzdzfCW92L0GvbaSFlvc3n2Ep/sponzmlNl2Kg39N5Py+02v+Aypc+i2c+9og==" + "license": "ISC" }, "node_modules/it-to-stream": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/it-to-stream/-/it-to-stream-1.0.0.tgz", - "integrity": "sha512-pLULMZMAB/+vbdvbZtebC0nWBTbG581lk6w8P7DfIIIKUfa8FbY7Oi0FxZcFPbxvISs7A9E+cMpLDBc1XhpAOA==", + "license": "MIT", "dependencies": { "buffer": "^6.0.3", "fast-fifo": "^1.0.0", @@ -9287,8 +8399,6 @@ }, "node_modules/it-to-stream/node_modules/buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -9303,6 +8413,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -9310,8 +8421,7 @@ }, "node_modules/it-ws": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-4.0.0.tgz", - "integrity": "sha512-XmTzpMkevc6rUboy73r0CCNhciMmL/Yxir9O6FujRwdrjysztqLBQ1Xkr4CpY2m7BVSCObKotaCWJeZ29lOXRA==", + "license": "MIT", "dependencies": { "buffer": "^6.0.3", "event-iterator": "^2.0.0", @@ -9321,8 +8431,6 @@ }, "node_modules/it-ws/node_modules/buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -9337,6 +8445,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -9344,8 +8453,7 @@ }, "node_modules/jayson": { "version": "3.6.6", - "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.6.tgz", - "integrity": "sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ==", + "license": "MIT", "dependencies": { "@types/connect": "^3.4.33", "@types/express-serve-static-core": "^4.17.9", @@ -9372,19 +8480,16 @@ }, "node_modules/jayson/node_modules/@types/node": { "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==" + "license": "MIT" }, "node_modules/jayson/node_modules/commander": { "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "license": "MIT" }, "node_modules/jest-worker": { "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -9396,9 +8501,8 @@ }, "node_modules/jest-worker/node_modules/supports-color": { "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -9411,8 +8515,6 @@ }, "node_modules/jmespath": { "version": "0.15.0", - "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", - "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=", "dev": true, "engines": { "node": ">= 0.6.0" @@ -9420,20 +8522,17 @@ }, "node_modules/js-sha3": { "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + "license": "MIT" }, "node_modules/js-tokens": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/js-yaml": { "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -9444,14 +8543,12 @@ }, "node_modules/jsbn": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", - "integrity": "sha1-sBMHyym2GKHtJux56RH4A8TaAEA=" + "license": "MIT" }, "node_modules/jsdom": { "version": "15.2.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-15.2.1.tgz", - "integrity": "sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g==", "dev": true, + "license": "MIT", "dependencies": { "abab": "^2.0.0", "acorn": "^7.1.0", @@ -9494,27 +8591,24 @@ }, "node_modules/jsdom/node_modules/ip-regex": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/jsdom/node_modules/punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/jsdom/node_modules/tough-cookie": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", - "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "ip-regex": "^2.1.0", "psl": "^1.1.28", @@ -9526,18 +8620,16 @@ }, "node_modules/jsdom/node_modules/tr46": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", "dev": true, + "license": "MIT", "dependencies": { "punycode": "^2.1.0" } }, "node_modules/jsdom/node_modules/whatwg-url": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", "dev": true, + "license": "MIT", "dependencies": { "lodash.sortby": "^4.7.0", "tr46": "^1.0.1", @@ -9546,9 +8638,8 @@ }, "node_modules/jsesc": { "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, @@ -9558,51 +8649,43 @@ }, "node_modules/json-parse-better-errors": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-schema": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-schema-traverse": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "license": "MIT" }, "node_modules/json-stable-stringify": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", - "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", "dev": true, + "license": "MIT", "dependencies": { "jsonify": "~0.0.0" } }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-stringify-safe": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "license": "ISC" }, "node_modules/json5": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "dev": true, + "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -9612,14 +8695,12 @@ }, "node_modules/jsonc-parser": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", - "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jsonfile": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -9629,34 +8710,27 @@ }, "node_modules/jsonify": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", "dev": true, - "engines": { - "node": "*" - } + "license": "Public Domain" }, "node_modules/jsonparse": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "engines": [ "node >= 0.2.0" - ] + ], + "license": "MIT" }, "node_modules/jsonpointer": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.0.tgz", - "integrity": "sha512-PNYZIdMjVIvVgDSYKTT63Y+KZ6IZvGRNNWcxwD+GNnUz1MKPfv30J8ueCjdwcN0nDx2SlshgyB7Oy0epAzVRRg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/JSONStream": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "license": "(MIT OR Apache-2.0)", "dependencies": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" @@ -9670,9 +8744,8 @@ }, "node_modules/jsonstream2": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/jsonstream2/-/jsonstream2-1.1.2.tgz", - "integrity": "sha512-sVWipJW3f/NGAZfQnqys6cGTUc6vgiTl4eFK0Y3lzi2RV4Fo5hzgUpgc/jS4qY8/nnntFPiXt14ujrS2TzfWkQ==", "dev": true, + "license": "MIT", "dependencies": { "jsonparse": "0.0.6", "through2": "^0.6.1", @@ -9684,24 +8757,21 @@ }, "node_modules/jsonstream2/node_modules/isarray": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jsonstream2/node_modules/jsonparse": { "version": "0.0.6", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.6.tgz", - "integrity": "sha1-q1mfGTJNSuF4+iGpMBkqsRq2Gk4=", "dev": true, "engines": [ "node >= 0.2.0" - ] + ], + "license": "MIT" }, "node_modules/jsonstream2/node_modules/readable-stream": { "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", @@ -9711,15 +8781,13 @@ }, "node_modules/jsonstream2/node_modules/string_decoder": { "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jsonstream2/node_modules/through2": { "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", "dev": true, + "license": "MIT", "dependencies": { "readable-stream": ">=1.0.33-1 <1.1.0-0", "xtend": ">=4.0.0 <4.1.0-0" @@ -9727,9 +8795,8 @@ }, "node_modules/jsonwebtoken": { "version": "8.5.1", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", - "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", "dev": true, + "license": "MIT", "dependencies": { "jws": "^3.2.2", "lodash.includes": "^4.3.0", @@ -9749,23 +8816,20 @@ }, "node_modules/jsonwebtoken/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jsonwebtoken/node_modules/semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver" } }, "node_modules/jsprim": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "license": "MIT", "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -9778,23 +8842,20 @@ }, "node_modules/jsx-ast-utils": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz", - "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=", "dev": true, + "license": "MIT", "engines": { "node": ">=4.0" } }, "node_modules/just-extend": { "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==" + "license": "MIT" }, "node_modules/jwa": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", "dev": true, + "license": "MIT", "dependencies": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -9803,9 +8864,8 @@ }, "node_modules/jws": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", "dev": true, + "license": "MIT", "dependencies": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" @@ -9813,25 +8873,22 @@ }, "node_modules/jwt-simple": { "version": "0.5.6", - "resolved": "https://registry.npmjs.org/jwt-simple/-/jwt-simple-0.5.6.tgz", - "integrity": "sha512-40aUybvhH9t2h71ncA1/1SbtTNCVZHgsTsTgqPUxGWDmUDrXyDf2wMNQKEbdBjbf4AI+fQhbECNTV6lWxQKUzg==", + "license": "MIT", "engines": { "node": ">= 0.4.0" } }, "node_modules/k-bucket": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/k-bucket/-/k-bucket-5.1.0.tgz", - "integrity": "sha512-Fac7iINEovXIWU20GPnOMLUbjctiS+cnmyjC4zAUgvs3XPf1vo9akfCHkigftSic/jiKqKl+KA3a/vFcJbHyCg==", + "license": "MIT", "dependencies": { "randombytes": "^2.1.0" } }, "node_modules/karma": { "version": "6.3.17", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.3.17.tgz", - "integrity": "sha512-2TfjHwrRExC8yHoWlPBULyaLwAFmXmxQrcuFImt/JsAsSZu1uOWTZ1ZsWjqQtWpHLiatJOHL5jFjXSJIgCd01g==", "dev": true, + "license": "MIT", "dependencies": { "@colors/colors": "1.5.0", "body-parser": "^1.19.0", @@ -9867,18 +8924,16 @@ }, "node_modules/karma-chrome-launcher": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.1.tgz", - "integrity": "sha512-hsIglcq1vtboGPAN+DGCISCFOxW+ZVnIqhDQcCMqqCp+4dmJ0Qpq5QAjkbA0X2L9Mi6OBkHi2Srrbmm7pUKkzQ==", "dev": true, + "license": "MIT", "dependencies": { "which": "^1.2.1" } }, "node_modules/karma-firefox-launcher": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-2.1.2.tgz", - "integrity": "sha512-VV9xDQU1QIboTrjtGVD4NCfzIH7n01ZXqy/qpBhnOeGVOkG5JYPEm8kuSd7psHE6WouZaQ9Ool92g8LFweSNMA==", "dev": true, + "license": "MIT", "dependencies": { "is-wsl": "^2.2.0", "which": "^2.0.1" @@ -9886,9 +8941,8 @@ }, "node_modules/karma-firefox-launcher/node_modules/which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -9901,9 +8955,8 @@ }, "node_modules/karma-tap": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/karma-tap/-/karma-tap-4.2.0.tgz", - "integrity": "sha512-d0k9lvVnxJ4z0u94jVDcUwqSPfJ0O0LQRWLvYoRp1I5k3E5K1fH19X0Ro0kDzAZk7ygyDN/AfV40Z37vQFXCKg==", "dev": true, + "license": "ISC", "dependencies": { "babel-polyfill": "^6.26.0" }, @@ -9913,9 +8966,8 @@ }, "node_modules/karma-typescript": { "version": "5.5.3", - "resolved": "https://registry.npmjs.org/karma-typescript/-/karma-typescript-5.5.3.tgz", - "integrity": "sha512-l1FHurolXEBIzRa9ExpNtjzysAhsi/vLpTazpwLHWWK86mknvVpqor6pRZ5Nid7jvOPrTBqAq0JRuLgiCdRkFw==", "dev": true, + "license": "MIT", "dependencies": { "acorn": "^8.1.0", "acorn-walk": "^8.0.2", @@ -9968,9 +9020,8 @@ }, "node_modules/karma-typescript/node_modules/acorn": { "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -9980,18 +9031,16 @@ }, "node_modules/karma-typescript/node_modules/acorn-walk": { "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/karma-typescript/node_modules/assert": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", - "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", "dev": true, + "license": "MIT", "dependencies": { "es6-object-assign": "^1.1.0", "is-nan": "^1.2.1", @@ -10001,14 +9050,11 @@ }, "node_modules/karma-typescript/node_modules/async": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/karma-typescript/node_modules/buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, "funding": [ { @@ -10024,6 +9070,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -10031,9 +9078,8 @@ }, "node_modules/karma-typescript/node_modules/domain-browser": { "version": "4.22.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.22.0.tgz", - "integrity": "sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -10043,33 +9089,29 @@ }, "node_modules/karma-typescript/node_modules/events": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.x" } }, "node_modules/karma-typescript/node_modules/path-browserify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/karma-typescript/node_modules/punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/karma-typescript/node_modules/rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -10082,18 +9124,16 @@ }, "node_modules/karma-typescript/node_modules/source-map": { "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">= 8" } }, "node_modules/karma-typescript/node_modules/timers-browserify": { "version": "2.0.12", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", - "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", "dev": true, + "license": "MIT", "dependencies": { "setimmediate": "^1.0.4" }, @@ -10103,9 +9143,8 @@ }, "node_modules/karma-typescript/node_modules/tmp": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", "dev": true, + "license": "MIT", "dependencies": { "rimraf": "^3.0.0" }, @@ -10115,9 +9154,8 @@ }, "node_modules/karma-typescript/node_modules/util": { "version": "0.12.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.4.tgz", - "integrity": "sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -10129,9 +9167,8 @@ }, "node_modules/karma/node_modules/rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -10144,18 +9181,16 @@ }, "node_modules/karma/node_modules/source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/karma/node_modules/tmp": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", "dev": true, + "license": "MIT", "dependencies": { "rimraf": "^3.0.0" }, @@ -10165,9 +9200,8 @@ }, "node_modules/karma/node_modules/yargs": { "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -10183,18 +9217,16 @@ }, "node_modules/karma/node_modules/yargs-parser": { "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/keccak": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz", - "integrity": "sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==", "hasInstallScript": true, + "license": "MIT", "dependencies": { "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0", @@ -10206,9 +9238,8 @@ }, "node_modules/keygrip": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", - "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", "dev": true, + "license": "MIT", "dependencies": { "tsscmp": "1.0.6" }, @@ -10218,37 +9249,32 @@ }, "node_modules/keypair": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/keypair/-/keypair-1.0.4.tgz", - "integrity": "sha512-zwhgOhhniaL7oxMgUMKKw5219PWWABMO+dgMnzJOQ2/5L3XJtTJGhW2PEXlxXj9zaccdReZJZ83+4NPhVfNVDg==" + "license": "BSD / GPL" }, "node_modules/kind-of": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/kleur": { "version": "4.1.4", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", - "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/kuler": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", - "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" + "license": "MIT" }, "node_modules/labeled-stream-splicer": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", - "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "^2.0.1", "stream-splicer": "^2.0.0" @@ -10256,8 +9282,7 @@ }, "node_modules/level": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/level/-/level-6.0.1.tgz", - "integrity": "sha512-psRSqJZCsC/irNhfHzrVZbmPYXDcEYhA5TVNwr+V92jF44rbf86hqGp8fiT702FyiArScYIlPSBTDUASCVNSpw==", + "license": "MIT", "dependencies": { "level-js": "^5.0.0", "level-packager": "^5.1.0", @@ -10273,8 +9298,7 @@ }, "node_modules/level-codec": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "license": "MIT", "dependencies": { "buffer": "^5.6.0" }, @@ -10284,8 +9308,6 @@ }, "node_modules/level-codec/node_modules/buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -10300,6 +9322,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -10307,16 +9330,14 @@ }, "node_modules/level-concat-iterator": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", - "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/level-errors": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "license": "MIT", "dependencies": { "errno": "~0.1.1" }, @@ -10326,8 +9347,7 @@ }, "node_modules/level-iterator-stream": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "license": "MIT", "dependencies": { "inherits": "^2.0.4", "readable-stream": "^3.4.0", @@ -10339,8 +9359,7 @@ }, "node_modules/level-js": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/level-js/-/level-js-5.0.2.tgz", - "integrity": "sha512-SnBIDo2pdO5VXh02ZmtAyPP6/+6YTJg2ibLtl9C34pWvmtMEmRTWpra+qO/hifkUtBTOtfx6S9vLDjBsBK4gRg==", + "license": "MIT", "dependencies": { "abstract-leveldown": "~6.2.3", "buffer": "^5.5.0", @@ -10350,8 +9369,6 @@ }, "node_modules/level-js/node_modules/buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -10366,6 +9383,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -10373,8 +9391,7 @@ }, "node_modules/level-mem": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz", - "integrity": "sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==", + "license": "MIT", "dependencies": { "level-packager": "^5.0.3", "memdown": "^5.0.0" @@ -10385,8 +9402,7 @@ }, "node_modules/level-packager": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", - "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", + "license": "MIT", "dependencies": { "encoding-down": "^6.3.0", "levelup": "^4.3.2" @@ -10397,8 +9413,7 @@ }, "node_modules/level-supports": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", - "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "license": "MIT", "dependencies": { "xtend": "^4.0.2" }, @@ -10408,8 +9423,7 @@ }, "node_modules/level-ws": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-2.0.0.tgz", - "integrity": "sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "readable-stream": "^3.1.0", @@ -10421,9 +9435,8 @@ }, "node_modules/leveldown": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", - "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", "hasInstallScript": true, + "license": "MIT", "dependencies": { "abstract-leveldown": "~6.2.1", "napi-macros": "~2.0.0", @@ -10435,8 +9448,7 @@ }, "node_modules/leveldown/node_modules/node-gyp-build": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", - "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==", + "license": "MIT", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -10445,8 +9457,7 @@ }, "node_modules/levelup": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "license": "MIT", "dependencies": { "deferred-leveldown": "~5.3.0", "level-errors": "~2.0.0", @@ -10460,18 +9471,16 @@ }, "node_modules/leven": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/levn": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" @@ -10482,8 +9491,7 @@ }, "node_modules/libp2p": { "version": "0.30.13", - "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.30.13.tgz", - "integrity": "sha512-iR5nZBZ+AtClzviNIzTsz58v4CdDEM+vzOiILcVm0d++NtkFt/DP0wcnia0qXLXUT98R01pkEnfdNyoBojPPPQ==", + "license": "MIT", "dependencies": { "@motrix/nat-api": "^0.3.1", "abort-controller": "^3.0.0", @@ -10546,8 +9554,7 @@ }, "node_modules/libp2p-bootstrap": { "version": "0.14.0", - "resolved": "https://registry.npmjs.org/libp2p-bootstrap/-/libp2p-bootstrap-0.14.0.tgz", - "integrity": "sha512-j3slZo5nOdA8wVlav8dRZeAXutZ7psz/f10DLoIEX/EFif7uU5oZfIYvjbVGo3ZDl+VQLo2tR0m1lV0westQ3g==", + "license": "MIT", "dependencies": { "debug": "^4.3.1", "mafmt": "^10.0.0", @@ -10560,13 +9567,11 @@ }, "node_modules/libp2p-bootstrap/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/libp2p-bootstrap/node_modules/libp2p-crypto": { "version": "0.21.2", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.21.2.tgz", - "integrity": "sha512-EXFrhSpiHtJ+/L8xXDvQNK5VjUMG51u878jzZcaT5XhuN/zFg6PWJFnl/qB2Y2j7eMWnvCRP7Kp+ua2H36cG4g==", + "license": "MIT", "dependencies": { "@noble/ed25519": "^1.5.1", "@noble/secp256k1": "^1.3.0", @@ -10583,24 +9588,21 @@ }, "node_modules/libp2p-bootstrap/node_modules/mafmt": { "version": "10.0.0", - "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-10.0.0.tgz", - "integrity": "sha512-K1bziJOXcnepfztu+2Xy9FLKVLaFMDuspmiyJIYRxnO0WOxFSV7XKSdMxMrVZxcvg1+YjlTIvSGTImUHU2k4Aw==", + "license": "MIT", "dependencies": { "multiaddr": "^10.0.0" } }, "node_modules/libp2p-bootstrap/node_modules/node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "version": "1.3.0", + "license": "(BSD-3-Clause OR GPL-2.0)", "engines": { "node": ">= 6.13.0" } }, "node_modules/libp2p-bootstrap/node_modules/peer-id": { "version": "0.16.0", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.16.0.tgz", - "integrity": "sha512-EmL7FurFUduU9m1PS9cfJ5TAuCvxKQ7DKpfx3Yj6IKWyBRtosriFuOag/l3ni/dtPgPLwiA4R9IvpL7hsDLJuQ==", + "license": "MIT", "dependencies": { "class-is": "^1.1.0", "libp2p-crypto": "^0.21.0", @@ -10614,8 +9616,7 @@ }, "node_modules/libp2p-crypto": { "version": "0.19.7", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.19.7.tgz", - "integrity": "sha512-Qb5o/3WFKF2j6mYSt4UBPyi2kbKl3jYV0podBJoJCw70DlpM5Xc+oh3fFY9ToSunu8aSQQ5GY8nutjXgX/uGRA==", + "license": "MIT", "dependencies": { "err-code": "^3.0.1", "is-typedarray": "^1.0.0", @@ -10635,13 +9636,11 @@ }, "node_modules/libp2p-crypto/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/libp2p-interfaces": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/libp2p-interfaces/-/libp2p-interfaces-1.3.1.tgz", - "integrity": "sha512-Bh991Nv2KT/jZ7DjPd/zqhk8cCtkHl6OWw8lyK7wBX7Aj3/ezGwjoDABJzKgt1lbvcgCeQIbzPiIbaKj4DUI4w==", + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "abortable-iterator": "^3.0.0", @@ -10661,13 +9660,11 @@ }, "node_modules/libp2p-interfaces/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/libp2p-interfaces/node_modules/libp2p-crypto": { "version": "0.20.0", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.20.0.tgz", - "integrity": "sha512-WgIW9rYcWaO/5j2T6NW3R6Q46yvp2ZfFErqRMbi4/pOTL3T7+OROYpL/1iWVksWkXyurU/t2qFsIijWMxR5C4Q==", + "license": "MIT", "dependencies": { "err-code": "^3.0.1", "iso-random-stream": "^2.0.0", @@ -10687,8 +9684,7 @@ }, "node_modules/libp2p-interfaces/node_modules/peer-id": { "version": "0.15.4", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.15.4.tgz", - "integrity": "sha512-MDoBIMZYwQIAHaZQUwsIcvoFgdbIl5GtZMwSkXpIYvc5v0TSDv+u8WsTKrKt2Vv28tHFFDJQdVzu3T4qTPzK+w==", + "license": "MIT", "dependencies": { "class-is": "^1.1.0", "libp2p-crypto": "^0.20.0", @@ -10706,8 +9702,7 @@ }, "node_modules/libp2p-kad-dht": { "version": "0.20.6", - "resolved": "https://registry.npmjs.org/libp2p-kad-dht/-/libp2p-kad-dht-0.20.6.tgz", - "integrity": "sha512-hRClzJP+NK3zBU0/pYkoDUhZcviqmPu4czFaftcl3cCGasjxSaWNEZNKsf65QwoINZD9jFrYkQuXW9/gWQwuOA==", + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "async": "^2.6.2", @@ -10746,8 +9741,7 @@ }, "node_modules/libp2p-kad-dht/node_modules/bl": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -10756,8 +9750,6 @@ }, "node_modules/libp2p-kad-dht/node_modules/buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -10772,6 +9764,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -10779,8 +9772,7 @@ }, "node_modules/libp2p-kad-dht/node_modules/delay": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/delay/-/delay-4.4.1.tgz", - "integrity": "sha512-aL3AhqtfhOlT/3ai6sWXeqwnw63ATNpnUiN4HL7x9q+My5QtHlO3OIkasmug9LKzpheLdmUKGRKnYXYAS7FQkQ==", + "license": "MIT", "engines": { "node": ">=6" }, @@ -10790,8 +9782,7 @@ }, "node_modules/libp2p-kad-dht/node_modules/it-length-prefixed": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-3.1.0.tgz", - "integrity": "sha512-E5GwT6qfZEwh3/XThyYwgjKJ4/hxvTC9kdbj3gxXDeUDKtC7+K2T647sPeX7xDEWqunsnoQyvOrjoHPegaT3uw==", + "license": "MIT", "dependencies": { "@types/bl": "^2.1.0", "bl": "^4.0.2", @@ -10801,8 +9792,7 @@ }, "node_modules/libp2p-kad-dht/node_modules/libp2p-interfaces": { "version": "0.8.4", - "resolved": "https://registry.npmjs.org/libp2p-interfaces/-/libp2p-interfaces-0.8.4.tgz", - "integrity": "sha512-LaPkXVhqgAcFwqsyqGSZNAjgXSa2V+skOfIKE2UtQHaduwLct2KpFDOmvhRHTWHfRHwI9bSCskDB7xWGNTwZsQ==", + "license": "MIT", "dependencies": { "@types/bl": "^2.1.0", "abort-controller": "^3.0.0", @@ -10836,8 +9826,7 @@ }, "node_modules/libp2p-kad-dht/node_modules/multiaddr": { "version": "8.1.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-8.1.2.tgz", - "integrity": "sha512-r13IzW8+Sv9zab9Gt8RPMIN2WkptIPq99EpAzg4IbJ/zTELhiEwXWr9bAmEatSCI4j/LSA6ESJzvz95JZ+ZYXQ==", + "license": "MIT", "dependencies": { "cids": "^1.0.0", "class-is": "^1.1.0", @@ -10851,8 +9840,7 @@ }, "node_modules/libp2p-kad-dht/node_modules/multiaddr/node_modules/uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", + "license": "MIT", "dependencies": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" @@ -10860,9 +9848,7 @@ }, "node_modules/libp2p-kad-dht/node_modules/multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", - "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", "dependencies": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -10874,8 +9860,7 @@ }, "node_modules/libp2p-kad-dht/node_modules/multihashes": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-3.1.2.tgz", - "integrity": "sha512-AP4IoV/YzkNrfbQKZE3OMPibrmy350OmCd6cJkwyM8oExaXIlOY4UnOOVSQtAEuq/LR01XfXKCESidzZvSwHCQ==", + "license": "MIT", "dependencies": { "multibase": "^3.1.0", "uint8arrays": "^2.0.5", @@ -10888,13 +9873,11 @@ }, "node_modules/libp2p-kad-dht/node_modules/multihashes/node_modules/varint": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", - "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==" + "license": "MIT" }, "node_modules/libp2p-kad-dht/node_modules/p-limit": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -10907,21 +9890,18 @@ }, "node_modules/libp2p-kad-dht/node_modules/uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", + "license": "MIT", "dependencies": { "multiformats": "^9.4.2" } }, "node_modules/libp2p-kad-dht/node_modules/varint": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "license": "MIT" }, "node_modules/libp2p-mplex": { "version": "0.10.7", - "resolved": "https://registry.npmjs.org/libp2p-mplex/-/libp2p-mplex-0.10.7.tgz", - "integrity": "sha512-21VV0DZWuOsHgitWy1GZD1M/kki3a/hVoAJ5QC48p01JNSK5W8gxRiZtq7cCGJ/xNpbQxvMlMtS5eq8CFRlysg==", + "license": "MIT", "dependencies": { "abortable-iterator": "^3.0.2", "bl": "^5.0.0", @@ -10934,8 +9914,7 @@ }, "node_modules/libp2p-mplex/node_modules/bl": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", - "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", + "license": "MIT", "dependencies": { "buffer": "^6.0.3", "inherits": "^2.0.4", @@ -10944,8 +9923,6 @@ }, "node_modules/libp2p-mplex/node_modules/buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -10960,6 +9937,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -10967,13 +9945,11 @@ }, "node_modules/libp2p-mplex/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/libp2p-record": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/libp2p-record/-/libp2p-record-0.9.0.tgz", - "integrity": "sha512-8FlhzP+UlXTYOR+9D8nYoGOIJ6S8XogKD625bqzHJbXJQyJNCNaW3tZPHqrQrvUW7o6GsAeyQAfCp5WLEH0FZg==", + "license": "MIT", "dependencies": { "err-code": "^2.0.0", "multihashes": "^3.0.1", @@ -10988,9 +9964,7 @@ }, "node_modules/libp2p-record/node_modules/multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", - "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", "dependencies": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -11002,8 +9976,7 @@ }, "node_modules/libp2p-record/node_modules/multihashes": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-3.1.2.tgz", - "integrity": "sha512-AP4IoV/YzkNrfbQKZE3OMPibrmy350OmCd6cJkwyM8oExaXIlOY4UnOOVSQtAEuq/LR01XfXKCESidzZvSwHCQ==", + "license": "MIT", "dependencies": { "multibase": "^3.1.0", "uint8arrays": "^2.0.5", @@ -11016,16 +9989,14 @@ }, "node_modules/libp2p-record/node_modules/multihashes/node_modules/uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", + "license": "MIT", "dependencies": { "multiformats": "^9.4.2" } }, "node_modules/libp2p-record/node_modules/uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", + "license": "MIT", "dependencies": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" @@ -11033,8 +10004,7 @@ }, "node_modules/libp2p-tcp": { "version": "0.15.4", - "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.15.4.tgz", - "integrity": "sha512-MqXIlqV7t9z0A1Ww9Omd2XIlndcYOAh5R6kWRZ8Vo/CITazKUC5ZGNoj23hq/aEPaX8p5XmJs2BKESg/OuhGhQ==", + "license": "MIT", "dependencies": { "abortable-iterator": "^3.0.0", "class-is": "^1.1.0", @@ -11051,13 +10021,11 @@ }, "node_modules/libp2p-tcp/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/libp2p-tcp/node_modules/ip-address": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-7.1.0.tgz", - "integrity": "sha512-V9pWC/VJf2lsXqP7IWJ+pe3P1/HCYGBMZrrnT62niLGjAfCbeiwXMUxaeHvnVlz19O27pvXP4azs+Pj/A0x+SQ==", + "license": "MIT", "dependencies": { "jsbn": "1.1.0", "sprintf-js": "1.1.2" @@ -11068,8 +10036,7 @@ }, "node_modules/libp2p-tcp/node_modules/libp2p-utils": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/libp2p-utils/-/libp2p-utils-0.3.1.tgz", - "integrity": "sha512-LOVfww7a6Rhtoupl3z1ABuTEli5whY3VLTB9QntsOIwbOcX9GfmjuhqYbEDht9lVPAQl+rCUWbfDMvK121ryUg==", + "license": "MIT", "dependencies": { "abortable-iterator": "^3.0.0", "debug": "^4.3.0", @@ -11082,16 +10049,14 @@ }, "node_modules/libp2p-tcp/node_modules/mafmt": { "version": "9.0.0", - "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-9.0.0.tgz", - "integrity": "sha512-BwKL6FJxc6R85K6gFE/pX7MVyCp0NkM2DJHg0RatxVgDlK4g9kqtfXQUt2iReSmTcgZss/Q/Bdfa2KTg4KyC+g==", + "license": "MIT", "dependencies": { "multiaddr": "^9.0.1" } }, "node_modules/libp2p-tcp/node_modules/multiaddr": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", - "integrity": "sha512-YFaEb9t4yXSbaGksSEdg+Kn2U02s7w4wXUgyEMQmPxFJj7CfVHY10WOsScAX/rK6Soa15S1zXYadqH9TtlVreQ==", + "license": "MIT", "dependencies": { "cids": "^1.0.0", "dns-over-http-resolver": "^1.0.0", @@ -11104,21 +10069,18 @@ }, "node_modules/libp2p-tcp/node_modules/sprintf-js": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" + "license": "BSD-3-Clause" }, "node_modules/libp2p-tcp/node_modules/uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", + "license": "MIT", "dependencies": { "multiformats": "^9.4.2" } }, "node_modules/libp2p-utils": { "version": "0.2.3", - "resolved": "https://registry.npmjs.org/libp2p-utils/-/libp2p-utils-0.2.3.tgz", - "integrity": "sha512-9BoMCgvJF7LJ+JVMaHtqfCqhZN4i/sx0DrY6lf9U0Rq9uUgQ9qTai2O9LXcfr1LOS3OMMeRLsKk25MMgsf7W3w==", + "license": "MIT", "dependencies": { "abortable-iterator": "^3.0.0", "debug": "^4.2.0", @@ -11131,8 +10093,7 @@ }, "node_modules/libp2p-utils/node_modules/multiaddr": { "version": "8.1.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-8.1.2.tgz", - "integrity": "sha512-r13IzW8+Sv9zab9Gt8RPMIN2WkptIPq99EpAzg4IbJ/zTELhiEwXWr9bAmEatSCI4j/LSA6ESJzvz95JZ+ZYXQ==", + "license": "MIT", "dependencies": { "cids": "^1.0.0", "class-is": "^1.1.0", @@ -11146,9 +10107,7 @@ }, "node_modules/libp2p-utils/node_modules/multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", - "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", "dependencies": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -11160,8 +10119,7 @@ }, "node_modules/libp2p-utils/node_modules/uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", + "license": "MIT", "dependencies": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" @@ -11169,13 +10127,11 @@ }, "node_modules/libp2p-utils/node_modules/varint": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "license": "MIT" }, "node_modules/libp2p-websockets": { "version": "0.15.9", - "resolved": "https://registry.npmjs.org/libp2p-websockets/-/libp2p-websockets-0.15.9.tgz", - "integrity": "sha512-tuQ4KezPEiJ/JXGKJUttPgBWTv36NnaqY05lWja8wQwQU3R1NgpH4GRJnTBshGXoBFdvGGJbTxvsJlh15NzMkg==", + "license": "MIT", "dependencies": { "abortable-iterator": "^3.0.0", "class-is": "^1.1.0", @@ -11193,8 +10149,6 @@ }, "node_modules/libp2p-websockets/node_modules/buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -11209,6 +10163,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -11216,13 +10171,11 @@ }, "node_modules/libp2p-websockets/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/libp2p-websockets/node_modules/ip-address": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-7.1.0.tgz", - "integrity": "sha512-V9pWC/VJf2lsXqP7IWJ+pe3P1/HCYGBMZrrnT62niLGjAfCbeiwXMUxaeHvnVlz19O27pvXP4azs+Pj/A0x+SQ==", + "license": "MIT", "dependencies": { "jsbn": "1.1.0", "sprintf-js": "1.1.2" @@ -11233,8 +10186,7 @@ }, "node_modules/libp2p-websockets/node_modules/ipfs-utils": { "version": "8.1.6", - "resolved": "https://registry.npmjs.org/ipfs-utils/-/ipfs-utils-8.1.6.tgz", - "integrity": "sha512-V/cwb6113DrDhrjDTWImA6+zmJbpdbUkxdxmEQO7it8ykV76bBmzU1ZXSM0QR0qxGy9VW8dkUlPAC2K10VgSmw==", + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "any-signal": "^2.1.0", @@ -11256,8 +10208,7 @@ }, "node_modules/libp2p-websockets/node_modules/libp2p-utils": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/libp2p-utils/-/libp2p-utils-0.3.1.tgz", - "integrity": "sha512-LOVfww7a6Rhtoupl3z1ABuTEli5whY3VLTB9QntsOIwbOcX9GfmjuhqYbEDht9lVPAQl+rCUWbfDMvK121ryUg==", + "license": "MIT", "dependencies": { "abortable-iterator": "^3.0.0", "debug": "^4.3.0", @@ -11270,16 +10221,14 @@ }, "node_modules/libp2p-websockets/node_modules/mafmt": { "version": "9.0.0", - "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-9.0.0.tgz", - "integrity": "sha512-BwKL6FJxc6R85K6gFE/pX7MVyCp0NkM2DJHg0RatxVgDlK4g9kqtfXQUt2iReSmTcgZss/Q/Bdfa2KTg4KyC+g==", + "license": "MIT", "dependencies": { "multiaddr": "^9.0.1" } }, "node_modules/libp2p-websockets/node_modules/multiaddr": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", - "integrity": "sha512-YFaEb9t4yXSbaGksSEdg+Kn2U02s7w4wXUgyEMQmPxFJj7CfVHY10WOsScAX/rK6Soa15S1zXYadqH9TtlVreQ==", + "license": "MIT", "dependencies": { "cids": "^1.0.0", "dns-over-http-resolver": "^1.0.0", @@ -11293,8 +10242,6 @@ "node_modules/libp2p-websockets/node_modules/node-fetch": { "name": "@achingbrain/node-fetch", "version": "2.6.7", - "resolved": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g==", "license": "MIT", "engines": { "node": "4.x || >=6.0.0" @@ -11302,21 +10249,18 @@ }, "node_modules/libp2p-websockets/node_modules/sprintf-js": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" + "license": "BSD-3-Clause" }, "node_modules/libp2p-websockets/node_modules/uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", + "license": "MIT", "dependencies": { "multiformats": "^9.4.2" } }, "node_modules/libp2p/node_modules/bl": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -11325,8 +10269,6 @@ }, "node_modules/libp2p/node_modules/buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -11341,6 +10283,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -11348,8 +10291,7 @@ }, "node_modules/libp2p/node_modules/delay": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/delay/-/delay-4.4.1.tgz", - "integrity": "sha512-aL3AhqtfhOlT/3ai6sWXeqwnw63ATNpnUiN4HL7x9q+My5QtHlO3OIkasmug9LKzpheLdmUKGRKnYXYAS7FQkQ==", + "license": "MIT", "engines": { "node": ">=6" }, @@ -11359,21 +10301,18 @@ }, "node_modules/libp2p/node_modules/es6-promisify": { "version": "6.1.1", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", - "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==" + "license": "MIT" }, "node_modules/libp2p/node_modules/events": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", "engines": { "node": ">=0.8.x" } }, "node_modules/libp2p/node_modules/it-handshake": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/it-handshake/-/it-handshake-1.0.2.tgz", - "integrity": "sha512-uutOim5xF1eyDQD3u8qd3TxbWKwxqGMlbvacZsRsPdjO1BD9lnPTVci0jSMGsvMOu+5Y3W/QQ4hPQb87qPmPVQ==", + "license": "MIT", "dependencies": { "it-pushable": "^1.4.0", "it-reader": "^2.0.0", @@ -11382,8 +10321,7 @@ }, "node_modules/libp2p/node_modules/it-length-prefixed": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-3.1.0.tgz", - "integrity": "sha512-E5GwT6qfZEwh3/XThyYwgjKJ4/hxvTC9kdbj3gxXDeUDKtC7+K2T647sPeX7xDEWqunsnoQyvOrjoHPegaT3uw==", + "license": "MIT", "dependencies": { "@types/bl": "^2.1.0", "bl": "^4.0.2", @@ -11393,21 +10331,18 @@ }, "node_modules/libp2p/node_modules/it-length-prefixed/node_modules/varint": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "license": "MIT" }, "node_modules/libp2p/node_modules/it-reader": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-2.1.0.tgz", - "integrity": "sha512-hSysqWTO9Tlwc5EGjVf8JYZzw0D2FsxD/g+eNNWrez9zODxWt6QlN6JAMmycK72Mv4jHEKEXoyzUN4FYGmJaZw==", + "license": "MIT", "dependencies": { "bl": "^4.0.0" } }, "node_modules/libp2p/node_modules/libp2p-interfaces": { "version": "0.8.4", - "resolved": "https://registry.npmjs.org/libp2p-interfaces/-/libp2p-interfaces-0.8.4.tgz", - "integrity": "sha512-LaPkXVhqgAcFwqsyqGSZNAjgXSa2V+skOfIKE2UtQHaduwLct2KpFDOmvhRHTWHfRHwI9bSCskDB7xWGNTwZsQ==", + "license": "MIT", "dependencies": { "@types/bl": "^2.1.0", "abort-controller": "^3.0.0", @@ -11441,8 +10376,7 @@ }, "node_modules/libp2p/node_modules/multiaddr": { "version": "8.1.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-8.1.2.tgz", - "integrity": "sha512-r13IzW8+Sv9zab9Gt8RPMIN2WkptIPq99EpAzg4IbJ/zTELhiEwXWr9bAmEatSCI4j/LSA6ESJzvz95JZ+ZYXQ==", + "license": "MIT", "dependencies": { "cids": "^1.0.0", "class-is": "^1.1.0", @@ -11456,8 +10390,7 @@ }, "node_modules/libp2p/node_modules/multiaddr/node_modules/uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", + "license": "MIT", "dependencies": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" @@ -11465,14 +10398,11 @@ }, "node_modules/libp2p/node_modules/multiaddr/node_modules/varint": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "license": "MIT" }, "node_modules/libp2p/node_modules/multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", - "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", "dependencies": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -11484,8 +10414,7 @@ }, "node_modules/libp2p/node_modules/multihashes": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-3.1.2.tgz", - "integrity": "sha512-AP4IoV/YzkNrfbQKZE3OMPibrmy350OmCd6cJkwyM8oExaXIlOY4UnOOVSQtAEuq/LR01XfXKCESidzZvSwHCQ==", + "license": "MIT", "dependencies": { "multibase": "^3.1.0", "uint8arrays": "^2.0.5", @@ -11498,8 +10427,7 @@ }, "node_modules/libp2p/node_modules/p-limit": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -11512,23 +10440,20 @@ }, "node_modules/libp2p/node_modules/uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", + "license": "MIT", "dependencies": { "multiformats": "^9.4.2" } }, "node_modules/lines-and-columns": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/load-json-file": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.1.2", "parse-json": "^4.0.0", @@ -11541,9 +10466,8 @@ }, "node_modules/load-json-file/node_modules/parse-json": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, + "license": "MIT", "dependencies": { "error-ex": "^1.3.1", "json-parse-better-errors": "^1.0.1" @@ -11554,27 +10478,24 @@ }, "node_modules/load-json-file/node_modules/strip-bom": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "version": "4.2.0", "dev": true, + "license": "MIT", "engines": { "node": ">=6.11.5" } }, "node_modules/loader-utils": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", "dev": true, + "license": "MIT", "dependencies": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", @@ -11586,9 +10507,8 @@ }, "node_modules/locate-path": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^4.1.0" }, @@ -11598,119 +10518,99 @@ }, "node_modules/lockfile": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.4.tgz", - "integrity": "sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA==", "dev": true, + "license": "ISC", "dependencies": { "signal-exit": "^3.0.2" } }, "node_modules/lodash": { "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "license": "MIT" }, "node_modules/lodash.cond": { "version": "4.5.2", - "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", - "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.find": { "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz", - "integrity": "sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E=" + "license": "MIT" }, "node_modules/lodash.flattendeep": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.get": { "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + "license": "MIT" }, "node_modules/lodash.includes": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.isboolean": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.isinteger": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.isnumber": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.isstring": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.max": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.max/-/lodash.max-4.0.1.tgz", - "integrity": "sha1-hzVWbGGLNan3YFILSHrnllivE2o=" + "license": "MIT" }, "node_modules/lodash.memoize": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.merge": { "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "license": "MIT" }, "node_modules/lodash.once": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.padstart": { "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.6.1.tgz", - "integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs=" + "license": "MIT" }, "node_modules/lodash.repeat": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-4.1.0.tgz", - "integrity": "sha1-/H3oEx2MisB+S0n3T/6CnR8r7EQ=" + "license": "MIT" }, "node_modules/lodash.sortby": { "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/log4js": { "version": "6.4.4", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.4.tgz", - "integrity": "sha512-ncaWPsuw9Vl1CKA406hVnJLGQKy1OHx6buk8J4rE2lVW+NW5Y82G5/DIloO7NkqLOUtNPEANaWC1kZYVjXssPw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "date-format": "^4.0.6", "debug": "^4.3.4", @@ -11724,14 +10624,12 @@ }, "node_modules/log4js/node_modules/flatted": { "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/logform": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz", - "integrity": "sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw==", + "license": "MIT", "dependencies": { "@colors/colors": "1.5.0", "fecha": "^4.2.0", @@ -11742,74 +10640,63 @@ }, "node_modules/logform/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "license": "MIT" }, "node_modules/lolex": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-1.6.0.tgz", - "integrity": "sha1-OpoCg0UqR9dDnnJzG54H1zhuSfY=", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/long": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + "license": "Apache-2.0" }, "node_modules/loupe": { "version": "2.3.4", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", - "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "license": "MIT", "dependencies": { "get-func-name": "^2.0.0" } }, "node_modules/lower-case": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", - "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lru-cache": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "license": "ISC", "dependencies": { "yallist": "^3.0.2" } }, "node_modules/ltgt": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + "license": "MIT" }, "node_modules/lunr": { "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lunr-mutable-indexes": { "version": "2.3.2", - "resolved": "https://registry.npmjs.org/lunr-mutable-indexes/-/lunr-mutable-indexes-2.3.2.tgz", - "integrity": "sha512-Han6cdWAPPFM7C2AigS2Ofl3XjAT0yVMrUixodJEpyg71zCtZ2yzXc3s+suc/OaNt4ca6WJBEzVnEIjxCTwFMw==", "dev": true, + "license": "MIT", "dependencies": { "lunr": ">= 2.3.0 < 2.4.0" } }, "node_modules/mafmt": { "version": "8.0.4", - "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-8.0.4.tgz", - "integrity": "sha512-wwZ5+PU0vQw10kwQRyZin1Z0dqVOp0BnYlX1xvXHS2fmLwrrQCfU1+3tlW5MRcihUwGz1virnVhbRAU1biKfiw==", + "license": "MIT", "dependencies": { "multiaddr": "^8.0.0" } }, "node_modules/mafmt/node_modules/multiaddr": { "version": "8.1.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-8.1.2.tgz", - "integrity": "sha512-r13IzW8+Sv9zab9Gt8RPMIN2WkptIPq99EpAzg4IbJ/zTELhiEwXWr9bAmEatSCI4j/LSA6ESJzvz95JZ+ZYXQ==", + "license": "MIT", "dependencies": { "cids": "^1.0.0", "class-is": "^1.1.0", @@ -11823,9 +10710,7 @@ }, "node_modules/mafmt/node_modules/multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", - "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", "dependencies": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -11837,8 +10722,7 @@ }, "node_modules/mafmt/node_modules/uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", + "license": "MIT", "dependencies": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" @@ -11846,23 +10730,20 @@ }, "node_modules/mafmt/node_modules/varint": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "license": "MIT" }, "node_modules/magic-string": { "version": "0.23.2", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.23.2.tgz", - "integrity": "sha512-oIUZaAxbcxYIp4AyLafV6OVKoB3YouZs0UTCJ8mOKBHNyJgGDaMJ4TgA+VylJh6fx7EQCC52XkbURxxG9IoJXA==", "dev": true, + "license": "MIT", "dependencies": { "sourcemap-codec": "^1.4.1" } }, "node_modules/make-dir": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, + "license": "MIT", "dependencies": { "pify": "^3.0.0" }, @@ -11872,15 +10753,13 @@ }, "node_modules/make-error": { "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/marked": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.14.tgz", - "integrity": "sha512-HL5sSPE/LP6U9qKgngIIPTthuxC0jrfxpYMZ3LdGDD3vTnLs59m2Z7r6+LNDR3ToqEQdkKd6YaaEfJhodJmijQ==", + "version": "4.0.12", "dev": true, + "license": "MIT", "bin": { "marked": "bin/marked.js" }, @@ -11890,17 +10769,15 @@ }, "node_modules/mcl-wasm": { "version": "0.7.9", - "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz", - "integrity": "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==", + "license": "BSD-3-Clause", "engines": { "node": ">=8.9.0" } }, "node_modules/md5.js": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "dev": true, + "license": "MIT", "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -11909,16 +10786,14 @@ }, "node_modules/media-typer": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/memdown": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz", - "integrity": "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==", + "license": "MIT", "dependencies": { "abstract-leveldown": "~6.2.1", "functional-red-black-tree": "~1.0.1", @@ -11933,13 +10808,10 @@ }, "node_modules/memdown/node_modules/immediate": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + "license": "MIT" }, "node_modules/memorystream": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", "dev": true, "engines": { "node": ">= 0.10.0" @@ -11947,14 +10819,12 @@ }, "node_modules/merge-descriptors": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/merge-options": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", - "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", + "license": "MIT", "dependencies": { "is-plain-obj": "^2.1.0" }, @@ -11964,23 +10834,20 @@ }, "node_modules/merge-source-map": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.0.4.tgz", - "integrity": "sha1-pd5GU42uhNQRTMXqArR3KmNGcB8=", "dev": true, + "license": "MIT", "dependencies": { "source-map": "^0.5.6" } }, "node_modules/merge-stream": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + "license": "MIT" }, "node_modules/merge2": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -11991,21 +10858,19 @@ }, "node_modules/methods": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.4", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" + "braces": "^3.0.1", + "picomatch": "^2.2.3" }, "engines": { "node": ">=8.6" @@ -12013,9 +10878,8 @@ }, "node_modules/miller-rabin": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, + "license": "MIT", "dependencies": { "bn.js": "^4.0.0", "brorand": "^1.0.1" @@ -12024,11 +10888,15 @@ "miller-rabin": "bin/miller-rabin" } }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "dev": true, + "license": "MIT" + }, "node_modules/mime": { "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", "dev": true, + "license": "MIT", "bin": { "mime": "cli.js" }, @@ -12038,16 +10906,14 @@ }, "node_modules/mime-db": { "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -12057,26 +10923,22 @@ }, "node_modules/mimic-fn": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/minimalistic-assert": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "license": "ISC" }, "node_modules/minimalistic-crypto-utils": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + "license": "MIT" }, "node_modules/minimatch": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -12086,14 +10948,12 @@ }, "node_modules/minimist": { "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "license": "MIT" }, "node_modules/mkdirp": { "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.6" }, @@ -12103,15 +10963,13 @@ }, "node_modules/mkdirp-classic": { "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/module-deps": { "version": "6.2.3", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz", - "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==", "dev": true, + "license": "MIT", "dependencies": { "browser-resolve": "^2.0.0", "cached-path-relative": "^1.0.2", @@ -12138,15 +10996,13 @@ }, "node_modules/module-deps/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/module-deps/node_modules/readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -12159,56 +11015,48 @@ }, "node_modules/module-deps/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/module-deps/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/moment": { - "version": "2.29.2", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.2.tgz", - "integrity": "sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg==", + "version": "2.29.1", + "license": "MIT", "engines": { "node": "*" } }, "node_modules/morphdom": { "version": "2.6.1", - "resolved": "https://registry.npmjs.org/morphdom/-/morphdom-2.6.1.tgz", - "integrity": "sha512-Y8YRbAEP3eKykroIBWrjcfMw7mmwJfjhqdpSvoqinu8Y702nAwikpXcNFDiIkyvfCLxLM9Wu95RZqo4a9jFBaA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/moving-average": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/moving-average/-/moving-average-1.0.1.tgz", - "integrity": "sha512-Hl3aUJqu/7LMslHM6mz9Sk1mpFwe4jW5QcmJgukcUGFILBcQW5L9ot8BUVRSuUaW3o/1Twrwmu7w2NTGvw76cA==" + "license": "MIT" }, "node_modules/mri": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", - "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/ms": { "version": "0.7.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.3.tgz", - "integrity": "sha1-cIFVpeROM/X9D8U+gdDUCpG+H/8=" + "license": "MIT" }, "node_modules/multiaddr": { "version": "10.0.1", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-10.0.1.tgz", - "integrity": "sha512-G5upNcGzEGuTHkzxezPrrD6CaIHR9uo+7MwqhNVcXTs33IInon4y7nMiGxl2CY5hG7chvYQUQhz5V52/Qe3cbg==", + "license": "MIT", "dependencies": { "dns-over-http-resolver": "^1.2.3", "err-code": "^3.0.1", @@ -12220,21 +11068,18 @@ }, "node_modules/multiaddr-to-uri": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/multiaddr-to-uri/-/multiaddr-to-uri-7.0.0.tgz", - "integrity": "sha512-VbscDpLcbV0m25tJqfnZSfbjVUuNlPa4BbD5l/7me1t0lc3SWI0XAoO5E/PNJF0e1qUlbdq7yjVFEQjUT+9r0g==", + "license": "MIT", "dependencies": { "multiaddr": "^9.0.1" } }, "node_modules/multiaddr-to-uri/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/multiaddr-to-uri/node_modules/multiaddr": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", - "integrity": "sha512-YFaEb9t4yXSbaGksSEdg+Kn2U02s7w4wXUgyEMQmPxFJj7CfVHY10WOsScAX/rK6Soa15S1zXYadqH9TtlVreQ==", + "license": "MIT", "dependencies": { "cids": "^1.0.0", "dns-over-http-resolver": "^1.0.0", @@ -12247,22 +11092,18 @@ }, "node_modules/multiaddr-to-uri/node_modules/uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", + "license": "MIT", "dependencies": { "multiformats": "^9.4.2" } }, "node_modules/multiaddr/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/multibase": { "version": "4.0.6", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-4.0.6.tgz", - "integrity": "sha512-x23pDe5+svdLz/k5JPGCVdfn7Q5mZVMBETiC+ORfO+sor9Sgs0smJzAjfTbM5tckeCqnaUuMYoz+k3RXMmJClQ==", - "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", "dependencies": { "@multiformats/base-x": "^4.0.1" }, @@ -12273,9 +11114,7 @@ }, "node_modules/multicodec": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-2.1.3.tgz", - "integrity": "sha512-0tOH2Gtio39uO41o+2xl9UhRkCWxU5ZmZSbFCh/OjGzkWJI8e6lkN/s4Mj1YfyWoBod+2+S3W+6wO6nhkwN8pA==", - "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", "dependencies": { "uint8arrays": "1.1.0", "varint": "^6.0.0" @@ -12283,9 +11122,7 @@ }, "node_modules/multicodec/node_modules/multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", - "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", "dependencies": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -12297,8 +11134,7 @@ }, "node_modules/multicodec/node_modules/uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", + "license": "MIT", "dependencies": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" @@ -12306,13 +11142,11 @@ }, "node_modules/multiformats": { "version": "9.6.4", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.6.4.tgz", - "integrity": "sha512-fCCB6XMrr6CqJiHNjfFNGT0v//dxOBMrOMqUIzpPc/mmITweLEyhvMpY9bF+jZ9z3vaMAau5E8B68DW77QMXkg==" + "license": "(Apache-2.0 AND MIT)" }, "node_modules/multihashes": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-4.0.3.tgz", - "integrity": "sha512-0AhMH7Iu95XjDLxIeuCOOE4t9+vQZsACyKZ9Fxw2pcsRmlX4iCn1mby0hS0bb+nQOVpdQYWPpnyusw4da5RPhA==", + "license": "MIT", "dependencies": { "multibase": "^4.0.1", "uint8arrays": "^3.0.0", @@ -12325,13 +11159,11 @@ }, "node_modules/multihashes/node_modules/varint": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "license": "MIT" }, "node_modules/multihashing-async": { "version": "2.1.4", - "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-2.1.4.tgz", - "integrity": "sha512-sB1MiQXPSBTNRVSJc2zM157PXgDtud2nMFUEIvBrsq5Wv96sUclMRK/ecjoP1T/W61UJBqt4tCTwMkUpt2Gbzg==", + "license": "MIT", "dependencies": { "blakejs": "^1.1.0", "err-code": "^3.0.0", @@ -12347,13 +11179,11 @@ }, "node_modules/multihashing-async/node_modules/err-code": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "license": "MIT" }, "node_modules/multistream-select": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/multistream-select/-/multistream-select-1.0.0.tgz", - "integrity": "sha512-82riQ+qZ0RPY+KbRdeeKKQnFSBCVpUbZ15EniGU2nfwM8NdrpPIeUYXFw4a/pyprcNeRfMgLlG9aCh874p8nJg==", + "license": "MIT", "dependencies": { "bl": "^4.0.0", "debug": "^4.1.1", @@ -12368,8 +11198,7 @@ }, "node_modules/multistream-select/node_modules/bl": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -12378,8 +11207,6 @@ }, "node_modules/multistream-select/node_modules/buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -12394,6 +11221,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -12401,8 +11229,7 @@ }, "node_modules/multistream-select/node_modules/it-handshake": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/it-handshake/-/it-handshake-1.0.2.tgz", - "integrity": "sha512-uutOim5xF1eyDQD3u8qd3TxbWKwxqGMlbvacZsRsPdjO1BD9lnPTVci0jSMGsvMOu+5Y3W/QQ4hPQb87qPmPVQ==", + "license": "MIT", "dependencies": { "it-pushable": "^1.4.0", "it-reader": "^2.0.0", @@ -12411,8 +11238,7 @@ }, "node_modules/multistream-select/node_modules/it-length-prefixed": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-3.1.0.tgz", - "integrity": "sha512-E5GwT6qfZEwh3/XThyYwgjKJ4/hxvTC9kdbj3gxXDeUDKtC7+K2T647sPeX7xDEWqunsnoQyvOrjoHPegaT3uw==", + "license": "MIT", "dependencies": { "@types/bl": "^2.1.0", "bl": "^4.0.2", @@ -12422,17 +11248,14 @@ }, "node_modules/multistream-select/node_modules/it-reader": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-2.1.0.tgz", - "integrity": "sha512-hSysqWTO9Tlwc5EGjVf8JYZzw0D2FsxD/g+eNNWrez9zODxWt6QlN6JAMmycK72Mv4jHEKEXoyzUN4FYGmJaZw==", + "license": "MIT", "dependencies": { "bl": "^4.0.0" } }, "node_modules/multistream-select/node_modules/multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", - "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", "dependencies": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -12444,8 +11267,7 @@ }, "node_modules/multistream-select/node_modules/uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", + "license": "MIT", "dependencies": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" @@ -12453,21 +11275,18 @@ }, "node_modules/multistream-select/node_modules/varint": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "license": "MIT" }, "node_modules/murmurhash3js-revisited": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz", - "integrity": "sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==", + "license": "MIT", "engines": { "node": ">=8.0.0" } }, "node_modules/mutable-proxy": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mutable-proxy/-/mutable-proxy-1.0.0.tgz", - "integrity": "sha512-4OvNRr1DJpy2QuDUV74m+BWZ//n4gG4bmd21MzDSPqHEidIDWqwyOjcadU1LBMO3vXYGurVKjfBrxrSQIHFu9A==", + "license": "MIT", "engines": { "node": ">=6.X.X", "npm": ">=3.X.X" @@ -12475,24 +11294,21 @@ }, "node_modules/mute-stream": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/mutexify": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/mutexify/-/mutexify-1.4.0.tgz", - "integrity": "sha512-pbYSsOrSB/AKN5h/WzzLRMFgZhClWccf2XIB4RSMC8JbquiB0e0/SH5AIfdQMdyHmYtv4seU7yV/TvAwPLJ1Yg==", "dev": true, + "license": "MIT", "dependencies": { "queue-tick": "^1.0.0" } }, "node_modules/mv": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz", - "integrity": "sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=", "dev": true, + "license": "MIT", "dependencies": { "mkdirp": "~0.5.1", "ncp": "~2.0.0", @@ -12504,9 +11320,8 @@ }, "node_modules/mv/node_modules/glob": { "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", "dev": true, + "license": "ISC", "dependencies": { "inflight": "^1.0.4", "inherits": "2", @@ -12520,9 +11335,8 @@ }, "node_modules/mv/node_modules/rimraf": { "version": "2.4.5", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", - "integrity": "sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=", "dev": true, + "license": "ISC", "dependencies": { "glob": "^6.0.1" }, @@ -12532,20 +11346,17 @@ }, "node_modules/nan": { "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" + "license": "MIT" }, "node_modules/nanoassert": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-1.1.0.tgz", - "integrity": "sha1-TzFS4JVA/eKMdvRLGbvNHVpCR40=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/nanobench": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nanobench/-/nanobench-2.1.1.tgz", - "integrity": "sha512-z+Vv7zElcjN+OpzAxAquUayFLGK3JI/ubCl0Oh64YQqsTGG09CGqieJVQw4ui8huDnnAgrvTv93qi5UaOoNj8A==", "dev": true, + "license": "MIT", "dependencies": { "browser-process-hrtime": "^0.1.2", "chalk": "^1.1.3", @@ -12559,27 +11370,24 @@ }, "node_modules/nanobench/node_modules/ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/nanobench/node_modules/ansi-styles": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/nanobench/node_modules/chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", @@ -12593,9 +11401,8 @@ }, "node_modules/nanobench/node_modules/strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^2.0.0" }, @@ -12605,18 +11412,16 @@ }, "node_modules/nanobench/node_modules/supports-color": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } }, "node_modules/nanohtml": { "version": "1.9.1", - "resolved": "https://registry.npmjs.org/nanohtml/-/nanohtml-1.9.1.tgz", - "integrity": "sha512-4snfp20yKdA6+dT1vv0F4l1oYmnFXPNHk3ZFTfOldD9LamFxQZ9gWk4gJz7wflq3XROLzrGQHfo0HT4V4kSkhQ==", "dev": true, + "license": "MIT", "dependencies": { "acorn-node": "^1.8.2", "camel-case": "^3.0.0", @@ -12632,9 +11437,8 @@ } }, "node_modules/nanoid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz", - "integrity": "sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==", + "version": "3.3.1", + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -12644,79 +11448,68 @@ }, "node_modules/napi-macros": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" + "license": "MIT" }, "node_modules/native-abort-controller": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/native-abort-controller/-/native-abort-controller-1.0.4.tgz", - "integrity": "sha512-zp8yev7nxczDJMoP6pDxyD20IU0T22eX8VwN2ztDccKvSZhRaV33yP1BGwKSZfXuqWUzsXopVFjBdau9OOAwMQ==", + "license": "MIT", "peerDependencies": { "abort-controller": "*" } }, "node_modules/native-fetch": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/native-fetch/-/native-fetch-3.0.0.tgz", - "integrity": "sha512-G3Z7vx0IFb/FQ4JxvtqGABsOTIqRWvgQz6e+erkB+JJD6LrszQtMozEHI4EkmgZQvnGHrpLVzUWk7t4sJCIkVw==", + "license": "MIT", "peerDependencies": { "node-fetch": "*" } }, "node_modules/natural-compare": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ncp": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", "dev": true, + "license": "MIT", "bin": { "ncp": "bin/ncp" } }, "node_modules/negotiator": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/neo-async": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/netmask": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", - "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "license": "MIT", "engines": { "node": ">= 0.4.0" } }, "node_modules/next-tick": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/nice-try": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/nise": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", - "integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==", + "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^1.7.0", "@sinonjs/fake-timers": "^6.0.0", @@ -12727,48 +11520,39 @@ }, "node_modules/nise/node_modules/isarray": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + "license": "MIT" }, "node_modules/nise/node_modules/path-to-regexp": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "license": "MIT", "dependencies": { "isarray": "0.0.1" } }, "node_modules/no-case": { "version": "2.3.2", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", "dev": true, + "license": "MIT", "dependencies": { "lower-case": "^1.1.1" } }, "node_modules/noble-ed25519": { "version": "1.2.6", - "resolved": "https://registry.npmjs.org/noble-ed25519/-/noble-ed25519-1.2.6.tgz", - "integrity": "sha512-zfnWqg9FVMp8CnzUpAjbt1nDXpDjCvxYiCXdnW1mY8zQHw/6twUlkFm14VPdojVzc0kcd+i9zT79+26GcNbsuQ==", - "deprecated": "Switch to namespaced @noble/ed25519 for security and feature updates" + "license": "MIT" }, "node_modules/noble-secp256k1": { "version": "1.2.14", - "resolved": "https://registry.npmjs.org/noble-secp256k1/-/noble-secp256k1-1.2.14.tgz", - "integrity": "sha512-GSCXyoZBUaaPwVWdYncMEmzlSUjF9J/YeEHpklYJCyg8wPuJP3NzDx0BkiwArzINkdX2HJHvUJhL6vVWPOQQcg==", - "deprecated": "Switch to namespaced @noble/secp256k1 for security and feature updates" + "license": "MIT" }, "node_modules/node-addon-api": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + "license": "MIT" }, "node_modules/node-dir": { "version": "0.1.17", - "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", - "integrity": "sha1-X1Zl2TNRM1yqvvjxxVRRbPXx5OU=", "dev": true, + "license": "MIT", "dependencies": { "minimatch": "^3.0.2" }, @@ -12778,8 +11562,7 @@ }, "node_modules/node-fetch": { "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -12797,16 +11580,14 @@ }, "node_modules/node-forge": { "version": "0.10.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", - "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==", + "license": "(BSD-3-Clause OR GPL-2.0)", "engines": { "node": ">= 6.0.0" } }, "node_modules/node-gyp-build": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", - "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", + "version": "4.3.0", + "license": "MIT", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -12815,9 +11596,8 @@ }, "node_modules/node-preload": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", - "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", "dev": true, + "license": "MIT", "dependencies": { "process-on-spawn": "^1.0.0" }, @@ -12826,33 +11606,29 @@ } }, "node_modules/node-releases": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.3.tgz", - "integrity": "sha512-maHFz6OLqYxz+VQyCAtA3PTX4UP/53pa05fyDNc9CwjvJ0yEh6+xBwKsgCxMNhS8taUKBFYxfuiaD9U/55iFaw==", - "dev": true + "version": "2.0.2", + "dev": true, + "license": "MIT" }, "node_modules/normalize-html-whitespace": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/normalize-html-whitespace/-/normalize-html-whitespace-0.2.0.tgz", - "integrity": "sha1-EBci9kI1Ucdc24+dEE/4UNrx4Q4=", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.10" } }, "node_modules/normalize-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/npm-run-path": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "license": "MIT", "dependencies": { "path-key": "^3.0.0" }, @@ -12862,32 +11638,28 @@ }, "node_modules/npm-run-path/node_modules/path-key": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/nwsapi": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/nyc": { "version": "15.1.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", - "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, + "license": "ISC", "dependencies": { "@istanbuljs/load-nyc-config": "^1.0.0", "@istanbuljs/schema": "^0.1.2", @@ -12926,27 +11698,24 @@ }, "node_modules/nyc-report-lcov-absolute": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/nyc-report-lcov-absolute/-/nyc-report-lcov-absolute-1.0.0.tgz", - "integrity": "sha512-sDq0XM0on9casPNySxGD/WSy17m95+e8xEhObNHoxVRsTIZZt8akop4WWisnjzEWRARGW91Ip6oRhIWmy4qcPw==", "dev": true, + "license": "MIT", "peerDependencies": { "istanbul-reports": "^3.0.0" } }, "node_modules/nyc/node_modules/ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/nyc/node_modules/cliui": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -12955,9 +11724,8 @@ }, "node_modules/nyc/node_modules/make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^6.0.0" }, @@ -12970,9 +11738,8 @@ }, "node_modules/nyc/node_modules/p-map": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, + "license": "MIT", "dependencies": { "aggregate-error": "^3.0.0" }, @@ -12982,18 +11749,16 @@ }, "node_modules/nyc/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, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/nyc/node_modules/rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -13006,9 +11771,8 @@ }, "node_modules/nyc/node_modules/strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -13018,9 +11782,8 @@ }, "node_modules/nyc/node_modules/wrap-ansi": { "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -13032,15 +11795,13 @@ }, "node_modules/nyc/node_modules/y18n": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/nyc/node_modules/yargs": { "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^6.0.0", "decamelize": "^1.2.0", @@ -13060,9 +11821,8 @@ }, "node_modules/nyc/node_modules/yargs-parser": { "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, + "license": "ISC", "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -13073,41 +11833,36 @@ }, "node_modules/oauth-sign": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "license": "Apache-2.0", "engines": { "node": "*" } }, "node_modules/object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/object-hash": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz", - "integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==", + "license": "MIT", "engines": { "node": ">= 6" } }, "node_modules/object-inspect": { "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-is": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -13121,16 +11876,14 @@ }, "node_modules/object-keys": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/object.assign": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", @@ -13145,9 +11898,8 @@ } }, "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "version": "2.3.0", + "license": "MIT", "dependencies": { "ee-first": "1.1.1" }, @@ -13157,43 +11909,38 @@ }, "node_modules/on-headers": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/on-net-listen": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/on-net-listen/-/on-net-listen-1.1.2.tgz", - "integrity": "sha512-y1HRYy8s/RlcBvDUwKXSmkODMdx4KSuIvloCnQYJ2LdBBC1asY4HtfhXwe3UWknLakATZDnbzht2Ijw3M1EqFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=9.4.0 || ^8.9.4" } }, "node_modules/once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, + "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/one-time": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", - "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "license": "MIT", "dependencies": { "fn.name": "1.x.x" } }, "node_modules/onetime": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" }, @@ -13206,18 +11953,16 @@ }, "node_modules/opencollective-postinstall": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", "dev": true, + "license": "MIT", "bin": { "opencollective-postinstall": "index.js" } }, "node_modules/opn": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", - "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", "dev": true, + "license": "MIT", "dependencies": { "is-wsl": "^1.1.0" }, @@ -13227,18 +11972,16 @@ }, "node_modules/opn/node_modules/is-wsl": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/optionator": { "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, + "license": "MIT", "dependencies": { "deep-is": "~0.1.3", "fast-levenshtein": "~2.0.6", @@ -13253,32 +11996,28 @@ }, "node_modules/os-browserify": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/p-any": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-any/-/p-any-3.0.0.tgz", - "integrity": "sha512-5rqbqfsRWNb0sukt0awwgJMlaep+8jV45S15SKKB34z4UuzjcofIfnriCBhWjZP2jbVtjt9yRl7buB6RlKsu9w==", + "license": "MIT", "dependencies": { "p-cancelable": "^2.0.0", "p-some": "^5.0.0" @@ -13292,24 +12031,21 @@ }, "node_modules/p-cancelable": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/p-defer": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-3.0.0.tgz", - "integrity": "sha512-ugZxsxmtTln604yeYd29EGrNhazN2lywetzpKhfmQjW/VJmhpDmWbiX+h0zL8V91R0UXkhb3KtPmyq9PZw3aYw==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/p-fifo": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-fifo/-/p-fifo-1.0.0.tgz", - "integrity": "sha512-IjoCxXW48tqdtDFz6fqo5q1UfFVjjVZe8TC1QRflvNUJtNfCUhxOUw6MOVZhDPjqhSzc26xKdugsO17gmzd5+A==", + "license": "MIT", "dependencies": { "fast-fifo": "^1.0.0", "p-defer": "^3.0.0" @@ -13317,8 +12053,7 @@ }, "node_modules/p-filter": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz", - "integrity": "sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==", + "license": "MIT", "dependencies": { "p-map": "^2.0.0" }, @@ -13328,24 +12063,21 @@ }, "node_modules/p-filter/node_modules/p-map": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/p-finally": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/p-limit": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, @@ -13358,9 +12090,8 @@ }, "node_modules/p-locate": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^2.2.0" }, @@ -13370,8 +12101,7 @@ }, "node_modules/p-map": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "license": "MIT", "dependencies": { "aggregate-error": "^3.0.0" }, @@ -13384,8 +12114,7 @@ }, "node_modules/p-queue": { "version": "6.6.2", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", - "integrity": "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==", + "license": "MIT", "dependencies": { "eventemitter3": "^4.0.4", "p-timeout": "^3.2.0" @@ -13399,8 +12128,7 @@ }, "node_modules/p-queue/node_modules/p-timeout": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "license": "MIT", "dependencies": { "p-finally": "^1.0.0" }, @@ -13410,16 +12138,14 @@ }, "node_modules/p-reflect": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-reflect/-/p-reflect-2.1.0.tgz", - "integrity": "sha512-paHV8NUz8zDHu5lhr/ngGWQiW067DK/+IbJ+RfZ4k+s8y4EKyYCz8pGYWjxCg35eHztpJAt+NUgvN4L+GCbPlg==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/p-retry": { "version": "4.6.1", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.1.tgz", - "integrity": "sha512-e2xXGNhZOZ0lfgR9kL34iGlU8N/KO0xZnQxVEwdeOvpqNDQfdnxIYizvWtK8RglUa3bGqI8g0R/BdfzLMxRkiA==", + "license": "MIT", "dependencies": { "@types/retry": "^0.12.0", "retry": "^0.13.1" @@ -13430,8 +12156,7 @@ }, "node_modules/p-settle": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/p-settle/-/p-settle-4.1.1.tgz", - "integrity": "sha512-6THGh13mt3gypcNMm0ADqVNCcYa3BK6DWsuJWFCuEKP1rpY+OKGp7gaZwVmLspmic01+fsg/fN57MfvDzZ/PuQ==", + "license": "MIT", "dependencies": { "p-limit": "^2.2.2", "p-reflect": "^2.1.0" @@ -13445,8 +12170,7 @@ }, "node_modules/p-some": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-some/-/p-some-5.0.0.tgz", - "integrity": "sha512-Js5XZxo6vHjB9NOYAzWDYAIyyiPvva0DWESAIWIK7uhSpGsyg5FwUPxipU/SOQx5x9EqhOh545d1jo6cVkitig==", + "license": "MIT", "dependencies": { "aggregate-error": "^3.0.0", "p-cancelable": "^2.0.0" @@ -13460,16 +12184,14 @@ }, "node_modules/p-timeout": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-4.1.0.tgz", - "integrity": "sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==", + "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/p-times": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-times/-/p-times-3.0.0.tgz", - "integrity": "sha512-/Z7mcs8Liie8E7IHI9SBtmkHVW/GjLroQ94ALoAMIG20mqFMuh56/3WYhtOTqX9ccRSOxgaCkFC94Bat1Ofskg==", + "license": "MIT", "dependencies": { "p-map": "^4.0.0" }, @@ -13482,16 +12204,14 @@ }, "node_modules/p-try": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/p-wait-for": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-3.2.0.tgz", - "integrity": "sha512-wpgERjNkLrBiFmkMEjuZJEWKKDrNfHCKA1OhyN1wg1FrLkULbviEy6py1AyJUgZ72YWFbZ38FIpnqvVqAlDUwA==", + "license": "MIT", "dependencies": { "p-timeout": "^3.0.0" }, @@ -13504,8 +12224,7 @@ }, "node_modules/p-wait-for/node_modules/p-timeout": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "license": "MIT", "dependencies": { "p-finally": "^1.0.0" }, @@ -13515,9 +12234,8 @@ }, "node_modules/package-hash": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", - "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", "dev": true, + "license": "ISC", "dependencies": { "graceful-fs": "^4.1.15", "hasha": "^5.0.0", @@ -13530,9 +12248,8 @@ }, "node_modules/pad": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/pad/-/pad-3.2.0.tgz", - "integrity": "sha512-2u0TrjcGbOjBTJpyewEl4hBO3OeX5wWue7eIFPzQTg6wFSvoaHcBTTUY5m+n0hd04gmTCPuY0kCpVIVuw5etwg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "wcwidth": "^1.0.1" }, @@ -13542,15 +12259,13 @@ }, "node_modules/pako": { "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true + "dev": true, + "license": "(MIT AND Zlib)" }, "node_modules/parent-module": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -13560,18 +12275,16 @@ }, "node_modules/parents": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", "dev": true, + "license": "MIT", "dependencies": { "path-platform": "~0.11.15" } }, "node_modules/parse-asn1": { "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", "dev": true, + "license": "ISC", "dependencies": { "asn1.js": "^5.2.0", "browserify-aes": "^1.0.0", @@ -13582,9 +12295,8 @@ }, "node_modules/parse-json": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -13600,100 +12312,87 @@ }, "node_modules/parse5": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", - "integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/parseurl": { "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/path-browserify": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/path-is-inside": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true + "dev": true, + "license": "(WTFPL OR MIT)" }, "node_modules/path-key": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/path-parse": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/path-platform": { "version": "0.11.15", - "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", - "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } }, "node_modules/path-to-regexp": { "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/path-type": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/pathval": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "license": "MIT", "engines": { "node": "*" } }, "node_modules/pbkdf2": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", "dev": true, + "license": "MIT", "dependencies": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -13707,8 +12406,7 @@ }, "node_modules/peer-id": { "version": "0.14.8", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.14.8.tgz", - "integrity": "sha512-GpuLpob/9FrEFvyZrKKsISEkaBYsON2u0WtiawLHj1ii6ewkoeRiSDFLyIefYhw0jGvQoeoZS05jaT52X7Bvig==", + "license": "MIT", "dependencies": { "cids": "^1.1.5", "class-is": "^1.1.0", @@ -13727,16 +12425,14 @@ }, "node_modules/peer-id/node_modules/uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", + "license": "MIT", "dependencies": { "multiformats": "^9.4.2" } }, "node_modules/pem-jwk": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pem-jwk/-/pem-jwk-2.0.0.tgz", - "integrity": "sha512-rFxu7rVoHgQ5H9YsP50dDWf0rHjreVA2z0yPiWr5WdH/UHb29hKtF7h6l8vNd1cbYR1t0QL+JKhW55a2ZV4KtA==", + "license": "MPL-2.0", "dependencies": { "asn1.js": "^5.0.1" }, @@ -13749,9 +12445,8 @@ }, "node_modules/perf-sym": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/perf-sym/-/perf-sym-2.0.3.tgz", - "integrity": "sha512-dEVkxyeQ/LroVSVEx94UHsftLNLNR3fs6OGfxWXBOKaNb1XZUb0Evr49RTFFYpJakMCa1MLMxoGDzHu4VENCTg==", "dev": true, + "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "minimist": "^1.2.0", @@ -13766,9 +12461,8 @@ }, "node_modules/perf-sym/node_modules/pump": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", "dev": true, + "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -13776,29 +12470,25 @@ }, "node_modules/perf-sym/node_modules/split2": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", "dev": true, + "license": "ISC", "dependencies": { "through2": "^2.0.2" } }, "node_modules/performance-now": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "license": "MIT" }, "node_modules/picocolors": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -13808,27 +12498,24 @@ }, "node_modules/pify": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/pinkie": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/pinkie-promise": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, + "license": "MIT", "dependencies": { "pinkie": "^2.0.0" }, @@ -13838,9 +12525,8 @@ }, "node_modules/pino": { "version": "5.17.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-5.17.0.tgz", - "integrity": "sha512-LqrqmRcJz8etUjyV0ddqB6OTUutCgQULPFg2b4dtijRHUsucaAdBgSUW58vY6RFSX+NT8963F+q0tM6lNwGShA==", "dev": true, + "license": "MIT", "dependencies": { "fast-redact": "^2.0.0", "fast-safe-stringify": "^2.0.7", @@ -13855,9 +12541,8 @@ }, "node_modules/pino-pretty": { "version": "2.6.1", - "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-2.6.1.tgz", - "integrity": "sha512-e/CWtKLidqkr7sinfIVVcsfcHgnFVlGvuEfKuuPFnxBo+9dZZsmgF8a9Rj7SYJ5LMZ8YBxNY9Ca46eam4ajKtQ==", "dev": true, + "license": "MIT", "dependencies": { "args": "^5.0.0", "chalk": "^2.3.2", @@ -13875,9 +12560,8 @@ }, "node_modules/pino-pretty/node_modules/ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -13887,9 +12571,8 @@ }, "node_modules/pino-pretty/node_modules/chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -13901,33 +12584,29 @@ }, "node_modules/pino-pretty/node_modules/color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "1.1.3" } }, "node_modules/pino-pretty/node_modules/color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pino-pretty/node_modules/has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/pino-pretty/node_modules/supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -13937,15 +12616,13 @@ }, "node_modules/pino-std-serializers": { "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-2.5.0.tgz", - "integrity": "sha512-wXqbqSrIhE58TdrxxlfLwU9eDhrzppQDvGhBEr1gYbzzM4KKo3Y63gSjiDXRKLVS2UOXdPNR2v+KnQgNrs+xUg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pkg-conf": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", - "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", "dev": true, + "license": "MIT", "dependencies": { "find-up": "^2.0.0", "load-json-file": "^4.0.0" @@ -13956,9 +12633,8 @@ }, "node_modules/pkg-conf/node_modules/find-up": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^2.0.0" }, @@ -13968,9 +12644,8 @@ }, "node_modules/pkg-conf/node_modules/locate-path": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" @@ -13981,9 +12656,8 @@ }, "node_modules/pkg-conf/node_modules/p-limit": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, + "license": "MIT", "dependencies": { "p-try": "^1.0.0" }, @@ -13993,9 +12667,8 @@ }, "node_modules/pkg-conf/node_modules/p-locate": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^1.1.0" }, @@ -14005,27 +12678,24 @@ }, "node_modules/pkg-conf/node_modules/p-try": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/pkg-conf/node_modules/path-exists": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/pkg-config": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz", - "integrity": "sha1-VX7yLXPaPIg3EHdmxS6tq94pj+Q=", "dev": true, + "license": "MIT", "dependencies": { "debug-log": "^1.0.0", "find-root": "^1.0.0", @@ -14037,9 +12707,8 @@ }, "node_modules/pkg-dir": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", - "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", "dev": true, + "license": "MIT", "dependencies": { "find-up": "^5.0.0" }, @@ -14049,9 +12718,8 @@ }, "node_modules/pkg-dir/node_modules/find-up": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -14065,9 +12733,8 @@ }, "node_modules/pkg-dir/node_modules/locate-path": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -14080,9 +12747,8 @@ }, "node_modules/pkg-dir/node_modules/p-limit": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -14095,9 +12761,8 @@ }, "node_modules/pkg-dir/node_modules/p-locate": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -14110,9 +12775,8 @@ }, "node_modules/pkg-up": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", - "integrity": "sha1-Pgj7RhUlxEIWJKM7n35tCvWwWiY=", "dev": true, + "license": "MIT", "dependencies": { "find-up": "^1.0.0" }, @@ -14122,9 +12786,8 @@ }, "node_modules/pkg-up/node_modules/find-up": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, + "license": "MIT", "dependencies": { "path-exists": "^2.0.0", "pinkie-promise": "^2.0.0" @@ -14135,9 +12798,8 @@ }, "node_modules/pkg-up/node_modules/path-exists": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, + "license": "MIT", "dependencies": { "pinkie-promise": "^2.0.0" }, @@ -14147,54 +12809,46 @@ }, "node_modules/pkginfo": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz", - "integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4.0" } }, "node_modules/platform": { "version": "1.3.6", - "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", - "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/please-upgrade-node": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", "dev": true, + "license": "MIT", "dependencies": { "semver-compare": "^1.0.0" } }, "node_modules/pluralize": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", - "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pn": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/prelude-ls": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true, "engines": { "node": ">= 0.8.0" } }, "node_modules/prettier": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", - "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "version": "2.6.0", "dev": true, + "license": "MIT", "bin": { "prettier": "bin-prettier.js" }, @@ -14207,9 +12861,8 @@ }, "node_modules/prettier-linter-helpers": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", "dev": true, + "license": "MIT", "dependencies": { "fast-diff": "^1.1.2" }, @@ -14219,18 +12872,16 @@ }, "node_modules/pretty-hrtime": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/pretty-trace": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/pretty-trace/-/pretty-trace-0.3.1.tgz", - "integrity": "sha1-hexuZ2zlQIbok1kZEPsX1S0sImI=", "dev": true, + "license": "MIT", "dependencies": { "ansicolors": "~0.2.1", "split2": "~0.2.1" @@ -14241,15 +12892,13 @@ }, "node_modules/pretty-trace/node_modules/isarray": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pretty-trace/node_modules/readable-stream": { "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", @@ -14259,33 +12908,39 @@ }, "node_modules/pretty-trace/node_modules/split2": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/split2/-/split2-0.2.1.tgz", - "integrity": "sha1-At2smtwD7Au3jBKC7Aecpuha6QA=", "dev": true, + "license": "ISC", "dependencies": { "through2": "~0.6.1" } }, "node_modules/pretty-trace/node_modules/string_decoder": { "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pretty-trace/node_modules/through2": { "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", "dev": true, + "license": "MIT", "dependencies": { "readable-stream": ">=1.0.33-1 <1.1.0-0", "xtend": ">=4.0.0 <4.1.0-0" } }, + "node_modules/printj": { + "version": "1.3.1", + "license": "Apache-2.0", + "bin": { + "printj": "bin/printj.njs" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/private-ip": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/private-ip/-/private-ip-2.3.3.tgz", - "integrity": "sha512-5zyFfekIVUOTVbL92hc8LJOtE/gyGHeREHkJ2yTyByP8Q2YZVoBqLg3EfYLeF0oVvGqtaEX2t2Qovja0/gStXw==", + "license": "MIT", "dependencies": { "ip-regex": "^4.3.0", "ipaddr.js": "^2.0.1", @@ -14295,23 +12950,20 @@ }, "node_modules/process": { "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6.0" } }, "node_modules/process-nextick-args": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "license": "MIT" }, "node_modules/process-on-spawn": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", - "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", "dev": true, + "license": "MIT", "dependencies": { "fromentries": "^1.2.0" }, @@ -14321,17 +12973,15 @@ }, "node_modules/progress": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/promise-to-callback": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/promise-to-callback/-/promise-to-callback-1.0.0.tgz", - "integrity": "sha1-XSp0kBC/tn2WNZj805YHRqaP7vc=", + "license": "MIT", "dependencies": { "is-fn": "^1.0.0", "set-immediate-shim": "^1.0.1" @@ -14342,9 +12992,8 @@ }, "node_modules/protobufjs": { "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -14367,13 +13016,11 @@ }, "node_modules/protocol-buffers-schema": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", - "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==" + "license": "MIT" }, "node_modules/protons": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/protons/-/protons-2.0.3.tgz", - "integrity": "sha512-j6JikP/H7gNybNinZhAHMN07Vjr1i4lVupg598l4I9gSTjJqOvKnwjzYX2PzvBTSVf2eZ2nWv4vG+mtW8L6tpA==", + "license": "MIT", "dependencies": { "protocol-buffers-schema": "^3.3.1", "signed-varint": "^2.0.1", @@ -14383,14 +13030,12 @@ }, "node_modules/protons/node_modules/varint": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "license": "MIT" }, "node_modules/proxy-addr": { "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", "dev": true, + "license": "MIT", "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" @@ -14401,28 +13046,24 @@ }, "node_modules/proxy-addr/node_modules/ipaddr.js": { "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.10" } }, "node_modules/prr": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + "license": "MIT" }, "node_modules/psl": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "license": "MIT" }, "node_modules/public-encrypt": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", "dev": true, + "license": "MIT", "dependencies": { "bn.js": "^4.1.0", "browserify-rsa": "^4.0.0", @@ -14432,17 +13073,20 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "dev": true, + "license": "MIT" + }, "node_modules/pull-pair": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pull-pair/-/pull-pair-1.1.0.tgz", - "integrity": "sha1-fuQnJj/fTaglOXrAoF4atLdL120=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pump": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, + "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -14450,9 +13094,8 @@ }, "node_modules/pumpify": { "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", "dev": true, + "license": "MIT", "dependencies": { "duplexify": "^3.6.0", "inherits": "^2.0.3", @@ -14461,9 +13104,8 @@ }, "node_modules/pumpify/node_modules/pump": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "dev": true, + "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -14471,34 +13113,27 @@ }, "node_modules/punycode": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/qheap": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/qheap/-/qheap-1.4.0.tgz", - "integrity": "sha1-LSY+20wfckSnpZH5t3ZFvLzZ3S4=", + "license": "Apache-2.0", "engines": { "node": "*" } }, "node_modules/qjobs": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.9" } }, "node_modules/qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", - "dependencies": { - "side-channel": "^1.0.4" - }, + "version": "6.9.7", + "license": "BSD-3-Clause", "engines": { "node": ">=0.6" }, @@ -14508,9 +13143,6 @@ }, "node_modules/querystring": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", "dev": true, "engines": { "node": ">=0.4.x" @@ -14518,8 +13150,6 @@ }, "node_modules/querystring-es3": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true, "engines": { "node": ">=0.4.x" @@ -14527,8 +13157,6 @@ }, "node_modules/queue-microtask": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { @@ -14543,19 +13171,18 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/queue-tick": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.0.tgz", - "integrity": "sha512-ULWhjjE8BmiICGn3G8+1L9wFpERNxkf8ysxkAer4+TFdRefDaXOCV5m92aMB9FtBVmn/8sETXLXY6BfW7hyaWQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/quibble": { "version": "0.6.8", - "resolved": "https://registry.npmjs.org/quibble/-/quibble-0.6.8.tgz", - "integrity": "sha512-HQ89ZADQ4uZjyePn1yACZADE3OUQ16Py5gkVxcoPvV6IRiItAgGMBkeQ5f1rOnnnsVKccMdhic0xABd7+cY/jA==", "dev": true, + "license": "MIT", "dependencies": { "lodash": "^4.17.21", "resolve": "^1.20.0" @@ -14567,23 +13194,20 @@ }, "node_modules/quick-format-unescaped": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-3.0.3.tgz", - "integrity": "sha512-dy1yjycmn9blucmJLXOfZDx1ikZJUi6E8bBZLnhPG5gBrVhHXx2xVyqqgKBubVNEXmx51dBACMHpoMQK/N/AXQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/randombytes": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } }, "node_modules/randomfill": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, + "license": "MIT", "dependencies": { "randombytes": "^2.0.5", "safe-buffer": "^5.1.0" @@ -14591,20 +13215,18 @@ }, "node_modules/range-parser": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.4.3", + "license": "MIT", "dependencies": { "bytes": "3.1.2", - "http-errors": "2.0.0", + "http-errors": "1.8.1", "iconv-lite": "0.4.24", "unpipe": "1.0.0" }, @@ -14614,32 +13236,28 @@ }, "node_modules/react-native-fetch-api": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/react-native-fetch-api/-/react-native-fetch-api-2.0.0.tgz", - "integrity": "sha512-GOA8tc1EVYLnHvma/TU9VTgLOyralO7eATRuCDchQveXW9Fr9vXygyq9iwqmM7YRZ8qRJfEt9xOS7OYMdJvRFw==", + "license": "MIT", "dependencies": { "p-defer": "^3.0.0" } }, "node_modules/read-only-stream": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", "dev": true, + "license": "MIT", "dependencies": { "readable-stream": "^2.0.2" } }, "node_modules/read-only-stream/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/read-only-stream/node_modules/readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -14652,23 +13270,20 @@ }, "node_modules/read-only-stream/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/read-only-stream/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/readable-stream": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -14680,9 +13295,8 @@ }, "node_modules/readdirp": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, + "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, @@ -14692,9 +13306,8 @@ }, "node_modules/readline2": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", - "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", "dev": true, + "license": "MIT", "dependencies": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -14703,9 +13316,8 @@ }, "node_modules/readline2/node_modules/is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, + "license": "MIT", "dependencies": { "number-is-nan": "^1.0.0" }, @@ -14715,28 +13327,24 @@ }, "node_modules/readline2/node_modules/mute-stream": { "version": "0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", - "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/receptacle": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/receptacle/-/receptacle-1.3.2.tgz", - "integrity": "sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A==", + "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/receptacle/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "license": "MIT" }, "node_modules/rechoir": { "version": "0.7.1", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", - "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", "dev": true, + "license": "MIT", "dependencies": { "resolve": "^1.9.0" }, @@ -14746,15 +13354,13 @@ }, "node_modules/regenerator-runtime": { "version": "0.10.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/regexp.prototype.flags": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.1.tgz", - "integrity": "sha512-pMR7hBVUUGI7PMA37m2ofIdQCsomVnas+Jn5UPGAHQ+/LlwKm/aTLJHdasmHRzlfeZwHiAOaRSo2rbBDm3nNUQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -14768,9 +13374,8 @@ }, "node_modules/regexpp": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -14780,9 +13385,8 @@ }, "node_modules/release-zalgo": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", "dev": true, + "license": "ISC", "dependencies": { "es6-error": "^4.0.1" }, @@ -14792,9 +13396,7 @@ }, "node_modules/request": { "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "license": "Apache-2.0", "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -14823,9 +13425,8 @@ }, "node_modules/request-promise-core": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", - "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", "dev": true, + "license": "ISC", "dependencies": { "lodash": "^4.17.19" }, @@ -14838,10 +13439,8 @@ }, "node_modules/request-promise-native": { "version": "1.0.9", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", - "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", - "deprecated": "request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142", "dev": true, + "license": "ISC", "dependencies": { "request-promise-core": "1.1.4", "stealthy-require": "^1.1.1", @@ -14856,40 +13455,34 @@ }, "node_modules/request/node_modules/qs": { "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.6" } }, "node_modules/request/node_modules/uuid": { "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "license": "MIT", "bin": { "uuid": "bin/uuid" } }, "node_modules/require-directory": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/require-main-filename": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/require-uncached": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, + "license": "MIT", "dependencies": { "caller-path": "^0.1.0", "resolve-from": "^1.0.0" @@ -14900,24 +13493,21 @@ }, "node_modules/require-uncached/node_modules/resolve-from": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/requires-port": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/resolve": { "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.8.1", "path-parse": "^1.0.7", @@ -14932,9 +13522,8 @@ }, "node_modules/resolve-cwd": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, + "license": "MIT", "dependencies": { "resolve-from": "^5.0.0" }, @@ -14944,27 +13533,24 @@ }, "node_modules/resolve-cwd/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, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/resolve-from": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/resolve-jit-symbols": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/resolve-jit-symbols/-/resolve-jit-symbols-0.5.0.tgz", - "integrity": "sha1-kFsz9socoGbxEtrafM4w9SuU9f0=", "dev": true, + "license": "MIT", "dependencies": { "pretty-trace": "~0.3.1" }, @@ -14974,9 +13560,8 @@ }, "node_modules/restore-cursor": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, + "license": "MIT", "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -14987,31 +13572,27 @@ }, "node_modules/resumer": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", - "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", "dev": true, + "license": "MIT", "dependencies": { "through": "~2.3.4" } }, "node_modules/retimer": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/retimer/-/retimer-2.0.0.tgz", - "integrity": "sha512-KLXY85WkEq2V2bKex/LOO1ViXVn2KGYe4PYysAdYdjmraYIUsVkXu8O4am+8+5UbaaGl1qho4aqAAPHNQ4GSbg==" + "license": "MIT" }, "node_modules/retry": { "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/reusify": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -15019,15 +13600,13 @@ }, "node_modules/rfdc": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/rimraf": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -15037,9 +13616,8 @@ }, "node_modules/ripemd160": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, + "license": "MIT", "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -15051,17 +13629,14 @@ }, "node_modules/run-async": { "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/run-parallel": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "funding": [ { @@ -15077,26 +13652,23 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } }, "node_modules/rustbn.js": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" + "license": "(MIT OR Apache-2.0)" }, "node_modules/rx-lite": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", - "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", "dev": true }, "node_modules/rxjs": { "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { "tslib": "^1.9.0" }, @@ -15106,8 +13678,6 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -15121,46 +13691,41 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/safe-json-stringify": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", - "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/safe-stable-stringify": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz", - "integrity": "sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg==", + "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "license": "MIT" }, "node_modules/sanitize-filename": { "version": "1.6.3", - "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", - "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", + "license": "WTFPL OR ISC", "dependencies": { "truncate-utf8-bytes": "^1.0.0" } }, "node_modules/sax": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "license": "ISC" }, "node_modules/saxes": { "version": "3.1.11", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.11.tgz", - "integrity": "sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g==", "dev": true, + "license": "ISC", "dependencies": { "xmlchars": "^2.1.1" }, @@ -15170,17 +13735,15 @@ }, "node_modules/scanf": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/scanf/-/scanf-1.1.2.tgz", - "integrity": "sha512-AjyDCF9jrLcGl+wbH2OO0vfpMUNmv6skJuuLL/vgDUmG/0YXCT6SVBTOvZXOPAD5raJLtDtUU7v0yF79JDuAqA==", + "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/schema-utils": { "version": "2.7.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", - "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", "dev": true, + "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.5", "ajv": "^6.12.4", @@ -15196,9 +13759,8 @@ }, "node_modules/secp256k1": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", "hasInstallScript": true, + "license": "MIT", "dependencies": { "elliptic": "^6.5.4", "node-addon-api": "^2.0.0", @@ -15210,32 +13772,28 @@ }, "node_modules/semaphore-async-await": { "version": "1.5.1", - "resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz", - "integrity": "sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo=", + "license": "MIT", "engines": { "node": ">=4.1" } }, "node_modules/semver": { "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } }, "node_modules/semver-compare": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/semver-regex": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.3.tgz", - "integrity": "sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -15245,9 +13803,8 @@ }, "node_modules/send": { "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "dev": true, + "license": "MIT", "dependencies": { "debug": "2.6.9", "depd": "~1.1.2", @@ -15269,39 +13826,21 @@ }, "node_modules/send/node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/send/node_modules/debug/node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/send/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/send/node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true + "license": "MIT" }, "node_modules/send/node_modules/http-errors": { "version": "1.7.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", - "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", "dev": true, + "license": "MIT", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.4", @@ -15315,9 +13854,8 @@ }, "node_modules/send/node_modules/mime": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true, + "license": "MIT", "bin": { "mime": "cli.js" }, @@ -15327,51 +13865,34 @@ }, "node_modules/send/node_modules/ms": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "node_modules/send/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", "dev": true, - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } + "license": "MIT" }, "node_modules/send/node_modules/setprototypeof": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/send/node_modules/toidentifier": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.6" } }, "node_modules/serialize-javascript": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } }, "node_modules/serve-static": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "dev": true, + "license": "MIT", "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", @@ -15384,39 +13905,33 @@ }, "node_modules/set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/set-delayed-interval": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/set-delayed-interval/-/set-delayed-interval-1.0.0.tgz", - "integrity": "sha512-29fhAwuZlLcuBnW/EwxvLcg2D3ELX+VBDNhnavs3YYkab72qmrcSeQNVdzl8EcPPahGQXhBM6MKdPLCQGMDakw==" + "license": "MIT" }, "node_modules/set-immediate-shim": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/setimmediate": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/setprototypeof": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + "license": "ISC" }, "node_modules/sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, + "license": "(MIT AND BSD-3-Clause)", "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -15427,9 +13942,8 @@ }, "node_modules/shallow-clone": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", "dev": true, + "license": "MIT", "dependencies": { "kind-of": "^6.0.2" }, @@ -15439,9 +13953,8 @@ }, "node_modules/shasum": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", - "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", "dev": true, + "license": "MIT", "dependencies": { "json-stable-stringify": "~0.0.0", "sha.js": "~2.4.4" @@ -15449,18 +13962,16 @@ }, "node_modules/shasum-object": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz", - "integrity": "sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "fast-safe-stringify": "^2.0.7" } }, "node_modules/shebang-command": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^1.0.0" }, @@ -15470,24 +13981,21 @@ }, "node_modules/shebang-regex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/shell-quote": { "version": "1.7.3", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", - "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/shelljs": { "version": "0.7.8", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", - "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "glob": "^7.0.0", "interpret": "^1.0.0", @@ -15503,17 +14011,14 @@ }, "node_modules/shelljs/node_modules/interpret": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.10" } }, "node_modules/shelljs/node_modules/rechoir": { "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "dependencies": { "resolve": "^1.1.6" @@ -15524,9 +14029,8 @@ }, "node_modules/shiki": { "version": "0.10.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.10.1.tgz", - "integrity": "sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng==", "dev": true, + "license": "MIT", "dependencies": { "jsonc-parser": "^3.0.0", "vscode-oniguruma": "^1.6.1", @@ -15535,8 +14039,7 @@ }, "node_modules/side-channel": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -15548,26 +14051,21 @@ }, "node_modules/signal-exit": { "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "license": "ISC" }, "node_modules/signed-varint": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/signed-varint/-/signed-varint-2.0.1.tgz", - "integrity": "sha1-UKmYnafJjCxh2tEZvJdHDvhSgSk=", + "license": "MIT", "dependencies": { "varint": "~5.0.0" } }, "node_modules/signed-varint/node_modules/varint": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "license": "MIT" }, "node_modules/simple-concat": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", "dev": true, "funding": [ { @@ -15582,44 +14080,40 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/simple-swizzle": { "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "license": "MIT", "dependencies": { "is-arrayish": "^0.3.1" } }, "node_modules/simple-swizzle/node_modules/is-arrayish": { "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + "license": "MIT" }, "node_modules/single-line-log": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/single-line-log/-/single-line-log-1.1.2.tgz", - "integrity": "sha1-wvg/Jzo+GhbtsJlWYdoO1e8DM2Q=", "dev": true, + "license": "MIT", "dependencies": { "string-width": "^1.0.1" } }, "node_modules/single-line-log/node_modules/ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/single-line-log/node_modules/is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, + "license": "MIT", "dependencies": { "number-is-nan": "^1.0.0" }, @@ -15629,9 +14123,8 @@ }, "node_modules/single-line-log/node_modules/string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, + "license": "MIT", "dependencies": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -15643,9 +14136,8 @@ }, "node_modules/single-line-log/node_modules/strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^2.0.0" }, @@ -15655,8 +14147,7 @@ }, "node_modules/sinon": { "version": "9.2.4", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", - "integrity": "sha512-zljcULZQsJxVra28qIAL6ow1Z9tpattkCTEJR4RBP3TGc00FcttsP5pK284Nas5WjMZU5Yzy3kAIp3B3KRf5Yg==", + "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^1.8.1", "@sinonjs/fake-timers": "^6.0.1", @@ -15672,18 +14163,16 @@ }, "node_modules/slash": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/slice-ansi": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.0", "astral-regex": "^1.0.0", @@ -15695,9 +14184,8 @@ }, "node_modules/slice-ansi/node_modules/ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -15707,38 +14195,33 @@ }, "node_modules/slice-ansi/node_modules/color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "1.1.3" } }, "node_modules/slice-ansi/node_modules/color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/snappyjs": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/snappyjs/-/snappyjs-0.6.1.tgz", - "integrity": "sha512-YIK6I2lsH072UE0aOFxxY1dPDCS43I5ktqHpeAsuLNYWkE5pGxRGWfDM4/vSUfNzXjC1Ivzt3qx31PCLmc9yqg==" + "license": "MIT" }, "node_modules/socket.io": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.4.1.tgz", - "integrity": "sha512-s04vrBswdQBUmuWJuuNTmXUVJhP0cVky8bBDhdkf8y0Ptsu7fKU2LuLbts9g+pdmAdyMMn8F/9Mf1/wbtUN0fg==", "dev": true, + "license": "MIT", "dependencies": { "accepts": "~1.3.4", "base64id": "~2.0.0", @@ -15753,15 +14236,13 @@ }, "node_modules/socket.io-adapter": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz", - "integrity": "sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/socket.io-parser": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz", - "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==", "dev": true, + "license": "MIT", "dependencies": { "@types/component-emitter": "^1.2.10", "component-emitter": "~1.3.0", @@ -15773,9 +14254,8 @@ }, "node_modules/solc": { "version": "0.8.13", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.13.tgz", - "integrity": "sha512-C0yTN+rjEOGO6uVOXI8+EKa75SFMuZpQ2tryex4QxWIg0HRWZvCHKfVPuLZ5wx06Sb6GBp6uQA5yqQyXZnXOJw==", "dev": true, + "license": "MIT", "dependencies": { "command-exists": "^1.2.8", "commander": "^8.1.0", @@ -15794,27 +14274,24 @@ }, "node_modules/solc/node_modules/commander": { "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", "dev": true, + "license": "MIT", "engines": { "node": ">= 12" } }, "node_modules/solc/node_modules/semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver" } }, "node_modules/sonic-boom": { "version": "0.7.7", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-0.7.7.tgz", - "integrity": "sha512-Ei5YOo5J64GKClHIL/5evJPgASXFVpfVYbJV9PILZQytTK6/LCwHvsZJW2Ig4p9FMC2OrBrMnXKgRN/OEoAWfg==", "dev": true, + "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0", "flatstr": "^1.0.12" @@ -15822,18 +14299,16 @@ }, "node_modules/source-map": { "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-support": { "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -15841,24 +14316,21 @@ }, "node_modules/source-map-support/node_modules/source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/sourcemap-codec": { "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/spawn-wrap": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", "dev": true, + "license": "ISC", "dependencies": { "foreground-child": "^2.0.0", "is-windows": "^1.0.2", @@ -15873,9 +14345,8 @@ }, "node_modules/spawn-wrap/node_modules/make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^6.0.0" }, @@ -15888,9 +14359,8 @@ }, "node_modules/spawn-wrap/node_modules/rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -15903,9 +14373,8 @@ }, "node_modules/spawn-wrap/node_modules/which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -15918,23 +14387,20 @@ }, "node_modules/split2": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", - "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", "dev": true, + "license": "ISC", "dependencies": { "readable-stream": "^3.0.0" } }, "node_modules/sprintf-js": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/sshpk": { "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "license": "MIT", "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -15957,22 +14423,19 @@ }, "node_modules/sshpk/node_modules/jsbn": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "license": "MIT" }, "node_modules/stack-trace": { "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "license": "MIT", "engines": { "node": "*" } }, "node_modules/standard": { "version": "10.0.3", - "resolved": "https://registry.npmjs.org/standard/-/standard-10.0.3.tgz", - "integrity": "sha512-JURZ+85ExKLQULckDFijdX5WHzN6RC7fgiZNSV4jFQVo+3tPoQGHyBrGekye/yf0aOfb4210EM5qPNlc2cRh4w==", "dev": true, + "license": "MIT", "dependencies": { "eslint": "~3.19.0", "eslint-config-standard": "10.2.1", @@ -15993,9 +14456,8 @@ }, "node_modules/standard-engine": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-7.0.0.tgz", - "integrity": "sha1-67d7nI/CyBZf+jU72Rug3/Qa9pA=", "dev": true, + "license": "MIT", "dependencies": { "deglob": "^2.1.0", "get-stdin": "^5.0.1", @@ -16005,18 +14467,16 @@ }, "node_modules/standard-engine/node_modules/get-stdin": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", - "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/standard/node_modules/acorn": { "version": "5.7.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -16026,18 +14486,16 @@ }, "node_modules/standard/node_modules/acorn-jsx": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, + "license": "MIT", "dependencies": { "acorn": "^3.0.4" } }, "node_modules/standard/node_modules/acorn-jsx/node_modules/acorn": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -16047,9 +14505,8 @@ }, "node_modules/standard/node_modules/ajv": { "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "dev": true, + "license": "MIT", "dependencies": { "co": "^4.6.0", "json-stable-stringify": "^1.0.1" @@ -16057,45 +14514,40 @@ }, "node_modules/standard/node_modules/ajv-keywords": { "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", "dev": true, + "license": "MIT", "peerDependencies": { "ajv": ">=4.10.0" } }, "node_modules/standard/node_modules/ansi-escapes": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/standard/node_modules/ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/standard/node_modules/ansi-styles": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/standard/node_modules/chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", @@ -16109,9 +14561,8 @@ }, "node_modules/standard/node_modules/cli-cursor": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", "dev": true, + "license": "MIT", "dependencies": { "restore-cursor": "^1.0.1" }, @@ -16121,24 +14572,21 @@ }, "node_modules/standard/node_modules/cli-width": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/standard/node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/standard/node_modules/doctrine": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, @@ -16148,9 +14596,8 @@ }, "node_modules/standard/node_modules/eslint": { "version": "3.19.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", - "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", "dev": true, + "license": "MIT", "dependencies": { "babel-code-frame": "^6.16.0", "chalk": "^1.1.3", @@ -16197,9 +14644,8 @@ }, "node_modules/standard/node_modules/eslint-config-standard": { "version": "10.2.1", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz", - "integrity": "sha1-wGHk0GbzedwXzVYsZOgZtN1FRZE=", "dev": true, + "license": "MIT", "peerDependencies": { "eslint": ">=3.19.0", "eslint-plugin-import": ">=2.2.0", @@ -16210,9 +14656,8 @@ }, "node_modules/standard/node_modules/eslint-config-standard-jsx": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-4.0.2.tgz", - "integrity": "sha512-F8fRh2WFnTek7dZH9ZaE0PCBwdVGkwVWZmizla/DDNOmg7Tx6B/IlK5+oYpiX29jpu73LszeJj5i1axEZv6VMw==", "dev": true, + "license": "MIT", "peerDependencies": { "eslint": ">=3.19.0", "eslint-plugin-react": ">=6.10.3" @@ -16220,9 +14665,8 @@ }, "node_modules/standard/node_modules/eslint-plugin-import": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.2.0.tgz", - "integrity": "sha1-crowb60wXWfEgWNIpGmaQimsi04=", "dev": true, + "license": "MIT", "dependencies": { "builtin-modules": "^1.1.1", "contains-path": "^0.1.0", @@ -16244,8 +14688,6 @@ }, "node_modules/standard/node_modules/eslint-plugin-import/node_modules/doctrine": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "dependencies": { "esutils": "^2.0.2", @@ -16257,9 +14699,8 @@ }, "node_modules/standard/node_modules/eslint-plugin-react": { "version": "6.10.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz", - "integrity": "sha1-xUNb6wZ3ThLH2y9qut3L+QDNP3g=", "dev": true, + "license": "MIT", "dependencies": { "array.prototype.find": "^2.0.1", "doctrine": "^1.2.2", @@ -16276,8 +14717,6 @@ }, "node_modules/standard/node_modules/eslint-plugin-react/node_modules/doctrine": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "dependencies": { "esutils": "^2.0.2", @@ -16289,9 +14728,8 @@ }, "node_modules/standard/node_modules/espree": { "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "acorn": "^5.5.0", "acorn-jsx": "^3.0.0" @@ -16302,9 +14740,8 @@ }, "node_modules/standard/node_modules/figures": { "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "dev": true, + "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5", "object-assign": "^4.1.0" @@ -16315,9 +14752,8 @@ }, "node_modules/standard/node_modules/file-entry-cache": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, + "license": "MIT", "dependencies": { "flat-cache": "^1.2.1", "object-assign": "^4.0.1" @@ -16328,9 +14764,8 @@ }, "node_modules/standard/node_modules/flat-cache": { "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", "dev": true, + "license": "MIT", "dependencies": { "circular-json": "^0.3.1", "graceful-fs": "^4.1.2", @@ -16343,24 +14778,21 @@ }, "node_modules/standard/node_modules/globals": { "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/standard/node_modules/ignore": { "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/standard/node_modules/inquirer": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", - "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", "dev": true, + "license": "MIT", "dependencies": { "ansi-escapes": "^1.1.0", "ansi-regex": "^2.0.0", @@ -16379,9 +14811,8 @@ }, "node_modules/standard/node_modules/is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, + "license": "MIT", "dependencies": { "number-is-nan": "^1.0.0" }, @@ -16391,38 +14822,32 @@ }, "node_modules/standard/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/standard/node_modules/json-stable-stringify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "dev": true, + "license": "MIT", "dependencies": { "jsonify": "~0.0.0" } }, "node_modules/standard/node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/standard/node_modules/onetime": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/standard/node_modules/progress": { "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", "dev": true, "engines": { "node": ">=0.4.0" @@ -16430,9 +14855,8 @@ }, "node_modules/standard/node_modules/restore-cursor": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", "dev": true, + "license": "MIT", "dependencies": { "exit-hook": "^1.0.0", "onetime": "^1.0.0" @@ -16443,27 +14867,24 @@ }, "node_modules/standard/node_modules/run-async": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", - "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", "dev": true, + "license": "MIT", "dependencies": { "once": "^1.3.0" } }, "node_modules/standard/node_modules/slice-ansi": { "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/standard/node_modules/string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, + "license": "MIT", "dependencies": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -16475,9 +14896,8 @@ }, "node_modules/standard/node_modules/strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^2.0.0" }, @@ -16487,36 +14907,32 @@ }, "node_modules/standard/node_modules/strip-bom": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/standard/node_modules/strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/standard/node_modules/supports-color": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } }, "node_modules/standard/node_modules/table": { "version": "3.8.3", - "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", - "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "ajv": "^4.7.0", "ajv-keywords": "^1.0.0", @@ -16527,28 +14943,25 @@ } }, "node_modules/standard/node_modules/table/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "version": "3.0.0", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/standard/node_modules/table/node_modules/is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/standard/node_modules/table/node_modules/string-width": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, + "license": "MIT", "dependencies": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" @@ -16559,9 +14972,8 @@ }, "node_modules/standard/node_modules/table/node_modules/strip-ansi": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^3.0.0" }, @@ -16571,9 +14983,8 @@ }, "node_modules/standard/node_modules/write": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", "dev": true, + "license": "MIT", "dependencies": { "mkdirp": "^0.5.1" }, @@ -16583,26 +14994,23 @@ }, "node_modules/statuses": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/stealthy-require": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true, + "license": "ISC", "engines": { "node": ">=0.10.0" } }, "node_modules/stream-browserify": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", - "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "~2.0.4", "readable-stream": "^3.5.0" @@ -16610,9 +15018,8 @@ }, "node_modules/stream-combiner2": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", "dev": true, + "license": "MIT", "dependencies": { "duplexer2": "~0.1.0", "readable-stream": "^2.0.2" @@ -16620,15 +15027,13 @@ }, "node_modules/stream-combiner2/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/stream-combiner2/node_modules/readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -16641,24 +15046,21 @@ }, "node_modules/stream-combiner2/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/stream-combiner2/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/stream-http": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", - "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", "dev": true, + "license": "MIT", "dependencies": { "builtin-status-codes": "^3.0.0", "inherits": "^2.0.4", @@ -16668,15 +15070,13 @@ }, "node_modules/stream-shift": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/stream-splicer": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz", - "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "^2.0.1", "readable-stream": "^2.0.2" @@ -16684,15 +15084,13 @@ }, "node_modules/stream-splicer/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/stream-splicer/node_modules/readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -16705,40 +15103,35 @@ }, "node_modules/stream-splicer/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/stream-splicer/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/stream-to-it": { "version": "0.2.4", - "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-0.2.4.tgz", - "integrity": "sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ==", + "license": "MIT", "dependencies": { "get-iterator": "^1.0.2" } }, "node_modules/streaming-iterables": { "version": "5.0.4", - "resolved": "https://registry.npmjs.org/streaming-iterables/-/streaming-iterables-5.0.4.tgz", - "integrity": "sha512-nEs6hBGIPsVz6uq6pscGGKfoPDQWrDQW0b0UHurtSDysekfKLmkPg7FQVRE2sj3Rad6yUo9E1sGTxOWyYsHQ/g==", + "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/streamroller": { "version": "3.0.6", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.6.tgz", - "integrity": "sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg==", "dev": true, + "license": "MIT", "dependencies": { "date-format": "^4.0.6", "debug": "^4.3.4", @@ -16750,16 +15143,14 @@ }, "node_modules/string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" } }, "node_modules/string-width": { "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -16771,16 +15162,14 @@ }, "node_modules/string-width/node_modules/ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/string-width/node_modules/strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -16790,9 +15179,8 @@ }, "node_modules/string.prototype.trim": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.5.tgz", - "integrity": "sha512-Lnh17webJVsD6ECeovpVN17RlAKjmz4rF9S+8Y45CkMc/ufVpTkU3vZIyIC7sllQ1FCvObZnnCdNs/HXTUOTlg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", @@ -16807,8 +15195,7 @@ }, "node_modules/string.prototype.trimend": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -16819,8 +15206,7 @@ }, "node_modules/string.prototype.trimstart": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -16831,9 +15217,8 @@ }, "node_modules/stringify-object-es5": { "version": "2.5.0", - "resolved": "https://registry.npmjs.org/stringify-object-es5/-/stringify-object-es5-2.5.0.tgz", - "integrity": "sha1-BXw8mpChJzObudFwSikLt70KHsU=", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "is-plain-obj": "^1.0.0", "is-regexp": "^1.0.0" @@ -16844,18 +15229,16 @@ }, "node_modules/stringify-object-es5/node_modules/is-plain-obj": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/strip-ansi": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^4.1.0" }, @@ -16865,26 +15248,23 @@ }, "node_modules/strip-bom": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/strip-final-newline": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/strip-json-comments": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -16894,19 +15274,16 @@ }, "node_modules/subarg": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.1.0" } }, "node_modules/superagent": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.1.2.tgz", - "integrity": "sha512-o9/fP6dww7a4xmEF5a484o2rG34UUGo8ztDlv7vbCWuqPhpndMi0f7eXxdlryk5U12Kzy46nh8eNpLAJ93Alsg==", - "deprecated": "Deprecated due to bug in CI build https://github.com/visionmedia/superagent/pull/1677\\#issuecomment-1081361876", + "version": "7.1.1", "dev": true, + "license": "MIT", "dependencies": { "component-emitter": "^1.3.0", "cookiejar": "^2.1.3", @@ -16926,9 +15303,8 @@ }, "node_modules/superagent/node_modules/form-data": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -16940,9 +15316,8 @@ }, "node_modules/superagent/node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -16950,11 +15325,24 @@ "node": ">=10" } }, + "node_modules/superagent/node_modules/qs": { + "version": "6.10.3", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/superagent/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.5", "dev": true, + "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -16967,15 +15355,13 @@ }, "node_modules/superagent/node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/supertest": { "version": "6.2.2", - "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.2.2.tgz", - "integrity": "sha512-wCw9WhAtKJsBvh07RaS+/By91NNE0Wh0DN19/hWPlBOU8tAfOtbZoVSV4xXeoKoxgPx0rx2y+y+8660XtE7jzg==", "dev": true, + "license": "MIT", "dependencies": { "methods": "^1.1.2", "superagent": "^7.1.0" @@ -16986,9 +15372,8 @@ }, "node_modules/superwstest": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/superwstest/-/superwstest-2.0.1.tgz", - "integrity": "sha512-iE0VPbUKXyanGROaywWtOjctNR4SazpFqcOF68IY7Za2maB+prNaYjQFZsAFC+D1R/fXfHHeC6mnpv5ijq0JkA==", "dev": true, + "license": "MIT", "dependencies": { "@types/supertest": "<7", "@types/ws": "7.x || 8.x", @@ -17005,8 +15390,7 @@ }, "node_modules/supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -17016,9 +15400,8 @@ }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -17028,24 +15411,21 @@ }, "node_modules/symbol-tree": { "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/syntax-error": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", - "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", "dev": true, + "license": "MIT", "dependencies": { "acorn-node": "^1.2.0" } }, "node_modules/table": { "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "ajv": "^6.10.2", "lodash": "^4.17.14", @@ -17058,24 +15438,21 @@ }, "node_modules/table/node_modules/emoji-regex": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/table/node_modules/is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/table/node_modules/string-width": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", @@ -17087,24 +15464,21 @@ }, "node_modules/tachyons": { "version": "4.12.0", - "resolved": "https://registry.npmjs.org/tachyons/-/tachyons-4.12.0.tgz", - "integrity": "sha512-2nA2IrYFy3raCM9fxJ2KODRGHVSZNTW3BR0YnlGsLUf1DA3pk3YfWZ/DdfbnZK6zLZS+jUenlUGJsKcA5fUiZg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/tapable": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/tape": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.15.1.tgz", - "integrity": "sha512-k7F5pyr91n9D/yjSJwbLLYDCrTWXxMSXbbmHX2n334lSIc2rxeXyFkaBv4UuUd2gBYMrAOalPutAiCxC6q1qbw==", + "version": "4.15.0", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "~1.0.2", "deep-equal": "~1.1.1", @@ -17115,7 +15489,7 @@ "has": "~1.0.3", "inherits": "~2.0.4", "is-regex": "~1.1.4", - "minimist": "~1.2.6", + "minimist": "~1.2.5", "object-inspect": "~1.12.0", "resolve": "~1.22.0", "resumer": "~0.0.0", @@ -17128,9 +15502,8 @@ }, "node_modules/terser": { "version": "5.12.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", - "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.5.0", "commander": "^2.20.0", @@ -17146,9 +15519,8 @@ }, "node_modules/terser-webpack-plugin": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.1.tgz", - "integrity": "sha512-GvlZdT6wPQKbDNW/GDQzZFg/j4vKU96yl2q6mcUkzKOgW4gwf1Z8cZToUCrz31XHlPWH8MVb1r2tFtdDtTGJ7g==", "dev": true, + "license": "MIT", "dependencies": { "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", @@ -17180,9 +15552,8 @@ }, "node_modules/terser-webpack-plugin/node_modules/schema-utils": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, + "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", @@ -17198,18 +15569,16 @@ }, "node_modules/terser-webpack-plugin/node_modules/source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/terser/node_modules/acorn": { "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -17219,24 +15588,21 @@ }, "node_modules/terser/node_modules/commander": { "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/terser/node_modules/source-map": { "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">= 8" } }, "node_modules/test-exclude": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, + "license": "ISC", "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", @@ -17248,9 +15614,8 @@ }, "node_modules/testdouble": { "version": "3.16.4", - "resolved": "https://registry.npmjs.org/testdouble/-/testdouble-3.16.4.tgz", - "integrity": "sha512-NM8gzFurcf3tgf9miWx3ussoJWUxtT1MwJ7Xpe+sqJBbiwgqLDBqh64bnuDmGCHqhQ3Vou3Z5HtRjiAs7U/mug==", "dev": true, + "license": "MIT", "dependencies": { "lodash": "^4.17.15", "quibble": "^0.6.7", @@ -17263,9 +15628,8 @@ }, "node_modules/testdouble-timers": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/testdouble-timers/-/testdouble-timers-0.1.1.tgz", - "integrity": "sha1-o0fs1NZc3jDsN3aXf7gZYVoIr5A=", "dev": true, + "license": "MIT", "dependencies": { "lolex": "^1.4.0" }, @@ -17275,31 +15639,26 @@ }, "node_modules/text-hex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", - "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" + "license": "MIT" }, "node_modules/text-table": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/theredoc": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/theredoc/-/theredoc-1.0.0.tgz", - "integrity": "sha512-KU3SA3TjRRM932jpNfD3u4Ec3bSvedyo5ITPI7zgWYnKep7BwQQaxlhI9qbO+lKJoRnoAbEVfMcAHRuKVYikDA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/through": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + "license": "MIT" }, "node_modules/through2": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, + "license": "MIT", "dependencies": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" @@ -17307,15 +15666,13 @@ }, "node_modules/through2/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/through2/node_modules/readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -17328,23 +15685,20 @@ }, "node_modules/through2/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/through2/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/timeout-abort-controller": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/timeout-abort-controller/-/timeout-abort-controller-1.1.1.tgz", - "integrity": "sha512-BsF9i3NAJag6T0ZEjki9j654zoafI2X6ayuNd6Tp8+Ul6Tr5s4jo973qFeiWrRSweqvskC+AHDKUmIW4b7pdhQ==", + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "retimer": "^2.0.0" @@ -17352,8 +15706,6 @@ }, "node_modules/timers-browserify": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", "dev": true, "dependencies": { "process": "~0.11.0" @@ -17364,9 +15716,8 @@ }, "node_modules/tmp": { "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, + "license": "MIT", "dependencies": { "os-tmpdir": "~1.0.2" }, @@ -17376,18 +15727,16 @@ }, "node_modules/to-fast-properties": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/to-regex-range": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -17397,16 +15746,14 @@ }, "node_modules/toidentifier": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", "engines": { "node": ">=0.6" } }, "node_modules/tough-cookie": { "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "license": "BSD-3-Clause", "dependencies": { "psl": "^1.1.28", "punycode": "^2.1.1" @@ -17417,22 +15764,19 @@ }, "node_modules/tough-cookie/node_modules/punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/tr46": { "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + "license": "MIT" }, "node_modules/transform-ast": { "version": "2.4.4", - "resolved": "https://registry.npmjs.org/transform-ast/-/transform-ast-2.4.4.tgz", - "integrity": "sha512-AxjeZAcIOUO2lev2GDe3/xZ1Q0cVGjIMk5IsriTy8zbWlsEnjeB025AhkhBJHoy997mXpLd4R+kRbvnnQVuQHQ==", "dev": true, + "license": "MIT", "dependencies": { "acorn-node": "^1.3.0", "convert-source-map": "^1.5.1", @@ -17445,8 +15789,6 @@ }, "node_modules/transform-ast/node_modules/is-buffer": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", "dev": true, "funding": [ { @@ -17462,28 +15804,26 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/triple-beam": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", - "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" + "license": "MIT" }, "node_modules/truncate-utf8-bytes": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", - "integrity": "sha1-QFkjkJWS1W94pYGENLC3hInKXys=", + "license": "WTFPL", "dependencies": { "utf8-byte-length": "^1.0.1" } }, "node_modules/ts-node": { "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", - "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, + "license": "MIT", "dependencies": { "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", @@ -17524,9 +15864,8 @@ }, "node_modules/ts-node/node_modules/acorn": { "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -17536,33 +15875,29 @@ }, "node_modules/ts-node/node_modules/acorn-walk": { "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/tslib": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "dev": true, + "license": "0BSD" }, "node_modules/tsscmp": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", - "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.6.x" } }, "node_modules/tsutils": { "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, + "license": "MIT", "dependencies": { "tslib": "^1.8.1" }, @@ -17575,14 +15910,12 @@ }, "node_modules/tty-browserify": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/tunnel-agent": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" }, @@ -17592,20 +15925,17 @@ }, "node_modules/tweetnacl": { "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "license": "Unlicense" }, "node_modules/type": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/type-check": { "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "~1.1.2" }, @@ -17615,23 +15945,19 @@ }, "node_modules/type-component": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/type-component/-/type-component-0.0.1.tgz", - "integrity": "sha1-lSpsgcIe/STRPYEdDISYy4YOGVY=", "dev": true }, "node_modules/type-detect": { "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/type-fest": { "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -17641,8 +15967,7 @@ }, "node_modules/type-is": { "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -17653,24 +15978,21 @@ }, "node_modules/typedarray": { "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, + "license": "MIT", "dependencies": { "is-typedarray": "^1.0.0" } }, "node_modules/typedoc": { - "version": "0.22.15", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.15.tgz", - "integrity": "sha512-CMd1lrqQbFvbx6S9G6fL4HKp3GoIuhujJReWqlIvSb2T26vGai+8Os3Mde7Pn832pXYemd9BMuuYWhFpL5st0Q==", + "version": "0.22.13", "dev": true, + "license": "Apache-2.0", "dependencies": { "glob": "^7.2.0", "lunr": "^2.3.9", @@ -17689,10 +16011,9 @@ } }, "node_modules/typedoc-plugin-markdown": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.12.0.tgz", - "integrity": "sha512-yKl7/KWD8nP6Ot6OzMLLc8wBzN3CmkBoI/YQzxT62a9xmDgxyeTxGbHbkUoSzhKFqMI3SR0AqV6prAhVKbYnxw==", + "version": "3.11.14", "dev": true, + "license": "MIT", "dependencies": { "handlebars": "^4.7.7" }, @@ -17702,18 +16023,16 @@ }, "node_modules/typedoc/node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/typedoc/node_modules/minimatch": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -17722,10 +16041,9 @@ } }, "node_modules/typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "version": "4.6.2", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -17736,8 +16054,6 @@ }, "node_modules/ua-parser-js": { "version": "0.7.31", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", - "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==", "dev": true, "funding": [ { @@ -17749,15 +16065,15 @@ "url": "https://paypal.me/faisalman" } ], + "license": "MIT", "engines": { "node": "*" } }, "node_modules/uglify-js": { - "version": "3.15.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.4.tgz", - "integrity": "sha512-vMOPGDuvXecPs34V74qDKk4iJ/SN4vL3Ow/23ixafENYvtrNvtbcgUeugTcUGRGsOF/5fU8/NYSL5Hyb3l1OJA==", + "version": "3.15.3", "dev": true, + "license": "BSD-2-Clause", "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -17768,25 +16084,22 @@ }, "node_modules/uint8arrays": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.0.0.tgz", - "integrity": "sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA==", + "license": "MIT", "dependencies": { "multiformats": "^9.4.2" } }, "node_modules/umd": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", - "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", "dev": true, + "license": "MIT", "bin": { "umd": "bin/cli.js" } }, "node_modules/unbox-primitive": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.1", "has-bigints": "^1.0.1", @@ -17799,9 +16112,8 @@ }, "node_modules/undeclared-identifiers": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz", - "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "acorn-node": "^1.3.0", "dash-ast": "^1.0.0", @@ -17815,64 +16127,55 @@ }, "node_modules/uniq": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/universalify": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "license": "MIT", "engines": { "node": ">= 10.0.0" } }, "node_modules/unix-crypt-td-js": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/unix-crypt-td-js/-/unix-crypt-td-js-1.1.4.tgz", - "integrity": "sha512-8rMeVYWSIyccIJscb9NdCfZKSRBKYTeVnwmiRYT2ulE3qd1RaDQ0xQDP+rI3ccIWbhu/zuo5cgN8z73belNZgw==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/unordered-array-remove": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unordered-array-remove/-/unordered-array-remove-1.0.2.tgz", - "integrity": "sha1-xUbo+I4xegzyZEyX7LV9umbSUO8=" + "license": "MIT" }, "node_modules/unpipe": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/upper-case": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", - "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/uri-js": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, "node_modules/uri-js/node_modules/punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/url": { "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", "dev": true, + "license": "MIT", "dependencies": { "punycode": "1.3.2", "querystring": "0.2.0" @@ -17880,15 +16183,13 @@ }, "node_modules/url/node_modules/punycode": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ursa-optional": { "version": "0.10.2", - "resolved": "https://registry.npmjs.org/ursa-optional/-/ursa-optional-0.10.2.tgz", - "integrity": "sha512-TKdwuLboBn7M34RcvVTuQyhvrA8gYKapuVdm0nBP0mnBc7oECOfUQZrY91cefL3/nm64ZyrejSRrhTVdX7NG/A==", "hasInstallScript": true, + "license": "Apache-2.0", "dependencies": { "bindings": "^1.5.0", "nan": "^2.14.2" @@ -17899,9 +16200,8 @@ }, "node_modules/user-home": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", - "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", "dev": true, + "license": "MIT", "dependencies": { "os-homedir": "^1.0.0" }, @@ -17911,81 +16211,69 @@ }, "node_modules/utf8-byte-length": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", - "integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=" + "license": "WTFPL" }, "node_modules/util": { "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "2.0.3" } }, "node_modules/util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "license": "MIT" }, "node_modules/util-extend": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz", - "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/util/node_modules/inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/utils-merge": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "license": "MIT", "engines": { "node": ">= 0.4.0" } }, "node_modules/uuid": { "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/v8-compile-cache": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/v8-compile-cache-lib": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz", - "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/varint": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", - "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==" + "license": "MIT" }, "node_modules/vary": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/verdaccio": { "version": "4.13.0", - "resolved": "https://registry.npmjs.org/verdaccio/-/verdaccio-4.13.0.tgz", - "integrity": "sha512-kipaE7VeHNKelrbHlO1I7yjh2V97qn9Fg6r3tMyDveTXHwKUcAjynmWOFqKx/a566xJYClKc4t4z6UCVVs3gAQ==", "dev": true, + "license": "MIT", "dependencies": { "@verdaccio/commons-api": "9.7.1", "@verdaccio/local-storage": "9.7.5", @@ -18035,9 +16323,8 @@ }, "node_modules/verdaccio-audit": { "version": "9.7.3", - "resolved": "https://registry.npmjs.org/verdaccio-audit/-/verdaccio-audit-9.7.3.tgz", - "integrity": "sha512-FDWafgDjvnTbJapQpd0c41FjrecR+iRHrnDi2gkAn4IJpiLCgXC6R5NdkXjDIekKEsou9PyQTsEdoHK7iDx+tQ==", "dev": true, + "license": "MIT", "dependencies": { "express": "4.17.1", "request": "2.88.2" @@ -18052,9 +16339,8 @@ }, "node_modules/verdaccio-htpasswd": { "version": "9.7.2", - "resolved": "https://registry.npmjs.org/verdaccio-htpasswd/-/verdaccio-htpasswd-9.7.2.tgz", - "integrity": "sha512-c7ZEb7wuce0+4h92w4f1ySMhsIWFs/mlsFjjoqIlY5SBskmQI5RHC7HQglVgFjOMxrWoaaadJ5WGmFV+A/yxPQ==", "dev": true, + "license": "MIT", "dependencies": { "@verdaccio/file-locking": "^9.7.2", "apache-md5": "1.1.2", @@ -18070,20 +16356,10 @@ "url": "https://opencollective.com/verdaccio" } }, - "node_modules/verdaccio-htpasswd/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/verdaccio-htpasswd/node_modules/http-errors": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", - "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", "dev": true, + "license": "MIT", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.4", @@ -18097,24 +16373,21 @@ }, "node_modules/verdaccio-htpasswd/node_modules/toidentifier": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.6" } }, "node_modules/verdaccio/node_modules/async": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/verdaccio/node_modules/body-parser": { "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "dev": true, + "license": "MIT", "dependencies": { "bytes": "3.1.0", "content-type": "~1.0.4", @@ -18133,9 +16406,8 @@ }, "node_modules/verdaccio/node_modules/body-parser/node_modules/http-errors": { "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "dev": true, + "license": "MIT", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.3", @@ -18149,54 +16421,39 @@ }, "node_modules/verdaccio/node_modules/body-parser/node_modules/inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/verdaccio/node_modules/body-parser/node_modules/setprototypeof": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/verdaccio/node_modules/bytes": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/verdaccio/node_modules/commander": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/verdaccio/node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } }, - "node_modules/verdaccio/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/verdaccio/node_modules/http-errors": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", - "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", "dev": true, + "license": "MIT", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.4", @@ -18210,9 +16467,8 @@ }, "node_modules/verdaccio/node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -18222,9 +16478,8 @@ }, "node_modules/verdaccio/node_modules/marked": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.1.tgz", - "integrity": "sha512-5+/fKgMv2hARmMW7DOpykr2iLhl0NgjyELk5yn92iE7z8Se1IS9n3UsFm86hFXIkvMBmVxki8+ckcpjBeyo/hw==", "dev": true, + "license": "MIT", "bin": { "marked": "bin/marked" }, @@ -18234,9 +16489,8 @@ }, "node_modules/verdaccio/node_modules/mime": { "version": "2.5.2", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", - "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", "dev": true, + "license": "MIT", "bin": { "mime": "cli.js" }, @@ -18246,9 +16500,8 @@ }, "node_modules/verdaccio/node_modules/minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -18258,9 +16511,8 @@ }, "node_modules/verdaccio/node_modules/mkdirp": { "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.5" }, @@ -18270,36 +16522,21 @@ }, "node_modules/verdaccio/node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/verdaccio/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", "dev": true, - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } + "license": "MIT" }, "node_modules/verdaccio/node_modules/qs": { "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.6" } }, "node_modules/verdaccio/node_modules/raw-body": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", "dev": true, + "license": "MIT", "dependencies": { "bytes": "3.1.0", "http-errors": "1.7.2", @@ -18312,9 +16549,8 @@ }, "node_modules/verdaccio/node_modules/raw-body/node_modules/http-errors": { "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "dev": true, + "license": "MIT", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.3", @@ -18328,22 +16564,18 @@ }, "node_modules/verdaccio/node_modules/raw-body/node_modules/inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/verdaccio/node_modules/raw-body/node_modules/setprototypeof": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/verdaccio/node_modules/request": { "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", "dev": true, + "license": "Apache-2.0", "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -18372,18 +16604,16 @@ }, "node_modules/verdaccio/node_modules/request/node_modules/qs": { "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.6" } }, "node_modules/verdaccio/node_modules/semver": { "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", "dev": true, + "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -18396,18 +16626,16 @@ }, "node_modules/verdaccio/node_modules/toidentifier": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.6" } }, "node_modules/verdaccio/node_modules/tough-cookie": { "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "psl": "^1.1.24", "punycode": "^1.4.1" @@ -18418,27 +16646,23 @@ }, "node_modules/verdaccio/node_modules/uuid": { "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "dev": true, + "license": "MIT", "bin": { "uuid": "bin/uuid" } }, "node_modules/verdaccio/node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/verror": { "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "engines": [ "node >=0.6.0" ], + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -18447,51 +16671,44 @@ }, "node_modules/vm-browserify": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/void-elements": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/vscode-oniguruma": { "version": "1.6.2", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz", - "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/vscode-textmate": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", - "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/w3c-hr-time": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", "dev": true, + "license": "MIT", "dependencies": { "browser-process-hrtime": "^1.0.0" } }, "node_modules/w3c-hr-time/node_modules/browser-process-hrtime": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true + "dev": true, + "license": "BSD-2-Clause" }, "node_modules/w3c-xmlserializer": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz", - "integrity": "sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg==", "dev": true, + "license": "MIT", "dependencies": { "domexception": "^1.0.1", "webidl-conversions": "^4.0.2", @@ -18500,9 +16717,8 @@ }, "node_modules/watchpack": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", - "integrity": "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==", "dev": true, + "license": "MIT", "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -18513,17 +16729,15 @@ }, "node_modules/wcwidth": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", "dev": true, + "license": "MIT", "dependencies": { "defaults": "^1.0.3" } }, "node_modules/web-encoding": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", - "integrity": "sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==", + "license": "MIT", "dependencies": { "util": "^0.12.3" }, @@ -18533,8 +16747,7 @@ }, "node_modules/web-encoding/node_modules/util": { "version": "0.12.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.4.tgz", - "integrity": "sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -18546,15 +16759,13 @@ }, "node_modules/webidl-conversions": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true + "dev": true, + "license": "BSD-2-Clause" }, "node_modules/webpack": { - "version": "5.72.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.72.0.tgz", - "integrity": "sha512-qmSmbspI0Qo5ld49htys8GY9XhS9CGqFoHTsOVAnjBdg0Zn79y135R+k4IR4rKK6+eKaabMhJwiVB7xw0SJu5w==", + "version": "5.70.0", "dev": true, + "license": "MIT", "dependencies": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^0.0.51", @@ -18599,9 +16810,8 @@ }, "node_modules/webpack-cli": { "version": "4.9.2", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.2.tgz", - "integrity": "sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ==", "dev": true, + "license": "MIT", "dependencies": { "@discoveryjs/json-ext": "^0.5.0", "@webpack-cli/configtest": "^1.1.1", @@ -18642,18 +16852,16 @@ }, "node_modules/webpack-cli/node_modules/commander": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10" } }, "node_modules/webpack-merge": { "version": "5.8.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", - "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", "dev": true, + "license": "MIT", "dependencies": { "clone-deep": "^4.0.1", "wildcard": "^2.0.0" @@ -18664,18 +16872,16 @@ }, "node_modules/webpack-sources": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.13.0" } }, "node_modules/webpack/node_modules/acorn": { "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -18685,27 +16891,24 @@ }, "node_modules/webpack/node_modules/acorn-import-assertions": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^8" } }, "node_modules/webpack/node_modules/events": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.x" } }, "node_modules/webpack/node_modules/schema-utils": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, + "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", @@ -18721,23 +16924,20 @@ }, "node_modules/whatwg-encoding": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", "dev": true, + "license": "MIT", "dependencies": { "iconv-lite": "0.4.24" } }, "node_modules/whatwg-mimetype": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/whatwg-url": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -18745,14 +16945,12 @@ }, "node_modules/whatwg-url/node_modules/webidl-conversions": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "license": "BSD-2-Clause" }, "node_modules/which": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -18762,8 +16960,7 @@ }, "node_modules/which-boxed-primitive": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -18777,9 +16974,8 @@ }, "node_modules/which-collection": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", - "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", "dev": true, + "license": "MIT", "dependencies": { "is-map": "^2.0.1", "is-set": "^2.0.1", @@ -18792,23 +16988,20 @@ }, "node_modules/which-module": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/which-pm-runs": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", - "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/which-typed-array": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.7.tgz", - "integrity": "sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw==", + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -18826,14 +17019,12 @@ }, "node_modules/wildcard": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", - "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/winston": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.7.2.tgz", - "integrity": "sha512-QziIqtojHBoyzUOdQvQiar1DH0Xp9nF1A1y7NVy2DGEsz82SBDtOalS0ulTRGVT14xPX3WRWkCsdcJKqNflKng==", + "version": "3.6.0", + "license": "MIT", "dependencies": { "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", @@ -18852,8 +17043,7 @@ }, "node_modules/winston-daily-rotate-file": { "version": "4.6.1", - "resolved": "https://registry.npmjs.org/winston-daily-rotate-file/-/winston-daily-rotate-file-4.6.1.tgz", - "integrity": "sha512-Ycch4LZmTycbhgiI2eQXBKI1pKcEQgAqmBjyq7/dC6Dk77nasdxvhLKraqTdCw7wNDSs8/M0jXaLATHquG7xYg==", + "license": "MIT", "dependencies": { "file-stream-rotator": "^0.6.1", "object-hash": "^2.0.1", @@ -18869,8 +17059,7 @@ }, "node_modules/winston-transport": { "version": "4.5.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", - "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", + "license": "MIT", "dependencies": { "logform": "^2.3.2", "readable-stream": "^3.6.0", @@ -18882,28 +17071,24 @@ }, "node_modules/winston/node_modules/async": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" + "license": "MIT" }, "node_modules/word-wrap": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/wordwrap": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/wrap-ansi": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -18918,16 +17103,14 @@ }, "node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/wrap-ansi/node_modules/strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -18937,15 +17120,13 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/write": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, + "license": "MIT", "dependencies": { "mkdirp": "^0.5.1" }, @@ -18955,9 +17136,8 @@ }, "node_modules/write-file-atomic": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, + "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", @@ -18967,8 +17147,7 @@ }, "node_modules/ws": { "version": "7.5.7", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", - "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", + "license": "MIT", "engines": { "node": ">=8.3.0" }, @@ -18987,14 +17166,12 @@ }, "node_modules/xml-name-validator": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/xml2js": { "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "license": "MIT", "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" @@ -19005,62 +17182,53 @@ }, "node_modules/xmlbuilder": { "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "license": "MIT", "engines": { "node": ">=4.0" } }, "node_modules/xmlchars": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/xor-distance": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/xor-distance/-/xor-distance-2.0.0.tgz", - "integrity": "sha512-AsAqZfPAuWx7qB/0kyRDUEvoU3QKsHWzHU9smFlkaiprEpGfJ/NBbLze2Uq0rdkxCxkNM9uOLvz/KoNBCbZiLQ==" + "license": "MIT" }, "node_modules/xsalsa20": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/xsalsa20/-/xsalsa20-1.2.0.tgz", - "integrity": "sha512-FIr/DEeoHfj7ftfylnoFt3rAIRoWXpx2AoDfrT2qD2wtp7Dp+COajvs/Icb7uHqRW9m60f5iXZwdsJJO3kvb7w==" + "license": "MIT" }, "node_modules/xtend": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", "engines": { "node": ">=0.4" } }, "node_modules/y18n": { "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/yallist": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "license": "ISC" }, "node_modules/yaml": { "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 6" } }, "node_modules/yargs": { - "version": "17.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", - "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", + "version": "17.4.0", + "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -19076,25 +17244,22 @@ }, "node_modules/yargs-parser": { "version": "21.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", - "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "license": "ISC", "engines": { "node": ">=12" } }, "node_modules/yn": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/yocto-queue": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -19109,8 +17274,10 @@ "dependencies": { "@ethereumjs/common": "^2.6.4", "@ethereumjs/tx": "^3.5.1", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", - "merkle-patricia-tree": "^4.2.4" + "merkle-patricia-tree": "^4.2.4", + "rlp": "^3.0.0" }, "devDependencies": { "@types/lru-cache": "^5.1.0", @@ -19132,9 +17299,8 @@ }, "packages/block/node_modules/deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -19158,9 +17324,8 @@ }, "packages/block/node_modules/resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -19170,10 +17335,9 @@ } }, "packages/block/node_modules/tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, + "license": "MIT", "dependencies": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -19187,7 +17351,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19213,6 +17377,7 @@ "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", "lru-cache": "^5.1.1", + "rlp": "^3.0.0", "semaphore-async-await": "^1.5.1" }, "devDependencies": { @@ -19236,9 +17401,8 @@ }, "packages/blockchain/node_modules/deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -19262,9 +17426,8 @@ }, "packages/blockchain/node_modules/resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -19274,10 +17437,9 @@ } }, "packages/blockchain/node_modules/tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, + "license": "MIT", "dependencies": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -19291,7 +17453,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19315,7 +17477,7 @@ "@ethereumjs/block": "^3.6.2", "@ethereumjs/blockchain": "^5.5.2", "@ethereumjs/common": "^2.6.4", - "@ethereumjs/devp2p": "^4.2.1", + "@ethereumjs/devp2p": "^4.2.2", "@ethereumjs/ethash": "^1.1.0", "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", @@ -19325,6 +17487,7 @@ "connect": "^3.7.0", "cors": "^2.8.5", "debug": "^4.3.3", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "fs-extra": "^10.0.0", "it-pipe": "^1.1.0", @@ -19344,6 +17507,7 @@ "multiaddr": "^10.0.1", "peer-id": "^0.14.3", "qheap": "^1.4.0", + "rlp": "^3.0.0", "winston": "^3.3.3", "winston-daily-rotate-file": "^4.5.5", "yargs": "^17.2.1" @@ -19395,9 +17559,8 @@ }, "packages/client/node_modules/deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -19421,9 +17584,8 @@ }, "packages/client/node_modules/resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -19433,10 +17595,9 @@ } }, "packages/client/node_modules/tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, + "license": "MIT", "dependencies": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -19450,7 +17611,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19491,9 +17652,8 @@ }, "packages/common/node_modules/deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -19517,9 +17677,8 @@ }, "packages/common/node_modules/resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -19529,10 +17688,9 @@ } }, "packages/common/node_modules/tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, + "license": "MIT", "dependencies": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -19546,7 +17704,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19562,7 +17720,7 @@ }, "packages/devp2p": { "name": "@ethereumjs/devp2p", - "version": "4.2.1", + "version": "4.2.2", "license": "MIT", "dependencies": { "@ethereumjs/common": "^2.6.4", @@ -19581,6 +17739,7 @@ "lru-cache": "^5.1.1", "ms": "^0.7.1", "multiaddr": "^10.0.1", + "rlp": "^3.0.0", "scanf": "^1.1.2", "secp256k1": "^4.0.2", "snappyjs": "^0.6.1" @@ -19588,7 +17747,6 @@ "devDependencies": { "@ethereumjs/block": "^3.6.2", "@ethereumjs/tx": "^3.5.1", - "@types/async": "^2.4.1", "@types/chalk": "^2.2.0", "@types/debug": "^4.1.4", "@types/ip": "^1.1.0", @@ -19597,7 +17755,6 @@ "@types/node": "^16.11.7", "@types/secp256k1": "^4.0.1", "@types/tape": "^4.13.2", - "async": "^2.6.0", "chalk": "^2.4.2", "eslint": "^6.8.0", "nyc": "^15.1.0", @@ -19614,9 +17771,8 @@ }, "packages/devp2p/node_modules/ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -19626,9 +17782,8 @@ }, "packages/devp2p/node_modules/chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -19640,24 +17795,21 @@ }, "packages/devp2p/node_modules/color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "1.1.3" } }, "packages/devp2p/node_modules/color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "dev": true, + "license": "MIT" }, "packages/devp2p/node_modules/deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -19681,18 +17833,16 @@ }, "packages/devp2p/node_modules/has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "packages/devp2p/node_modules/resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -19703,9 +17853,8 @@ }, "packages/devp2p/node_modules/supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -19714,10 +17863,9 @@ } }, "packages/devp2p/node_modules/tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, + "license": "MIT", "dependencies": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -19731,7 +17879,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19754,7 +17902,9 @@ "@types/levelup": "^4.3.0", "bigint-crypto-utils": "^3.0.23", "buffer-xor": "^2.0.1", - "ethereumjs-util": "^7.1.4" + "ethereum-cryptography": "^1.0.3", + "ethereumjs-util": "^7.1.4", + "rlp": "^3.0.0" }, "devDependencies": { "@ethereumjs/common": "^2.6.4", @@ -19771,9 +17921,8 @@ }, "packages/ethash/node_modules/deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -19797,9 +17946,8 @@ }, "packages/ethash/node_modules/resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -19809,10 +17957,9 @@ } }, "packages/ethash/node_modules/tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, + "license": "MIT", "dependencies": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -19826,7 +17973,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19863,9 +18010,8 @@ }, "packages/rlp/node_modules/deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -19889,9 +18035,8 @@ }, "packages/rlp/node_modules/resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -19901,10 +18046,9 @@ } }, "packages/rlp/node_modules/tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, + "license": "MIT", "dependencies": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -19918,7 +18062,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -19939,9 +18083,11 @@ "dependencies": { "@ethereumjs/common": "^2.6.3", "debug": "^4.3.3", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^4.2.4" + "merkle-patricia-tree": "^4.2.4", + "rlp": "^3.0.0" }, "devDependencies": { "@types/node": "^16.11.7", @@ -20038,10 +18184,12 @@ "license": "MPL-2.0", "dependencies": { "@types/levelup": "^4.3.0", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", "level-ws": "^2.0.0", "readable-stream": "^3.6.0", + "rlp": "^3.0.0", "semaphore-async-await": "^1.5.1" }, "devDependencies": { @@ -20066,9 +18214,8 @@ }, "packages/trie/node_modules/deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -20092,9 +18239,8 @@ }, "packages/trie/node_modules/resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -20104,10 +18250,9 @@ } }, "packages/trie/node_modules/tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, + "license": "MIT", "dependencies": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -20121,7 +18266,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -20141,7 +18286,9 @@ "license": "MPL-2.0", "dependencies": { "@ethereumjs/common": "^2.6.4", - "ethereumjs-util": "^7.1.4" + "ethereum-cryptography": "^1.0.3", + "ethereumjs-util": "^7.1.4", + "rlp": "^3.0.0" }, "devDependencies": { "@types/minimist": "^1.2.0", @@ -20165,9 +18312,8 @@ }, "packages/tx/node_modules/deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -20191,9 +18337,8 @@ }, "packages/tx/node_modules/resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -20203,10 +18348,9 @@ } }, "packages/tx/node_modules/tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, + "license": "MIT", "dependencies": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -20220,7 +18364,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -20240,7 +18384,7 @@ "license": "MPL-2.0", "dependencies": { "ethereum-cryptography": "^1.0.3", - "rlp": "^2.2.4" + "rlp": "^3.0.0" }, "devDependencies": { "@types/bn.js": "^5.1.0", @@ -20263,22 +18407,6 @@ "node": ">=10.0.0" } }, - "packages/util/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, - "packages/util/node_modules/rlp": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", - "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", - "dependencies": { - "bn.js": "^5.2.0" - }, - "bin": { - "rlp": "bin/rlp" - } - }, "packages/vm": { "name": "@ethereumjs/vm", "version": "5.9.0", @@ -20292,10 +18420,12 @@ "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", "debug": "^4.3.3", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", "merkle-patricia-tree": "^4.2.4", + "rlp": "^3.0.0", "rustbn.js": "~0.2.0" }, "devDependencies": { @@ -20330,9 +18460,8 @@ }, "packages/vm/node_modules/deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -20356,9 +18485,8 @@ }, "packages/vm/node_modules/resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -20368,10 +18496,9 @@ } }, "packages/vm/node_modules/tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, + "license": "MIT", "dependencies": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -20385,7 +18512,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -20403,8 +18530,6 @@ "dependencies": { "@ampproject/remapping": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.1.2.tgz", - "integrity": "sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==", "dev": true, "requires": { "@jridgewell/trace-mapping": "^0.3.0" @@ -20412,8 +18537,6 @@ }, "@babel/code-frame": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dev": true, "requires": { "@babel/highlight": "^7.16.7" @@ -20421,37 +18544,31 @@ }, "@babel/compat-data": { "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", - "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==", "dev": true }, "@babel/core": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.9.tgz", - "integrity": "sha512-5ug+SfZCpDAkVp9SFIZAzlW18rlzsOcJGaetCjkySnrXXDUw9AR8cDUm1iByTmdWM6yxX6/zycaV76w3YTF2gw==", + "version": "7.17.8", "dev": true, "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.9", + "@babel/generator": "^7.17.7", "@babel/helper-compilation-targets": "^7.17.7", "@babel/helper-module-transforms": "^7.17.7", - "@babel/helpers": "^7.17.9", - "@babel/parser": "^7.17.9", + "@babel/helpers": "^7.17.8", + "@babel/parser": "^7.17.8", "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.9", + "@babel/traverse": "^7.17.3", "@babel/types": "^7.17.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.1", + "json5": "^2.1.2", "semver": "^6.3.0" } }, "@babel/generator": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.9.tgz", - "integrity": "sha512-rAdDousTwxbIxbz5I7GEQ3lUip+xVCXooZNbsydCWs3xA7ZsYOv+CFRdzGxRX78BmQHu9B1Eso59AOZQOJDEdQ==", + "version": "7.17.7", "dev": true, "requires": { "@babel/types": "^7.17.0", @@ -20461,8 +18578,6 @@ }, "@babel/helper-compilation-targets": { "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", - "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", "dev": true, "requires": { "@babel/compat-data": "^7.17.7", @@ -20473,27 +18588,29 @@ }, "@babel/helper-environment-visitor": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", "dev": true, "requires": { "@babel/types": "^7.16.7" } }, "@babel/helper-function-name": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", - "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", + "version": "7.16.7", "dev": true, "requires": { + "@babel/helper-get-function-arity": "^7.16.7", "@babel/template": "^7.16.7", - "@babel/types": "^7.17.0" + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.16.7", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" } }, "@babel/helper-hoist-variables": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, "requires": { "@babel/types": "^7.16.7" @@ -20501,8 +18618,6 @@ }, "@babel/helper-module-imports": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", - "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "dev": true, "requires": { "@babel/types": "^7.16.7" @@ -20510,8 +18625,6 @@ }, "@babel/helper-module-transforms": { "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", - "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.16.7", @@ -20526,14 +18639,10 @@ }, "@babel/helper-plugin-utils": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", - "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", "dev": true }, "@babel/helper-simple-access": { "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", - "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", "dev": true, "requires": { "@babel/types": "^7.17.0" @@ -20541,8 +18650,6 @@ }, "@babel/helper-skip-transparent-expression-wrappers": { "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", - "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", "dev": true, "requires": { "@babel/types": "^7.16.0" @@ -20550,8 +18657,6 @@ }, "@babel/helper-split-export-declaration": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, "requires": { "@babel/types": "^7.16.7" @@ -20559,31 +18664,23 @@ }, "@babel/helper-validator-identifier": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", "dev": true }, "@babel/helper-validator-option": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", - "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", "dev": true }, "@babel/helpers": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.9.tgz", - "integrity": "sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q==", + "version": "7.17.8", "dev": true, "requires": { "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.9", + "@babel/traverse": "^7.17.3", "@babel/types": "^7.17.0" } }, "@babel/highlight": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", - "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", + "version": "7.16.10", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.16.7", @@ -20593,8 +18690,6 @@ "dependencies": { "ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -20602,8 +18697,6 @@ }, "chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -20613,8 +18706,6 @@ }, "color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { "color-name": "1.1.3" @@ -20622,20 +18713,14 @@ }, "color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -20644,15 +18729,11 @@ } }, "@babel/parser": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", - "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", + "version": "7.17.8", "dev": true }, "@babel/plugin-transform-spread": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz", - "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.16.7", @@ -20661,8 +18742,6 @@ }, "@babel/template": { "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, "requires": { "@babel/code-frame": "^7.16.7", @@ -20671,18 +18750,16 @@ } }, "@babel/traverse": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.9.tgz", - "integrity": "sha512-PQO8sDIJ8SIwipTPiR71kJQCKQYB5NGImbOviK8K+kg5xkNSYXLBupuX9QhatFowrsvo9Hj8WgArg3W7ijNAQw==", + "version": "7.17.3", "dev": true, "requires": { "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.9", + "@babel/generator": "^7.17.3", "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.17.9", + "@babel/helper-function-name": "^7.16.7", "@babel/helper-hoist-variables": "^7.16.7", "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.9", + "@babel/parser": "^7.17.3", "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" @@ -20690,8 +18767,6 @@ }, "@babel/types": { "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.16.7", @@ -20700,8 +18775,6 @@ }, "@chainsafe/libp2p-noise": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.1.2.tgz", - "integrity": "sha512-UvZLWvIS7bAz6M8XfsnC/NhT1c/lg8NNsME1hTvo21kRwyxNFpB8gEhId03Cb5B23oIaHhMySAHBcpuMiSxQ2w==", "requires": { "@stablelib/chacha20poly1305": "^1.0.1", "@stablelib/hkdf": "^1.0.1", @@ -20720,14 +18793,10 @@ }, "dependencies": { "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" }, "peer-id": { "version": "0.15.4", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.15.4.tgz", - "integrity": "sha512-MDoBIMZYwQIAHaZQUwsIcvoFgdbIl5GtZMwSkXpIYvc5v0TSDv+u8WsTKrKt2Vv28tHFFDJQdVzu3T4qTPzK+w==", "requires": { "class-is": "^1.1.0", "libp2p-crypto": "^0.20.0", @@ -20739,8 +18808,6 @@ "dependencies": { "libp2p-crypto": { "version": "0.20.0", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.20.0.tgz", - "integrity": "sha512-WgIW9rYcWaO/5j2T6NW3R6Q46yvp2ZfFErqRMbi4/pOTL3T7+OROYpL/1iWVksWkXyurU/t2qFsIijWMxR5C4Q==", "requires": { "err-code": "^3.0.1", "iso-random-stream": "^2.0.0", @@ -20760,20 +18827,14 @@ } }, "@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==" + "version": "1.5.0" }, "@cspotcode/source-map-consumer": { "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", - "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", "dev": true }, "@cspotcode/source-map-support": { "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", - "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", "dev": true, "requires": { "@cspotcode/source-map-consumer": "0.8.0" @@ -20781,8 +18842,6 @@ }, "@dabh/diagnostics": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", - "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", "requires": { "colorspace": "1.1.x", "enabled": "2.0.x", @@ -20791,8 +18850,6 @@ }, "@discoveryjs/json-ext": { "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true }, "@ethereumjs/block": { @@ -20804,6 +18861,7 @@ "@types/node": "^16.11.7", "@types/tape": "^4.13.2", "eslint": "^6.8.0", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -20813,6 +18871,7 @@ "merkle-patricia-tree": "^4.2.4", "nyc": "^15.1.0", "prettier": "^2.0.5", + "rlp": "^3.0.0", "tape": "^5.3.1", "ts-node": "^10.2.1", "typedoc": "^0.22.4", @@ -20821,8 +18880,6 @@ "dependencies": { "deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "requires": { "call-bind": "^1.0.0", @@ -20844,8 +18901,6 @@ }, "resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, "requires": { "is-core-module": "^2.2.0", @@ -20853,9 +18908,7 @@ } }, "tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -20870,7 +18923,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -20905,6 +18958,7 @@ "lru-cache": "^5.1.1", "nyc": "^15.1.0", "prettier": "^2.0.5", + "rlp": "^3.0.0", "semaphore-async-await": "^1.5.1", "tape": "^5.3.1", "ts-node": "^10.2.1", @@ -20914,8 +18968,6 @@ "dependencies": { "deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "requires": { "call-bind": "^1.0.0", @@ -20937,18 +18989,14 @@ }, "resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, "requires": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" } }, - "tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "tape": { + "version": "5.5.2", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -20963,7 +19011,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -20984,7 +19032,7 @@ "@ethereumjs/block": "^3.6.2", "@ethereumjs/blockchain": "^5.5.2", "@ethereumjs/common": "^2.6.4", - "@ethereumjs/devp2p": "^4.2.1", + "@ethereumjs/devp2p": "^4.2.2", "@ethereumjs/ethash": "^1.1.0", "@ethereumjs/statemanager": "^1.0.0", "@ethereumjs/tx": "^3.5.1", @@ -21004,6 +19052,7 @@ "crypto-browserify": "^3.12.0", "debug": "^4.3.3", "eslint": "^6.8.0", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "file-replace-loader": "^1.2.0", "fs-extra": "^10.0.0", @@ -21037,6 +19086,7 @@ "process": "^0.11.10", "pull-pair": "^1.1.0", "qheap": "^1.4.0", + "rlp": "^3.0.0", "stream-browserify": "^3.0.0", "supertest": "^6.1.3", "superwstest": "^2.0.1", @@ -21055,8 +19105,6 @@ "dependencies": { "deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "requires": { "call-bind": "^1.0.0", @@ -21078,8 +19126,6 @@ }, "resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, "requires": { "is-core-module": "^2.2.0", @@ -21087,9 +19133,7 @@ } }, "tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -21104,7 +19148,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -21140,8 +19184,6 @@ "dependencies": { "deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "requires": { "call-bind": "^1.0.0", @@ -21163,8 +19205,6 @@ }, "resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, "requires": { "is-core-module": "^2.2.0", @@ -21172,9 +19212,7 @@ } }, "tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -21189,7 +19227,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -21208,7 +19246,6 @@ "@ethereumjs/block": "^3.6.2", "@ethereumjs/common": "^2.6.4", "@ethereumjs/tx": "^3.5.1", - "@types/async": "^2.4.1", "@types/bl": "^2.1.0", "@types/chalk": "^2.2.0", "@types/debug": "^4.1.4", @@ -21220,7 +19257,6 @@ "@types/node": "^16.11.7", "@types/secp256k1": "^4.0.1", "@types/tape": "^4.13.2", - "async": "^2.6.0", "base64url": "^3.0.1", "bl": "^1.1.2", "chalk": "^2.4.2", @@ -21237,6 +19273,7 @@ "multiaddr": "^10.0.1", "nyc": "^15.1.0", "prettier": "^2.0.5", + "rlp": "^3.0.0", "scanf": "^1.1.2", "secp256k1": "^4.0.2", "snappyjs": "^0.6.1", @@ -21249,8 +19286,6 @@ "dependencies": { "ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -21258,8 +19293,6 @@ }, "chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -21269,8 +19302,6 @@ }, "color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { "color-name": "1.1.3" @@ -21278,14 +19309,10 @@ }, "color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "requires": { "call-bind": "^1.0.0", @@ -21307,14 +19334,10 @@ }, "has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, "requires": { "is-core-module": "^2.2.0", @@ -21323,17 +19346,13 @@ }, "supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" } }, "tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -21348,7 +19367,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -21371,10 +19390,12 @@ "bigint-crypto-utils": "^3.0.23", "buffer-xor": "^2.0.1", "eslint": "^6.8.0", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", "nyc": "^15.1.0", "prettier": "^2.0.5", + "rlp": "^3.0.0", "tape": "^5.3.1", "ts-node": "^10.2.1", "typedoc": "^0.22.4", @@ -21383,8 +19404,6 @@ "dependencies": { "deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "requires": { "call-bind": "^1.0.0", @@ -21406,8 +19425,6 @@ }, "resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, "requires": { "is-core-module": "^2.2.0", @@ -21415,9 +19432,7 @@ } }, "tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -21432,7 +19447,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -21453,6 +19468,7 @@ "@types/tape": "^4.13.2", "debug": "^4.3.3", "eslint": "^6.8.0", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", "karma": "^6.3.2", @@ -21463,6 +19479,7 @@ "merkle-patricia-tree": "^4.2.4", "nyc": "^15.1.0", "prettier": "^2.0.5", + "rlp": "^3.0.0", "standard": "^10.0.0", "tape": "^5.3.1", "ts-node": "^10.2.1", @@ -21542,6 +19559,7 @@ "@types/node": "^16.11.7", "@types/tape": "^4.13.2", "eslint": "^6.8.0", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -21552,6 +19570,7 @@ "node-dir": "^0.1.16", "nyc": "^15.1.0", "prettier": "^2.0.5", + "rlp": "^3.0.0", "tape": "^5.3.1", "ts-node": "^10.2.1", "typedoc": "^0.22.4", @@ -21560,8 +19579,6 @@ "dependencies": { "deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "requires": { "call-bind": "^1.0.0", @@ -21583,8 +19600,6 @@ }, "resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, "requires": { "is-core-module": "^2.2.0", @@ -21592,9 +19607,7 @@ } }, "tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -21609,7 +19622,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -21643,6 +19656,7 @@ "core-js-pure": "^3.0.1", "debug": "^4.3.3", "eslint": "^6.8.0", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", "karma": "^6.3.2", @@ -21658,6 +19672,7 @@ "node-dir": "^0.1.17", "nyc": "^15.1.0", "prettier": "^2.0.5", + "rlp": "^3.0.0", "rustbn.js": "~0.2.0", "solc": "^0.8.1", "standard": "^10.0.0", @@ -21669,8 +19684,6 @@ "dependencies": { "deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "requires": { "call-bind": "^1.0.0", @@ -21692,8 +19705,6 @@ }, "resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, "requires": { "is-core-module": "^2.2.0", @@ -21701,9 +19712,7 @@ } }, "tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -21718,7 +19727,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -21733,8 +19742,6 @@ }, "@ethersproject/abi": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.0.tgz", - "integrity": "sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg==", "dev": true, "requires": { "@ethersproject/address": "^5.6.0", @@ -21750,8 +19757,6 @@ }, "@ethersproject/abstract-provider": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz", - "integrity": "sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw==", "dev": true, "requires": { "@ethersproject/bignumber": "^5.6.0", @@ -21765,8 +19770,6 @@ }, "@ethersproject/abstract-signer": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz", - "integrity": "sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ==", "dev": true, "requires": { "@ethersproject/abstract-provider": "^5.6.0", @@ -21778,8 +19781,6 @@ }, "@ethersproject/address": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.0.tgz", - "integrity": "sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ==", "dev": true, "requires": { "@ethersproject/bignumber": "^5.6.0", @@ -21791,8 +19792,6 @@ }, "@ethersproject/base64": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.0.tgz", - "integrity": "sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw==", "dev": true, "requires": { "@ethersproject/bytes": "^5.6.0" @@ -21800,19 +19799,21 @@ }, "@ethersproject/bignumber": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.0.tgz", - "integrity": "sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA==", "dev": true, "requires": { "@ethersproject/bytes": "^5.6.0", "@ethersproject/logger": "^5.6.0", "bn.js": "^4.11.9" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "dev": true + } } }, "@ethersproject/bytes": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", - "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", + "version": "5.6.0", "dev": true, "requires": { "@ethersproject/logger": "^5.6.0" @@ -21820,8 +19821,6 @@ }, "@ethersproject/constants": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.0.tgz", - "integrity": "sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA==", "dev": true, "requires": { "@ethersproject/bignumber": "^5.6.0" @@ -21829,8 +19828,6 @@ }, "@ethersproject/hash": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.0.tgz", - "integrity": "sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA==", "dev": true, "requires": { "@ethersproject/abstract-signer": "^5.6.0", @@ -21845,8 +19842,6 @@ }, "@ethersproject/keccak256": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.0.tgz", - "integrity": "sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w==", "dev": true, "requires": { "@ethersproject/bytes": "^5.6.0", @@ -21855,14 +19850,10 @@ }, "@ethersproject/logger": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", - "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", "dev": true }, "@ethersproject/networks": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.1.tgz", - "integrity": "sha512-b2rrupf3kCTcc3jr9xOWBuHylSFtbpJf79Ga7QR98ienU2UqGimPGEsYMgbI29KHJfA5Us89XwGVmxrlxmSrMg==", + "version": "5.6.0", "dev": true, "requires": { "@ethersproject/logger": "^5.6.0" @@ -21870,8 +19861,6 @@ }, "@ethersproject/properties": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", - "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", "dev": true, "requires": { "@ethersproject/logger": "^5.6.0" @@ -21879,8 +19868,6 @@ }, "@ethersproject/rlp": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.0.tgz", - "integrity": "sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g==", "dev": true, "requires": { "@ethersproject/bytes": "^5.6.0", @@ -21889,8 +19876,6 @@ }, "@ethersproject/signing-key": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.0.tgz", - "integrity": "sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA==", "dev": true, "requires": { "@ethersproject/bytes": "^5.6.0", @@ -21899,12 +19884,16 @@ "bn.js": "^4.11.9", "elliptic": "6.5.4", "hash.js": "1.1.7" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "dev": true + } } }, "@ethersproject/strings": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.0.tgz", - "integrity": "sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg==", "dev": true, "requires": { "@ethersproject/bytes": "^5.6.0", @@ -21914,8 +19903,6 @@ }, "@ethersproject/transactions": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.0.tgz", - "integrity": "sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg==", "dev": true, "requires": { "@ethersproject/address": "^5.6.0", @@ -21931,8 +19918,6 @@ }, "@ethersproject/web": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.0.tgz", - "integrity": "sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg==", "dev": true, "requires": { "@ethersproject/base64": "^5.6.0", @@ -21944,8 +19929,6 @@ }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "requires": { "camelcase": "^5.3.1", @@ -21957,34 +19940,24 @@ "dependencies": { "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 } } }, "@istanbuljs/schema": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true }, "@jridgewell/resolve-uri": { "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", "dev": true }, "@jridgewell/sourcemap-codec": { "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", "dev": true }, "@jridgewell/trace-mapping": { "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", - "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", "dev": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", @@ -21993,8 +19966,6 @@ }, "@motrix/nat-api": { "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@motrix/nat-api/-/nat-api-0.3.2.tgz", - "integrity": "sha512-T3LSHnEUULbSU1o1zCZZ1ul8l8Jm98f0fz/0BeF7DhNvrV63YllLCD4vUR9hFZWu/+WTIVPnbH8dBK5Ckuveuw==", "requires": { "async": "^3.2.0", "debug": "^4.3.1", @@ -22005,21 +19976,15 @@ }, "dependencies": { "async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" + "version": "3.2.3" } } }, "@multiformats/base-x": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@multiformats/base-x/-/base-x-4.0.1.tgz", - "integrity": "sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw==" + "version": "4.0.1" }, "@noble/ed25519": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@noble/ed25519/-/ed25519-1.6.0.tgz", - "integrity": "sha512-UKju89WV37IUALIMfKhKW3psO8AqmrE/GvH6QbPKjzolQ98zM7WmGUeY+xdIgSf5tqPFf75ZCYMgym6E9Jsw3Q==" + "version": "1.6.0" }, "@noble/hashes": { "version": "1.0.0", @@ -22027,14 +19992,10 @@ "integrity": "sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg==" }, "@noble/secp256k1": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.5.5.tgz", - "integrity": "sha512-sZ1W6gQzYnu45wPrWx8D3kwI2/U29VYTx9OjbDAd7jwRItJ0cSTMPRL/C8AWZFn9kWFLQGqEXVEE86w4Z8LpIQ==" + "version": "1.5.5" }, "@nodelib/fs.scandir": { "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "requires": { "@nodelib/fs.stat": "2.0.5", @@ -22043,14 +20004,10 @@ }, "@nodelib/fs.stat": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true }, "@nodelib/fs.walk": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.5", @@ -22058,58 +20015,38 @@ } }, "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + "version": "1.1.2" }, "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + "version": "1.1.2" }, "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + "version": "2.0.4" }, "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + "version": "1.1.0" }, "@protobufjs/fetch": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", "requires": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" } }, "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + "version": "1.0.2" }, "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + "version": "1.1.0" }, "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + "version": "1.1.2" }, "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + "version": "1.1.0" }, "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + "version": "1.1.0" }, "@scure/base": { "version": "1.0.0", @@ -22137,24 +20074,18 @@ }, "@sinonjs/commons": { "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", "requires": { "type-detect": "4.0.8" } }, "@sinonjs/fake-timers": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", "requires": { "@sinonjs/commons": "^1.7.0" } }, "@sinonjs/samsam": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz", - "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==", "requires": { "@sinonjs/commons": "^1.6.0", "lodash.get": "^4.4.2", @@ -22162,38 +20093,26 @@ } }, "@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==" + "version": "0.7.1" }, "@socket.io/base64-arraybuffer": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", - "integrity": "sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ==", "dev": true }, "@stablelib/aead": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/aead/-/aead-1.0.1.tgz", - "integrity": "sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==" + "version": "1.0.1" }, "@stablelib/binary": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", - "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", "requires": { "@stablelib/int": "^1.0.1" } }, "@stablelib/bytes": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/bytes/-/bytes-1.0.1.tgz", - "integrity": "sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ==" + "version": "1.0.1" }, "@stablelib/chacha": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz", - "integrity": "sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==", "requires": { "@stablelib/binary": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -22201,8 +20120,6 @@ }, "@stablelib/chacha20poly1305": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha20poly1305/-/chacha20poly1305-1.0.1.tgz", - "integrity": "sha512-MmViqnqHd1ymwjOQfghRKw2R/jMIGT3wySN7cthjXCBdO+qErNPUBnRzqNpnvIwg7JBCg3LdeCZZO4de/yEhVA==", "requires": { "@stablelib/aead": "^1.0.1", "@stablelib/binary": "^1.0.1", @@ -22213,19 +20130,13 @@ } }, "@stablelib/constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/constant-time/-/constant-time-1.0.1.tgz", - "integrity": "sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==" + "version": "1.0.1" }, "@stablelib/hash": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hash/-/hash-1.0.1.tgz", - "integrity": "sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==" + "version": "1.0.1" }, "@stablelib/hkdf": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hkdf/-/hkdf-1.0.1.tgz", - "integrity": "sha512-SBEHYE16ZXlHuaW5RcGk533YlBj4grMeg5TooN80W3NpcHRtLZLLXvKyX0qcRFxf+BGDobJLnwkvgEwHIDBR6g==", "requires": { "@stablelib/hash": "^1.0.1", "@stablelib/hmac": "^1.0.1", @@ -22234,8 +20145,6 @@ }, "@stablelib/hmac": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hmac/-/hmac-1.0.1.tgz", - "integrity": "sha512-V2APD9NSnhVpV/QMYgCVMIYKiYG6LSqw1S65wxVoirhU/51ACio6D4yDVSwMzuTJXWZoVHbDdINioBwKy5kVmA==", "requires": { "@stablelib/constant-time": "^1.0.1", "@stablelib/hash": "^1.0.1", @@ -22243,22 +20152,16 @@ } }, "@stablelib/int": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", - "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" + "version": "1.0.1" }, "@stablelib/keyagreement": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/keyagreement/-/keyagreement-1.0.1.tgz", - "integrity": "sha512-VKL6xBwgJnI6l1jKrBAfn265cspaWBPAPEc62VBQrWHLqVgNRE09gQ/AnOEyKUWrrqfD+xSQ3u42gJjLDdMDQg==", "requires": { "@stablelib/bytes": "^1.0.1" } }, "@stablelib/poly1305": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/poly1305/-/poly1305-1.0.1.tgz", - "integrity": "sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==", "requires": { "@stablelib/constant-time": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -22266,8 +20169,6 @@ }, "@stablelib/random": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/random/-/random-1.0.1.tgz", - "integrity": "sha512-zOh+JHX3XG9MSfIB0LZl/YwPP9w3o6WBiJkZvjPoKKu5LKFW4OLV71vMxWp9qG5T43NaWyn0QQTWgqCdO+yOBQ==", "requires": { "@stablelib/binary": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -22275,8 +20176,6 @@ }, "@stablelib/sha256": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/sha256/-/sha256-1.0.1.tgz", - "integrity": "sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ==", "requires": { "@stablelib/binary": "^1.0.1", "@stablelib/hash": "^1.0.1", @@ -22284,14 +20183,10 @@ } }, "@stablelib/wipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", - "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" + "version": "1.0.1" }, "@stablelib/x25519": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@stablelib/x25519/-/x25519-1.0.2.tgz", - "integrity": "sha512-wTR0t0Bp1HABLFRbYaE3vFLuco2QbAg6QvxBnzi5j9qjhYezWHW7OiCZyaWbt25UkSaoolUUT4Il0nS/2vcbSw==", "requires": { "@stablelib/keyagreement": "^1.0.1", "@stablelib/random": "^1.0.1", @@ -22300,57 +20195,39 @@ }, "@tsconfig/node10": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", "dev": true }, "@tsconfig/node12": { "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", "dev": true }, "@tsconfig/node14": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", "dev": true }, "@tsconfig/node16": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", "dev": true }, "@types/abstract-leveldown": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", - "integrity": "sha512-q5veSX6zjUy/DlDhR4Y4cU0k2Ar+DT2LUraP00T19WLmTO6Se1djepCCaqU6nQrwcJ5Hyo/CWqxTzrrFg8eqbQ==" + "version": "7.2.0" }, "@types/async": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@types/async/-/async-2.4.2.tgz", - "integrity": "sha512-bWBbC7VG2jdjbgZMX0qpds8U/3h3anfIqE81L8jmVrgFZw/urEDnBA78ymGGKTTK6ciBXmmJ/xlok+Re41S8ww==", "dev": true }, "@types/benchmark": { "version": "1.0.33", - "resolved": "https://registry.npmjs.org/@types/benchmark/-/benchmark-1.0.33.tgz", - "integrity": "sha512-rG7Ieasa9UfZJnL72qiFvY9ivhEIYjCGgfcLLb5tJ/EL9+Mcxernj6W3HVCv/cOfJYuwNUwvVVhnrKl8iT8aqA==", "dev": true }, "@types/bl": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/bl/-/bl-2.1.0.tgz", - "integrity": "sha512-1TdA9IXOy4sdqn8vgieQ6GZAiHiPNrOiO1s2GJjuYPw4QVY7gYoVjkW049avj33Ez7IcIvu43hQsMsoUFbCn2g==", "requires": { "@types/node": "*" } }, "@types/bn.js": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", - "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", "dev": true, "requires": { "@types/node": "*" @@ -22358,8 +20235,6 @@ }, "@types/body-parser": { "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", "dev": true, "requires": { "@types/connect": "*", @@ -22368,8 +20243,6 @@ }, "@types/chalk": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@types/chalk/-/chalk-2.2.0.tgz", - "integrity": "sha512-1zzPV9FDe1I/WHhRkf9SNgqtRJWZqrBWgu7JGveuHmmyR9CnAPCie2N/x+iHrgnpYBIcCJWHBoMRv2TRWktsvw==", "dev": true, "requires": { "chalk": "*" @@ -22377,46 +20250,32 @@ }, "@types/component-emitter": { "version": "1.2.11", - "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", - "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==", "dev": true }, "@types/connect": { "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", "requires": { "@types/node": "*" } }, "@types/cookie": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", "dev": true }, "@types/cookiejar": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", "dev": true }, "@types/core-js": { "version": "2.5.5", - "resolved": "https://registry.npmjs.org/@types/core-js/-/core-js-2.5.5.tgz", - "integrity": "sha512-C4vwOHrhsvxn7UFyk4NDQNUpgNKdWsT/bL39UWyD75KSEOObZSKa9mYDOCM5FGeJG2qtbG0XiEbUKND2+j0WOg==", "dev": true }, "@types/cors": { "version": "2.8.12", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", "dev": true }, "@types/debug": { "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", "dev": true, "requires": { "@types/ms": "*" @@ -22424,8 +20283,6 @@ }, "@types/eslint": { "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", - "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", "dev": true, "requires": { "@types/estree": "*", @@ -22434,8 +20291,6 @@ }, "@types/eslint-scope": { "version": "3.7.3", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", "dev": true, "requires": { "@types/eslint": "*", @@ -22444,14 +20299,10 @@ }, "@types/estree": { "version": "0.0.51", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", - "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", "dev": true }, "@types/express-serve-static-core": { "version": "4.17.28", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", - "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", "requires": { "@types/node": "*", "@types/qs": "*", @@ -22460,8 +20311,6 @@ }, "@types/fs-extra": { "version": "8.1.2", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.2.tgz", - "integrity": "sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==", "dev": true, "requires": { "@types/node": "*" @@ -22469,51 +20318,37 @@ }, "@types/ip": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@types/ip/-/ip-1.1.0.tgz", - "integrity": "sha512-dwNe8gOoF70VdL6WJBwVHtQmAX4RMd62M+mAB9HQFjG1/qiCLM/meRy95Pd14FYBbEDwCq7jgJs89cHpLBu4HQ==", "dev": true, "requires": { "@types/node": "*" } }, "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.10", "dev": true }, "@types/jwt-simple": { "version": "0.5.33", - "resolved": "https://registry.npmjs.org/@types/jwt-simple/-/jwt-simple-0.5.33.tgz", - "integrity": "sha1-+4Ocq+gUN5VPfQzQF2CtgJbsUm4=", "dev": true }, "@types/k-bucket": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@types/k-bucket/-/k-bucket-5.0.1.tgz", - "integrity": "sha512-HjWSV4fBIRlZNbp7e+IQlHOY9MZhBcY+9Jf8vhZv5qGHJMlkCQQBKiX/n69/3YvTF34jsm+WKmro7eyG6FbYww==", "requires": { "@types/node": "*" } }, "@types/keccak": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/keccak/-/keccak-3.0.1.tgz", - "integrity": "sha512-/MxAVmtyyeOvZ6dGf3ciLwFRuV5M8DRIyYNFGHYI6UyBW4/XqyO0LZw+JFMvaeY3cHItQAkELclBU1x5ank6mg==", "dev": true, "requires": { "@types/node": "*" } }, "@types/level-errors": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/level-errors/-/level-errors-3.0.0.tgz", - "integrity": "sha512-/lMtoq/Cf/2DVOm6zE6ORyOM+3ZVm/BvzEZVxUhf6bgh8ZHglXlBqxbxSlJeVp8FCbD3IVvk/VbsaNmDjrQvqQ==" + "version": "3.0.0" }, "@types/levelup": { "version": "4.3.3", - "resolved": "https://registry.npmjs.org/@types/levelup/-/levelup-4.3.3.tgz", - "integrity": "sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA==", "requires": { "@types/abstract-leveldown": "*", "@types/level-errors": "*", @@ -22521,46 +20356,30 @@ } }, "@types/lodash": { - "version": "4.14.181", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.181.tgz", - "integrity": "sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag==" + "version": "4.14.180" }, "@types/long": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", - "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" + "version": "4.0.1" }, "@types/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==" + "version": "5.1.1" }, "@types/minimatch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" + "version": "3.0.5" }, "@types/minimist": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", "dev": true }, "@types/ms": { "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", "dev": true }, "@types/node": { - "version": "16.11.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.26.tgz", - "integrity": "sha512-GZ7bu5A6+4DtG7q9GsoHXy3ALcgeIHP4NnL0Vv2wu0uUB/yQex26v0tf6/na1mm0+bS9Uw+0DFex7aaKr2qawQ==" + "version": "16.11.26" }, "@types/node-dir": { "version": "0.0.34", - "resolved": "https://registry.npmjs.org/@types/node-dir/-/node-dir-0.0.34.tgz", - "integrity": "sha512-FwNgAbQyXvMP/kTsi/lH7Cpz+2xny+/ZhpDMophHcZerMxYvM+eqa8an1isNbykSQ9VCZutdbmMx2FLp5ufeMw==", "dev": true, "requires": { "@types/node": "*" @@ -22568,29 +20387,19 @@ }, "@types/parse-json": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, "@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + "version": "6.9.7" }, "@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + "version": "1.2.4" }, "@types/retry": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", - "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==" + "version": "0.12.1" }, "@types/secp256k1": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", "dev": true, "requires": { "@types/node": "*" @@ -22598,8 +20407,6 @@ }, "@types/superagent": { "version": "4.1.15", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.15.tgz", - "integrity": "sha512-mu/N4uvfDN2zVQQ5AYJI/g4qxn2bHB6521t1UuH09ShNWjebTqN0ZFuYK9uYjcgmI0dTQEs+Owi1EO6U0OkOZQ==", "dev": true, "requires": { "@types/cookiejar": "*", @@ -22608,8 +20415,6 @@ }, "@types/supertest": { "version": "2.0.12", - "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.12.tgz", - "integrity": "sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==", "dev": true, "requires": { "@types/superagent": "*" @@ -22617,8 +20422,6 @@ }, "@types/tape": { "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@types/tape/-/tape-4.13.2.tgz", - "integrity": "sha512-V1ez/RtYRGN9cNYApw5xf27DpMkTB0033X6a2i3KUmKhSojBfbWN0i3EgZxboUG96WJLHLdOyZ01aiZwVW5aSA==", "dev": true, "requires": { "@types/node": "*" @@ -22626,16 +20429,12 @@ }, "@types/ws": { "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", "requires": { "@types/node": "*" } }, "@typescript-eslint/eslint-plugin": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", - "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", "dev": true, "requires": { "@typescript-eslint/experimental-utils": "4.33.0", @@ -22650,17 +20449,13 @@ "dependencies": { "lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { "yallist": "^4.0.0" } }, "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.5", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -22668,16 +20463,12 @@ }, "yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true } } }, "@typescript-eslint/experimental-utils": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", - "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", "dev": true, "requires": { "@types/json-schema": "^7.0.7", @@ -22690,8 +20481,6 @@ }, "@typescript-eslint/parser": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", - "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", "dev": true, "requires": { "@typescript-eslint/scope-manager": "4.33.0", @@ -22702,8 +20491,6 @@ }, "@typescript-eslint/scope-manager": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", - "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", "dev": true, "requires": { "@typescript-eslint/types": "4.33.0", @@ -22712,14 +20499,10 @@ }, "@typescript-eslint/types": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", - "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", "dev": true }, "@typescript-eslint/typescript-estree": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", - "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", "dev": true, "requires": { "@typescript-eslint/types": "4.33.0", @@ -22733,17 +20516,13 @@ "dependencies": { "lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { "yallist": "^4.0.0" } }, "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.5", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -22751,16 +20530,12 @@ }, "yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true } } }, "@typescript-eslint/visitor-keys": { "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", - "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", "dev": true, "requires": { "@typescript-eslint/types": "4.33.0", @@ -22769,24 +20544,14 @@ }, "@verdaccio/commons-api": { "version": "9.7.1", - "resolved": "https://registry.npmjs.org/@verdaccio/commons-api/-/commons-api-9.7.1.tgz", - "integrity": "sha512-s2uD3s325C0UsQ9uQTmf15dXFsGVo23IM6pSUTukCRuurCok89e/k1Adz2CaoXpEu1qpxQ6Sv0dcNpGl7Q7hwQ==", "dev": true, "requires": { "http-errors": "1.8.0", "http-status-codes": "1.4.0" }, "dependencies": { - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, "http-errors": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", - "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", "dev": true, "requires": { "depd": "~1.1.2", @@ -22798,16 +20563,12 @@ }, "toidentifier": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true } } }, "@verdaccio/file-locking": { "version": "9.7.2", - "resolved": "https://registry.npmjs.org/@verdaccio/file-locking/-/file-locking-9.7.2.tgz", - "integrity": "sha512-y9yLk8+9wdQH1bDyeR7Cu80dKQMiiva9ddNbXllV6h0uxaqVOxDyyE0OWdyvUy0xdA4lUD/y0DxHOInDOhdKaw==", "dev": true, "requires": { "lockfile": "1.0.4" @@ -22815,8 +20576,6 @@ }, "@verdaccio/local-storage": { "version": "9.7.5", - "resolved": "https://registry.npmjs.org/@verdaccio/local-storage/-/local-storage-9.7.5.tgz", - "integrity": "sha512-Hur5GGvy6L7lrKmITC+t+VgdRuUGA1Y2/j3DC726NC0obtOlNsOkXTPQTUgSlvao0KnnHSzfm1+MZ7ZlwCMYew==", "dev": true, "requires": { "@verdaccio/commons-api": "^9.7.1", @@ -22830,8 +20589,6 @@ "dependencies": { "abstract-leveldown": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz", - "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==", "dev": true, "requires": { "level-concat-iterator": "~2.0.0", @@ -22840,20 +20597,14 @@ }, "async": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", "dev": true }, "immediate": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=", "dev": true }, "level": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/level/-/level-5.0.1.tgz", - "integrity": "sha512-wcak5OQeA4rURGacqS62R/xNHjCYnJSQDBOlm4KNUGJVE9bWv2B04TclqReYejN+oD65PzD4FsqeWoI5wNC5Lg==", "dev": true, "requires": { "level-js": "^4.0.0", @@ -22864,8 +20615,6 @@ }, "level-js": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-js/-/level-js-4.0.2.tgz", - "integrity": "sha512-PeGjZsyMG4O89KHiez1zoMJxStnkM+oBIqgACjoo5PJqFiSUUm3GNod/KcbqN5ktyZa8jkG7I1T0P2u6HN9lIg==", "dev": true, "requires": { "abstract-leveldown": "~6.0.1", @@ -22877,8 +20626,6 @@ }, "mkdirp": { "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { "minimist": "^1.2.5" @@ -22888,8 +20635,6 @@ }, "@verdaccio/readme": { "version": "9.7.5", - "resolved": "https://registry.npmjs.org/@verdaccio/readme/-/readme-9.7.5.tgz", - "integrity": "sha512-1CXqpXHCcmrCzFk++Cs7S1gcj/pSSUozVIuUPNrnp+GWAbM+kmalC1H6mpYCK2zR8jA3EkwLSyPbzK21E/B4tQ==", "dev": true, "requires": { "dompurify": "^2.2.6", @@ -22899,28 +20644,20 @@ "dependencies": { "marked": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz", - "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==", "dev": true } } }, "@verdaccio/streams": { "version": "9.7.2", - "resolved": "https://registry.npmjs.org/@verdaccio/streams/-/streams-9.7.2.tgz", - "integrity": "sha512-SoCG1btVFPxOcrs8w9wLJCfe8nfE6EaEXCXyRwGbh+Sr3NLEG0R8JOugGJbuSE+zIRuUs5JaUKjzSec+JKLvZw==", "dev": true }, "@verdaccio/ui-theme": { "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@verdaccio/ui-theme/-/ui-theme-1.15.1.tgz", - "integrity": "sha512-CSd/NnVuqWQo7RnmL7ehZeAEYUbvGM33VmWGzoO91Ujny2tbhlg7kdpbfiEIoKl8Yc2wd9bVMd1HJATDF2uHGw==", "dev": true }, "@webassemblyjs/ast": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", "dev": true, "requires": { "@webassemblyjs/helper-numbers": "1.11.1", @@ -22929,26 +20666,18 @@ }, "@webassemblyjs/floating-point-hex-parser": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", "dev": true }, "@webassemblyjs/helper-api-error": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", "dev": true }, "@webassemblyjs/helper-buffer": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", - "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", "dev": true }, "@webassemblyjs/helper-numbers": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", "dev": true, "requires": { "@webassemblyjs/floating-point-hex-parser": "1.11.1", @@ -22958,14 +20687,10 @@ }, "@webassemblyjs/helper-wasm-bytecode": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", "dev": true }, "@webassemblyjs/helper-wasm-section": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", - "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", "dev": true, "requires": { "@webassemblyjs/ast": "1.11.1", @@ -22976,8 +20701,6 @@ }, "@webassemblyjs/ieee754": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", - "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", "dev": true, "requires": { "@xtuc/ieee754": "^1.2.0" @@ -22985,8 +20708,6 @@ }, "@webassemblyjs/leb128": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", - "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", "dev": true, "requires": { "@xtuc/long": "4.2.2" @@ -22994,14 +20715,10 @@ }, "@webassemblyjs/utf8": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", - "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", "dev": true }, "@webassemblyjs/wasm-edit": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", - "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", "dev": true, "requires": { "@webassemblyjs/ast": "1.11.1", @@ -23016,8 +20733,6 @@ }, "@webassemblyjs/wasm-gen": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", - "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", "dev": true, "requires": { "@webassemblyjs/ast": "1.11.1", @@ -23029,8 +20744,6 @@ }, "@webassemblyjs/wasm-opt": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", - "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", "dev": true, "requires": { "@webassemblyjs/ast": "1.11.1", @@ -23041,8 +20754,6 @@ }, "@webassemblyjs/wasm-parser": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", - "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", "dev": true, "requires": { "@webassemblyjs/ast": "1.11.1", @@ -23055,8 +20766,6 @@ }, "@webassemblyjs/wast-printer": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", - "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", "dev": true, "requires": { "@webassemblyjs/ast": "1.11.1", @@ -23065,15 +20774,11 @@ }, "@webpack-cli/configtest": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.1.tgz", - "integrity": "sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg==", "dev": true, "requires": {} }, "@webpack-cli/info": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.1.tgz", - "integrity": "sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA==", "dev": true, "requires": { "envinfo": "^7.7.3" @@ -23081,33 +20786,23 @@ }, "@webpack-cli/serve": { "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.1.tgz", - "integrity": "sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw==", "dev": true, "requires": {} }, "@xtuc/ieee754": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", "dev": true }, "@xtuc/long": { "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, "@zxing/text-encoding": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", - "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", "optional": true }, "0x": { "version": "4.11.0", - "resolved": "https://registry.npmjs.org/0x/-/0x-4.11.0.tgz", - "integrity": "sha512-AdEFfertRHzlGq5RWdF6kxHwNbpVBoCB5kIvIqXfgWu37UcP0mFK3P9FKundVauPvNpGCmA9YcJsPxt9+8MRoQ==", "dev": true, "requires": { "ajv": "^6.9.2", @@ -23142,38 +20837,28 @@ "dependencies": { "semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true } } }, "abab": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", "dev": true }, "abort-controller": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", "requires": { "event-target-shim": "^5.0.0" } }, "abortable-iterator": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-3.0.2.tgz", - "integrity": "sha512-qVP8HFfTpUQI2F+f1tpTriKDIZ4XrmwCrBCrQeRKO7DKWF3kgoT6NXiNDv2krrGcHxPwmI63eGQiec81sEaWIw==", "requires": { "get-iterator": "^1.0.2" } }, "abstract-leveldown": { "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", "requires": { "buffer": "^5.5.0", "immediate": "^3.2.3", @@ -23184,8 +20869,6 @@ "dependencies": { "buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -23195,8 +20878,6 @@ }, "accepts": { "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, "requires": { "mime-types": "~2.1.34", @@ -23205,14 +20886,10 @@ }, "acorn": { "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true }, "acorn-globals": { "version": "4.3.4", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", - "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==", "dev": true, "requires": { "acorn": "^6.0.1", @@ -23221,29 +20898,21 @@ "dependencies": { "acorn": { "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", "dev": true }, "acorn-walk": { "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", - "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", "dev": true } } }, "acorn-jsx": { "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "requires": {} }, "acorn-node": { "version": "1.8.2", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", - "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", "dev": true, "requires": { "acorn": "^7.0.0", @@ -23253,14 +20922,10 @@ }, "acorn-walk": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", "dev": true }, "aggregate-error": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "requires": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -23268,8 +20933,6 @@ }, "ajv": { "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -23279,15 +20942,11 @@ }, "ajv-keywords": { "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "dev": true, "requires": {} }, "ansi-escapes": { "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "requires": { "type-fest": "^0.21.3" @@ -23295,28 +20954,20 @@ }, "ansi-regex": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true }, "ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "requires": { "color-convert": "^2.0.1" } }, "ansicolors": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.2.1.tgz", - "integrity": "sha1-vgiVmQl7dKXJxKhKDNvNtivYeu8=", "dev": true }, "any-signal": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/any-signal/-/any-signal-2.1.2.tgz", - "integrity": "sha512-B+rDnWasMi/eWcajPcCWSlYc7muXOrcYrqgyzcdKisl2H/WTlQ0gip1KyQfr0ZlxJdsuWCj/LWwQm7fhyhRfIQ==", "requires": { "abort-controller": "^3.0.0", "native-abort-controller": "^1.0.3" @@ -23324,8 +20975,6 @@ }, "anymatch": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, "requires": { "normalize-path": "^3.0.0", @@ -23334,14 +20983,10 @@ }, "apache-md5": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/apache-md5/-/apache-md5-1.1.2.tgz", - "integrity": "sha1-7klza2ObTxCLbp5ibG2pkwa0FpI=", "dev": true }, "append-transform": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", - "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, "requires": { "default-require-extensions": "^3.0.0" @@ -23349,20 +20994,14 @@ }, "archy": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, "arg": { "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, "argparse": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "~1.0.2" @@ -23370,8 +21009,6 @@ }, "args": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/args/-/args-5.0.1.tgz", - "integrity": "sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==", "dev": true, "requires": { "camelcase": "5.0.0", @@ -23382,8 +21019,6 @@ "dependencies": { "ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -23391,14 +21026,10 @@ }, "camelcase": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", "dev": true }, "chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -23408,8 +21039,6 @@ }, "color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { "color-name": "1.1.3" @@ -23417,20 +21046,14 @@ }, "color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -23440,26 +21063,18 @@ }, "array-equal": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, "array-flatten": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", "dev": true }, "array-union": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, "array.prototype.every": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.3.tgz", - "integrity": "sha512-vWnriJI//SOMOWtXbU/VXhJ/InfnNHPF6BLKn5WfY8xXy+NWql0fUy20GO3sdqBhCAO+qw8S/E5nJiZX+QFdCA==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -23469,46 +21084,40 @@ } }, "array.prototype.find": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.2.0.tgz", - "integrity": "sha512-sn40qmUiLYAcRb/1HsIQjTTZ1kCy8II8VtZJpMn2Aoen9twULhbWXisfh3HimGqMlHGUul0/TfKCnXg42LuPpQ==", + "version": "2.1.2", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.19.4", - "es-shim-unscopables": "^1.0.0" + "es-abstract": "^1.19.0" } }, "asap": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", "dev": true }, "asn1": { "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "requires": { "safer-buffer": "~2.1.0" } }, "asn1.js": { "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", "requires": { "bn.js": "^4.0.0", "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0", "safer-buffer": "^2.1.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0" + } } }, "assert": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", "dev": true, "requires": { "object-assign": "^4.1.1", @@ -23517,14 +21126,10 @@ "dependencies": { "inherits": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", "dev": true }, "util": { "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { "inherits": "2.0.1" @@ -23533,67 +21138,45 @@ } }, "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "version": "1.0.0" }, "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" + "version": "1.1.0" }, "astral-regex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, "async": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", "requires": { "lodash": "^4.17.14" } }, "async-eventemitter": { "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", "requires": { "async": "^2.4.0" } }, "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "version": "0.4.0" }, "atomic-sleep": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", - "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", "dev": true }, "available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" + "version": "1.0.5" }, "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + "version": "0.7.0" }, "aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" + "version": "1.11.0" }, "babel-code-frame": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { "chalk": "^1.1.3", @@ -23603,20 +21186,14 @@ "dependencies": { "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, "chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { "ansi-styles": "^2.2.1", @@ -23628,14 +21205,10 @@ }, "js-tokens": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -23643,16 +21216,12 @@ }, "supports-color": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true } } }, "babel-polyfill": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", - "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", "dev": true, "requires": { "babel-runtime": "^6.26.0", @@ -23662,8 +21231,6 @@ }, "babel-runtime": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { "core-js": "^2.4.0", @@ -23672,56 +21239,38 @@ "dependencies": { "regenerator-runtime": { "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true } } }, "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "version": "1.0.2" }, "base32.js": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/base32.js/-/base32.js-0.1.0.tgz", - "integrity": "sha1-tYLexpPC8R6JPPBk7mrFthMaIgI=" + "version": "0.1.0" }, "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + "version": "1.5.1" }, "base64id": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "dev": true }, "base64url": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/base64url/-/base64url-3.0.1.tgz", - "integrity": "sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==" + "version": "3.0.1" }, "bcrypt-pbkdf": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "requires": { "tweetnacl": "^0.14.3" } }, "bcryptjs": { "version": "2.4.3", - "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", - "integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=", "dev": true }, "benchmark": { "version": "2.1.4", - "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", - "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", "dev": true, "requires": { "lodash": "^4.17.4", @@ -23730,14 +21279,12 @@ }, "big.js": { "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, "bigint-crypto-utils": { - "version": "3.0.23", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.0.23.tgz", - "integrity": "sha512-ecCXGRhpfm6gOMlNymoojOXnASyx8lwk3Z8f76lANPAnR/rgo/OKVMajxN5TbfT/BaEfcBXskpIUiRz8HPDKoQ==", + "version": "3.0.24", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.0.24.tgz", + "integrity": "sha512-TZZ04h0BCfE5kAR5VTiUp+8eWHcclXFCI+4EFL5Y8z0++XJqqUnEjgwzBbVIpMHbSBu3Gjv7VT6msIXJzzSfTg==", "requires": { "bigint-mod-arith": "^3.0.1" } @@ -23748,42 +21295,30 @@ "integrity": "sha512-tlhD4h/D1sv4pJfZzBesKOlfXRCQTeMMUrGbpc2PAawMAjb/S/OPAQfi667w6COt/UHOfvOW47sCSMaSEj4zIg==" }, "bignumber.js": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", - "integrity": "sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==" + "version": "9.0.2" }, "binary-extensions": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, "bindings": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "requires": { "file-uri-to-path": "1.0.0" } }, "bl": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", - "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", "requires": { "readable-stream": "^2.3.5", "safe-buffer": "^5.1.1" }, "dependencies": { "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "version": "1.0.0" }, "readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -23795,14 +21330,10 @@ } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.1.2" }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" } @@ -23810,53 +21341,40 @@ } }, "blakejs": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + "version": "1.2.1" }, "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "version": "5.2.0", + "dev": true }, "body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.19.2", "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", + "depd": "~1.1.2", + "http-errors": "1.8.1", "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.10.3", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" + "on-finished": "~2.3.0", + "qs": "6.9.7", + "raw-body": "2.4.3", + "type-is": "~1.6.18" }, "dependencies": { "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { "ms": "2.0.0" } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "version": "2.0.0" } } }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -23864,22 +21382,16 @@ }, "braces": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { "fill-range": "^7.0.1" } }, "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "version": "1.1.0" }, "browser-pack": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", - "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", "dev": true, "requires": { "combine-source-map": "~0.8.0", @@ -23892,14 +21404,10 @@ }, "browser-process-hrtime": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", "dev": true }, "browser-resolve": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", - "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", "dev": true, "requires": { "resolve": "^1.17.0" @@ -23907,8 +21415,6 @@ }, "browserify": { "version": "16.5.2", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.5.2.tgz", - "integrity": "sha512-TkOR1cQGdmXU9zW4YukWzWVSJwrxmNdADFbqbE3HFgQWe5wqZmOawqZ7J/8MPCwk/W8yY7Y0h+7mOtcZxLP23g==", "dev": true, "requires": { "assert": "^1.4.0", @@ -23963,14 +21469,10 @@ "dependencies": { "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -23984,14 +21486,10 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "stream-browserify": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", "dev": true, "requires": { "inherits": "~2.0.1", @@ -24000,8 +21498,6 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -24011,8 +21507,6 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { "buffer-xor": "^1.0.3", @@ -24025,16 +21519,12 @@ "dependencies": { "buffer-xor": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", "dev": true } } }, "browserify-cipher": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", "dev": true, "requires": { "browserify-aes": "^1.0.4", @@ -24044,8 +21534,6 @@ }, "browserify-des": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", "dev": true, "requires": { "cipher-base": "^1.0.1", @@ -24056,26 +21544,14 @@ }, "browserify-rsa": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", "dev": true, "requires": { "bn.js": "^5.0.0", "randombytes": "^2.0.1" - }, - "dependencies": { - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", - "dev": true - } } }, "browserify-sign": { "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", "dev": true, "requires": { "bn.js": "^5.1.1", @@ -24087,20 +21563,10 @@ "parse-asn1": "^5.1.5", "readable-stream": "^3.6.0", "safe-buffer": "^5.2.0" - }, - "dependencies": { - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", - "dev": true - } } }, "browserify-zlib": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dev": true, "requires": { "pako": "~1.0.5" @@ -24108,8 +21574,6 @@ }, "browserslist": { "version": "4.20.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", - "integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==", "dev": true, "requires": { "caniuse-lite": "^1.0.30001317", @@ -24121,8 +21585,6 @@ }, "buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", "dev": true, "requires": { "base64-js": "^1.0.2", @@ -24131,40 +21593,28 @@ }, "buffer-equal-constant-time": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=", "dev": true }, "buffer-from": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, "buffer-xor": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", - "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", "requires": { "safe-buffer": "^5.1.1" } }, "builtin-modules": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, "builtin-status-codes": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", "dev": true }, "bunyan": { "version": "1.8.15", - "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.15.tgz", - "integrity": "sha512-0tECWShh6wUysgucJcBAoYegf3JJoZWibxdqhTm7OHPeT42qdjkZ29QCMcKwbgU1kiH+auSIasNRXMLWXafXig==", "dev": true, "requires": { "dtrace-provider": "~0.8", @@ -24174,20 +21624,14 @@ } }, "bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + "version": "3.1.2" }, "cached-path-relative": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz", - "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==", "dev": true }, "caching-transform": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, "requires": { "hasha": "^5.0.0", @@ -24198,8 +21642,6 @@ "dependencies": { "make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -24209,8 +21651,6 @@ }, "call-bind": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -24218,8 +21658,6 @@ }, "caller-path": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "dev": true, "requires": { "callsites": "^0.2.0" @@ -24227,22 +21665,16 @@ "dependencies": { "callsites": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true } } }, "callsites": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "camel-case": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", "dev": true, "requires": { "no-case": "^2.2.0", @@ -24251,25 +21683,17 @@ }, "camelcase": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "caniuse-lite": { - "version": "1.0.30001328", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001328.tgz", - "integrity": "sha512-Ue55jHkR/s4r00FLNiX+hGMMuwml/QGqqzVeMQ5thUewznU2EdULFvI3JR7JJid6OrjJNfFvHY2G2dIjmRaDDQ==", + "version": "1.0.30001319", "dev": true }, "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "version": "0.12.0" }, "chai": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", - "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", "requires": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", @@ -24281,14 +21705,10 @@ } }, "chai-checkmark": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/chai-checkmark/-/chai-checkmark-1.0.1.tgz", - "integrity": "sha1-n7s8mtkQHwl+8ogyjTD0In10//s=" + "version": "1.0.1" }, "chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -24296,19 +21716,13 @@ }, "chardet": { "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" + "version": "1.0.2" }, "chokidar": { "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { "anymatch": "~3.1.2", @@ -24323,20 +21737,14 @@ }, "chrome-trace-event": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", "dev": true }, "ci-info": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, "cids": { "version": "1.1.9", - "resolved": "https://registry.npmjs.org/cids/-/cids-1.1.9.tgz", - "integrity": "sha512-l11hWRfugIcbGuTZwAM5PwpjPPjyb6UZOGwlHSnOBV5o07XhQ4gNpBN67FbODvpjyHtd+0Xs6KNvUcGBiDRsdg==", "requires": { "multibase": "^4.0.1", "multicodec": "^3.0.1", @@ -24346,8 +21754,6 @@ "dependencies": { "multicodec": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-3.2.1.tgz", - "integrity": "sha512-+expTPftro8VAW8kfvcuNNNBgb9gPeNYV9dn+z1kJRWF2vih+/S79f2RVeIwmrJBUJ6NT9IUPWnZDQvegEh5pw==", "requires": { "uint8arrays": "^3.0.0", "varint": "^6.0.0" @@ -24357,8 +21763,6 @@ }, "cipher-base": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { "inherits": "^2.0.1", @@ -24367,24 +21771,16 @@ }, "circular-json": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, "class-is": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", - "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==" + "version": "1.1.0" }, "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" + "version": "2.2.0" }, "cli-cursor": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "requires": { "restore-cursor": "^3.1.0" @@ -24392,14 +21788,10 @@ }, "cli-width": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true }, "cliui": { "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -24407,14 +21799,10 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "version": "5.0.1" }, "strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "requires": { "ansi-regex": "^5.0.1" } @@ -24423,14 +21811,10 @@ }, "clone": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true }, "clone-deep": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", "dev": true, "requires": { "is-plain-object": "^2.0.4", @@ -24440,20 +21824,14 @@ }, "co": { "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "color": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", - "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", "requires": { "color-convert": "^1.9.3", "color-string": "^1.6.0" @@ -24461,36 +21839,26 @@ "dependencies": { "color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "requires": { "color-name": "1.1.3" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "version": "1.1.3" } } }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "requires": { "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "version": "1.1.4" }, "color-string": { "version": "1.9.0", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.0.tgz", - "integrity": "sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ==", "requires": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" @@ -24498,20 +21866,14 @@ }, "colorette": { "version": "2.0.16", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", - "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", "dev": true }, "colors": { "version": "0.6.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", "dev": true }, "colorspace": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", - "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", "requires": { "color": "^3.1.3", "text-hex": "1.0.x" @@ -24519,8 +21881,6 @@ }, "combine-source-map": { "version": "0.8.0", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", "dev": true, "requires": { "convert-source-map": "~1.1.0", @@ -24531,54 +21891,38 @@ "dependencies": { "convert-source-map": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", "dev": true } } }, "combined-stream": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "requires": { "delayed-stream": "~1.0.0" } }, "command-exists": { "version": "1.2.9", - "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", - "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", "dev": true }, "commander": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", - "integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E=", "dev": true }, "commondir": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, "compare-versions": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", "dev": true }, "component-emitter": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, "compressible": { "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", "dev": true, "requires": { "mime-db": ">= 1.43.0 < 2" @@ -24586,8 +21930,6 @@ }, "compression": { "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", "dev": true, "requires": { "accepts": "~1.3.5", @@ -24601,14 +21943,10 @@ "dependencies": { "bytes": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", "dev": true }, "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -24616,27 +21954,19 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true } } }, "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "version": "0.0.1" }, "concat-stream": { "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -24647,14 +21977,10 @@ "dependencies": { "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -24668,14 +21994,10 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -24685,8 +22007,6 @@ }, "connect": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", - "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", "requires": { "debug": "2.6.9", "finalhandler": "1.1.2", @@ -24696,41 +22016,29 @@ "dependencies": { "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { "ms": "2.0.0" } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "version": "2.0.0" } } }, "console-browserify": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", "dev": true }, "constants-browserify": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", "dev": true }, "contains-path": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, "content-disposition": { "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", "dev": true, "requires": { "safe-buffer": "5.1.2" @@ -24738,21 +22046,15 @@ "dependencies": { "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true } } }, "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + "version": "1.0.4" }, "convert-source-map": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, "requires": { "safe-buffer": "~5.1.1" @@ -24760,60 +22062,48 @@ "dependencies": { "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true } } }, "cookie": { "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "dev": true }, "cookie-signature": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", "dev": true }, "cookiejar": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", - "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==", "dev": true }, "cookies": { "version": "0.8.0", - "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz", - "integrity": "sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==", "dev": true, "requires": { "depd": "~2.0.0", "keygrip": "~1.1.0" + }, + "dependencies": { + "depd": { + "version": "2.0.0", + "dev": true + } } }, "core-js": { "version": "2.6.12", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", "dev": true }, "core-js-pure": { - "version": "3.21.1", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.21.1.tgz", - "integrity": "sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ==" + "version": "3.21.1" }, "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "version": "1.0.2" }, "cors": { "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "requires": { "object-assign": "^4", "vary": "^1" @@ -24821,8 +22111,6 @@ }, "cosmiconfig": { "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", "dev": true, "requires": { "@types/parse-json": "^4.0.0", @@ -24833,24 +22121,28 @@ } }, "crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==" + "version": "1.2.1", + "requires": { + "exit-on-epipe": "~1.0.1", + "printj": "~1.3.1" + } }, "create-ecdh": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", "dev": true, "requires": { "bn.js": "^4.1.0", "elliptic": "^6.5.3" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "dev": true + } } }, "create-hash": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { "cipher-base": "^1.0.1", @@ -24862,8 +22154,6 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { "cipher-base": "^1.0.3", @@ -24876,14 +22166,10 @@ }, "create-require": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, "cross-spawn": { "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { "nice-try": "^1.0.4", @@ -24895,16 +22181,12 @@ "dependencies": { "semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true } } }, "crypto-browserify": { "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "dev": true, "requires": { "browserify-cipher": "^1.0.0", @@ -24922,14 +22204,10 @@ }, "cssom": { "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", "dev": true }, "cssstyle": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", "dev": true, "requires": { "cssom": "~0.3.6" @@ -24937,22 +22215,16 @@ "dependencies": { "cssom": { "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", "dev": true } } }, "custom-event": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", "dev": true }, "d": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", "dev": true, "requires": { "es5-ext": "^0.10.50", @@ -24961,8 +22233,6 @@ }, "d3-array": { "version": "2.12.1", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", - "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", "dev": true, "requires": { "internmap": "^1.0.0" @@ -24970,20 +22240,14 @@ }, "d3-color": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", - "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==", "dev": true }, "d3-dispatch": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", - "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==", "dev": true }, "d3-drag": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-1.2.5.tgz", - "integrity": "sha512-rD1ohlkKQwMZYkQlYVCrSFxsWPzI97+W+PaEIBNTMxRuxz9RF0Hi5nJWHGVJ3Om9d2fRTe1yOBINJyy/ahV95w==", "dev": true, "requires": { "d3-dispatch": "1", @@ -24992,14 +22256,10 @@ }, "d3-ease": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz", - "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ==", "dev": true }, "d3-fg": { "version": "6.14.0", - "resolved": "https://registry.npmjs.org/d3-fg/-/d3-fg-6.14.0.tgz", - "integrity": "sha512-M4QpFZOEvAq4ZDzwabJp2inL+KXS85T2SQl00zWwjnolaCJR+gHxUbT7Ha4GxTeW1NXwzbykhv/38I1fxQqbyg==", "dev": true, "requires": { "d3-array": "^2.2.0", @@ -25015,20 +22275,14 @@ }, "d3-format": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-2.0.0.tgz", - "integrity": "sha512-Ab3S6XuE/Q+flY96HXT0jOXcM4EAClYFnRGY5zsjRGNy6qCYrQsMffs7cV5Q9xejb35zxW5hf/guKw34kvIKsA==", "dev": true }, "d3-hierarchy": { "version": "1.1.9", - "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz", - "integrity": "sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==", "dev": true }, "d3-interpolate": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz", - "integrity": "sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ==", "dev": true, "requires": { "d3-color": "1 - 2" @@ -25036,8 +22290,6 @@ }, "d3-scale": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", - "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", "dev": true, "requires": { "d3-array": "^2.3.0", @@ -25049,14 +22301,10 @@ }, "d3-selection": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz", - "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg==", "dev": true }, "d3-time": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", - "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", "dev": true, "requires": { "d3-array": "2" @@ -25064,8 +22312,6 @@ }, "d3-time-format": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-3.0.0.tgz", - "integrity": "sha512-UXJh6EKsHBTjopVqZBhFysQcoXSv/5yLONZvkQ5Kk3qbwiUYkdX17Xa1PT6U1ZWXGGfB1ey5L8dKMlFq2DO0Ag==", "dev": true, "requires": { "d3-time": "1 - 2" @@ -25073,14 +22319,10 @@ }, "d3-timer": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", - "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==", "dev": true }, "d3-transition": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.3.2.tgz", - "integrity": "sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==", "dev": true, "requires": { "d3-color": "1", @@ -25093,14 +22335,10 @@ "dependencies": { "d3-color": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", - "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==", "dev": true }, "d3-interpolate": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", "dev": true, "requires": { "d3-color": "1" @@ -25110,8 +22348,6 @@ }, "d3-zoom": { "version": "1.8.3", - "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-1.8.3.tgz", - "integrity": "sha512-VoLXTK4wvy1a0JpH2Il+F2CiOhVu7VRXWF5M/LroMIh3/zBAC3WAt7QoIvPibOavVo20hN6/37vwAsdBejLyKQ==", "dev": true, "requires": { "d3-dispatch": "1", @@ -25123,14 +22359,10 @@ "dependencies": { "d3-color": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", - "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==", "dev": true }, "d3-interpolate": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", "dev": true, "requires": { "d3-color": "1" @@ -25140,22 +22372,16 @@ }, "dash-ast": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", - "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==", "dev": true }, "dashdash": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { "assert-plus": "^1.0.0" } }, "data-urls": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", - "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", "dev": true, "requires": { "abab": "^2.0.0", @@ -25165,14 +22391,10 @@ "dependencies": { "punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "tr46": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", "dev": true, "requires": { "punycode": "^2.1.0" @@ -25180,8 +22402,6 @@ }, "whatwg-url": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", "dev": true, "requires": { "lodash.sortby": "^4.7.0", @@ -25193,67 +22413,47 @@ }, "date-format": { "version": "4.0.6", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.6.tgz", - "integrity": "sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw==", "dev": true }, "dateformat": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", "dev": true }, "dayjs": { "version": "1.10.4", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.4.tgz", - "integrity": "sha512-RI/Hh4kqRc1UKLOAf/T5zdMMX5DQIlDxwUe3wSyMMnEbGunnpENCdbUgM+dW7kXidZqCttBrmw7BhN4TMddkCw==", "dev": true }, "debounce": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", - "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", "dev": true }, "debug": { "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { "ms": "2.1.2" }, "dependencies": { "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.2" } } }, "debug-log": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", - "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=", "dev": true }, "decamelize": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "deep-eql": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", "requires": { "type-detect": "^4.0.0" } }, "deep-equal": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", "dev": true, "requires": { "is-arguments": "^1.0.4", @@ -25266,22 +22466,16 @@ }, "deep-is": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "default-gateway": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", - "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", "requires": { "execa": "^5.0.0" } }, "default-require-extensions": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", - "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", "dev": true, "requires": { "strip-bom": "^4.0.0" @@ -25289,8 +22483,6 @@ }, "defaults": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", "dev": true, "requires": { "clone": "^1.0.2" @@ -25298,8 +22490,6 @@ }, "deferred-leveldown": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", "requires": { "abstract-leveldown": "~6.2.1", "inherits": "^2.0.3" @@ -25307,22 +22497,16 @@ }, "define-properties": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "requires": { "object-keys": "^1.0.12" } }, "defined": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", "dev": true }, "deglob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.1.tgz", - "integrity": "sha512-2kjwuGGonL7gWE1XU4Fv79+vVzpoQCl0V+boMwWtOQJV2AGDabCwez++nB1Nli/8BabAfZQ/UuHPlp6AymKdWw==", "dev": true, "requires": { "find-root": "^1.0.0", @@ -25335,31 +22519,21 @@ "dependencies": { "ignore": { "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true } } }, "delay": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", - "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==" + "version": "5.0.0" }, "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "version": "1.0.0" }, "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + "version": "1.1.2" }, "deps-sort": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", - "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", "dev": true, "requires": { "JSONStream": "^1.0.3", @@ -25370,8 +22544,6 @@ }, "des.js": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", "dev": true, "requires": { "inherits": "^2.0.1", @@ -25379,19 +22551,14 @@ } }, "destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" + "version": "1.0.4", + "dev": true }, "detect-node": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==" + "version": "2.1.0" }, "detective": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", - "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==", "dev": true, "requires": { "acorn-node": "^1.6.1", @@ -25401,8 +22568,6 @@ }, "dezalgo": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz", - "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=", "dev": true, "requires": { "asap": "^2.0.0", @@ -25411,30 +22576,28 @@ }, "di": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", - "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", "dev": true }, "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" + "version": "4.0.2" }, "diffie-hellman": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "dev": true + } } }, "dir-glob": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "requires": { "path-type": "^4.0.0" @@ -25442,14 +22605,10 @@ }, "dirty-chai": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/dirty-chai/-/dirty-chai-2.0.1.tgz", - "integrity": "sha512-ys79pWKvDMowIDEPC6Fig8d5THiC0DJ2gmTeGzVAoEH18J8OzLud0Jh7I9IWg3NSk8x2UocznUuFmfHCXYZx9w==", "requires": {} }, "dns-over-http-resolver": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/dns-over-http-resolver/-/dns-over-http-resolver-1.2.3.tgz", - "integrity": "sha512-miDiVSI6KSNbi4SVifzO/reD8rMnxgrlnkrlkugOLQpWQTe2qMdHsZp5DmfKjxNE+/T3VAAYLQUZMv9SMr6+AA==", "requires": { "debug": "^4.3.1", "native-fetch": "^3.0.0", @@ -25458,8 +22617,6 @@ }, "doctrine": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -25467,8 +22624,6 @@ }, "dom-serialize": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", - "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", "dev": true, "requires": { "custom-event": "~1.0.0", @@ -25479,14 +22634,10 @@ }, "domain-browser": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", "dev": true }, "domexception": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", "dev": true, "requires": { "webidl-conversions": "^4.0.2" @@ -25494,14 +22645,10 @@ }, "dompurify": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.6.tgz", - "integrity": "sha512-OFP2u/3T1R5CEgWCEONuJ1a5+MFKnOYpkywpUSxv/dj1LeBT1erK+JwM7zK0ROy2BRhqVCf0LRw/kHqKuMkVGg==", "dev": true }, "dotignore": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", - "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", "dev": true, "requires": { "minimatch": "^3.0.4" @@ -25509,8 +22656,6 @@ }, "dtrace-provider": { "version": "0.8.8", - "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz", - "integrity": "sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==", "dev": true, "optional": true, "requires": { @@ -25519,8 +22664,6 @@ }, "duplexer2": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", "dev": true, "requires": { "readable-stream": "^2.0.2" @@ -25528,14 +22671,10 @@ "dependencies": { "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -25549,14 +22688,10 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -25566,8 +22701,6 @@ }, "duplexify": { "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", "dev": true, "requires": { "end-of-stream": "^1.0.0", @@ -25578,14 +22711,10 @@ "dependencies": { "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -25599,14 +22728,10 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -25616,52 +22741,38 @@ }, "ecc-jsbn": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" }, "dependencies": { "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "version": "0.1.1" } } }, "ecdsa-sig-formatter": { "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", "dev": true, "requires": { "safe-buffer": "^5.0.1" } }, "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + "version": "1.1.1" }, "electron-fetch": { "version": "1.7.4", - "resolved": "https://registry.npmjs.org/electron-fetch/-/electron-fetch-1.7.4.tgz", - "integrity": "sha512-+fBLXEy4CJWQ5bz8dyaeSG1hD6JJ15kBZyj3eh24pIVrd3hLM47H/umffrdQfS6GZ0falF0g9JT9f3Rs6AVUhw==", "requires": { "encoding": "^0.1.13" } }, "electron-to-chromium": { - "version": "1.4.107", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.107.tgz", - "integrity": "sha512-Huen6taaVrUrSy8o7mGStByba8PfOWWluHNxSHGBrCgEdFVLtvdQDBr9LBCF9Uci8SYxh28QNNMO0oC17wbGAg==", + "version": "1.4.90", "dev": true }, "elliptic": { "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", "requires": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -25670,41 +22781,34 @@ "inherits": "^2.0.4", "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0" + } } }, "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "version": "8.0.0" }, "emojis-list": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true }, "enabled": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", - "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" + "version": "2.0.0" }, "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + "version": "1.0.2" }, "encoding": { "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", "requires": { "iconv-lite": "^0.6.2" }, "dependencies": { "iconv-lite": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "requires": { "safer-buffer": ">= 2.1.2 < 3.0.0" } @@ -25713,8 +22817,6 @@ }, "encoding-down": { "version": "6.3.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", - "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", "requires": { "abstract-leveldown": "^6.2.1", "inherits": "^2.0.3", @@ -25724,8 +22826,6 @@ }, "end-of-stream": { "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, "requires": { "once": "^1.4.0" @@ -25733,8 +22833,6 @@ }, "engine.io": { "version": "6.1.3", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.3.tgz", - "integrity": "sha512-rqs60YwkvWTLLnfazqgZqLa/aKo+9cueVfEi/dZ8PyGyaf8TLOxj++4QMIgeG3Gn0AhrWiFXvghsoY9L9h25GA==", "dev": true, "requires": { "@types/cookie": "^0.4.1", @@ -25751,8 +22849,6 @@ "dependencies": { "ws": { "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", "dev": true, "requires": {} } @@ -25760,8 +22856,6 @@ }, "engine.io-parser": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.3.tgz", - "integrity": "sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg==", "dev": true, "requires": { "@socket.io/base64-arraybuffer": "~1.0.2" @@ -25769,8 +22863,6 @@ }, "enhanced-resolve": { "version": "5.9.2", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.9.2.tgz", - "integrity": "sha512-GIm3fQfwLJ8YZx2smuHpBKkXC1yOk+OBEmKckVyL0i/ea8mqDEykK3ld5dgH1QYPNyT/lIllxV2LULnxCHaHkA==", "dev": true, "requires": { "graceful-fs": "^4.2.4", @@ -25779,48 +22871,34 @@ }, "ent": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", "dev": true }, "env-string": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/env-string/-/env-string-1.0.1.tgz", - "integrity": "sha512-/DhCJDf5DSFK32joQiWRpWrT0h7p3hVQfMKxiBb7Nt8C8IF8BYyPtclDnuGGLOoj16d/8udKeiE7JbkotDmorQ==", "dev": true }, "envinfo": { "version": "7.7.4", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.4.tgz", - "integrity": "sha512-TQXTYFVVwwluWSFis6K2XKxgrD22jEv0FTuLCQI+OjH7rn93+iY0fSSFM5lrSxFY+H1+B0/cvvlamr3UsBivdQ==", "dev": true }, "err-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" + "version": "2.0.3" }, "errno": { "version": "0.1.8", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", - "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", "requires": { "prr": "~1.0.1" } }, "error-ex": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" } }, "es-abstract": { - "version": "1.19.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.4.tgz", - "integrity": "sha512-flV8e5g9/xulChMG48Fygk1ptpo4lQRJ0eJYtxJFgi7pklLx7EFcOJ34jnvr8pbWlaFN/AT1cZpe0hiFel9Hqg==", + "version": "1.19.1", "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", @@ -25828,15 +22906,15 @@ "get-intrinsic": "^1.1.1", "get-symbol-description": "^1.0.0", "has": "^1.0.3", - "has-symbols": "^1.0.3", + "has-symbols": "^1.0.2", "internal-slot": "^1.0.3", "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.2", + "is-negative-zero": "^2.0.1", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.1", "is-string": "^1.0.7", - "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "is-weakref": "^1.0.1", + "object-inspect": "^1.11.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", @@ -25846,8 +22924,6 @@ }, "es-get-iterator": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz", - "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -25862,23 +22938,10 @@ }, "es-module-lexer": { "version": "0.9.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", - "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", "dev": true }, - "es-shim-unscopables": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, "es-to-primitive": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -25886,9 +22949,7 @@ } }, "es5-ext": { - "version": "0.10.60", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.60.tgz", - "integrity": "sha512-jpKNXIt60htYG59/9FGf2PYT3pwMpnEbNKysU+k/4FGwyGtMotOvcZOuW+EmXXYASRqYSXQfGL5cVIthOTgbkg==", + "version": "0.10.59", "dev": true, "requires": { "es6-iterator": "^2.0.3", @@ -25898,14 +22959,10 @@ }, "es6-error": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, "es6-iterator": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "dev": true, "requires": { "d": "1", @@ -25915,8 +22972,6 @@ }, "es6-map": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", - "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", "dev": true, "requires": { "d": "1", @@ -25929,27 +22984,19 @@ }, "es6-object-assign": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", - "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", "dev": true }, "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + "version": "4.2.8" }, "es6-promisify": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "requires": { "es6-promise": "^4.0.3" } }, "es6-set": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", - "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", "dev": true, "requires": { "d": "1", @@ -25961,8 +23008,6 @@ "dependencies": { "es6-symbol": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", "dev": true, "requires": { "d": "1", @@ -25973,8 +23018,6 @@ }, "es6-symbol": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", "dev": true, "requires": { "d": "^1.0.1", @@ -25983,8 +23026,6 @@ }, "es6-weak-map": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", "dev": true, "requires": { "d": "1", @@ -25994,25 +23035,17 @@ } }, "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + "version": "3.1.1" }, "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + "version": "1.0.3" }, "escape-string-regexp": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, "escodegen": { "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", "dev": true, "requires": { "esprima": "^4.0.1", @@ -26024,8 +23057,6 @@ "dependencies": { "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "optional": true } @@ -26033,8 +23064,6 @@ }, "escope": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", "dev": true, "requires": { "es6-map": "^0.1.3", @@ -26045,8 +23074,6 @@ }, "eslint": { "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -26090,8 +23117,6 @@ "dependencies": { "ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -26099,8 +23124,6 @@ }, "chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -26110,8 +23133,6 @@ }, "color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { "color-name": "1.1.3" @@ -26119,14 +23140,10 @@ }, "color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "eslint-utils": { "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" @@ -26134,14 +23151,10 @@ }, "eslint-visitor-keys": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true }, "globals": { "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "dev": true, "requires": { "type-fest": "^0.8.1" @@ -26149,26 +23162,18 @@ }, "has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "ignore": { "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, "regexpp": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, "supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -26176,16 +23181,12 @@ }, "type-fest": { "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true } } }, "eslint-config-prettier": { "version": "6.15.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz", - "integrity": "sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==", "dev": true, "requires": { "get-stdin": "^6.0.0" @@ -26193,15 +23194,11 @@ }, "eslint-config-typestrict": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/eslint-config-typestrict/-/eslint-config-typestrict-1.0.2.tgz", - "integrity": "sha512-P9gOX90JFMlwoFd9SAebfHasJxkNyTAsoOiZHwd1sQz3EhGGUes/KrR/p7XieAPjoZGEypxkayKhlql2CHYgfw==", "dev": true, "requires": {} }, "eslint-import-resolver-node": { "version": "0.2.3", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz", - "integrity": "sha1-Wt2BBujJKNssuiMrzZ76hG49oWw=", "dev": true, "requires": { "debug": "^2.2.0", @@ -26211,8 +23208,6 @@ "dependencies": { "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -26220,16 +23215,12 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } } }, "eslint-module-utils": { "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", "dev": true, "requires": { "debug": "^3.2.7", @@ -26238,8 +23229,6 @@ "dependencies": { "debug": { "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "requires": { "ms": "^2.1.1" @@ -26247,8 +23236,6 @@ }, "find-up": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "^2.0.0" @@ -26256,8 +23243,6 @@ }, "locate-path": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { "p-locate": "^2.0.0", @@ -26266,14 +23251,10 @@ }, "ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "p-limit": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { "p-try": "^1.0.0" @@ -26281,8 +23262,6 @@ }, "p-locate": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { "p-limit": "^1.1.0" @@ -26290,22 +23269,16 @@ }, "p-try": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, "path-exists": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true } } }, "eslint-plugin-implicit-dependencies": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-implicit-dependencies/-/eslint-plugin-implicit-dependencies-1.1.1.tgz", - "integrity": "sha512-/EbKwaWTASieQR+hWeSIYaNRUCwIn/wAuPNFsiZZTMKYLXegVJyHvepDnJIIpfYWpqtYcrukNLQDit1yfmGD/A==", "dev": true, "requires": { "builtin-modules": "^1.1.1", @@ -26314,8 +23287,6 @@ }, "eslint-plugin-node": { "version": "4.2.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-4.2.3.tgz", - "integrity": "sha512-vIUQPuwbVYdz/CYnlTLsJrRy7iXHQjdEe5wz0XhhdTym3IInM/zZLlPf9nZ2mThsH0QcsieCOWs2vOeCy/22LQ==", "dev": true, "requires": { "ignore": "^3.0.11", @@ -26327,22 +23298,16 @@ "dependencies": { "ignore": { "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true }, "semver": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", "dev": true } } }, "eslint-plugin-prettier": { "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz", - "integrity": "sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g==", "dev": true, "requires": { "prettier-linter-helpers": "^1.0.0" @@ -26350,28 +23315,20 @@ }, "eslint-plugin-promise": { "version": "3.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz", - "integrity": "sha1-ePu2/+BHIBYnVp6FpsU3OvKmj8o=", "dev": true }, "eslint-plugin-sonarjs": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.5.0.tgz", - "integrity": "sha512-XW5MnzlRjhXpIdbULC/qAdJYHWw3rRLws/DyawdlPU/IdVr9AmRK1r2LaCvabwKOAW2XYYSo3kDX58E4MrB7PQ==", "dev": true, "requires": {} }, "eslint-plugin-standard": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz", - "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", "dev": true, "requires": {} }, "eslint-scope": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { "esrecurse": "^4.3.0", @@ -26380,8 +23337,6 @@ }, "eslint-utils": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "requires": { "eslint-visitor-keys": "^2.0.0" @@ -26389,14 +23344,10 @@ }, "eslint-visitor-keys": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true }, "espree": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, "requires": { "acorn": "^7.1.1", @@ -26406,22 +23357,16 @@ "dependencies": { "eslint-visitor-keys": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true } } }, "esprima": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "esquery": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -26429,16 +23374,12 @@ "dependencies": { "estraverse": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } }, "esrecurse": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "requires": { "estraverse": "^5.2.0" @@ -26446,34 +23387,24 @@ "dependencies": { "estraverse": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } }, "estraverse": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, "estree-is-member-expression": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/estree-is-member-expression/-/estree-is-member-expression-1.0.0.tgz", - "integrity": "sha512-Ec+X44CapIGExvSZN+pGkmr5p7HwUVQoPQSd458Lqwvaf4/61k/invHSh4BYK8OXnCkfEhWuIoG5hayKLQStIg==", "dev": true }, "esutils": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, "etag": { "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", "dev": true }, "ethereum-cryptography": { @@ -26503,31 +23434,14 @@ "karma-typescript": "^5.5.3", "nyc": "^15.1.0", "prettier": "^2.0.5", - "rlp": "^2.2.4", + "rlp": "^3.0.0", "tape": "^4.10.1", "ts-node": "^10.2.1", "typescript": "^4.4.2" - }, - "dependencies": { - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, - "rlp": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", - "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", - "requires": { - "bn.js": "^5.2.0" - } - } } }, "event-emitter": { "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", "dev": true, "requires": { "d": "1", @@ -26535,30 +23449,20 @@ } }, "event-iterator": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/event-iterator/-/event-iterator-2.0.0.tgz", - "integrity": "sha512-KGft0ldl31BZVV//jj+IAIGCxkvvUkkON+ScH6zfoX+l+omX6001ggyRSpI0Io2Hlro0ThXotswCtfzS8UkIiQ==" + "version": "2.0.0" }, "event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + "version": "5.0.1" }, "eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + "version": "4.0.7" }, "events": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz", - "integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==", "dev": true }, "evp_bytestokey": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { "md5.js": "^1.3.4", @@ -26567,8 +23471,6 @@ }, "execa": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "requires": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -26583,8 +23485,6 @@ "dependencies": { "cross-spawn": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -26592,27 +23492,19 @@ } }, "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + "version": "3.1.1" }, "shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "requires": { "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + "version": "3.0.0" }, "which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "requires": { "isexe": "^2.0.0" } @@ -26621,8 +23513,6 @@ }, "execspawn": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/execspawn/-/execspawn-1.0.1.tgz", - "integrity": "sha1-gob53efOzeeQX73ATiTzaPI/jaY=", "dev": true, "requires": { "util-extend": "^1.0.1" @@ -26630,14 +23520,13 @@ }, "exit-hook": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", "dev": true }, + "exit-on-epipe": { + "version": "1.0.1" + }, "express": { "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", "dev": true, "requires": { "accepts": "~1.3.7", @@ -26674,8 +23563,6 @@ "dependencies": { "body-parser": { "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "dev": true, "requires": { "bytes": "3.1.0", @@ -26692,35 +23579,21 @@ }, "bytes": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", "dev": true }, "cookie": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", "dev": true }, "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" } }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, "http-errors": { "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "dev": true, "requires": { "depd": "~1.1.2", @@ -26732,35 +23605,18 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, "qs": { "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", "dev": true }, "raw-body": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", "dev": true, "requires": { "bytes": "3.1.0", @@ -26771,28 +23627,20 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "setprototypeof": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, "toidentifier": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true } } }, "ext": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", - "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", "dev": true, "requires": { "type": "^2.5.0" @@ -26800,21 +23648,15 @@ "dependencies": { "type": { "version": "2.6.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz", - "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==", "dev": true } } }, "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "version": "3.0.2" }, "external-editor": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "requires": { "chardet": "^0.7.0", @@ -26823,35 +23665,23 @@ } }, "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "version": "1.3.0" }, "eyes": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" + "version": "0.1.8" }, "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "version": "3.1.3" }, "fast-diff": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, "fast-fifo": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.1.0.tgz", - "integrity": "sha512-Kl29QoNbNvn4nhDsLYjyIAaIqaJB6rBx5p3sL9VjaefJ+eMFBWVZiaoguaoZfzEKr5RhAti0UgM8703akGPJ6g==" + "version": "1.1.0" }, "fast-glob": { "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -26863,57 +23693,39 @@ }, "fast-json-parse": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/fast-json-parse/-/fast-json-parse-1.0.3.tgz", - "integrity": "sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw==", "dev": true }, "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "version": "2.1.0" }, "fast-levenshtein": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, "fast-redact": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-2.1.0.tgz", - "integrity": "sha512-0LkHpTLyadJavq9sRzzyqIoMZemWli77K2/MGOkafrR64B9ItrvZ9aT+jluvNDsv0YEHjSNhlMBtbokuoqii4A==", "dev": true }, "fast-safe-stringify": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", "dev": true }, "fastest-levenshtein": { "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", - "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", "dev": true }, "fastq": { "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "requires": { "reusify": "^1.0.4" } }, "fecha": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.2.tgz", - "integrity": "sha512-5rOQWkBVz3FnYWTi/ELZmq4CoK1Pb+xKNZWuJRsOwo0+8DrP43CrWJtyLVvb5U7z7ggE5llahfDbLjaVNzXVJQ==" + "version": "4.2.1" }, "figures": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "requires": { "escape-string-regexp": "^1.0.5" @@ -26921,8 +23733,6 @@ }, "file-entry-cache": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { "flat-cache": "^2.0.1" @@ -26930,8 +23740,6 @@ }, "file-replace-loader": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/file-replace-loader/-/file-replace-loader-1.4.0.tgz", - "integrity": "sha512-qXbFaCuUHXNRWo2elkioNDnGAXHM/hy9brlhjRGiEwo47VxtP4fGFyxF0p6yWK3xS94FLphO/oDB7lGymWIt1w==", "dev": true, "requires": { "loader-utils": "^2.0.0", @@ -26940,21 +23748,15 @@ }, "file-stream-rotator": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/file-stream-rotator/-/file-stream-rotator-0.6.1.tgz", - "integrity": "sha512-u+dBid4PvZw17PmDeRcNOtCP9CCK/9lRN2w+r1xIS7yOL9JFrIBKTvrYsxT4P0pGtThYTn++QS5ChHaUov3+zQ==", "requires": { "moment": "^2.29.1" } }, "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + "version": "1.0.0" }, "fill-range": { "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -26962,8 +23764,6 @@ }, "finalhandler": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "requires": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -26976,31 +23776,17 @@ "dependencies": { "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { "ms": "2.0.0" } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } + "version": "2.0.0" } } }, "find-cache-dir": { "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, "requires": { "commondir": "^1.0.1", @@ -27010,8 +23796,6 @@ "dependencies": { "make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -27019,8 +23803,6 @@ }, "pkg-dir": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { "find-up": "^4.0.0" @@ -27030,14 +23812,10 @@ }, "find-root": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", "dev": true }, "find-up": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { "locate-path": "^5.0.0", @@ -27046,8 +23824,6 @@ }, "find-versions": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", "dev": true, "requires": { "semver-regex": "^3.1.2" @@ -27055,8 +23831,6 @@ }, "findup": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/findup/-/findup-0.1.5.tgz", - "integrity": "sha1-itkpozk7rGJ5V6fl3kYjsGsOLOs=", "dev": true, "requires": { "colors": "~0.6.0-1", @@ -27065,8 +23839,6 @@ }, "flat-cache": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, "requires": { "flatted": "^2.0.0", @@ -27076,45 +23848,31 @@ }, "flatstr": { "version": "1.0.12", - "resolved": "https://registry.npmjs.org/flatstr/-/flatstr-1.0.12.tgz", - "integrity": "sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw==", "dev": true }, "flatted": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, "fn.name": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", - "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" + "version": "1.1.0" }, "follow-redirects": { "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", "dev": true }, "for-each": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "requires": { "is-callable": "^1.1.3" } }, "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" + "version": "2.0.5" }, "foreground-child": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -27123,8 +23881,6 @@ "dependencies": { "cross-spawn": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -27134,14 +23890,10 @@ }, "path-key": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { "shebang-regex": "^3.0.0" @@ -27149,14 +23901,10 @@ }, "shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -27165,14 +23913,10 @@ } }, "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "version": "0.6.1" }, "form-data": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -27181,8 +23925,6 @@ }, "formidable": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.0.1.tgz", - "integrity": "sha512-rjTMNbp2BpfQShhFbR3Ruk3qk2y9jKpvMW78nJgx8QKtxjDVrwbZG+wvDOmVbifHyOUOQJXxqEy6r0faRrPzTQ==", "dev": true, "requires": { "dezalgo": "1.0.3", @@ -27193,34 +23935,24 @@ "dependencies": { "qs": { "version": "6.9.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.3.tgz", - "integrity": "sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==", "dev": true } } }, "forwarded": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "dev": true }, "fresh": { "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", "dev": true }, "fromentries": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", - "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", "dev": true }, "fs-extra": { "version": "10.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", - "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -27229,31 +23961,21 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, "fsevents": { "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.1" }, "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + "version": "1.0.1" }, "generate-function": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", - "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", "dev": true, "requires": { "is-property": "^1.0.2" @@ -27261,8 +23983,6 @@ }, "generate-object-property": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", "dev": true, "requires": { "is-property": "^1.0.0" @@ -27270,30 +23990,20 @@ }, "gensync": { "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true }, "get-assigned-identifiers": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", - "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", "dev": true }, "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + "version": "2.0.5" }, "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=" + "version": "2.0.0" }, "get-intrinsic": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -27301,31 +24011,21 @@ } }, "get-iterator": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-1.0.2.tgz", - "integrity": "sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==" + "version": "1.0.2" }, "get-package-type": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true }, "get-stdin": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", "dev": true }, "get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" + "version": "6.0.1" }, "get-symbol-description": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", "requires": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -27333,16 +24033,12 @@ }, "getpass": { "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { "assert-plus": "^1.0.0" } }, "glob": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -27355,8 +24051,6 @@ }, "glob-parent": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -27364,20 +24058,14 @@ }, "glob-to-regexp": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, "globals": { "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, "globby": { "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "requires": { "array-union": "^2.1.0", @@ -27389,14 +24077,10 @@ } }, "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + "version": "4.2.9" }, "handlebars": { "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "dev": true, "requires": { "minimist": "^1.2.5", @@ -27408,21 +24092,15 @@ "dependencies": { "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + "version": "2.0.0" }, "har-validator": { "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "requires": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -27430,16 +24108,12 @@ }, "has": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "requires": { "function-bind": "^1.1.1" } }, "has-ansi": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -27447,21 +24121,15 @@ "dependencies": { "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true } } }, "has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==" + "version": "1.0.1" }, "has-dynamic-import": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz", - "integrity": "sha512-X3fbtsZmwb6W7fJGR9o7x65fZoodygCrZ3TVycvghP62yYQfS0t4RS0Qcz+j5tQYUKeSWS09tHkWW6WhFV3XhQ==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -27469,33 +24137,23 @@ } }, "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "version": "4.0.0" }, "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "version": "1.0.3" }, "has-tostringtag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", "requires": { "has-symbols": "^1.0.2" } }, "has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true }, "hash-base": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", "dev": true, "requires": { "inherits": "^2.0.4", @@ -27505,8 +24163,6 @@ }, "hash.js": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -27514,8 +24170,6 @@ }, "hasha": { "version": "5.2.2", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", - "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, "requires": { "is-stream": "^2.0.0", @@ -27524,37 +24178,25 @@ "dependencies": { "type-fest": { "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true } } }, "hashlru": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/hashlru/-/hashlru-2.3.0.tgz", - "integrity": "sha512-0cMsjjIC8I+D3M44pOQdsy0OHXGLVz6Z0beRuufhKa0KfaD2wGwAev6jILzXsd3/vpnNQJmWyZtIILqM1N+n5A==" + "version": "2.3.0" }, "heap": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz", - "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==" + "version": "0.2.7" }, "hexoid": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", - "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==", "dev": true }, "hi-base32": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/hi-base32/-/hi-base32-0.5.1.tgz", - "integrity": "sha512-EmBBpvdYh/4XxsnUybsPag6VikPYnN30td+vQk+GI3qpahVEG9+gTkG0aXVxTjBqQ5T6ijbWIu77O+C5WFWsnA==" + "version": "0.5.1" }, "hmac-drbg": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -27563,14 +24205,10 @@ }, "hsl-to-rgb-for-reals": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/hsl-to-rgb-for-reals/-/hsl-to-rgb-for-reals-1.1.1.tgz", - "integrity": "sha512-LgOWAkrN0rFaQpfdWBQlv/VhkOxb5AsBjk6NQVx4yEzWS923T07X0M1Y0VNko2H52HeSpZrZNNMJ0aFqsdVzQg==", "dev": true }, "html-encoding-sniffer": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", "dev": true, "requires": { "whatwg-encoding": "^1.0.1" @@ -27578,39 +24216,24 @@ }, "html-escaper": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, "htmlescape": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", "dev": true }, "http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "version": "1.8.1", "requires": { - "depd": "2.0.0", + "depd": "~1.1.2", "inherits": "2.0.4", "setprototypeof": "1.2.0", - "statuses": "2.0.1", + "statuses": ">= 1.5.0 < 2", "toidentifier": "1.0.1" - }, - "dependencies": { - "statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" - } } }, "http-proxy": { "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, "requires": { "eventemitter3": "^4.0.0", @@ -27620,8 +24243,6 @@ }, "http-signature": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -27630,25 +24251,17 @@ }, "http-status-codes": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-1.4.0.tgz", - "integrity": "sha512-JrT3ua+WgH8zBD3HEJYbeEgnuQaAnUeRRko/YojPAJjGmIfGD3KPU/asLdsLwKjfxOmQe5nXMQ0pt/7MyapVbQ==", "dev": true }, "https-browserify": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, "human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" + "version": "2.1.0" }, "husky": { "version": "4.3.8", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz", - "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", "dev": true, "requires": { "chalk": "^4.0.0", @@ -27665,14 +24278,10 @@ }, "hyperscript-attribute-to-property": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/hyperscript-attribute-to-property/-/hyperscript-attribute-to-property-1.0.2.tgz", - "integrity": "sha512-oerMul16jZCmrbNsUw8QgrtDzF8lKgFri1bKQjReLw1IhiiNkI59CWuzZjJDGT79UQ1YiWqXhJMv/tRMVqgtkA==", "dev": true }, "hyperx": { "version": "2.5.4", - "resolved": "https://registry.npmjs.org/hyperx/-/hyperx-2.5.4.tgz", - "integrity": "sha512-iOkSh7Yse7lsN/B9y7OsevLWjeXPqGuHQ5SbwaiJM5xAhWFqhoN6erpK1dQsS12OFU36lyai1pnx1mmzWLQqcA==", "dev": true, "requires": { "hyperscript-attribute-to-property": "^1.0.0" @@ -27680,32 +24289,22 @@ }, "iconv-lite": { "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { "safer-buffer": ">= 2.1.2 < 3" } }, "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + "version": "1.2.1" }, "ignore": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true }, "immediate": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", - "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" + "version": "3.3.0" }, "import-fresh": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -27714,8 +24313,6 @@ }, "import-local": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", "dev": true, "requires": { "pkg-dir": "^4.2.0", @@ -27724,8 +24321,6 @@ "dependencies": { "pkg-dir": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { "find-up": "^4.0.0" @@ -27735,19 +24330,13 @@ }, "imurmurhash": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + "version": "4.0.0" }, "inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { "once": "^1.3.0", @@ -27755,14 +24344,10 @@ } }, "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "version": "2.0.4" }, "inline-source-map": { "version": "0.6.2", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", "dev": true, "requires": { "source-map": "~0.5.3" @@ -27770,8 +24355,6 @@ }, "inquirer": { "version": "7.3.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", "dev": true, "requires": { "ansi-escapes": "^4.2.1", @@ -27791,14 +24374,10 @@ "dependencies": { "ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { "ansi-regex": "^5.0.1" @@ -27808,8 +24387,6 @@ }, "insert-module-globals": { "version": "7.2.1", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", - "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", "dev": true, "requires": { "acorn-node": "^1.5.2", @@ -27826,8 +24403,6 @@ }, "interface-datastore": { "version": "3.0.6", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-3.0.6.tgz", - "integrity": "sha512-ruF9CVmtKCNfzCZYW6YeEKDRDbgFaiKGrSWof19BVCv6Qx/WrL1jRV4sCQUHCaXwJI7FCFknhw++PGafWCXvfw==", "requires": { "err-code": "^3.0.1", "ipfs-utils": "^6.0.0", @@ -27838,16 +24413,12 @@ }, "dependencies": { "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" } } }, "internal-slot": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", "requires": { "get-intrinsic": "^1.1.0", "has": "^1.0.3", @@ -27856,25 +24427,17 @@ }, "internmap": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", - "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==", "dev": true }, "interpret": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "dev": true }, "ip": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" + "version": "1.1.5" }, "ip-address": { "version": "6.4.0", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-6.4.0.tgz", - "integrity": "sha512-c5uxc2WUTuRBVHT/6r4m7HIr/DfV0bF6DvLH3iZGSK8wp8iMwwZSgIq2do0asFf8q9ECug0SE+6+1ACMe4sorA==", "requires": { "jsbn": "1.1.0", "lodash.find": "4.6.0", @@ -27886,26 +24449,18 @@ }, "dependencies": { "sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" + "version": "1.1.2" } } }, "ip-regex": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", - "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==" + "version": "4.3.0" }, "ipaddr.js": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", - "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==" + "version": "2.0.1" }, "ipfs-utils": { "version": "6.0.8", - "resolved": "https://registry.npmjs.org/ipfs-utils/-/ipfs-utils-6.0.8.tgz", - "integrity": "sha512-mDDQaDisI/uWk+X08wyw+jBcq76IXwMjgyaoyEgJDb/Izb+QbBCSJjo9q+EvbMxh6/l6q0NiAfbbsxEyQYPW9w==", "requires": { "abort-controller": "^3.0.0", "any-signal": "^2.1.0", @@ -27926,24 +24481,18 @@ "dependencies": { "buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" } } }, "is-arguments": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -27951,22 +24500,16 @@ }, "is-arrayish": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, "is-bigint": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "requires": { "has-bigints": "^1.0.1" } }, "is-binary-path": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "requires": { "binary-extensions": "^2.0.0" @@ -27974,14 +24517,10 @@ }, "is-boolean-attribute": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/is-boolean-attribute/-/is-boolean-attribute-0.0.1.tgz", - "integrity": "sha1-JKtZt9y52jYSx3PmDGVlZeWgmAw=", "dev": true }, "is-boolean-object": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -27989,19 +24528,13 @@ }, "is-buffer": { "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, "is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==" + "version": "1.2.4" }, "is-core-module": { "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", "dev": true, "requires": { "has": "^1.0.3" @@ -28009,51 +24542,35 @@ }, "is-date-object": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "requires": { "has-tostringtag": "^1.0.0" } }, "is-docker": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true }, "is-electron": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.1.tgz", - "integrity": "sha512-r8EEQQsqT+Gn0aXFx7lTFygYQhILLCB+wn0WCDL5LZRINeLH/Rvw1j2oKodELLXYNImQ3CRlVsY8wW4cGOsyuw==" + "version": "2.2.1" }, "is-extglob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, "is-fn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fn/-/is-fn-1.0.0.tgz", - "integrity": "sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw=" + "version": "1.0.0" }, "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + "version": "3.0.0" }, "is-generator-function": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", "requires": { "has-tostringtag": "^1.0.0" } }, "is-glob": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -28061,33 +24578,23 @@ }, "is-ip": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-3.1.0.tgz", - "integrity": "sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==", "requires": { "ip-regex": "^4.0.0" } }, "is-loopback-addr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-1.0.1.tgz", - "integrity": "sha512-DhWU/kqY7X2F6KrrVTu7mHlbd2Pbo4D1YkAzasBMjQs6lJAoefxaA6m6CpSX0K6pjt9D0b9PNFI5zduy/vzOYw==" + "version": "1.0.1" }, "is-map": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", "dev": true }, "is-my-ip-valid": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.1.tgz", - "integrity": "sha512-jxc8cBcOWbNK2i2aTkCZP6i7wkHF1bqKFrwEHuN5Jtg5BSaZHUZQ/JTOJwoV41YvHnOaRyWWh72T/KvfNz9DJg==", "dev": true }, "is-my-json-valid": { "version": "2.20.6", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.6.tgz", - "integrity": "sha512-1JQwulVNjx8UqkPE/bqDaxtH4PXCe/2VRh/y3p99heOV87HG4Id5/VfDswd+YiAfHcRTfDlWgISycnHuhZq1aw==", "dev": true, "requires": { "generate-function": "^2.0.0", @@ -28099,8 +24606,6 @@ }, "is-nan": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", - "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", "dev": true, "requires": { "call-bind": "^1.0.0", @@ -28108,33 +24613,23 @@ } }, "is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==" + "version": "2.0.2" }, "is-number": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, "is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "version": "1.0.6", "requires": { "has-tostringtag": "^1.0.0" } }, "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" + "version": "2.1.0" }, "is-plain-object": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { "isobject": "^3.0.1" @@ -28142,14 +24637,10 @@ }, "is-property": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", "dev": true }, "is-regex": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -28157,55 +24648,36 @@ }, "is-regexp": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", - "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", "dev": true }, "is-resolvable": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, "is-set": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", "dev": true }, "is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", - "requires": { - "call-bind": "^1.0.2" - } + "version": "1.0.1" }, "is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + "version": "2.0.1" }, "is-string": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "requires": { "has-tostringtag": "^1.0.0" } }, "is-symbol": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "requires": { "has-symbols": "^1.0.2" } }, "is-typed-array": { "version": "1.1.8", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.8.tgz", - "integrity": "sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA==", "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -28215,28 +24687,20 @@ } }, "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "version": "1.0.0" }, "is-weakmap": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", "dev": true }, "is-weakref": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "requires": { "call-bind": "^1.0.2" } }, "is-weakset": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", - "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -28245,14 +24709,10 @@ }, "is-windows": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, "is-wsl": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, "requires": { "is-docker": "^2.0.0" @@ -28260,69 +24720,47 @@ }, "isarray": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true }, "isbinaryfile": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", - "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", + "version": "4.0.8", "dev": true }, "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "version": "2.0.0" }, "iso-random-stream": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/iso-random-stream/-/iso-random-stream-2.0.2.tgz", - "integrity": "sha512-yJvs+Nnelic1L2vH2JzWvvPQFA4r7kSTnpST/+LkAQjSz0hos2oqLD+qIVi9Qk38Hoe7mNDt3j0S27R58MVjLQ==", "requires": { "events": "^3.3.0", "readable-stream": "^3.4.0" }, "dependencies": { "events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" + "version": "3.3.0" } } }, "iso-url": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/iso-url/-/iso-url-1.2.1.tgz", - "integrity": "sha512-9JPDgCN4B7QPkLtYAAOrEuAWvP9rWvR5offAr0/SeF046wIkglqH3VXgYYP6NcsKslH80UIVgmPqNe3j7tG2ng==" + "version": "1.2.1" }, "isobject": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, "isomorphic-ws": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", "requires": {} }, "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "version": "0.1.2" }, "istanbul-lib-coverage": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", "dev": true }, "istanbul-lib-hook": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", - "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, "requires": { "append-transform": "^2.0.0" @@ -28330,8 +24768,6 @@ }, "istanbul-lib-instrument": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", "dev": true, "requires": { "@babel/core": "^7.7.5", @@ -28342,8 +24778,6 @@ }, "istanbul-lib-processinfo": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", - "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", "dev": true, "requires": { "archy": "^1.0.0", @@ -28357,8 +24791,6 @@ "dependencies": { "cross-spawn": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -28368,8 +24800,6 @@ }, "make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -28377,8 +24807,6 @@ }, "p-map": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, "requires": { "aggregate-error": "^3.0.0" @@ -28386,14 +24814,10 @@ }, "path-key": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -28401,8 +24825,6 @@ }, "shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { "shebang-regex": "^3.0.0" @@ -28410,20 +24832,14 @@ }, "shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "uuid": { "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, "which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -28433,8 +24849,6 @@ }, "istanbul-lib-report": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", "dev": true, "requires": { "istanbul-lib-coverage": "^3.0.0", @@ -28444,8 +24858,6 @@ "dependencies": { "make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -28455,8 +24867,6 @@ }, "istanbul-lib-source-maps": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "requires": { "debug": "^4.1.1", @@ -28466,16 +24876,12 @@ "dependencies": { "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, "istanbul-reports": { "version": "3.1.4", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.4.tgz", - "integrity": "sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw==", "dev": true, "requires": { "html-escaper": "^2.0.0", @@ -28483,14 +24889,10 @@ } }, "it-all": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/it-all/-/it-all-1.0.6.tgz", - "integrity": "sha512-3cmCc6Heqe3uWi3CVM/k51fa/XbMFpQVzFoDsV0IZNHSQDyAXl3c4MjHkFX5kF3922OGj7Myv1nSEUgRtcuM1A==" + "version": "1.0.6" }, "it-buffer": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/it-buffer/-/it-buffer-0.1.3.tgz", - "integrity": "sha512-9a2/9SYVwG7bcn3tpRDR4bXbtuMLXnDK48KVC+GXiQg97ZOOdWz2nIITBsOQ19b+gj01Rw8RNwtiLDLI8P8oiQ==", "requires": { "bl": "^5.0.0", "buffer": "^6.0.3" @@ -28498,8 +24900,6 @@ "dependencies": { "bl": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", - "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", "requires": { "buffer": "^6.0.3", "inherits": "^2.0.4", @@ -28508,8 +24908,6 @@ }, "buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -28518,24 +24916,16 @@ } }, "it-drain": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-1.0.5.tgz", - "integrity": "sha512-r/GjkiW1bZswC04TNmUnLxa6uovme7KKwPhc+cb1hHU65E3AByypHH6Pm91WHuvqfFsm+9ws0kPtDBV3/8vmIg==" + "version": "1.0.5" }, "it-filter": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/it-filter/-/it-filter-1.0.3.tgz", - "integrity": "sha512-EI3HpzUrKjTH01miLHWmhNWy3Xpbx4OXMXltgrNprL5lDpF3giVpHIouFpr5l+evXw6aOfxhnt01BIB+4VQA+w==" + "version": "1.0.3" }, "it-first": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/it-first/-/it-first-1.0.7.tgz", - "integrity": "sha512-nvJKZoBpZD/6Rtde6FXqwDqDZGF1sCADmr2Zoc0hZsIvnE449gRFnGctxDf09Bzc/FWnHXAdaHVIetY6lrE0/g==" + "version": "1.0.7" }, "it-glob": { "version": "0.0.14", - "resolved": "https://registry.npmjs.org/it-glob/-/it-glob-0.0.14.tgz", - "integrity": "sha512-TKKzs9CglbsihSpcwJPXN5DBUssu4akRzPlp8QJRCoLrKoaOpyY2V1qDlxx+UMivn0i114YyTd4AawWl7eqIdw==", "requires": { "@types/minimatch": "^3.0.4", "minimatch": "^3.0.4" @@ -28543,16 +24933,12 @@ }, "it-goodbye": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/it-goodbye/-/it-goodbye-2.0.2.tgz", - "integrity": "sha512-k56lqArpxkIU0yyhnPhvnyOBpzRQn+4VEyd+dUBWhN5kvCgPBeC0XMuHiA71iU98sDpCrJrT/X+81ajT0AOQtQ==", "requires": { "buffer": "^5.6.0" }, "dependencies": { "buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -28562,8 +24948,6 @@ }, "it-handshake": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/it-handshake/-/it-handshake-2.0.0.tgz", - "integrity": "sha512-K4q+mz8aLlCK3vTjtgNdHC9c/JbuOATsfogarjMsLcBZC5vYfKbX3Gq3AWcCdjIsIrPqzTlhPKSxl64LJkrt2w==", "requires": { "it-pushable": "^1.4.0", "it-reader": "^3.0.0", @@ -28572,8 +24956,6 @@ }, "it-length-prefixed": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-5.0.3.tgz", - "integrity": "sha512-b+jDHLcnOnPDQN79ronmzF5jeBjdJsy0ce2O6i6X4J5tnaO8Fd146ZA/tMbzaLlKnTpXa0eKtofpYhumXGENeg==", "requires": { "bl": "^5.0.0", "buffer": "^6.0.3", @@ -28582,8 +24964,6 @@ "dependencies": { "bl": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", - "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", "requires": { "buffer": "^6.0.3", "inherits": "^2.0.4", @@ -28592,8 +24972,6 @@ }, "buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -28602,30 +24980,22 @@ } }, "it-map": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/it-map/-/it-map-1.0.6.tgz", - "integrity": "sha512-XT4/RM6UHIFG9IobGlQPFQUrlEKkU4eBUFG3qhWhfAdh1JfF2x11ShCrKCdmZ0OiZppPfoLuzcfA4cey6q3UAQ==" + "version": "1.0.6" }, "it-merge": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/it-merge/-/it-merge-1.0.0.tgz", - "integrity": "sha512-bs40LMjG/9JMOcJ7pgyGLoOeWBpw28ZoMmZIk/1NCa5SUxd4elXCuadAr2qSjPiHz2GxrqoWGFAP7SePGddatw==", "requires": { "it-pushable": "^1.4.0" } }, "it-pair": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/it-pair/-/it-pair-1.0.0.tgz", - "integrity": "sha512-9raOiDu5OAuDOahtMtapKQDrQTxBfzlzrNcB6o7JARHkt+7Bb1dMkW/TpYdAjBJE77KH3e2zGzwpGUP9tXbLww==", "requires": { "get-iterator": "^1.0.2" } }, "it-pb-rpc": { "version": "0.1.13", - "resolved": "https://registry.npmjs.org/it-pb-rpc/-/it-pb-rpc-0.1.13.tgz", - "integrity": "sha512-aZ4FNJsDgNepVVTmYXgXbQabIiOQyqYWUhdfovaHDcPSM5KjegwJihJEWMJjMyj+oLSKcZl0vmHgHxXWJ9/ufw==", "requires": { "is-buffer": "^2.0.5", "it-handshake": "^2.0.0", @@ -28633,21 +25003,15 @@ }, "dependencies": { "is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==" + "version": "2.0.5" } } }, "it-pipe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/it-pipe/-/it-pipe-1.1.0.tgz", - "integrity": "sha512-lF0/3qTVeth13TOnHVs0BTFaziwQF7m5Gg+E6JV0BXcLKutC92YjSi7bASgkPOXaLEb+YvNZrPorGMBIJvZfxg==" + "version": "1.1.0" }, "it-protocol-buffers": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/it-protocol-buffers/-/it-protocol-buffers-0.2.1.tgz", - "integrity": "sha512-UbezSc9BZTw0DU7mFS6iG9PXeycJfTDJlFAlniI3x1CRrKeDP+IW6ERPAFskHI3O+wij18Mk7eHgDtFz4Zk65A==", "requires": { "it-buffer": "^0.1.1", "it-length-prefixed": "^3.0.0" @@ -28655,8 +25019,6 @@ "dependencies": { "bl": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "requires": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -28665,8 +25027,6 @@ }, "buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -28674,8 +25034,6 @@ }, "it-length-prefixed": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-3.1.0.tgz", - "integrity": "sha512-E5GwT6qfZEwh3/XThyYwgjKJ4/hxvTC9kdbj3gxXDeUDKtC7+K2T647sPeX7xDEWqunsnoQyvOrjoHPegaT3uw==", "requires": { "@types/bl": "^2.1.0", "bl": "^4.0.2", @@ -28684,32 +25042,24 @@ } }, "varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "version": "5.0.2" } } }, "it-pushable": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-1.4.2.tgz", - "integrity": "sha512-vVPu0CGRsTI8eCfhMknA7KIBqqGFolbRx+1mbQ6XuZ7YCz995Qj7L4XUviwClFunisDq96FdxzF5FnAbw15afg==", "requires": { "fast-fifo": "^1.0.0" } }, "it-reader": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-3.0.0.tgz", - "integrity": "sha512-NxR40odATeaBmSefn6Xn43DplYvn2KtEKQzn4jrTRuPYXMky5M4e+KQ7aTJh0k0vkytLyeenGO1I1GXlGm4laQ==", "requires": { "bl": "^5.0.0" }, "dependencies": { "bl": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", - "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", "requires": { "buffer": "^6.0.3", "inherits": "^2.0.4", @@ -28718,8 +25068,6 @@ }, "buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -28728,14 +25076,10 @@ } }, "it-take": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/it-take/-/it-take-1.0.0.tgz", - "integrity": "sha512-zfr2iAtekTGhHVWzCqqqgDnHhmzdzfCW92L0GvbaSFlvc3n2Ep/sponzmlNl2Kg39N5Py+02v+Aypc+i2c+9og==" + "version": "1.0.0" }, "it-to-stream": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/it-to-stream/-/it-to-stream-1.0.0.tgz", - "integrity": "sha512-pLULMZMAB/+vbdvbZtebC0nWBTbG581lk6w8P7DfIIIKUfa8FbY7Oi0FxZcFPbxvISs7A9E+cMpLDBc1XhpAOA==", "requires": { "buffer": "^6.0.3", "fast-fifo": "^1.0.0", @@ -28747,8 +25091,6 @@ "dependencies": { "buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -28758,8 +25100,6 @@ }, "it-ws": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-4.0.0.tgz", - "integrity": "sha512-XmTzpMkevc6rUboy73r0CCNhciMmL/Yxir9O6FujRwdrjysztqLBQ1Xkr4CpY2m7BVSCObKotaCWJeZ29lOXRA==", "requires": { "buffer": "^6.0.3", "event-iterator": "^2.0.0", @@ -28769,8 +25109,6 @@ "dependencies": { "buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -28780,8 +25118,6 @@ }, "jayson": { "version": "3.6.6", - "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.6.tgz", - "integrity": "sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ==", "requires": { "@types/connect": "^3.4.33", "@types/express-serve-static-core": "^4.17.9", @@ -28801,21 +25137,15 @@ }, "dependencies": { "@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==" + "version": "12.20.47" }, "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "version": "2.20.3" } } }, "jest-worker": { "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", "dev": true, "requires": { "@types/node": "*", @@ -28825,8 +25155,6 @@ "dependencies": { "supports-color": { "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -28836,25 +25164,17 @@ }, "jmespath": { "version": "0.15.0", - "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", - "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=", "dev": true }, "js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + "version": "0.8.0" }, "js-tokens": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -28862,14 +25182,10 @@ } }, "jsbn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", - "integrity": "sha1-sBMHyym2GKHtJux56RH4A8TaAEA=" + "version": "1.1.0" }, "jsdom": { "version": "15.2.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-15.2.1.tgz", - "integrity": "sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g==", "dev": true, "requires": { "abab": "^2.0.0", @@ -28902,20 +25218,14 @@ "dependencies": { "ip-regex": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", "dev": true }, "punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "tough-cookie": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", - "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", "dev": true, "requires": { "ip-regex": "^2.1.0", @@ -28925,8 +25235,6 @@ }, "tr46": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", "dev": true, "requires": { "punycode": "^2.1.0" @@ -28934,8 +25242,6 @@ }, "whatwg-url": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", "dev": true, "requires": { "lodash.sortby": "^4.7.0", @@ -28947,36 +25253,24 @@ }, "jsesc": { "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, "json-parse-better-errors": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, "json-parse-even-better-errors": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, "json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + "version": "0.4.0" }, "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "version": "0.4.1" }, "json-stable-stringify": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", - "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", "dev": true, "requires": { "jsonify": "~0.0.0" @@ -28984,31 +25278,21 @@ }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "version": "5.0.1" }, "json5": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "dev": true }, "jsonc-parser": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", - "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", "dev": true }, "jsonfile": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "requires": { "graceful-fs": "^4.1.6", "universalify": "^2.0.0" @@ -29016,25 +25300,17 @@ }, "jsonify": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", "dev": true }, "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" + "version": "1.3.1" }, "jsonpointer": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.0.tgz", - "integrity": "sha512-PNYZIdMjVIvVgDSYKTT63Y+KZ6IZvGRNNWcxwD+GNnUz1MKPfv30J8ueCjdwcN0nDx2SlshgyB7Oy0epAzVRRg==", "dev": true }, "JSONStream": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "requires": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" @@ -29042,8 +25318,6 @@ }, "jsonstream2": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/jsonstream2/-/jsonstream2-1.1.2.tgz", - "integrity": "sha512-sVWipJW3f/NGAZfQnqys6cGTUc6vgiTl4eFK0Y3lzi2RV4Fo5hzgUpgc/jS4qY8/nnntFPiXt14ujrS2TzfWkQ==", "dev": true, "requires": { "jsonparse": "0.0.6", @@ -29053,20 +25327,14 @@ "dependencies": { "isarray": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "jsonparse": { "version": "0.0.6", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.6.tgz", - "integrity": "sha1-q1mfGTJNSuF4+iGpMBkqsRq2Gk4=", "dev": true }, "readable-stream": { "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -29077,14 +25345,10 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true }, "through2": { "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", "dev": true, "requires": { "readable-stream": ">=1.0.33-1 <1.1.0-0", @@ -29095,8 +25359,6 @@ }, "jsonwebtoken": { "version": "8.5.1", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", - "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", "dev": true, "requires": { "jws": "^3.2.2", @@ -29113,22 +25375,16 @@ "dependencies": { "ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true } } }, "jsprim": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -29138,19 +25394,13 @@ }, "jsx-ast-utils": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz", - "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=", "dev": true }, "just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==" + "version": "4.2.1" }, "jwa": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", "dev": true, "requires": { "buffer-equal-constant-time": "1.0.1", @@ -29160,8 +25410,6 @@ }, "jws": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", "dev": true, "requires": { "jwa": "^1.4.1", @@ -29169,22 +25417,16 @@ } }, "jwt-simple": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/jwt-simple/-/jwt-simple-0.5.6.tgz", - "integrity": "sha512-40aUybvhH9t2h71ncA1/1SbtTNCVZHgsTsTgqPUxGWDmUDrXyDf2wMNQKEbdBjbf4AI+fQhbECNTV6lWxQKUzg==" + "version": "0.5.6" }, "k-bucket": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/k-bucket/-/k-bucket-5.1.0.tgz", - "integrity": "sha512-Fac7iINEovXIWU20GPnOMLUbjctiS+cnmyjC4zAUgvs3XPf1vo9akfCHkigftSic/jiKqKl+KA3a/vFcJbHyCg==", "requires": { "randombytes": "^2.1.0" } }, "karma": { "version": "6.3.17", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.3.17.tgz", - "integrity": "sha512-2TfjHwrRExC8yHoWlPBULyaLwAFmXmxQrcuFImt/JsAsSZu1uOWTZ1ZsWjqQtWpHLiatJOHL5jFjXSJIgCd01g==", "dev": true, "requires": { "@colors/colors": "1.5.0", @@ -29215,8 +25457,6 @@ "dependencies": { "rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -29224,14 +25464,10 @@ }, "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "tmp": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", "dev": true, "requires": { "rimraf": "^3.0.0" @@ -29239,8 +25475,6 @@ }, "yargs": { "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "requires": { "cliui": "^7.0.2", @@ -29254,16 +25488,12 @@ }, "yargs-parser": { "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true } } }, "karma-chrome-launcher": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.1.tgz", - "integrity": "sha512-hsIglcq1vtboGPAN+DGCISCFOxW+ZVnIqhDQcCMqqCp+4dmJ0Qpq5QAjkbA0X2L9Mi6OBkHi2Srrbmm7pUKkzQ==", "dev": true, "requires": { "which": "^1.2.1" @@ -29271,8 +25501,6 @@ }, "karma-firefox-launcher": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-2.1.2.tgz", - "integrity": "sha512-VV9xDQU1QIboTrjtGVD4NCfzIH7n01ZXqy/qpBhnOeGVOkG5JYPEm8kuSd7psHE6WouZaQ9Ool92g8LFweSNMA==", "dev": true, "requires": { "is-wsl": "^2.2.0", @@ -29281,8 +25509,6 @@ "dependencies": { "which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -29292,8 +25518,6 @@ }, "karma-tap": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/karma-tap/-/karma-tap-4.2.0.tgz", - "integrity": "sha512-d0k9lvVnxJ4z0u94jVDcUwqSPfJ0O0LQRWLvYoRp1I5k3E5K1fH19X0Ro0kDzAZk7ygyDN/AfV40Z37vQFXCKg==", "dev": true, "requires": { "babel-polyfill": "^6.26.0" @@ -29301,8 +25525,6 @@ }, "karma-typescript": { "version": "5.5.3", - "resolved": "https://registry.npmjs.org/karma-typescript/-/karma-typescript-5.5.3.tgz", - "integrity": "sha512-l1FHurolXEBIzRa9ExpNtjzysAhsi/vLpTazpwLHWWK86mknvVpqor6pRZ5Nid7jvOPrTBqAq0JRuLgiCdRkFw==", "dev": true, "requires": { "acorn": "^8.1.0", @@ -29352,20 +25574,14 @@ "dependencies": { "acorn": { "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true }, "acorn-walk": { "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true }, "assert": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", - "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", "dev": true, "requires": { "es6-object-assign": "^1.1.0", @@ -29376,14 +25592,10 @@ }, "async": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", "dev": true }, "buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, "requires": { "base64-js": "^1.3.1", @@ -29392,32 +25604,22 @@ }, "domain-browser": { "version": "4.22.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.22.0.tgz", - "integrity": "sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw==", "dev": true }, "events": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true }, "path-browserify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", "dev": true }, "punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -29425,14 +25627,10 @@ }, "source-map": { "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true }, "timers-browserify": { "version": "2.0.12", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", - "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", "dev": true, "requires": { "setimmediate": "^1.0.4" @@ -29440,8 +25638,6 @@ }, "tmp": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", "dev": true, "requires": { "rimraf": "^3.0.0" @@ -29449,8 +25645,6 @@ }, "util": { "version": "0.12.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.4.tgz", - "integrity": "sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -29465,8 +25659,6 @@ }, "keccak": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz", - "integrity": "sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==", "requires": { "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0", @@ -29475,39 +25667,27 @@ }, "keygrip": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", - "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", "dev": true, "requires": { "tsscmp": "1.0.6" } }, "keypair": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/keypair/-/keypair-1.0.4.tgz", - "integrity": "sha512-zwhgOhhniaL7oxMgUMKKw5219PWWABMO+dgMnzJOQ2/5L3XJtTJGhW2PEXlxXj9zaccdReZJZ83+4NPhVfNVDg==" + "version": "1.0.4" }, "kind-of": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, "kleur": { "version": "4.1.4", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", - "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", "dev": true }, "kuler": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", - "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" + "version": "2.0.0" }, "labeled-stream-splicer": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", - "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==", "dev": true, "requires": { "inherits": "^2.0.1", @@ -29516,8 +25696,6 @@ }, "level": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/level/-/level-6.0.1.tgz", - "integrity": "sha512-psRSqJZCsC/irNhfHzrVZbmPYXDcEYhA5TVNwr+V92jF44rbf86hqGp8fiT702FyiArScYIlPSBTDUASCVNSpw==", "requires": { "level-js": "^5.0.0", "level-packager": "^5.1.0", @@ -29526,16 +25704,12 @@ }, "level-codec": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", "requires": { "buffer": "^5.6.0" }, "dependencies": { "buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -29544,22 +25718,16 @@ } }, "level-concat-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", - "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" + "version": "2.0.1" }, "level-errors": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", "requires": { "errno": "~0.1.1" } }, "level-iterator-stream": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", "requires": { "inherits": "^2.0.4", "readable-stream": "^3.4.0", @@ -29568,8 +25736,6 @@ }, "level-js": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/level-js/-/level-js-5.0.2.tgz", - "integrity": "sha512-SnBIDo2pdO5VXh02ZmtAyPP6/+6YTJg2ibLtl9C34pWvmtMEmRTWpra+qO/hifkUtBTOtfx6S9vLDjBsBK4gRg==", "requires": { "abstract-leveldown": "~6.2.3", "buffer": "^5.5.0", @@ -29579,8 +25745,6 @@ "dependencies": { "buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -29590,8 +25754,6 @@ }, "level-mem": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz", - "integrity": "sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==", "requires": { "level-packager": "^5.0.3", "memdown": "^5.0.0" @@ -29599,8 +25761,6 @@ }, "level-packager": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", - "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", "requires": { "encoding-down": "^6.3.0", "levelup": "^4.3.2" @@ -29608,16 +25768,12 @@ }, "level-supports": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", - "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", "requires": { "xtend": "^4.0.2" } }, "level-ws": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-2.0.0.tgz", - "integrity": "sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==", "requires": { "inherits": "^2.0.3", "readable-stream": "^3.1.0", @@ -29626,8 +25782,6 @@ }, "leveldown": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", - "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", "requires": { "abstract-leveldown": "~6.2.1", "napi-macros": "~2.0.0", @@ -29635,16 +25789,12 @@ }, "dependencies": { "node-gyp-build": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", - "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==" + "version": "4.1.1" } } }, "levelup": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", "requires": { "deferred-leveldown": "~5.3.0", "level-errors": "~2.0.0", @@ -29655,14 +25805,10 @@ }, "leven": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", "dev": true }, "levn": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { "prelude-ls": "~1.1.2", @@ -29671,8 +25817,6 @@ }, "libp2p": { "version": "0.30.13", - "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.30.13.tgz", - "integrity": "sha512-iR5nZBZ+AtClzviNIzTsz58v4CdDEM+vzOiILcVm0d++NtkFt/DP0wcnia0qXLXUT98R01pkEnfdNyoBojPPPQ==", "requires": { "@motrix/nat-api": "^0.3.1", "abort-controller": "^3.0.0", @@ -29731,8 +25875,6 @@ "dependencies": { "bl": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "requires": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -29741,32 +25883,22 @@ }, "buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "delay": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/delay/-/delay-4.4.1.tgz", - "integrity": "sha512-aL3AhqtfhOlT/3ai6sWXeqwnw63ATNpnUiN4HL7x9q+My5QtHlO3OIkasmug9LKzpheLdmUKGRKnYXYAS7FQkQ==" + "version": "4.4.1" }, "es6-promisify": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", - "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==" + "version": "6.1.1" }, "events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" + "version": "3.3.0" }, "it-handshake": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/it-handshake/-/it-handshake-1.0.2.tgz", - "integrity": "sha512-uutOim5xF1eyDQD3u8qd3TxbWKwxqGMlbvacZsRsPdjO1BD9lnPTVci0jSMGsvMOu+5Y3W/QQ4hPQb87qPmPVQ==", "requires": { "it-pushable": "^1.4.0", "it-reader": "^2.0.0", @@ -29775,8 +25907,6 @@ }, "it-length-prefixed": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-3.1.0.tgz", - "integrity": "sha512-E5GwT6qfZEwh3/XThyYwgjKJ4/hxvTC9kdbj3gxXDeUDKtC7+K2T647sPeX7xDEWqunsnoQyvOrjoHPegaT3uw==", "requires": { "@types/bl": "^2.1.0", "bl": "^4.0.2", @@ -29785,24 +25915,18 @@ }, "dependencies": { "varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "version": "5.0.2" } } }, "it-reader": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-2.1.0.tgz", - "integrity": "sha512-hSysqWTO9Tlwc5EGjVf8JYZzw0D2FsxD/g+eNNWrez9zODxWt6QlN6JAMmycK72Mv4jHEKEXoyzUN4FYGmJaZw==", "requires": { "bl": "^4.0.0" } }, "libp2p-interfaces": { "version": "0.8.4", - "resolved": "https://registry.npmjs.org/libp2p-interfaces/-/libp2p-interfaces-0.8.4.tgz", - "integrity": "sha512-LaPkXVhqgAcFwqsyqGSZNAjgXSa2V+skOfIKE2UtQHaduwLct2KpFDOmvhRHTWHfRHwI9bSCskDB7xWGNTwZsQ==", "requires": { "@types/bl": "^2.1.0", "abort-controller": "^3.0.0", @@ -29836,8 +25960,6 @@ }, "multiaddr": { "version": "8.1.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-8.1.2.tgz", - "integrity": "sha512-r13IzW8+Sv9zab9Gt8RPMIN2WkptIPq99EpAzg4IbJ/zTELhiEwXWr9bAmEatSCI4j/LSA6ESJzvz95JZ+ZYXQ==", "requires": { "cids": "^1.0.0", "class-is": "^1.1.0", @@ -29851,24 +25973,18 @@ "dependencies": { "uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", "requires": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" } }, "varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "version": "5.0.2" } } }, "multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", "requires": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -29876,8 +25992,6 @@ }, "multihashes": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-3.1.2.tgz", - "integrity": "sha512-AP4IoV/YzkNrfbQKZE3OMPibrmy350OmCd6cJkwyM8oExaXIlOY4UnOOVSQtAEuq/LR01XfXKCESidzZvSwHCQ==", "requires": { "multibase": "^3.1.0", "uint8arrays": "^2.0.5", @@ -29886,16 +26000,12 @@ }, "p-limit": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "requires": { "yocto-queue": "^0.1.0" } }, "uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", "requires": { "multiformats": "^9.4.2" } @@ -29904,8 +26014,6 @@ }, "libp2p-bootstrap": { "version": "0.14.0", - "resolved": "https://registry.npmjs.org/libp2p-bootstrap/-/libp2p-bootstrap-0.14.0.tgz", - "integrity": "sha512-j3slZo5nOdA8wVlav8dRZeAXutZ7psz/f10DLoIEX/EFif7uU5oZfIYvjbVGo3ZDl+VQLo2tR0m1lV0westQ3g==", "requires": { "debug": "^4.3.1", "mafmt": "^10.0.0", @@ -29914,14 +26022,10 @@ }, "dependencies": { "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" }, "libp2p-crypto": { "version": "0.21.2", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.21.2.tgz", - "integrity": "sha512-EXFrhSpiHtJ+/L8xXDvQNK5VjUMG51u878jzZcaT5XhuN/zFg6PWJFnl/qB2Y2j7eMWnvCRP7Kp+ua2H36cG4g==", "requires": { "@noble/ed25519": "^1.5.1", "@noble/secp256k1": "^1.3.0", @@ -29935,21 +26039,15 @@ }, "mafmt": { "version": "10.0.0", - "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-10.0.0.tgz", - "integrity": "sha512-K1bziJOXcnepfztu+2Xy9FLKVLaFMDuspmiyJIYRxnO0WOxFSV7XKSdMxMrVZxcvg1+YjlTIvSGTImUHU2k4Aw==", "requires": { "multiaddr": "^10.0.0" } }, "node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==" + "version": "1.3.0" }, "peer-id": { "version": "0.16.0", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.16.0.tgz", - "integrity": "sha512-EmL7FurFUduU9m1PS9cfJ5TAuCvxKQ7DKpfx3Yj6IKWyBRtosriFuOag/l3ni/dtPgPLwiA4R9IvpL7hsDLJuQ==", "requires": { "class-is": "^1.1.0", "libp2p-crypto": "^0.21.0", @@ -29962,8 +26060,6 @@ }, "libp2p-crypto": { "version": "0.19.7", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.19.7.tgz", - "integrity": "sha512-Qb5o/3WFKF2j6mYSt4UBPyi2kbKl3jYV0podBJoJCw70DlpM5Xc+oh3fFY9ToSunu8aSQQ5GY8nutjXgX/uGRA==", "requires": { "err-code": "^3.0.1", "is-typedarray": "^1.0.0", @@ -29979,16 +26075,12 @@ }, "dependencies": { "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" } } }, "libp2p-interfaces": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/libp2p-interfaces/-/libp2p-interfaces-1.3.1.tgz", - "integrity": "sha512-Bh991Nv2KT/jZ7DjPd/zqhk8cCtkHl6OWw8lyK7wBX7Aj3/ezGwjoDABJzKgt1lbvcgCeQIbzPiIbaKj4DUI4w==", "requires": { "abort-controller": "^3.0.0", "abortable-iterator": "^3.0.0", @@ -30007,14 +26099,10 @@ }, "dependencies": { "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" }, "libp2p-crypto": { "version": "0.20.0", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.20.0.tgz", - "integrity": "sha512-WgIW9rYcWaO/5j2T6NW3R6Q46yvp2ZfFErqRMbi4/pOTL3T7+OROYpL/1iWVksWkXyurU/t2qFsIijWMxR5C4Q==", "requires": { "err-code": "^3.0.1", "iso-random-stream": "^2.0.0", @@ -30031,8 +26119,6 @@ }, "peer-id": { "version": "0.15.4", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.15.4.tgz", - "integrity": "sha512-MDoBIMZYwQIAHaZQUwsIcvoFgdbIl5GtZMwSkXpIYvc5v0TSDv+u8WsTKrKt2Vv28tHFFDJQdVzu3T4qTPzK+w==", "requires": { "class-is": "^1.1.0", "libp2p-crypto": "^0.20.0", @@ -30046,8 +26132,6 @@ }, "libp2p-kad-dht": { "version": "0.20.6", - "resolved": "https://registry.npmjs.org/libp2p-kad-dht/-/libp2p-kad-dht-0.20.6.tgz", - "integrity": "sha512-hRClzJP+NK3zBU0/pYkoDUhZcviqmPu4czFaftcl3cCGasjxSaWNEZNKsf65QwoINZD9jFrYkQuXW9/gWQwuOA==", "requires": { "abort-controller": "^3.0.0", "async": "^2.6.2", @@ -30082,8 +26166,6 @@ "dependencies": { "bl": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "requires": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -30092,22 +26174,16 @@ }, "buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "delay": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/delay/-/delay-4.4.1.tgz", - "integrity": "sha512-aL3AhqtfhOlT/3ai6sWXeqwnw63ATNpnUiN4HL7x9q+My5QtHlO3OIkasmug9LKzpheLdmUKGRKnYXYAS7FQkQ==" + "version": "4.4.1" }, "it-length-prefixed": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-3.1.0.tgz", - "integrity": "sha512-E5GwT6qfZEwh3/XThyYwgjKJ4/hxvTC9kdbj3gxXDeUDKtC7+K2T647sPeX7xDEWqunsnoQyvOrjoHPegaT3uw==", "requires": { "@types/bl": "^2.1.0", "bl": "^4.0.2", @@ -30117,8 +26193,6 @@ }, "libp2p-interfaces": { "version": "0.8.4", - "resolved": "https://registry.npmjs.org/libp2p-interfaces/-/libp2p-interfaces-0.8.4.tgz", - "integrity": "sha512-LaPkXVhqgAcFwqsyqGSZNAjgXSa2V+skOfIKE2UtQHaduwLct2KpFDOmvhRHTWHfRHwI9bSCskDB7xWGNTwZsQ==", "requires": { "@types/bl": "^2.1.0", "abort-controller": "^3.0.0", @@ -30152,8 +26226,6 @@ }, "multiaddr": { "version": "8.1.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-8.1.2.tgz", - "integrity": "sha512-r13IzW8+Sv9zab9Gt8RPMIN2WkptIPq99EpAzg4IbJ/zTELhiEwXWr9bAmEatSCI4j/LSA6ESJzvz95JZ+ZYXQ==", "requires": { "cids": "^1.0.0", "class-is": "^1.1.0", @@ -30167,8 +26239,6 @@ "dependencies": { "uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", "requires": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" @@ -30178,8 +26248,6 @@ }, "multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", "requires": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -30187,8 +26255,6 @@ }, "multihashes": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-3.1.2.tgz", - "integrity": "sha512-AP4IoV/YzkNrfbQKZE3OMPibrmy350OmCd6cJkwyM8oExaXIlOY4UnOOVSQtAEuq/LR01XfXKCESidzZvSwHCQ==", "requires": { "multibase": "^3.1.0", "uint8arrays": "^2.0.5", @@ -30196,39 +26262,29 @@ }, "dependencies": { "varint": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", - "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==" + "version": "6.0.0" } } }, "p-limit": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "requires": { "yocto-queue": "^0.1.0" } }, "uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", "requires": { "multiformats": "^9.4.2" } }, "varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "version": "5.0.2" } } }, "libp2p-mplex": { "version": "0.10.7", - "resolved": "https://registry.npmjs.org/libp2p-mplex/-/libp2p-mplex-0.10.7.tgz", - "integrity": "sha512-21VV0DZWuOsHgitWy1GZD1M/kki3a/hVoAJ5QC48p01JNSK5W8gxRiZtq7cCGJ/xNpbQxvMlMtS5eq8CFRlysg==", "requires": { "abortable-iterator": "^3.0.2", "bl": "^5.0.0", @@ -30241,8 +26297,6 @@ "dependencies": { "bl": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", - "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", "requires": { "buffer": "^6.0.3", "inherits": "^2.0.4", @@ -30251,24 +26305,18 @@ }, "buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" } } }, "libp2p-record": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/libp2p-record/-/libp2p-record-0.9.0.tgz", - "integrity": "sha512-8FlhzP+UlXTYOR+9D8nYoGOIJ6S8XogKD625bqzHJbXJQyJNCNaW3tZPHqrQrvUW7o6GsAeyQAfCp5WLEH0FZg==", "requires": { "err-code": "^2.0.0", "multihashes": "^3.0.1", @@ -30279,8 +26327,6 @@ "dependencies": { "multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", "requires": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -30288,8 +26334,6 @@ }, "multihashes": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-3.1.2.tgz", - "integrity": "sha512-AP4IoV/YzkNrfbQKZE3OMPibrmy350OmCd6cJkwyM8oExaXIlOY4UnOOVSQtAEuq/LR01XfXKCESidzZvSwHCQ==", "requires": { "multibase": "^3.1.0", "uint8arrays": "^2.0.5", @@ -30298,8 +26342,6 @@ "dependencies": { "uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", "requires": { "multiformats": "^9.4.2" } @@ -30308,8 +26350,6 @@ }, "uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", "requires": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" @@ -30319,8 +26359,6 @@ }, "libp2p-tcp": { "version": "0.15.4", - "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.15.4.tgz", - "integrity": "sha512-MqXIlqV7t9z0A1Ww9Omd2XIlndcYOAh5R6kWRZ8Vo/CITazKUC5ZGNoj23hq/aEPaX8p5XmJs2BKESg/OuhGhQ==", "requires": { "abortable-iterator": "^3.0.0", "class-is": "^1.1.0", @@ -30333,14 +26371,10 @@ }, "dependencies": { "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" }, "ip-address": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-7.1.0.tgz", - "integrity": "sha512-V9pWC/VJf2lsXqP7IWJ+pe3P1/HCYGBMZrrnT62niLGjAfCbeiwXMUxaeHvnVlz19O27pvXP4azs+Pj/A0x+SQ==", "requires": { "jsbn": "1.1.0", "sprintf-js": "1.1.2" @@ -30348,8 +26382,6 @@ }, "libp2p-utils": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/libp2p-utils/-/libp2p-utils-0.3.1.tgz", - "integrity": "sha512-LOVfww7a6Rhtoupl3z1ABuTEli5whY3VLTB9QntsOIwbOcX9GfmjuhqYbEDht9lVPAQl+rCUWbfDMvK121ryUg==", "requires": { "abortable-iterator": "^3.0.0", "debug": "^4.3.0", @@ -30362,16 +26394,12 @@ }, "mafmt": { "version": "9.0.0", - "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-9.0.0.tgz", - "integrity": "sha512-BwKL6FJxc6R85K6gFE/pX7MVyCp0NkM2DJHg0RatxVgDlK4g9kqtfXQUt2iReSmTcgZss/Q/Bdfa2KTg4KyC+g==", "requires": { "multiaddr": "^9.0.1" } }, "multiaddr": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", - "integrity": "sha512-YFaEb9t4yXSbaGksSEdg+Kn2U02s7w4wXUgyEMQmPxFJj7CfVHY10WOsScAX/rK6Soa15S1zXYadqH9TtlVreQ==", "requires": { "cids": "^1.0.0", "dns-over-http-resolver": "^1.0.0", @@ -30383,14 +26411,10 @@ } }, "sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" + "version": "1.1.2" }, "uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", "requires": { "multiformats": "^9.4.2" } @@ -30399,8 +26423,6 @@ }, "libp2p-utils": { "version": "0.2.3", - "resolved": "https://registry.npmjs.org/libp2p-utils/-/libp2p-utils-0.2.3.tgz", - "integrity": "sha512-9BoMCgvJF7LJ+JVMaHtqfCqhZN4i/sx0DrY6lf9U0Rq9uUgQ9qTai2O9LXcfr1LOS3OMMeRLsKk25MMgsf7W3w==", "requires": { "abortable-iterator": "^3.0.0", "debug": "^4.2.0", @@ -30413,8 +26435,6 @@ "dependencies": { "multiaddr": { "version": "8.1.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-8.1.2.tgz", - "integrity": "sha512-r13IzW8+Sv9zab9Gt8RPMIN2WkptIPq99EpAzg4IbJ/zTELhiEwXWr9bAmEatSCI4j/LSA6ESJzvz95JZ+ZYXQ==", "requires": { "cids": "^1.0.0", "class-is": "^1.1.0", @@ -30428,8 +26448,6 @@ }, "multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", "requires": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -30437,24 +26455,18 @@ }, "uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", "requires": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" } }, "varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "version": "5.0.2" } } }, "libp2p-websockets": { "version": "0.15.9", - "resolved": "https://registry.npmjs.org/libp2p-websockets/-/libp2p-websockets-0.15.9.tgz", - "integrity": "sha512-tuQ4KezPEiJ/JXGKJUttPgBWTv36NnaqY05lWja8wQwQU3R1NgpH4GRJnTBshGXoBFdvGGJbTxvsJlh15NzMkg==", "requires": { "abortable-iterator": "^3.0.0", "class-is": "^1.1.0", @@ -30472,22 +26484,16 @@ "dependencies": { "buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" }, "ip-address": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-7.1.0.tgz", - "integrity": "sha512-V9pWC/VJf2lsXqP7IWJ+pe3P1/HCYGBMZrrnT62niLGjAfCbeiwXMUxaeHvnVlz19O27pvXP4azs+Pj/A0x+SQ==", "requires": { "jsbn": "1.1.0", "sprintf-js": "1.1.2" @@ -30495,8 +26501,6 @@ }, "ipfs-utils": { "version": "8.1.6", - "resolved": "https://registry.npmjs.org/ipfs-utils/-/ipfs-utils-8.1.6.tgz", - "integrity": "sha512-V/cwb6113DrDhrjDTWImA6+zmJbpdbUkxdxmEQO7it8ykV76bBmzU1ZXSM0QR0qxGy9VW8dkUlPAC2K10VgSmw==", "requires": { "abort-controller": "^3.0.0", "any-signal": "^2.1.0", @@ -30518,8 +26522,6 @@ }, "libp2p-utils": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/libp2p-utils/-/libp2p-utils-0.3.1.tgz", - "integrity": "sha512-LOVfww7a6Rhtoupl3z1ABuTEli5whY3VLTB9QntsOIwbOcX9GfmjuhqYbEDht9lVPAQl+rCUWbfDMvK121ryUg==", "requires": { "abortable-iterator": "^3.0.0", "debug": "^4.3.0", @@ -30532,16 +26534,12 @@ }, "mafmt": { "version": "9.0.0", - "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-9.0.0.tgz", - "integrity": "sha512-BwKL6FJxc6R85K6gFE/pX7MVyCp0NkM2DJHg0RatxVgDlK4g9kqtfXQUt2iReSmTcgZss/Q/Bdfa2KTg4KyC+g==", "requires": { "multiaddr": "^9.0.1" } }, "multiaddr": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", - "integrity": "sha512-YFaEb9t4yXSbaGksSEdg+Kn2U02s7w4wXUgyEMQmPxFJj7CfVHY10WOsScAX/rK6Soa15S1zXYadqH9TtlVreQ==", "requires": { "cids": "^1.0.0", "dns-over-http-resolver": "^1.0.0", @@ -30553,18 +26551,13 @@ } }, "node-fetch": { - "version": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g==" + "version": "npm:@achingbrain/node-fetch@2.6.7" }, "sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" + "version": "1.1.2" }, "uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", "requires": { "multiformats": "^9.4.2" } @@ -30573,14 +26566,10 @@ }, "lines-and-columns": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, "load-json-file": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -30591,8 +26580,6 @@ "dependencies": { "parse-json": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, "requires": { "error-ex": "^1.3.1", @@ -30601,22 +26588,16 @@ }, "strip-bom": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true } } }, "loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "version": "4.2.0", "dev": true }, "loader-utils": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", "dev": true, "requires": { "big.js": "^5.2.2", @@ -30626,8 +26607,6 @@ }, "locate-path": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { "p-locate": "^4.1.0" @@ -30635,118 +26614,78 @@ }, "lockfile": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.4.tgz", - "integrity": "sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA==", "dev": true, "requires": { "signal-exit": "^3.0.2" } }, "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "version": "4.17.21" }, "lodash.cond": { "version": "4.5.2", - "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", - "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", "dev": true }, "lodash.find": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz", - "integrity": "sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E=" + "version": "4.6.0" }, "lodash.flattendeep": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + "version": "4.4.2" }, "lodash.includes": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=", "dev": true }, "lodash.isboolean": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=", "dev": true }, "lodash.isinteger": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=", "dev": true }, "lodash.isnumber": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=", "dev": true }, "lodash.isplainobject": { "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", "dev": true }, "lodash.isstring": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", "dev": true }, "lodash.max": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.max/-/lodash.max-4.0.1.tgz", - "integrity": "sha1-hzVWbGGLNan3YFILSHrnllivE2o=" + "version": "4.0.1" }, "lodash.memoize": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", "dev": true }, "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "version": "4.6.2" }, "lodash.once": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=", "dev": true }, "lodash.padstart": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.6.1.tgz", - "integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs=" + "version": "4.6.1" }, "lodash.repeat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-4.1.0.tgz", - "integrity": "sha1-/H3oEx2MisB+S0n3T/6CnR8r7EQ=" + "version": "4.1.0" }, "lodash.sortby": { "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, "log4js": { "version": "6.4.4", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.4.tgz", - "integrity": "sha512-ncaWPsuw9Vl1CKA406hVnJLGQKy1OHx6buk8J4rE2lVW+NW5Y82G5/DIloO7NkqLOUtNPEANaWC1kZYVjXssPw==", "dev": true, "requires": { "date-format": "^4.0.6", @@ -30758,16 +26697,12 @@ "dependencies": { "flatted": { "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true } } }, "logform": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz", - "integrity": "sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw==", "requires": { "@colors/colors": "1.5.0", "fecha": "^4.2.0", @@ -30777,60 +26712,42 @@ }, "dependencies": { "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "version": "2.1.3" } } }, "lolex": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-1.6.0.tgz", - "integrity": "sha1-OpoCg0UqR9dDnnJzG54H1zhuSfY=", "dev": true }, "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + "version": "4.0.0" }, "loupe": { "version": "2.3.4", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", - "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", "requires": { "get-func-name": "^2.0.0" } }, "lower-case": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", - "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=", "dev": true }, "lru-cache": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "requires": { "yallist": "^3.0.2" } }, "ltgt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + "version": "2.2.1" }, "lunr": { "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, "lunr-mutable-indexes": { "version": "2.3.2", - "resolved": "https://registry.npmjs.org/lunr-mutable-indexes/-/lunr-mutable-indexes-2.3.2.tgz", - "integrity": "sha512-Han6cdWAPPFM7C2AigS2Ofl3XjAT0yVMrUixodJEpyg71zCtZ2yzXc3s+suc/OaNt4ca6WJBEzVnEIjxCTwFMw==", "dev": true, "requires": { "lunr": ">= 2.3.0 < 2.4.0" @@ -30838,16 +26755,12 @@ }, "mafmt": { "version": "8.0.4", - "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-8.0.4.tgz", - "integrity": "sha512-wwZ5+PU0vQw10kwQRyZin1Z0dqVOp0BnYlX1xvXHS2fmLwrrQCfU1+3tlW5MRcihUwGz1virnVhbRAU1biKfiw==", "requires": { "multiaddr": "^8.0.0" }, "dependencies": { "multiaddr": { "version": "8.1.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-8.1.2.tgz", - "integrity": "sha512-r13IzW8+Sv9zab9Gt8RPMIN2WkptIPq99EpAzg4IbJ/zTELhiEwXWr9bAmEatSCI4j/LSA6ESJzvz95JZ+ZYXQ==", "requires": { "cids": "^1.0.0", "class-is": "^1.1.0", @@ -30861,8 +26774,6 @@ }, "multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", "requires": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -30870,24 +26781,18 @@ }, "uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", "requires": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" } }, "varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "version": "5.0.2" } } }, "magic-string": { "version": "0.23.2", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.23.2.tgz", - "integrity": "sha512-oIUZaAxbcxYIp4AyLafV6OVKoB3YouZs0UTCJ8mOKBHNyJgGDaMJ4TgA+VylJh6fx7EQCC52XkbURxxG9IoJXA==", "dev": true, "requires": { "sourcemap-codec": "^1.4.1" @@ -30895,8 +26800,6 @@ }, "make-dir": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { "pify": "^3.0.0" @@ -30904,25 +26807,17 @@ }, "make-error": { "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "marked": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.14.tgz", - "integrity": "sha512-HL5sSPE/LP6U9qKgngIIPTthuxC0jrfxpYMZ3LdGDD3vTnLs59m2Z7r6+LNDR3ToqEQdkKd6YaaEfJhodJmijQ==", + "version": "4.0.12", "dev": true }, "mcl-wasm": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz", - "integrity": "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==" + "version": "0.7.9" }, "md5.js": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "dev": true, "requires": { "hash-base": "^3.0.0", @@ -30931,14 +26826,10 @@ } }, "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + "version": "0.3.0" }, "memdown": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz", - "integrity": "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==", "requires": { "abstract-leveldown": "~6.2.1", "functional-red-black-tree": "~1.0.1", @@ -30949,50 +26840,36 @@ }, "dependencies": { "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + "version": "3.2.3" } } }, "memorystream": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", "dev": true }, "merge-descriptors": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", "dev": true }, "merge-options": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", - "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", "requires": { "is-plain-obj": "^2.1.0" } }, "merge-source-map": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.0.4.tgz", - "integrity": "sha1-pd5GU42uhNQRTMXqArR3KmNGcB8=", "dev": true, "requires": { "source-map": "^0.5.6" } }, "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + "version": "2.0.0" }, "merge2": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, "merkle-patricia-tree": { @@ -31005,6 +26882,7 @@ "0x": "^4.9.1", "benchmark": "^2.1.4", "eslint": "^6.8.0", + "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -31016,6 +26894,7 @@ "nyc": "^15.1.0", "prettier": "^2.0.5", "readable-stream": "^3.6.0", + "rlp": "^3.0.0", "semaphore-async-await": "^1.5.1", "tape": "^5.3.1", "ts-node": "^10.2.1", @@ -31025,8 +26904,6 @@ "dependencies": { "deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "requires": { "call-bind": "^1.0.0", @@ -31048,8 +26925,6 @@ }, "resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, "requires": { "is-core-module": "^2.2.0", @@ -31057,9 +26932,7 @@ } }, "tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -31074,7 +26947,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -31089,81 +26962,63 @@ }, "methods": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", "dev": true }, "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.4", "dev": true, "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" + "braces": "^3.0.1", + "picomatch": "^2.2.3" } }, "miller-rabin": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, "requires": { "bn.js": "^4.0.0", "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "dev": true + } } }, "mime": { "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", "dev": true }, "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + "version": "1.52.0" }, "mime-types": { "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "requires": { "mime-db": "1.52.0" } }, "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + "version": "2.1.0" }, "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "version": "1.0.1" }, "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + "version": "1.0.1" }, "minimatch": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "version": "1.2.6" }, "mkdirp": { "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, "requires": { "minimist": "^1.2.6" @@ -31171,14 +27026,10 @@ }, "mkdirp-classic": { "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", "dev": true }, "module-deps": { "version": "6.2.3", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz", - "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==", "dev": true, "requires": { "browser-resolve": "^2.0.0", @@ -31200,14 +27051,10 @@ "dependencies": { "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -31221,14 +27068,10 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -31237,36 +27080,24 @@ } }, "moment": { - "version": "2.29.2", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.2.tgz", - "integrity": "sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg==" + "version": "2.29.1" }, "morphdom": { "version": "2.6.1", - "resolved": "https://registry.npmjs.org/morphdom/-/morphdom-2.6.1.tgz", - "integrity": "sha512-Y8YRbAEP3eKykroIBWrjcfMw7mmwJfjhqdpSvoqinu8Y702nAwikpXcNFDiIkyvfCLxLM9Wu95RZqo4a9jFBaA==", "dev": true }, "moving-average": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/moving-average/-/moving-average-1.0.1.tgz", - "integrity": "sha512-Hl3aUJqu/7LMslHM6mz9Sk1mpFwe4jW5QcmJgukcUGFILBcQW5L9ot8BUVRSuUaW3o/1Twrwmu7w2NTGvw76cA==" + "version": "1.0.1" }, "mri": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", - "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==", "dev": true }, "ms": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.3.tgz", - "integrity": "sha1-cIFVpeROM/X9D8U+gdDUCpG+H/8=" + "version": "0.7.3" }, "multiaddr": { "version": "10.0.1", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-10.0.1.tgz", - "integrity": "sha512-G5upNcGzEGuTHkzxezPrrD6CaIHR9uo+7MwqhNVcXTs33IInon4y7nMiGxl2CY5hG7chvYQUQhz5V52/Qe3cbg==", "requires": { "dns-over-http-resolver": "^1.2.3", "err-code": "^3.0.1", @@ -31277,29 +27108,21 @@ }, "dependencies": { "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" } } }, "multiaddr-to-uri": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/multiaddr-to-uri/-/multiaddr-to-uri-7.0.0.tgz", - "integrity": "sha512-VbscDpLcbV0m25tJqfnZSfbjVUuNlPa4BbD5l/7me1t0lc3SWI0XAoO5E/PNJF0e1qUlbdq7yjVFEQjUT+9r0g==", "requires": { "multiaddr": "^9.0.1" }, "dependencies": { "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" }, "multiaddr": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", - "integrity": "sha512-YFaEb9t4yXSbaGksSEdg+Kn2U02s7w4wXUgyEMQmPxFJj7CfVHY10WOsScAX/rK6Soa15S1zXYadqH9TtlVreQ==", "requires": { "cids": "^1.0.0", "dns-over-http-resolver": "^1.0.0", @@ -31312,8 +27135,6 @@ }, "uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", "requires": { "multiformats": "^9.4.2" } @@ -31322,16 +27143,12 @@ }, "multibase": { "version": "4.0.6", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-4.0.6.tgz", - "integrity": "sha512-x23pDe5+svdLz/k5JPGCVdfn7Q5mZVMBETiC+ORfO+sor9Sgs0smJzAjfTbM5tckeCqnaUuMYoz+k3RXMmJClQ==", "requires": { "@multiformats/base-x": "^4.0.1" } }, "multicodec": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-2.1.3.tgz", - "integrity": "sha512-0tOH2Gtio39uO41o+2xl9UhRkCWxU5ZmZSbFCh/OjGzkWJI8e6lkN/s4Mj1YfyWoBod+2+S3W+6wO6nhkwN8pA==", "requires": { "uint8arrays": "1.1.0", "varint": "^6.0.0" @@ -31339,8 +27156,6 @@ "dependencies": { "multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", "requires": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -31348,8 +27163,6 @@ }, "uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", "requires": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" @@ -31358,14 +27171,10 @@ } }, "multiformats": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.6.4.tgz", - "integrity": "sha512-fCCB6XMrr6CqJiHNjfFNGT0v//dxOBMrOMqUIzpPc/mmITweLEyhvMpY9bF+jZ9z3vaMAau5E8B68DW77QMXkg==" + "version": "9.6.4" }, "multihashes": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-4.0.3.tgz", - "integrity": "sha512-0AhMH7Iu95XjDLxIeuCOOE4t9+vQZsACyKZ9Fxw2pcsRmlX4iCn1mby0hS0bb+nQOVpdQYWPpnyusw4da5RPhA==", "requires": { "multibase": "^4.0.1", "uint8arrays": "^3.0.0", @@ -31373,16 +27182,12 @@ }, "dependencies": { "varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "version": "5.0.2" } } }, "multihashing-async": { "version": "2.1.4", - "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-2.1.4.tgz", - "integrity": "sha512-sB1MiQXPSBTNRVSJc2zM157PXgDtud2nMFUEIvBrsq5Wv96sUclMRK/ecjoP1T/W61UJBqt4tCTwMkUpt2Gbzg==", "requires": { "blakejs": "^1.1.0", "err-code": "^3.0.0", @@ -31393,16 +27198,12 @@ }, "dependencies": { "err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + "version": "3.0.1" } } }, "multistream-select": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/multistream-select/-/multistream-select-1.0.0.tgz", - "integrity": "sha512-82riQ+qZ0RPY+KbRdeeKKQnFSBCVpUbZ15EniGU2nfwM8NdrpPIeUYXFw4a/pyprcNeRfMgLlG9aCh874p8nJg==", "requires": { "bl": "^4.0.0", "debug": "^4.1.1", @@ -31417,8 +27218,6 @@ "dependencies": { "bl": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "requires": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -31427,8 +27226,6 @@ }, "buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -31436,8 +27233,6 @@ }, "it-handshake": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/it-handshake/-/it-handshake-1.0.2.tgz", - "integrity": "sha512-uutOim5xF1eyDQD3u8qd3TxbWKwxqGMlbvacZsRsPdjO1BD9lnPTVci0jSMGsvMOu+5Y3W/QQ4hPQb87qPmPVQ==", "requires": { "it-pushable": "^1.4.0", "it-reader": "^2.0.0", @@ -31446,8 +27241,6 @@ }, "it-length-prefixed": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-3.1.0.tgz", - "integrity": "sha512-E5GwT6qfZEwh3/XThyYwgjKJ4/hxvTC9kdbj3gxXDeUDKtC7+K2T647sPeX7xDEWqunsnoQyvOrjoHPegaT3uw==", "requires": { "@types/bl": "^2.1.0", "bl": "^4.0.2", @@ -31457,16 +27250,12 @@ }, "it-reader": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-2.1.0.tgz", - "integrity": "sha512-hSysqWTO9Tlwc5EGjVf8JYZzw0D2FsxD/g+eNNWrez9zODxWt6QlN6JAMmycK72Mv4jHEKEXoyzUN4FYGmJaZw==", "requires": { "bl": "^4.0.0" } }, "multibase": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", - "integrity": "sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==", "requires": { "@multiformats/base-x": "^4.0.1", "web-encoding": "^1.0.6" @@ -31474,40 +27263,28 @@ }, "uint8arrays": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", - "integrity": "sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==", "requires": { "multibase": "^3.0.0", "web-encoding": "^1.0.2" } }, "varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "version": "5.0.2" } } }, "murmurhash3js-revisited": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz", - "integrity": "sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==" + "version": "3.0.0" }, "mutable-proxy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mutable-proxy/-/mutable-proxy-1.0.0.tgz", - "integrity": "sha512-4OvNRr1DJpy2QuDUV74m+BWZ//n4gG4bmd21MzDSPqHEidIDWqwyOjcadU1LBMO3vXYGurVKjfBrxrSQIHFu9A==" + "version": "1.0.0" }, "mute-stream": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, "mutexify": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/mutexify/-/mutexify-1.4.0.tgz", - "integrity": "sha512-pbYSsOrSB/AKN5h/WzzLRMFgZhClWccf2XIB4RSMC8JbquiB0e0/SH5AIfdQMdyHmYtv4seU7yV/TvAwPLJ1Yg==", "dev": true, "requires": { "queue-tick": "^1.0.0" @@ -31515,8 +27292,6 @@ }, "mv": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz", - "integrity": "sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=", "dev": true, "requires": { "mkdirp": "~0.5.1", @@ -31526,8 +27301,6 @@ "dependencies": { "glob": { "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", "dev": true, "requires": { "inflight": "^1.0.4", @@ -31539,8 +27312,6 @@ }, "rimraf": { "version": "2.4.5", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", - "integrity": "sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=", "dev": true, "requires": { "glob": "^6.0.1" @@ -31549,20 +27320,14 @@ } }, "nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" + "version": "2.15.0" }, "nanoassert": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-1.1.0.tgz", - "integrity": "sha1-TzFS4JVA/eKMdvRLGbvNHVpCR40=", "dev": true }, "nanobench": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nanobench/-/nanobench-2.1.1.tgz", - "integrity": "sha512-z+Vv7zElcjN+OpzAxAquUayFLGK3JI/ubCl0Oh64YQqsTGG09CGqieJVQw4ui8huDnnAgrvTv93qi5UaOoNj8A==", "dev": true, "requires": { "browser-process-hrtime": "^0.1.2", @@ -31573,20 +27338,14 @@ "dependencies": { "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, "chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { "ansi-styles": "^2.2.1", @@ -31598,8 +27357,6 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -31607,16 +27364,12 @@ }, "supports-color": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true } } }, "nanohtml": { "version": "1.9.1", - "resolved": "https://registry.npmjs.org/nanohtml/-/nanohtml-1.9.1.tgz", - "integrity": "sha512-4snfp20yKdA6+dT1vv0F4l1oYmnFXPNHk3ZFTfOldD9LamFxQZ9gWk4gJz7wflq3XROLzrGQHfo0HT4V4kSkhQ==", "dev": true, "requires": { "acorn-node": "^1.8.2", @@ -31633,72 +27386,48 @@ } }, "nanoid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz", - "integrity": "sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==" + "version": "3.3.1" }, "napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" + "version": "2.0.0" }, "native-abort-controller": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/native-abort-controller/-/native-abort-controller-1.0.4.tgz", - "integrity": "sha512-zp8yev7nxczDJMoP6pDxyD20IU0T22eX8VwN2ztDccKvSZhRaV33yP1BGwKSZfXuqWUzsXopVFjBdau9OOAwMQ==", "requires": {} }, "native-fetch": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/native-fetch/-/native-fetch-3.0.0.tgz", - "integrity": "sha512-G3Z7vx0IFb/FQ4JxvtqGABsOTIqRWvgQz6e+erkB+JJD6LrszQtMozEHI4EkmgZQvnGHrpLVzUWk7t4sJCIkVw==", "requires": {} }, "natural-compare": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, "ncp": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", "dev": true }, "negotiator": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true }, "neo-async": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, "netmask": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", - "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==" + "version": "2.0.2" }, "next-tick": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, "nice-try": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, "nise": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", - "integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==", "requires": { "@sinonjs/commons": "^1.7.0", "@sinonjs/fake-timers": "^6.0.0", @@ -31708,14 +27437,10 @@ }, "dependencies": { "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + "version": "0.0.1" }, "path-to-regexp": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", "requires": { "isarray": "0.0.1" } @@ -31724,32 +27449,22 @@ }, "no-case": { "version": "2.3.2", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", "dev": true, "requires": { "lower-case": "^1.1.1" } }, "noble-ed25519": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/noble-ed25519/-/noble-ed25519-1.2.6.tgz", - "integrity": "sha512-zfnWqg9FVMp8CnzUpAjbt1nDXpDjCvxYiCXdnW1mY8zQHw/6twUlkFm14VPdojVzc0kcd+i9zT79+26GcNbsuQ==" + "version": "1.2.6" }, "noble-secp256k1": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/noble-secp256k1/-/noble-secp256k1-1.2.14.tgz", - "integrity": "sha512-GSCXyoZBUaaPwVWdYncMEmzlSUjF9J/YeEHpklYJCyg8wPuJP3NzDx0BkiwArzINkdX2HJHvUJhL6vVWPOQQcg==" + "version": "1.2.14" }, "node-addon-api": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + "version": "2.0.2" }, "node-dir": { "version": "0.1.17", - "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", - "integrity": "sha1-X1Zl2TNRM1yqvvjxxVRRbPXx5OU=", "dev": true, "requires": { "minimatch": "^3.0.2" @@ -31757,80 +27472,56 @@ }, "node-fetch": { "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", "requires": { "whatwg-url": "^5.0.0" } }, "node-forge": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", - "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" + "version": "0.10.0" }, "node-gyp-build": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", - "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==" + "version": "4.3.0" }, "node-preload": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", - "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", "dev": true, "requires": { "process-on-spawn": "^1.0.0" } }, "node-releases": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.3.tgz", - "integrity": "sha512-maHFz6OLqYxz+VQyCAtA3PTX4UP/53pa05fyDNc9CwjvJ0yEh6+xBwKsgCxMNhS8taUKBFYxfuiaD9U/55iFaw==", + "version": "2.0.2", "dev": true }, "normalize-html-whitespace": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/normalize-html-whitespace/-/normalize-html-whitespace-0.2.0.tgz", - "integrity": "sha1-EBci9kI1Ucdc24+dEE/4UNrx4Q4=", "dev": true }, "normalize-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, "npm-run-path": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "requires": { "path-key": "^3.0.0" }, "dependencies": { "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + "version": "3.1.1" } } }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "nwsapi": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, "nyc": { "version": "15.1.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", - "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, "requires": { "@istanbuljs/load-nyc-config": "^1.0.0", @@ -31864,14 +27555,10 @@ "dependencies": { "ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "cliui": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, "requires": { "string-width": "^4.2.0", @@ -31881,8 +27568,6 @@ }, "make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -31890,8 +27575,6 @@ }, "p-map": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, "requires": { "aggregate-error": "^3.0.0" @@ -31899,14 +27582,10 @@ }, "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 }, "rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -31914,8 +27593,6 @@ }, "strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { "ansi-regex": "^5.0.1" @@ -31923,8 +27600,6 @@ }, "wrap-ansi": { "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "requires": { "ansi-styles": "^4.0.0", @@ -31934,14 +27609,10 @@ }, "y18n": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "dev": true }, "yargs": { "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, "requires": { "cliui": "^6.0.0", @@ -31959,8 +27630,6 @@ }, "yargs-parser": { "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -31971,35 +27640,23 @@ }, "nyc-report-lcov-absolute": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/nyc-report-lcov-absolute/-/nyc-report-lcov-absolute-1.0.0.tgz", - "integrity": "sha512-sDq0XM0on9casPNySxGD/WSy17m95+e8xEhObNHoxVRsTIZZt8akop4WWisnjzEWRARGW91Ip6oRhIWmy4qcPw==", "dev": true, "requires": {} }, "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "version": "0.9.0" }, "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "version": "4.1.1" }, "object-hash": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz", - "integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==" + "version": "2.2.0" }, "object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==" + "version": "1.12.0" }, "object-is": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -32007,14 +27664,10 @@ } }, "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + "version": "1.1.1" }, "object.assign": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "requires": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", @@ -32023,29 +27676,21 @@ } }, "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "version": "2.3.0", "requires": { "ee-first": "1.1.1" } }, "on-headers": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "dev": true }, "on-net-listen": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/on-net-listen/-/on-net-listen-1.1.2.tgz", - "integrity": "sha512-y1HRYy8s/RlcBvDUwKXSmkODMdx4KSuIvloCnQYJ2LdBBC1asY4HtfhXwe3UWknLakATZDnbzht2Ijw3M1EqFg==", "dev": true }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" @@ -32053,30 +27698,22 @@ }, "one-time": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", - "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", "requires": { "fn.name": "1.x.x" } }, "onetime": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "requires": { "mimic-fn": "^2.1.0" } }, "opencollective-postinstall": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", "dev": true }, "opn": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", - "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", "dev": true, "requires": { "is-wsl": "^1.1.0" @@ -32084,16 +27721,12 @@ "dependencies": { "is-wsl": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", "dev": true } } }, "optionator": { "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "requires": { "deep-is": "~0.1.3", @@ -32106,45 +27739,31 @@ }, "os-browserify": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", "dev": true }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, "p-any": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-any/-/p-any-3.0.0.tgz", - "integrity": "sha512-5rqbqfsRWNb0sukt0awwgJMlaep+8jV45S15SKKB34z4UuzjcofIfnriCBhWjZP2jbVtjt9yRl7buB6RlKsu9w==", "requires": { "p-cancelable": "^2.0.0", "p-some": "^5.0.0" } }, "p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==" + "version": "2.1.1" }, "p-defer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-3.0.0.tgz", - "integrity": "sha512-ugZxsxmtTln604yeYd29EGrNhazN2lywetzpKhfmQjW/VJmhpDmWbiX+h0zL8V91R0UXkhb3KtPmyq9PZw3aYw==" + "version": "3.0.0" }, "p-fifo": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-fifo/-/p-fifo-1.0.0.tgz", - "integrity": "sha512-IjoCxXW48tqdtDFz6fqo5q1UfFVjjVZe8TC1QRflvNUJtNfCUhxOUw6MOVZhDPjqhSzc26xKdugsO17gmzd5+A==", "requires": { "fast-fifo": "^1.0.0", "p-defer": "^3.0.0" @@ -32152,36 +27771,26 @@ }, "p-filter": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz", - "integrity": "sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==", "requires": { "p-map": "^2.0.0" }, "dependencies": { "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==" + "version": "2.1.0" } } }, "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + "version": "1.0.0" }, "p-limit": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "requires": { "p-try": "^2.0.0" } }, "p-locate": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { "p-limit": "^2.2.0" @@ -32189,16 +27798,12 @@ }, "p-map": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "requires": { "aggregate-error": "^3.0.0" } }, "p-queue": { "version": "6.6.2", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", - "integrity": "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==", "requires": { "eventemitter3": "^4.0.4", "p-timeout": "^3.2.0" @@ -32206,8 +27811,6 @@ "dependencies": { "p-timeout": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", "requires": { "p-finally": "^1.0.0" } @@ -32215,14 +27818,10 @@ } }, "p-reflect": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-reflect/-/p-reflect-2.1.0.tgz", - "integrity": "sha512-paHV8NUz8zDHu5lhr/ngGWQiW067DK/+IbJ+RfZ4k+s8y4EKyYCz8pGYWjxCg35eHztpJAt+NUgvN4L+GCbPlg==" + "version": "2.1.0" }, "p-retry": { "version": "4.6.1", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.1.tgz", - "integrity": "sha512-e2xXGNhZOZ0lfgR9kL34iGlU8N/KO0xZnQxVEwdeOvpqNDQfdnxIYizvWtK8RglUa3bGqI8g0R/BdfzLMxRkiA==", "requires": { "@types/retry": "^0.12.0", "retry": "^0.13.1" @@ -32230,8 +27829,6 @@ }, "p-settle": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/p-settle/-/p-settle-4.1.1.tgz", - "integrity": "sha512-6THGh13mt3gypcNMm0ADqVNCcYa3BK6DWsuJWFCuEKP1rpY+OKGp7gaZwVmLspmic01+fsg/fN57MfvDzZ/PuQ==", "requires": { "p-limit": "^2.2.2", "p-reflect": "^2.1.0" @@ -32239,43 +27836,31 @@ }, "p-some": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-some/-/p-some-5.0.0.tgz", - "integrity": "sha512-Js5XZxo6vHjB9NOYAzWDYAIyyiPvva0DWESAIWIK7uhSpGsyg5FwUPxipU/SOQx5x9EqhOh545d1jo6cVkitig==", "requires": { "aggregate-error": "^3.0.0", "p-cancelable": "^2.0.0" } }, "p-timeout": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-4.1.0.tgz", - "integrity": "sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==" + "version": "4.1.0" }, "p-times": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-times/-/p-times-3.0.0.tgz", - "integrity": "sha512-/Z7mcs8Liie8E7IHI9SBtmkHVW/GjLroQ94ALoAMIG20mqFMuh56/3WYhtOTqX9ccRSOxgaCkFC94Bat1Ofskg==", "requires": { "p-map": "^4.0.0" } }, "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + "version": "2.2.0" }, "p-wait-for": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-3.2.0.tgz", - "integrity": "sha512-wpgERjNkLrBiFmkMEjuZJEWKKDrNfHCKA1OhyN1wg1FrLkULbviEy6py1AyJUgZ72YWFbZ38FIpnqvVqAlDUwA==", "requires": { "p-timeout": "^3.0.0" }, "dependencies": { "p-timeout": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", "requires": { "p-finally": "^1.0.0" } @@ -32284,8 +27869,6 @@ }, "package-hash": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", - "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", "dev": true, "requires": { "graceful-fs": "^4.1.15", @@ -32296,8 +27879,6 @@ }, "pad": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/pad/-/pad-3.2.0.tgz", - "integrity": "sha512-2u0TrjcGbOjBTJpyewEl4hBO3OeX5wWue7eIFPzQTg6wFSvoaHcBTTUY5m+n0hd04gmTCPuY0kCpVIVuw5etwg==", "dev": true, "requires": { "wcwidth": "^1.0.1" @@ -32305,14 +27886,10 @@ }, "pako": { "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", "dev": true }, "parent-module": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "requires": { "callsites": "^3.0.0" @@ -32320,8 +27897,6 @@ }, "parents": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", "dev": true, "requires": { "path-platform": "~0.11.15" @@ -32329,8 +27904,6 @@ }, "parse-asn1": { "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", "dev": true, "requires": { "asn1.js": "^5.2.0", @@ -32342,8 +27915,6 @@ }, "parse-json": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -32354,78 +27925,52 @@ }, "parse5": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", - "integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ==", "dev": true }, "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + "version": "1.3.3" }, "path-browserify": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", "dev": true }, "path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "path-is-inside": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, "path-key": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "path-parse": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-platform": { "version": "0.11.15", - "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", - "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", "dev": true }, "path-to-regexp": { "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", "dev": true }, "path-type": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, "pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==" + "version": "1.1.1" }, "pbkdf2": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", "dev": true, "requires": { "create-hash": "^1.1.2", @@ -32437,8 +27982,6 @@ }, "peer-id": { "version": "0.14.8", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.14.8.tgz", - "integrity": "sha512-GpuLpob/9FrEFvyZrKKsISEkaBYsON2u0WtiawLHj1ii6ewkoeRiSDFLyIefYhw0jGvQoeoZS05jaT52X7Bvig==", "requires": { "cids": "^1.1.5", "class-is": "^1.1.0", @@ -32451,8 +27994,6 @@ "dependencies": { "uint8arrays": { "version": "2.1.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", - "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", "requires": { "multiformats": "^9.4.2" } @@ -32461,16 +28002,12 @@ }, "pem-jwk": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pem-jwk/-/pem-jwk-2.0.0.tgz", - "integrity": "sha512-rFxu7rVoHgQ5H9YsP50dDWf0rHjreVA2z0yPiWr5WdH/UHb29hKtF7h6l8vNd1cbYR1t0QL+JKhW55a2ZV4KtA==", "requires": { "asn1.js": "^5.0.1" } }, "perf-sym": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/perf-sym/-/perf-sym-2.0.3.tgz", - "integrity": "sha512-dEVkxyeQ/LroVSVEx94UHsftLNLNR3fs6OGfxWXBOKaNb1XZUb0Evr49RTFFYpJakMCa1MLMxoGDzHu4VENCTg==", "dev": true, "requires": { "end-of-stream": "^1.1.0", @@ -32482,8 +28019,6 @@ "dependencies": { "pump": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", "dev": true, "requires": { "end-of-stream": "^1.1.0", @@ -32492,8 +28027,6 @@ }, "split2": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", "dev": true, "requires": { "through2": "^2.0.2" @@ -32502,38 +28035,26 @@ } }, "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "version": "2.1.0" }, "picocolors": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, "picomatch": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "pify": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, "pinkie": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { "pinkie": "^2.0.0" @@ -32541,8 +28062,6 @@ }, "pino": { "version": "5.17.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-5.17.0.tgz", - "integrity": "sha512-LqrqmRcJz8etUjyV0ddqB6OTUutCgQULPFg2b4dtijRHUsucaAdBgSUW58vY6RFSX+NT8963F+q0tM6lNwGShA==", "dev": true, "requires": { "fast-redact": "^2.0.0", @@ -32555,8 +28074,6 @@ }, "pino-pretty": { "version": "2.6.1", - "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-2.6.1.tgz", - "integrity": "sha512-e/CWtKLidqkr7sinfIVVcsfcHgnFVlGvuEfKuuPFnxBo+9dZZsmgF8a9Rj7SYJ5LMZ8YBxNY9Ca46eam4ajKtQ==", "dev": true, "requires": { "args": "^5.0.0", @@ -32572,8 +28089,6 @@ "dependencies": { "ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -32581,8 +28096,6 @@ }, "chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -32592,8 +28105,6 @@ }, "color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { "color-name": "1.1.3" @@ -32601,20 +28112,14 @@ }, "color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -32624,14 +28129,10 @@ }, "pino-std-serializers": { "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-2.5.0.tgz", - "integrity": "sha512-wXqbqSrIhE58TdrxxlfLwU9eDhrzppQDvGhBEr1gYbzzM4KKo3Y63gSjiDXRKLVS2UOXdPNR2v+KnQgNrs+xUg==", "dev": true }, "pkg-conf": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", - "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", "dev": true, "requires": { "find-up": "^2.0.0", @@ -32640,8 +28141,6 @@ "dependencies": { "find-up": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "^2.0.0" @@ -32649,8 +28148,6 @@ }, "locate-path": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { "p-locate": "^2.0.0", @@ -32659,8 +28156,6 @@ }, "p-limit": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { "p-try": "^1.0.0" @@ -32668,8 +28163,6 @@ }, "p-locate": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { "p-limit": "^1.1.0" @@ -32677,22 +28170,16 @@ }, "p-try": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, "path-exists": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true } } }, "pkg-config": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz", - "integrity": "sha1-VX7yLXPaPIg3EHdmxS6tq94pj+Q=", "dev": true, "requires": { "debug-log": "^1.0.0", @@ -32702,8 +28189,6 @@ }, "pkg-dir": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", - "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", "dev": true, "requires": { "find-up": "^5.0.0" @@ -32711,8 +28196,6 @@ "dependencies": { "find-up": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { "locate-path": "^6.0.0", @@ -32721,8 +28204,6 @@ }, "locate-path": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { "p-locate": "^5.0.0" @@ -32730,8 +28211,6 @@ }, "p-limit": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { "yocto-queue": "^0.1.0" @@ -32739,8 +28218,6 @@ }, "p-locate": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { "p-limit": "^3.0.2" @@ -32750,8 +28227,6 @@ }, "pkg-up": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", - "integrity": "sha1-Pgj7RhUlxEIWJKM7n35tCvWwWiY=", "dev": true, "requires": { "find-up": "^1.0.0" @@ -32759,8 +28234,6 @@ "dependencies": { "find-up": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { "path-exists": "^2.0.0", @@ -32769,8 +28242,6 @@ }, "path-exists": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { "pinkie-promise": "^2.0.0" @@ -32780,20 +28251,14 @@ }, "pkginfo": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz", - "integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=", "dev": true }, "platform": { "version": "1.3.6", - "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", - "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", "dev": true }, "please-upgrade-node": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", "dev": true, "requires": { "semver-compare": "^1.0.0" @@ -32801,32 +28266,22 @@ }, "pluralize": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", - "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", "dev": true }, "pn": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", "dev": true }, "prelude-ls": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, "prettier": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", - "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "version": "2.6.0", "dev": true }, "prettier-linter-helpers": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", "dev": true, "requires": { "fast-diff": "^1.1.2" @@ -32834,14 +28289,10 @@ }, "pretty-hrtime": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", "dev": true }, "pretty-trace": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/pretty-trace/-/pretty-trace-0.3.1.tgz", - "integrity": "sha1-hexuZ2zlQIbok1kZEPsX1S0sImI=", "dev": true, "requires": { "ansicolors": "~0.2.1", @@ -32850,14 +28301,10 @@ "dependencies": { "isarray": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "readable-stream": { "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -32868,8 +28315,6 @@ }, "split2": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/split2/-/split2-0.2.1.tgz", - "integrity": "sha1-At2smtwD7Au3jBKC7Aecpuha6QA=", "dev": true, "requires": { "through2": "~0.6.1" @@ -32877,14 +28322,10 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true }, "through2": { "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", "dev": true, "requires": { "readable-stream": ">=1.0.33-1 <1.1.0-0", @@ -32893,10 +28334,11 @@ } } }, + "printj": { + "version": "1.3.1" + }, "private-ip": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/private-ip/-/private-ip-2.3.3.tgz", - "integrity": "sha512-5zyFfekIVUOTVbL92hc8LJOtE/gyGHeREHkJ2yTyByP8Q2YZVoBqLg3EfYLeF0oVvGqtaEX2t2Qovja0/gStXw==", "requires": { "ip-regex": "^4.3.0", "ipaddr.js": "^2.0.1", @@ -32906,19 +28348,13 @@ }, "process": { "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", "dev": true }, "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "version": "2.0.1" }, "process-on-spawn": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", - "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", "dev": true, "requires": { "fromentries": "^1.2.0" @@ -32926,14 +28362,10 @@ }, "progress": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, "promise-to-callback": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/promise-to-callback/-/promise-to-callback-1.0.0.tgz", - "integrity": "sha1-XSp0kBC/tn2WNZj805YHRqaP7vc=", "requires": { "is-fn": "^1.0.0", "set-immediate-shim": "^1.0.1" @@ -32941,8 +28373,6 @@ }, "protobufjs": { "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -32960,14 +28390,10 @@ } }, "protocol-buffers-schema": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", - "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==" + "version": "3.6.0" }, "protons": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/protons/-/protons-2.0.3.tgz", - "integrity": "sha512-j6JikP/H7gNybNinZhAHMN07Vjr1i4lVupg598l4I9gSTjJqOvKnwjzYX2PzvBTSVf2eZ2nWv4vG+mtW8L6tpA==", "requires": { "protocol-buffers-schema": "^3.3.1", "signed-varint": "^2.0.1", @@ -32976,16 +28402,12 @@ }, "dependencies": { "varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "version": "5.0.2" } } }, "proxy-addr": { "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", "dev": true, "requires": { "forwarded": "0.2.0", @@ -32994,26 +28416,18 @@ "dependencies": { "ipaddr.js": { "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", "dev": true } } }, "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + "version": "1.0.1" }, "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "version": "1.8.0" }, "public-encrypt": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", "dev": true, "requires": { "bn.js": "^4.1.0", @@ -33022,18 +28436,20 @@ "parse-asn1": "^5.0.0", "randombytes": "^2.0.1", "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "dev": true + } } }, "pull-pair": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pull-pair/-/pull-pair-1.1.0.tgz", - "integrity": "sha1-fuQnJj/fTaglOXrAoF4atLdL120=", "dev": true }, "pump": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { "end-of-stream": "^1.1.0", @@ -33042,8 +28458,6 @@ }, "pumpify": { "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", "dev": true, "requires": { "duplexify": "^3.6.0", @@ -33053,8 +28467,6 @@ "dependencies": { "pump": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "dev": true, "requires": { "end-of-stream": "^1.1.0", @@ -33065,57 +28477,36 @@ }, "punycode": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true }, "qheap": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/qheap/-/qheap-1.4.0.tgz", - "integrity": "sha1-LSY+20wfckSnpZH5t3ZFvLzZ3S4=" + "version": "1.4.0" }, "qjobs": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", "dev": true }, "qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", - "requires": { - "side-channel": "^1.0.4" - } + "version": "6.9.7" }, "querystring": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", "dev": true }, "querystring-es3": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, "queue-microtask": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, "queue-tick": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.0.tgz", - "integrity": "sha512-ULWhjjE8BmiICGn3G8+1L9wFpERNxkf8ysxkAer4+TFdRefDaXOCV5m92aMB9FtBVmn/8sETXLXY6BfW7hyaWQ==", "dev": true }, "quibble": { "version": "0.6.8", - "resolved": "https://registry.npmjs.org/quibble/-/quibble-0.6.8.tgz", - "integrity": "sha512-HQ89ZADQ4uZjyePn1yACZADE3OUQ16Py5gkVxcoPvV6IRiItAgGMBkeQ5f1rOnnnsVKccMdhic0xABd7+cY/jA==", "dev": true, "requires": { "lodash": "^4.17.21", @@ -33124,22 +28515,16 @@ }, "quick-format-unescaped": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-3.0.3.tgz", - "integrity": "sha512-dy1yjycmn9blucmJLXOfZDx1ikZJUi6E8bBZLnhPG5gBrVhHXx2xVyqqgKBubVNEXmx51dBACMHpoMQK/N/AXQ==", "dev": true }, "randombytes": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "requires": { "safe-buffer": "^5.1.0" } }, "randomfill": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, "requires": { "randombytes": "^2.0.5", @@ -33148,33 +28533,25 @@ }, "range-parser": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true }, "raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.4.3", "requires": { "bytes": "3.1.2", - "http-errors": "2.0.0", + "http-errors": "1.8.1", "iconv-lite": "0.4.24", "unpipe": "1.0.0" } }, "react-native-fetch-api": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/react-native-fetch-api/-/react-native-fetch-api-2.0.0.tgz", - "integrity": "sha512-GOA8tc1EVYLnHvma/TU9VTgLOyralO7eATRuCDchQveXW9Fr9vXygyq9iwqmM7YRZ8qRJfEt9xOS7OYMdJvRFw==", "requires": { "p-defer": "^3.0.0" } }, "read-only-stream": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", "dev": true, "requires": { "readable-stream": "^2.0.2" @@ -33182,14 +28559,10 @@ "dependencies": { "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -33203,14 +28576,10 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -33220,8 +28589,6 @@ }, "readable-stream": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -33230,8 +28597,6 @@ }, "readdirp": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { "picomatch": "^2.2.1" @@ -33239,8 +28604,6 @@ }, "readline2": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", - "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -33250,8 +28613,6 @@ "dependencies": { "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -33259,31 +28620,23 @@ }, "mute-stream": { "version": "0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", - "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", "dev": true } } }, "receptacle": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/receptacle/-/receptacle-1.3.2.tgz", - "integrity": "sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A==", "requires": { "ms": "^2.1.1" }, "dependencies": { "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "version": "2.1.3" } } }, "rechoir": { "version": "0.7.1", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", - "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", "dev": true, "requires": { "resolve": "^1.9.0" @@ -33291,14 +28644,10 @@ }, "regenerator-runtime": { "version": "0.10.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", "dev": true }, "regexp.prototype.flags": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.1.tgz", - "integrity": "sha512-pMR7hBVUUGI7PMA37m2ofIdQCsomVnas+Jn5UPGAHQ+/LlwKm/aTLJHdasmHRzlfeZwHiAOaRSo2rbBDm3nNUQ==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -33307,14 +28656,10 @@ }, "regexpp": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, "release-zalgo": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", "dev": true, "requires": { "es6-error": "^4.0.1" @@ -33322,8 +28667,6 @@ }, "request": { "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -33348,21 +28691,15 @@ }, "dependencies": { "qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==" + "version": "6.5.3" }, "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + "version": "3.4.0" } } }, "request-promise-core": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", - "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", "dev": true, "requires": { "lodash": "^4.17.19" @@ -33370,8 +28707,6 @@ }, "request-promise-native": { "version": "1.0.9", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", - "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", "dev": true, "requires": { "request-promise-core": "1.1.4", @@ -33380,20 +28715,14 @@ } }, "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + "version": "2.1.1" }, "require-main-filename": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "require-uncached": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { "caller-path": "^0.1.0", @@ -33402,22 +28731,16 @@ "dependencies": { "resolve-from": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "dev": true } } }, "requires-port": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "dev": true }, "resolve": { "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "dev": true, "requires": { "is-core-module": "^2.8.1", @@ -33427,8 +28750,6 @@ }, "resolve-cwd": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, "requires": { "resolve-from": "^5.0.0" @@ -33436,22 +28757,16 @@ "dependencies": { "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 } } }, "resolve-from": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "resolve-jit-symbols": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/resolve-jit-symbols/-/resolve-jit-symbols-0.5.0.tgz", - "integrity": "sha1-kFsz9socoGbxEtrafM4w9SuU9f0=", "dev": true, "requires": { "pretty-trace": "~0.3.1" @@ -33459,8 +28774,6 @@ }, "restore-cursor": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "requires": { "onetime": "^5.1.0", @@ -33469,39 +28782,27 @@ }, "resumer": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", - "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", "dev": true, "requires": { "through": "~2.3.4" } }, "retimer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/retimer/-/retimer-2.0.0.tgz", - "integrity": "sha512-KLXY85WkEq2V2bKex/LOO1ViXVn2KGYe4PYysAdYdjmraYIUsVkXu8O4am+8+5UbaaGl1qho4aqAAPHNQ4GSbg==" + "version": "2.0.0" }, "retry": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==" + "version": "0.13.1" }, "reusify": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, "rfdc": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", "dev": true }, "rimraf": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -33509,8 +28810,6 @@ }, "ripemd160": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "requires": { "hash-base": "^3.0.0", @@ -33536,8 +28835,6 @@ "dependencies": { "deep-equal": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", - "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "requires": { "call-bind": "^1.0.0", @@ -33559,8 +28856,6 @@ }, "resolve": { "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, "requires": { "is-core-module": "^2.2.0", @@ -33568,9 +28863,7 @@ } }, "tape": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", - "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", + "version": "5.5.2", "dev": true, "requires": { "array.prototype.every": "^1.1.3", @@ -33585,7 +28878,7 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.6", + "minimist": "^1.2.5", "object-inspect": "^1.12.0", "object-is": "^1.1.5", "object-keys": "^1.1.1", @@ -33600,92 +28893,64 @@ }, "run-async": { "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true }, "run-parallel": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "requires": { "queue-microtask": "^1.2.2" } }, "rustbn.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" + "version": "0.2.0" }, "rx-lite": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", - "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", "dev": true }, "rxjs": { "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", "dev": true, "requires": { "tslib": "^1.9.0" } }, "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "version": "5.2.1" }, "safe-json-stringify": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", - "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", "dev": true, "optional": true }, "safe-stable-stringify": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz", - "integrity": "sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg==" + "version": "2.3.1" }, "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "version": "2.1.2" }, "sanitize-filename": { "version": "1.6.3", - "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", - "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", "requires": { "truncate-utf8-bytes": "^1.0.0" } }, "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "version": "1.2.4" }, "saxes": { "version": "3.1.11", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.11.tgz", - "integrity": "sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g==", "dev": true, "requires": { "xmlchars": "^2.1.1" } }, "scanf": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/scanf/-/scanf-1.1.2.tgz", - "integrity": "sha512-AjyDCF9jrLcGl+wbH2OO0vfpMUNmv6skJuuLL/vgDUmG/0YXCT6SVBTOvZXOPAD5raJLtDtUU7v0yF79JDuAqA==" + "version": "1.1.2" }, "schema-utils": { "version": "2.7.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", - "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", "dev": true, "requires": { "@types/json-schema": "^7.0.5", @@ -33695,8 +28960,6 @@ }, "secp256k1": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", "requires": { "elliptic": "^6.5.4", "node-addon-api": "^2.0.0", @@ -33704,32 +28967,22 @@ } }, "semaphore-async-await": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz", - "integrity": "sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo=" + "version": "1.5.1" }, "semver": { "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, "semver-compare": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", "dev": true }, "semver-regex": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.3.tgz", - "integrity": "sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==", "dev": true }, "send": { "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "dev": true, "requires": { "debug": "2.6.9", @@ -33749,8 +29002,6 @@ "dependencies": { "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -33758,28 +29009,12 @@ "dependencies": { "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } } }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, "http-errors": { "version": "1.7.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", - "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", "dev": true, "requires": { "depd": "~1.1.2", @@ -33791,43 +29026,24 @@ }, "mime": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true }, "ms": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, "setprototypeof": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, "toidentifier": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true } } }, "serialize-javascript": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -33835,8 +29051,6 @@ }, "serve-static": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "dev": true, "requires": { "encodeurl": "~1.0.2", @@ -33847,35 +29061,23 @@ }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, "set-delayed-interval": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/set-delayed-interval/-/set-delayed-interval-1.0.0.tgz", - "integrity": "sha512-29fhAwuZlLcuBnW/EwxvLcg2D3ELX+VBDNhnavs3YYkab72qmrcSeQNVdzl8EcPPahGQXhBM6MKdPLCQGMDakw==" + "version": "1.0.0" }, "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + "version": "1.0.1" }, "setimmediate": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", "dev": true }, "setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + "version": "1.2.0" }, "sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { "inherits": "^2.0.1", @@ -33884,8 +29086,6 @@ }, "shallow-clone": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", "dev": true, "requires": { "kind-of": "^6.0.2" @@ -33893,8 +29093,6 @@ }, "shasum": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", - "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", "dev": true, "requires": { "json-stable-stringify": "~0.0.0", @@ -33903,8 +29101,6 @@ }, "shasum-object": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz", - "integrity": "sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==", "dev": true, "requires": { "fast-safe-stringify": "^2.0.7" @@ -33912,8 +29108,6 @@ }, "shebang-command": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { "shebang-regex": "^1.0.0" @@ -33921,20 +29115,14 @@ }, "shebang-regex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, "shell-quote": { "version": "1.7.3", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", - "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", "dev": true }, "shelljs": { "version": "0.7.8", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", - "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "dev": true, "requires": { "glob": "^7.0.0", @@ -33944,14 +29132,10 @@ "dependencies": { "interpret": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, "rechoir": { "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { "resolve": "^1.1.6" @@ -33961,8 +29145,6 @@ }, "shiki": { "version": "0.10.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.10.1.tgz", - "integrity": "sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng==", "dev": true, "requires": { "jsonc-parser": "^3.0.0", @@ -33972,8 +29154,6 @@ }, "side-channel": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "requires": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -33981,50 +29161,36 @@ } }, "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "version": "3.0.7" }, "signed-varint": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/signed-varint/-/signed-varint-2.0.1.tgz", - "integrity": "sha1-UKmYnafJjCxh2tEZvJdHDvhSgSk=", "requires": { "varint": "~5.0.0" }, "dependencies": { "varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "version": "5.0.2" } } }, "simple-concat": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", "dev": true }, "simple-swizzle": { "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", "requires": { "is-arrayish": "^0.3.1" }, "dependencies": { "is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + "version": "0.3.2" } } }, "single-line-log": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/single-line-log/-/single-line-log-1.1.2.tgz", - "integrity": "sha1-wvg/Jzo+GhbtsJlWYdoO1e8DM2Q=", "dev": true, "requires": { "string-width": "^1.0.1" @@ -34032,14 +29198,10 @@ "dependencies": { "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -34047,8 +29209,6 @@ }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -34058,8 +29218,6 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -34069,8 +29227,6 @@ }, "sinon": { "version": "9.2.4", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", - "integrity": "sha512-zljcULZQsJxVra28qIAL6ow1Z9tpattkCTEJR4RBP3TGc00FcttsP5pK284Nas5WjMZU5Yzy3kAIp3B3KRf5Yg==", "requires": { "@sinonjs/commons": "^1.8.1", "@sinonjs/fake-timers": "^6.0.1", @@ -34082,14 +29238,10 @@ }, "slash": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, "slice-ansi": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { "ansi-styles": "^3.2.0", @@ -34099,8 +29251,6 @@ "dependencies": { "ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -34108,8 +29258,6 @@ }, "color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { "color-name": "1.1.3" @@ -34117,27 +29265,19 @@ }, "color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true } } }, "snappyjs": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/snappyjs/-/snappyjs-0.6.1.tgz", - "integrity": "sha512-YIK6I2lsH072UE0aOFxxY1dPDCS43I5ktqHpeAsuLNYWkE5pGxRGWfDM4/vSUfNzXjC1Ivzt3qx31PCLmc9yqg==" + "version": "0.6.1" }, "socket.io": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.4.1.tgz", - "integrity": "sha512-s04vrBswdQBUmuWJuuNTmXUVJhP0cVky8bBDhdkf8y0Ptsu7fKU2LuLbts9g+pdmAdyMMn8F/9Mf1/wbtUN0fg==", "dev": true, "requires": { "accepts": "~1.3.4", @@ -34150,14 +29290,10 @@ }, "socket.io-adapter": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz", - "integrity": "sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ==", "dev": true }, "socket.io-parser": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz", - "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==", "dev": true, "requires": { "@types/component-emitter": "^1.2.10", @@ -34167,8 +29303,6 @@ }, "solc": { "version": "0.8.13", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.13.tgz", - "integrity": "sha512-C0yTN+rjEOGO6uVOXI8+EKa75SFMuZpQ2tryex4QxWIg0HRWZvCHKfVPuLZ5wx06Sb6GBp6uQA5yqQyXZnXOJw==", "dev": true, "requires": { "command-exists": "^1.2.8", @@ -34182,22 +29316,16 @@ "dependencies": { "commander": { "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", "dev": true }, "semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true } } }, "sonic-boom": { "version": "0.7.7", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-0.7.7.tgz", - "integrity": "sha512-Ei5YOo5J64GKClHIL/5evJPgASXFVpfVYbJV9PILZQytTK6/LCwHvsZJW2Ig4p9FMC2OrBrMnXKgRN/OEoAWfg==", "dev": true, "requires": { "atomic-sleep": "^1.0.0", @@ -34206,14 +29334,10 @@ }, "source-map": { "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, "source-map-support": { "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -34222,22 +29346,16 @@ "dependencies": { "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, "sourcemap-codec": { "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, "spawn-wrap": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", "dev": true, "requires": { "foreground-child": "^2.0.0", @@ -34250,8 +29368,6 @@ "dependencies": { "make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -34259,8 +29375,6 @@ }, "rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -34268,8 +29382,6 @@ }, "which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -34279,8 +29391,6 @@ }, "split2": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", - "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", "dev": true, "requires": { "readable-stream": "^3.0.0" @@ -34288,14 +29398,10 @@ }, "sprintf-js": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, "sshpk": { "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -34309,21 +29415,15 @@ }, "dependencies": { "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "version": "0.1.1" } } }, "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" + "version": "0.0.10" }, "standard": { "version": "10.0.3", - "resolved": "https://registry.npmjs.org/standard/-/standard-10.0.3.tgz", - "integrity": "sha512-JURZ+85ExKLQULckDFijdX5WHzN6RC7fgiZNSV4jFQVo+3tPoQGHyBrGekye/yf0aOfb4210EM5qPNlc2cRh4w==", "dev": true, "requires": { "eslint": "~3.19.0", @@ -34339,14 +29439,10 @@ "dependencies": { "acorn": { "version": "5.7.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", "dev": true }, "acorn-jsx": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { "acorn": "^3.0.4" @@ -34354,16 +29450,12 @@ "dependencies": { "acorn": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", "dev": true } } }, "ajv": { "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "dev": true, "requires": { "co": "^4.6.0", @@ -34372,33 +29464,23 @@ }, "ajv-keywords": { "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", "dev": true, "requires": {} }, "ansi-escapes": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", "dev": true }, "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, "chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { "ansi-styles": "^2.2.1", @@ -34410,8 +29492,6 @@ }, "cli-cursor": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", "dev": true, "requires": { "restore-cursor": "^1.0.1" @@ -34419,14 +29499,10 @@ }, "cli-width": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -34434,8 +29510,6 @@ }, "doctrine": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -34443,8 +29517,6 @@ }, "eslint": { "version": "3.19.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", - "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", "dev": true, "requires": { "babel-code-frame": "^6.16.0", @@ -34486,22 +29558,16 @@ }, "eslint-config-standard": { "version": "10.2.1", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz", - "integrity": "sha1-wGHk0GbzedwXzVYsZOgZtN1FRZE=", "dev": true, "requires": {} }, "eslint-config-standard-jsx": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-4.0.2.tgz", - "integrity": "sha512-F8fRh2WFnTek7dZH9ZaE0PCBwdVGkwVWZmizla/DDNOmg7Tx6B/IlK5+oYpiX29jpu73LszeJj5i1axEZv6VMw==", "dev": true, "requires": {} }, "eslint-plugin-import": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.2.0.tgz", - "integrity": "sha1-crowb60wXWfEgWNIpGmaQimsi04=", "dev": true, "requires": { "builtin-modules": "^1.1.1", @@ -34518,8 +29584,6 @@ "dependencies": { "doctrine": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { "esutils": "^2.0.2", @@ -34530,8 +29594,6 @@ }, "eslint-plugin-react": { "version": "6.10.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz", - "integrity": "sha1-xUNb6wZ3ThLH2y9qut3L+QDNP3g=", "dev": true, "requires": { "array.prototype.find": "^2.0.1", @@ -34543,8 +29605,6 @@ "dependencies": { "doctrine": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { "esutils": "^2.0.2", @@ -34555,8 +29615,6 @@ }, "espree": { "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { "acorn": "^5.5.0", @@ -34565,8 +29623,6 @@ }, "figures": { "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "dev": true, "requires": { "escape-string-regexp": "^1.0.5", @@ -34575,8 +29631,6 @@ }, "file-entry-cache": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { "flat-cache": "^1.2.1", @@ -34585,8 +29639,6 @@ }, "flat-cache": { "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", "dev": true, "requires": { "circular-json": "^0.3.1", @@ -34597,20 +29649,14 @@ }, "globals": { "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, "ignore": { "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true }, "inquirer": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", - "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", "dev": true, "requires": { "ansi-escapes": "^1.1.0", @@ -34630,8 +29676,6 @@ }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -34639,14 +29683,10 @@ }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "json-stable-stringify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "dev": true, "requires": { "jsonify": "~0.0.0" @@ -34654,26 +29694,18 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, "onetime": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", "dev": true }, "progress": { "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", "dev": true }, "restore-cursor": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", "dev": true, "requires": { "exit-hook": "^1.0.0", @@ -34682,8 +29714,6 @@ }, "run-async": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", - "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", "dev": true, "requires": { "once": "^1.3.0" @@ -34691,14 +29721,10 @@ }, "slice-ansi": { "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -34708,8 +29734,6 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -34717,26 +29741,18 @@ }, "strip-bom": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, "strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, "supports-color": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, "table": { "version": "3.8.3", - "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", - "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", "dev": true, "requires": { "ajv": "^4.7.0", @@ -34748,21 +29764,15 @@ }, "dependencies": { "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "version": "3.0.0", "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "string-width": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -34771,8 +29781,6 @@ }, "strip-ansi": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { "ansi-regex": "^3.0.0" @@ -34782,8 +29790,6 @@ }, "write": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", "dev": true, "requires": { "mkdirp": "^0.5.1" @@ -34793,8 +29799,6 @@ }, "standard-engine": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-7.0.0.tgz", - "integrity": "sha1-67d7nI/CyBZf+jU72Rug3/Qa9pA=", "dev": true, "requires": { "deglob": "^2.1.0", @@ -34805,27 +29809,19 @@ "dependencies": { "get-stdin": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", - "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", "dev": true } } }, "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + "version": "1.5.0" }, "stealthy-require": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, "stream-browserify": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", - "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", "dev": true, "requires": { "inherits": "~2.0.4", @@ -34834,8 +29830,6 @@ }, "stream-combiner2": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", "dev": true, "requires": { "duplexer2": "~0.1.0", @@ -34844,14 +29838,10 @@ "dependencies": { "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -34865,14 +29855,10 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -34882,8 +29868,6 @@ }, "stream-http": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", - "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", "dev": true, "requires": { "builtin-status-codes": "^3.0.0", @@ -34894,14 +29878,10 @@ }, "stream-shift": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, "stream-splicer": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz", - "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==", "dev": true, "requires": { "inherits": "^2.0.1", @@ -34910,14 +29890,10 @@ "dependencies": { "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -34931,14 +29907,10 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -34948,21 +29920,15 @@ }, "stream-to-it": { "version": "0.2.4", - "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-0.2.4.tgz", - "integrity": "sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ==", "requires": { "get-iterator": "^1.0.2" } }, "streaming-iterables": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/streaming-iterables/-/streaming-iterables-5.0.4.tgz", - "integrity": "sha512-nEs6hBGIPsVz6uq6pscGGKfoPDQWrDQW0b0UHurtSDysekfKLmkPg7FQVRE2sj3Rad6yUo9E1sGTxOWyYsHQ/g==" + "version": "5.0.4" }, "streamroller": { "version": "3.0.6", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.6.tgz", - "integrity": "sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg==", "dev": true, "requires": { "date-format": "^4.0.6", @@ -34972,16 +29938,12 @@ }, "string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "requires": { "safe-buffer": "~5.2.0" } }, "string-width": { "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -34989,14 +29951,10 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "version": "5.0.1" }, "strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "requires": { "ansi-regex": "^5.0.1" } @@ -35005,8 +29963,6 @@ }, "string.prototype.trim": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.5.tgz", - "integrity": "sha512-Lnh17webJVsD6ECeovpVN17RlAKjmz4rF9S+8Y45CkMc/ufVpTkU3vZIyIC7sllQ1FCvObZnnCdNs/HXTUOTlg==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -35016,8 +29972,6 @@ }, "string.prototype.trimend": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -35025,8 +29979,6 @@ }, "string.prototype.trimstart": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -35034,8 +29986,6 @@ }, "stringify-object-es5": { "version": "2.5.0", - "resolved": "https://registry.npmjs.org/stringify-object-es5/-/stringify-object-es5-2.5.0.tgz", - "integrity": "sha1-BXw8mpChJzObudFwSikLt70KHsU=", "dev": true, "requires": { "is-plain-obj": "^1.0.0", @@ -35044,16 +29994,12 @@ "dependencies": { "is-plain-obj": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", "dev": true } } }, "strip-ansi": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { "ansi-regex": "^4.1.0" @@ -35061,34 +30007,24 @@ }, "strip-bom": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true }, "strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + "version": "2.0.0" }, "strip-json-comments": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, "subarg": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", "dev": true, "requires": { "minimist": "^1.1.0" } }, "superagent": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.1.2.tgz", - "integrity": "sha512-o9/fP6dww7a4xmEF5a484o2rG34UUGo8ztDlv7vbCWuqPhpndMi0f7eXxdlryk5U12Kzy46nh8eNpLAJ93Alsg==", + "version": "7.1.1", "dev": true, "requires": { "component-emitter": "^1.3.0", @@ -35106,8 +30042,6 @@ "dependencies": { "form-data": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, "requires": { "asynckit": "^0.4.0", @@ -35117,17 +30051,20 @@ }, "lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { "yallist": "^4.0.0" } }, + "qs": { + "version": "6.10.3", + "dev": true, + "requires": { + "side-channel": "^1.0.4" + } + }, "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.5", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -35135,16 +30072,12 @@ }, "yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true } } }, "supertest": { "version": "6.2.2", - "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.2.2.tgz", - "integrity": "sha512-wCw9WhAtKJsBvh07RaS+/By91NNE0Wh0DN19/hWPlBOU8tAfOtbZoVSV4xXeoKoxgPx0rx2y+y+8660XtE7jzg==", "dev": true, "requires": { "methods": "^1.1.2", @@ -35153,8 +30086,6 @@ }, "superwstest": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/superwstest/-/superwstest-2.0.1.tgz", - "integrity": "sha512-iE0VPbUKXyanGROaywWtOjctNR4SazpFqcOF68IY7Za2maB+prNaYjQFZsAFC+D1R/fXfHHeC6mnpv5ijq0JkA==", "dev": true, "requires": { "@types/supertest": "<7", @@ -35164,28 +30095,20 @@ }, "supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "requires": { "has-flag": "^4.0.0" } }, "supports-preserve-symlinks-flag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, "symbol-tree": { "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, "syntax-error": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", - "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", "dev": true, "requires": { "acorn-node": "^1.2.0" @@ -35193,8 +30116,6 @@ }, "table": { "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { "ajv": "^6.10.2", @@ -35205,20 +30126,14 @@ "dependencies": { "emoji-regex": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "string-width": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { "emoji-regex": "^7.0.1", @@ -35230,20 +30145,14 @@ }, "tachyons": { "version": "4.12.0", - "resolved": "https://registry.npmjs.org/tachyons/-/tachyons-4.12.0.tgz", - "integrity": "sha512-2nA2IrYFy3raCM9fxJ2KODRGHVSZNTW3BR0YnlGsLUf1DA3pk3YfWZ/DdfbnZK6zLZS+jUenlUGJsKcA5fUiZg==", "dev": true }, "tapable": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true }, "tape": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.15.1.tgz", - "integrity": "sha512-k7F5pyr91n9D/yjSJwbLLYDCrTWXxMSXbbmHX2n334lSIc2rxeXyFkaBv4UuUd2gBYMrAOalPutAiCxC6q1qbw==", + "version": "4.15.0", "dev": true, "requires": { "call-bind": "~1.0.2", @@ -35255,7 +30164,7 @@ "has": "~1.0.3", "inherits": "~2.0.4", "is-regex": "~1.1.4", - "minimist": "~1.2.6", + "minimist": "~1.2.5", "object-inspect": "~1.12.0", "resolve": "~1.22.0", "resumer": "~0.0.0", @@ -35265,8 +30174,6 @@ }, "terser": { "version": "5.12.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", - "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", "dev": true, "requires": { "acorn": "^8.5.0", @@ -35277,28 +30184,20 @@ "dependencies": { "acorn": { "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true }, "commander": { "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "source-map": { "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true } } }, "terser-webpack-plugin": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.1.tgz", - "integrity": "sha512-GvlZdT6wPQKbDNW/GDQzZFg/j4vKU96yl2q6mcUkzKOgW4gwf1Z8cZToUCrz31XHlPWH8MVb1r2tFtdDtTGJ7g==", "dev": true, "requires": { "jest-worker": "^27.4.5", @@ -35310,8 +30209,6 @@ "dependencies": { "schema-utils": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { "@types/json-schema": "^7.0.8", @@ -35321,16 +30218,12 @@ }, "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, "test-exclude": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "requires": { "@istanbuljs/schema": "^0.1.2", @@ -35340,8 +30233,6 @@ }, "testdouble": { "version": "3.16.4", - "resolved": "https://registry.npmjs.org/testdouble/-/testdouble-3.16.4.tgz", - "integrity": "sha512-NM8gzFurcf3tgf9miWx3ussoJWUxtT1MwJ7Xpe+sqJBbiwgqLDBqh64bnuDmGCHqhQ3Vou3Z5HtRjiAs7U/mug==", "dev": true, "requires": { "lodash": "^4.17.15", @@ -35352,39 +30243,27 @@ }, "testdouble-timers": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/testdouble-timers/-/testdouble-timers-0.1.1.tgz", - "integrity": "sha1-o0fs1NZc3jDsN3aXf7gZYVoIr5A=", "dev": true, "requires": { "lolex": "^1.4.0" } }, "text-hex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", - "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" + "version": "1.0.0" }, "text-table": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, "theredoc": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/theredoc/-/theredoc-1.0.0.tgz", - "integrity": "sha512-KU3SA3TjRRM932jpNfD3u4Ec3bSvedyo5ITPI7zgWYnKep7BwQQaxlhI9qbO+lKJoRnoAbEVfMcAHRuKVYikDA==", "dev": true }, "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + "version": "2.3.8" }, "through2": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { "readable-stream": "~2.3.6", @@ -35393,14 +30272,10 @@ "dependencies": { "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "readable-stream": { "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -35414,14 +30289,10 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -35431,8 +30302,6 @@ }, "timeout-abort-controller": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/timeout-abort-controller/-/timeout-abort-controller-1.1.1.tgz", - "integrity": "sha512-BsF9i3NAJag6T0ZEjki9j654zoafI2X6ayuNd6Tp8+Ul6Tr5s4jo973qFeiWrRSweqvskC+AHDKUmIW4b7pdhQ==", "requires": { "abort-controller": "^3.0.0", "retimer": "^2.0.0" @@ -35440,8 +30309,6 @@ }, "timers-browserify": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", "dev": true, "requires": { "process": "~0.11.0" @@ -35449,8 +30316,6 @@ }, "tmp": { "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { "os-tmpdir": "~1.0.2" @@ -35458,49 +30323,35 @@ }, "to-fast-properties": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, "to-regex-range": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { "is-number": "^7.0.0" } }, "toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + "version": "1.0.1" }, "tough-cookie": { "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", "requires": { "psl": "^1.1.28", "punycode": "^2.1.1" }, "dependencies": { "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "version": "2.1.1" } } }, "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + "version": "0.0.3" }, "transform-ast": { "version": "2.4.4", - "resolved": "https://registry.npmjs.org/transform-ast/-/transform-ast-2.4.4.tgz", - "integrity": "sha512-AxjeZAcIOUO2lev2GDe3/xZ1Q0cVGjIMk5IsriTy8zbWlsEnjeB025AhkhBJHoy997mXpLd4R+kRbvnnQVuQHQ==", "dev": true, "requires": { "acorn-node": "^1.3.0", @@ -35514,29 +30365,21 @@ "dependencies": { "is-buffer": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", "dev": true } } }, "triple-beam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", - "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" + "version": "1.3.0" }, "truncate-utf8-bytes": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", - "integrity": "sha1-QFkjkJWS1W94pYGENLC3hInKXys=", "requires": { "utf8-byte-length": "^1.0.1" } }, "ts-node": { "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", - "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, "requires": { "@cspotcode/source-map-support": "0.7.0", @@ -35556,34 +30399,24 @@ "dependencies": { "acorn": { "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true }, "acorn-walk": { "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true } } }, "tslib": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, "tsscmp": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", - "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==", "dev": true }, "tsutils": { "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "requires": { "tslib": "^1.8.1" @@ -35591,33 +30424,23 @@ }, "tty-browserify": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", "dev": true }, "tunnel-agent": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { "safe-buffer": "^5.0.1" } }, "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "version": "0.14.5" }, "type": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", "dev": true }, "type-check": { "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { "prelude-ls": "~1.1.2" @@ -35625,25 +30448,17 @@ }, "type-component": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/type-component/-/type-component-0.0.1.tgz", - "integrity": "sha1-lSpsgcIe/STRPYEdDISYy4YOGVY=", "dev": true }, "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" + "version": "4.0.8" }, "type-fest": { "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true }, "type-is": { "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "requires": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -35651,23 +30466,17 @@ }, "typedarray": { "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, "typedarray-to-buffer": { "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, "requires": { "is-typedarray": "^1.0.0" } }, "typedoc": { - "version": "0.22.15", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.15.tgz", - "integrity": "sha512-CMd1lrqQbFvbx6S9G6fL4HKp3GoIuhujJReWqlIvSb2T26vGai+8Os3Mde7Pn832pXYemd9BMuuYWhFpL5st0Q==", + "version": "0.22.13", "dev": true, "requires": { "glob": "^7.2.0", @@ -35679,8 +30488,6 @@ "dependencies": { "brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { "balanced-match": "^1.0.0" @@ -35688,8 +30495,6 @@ }, "minimatch": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -35698,51 +30503,37 @@ } }, "typedoc-plugin-markdown": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.12.0.tgz", - "integrity": "sha512-yKl7/KWD8nP6Ot6OzMLLc8wBzN3CmkBoI/YQzxT62a9xmDgxyeTxGbHbkUoSzhKFqMI3SR0AqV6prAhVKbYnxw==", + "version": "3.11.14", "dev": true, "requires": { "handlebars": "^4.7.7" } }, "typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "version": "4.6.2", "dev": true }, "ua-parser-js": { "version": "0.7.31", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", - "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==", "dev": true }, "uglify-js": { - "version": "3.15.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.4.tgz", - "integrity": "sha512-vMOPGDuvXecPs34V74qDKk4iJ/SN4vL3Ow/23ixafENYvtrNvtbcgUeugTcUGRGsOF/5fU8/NYSL5Hyb3l1OJA==", + "version": "3.15.3", "dev": true, "optional": true }, "uint8arrays": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.0.0.tgz", - "integrity": "sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA==", "requires": { "multiformats": "^9.4.2" } }, "umd": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", - "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", "dev": true }, "unbox-primitive": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", "requires": { "function-bind": "^1.1.1", "has-bigints": "^1.0.1", @@ -35752,8 +30543,6 @@ }, "undeclared-identifiers": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz", - "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==", "dev": true, "requires": { "acorn-node": "^1.3.0", @@ -35765,56 +30554,38 @@ }, "uniq": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", "dev": true }, "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + "version": "2.0.0" }, "unix-crypt-td-js": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/unix-crypt-td-js/-/unix-crypt-td-js-1.1.4.tgz", - "integrity": "sha512-8rMeVYWSIyccIJscb9NdCfZKSRBKYTeVnwmiRYT2ulE3qd1RaDQ0xQDP+rI3ccIWbhu/zuo5cgN8z73belNZgw==", "dev": true }, "unordered-array-remove": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unordered-array-remove/-/unordered-array-remove-1.0.2.tgz", - "integrity": "sha1-xUbo+I4xegzyZEyX7LV9umbSUO8=" + "version": "1.0.2" }, "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + "version": "1.0.0" }, "upper-case": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", - "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=", "dev": true }, "uri-js": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "requires": { "punycode": "^2.1.0" }, "dependencies": { "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "version": "2.1.1" } } }, "url": { "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", "dev": true, "requires": { "punycode": "1.3.2", @@ -35823,16 +30594,12 @@ "dependencies": { "punycode": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", "dev": true } } }, "ursa-optional": { "version": "0.10.2", - "resolved": "https://registry.npmjs.org/ursa-optional/-/ursa-optional-0.10.2.tgz", - "integrity": "sha512-TKdwuLboBn7M34RcvVTuQyhvrA8gYKapuVdm0nBP0mnBc7oECOfUQZrY91cefL3/nm64ZyrejSRrhTVdX7NG/A==", "requires": { "bindings": "^1.5.0", "nan": "^2.14.2" @@ -35840,22 +30607,16 @@ }, "user-home": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", - "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", "dev": true, "requires": { "os-homedir": "^1.0.0" } }, "utf8-byte-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", - "integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=" + "version": "1.0.4" }, "util": { "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", "dev": true, "requires": { "inherits": "2.0.3" @@ -35863,59 +30624,39 @@ "dependencies": { "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true } } }, "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "version": "1.0.2" }, "util-extend": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz", - "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=", "dev": true }, "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + "version": "1.0.1" }, "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + "version": "8.3.2" }, "v8-compile-cache": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, "v8-compile-cache-lib": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz", - "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==", "dev": true }, "varint": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", - "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==" + "version": "6.0.0" }, "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + "version": "1.1.2" }, "verdaccio": { "version": "4.13.0", - "resolved": "https://registry.npmjs.org/verdaccio/-/verdaccio-4.13.0.tgz", - "integrity": "sha512-kipaE7VeHNKelrbHlO1I7yjh2V97qn9Fg6r3tMyDveTXHwKUcAjynmWOFqKx/a566xJYClKc4t4z6UCVVs3gAQ==", "dev": true, "requires": { "@verdaccio/commons-api": "9.7.1", @@ -35955,14 +30696,10 @@ "dependencies": { "async": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", "dev": true }, "body-parser": { "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "dev": true, "requires": { "bytes": "3.1.0", @@ -35979,8 +30716,6 @@ "dependencies": { "http-errors": { "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "dev": true, "requires": { "depd": "~1.1.2", @@ -35992,49 +30727,31 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "setprototypeof": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true } } }, "bytes": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", "dev": true }, "commander": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", "dev": true }, "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" } }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, "http-errors": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", - "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", "dev": true, "requires": { "depd": "~1.1.2", @@ -36046,8 +30763,6 @@ }, "lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { "yallist": "^4.0.0" @@ -36055,20 +30770,14 @@ }, "marked": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.1.tgz", - "integrity": "sha512-5+/fKgMv2hARmMW7DOpykr2iLhl0NgjyELk5yn92iE7z8Se1IS9n3UsFm86hFXIkvMBmVxki8+ckcpjBeyo/hw==", "dev": true }, "mime": { "version": "2.5.2", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", - "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", "dev": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -36076,8 +30785,6 @@ }, "mkdirp": { "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { "minimist": "^1.2.5" @@ -36085,29 +30792,14 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, "qs": { "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", "dev": true }, "raw-body": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", "dev": true, "requires": { "bytes": "3.1.0", @@ -36118,8 +30810,6 @@ "dependencies": { "http-errors": { "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "dev": true, "requires": { "depd": "~1.1.2", @@ -36131,22 +30821,16 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "setprototypeof": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true } } }, "request": { "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "dev": true, "requires": { "aws-sign2": "~0.7.0", @@ -36173,16 +30857,12 @@ "dependencies": { "qs": { "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "dev": true } } }, "semver": { "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -36190,14 +30870,10 @@ }, "toidentifier": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true }, "tough-cookie": { "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, "requires": { "psl": "^1.1.24", @@ -36206,22 +30882,16 @@ }, "uuid": { "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, "yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true } } }, "verdaccio-audit": { "version": "9.7.3", - "resolved": "https://registry.npmjs.org/verdaccio-audit/-/verdaccio-audit-9.7.3.tgz", - "integrity": "sha512-FDWafgDjvnTbJapQpd0c41FjrecR+iRHrnDi2gkAn4IJpiLCgXC6R5NdkXjDIekKEsou9PyQTsEdoHK7iDx+tQ==", "dev": true, "requires": { "express": "4.17.1", @@ -36230,8 +30900,6 @@ }, "verdaccio-htpasswd": { "version": "9.7.2", - "resolved": "https://registry.npmjs.org/verdaccio-htpasswd/-/verdaccio-htpasswd-9.7.2.tgz", - "integrity": "sha512-c7ZEb7wuce0+4h92w4f1ySMhsIWFs/mlsFjjoqIlY5SBskmQI5RHC7HQglVgFjOMxrWoaaadJ5WGmFV+A/yxPQ==", "dev": true, "requires": { "@verdaccio/file-locking": "^9.7.2", @@ -36241,16 +30909,8 @@ "unix-crypt-td-js": "1.1.4" }, "dependencies": { - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, "http-errors": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", - "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", "dev": true, "requires": { "depd": "~1.1.2", @@ -36262,16 +30922,12 @@ }, "toidentifier": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true } } }, "verror": { "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -36280,32 +30936,22 @@ }, "vm-browserify": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", "dev": true }, "void-elements": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", "dev": true }, "vscode-oniguruma": { "version": "1.6.2", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz", - "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==", "dev": true }, "vscode-textmate": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", - "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", "dev": true }, "w3c-hr-time": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", "dev": true, "requires": { "browser-process-hrtime": "^1.0.0" @@ -36313,16 +30959,12 @@ "dependencies": { "browser-process-hrtime": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true } } }, "w3c-xmlserializer": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz", - "integrity": "sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg==", "dev": true, "requires": { "domexception": "^1.0.1", @@ -36332,8 +30974,6 @@ }, "watchpack": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", - "integrity": "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==", "dev": true, "requires": { "glob-to-regexp": "^0.4.1", @@ -36342,8 +30982,6 @@ }, "wcwidth": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", "dev": true, "requires": { "defaults": "^1.0.3" @@ -36351,8 +30989,6 @@ }, "web-encoding": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", - "integrity": "sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==", "requires": { "@zxing/text-encoding": "0.9.0", "util": "^0.12.3" @@ -36360,8 +30996,6 @@ "dependencies": { "util": { "version": "0.12.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.4.tgz", - "integrity": "sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==", "requires": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -36375,14 +31009,10 @@ }, "webidl-conversions": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", "dev": true }, "webpack": { - "version": "5.72.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.72.0.tgz", - "integrity": "sha512-qmSmbspI0Qo5ld49htys8GY9XhS9CGqFoHTsOVAnjBdg0Zn79y135R+k4IR4rKK6+eKaabMhJwiVB7xw0SJu5w==", + "version": "5.70.0", "dev": true, "requires": { "@types/eslint-scope": "^3.7.3", @@ -36413,27 +31043,19 @@ "dependencies": { "acorn": { "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true }, "acorn-import-assertions": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", "dev": true, "requires": {} }, "events": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true }, "schema-utils": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { "@types/json-schema": "^7.0.8", @@ -36445,8 +31067,6 @@ }, "webpack-cli": { "version": "4.9.2", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.2.tgz", - "integrity": "sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ==", "dev": true, "requires": { "@discoveryjs/json-ext": "^0.5.0", @@ -36465,16 +31085,12 @@ "dependencies": { "commander": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true } } }, "webpack-merge": { "version": "5.8.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", - "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", "dev": true, "requires": { "clone-deep": "^4.0.1", @@ -36483,14 +31099,10 @@ }, "webpack-sources": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", "dev": true }, "whatwg-encoding": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", "dev": true, "requires": { "iconv-lite": "0.4.24" @@ -36498,30 +31110,22 @@ }, "whatwg-mimetype": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", "dev": true }, "whatwg-url": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", "requires": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" }, "dependencies": { "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "version": "3.0.1" } } }, "which": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -36529,8 +31133,6 @@ }, "which-boxed-primitive": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "requires": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -36541,8 +31143,6 @@ }, "which-collection": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", - "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", "dev": true, "requires": { "is-map": "^2.0.1", @@ -36553,20 +31153,14 @@ }, "which-module": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "which-pm-runs": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", - "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", "dev": true }, "which-typed-array": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.7.tgz", - "integrity": "sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw==", "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -36578,14 +31172,10 @@ }, "wildcard": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", - "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", "dev": true }, "winston": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.7.2.tgz", - "integrity": "sha512-QziIqtojHBoyzUOdQvQiar1DH0Xp9nF1A1y7NVy2DGEsz82SBDtOalS0ulTRGVT14xPX3WRWkCsdcJKqNflKng==", + "version": "3.6.0", "requires": { "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", @@ -36600,16 +31190,12 @@ }, "dependencies": { "async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" + "version": "3.2.3" } } }, "winston-daily-rotate-file": { "version": "4.6.1", - "resolved": "https://registry.npmjs.org/winston-daily-rotate-file/-/winston-daily-rotate-file-4.6.1.tgz", - "integrity": "sha512-Ycch4LZmTycbhgiI2eQXBKI1pKcEQgAqmBjyq7/dC6Dk77nasdxvhLKraqTdCw7wNDSs8/M0jXaLATHquG7xYg==", "requires": { "file-stream-rotator": "^0.6.1", "object-hash": "^2.0.1", @@ -36619,8 +31205,6 @@ }, "winston-transport": { "version": "4.5.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", - "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", "requires": { "logform": "^2.3.2", "readable-stream": "^3.6.0", @@ -36629,20 +31213,14 @@ }, "word-wrap": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, "wordwrap": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, "wrap-ansi": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -36650,14 +31228,10 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "version": "5.0.1" }, "strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "requires": { "ansi-regex": "^5.0.1" } @@ -36666,14 +31240,10 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "write": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { "mkdirp": "^0.5.1" @@ -36681,8 +31251,6 @@ }, "write-file-atomic": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, "requires": { "imurmurhash": "^0.1.4", @@ -36693,71 +31261,47 @@ }, "ws": { "version": "7.5.7", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", - "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", "requires": {} }, "xml-name-validator": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", "dev": true }, "xml2js": { "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", "requires": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" + "version": "11.0.1" }, "xmlchars": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, "xor-distance": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/xor-distance/-/xor-distance-2.0.0.tgz", - "integrity": "sha512-AsAqZfPAuWx7qB/0kyRDUEvoU3QKsHWzHU9smFlkaiprEpGfJ/NBbLze2Uq0rdkxCxkNM9uOLvz/KoNBCbZiLQ==" + "version": "2.0.0" }, "xsalsa20": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/xsalsa20/-/xsalsa20-1.2.0.tgz", - "integrity": "sha512-FIr/DEeoHfj7ftfylnoFt3rAIRoWXpx2AoDfrT2qD2wtp7Dp+COajvs/Icb7uHqRW9m60f5iXZwdsJJO3kvb7w==" + "version": "1.2.0" }, "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + "version": "4.0.2" }, "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + "version": "5.0.8" }, "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "version": "3.1.1" }, "yaml": { "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true }, "yargs": { - "version": "17.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", - "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", + "version": "17.4.0", "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -36769,20 +31313,14 @@ } }, "yargs-parser": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", - "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==" + "version": "21.0.1" }, "yn": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true }, "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" + "version": "0.1.0" } } } diff --git a/packages/block/package.json b/packages/block/package.json index 77fecdb4da0..2ea2364033d 100644 --- a/packages/block/package.json +++ b/packages/block/package.json @@ -37,7 +37,8 @@ "merkle-patricia-tree": "^4.2.4", "@ethereumjs/tx": "^3.5.1", "ethereum-cryptography": "^1.0.3", - "ethereumjs-util": "^7.1.4" + "ethereumjs-util": "^7.1.4", + "rlp": "^3.0.0" }, "devDependencies": { "@types/lru-cache": "^5.1.0", diff --git a/packages/block/src/block.ts b/packages/block/src/block.ts index abb3c9b06df..b5b1ae1ef04 100644 --- a/packages/block/src/block.ts +++ b/packages/block/src/block.ts @@ -1,6 +1,7 @@ import { BaseTrie as Trie } from 'merkle-patricia-tree' import { keccak256 } from 'ethereum-cryptography/keccak' -import { rlp, KECCAK256_RLP, bufferToHex, toBuffer } from 'ethereumjs-util' +import { arrToBufArr, bufArrToArr, KECCAK256_RLP, bufferToHex } from 'ethereumjs-util' +import RLP from 'rlp' import Common, { ConsensusType } from '@ethereumjs/common' import { TransactionFactory, @@ -71,7 +72,7 @@ export class Block { * @param opts */ public static fromRLPSerializedBlock(serialized: Buffer, opts?: BlockOptions) { - const values = rlp.decode(serialized) as any as BlockBuffer + const values = arrToBufArr(RLP.decode(Uint8Array.from(serialized))) as BlockBuffer if (!Array.isArray(values)) { throw new Error('Invalid serialized block input. Must be array') @@ -201,7 +202,7 @@ export class Block { * Returns the rlp encoding of the block. */ serialize(): Buffer { - return rlp.encode(this.raw()) + return Buffer.from(RLP.encode(bufArrToArr(this.raw()))) } /** @@ -211,7 +212,7 @@ export class Block { const { transactions, txTrie } = this for (let i = 0; i < transactions.length; i++) { const tx = transactions[i] - const key = rlp.encode(i) + const key = Buffer.from(RLP.encode(i)) const value = tx.serialize() await txTrie.put(key, value) } @@ -322,8 +323,9 @@ export class Block { * Validates the uncle's hash. */ validateUnclesHash(): boolean { - const raw = rlp.encode(this.uncleHeaders.map((uh) => uh.raw())) - return toBuffer(keccak256(raw)).equals(this.header.uncleHash) + const uncles = this.uncleHeaders.map((uh) => uh.raw()) + const raw = RLP.encode(bufArrToArr(uncles)) + return Buffer.from(keccak256(raw)).equals(this.header.uncleHash) } /** diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index ff2763eaf17..d035515567e 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -2,21 +2,23 @@ import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '@eth import { keccak256 } from 'ethereum-cryptography/keccak' import { Address, + arrToBufArr, bigIntToHex, bigIntToUnpaddedBuffer, + bufArrToArr, + bufferToBigInt, + bufferToHex, ecrecover, ecsign, intToBuffer, KECCAK256_RLP_ARRAY, KECCAK256_RLP, - rlp, toBuffer, - zeros, - bufferToHex, - bufferToBigInt, toType, TypeOutput, + zeros, } from 'ethereumjs-util' +import RLP from 'rlp' import { Blockchain, BlockHeaderBuffer, BlockOptions, HeaderData, JsonHeader } from './types' import { CLIQUE_EXTRA_VANITY, @@ -91,7 +93,7 @@ export class BlockHeader { * @param opts */ public static fromRLPSerializedHeader(serialized: Buffer, opts: BlockOptions = {}) { - const values = rlp.decode(serialized) + const values = arrToBufArr(RLP.decode(Uint8Array.from(serialized))) as Buffer[] if (!Array.isArray(values)) { throw new Error('Invalid serialized header input. Must be array') @@ -793,12 +795,12 @@ export class BlockHeader { hash(): Buffer { if (Object.isFrozen(this)) { if (!this.cache.hash) { - this.cache.hash = toBuffer(keccak256(rlp.encode(this.raw()))) + this.cache.hash = Buffer.from(keccak256(RLP.encode(bufArrToArr(this.raw())))) } return this.cache.hash } - return toBuffer(keccak256(rlp.encode(this.raw()))) + return Buffer.from(keccak256(RLP.encode(bufArrToArr(this.raw())))) } /** @@ -824,7 +826,7 @@ export class BlockHeader { this._requireClique('cliqueSigHash') const raw = this.raw() raw[12] = this.extraData.slice(0, this.extraData.length - CLIQUE_EXTRA_SEAL) - return toBuffer(keccak256(rlp.encode(raw))) + return Buffer.from(keccak256(RLP.encode(bufArrToArr(raw)))) } /** @@ -936,7 +938,7 @@ export class BlockHeader { * Returns the rlp encoding of the block header. */ serialize(): Buffer { - return rlp.encode(this.raw()) + return Buffer.from(RLP.encode(bufArrToArr(this.raw()))) } /** diff --git a/packages/block/test/block.spec.ts b/packages/block/test/block.spec.ts index 5175781c7de..cc713e96a2e 100644 --- a/packages/block/test/block.spec.ts +++ b/packages/block/test/block.spec.ts @@ -1,7 +1,8 @@ import tape from 'tape' import { keccak256 } from 'ethereum-cryptography/keccak' import { bytesToHex } from 'ethereum-cryptography/utils' -import { rlp, zeros, toBuffer } from 'ethereumjs-util' +import { bufArrToArr, NestedUint8Array, toBuffer, zeros } from 'ethereumjs-util' +import RLP from 'rlp' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block, BlockBuffer, BlockHeader } from '../src' import blockFromRpc from '../src/from-rpc' @@ -596,7 +597,8 @@ tape('[Block]: block functions', function (t) { common: new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }), }) - forkBlock2HeaderData.uncleHash = '0x' + bytesToHex(keccak256(rlp.encode([uncleHeader.raw()]))) + forkBlock2HeaderData.uncleHash = + '0x' + bytesToHex(keccak256(RLP.encode(bufArrToArr([uncleHeader.raw()])))) const forkBlock_ValidCommon = Block.fromBlockData( { @@ -718,14 +720,14 @@ tape('[Block]: block functions', function (t) { }) t.test('DAO hardfork', function (st) { - const blockData: any = rlp.decode(testDataPreLondon2.blocks[0].rlp) + const blockData = RLP.decode(testDataPreLondon2.blocks[0].rlp) as NestedUint8Array // Set block number from test block to mainnet DAO fork block 1920000 blockData[0][8] = Buffer.from('1D4C00', 'hex') const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Dao }) st.throws( function () { - Block.fromValuesArray(blockData, { common }) + Block.fromValuesArray(blockData as BlockBuffer, { common }) }, /Error: extraData should be 'dao-hard-fork'/, 'should throw on DAO HF block with wrong extra data' @@ -735,7 +737,7 @@ tape('[Block]: block functions', function (t) { blockData[0][12] = Buffer.from('64616f2d686172642d666f726b', 'hex') st.doesNotThrow(function () { - Block.fromValuesArray(blockData, { common }) + Block.fromValuesArray(blockData as BlockBuffer, { common }) }, 'should not throw on DAO HF block with correct extra data') st.end() }) diff --git a/packages/block/test/header.spec.ts b/packages/block/test/header.spec.ts index 167f0f1ffc3..e96b5bd23ea 100644 --- a/packages/block/test/header.spec.ts +++ b/packages/block/test/header.spec.ts @@ -1,5 +1,6 @@ import tape from 'tape' -import { Address, zeros, KECCAK256_RLP, KECCAK256_RLP_ARRAY, rlp } from 'ethereumjs-util' +import { Address, toBuffer, zeros, KECCAK256_RLP, KECCAK256_RLP_ARRAY } from 'ethereumjs-util' +import RLP from 'rlp' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { BlockHeader } from '../src/header' import { Block } from '../src' @@ -79,7 +80,7 @@ tape('[Block]: Header functions', function (t) { t.test('Initialization -> fromRLPSerializedHeader() -> error cases', function (st) { try { - BlockHeader.fromRLPSerializedHeader(rlp.encode('a')) + BlockHeader.fromRLPSerializedHeader(Buffer.from(RLP.encode('a'))) } catch (e: any) { const expectedError = 'Invalid serialized header input. Must be array' st.ok(e.message.includes(expectedError), 'should throw with header as rlp encoded string') @@ -267,7 +268,8 @@ tape('[Block]: Header functions', function (t) { const common = new Common({ chain: Chain.Goerli, hardfork: Hardfork.Istanbul }) const blockchain = new Mockchain() - const block = Block.fromRLPSerializedBlock(testDataPreLondon.genesisRLP, { common }) + const genesisRlp = toBuffer(testDataPreLondon.genesisRLP) + const block = Block.fromRLPSerializedBlock(genesisRlp, { common }) await blockchain.putBlock(block) headerData.number = 1 @@ -348,10 +350,7 @@ tape('[Block]: Header functions', function (t) { '64bf9cc30328b0e42387b3c82c614e6386259136235e20c1357bd11cdee86993', 'hex' ) - const poaBlock = Block.fromRLPSerializedBlock(testDataPreLondon.genesisRLP, { - common, - cliqueSigner, - }) + const poaBlock = Block.fromRLPSerializedBlock(genesisRlp, { common, cliqueSigner }) await poaBlockchain.putBlock(poaBlock) header = BlockHeader.fromHeaderData(headerData, { common, cliqueSigner }) @@ -380,9 +379,9 @@ tape('[Block]: Header functions', function (t) { const bcBlockGasLimitTestData = testData.BlockGasLimit2p63m1 Object.keys(bcBlockGasLimitTestData).forEach((key) => { - const genesisRlp = bcBlockGasLimitTestData[key].genesisRLP + const genesisRlp = toBuffer(bcBlockGasLimitTestData[key].genesisRLP) const parentBlock = Block.fromRLPSerializedBlock(genesisRlp) - const blockRlp = bcBlockGasLimitTestData[key].blocks[0].rlp + const blockRlp = toBuffer(bcBlockGasLimitTestData[key].blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp) st.equal(block.validateGasLimit(parentBlock), true) }) diff --git a/packages/block/test/util.ts b/packages/block/test/util.ts index f21892bfaea..b9dd5eab8c9 100644 --- a/packages/block/test/util.ts +++ b/packages/block/test/util.ts @@ -1,6 +1,7 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' import { keccak256 } from 'ethereum-cryptography/keccak' -import { rlp, toBuffer } from 'ethereumjs-util' +import { bufArrToArr } from 'ethereumjs-util' +import RLP from 'rlp' import { Block, BlockHeader } from '../src' /** @@ -25,6 +26,8 @@ function createBlock( const number = parentBlock.header.number + BigInt(1) const timestamp = parentBlock.header.timestamp + BigInt(1) + const uncleHash = keccak256(RLP.encode(bufArrToArr(uncles.map((uh) => uh.raw())))) + const londonHfBlock = common.hardforkBlock(Hardfork.London) const baseFeePerGas = londonHfBlock && number > londonHfBlock ? parentBlock.header.calcNextBaseFee() : undefined @@ -37,7 +40,7 @@ function createBlock( timestamp, gasLimit: BigInt(5000), extraData: Buffer.from(extraData), - uncleHash: toBuffer(keccak256(rlp.encode(uncles.map((uh) => uh.raw())))), + uncleHash, baseFeePerGas, }, uncleHeaders: uncles, diff --git a/packages/block/tsconfig.prod.json b/packages/block/tsconfig.prod.json index dbc8b066cc2..0f110554481 100644 --- a/packages/block/tsconfig.prod.json +++ b/packages/block/tsconfig.prod.json @@ -8,6 +8,7 @@ }, "include": ["src/**/*.ts"], "references": [ + { "path": "../rlp/tsconfig.prod.json" }, { "path": "../trie/tsconfig.prod.json" }, { "path": "../tx/tsconfig.prod.json" }, { "path": "../util/tsconfig.prod.json" } diff --git a/packages/blockchain/package.json b/packages/blockchain/package.json index a35bb7ff977..4d52794a346 100644 --- a/packages/blockchain/package.json +++ b/packages/blockchain/package.json @@ -40,6 +40,7 @@ "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", "lru-cache": "^5.1.1", + "rlp": "^3.0.0", "semaphore-async-await": "^1.5.1" }, "devDependencies": { diff --git a/packages/blockchain/src/consensus/clique.ts b/packages/blockchain/src/consensus/clique.ts index a939a1011e3..c2eab06c97a 100644 --- a/packages/blockchain/src/consensus/clique.ts +++ b/packages/blockchain/src/consensus/clique.ts @@ -1,6 +1,7 @@ import { debug as createDebugLogger } from 'debug' import { Block, BlockHeader } from '@ethereumjs/block' -import { Address, rlp, bigIntToBuffer, bufferToBigInt } from 'ethereumjs-util' +import { Address, bigIntToBuffer, bufferToBigInt, arrToBufArr, bufArrToArr } from 'ethereumjs-util' +import RLP from 'rlp' import Blockchain from '..' import { Consensus, ConsensusOptions } from './interface' @@ -191,7 +192,11 @@ export class CliqueConsensus implements Consensus { bigIntToBuffer(state[0]), state[1].map((a) => a.toBuffer()), ]) - await this.blockchain.db.put(CLIQUE_SIGNERS_KEY, rlp.encode(formatted), DB_OPTS) + await this.blockchain.db.put( + CLIQUE_SIGNERS_KEY, + Buffer.from(RLP.encode(bufArrToArr(formatted))), + DB_OPTS + ) // Output active signers for debugging purposes let i = 0 for (const signer of this.cliqueActiveSigners()) { @@ -338,7 +343,11 @@ export class CliqueConsensus implements Consensus { bigIntToBuffer(v[0]), [v[1][0].toBuffer(), v[1][1].toBuffer(), v[1][2]], ]) - await this.blockchain.db.put(CLIQUE_VOTES_KEY, rlp.encode(formatted), DB_OPTS) + await this.blockchain.db.put( + CLIQUE_VOTES_KEY, + Buffer.from(RLP.encode(bufArrToArr(formatted))), + DB_OPTS + ) } /** @@ -438,7 +447,11 @@ export class CliqueConsensus implements Consensus { bigIntToBuffer(b[0]), b[1].toBuffer(), ]) - await this.blockchain.db.put(CLIQUE_BLOCK_SIGNERS_SNAPSHOT_KEY, rlp.encode(formatted), DB_OPTS) + await this.blockchain.db.put( + CLIQUE_BLOCK_SIGNERS_SNAPSHOT_KEY, + Buffer.from(RLP.encode(bufArrToArr(formatted))), + DB_OPTS + ) } /** @@ -448,7 +461,7 @@ export class CliqueConsensus implements Consensus { private async getCliqueLatestSignerStates(): Promise { try { const signerStates = await this.blockchain.db.get(CLIQUE_SIGNERS_KEY, DB_OPTS) - const states = (rlp.decode(signerStates)) as [Buffer, Buffer[]] + const states = arrToBufArr(RLP.decode(Uint8Array.from(signerStates))) as [Buffer, Buffer[]] return states.map((state) => { const blockNum = bufferToBigInt(state[0] as Buffer) const addrs = (state[1]).map((buf: Buffer) => new Address(buf)) @@ -469,7 +482,10 @@ export class CliqueConsensus implements Consensus { private async getCliqueLatestVotes(): Promise { try { const signerVotes = await this.blockchain.db.get(CLIQUE_VOTES_KEY, DB_OPTS) - const votes = (rlp.decode(signerVotes)) as [Buffer, [Buffer, Buffer, Buffer]] + const votes = arrToBufArr(RLP.decode(Uint8Array.from(signerVotes))) as [ + Buffer, + [Buffer, Buffer, Buffer] + ] return votes.map((vote) => { const blockNum = bufferToBigInt(vote[0] as Buffer) const signer = new Address((vote[1] as any)[0]) @@ -492,7 +508,7 @@ export class CliqueConsensus implements Consensus { private async getCliqueLatestBlockSigners(): Promise { try { const blockSigners = await this.blockchain.db.get(CLIQUE_BLOCK_SIGNERS_SNAPSHOT_KEY, DB_OPTS) - const signers = (rlp.decode(blockSigners)) as [Buffer, Buffer][] + const signers = arrToBufArr(RLP.decode(Uint8Array.from(blockSigners))) as [Buffer, Buffer][] return signers.map((s) => { const blockNum = bufferToBigInt(s[0] as Buffer) const signer = new Address(s[1] as any) diff --git a/packages/blockchain/src/db/helpers.ts b/packages/blockchain/src/db/helpers.ts index f8ab286ccd7..14c0347e1c1 100644 --- a/packages/blockchain/src/db/helpers.ts +++ b/packages/blockchain/src/db/helpers.ts @@ -1,5 +1,6 @@ import { DBOp, DBTarget } from './operation' -import { rlp } from 'ethereumjs-util' +import { bufArrToArr } from 'ethereumjs-util' +import RLP from 'rlp' import { Block, BlockHeader } from '@ethereumjs/block' import { bufBE8 } from './constants' @@ -9,7 +10,7 @@ import { bufBE8 } from './constants' */ function DBSetTD(TD: bigint, blockNumber: bigint, blockHash: Buffer): DBOp { - return DBOp.set(DBTarget.TotalDifficulty, rlp.encode(TD), { + return DBOp.set(DBTarget.TotalDifficulty, Buffer.from(RLP.encode(TD)), { blockNumber, blockHash, }) @@ -43,7 +44,7 @@ function DBSetBlockOrHeader(blockBody: Block | BlockHeader): DBOp[] { isGenesis || (blockBody instanceof Block && (blockBody.transactions.length || blockBody.uncleHeaders.length)) ) { - const bodyValue = rlp.encode(blockBody.raw().slice(1)) + const bodyValue = Buffer.from(RLP.encode(bufArrToArr(blockBody.raw()).slice(1))) dbOps.push( DBOp.set(DBTarget.Body, bodyValue, { blockNumber, diff --git a/packages/blockchain/src/db/manager.ts b/packages/blockchain/src/db/manager.ts index 52c559266a0..2400a10438d 100644 --- a/packages/blockchain/src/db/manager.ts +++ b/packages/blockchain/src/db/manager.ts @@ -1,4 +1,5 @@ -import { bufferToBigInt, rlp } from 'ethereumjs-util' +import { arrToBufArr, bufferToBigInt } from 'ethereumjs-util' +import RLP from 'rlp' import { Block, BlockHeader, BlockOptions, BlockBuffer, BlockBodyBuffer } from '@ethereumjs/block' import Common from '@ethereumjs/common' import Cache from './cache' @@ -111,7 +112,7 @@ export class DBManager { */ async getBody(blockHash: Buffer, blockNumber: bigint): Promise { const body = await this.get(DBTarget.Body, { blockHash, blockNumber }) - return rlp.decode(body) as any as BlockBodyBuffer + return arrToBufArr(RLP.decode(Uint8Array.from(body))) as BlockBodyBuffer } /** @@ -134,7 +135,7 @@ export class DBManager { */ async getTotalDifficulty(blockHash: Buffer, blockNumber: bigint): Promise { const td = await this.get(DBTarget.TotalDifficulty, { blockHash, blockNumber }) - return bufferToBigInt(rlp.decode(td)) + return bufferToBigInt(Buffer.from(RLP.decode(Uint8Array.from(td)) as Uint8Array)) } /** diff --git a/packages/blockchain/test/util.ts b/packages/blockchain/test/util.ts index 0a5bfc1aed3..356b70475e1 100644 --- a/packages/blockchain/test/util.ts +++ b/packages/blockchain/test/util.ts @@ -1,4 +1,5 @@ -import { rlp, toBuffer } from 'ethereumjs-util' +import { bufArrToArr, toBuffer } from 'ethereumjs-util' +import RLP from 'rlp' import { Block, BlockHeader } from '@ethereumjs/block' import Common, { Chain, Hardfork } from '@ethereumjs/common' import Blockchain from '../src' @@ -155,7 +156,7 @@ export const createTestDB = async () => { ), keyEncoding: 'binary', valueEncoding: 'binary', - value: rlp.encode(toBuffer(17179869184)), + value: Buffer.from(RLP.encode(Uint8Array.from(toBuffer(17179869184)))), }, { type: 'put', @@ -165,7 +166,7 @@ export const createTestDB = async () => { ), keyEncoding: 'binary', valueEncoding: 'binary', - value: rlp.encode(genesis.raw().slice(1)), + value: Buffer.from(RLP.encode(bufArrToArr(genesis.raw()).slice(1))), }, { type: 'put', diff --git a/packages/blockchain/tsconfig.prod.json b/packages/blockchain/tsconfig.prod.json index eb0aa01ce5a..ec1801d1fc5 100644 --- a/packages/blockchain/tsconfig.prod.json +++ b/packages/blockchain/tsconfig.prod.json @@ -11,6 +11,7 @@ "references": [ { "path": "../common/tsconfig.prod.json" }, { "path": "../ethash/tsconfig.prod.json" }, + { "path": "../rlp/tsconfig.prod.json" }, { "path": "../util/tsconfig.prod.json" } ], } diff --git a/packages/client/lib/execution/receipt.ts b/packages/client/lib/execution/receipt.ts index 2b34fadb0a9..2bd3c8ce5c2 100644 --- a/packages/client/lib/execution/receipt.ts +++ b/packages/client/lib/execution/receipt.ts @@ -2,7 +2,15 @@ import { PreByzantiumTxReceipt, PostByzantiumTxReceipt, TxReceipt } from '@ether import { Log } from '@ethereumjs/vm/dist/evm/types' import Bloom from '@ethereumjs/vm/dist/bloom' import { TypedTransaction } from '@ethereumjs/tx' -import { rlp, intToBuffer, bufferToInt, bigIntToBuffer, bufferToBigInt } from 'ethereumjs-util' +import { + arrToBufArr, + bigIntToBuffer, + bufArrToArr, + bufferToBigInt, + bufferToInt, + intToBuffer, +} from 'ethereumjs-util' +import RLP from 'rlp' import { MetaDBManager, DBKey } from './metaDBManager' import type { Block } from '@ethereumjs/block' @@ -298,16 +306,20 @@ export class ReceiptsManager extends MetaDBManager { case RlpType.Receipts: if (conversion === RlpConvert.Encode) { value = value as TxReceipt[] - return rlp.encode( - value.map((r) => [ - (r as PreByzantiumTxReceipt).stateRoot ?? - intToBuffer((r as PostByzantiumTxReceipt).status), - bigIntToBuffer(r.gasUsed), - this.rlp(RlpConvert.Encode, RlpType.Logs, r.logs), - ]) + return Buffer.from( + RLP.encode( + bufArrToArr( + value.map((r) => [ + (r as PreByzantiumTxReceipt).stateRoot ?? + intToBuffer((r as PostByzantiumTxReceipt).status), + bigIntToBuffer(r.gasUsed), + this.rlp(RlpConvert.Encode, RlpType.Logs, r.logs), + ]) + ) + ) ) } else { - const decoded = rlp.decode(value as Buffer) as unknown as rlpReceipt[] + const decoded = arrToBufArr(RLP.decode(Uint8Array.from(value as Buffer))) as rlpReceipt[] return decoded.map((r) => { const gasUsed = r[1] const logs = this.rlp(RlpConvert.Decode, RlpType.Logs, r[2]) @@ -330,16 +342,18 @@ export class ReceiptsManager extends MetaDBManager { } case RlpType.Logs: if (conversion === RlpConvert.Encode) { - return rlp.encode(value as Log[]) + return Buffer.from(RLP.encode(bufArrToArr(value as Log[]))) } else { - return rlp.decode(value as Buffer) as unknown as Log[] + return arrToBufArr(RLP.decode(Uint8Array.from(value as Buffer))) as Log[] } case RlpType.TxHash: if (conversion === RlpConvert.Encode) { const [blockHash, txIndex] = value as TxHashIndex - return rlp.encode([blockHash, intToBuffer(txIndex)]) + return Buffer.from(RLP.encode(bufArrToArr([blockHash, intToBuffer(txIndex)]))) } else { - const [blockHash, txIndex] = rlp.decode(value as Buffer) as unknown as rlpTxHash + const [blockHash, txIndex] = arrToBufArr( + RLP.decode(Uint8Array.from(value as Buffer)) + ) as rlpTxHash return [blockHash, bufferToInt(txIndex)] as TxHashIndex } default: diff --git a/packages/client/lib/net/protocol/ethprotocol.ts b/packages/client/lib/net/protocol/ethprotocol.ts index 7495076121f..a5d143c6db6 100644 --- a/packages/client/lib/net/protocol/ethprotocol.ts +++ b/packages/client/lib/net/protocol/ethprotocol.ts @@ -7,7 +7,14 @@ import { } from '@ethereumjs/block' import { TransactionFactory, TypedTransaction } from '@ethereumjs/tx' import { encodeReceipt } from '@ethereumjs/vm/dist/runBlock' -import { bigIntToBuffer, bufferToBigInt, bufferToInt, rlp } from 'ethereumjs-util' +import { + arrToBufArr, + bigIntToBuffer, + bufArrToArr, + bufferToBigInt, + bufferToInt, +} from 'ethereumjs-util' +import RLP from 'rlp' import { Chain } from './../../blockchain' import { Message, Protocol, ProtocolOptions } from './protocol' import type { TxReceiptWithType } from '../../execution/receipt' @@ -240,7 +247,7 @@ export class EthProtocol extends Protocol { bufferToBigInt(reqId), receipts.map((r) => { // Legacy receipt if r[0] >= 0xc0, otherwise typed receipt with first byte as TransactionType - const decoded = rlp.decode(r[0] >= 0xc0 ? r : r.slice(1)) as any + const decoded = arrToBufArr(RLP.decode(bufArrToArr(r[0] >= 0xc0 ? r : r.slice(1)))) as any const [stateRootOrStatus, cumulativeGasUsed, logsBloom, logs] = decoded const receipt = { gasUsed: bufferToBigInt(cumulativeGasUsed), diff --git a/packages/client/lib/net/protocol/libp2psender.ts b/packages/client/lib/net/protocol/libp2psender.ts index 2f47b9dca9d..070e4c3ecf5 100644 --- a/packages/client/lib/net/protocol/libp2psender.ts +++ b/packages/client/lib/net/protocol/libp2psender.ts @@ -1,7 +1,8 @@ import pipe from 'it-pipe' import pushable from 'it-pushable' +import { arrToBufArr, bufferToInt, bufArrToArr, intToBuffer } from 'ethereumjs-util' +import RLP from 'rlp' import { Libp2pMuxedStream as MuxedStream } from '../../types' -import { bufferToInt, rlp } from 'ethereumjs-util' import { Sender } from './sender' // TypeScript doesn't have support yet for ReturnType @@ -41,7 +42,7 @@ export class Libp2pSender extends Sender { // convert BufferList to Buffer const data: Buffer = bl.slice() try { - const [codeBuf, payload]: any = rlp.decode(data) + const [codeBuf, payload]: any = arrToBufArr(RLP.decode(Uint8Array.from(data))) const code = bufferToInt(codeBuf) if (code === 0) { const status: any = {} @@ -64,8 +65,8 @@ export class Libp2pSender extends Sender { * @param status */ sendStatus(status: any) { - const payload: any = Object.entries(status).map(([k, v]) => [k, v]) - this.pushable.push(rlp.encode([0, payload])) + const payload: any = Object.entries(status).map(([k, v]) => [Buffer.from(k), v]) + this.pushable.push(Buffer.from(RLP.encode(bufArrToArr([intToBuffer(0), payload])))) } /** @@ -74,6 +75,6 @@ export class Libp2pSender extends Sender { * @param data message payload */ sendMessage(code: number, data: any) { - this.pushable.push(rlp.encode([code, data])) + this.pushable.push(Buffer.from(RLP.encode(bufArrToArr([intToBuffer(code), data])))) } } diff --git a/packages/client/lib/rpc/modules/engine.ts b/packages/client/lib/rpc/modules/engine.ts index a8a7011ad15..8fdd7c2423c 100644 --- a/packages/client/lib/rpc/modules/engine.ts +++ b/packages/client/lib/rpc/modules/engine.ts @@ -1,6 +1,7 @@ import { Block, HeaderData } from '@ethereumjs/block' import { TransactionFactory, TypedTransaction } from '@ethereumjs/tx' -import { toBuffer, bufferToHex, rlp, zeros } from 'ethereumjs-util' +import { bufferToHex, toBuffer, zeros } from 'ethereumjs-util' +import RLP from 'rlp' import { BaseTrie as Trie } from 'merkle-patricia-tree' import { Hardfork } from '@ethereumjs/common' @@ -130,7 +131,7 @@ const recursivelyFindParents = async (vmHeadHash: Buffer, parentHash: Buffer, ch const txsTrieRoot = async (txs: TypedTransaction[]) => { const trie = new Trie() for (const [i, tx] of txs.entries()) { - await trie.put(rlp.encode(i), tx.serialize()) + await trie.put(Buffer.from(RLP.encode(i)), tx.serialize()) } return trie.root } diff --git a/packages/client/lib/rpc/modules/eth.ts b/packages/client/lib/rpc/modules/eth.ts index 2bc02ad9b28..84495fdfa2b 100644 --- a/packages/client/lib/rpc/modules/eth.ts +++ b/packages/client/lib/rpc/modules/eth.ts @@ -14,12 +14,12 @@ import { bufferToHex, bigIntToHex, intToHex, - rlp, toBuffer, setLengthLeft, toType, TypeOutput, } from 'ethereumjs-util' +import RLP from 'rlp' import { middleware, validators } from '../validation' import { INTERNAL_ERROR, INVALID_PARAMS, PARSE_ERROR } from '../error-code' import { RpcTx } from '../types' @@ -662,7 +662,11 @@ export class Eth { const storageTrie = await (vm.stateManager as any)._getStorageTrie(address) const position = setLengthLeft(toBuffer(positionHex), 32) const storage = await storageTrie.get(position) - return storage ? bufferToHex(setLengthLeft(rlp.decode(storage), 32)) : '0x' + return storage + ? bufferToHex( + setLengthLeft(Buffer.from(RLP.decode(Uint8Array.from(storage)) as Uint8Array), 32) + ) + : '0x' } /** diff --git a/packages/client/lib/util/parse.ts b/packages/client/lib/util/parse.ts index af3a6a32148..d333ab893a7 100644 --- a/packages/client/lib/util/parse.ts +++ b/packages/client/lib/util/parse.ts @@ -6,16 +6,16 @@ import { keccak256 } from 'ethereum-cryptography/keccak' import { SecureTrie as Trie } from 'merkle-patricia-tree' import { Account, - rlp, - toBuffer, - unpadBuffer, - isHexPrefixed, - stripHexPrefix, + addHexPrefix, bigIntToHex, bufferToHex, - addHexPrefix, intToHex, + isHexPrefixed, + stripHexPrefix, + toBuffer, + unpadBuffer, } from 'ethereumjs-util' +import RLP from 'rlp' import type { MultiaddrLike } from '../types' import type { GenesisState } from '@ethereumjs/common/dist/types' @@ -98,8 +98,12 @@ async function createStorageTrie(storage: any) { const trie = new Trie() for (const [address, value] of Object.entries(storage) as unknown as [string, string]) { const key = isHexPrefixed(address) ? toBuffer(address) : Buffer.from(address, 'hex') - const val = rlp.encode( - unpadBuffer(isHexPrefixed(value) ? toBuffer(value) : Buffer.from(value, 'hex')) + const val = Buffer.from( + RLP.encode( + Uint8Array.from( + unpadBuffer(isHexPrefixed(value) ? toBuffer(value) : Buffer.from(value, 'hex')) + ) + ) ) await trie.put(key, val) } @@ -121,7 +125,7 @@ async function createGethGenesisStateTrie(alloc: any) { account.balance = BigInt(balance) } if (code) { - account.codeHash = toBuffer(keccak256(toBuffer(code))) + account.codeHash = Buffer.from(keccak256(toBuffer(code))) } if (storage) { const storageTrie = await createStorageTrie(storage) diff --git a/packages/client/package.json b/packages/client/package.json index 4304ea9ae7a..170d006cb82 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -83,6 +83,7 @@ "multiaddr": "^10.0.1", "peer-id": "^0.14.3", "qheap": "^1.4.0", + "rlp": "^3.0.0", "winston": "^3.3.3", "winston-daily-rotate-file": "^4.5.5", "yargs": "^17.2.1" diff --git a/packages/client/test/net/protocol/libp2psender.spec.ts b/packages/client/test/net/protocol/libp2psender.spec.ts index 8e887790571..04dc97f5ad3 100644 --- a/packages/client/test/net/protocol/libp2psender.spec.ts +++ b/packages/client/test/net/protocol/libp2psender.spec.ts @@ -12,7 +12,7 @@ tape('[Libp2pSender]', (t) => { t.equal(receiver.status.id.toString('hex'), '05', 'status getter') t.end() }) - sender.sendStatus({ id: 5 }) + sender.sendStatus({ id: Buffer.from('05', 'hex') }) }) t.test('should send/receive message', (t) => { @@ -24,7 +24,7 @@ tape('[Libp2pSender]', (t) => { t.equal(message.payload.toString('hex'), '05', 'message received (payload)') t.end() }) - sender.sendMessage(1, 5) + sender.sendMessage(1, Buffer.from('05', 'hex')) }) t.test('should catch errors', (t) => { diff --git a/packages/client/tsconfig.prod.json b/packages/client/tsconfig.prod.json index cd62f7b86a6..719fc15570c 100644 --- a/packages/client/tsconfig.prod.json +++ b/packages/client/tsconfig.prod.json @@ -10,6 +10,7 @@ { "path": "../blockchain/tsconfig.prod.json" }, { "path": "../common/tsconfig.prod.json" }, { "path": "../devp2p/tsconfig.prod.json" }, + { "path": "../rlp/tsconfig.prod.json" }, { "path": "../trie/tsconfig.prod.json" }, { "path": "../tx/tsconfig.prod.json" }, { "path": "../util/tsconfig.prod.json" }, diff --git a/packages/devp2p/examples/peer-communication.ts b/packages/devp2p/examples/peer-communication.ts index 6c9b8c1336c..4ffeebaeaa1 100644 --- a/packages/devp2p/examples/peer-communication.ts +++ b/packages/devp2p/examples/peer-communication.ts @@ -3,10 +3,11 @@ import { randomBytes } from 'crypto' import LRUCache from 'lru-cache' import ms from 'ms' import chalk from 'chalk' -import { rlp } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { TypedTransaction, TransactionFactory } from '@ethereumjs/tx' import { Block, BlockHeader } from '@ethereumjs/block' +import { arrToBufArr } from 'ethereumjs-util' +import RLP from 'rlp' import * as devp2p from '../src/index' import { ETH, Peer } from '../src/index' @@ -36,10 +37,9 @@ const REMOTE_CLIENTID_FILTER = [ const CHECK_BLOCK_TITLE = 'Berlin Fork' // Only for debugging/console output const CHECK_BLOCK_NR = 12244000 const CHECK_BLOCK = '1638380ab737e0e916bd1c7f23bd2bab2a532e44b90047f045f262ee21c42b21' -const CHECK_BLOCK_HEADER = rlp.decode( - Buffer.from( - 'f90219a0d44a4d33e28d7ea9edd12b69bd32b394587eee498b0e2543ce2bad1877ffbeaca01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347941ad91ee08f21be3de0ba2ba6918e714da6b45836a0fdec060ee45e55da9e36060fc95dddd0bdc47e447224666a895d9f0dc9adaa0ca0092d9fcc02ca9b372daec726704ce720d3aa366739868f4820ecaabadb9ac309a0974fee017515a46303f467b6fd50872994db1b0ea64d3455bad93ff9678aced9b90100356050004c5c89691add79838a01d4c302419252a4d3c96e9273908b7ee84660886c070607b4928c416a1800746a0d1dbb442d0baf06eea321422263726748600cc200e82aec08336863514d12d665718016989189c116bc0947046cc6718110586c11464a189000a11a41cc96991970153d88840768170244197e164c6204249b9091a0052ac85088c8108a4418dd2903690a036722623888ea14e90458a390a305a2342cb02766094f68c4100036330719848b48411614686717ab6068a46318204232429dc42020608802ceecd66c3c33a3a1fc6e82522049470328a4a81ba07c6604228ba94f008476005087a6804463696b41002650c0fdf548448a90408717ca31b6d618e883bad42083be153b83bdfbb1846078104798307834383639373636353666366532303530366636663663a0ae1de0acd35a98e211c7e276ad7524bb84a5e1b8d33dd7d1c052b095b564e8b888cca66773148b6e12', - 'hex' +const CHECK_BLOCK_HEADER = arrToBufArr( + RLP.decode( + '0xf90219a0d44a4d33e28d7ea9edd12b69bd32b394587eee498b0e2543ce2bad1877ffbeaca01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347941ad91ee08f21be3de0ba2ba6918e714da6b45836a0fdec060ee45e55da9e36060fc95dddd0bdc47e447224666a895d9f0dc9adaa0ca0092d9fcc02ca9b372daec726704ce720d3aa366739868f4820ecaabadb9ac309a0974fee017515a46303f467b6fd50872994db1b0ea64d3455bad93ff9678aced9b90100356050004c5c89691add79838a01d4c302419252a4d3c96e9273908b7ee84660886c070607b4928c416a1800746a0d1dbb442d0baf06eea321422263726748600cc200e82aec08336863514d12d665718016989189c116bc0947046cc6718110586c11464a189000a11a41cc96991970153d88840768170244197e164c6204249b9091a0052ac85088c8108a4418dd2903690a036722623888ea14e90458a390a305a2342cb02766094f68c4100036330719848b48411614686717ab6068a46318204232429dc42020608802ceecd66c3c33a3a1fc6e82522049470328a4a81ba07c6604228ba94f008476005087a6804463696b41002650c0fdf548448a90408717ca31b6d618e883bad42083be153b83bdfbb1846078104798307834383639373636353666366532303530366636663663a0ae1de0acd35a98e211c7e276ad7524bb84a5e1b8d33dd7d1c052b095b564e8b888cca66773148b6e12' ) ) diff --git a/packages/devp2p/package.json b/packages/devp2p/package.json index 00b6fa159be..d59383938f2 100644 --- a/packages/devp2p/package.json +++ b/packages/devp2p/package.json @@ -57,6 +57,7 @@ "lru-cache": "^5.1.1", "ms": "^0.7.1", "multiaddr": "^10.0.1", + "rlp": "^3.0.0", "scanf": "^1.1.2", "secp256k1": "^4.0.2", "snappyjs": "^0.6.1" diff --git a/packages/devp2p/src/dns/enr.ts b/packages/devp2p/src/dns/enr.ts index d9edf08b71b..aea361f2222 100644 --- a/packages/devp2p/src/dns/enr.ts +++ b/packages/devp2p/src/dns/enr.ts @@ -1,10 +1,11 @@ import assert from 'assert' import * as base32 from 'hi-base32' -import { rlp } from 'ethereumjs-util' import { sscanf } from 'scanf' import { ecdsaVerify } from 'secp256k1' import { Multiaddr } from 'multiaddr' import base64url from 'base64url' +import { arrToBufArr, bufArrToArr } from 'ethereumjs-util' +import RLP from 'rlp' import { PeerInfo } from '../dpt' import { toNewUint8Array, keccak256 } from '../util' @@ -55,7 +56,7 @@ export class ENR { // ENRs are RLP encoded and written to DNS TXT entries as base64 url-safe strings const base64BufferEnr = base64url.toBuffer(enr.slice(this.RECORD_PREFIX.length)) - const decoded = rlp.decode(base64BufferEnr) as unknown as Buffer[] + const decoded = arrToBufArr(RLP.decode(Uint8Array.from(base64BufferEnr))) as Buffer[] const [signature, seq, ...kvs] = decoded // Convert ENR key/value pairs to object @@ -66,7 +67,11 @@ export class ENR { } // Validate sig - const isVerified = ecdsaVerify(signature, keccak256(rlp.encode([seq, ...kvs])), obj.secp256k1) + const isVerified = ecdsaVerify( + signature, + keccak256(Buffer.from(RLP.encode(bufArrToArr([seq, ...kvs])))), + obj.secp256k1 + ) assert(isVerified, 'Unable to verify ENR signature') diff --git a/packages/devp2p/src/dpt/message.ts b/packages/devp2p/src/dpt/message.ts index 1560f131f09..680b5e1352f 100644 --- a/packages/devp2p/src/dpt/message.ts +++ b/packages/devp2p/src/dpt/message.ts @@ -1,7 +1,8 @@ import { debug as createDebugLogger } from 'debug' import ip from 'ip' -import { rlp } from 'ethereumjs-util' import secp256k1 from 'secp256k1' +import { bufArrToArr } from 'ethereumjs-util' +import RLP from 'rlp' import { keccak256, int2buffer, buffer2int, assertEq, unstrictDecode } from '../util' import { PeerInfo } from './dpt' @@ -169,7 +170,10 @@ export function encode(typename: string, data: T, privateKey: Buffer) { const type: number = types.byName[typename] as number if (type === undefined) throw new Error(`Invalid typename: ${typename}`) const encodedMsg = messages[typename].encode(data) - const typedata = Buffer.concat([Buffer.from([type]), rlp.encode(encodedMsg)]) + const typedata = Buffer.concat([ + Buffer.from([type]), + Buffer.from(RLP.encode(bufArrToArr(encodedMsg))), + ]) const sighash = keccak256(typedata) const sig = secp256k1.ecdsaSign(sighash, privateKey) diff --git a/packages/devp2p/src/protocol/eth.ts b/packages/devp2p/src/protocol/eth.ts index 348ad987076..a37b1cef673 100644 --- a/packages/devp2p/src/protocol/eth.ts +++ b/packages/devp2p/src/protocol/eth.ts @@ -1,6 +1,13 @@ import assert from 'assert' import snappy from 'snappyjs' -import { bufferToBigInt, bufferToHex, rlp, bigIntToBuffer } from 'ethereumjs-util' +import { + arrToBufArr, + bigIntToBuffer, + bufArrToArr, + bufferToBigInt, + bufferToHex, +} from 'ethereumjs-util' +import RLP from 'rlp' import { int2buffer, buffer2int, assertEq, formatLogId, formatLogData } from '../util' import { Peer } from '../rlpx/peer' import { EthProtocol, Protocol, SendMethod } from './protocol' @@ -38,7 +45,7 @@ export class ETH extends Protocol { static eth66 = { name: 'eth', version: 66, length: 29, constructor: ETH } _handleMessage(code: ETH.MESSAGE_CODES, data: any) { - const payload = rlp.decode(data) as unknown + const payload = arrToBufArr(RLP.decode(bufArrToArr(data))) const messageName = this.getMsgPrefix(code) const debugMsg = `Received ${messageName} message from ${this._peer._socket.remoteAddress}:${this._peer._socket.remotePort}` @@ -246,7 +253,7 @@ export class ETH extends Protocol { } (eth${this._version}): ${this._getStatusString(this._status)}` ) - let payload = rlp.encode(this._status as any) + let payload = Buffer.from(RLP.encode(bufArrToArr(this._status))) // Use snappy compression if peer supports DevP2P >=v5 if (this._peer._hello?.protocolVersion && this._peer._hello?.protocolVersion >= 5) { @@ -259,7 +266,10 @@ export class ETH extends Protocol { sendMessage(code: ETH.MESSAGE_CODES, payload: any) { const messageName = this.getMsgPrefix(code) - const logData = formatLogData(rlp.encode(payload).toString('hex'), this._verbose) + const logData = formatLogData( + Buffer.from(RLP.encode(bufArrToArr(payload))).toString('hex'), + this._verbose + ) const debugMsg = `Send ${messageName} message to ${this._peer._socket.remoteAddress}:${this._peer._socket.remotePort}: ${logData}` this.debug(messageName, debugMsg) @@ -295,7 +305,7 @@ export class ETH extends Protocol { throw new Error(`Unknown code ${code}`) } - payload = rlp.encode(payload) + payload = Buffer.from(RLP.encode(bufArrToArr(payload))) // Use snappy compression if peer supports DevP2P >=v5 if (this._peer._hello?.protocolVersion && this._peer._hello?.protocolVersion >= 5) { diff --git a/packages/devp2p/src/protocol/les.ts b/packages/devp2p/src/protocol/les.ts index 2c5bc46165f..1c1d6e80467 100644 --- a/packages/devp2p/src/protocol/les.ts +++ b/packages/devp2p/src/protocol/les.ts @@ -1,4 +1,5 @@ -import { bigIntToBuffer, rlp } from 'ethereumjs-util' +import { arrToBufArr, bigIntToBuffer, bufArrToArr } from 'ethereumjs-util' +import RLP from 'rlp' import ms from 'ms' import snappy from 'snappyjs' import { int2buffer, buffer2int, assertEq, formatLogData } from '../util' @@ -24,7 +25,7 @@ export class LES extends Protocol { static les4 = { name: 'les', version: 4, length: 23, constructor: LES } _handleMessage(code: LES.MESSAGE_CODES, data: any) { - const payload = rlp.decode(data) + const payload = arrToBufArr(RLP.decode(bufArrToArr(data))) const messageName = this.getMsgPrefix(code) const debugMsg = `Received ${messageName} message from ${this._peer._socket.remoteAddress}:${this._peer._socket.remotePort}` @@ -160,7 +161,7 @@ export class LES extends Protocol { const statusList: any[][] = [] Object.keys(status).forEach((key) => { - statusList.push([key, status[key]]) + statusList.push([Buffer.from(key), status[key]]) }) this.debug( @@ -170,7 +171,7 @@ export class LES extends Protocol { } (les${this._version}): ${this._getStatusString(this._status)}` ) - let payload = rlp.encode(statusList) + let payload = Buffer.from(RLP.encode(bufArrToArr(statusList))) // Use snappy compression if peer supports DevP2P >=v5 if (this._peer._hello?.protocolVersion && this._peer._hello?.protocolVersion >= 5) { @@ -188,7 +189,10 @@ export class LES extends Protocol { */ sendMessage(code: LES.MESSAGE_CODES, payload: any) { const messageName = this.getMsgPrefix(code) - const logData = formatLogData(rlp.encode(payload).toString('hex'), this._verbose) + const logData = formatLogData( + Buffer.from(RLP.encode(bufArrToArr(payload))).toString('hex'), + this._verbose + ) const debugMsg = `Send ${messageName} message to ${this._peer._socket.remoteAddress}:${this._peer._socket.remotePort}: ${logData}` this.debug(messageName, debugMsg) @@ -230,7 +234,7 @@ export class LES extends Protocol { throw new Error(`Unknown code ${code}`) } - payload = rlp.encode(payload) + payload = Buffer.from(RLP.encode(payload)) // Use snappy compression if peer supports DevP2P >=v5 if (this._peer._hello?.protocolVersion && this._peer._hello?.protocolVersion >= 5) { diff --git a/packages/devp2p/src/rlpx/ecies.ts b/packages/devp2p/src/rlpx/ecies.ts index cbd2c3e990b..eb8f5c14313 100644 --- a/packages/devp2p/src/rlpx/ecies.ts +++ b/packages/devp2p/src/rlpx/ecies.ts @@ -1,7 +1,8 @@ import crypto, { Decipher } from 'crypto' import { debug as createDebugLogger } from 'debug' import { publicKeyCreate, ecdh, ecdsaRecover, ecdsaSign } from 'secp256k1' -import { rlp } from 'ethereumjs-util' +import { bufArrToArr } from 'ethereumjs-util' +import RLP from 'rlp' import { unstrictDecode } from '../util' import { MAC } from './mac' @@ -180,7 +181,7 @@ export class ECIES { Buffer.from([0x04]), ] - const dataRLP = rlp.encode(data) + const dataRLP = Buffer.from(RLP.encode(bufArrToArr(data))) const pad = crypto.randomBytes(100 + Math.floor(Math.random() * 151)) // Random padding between 100, 250 const authMsg = Buffer.concat([dataRLP, pad]) const overheadLength = 113 @@ -269,7 +270,7 @@ export class ECIES { createAckEIP8(): Buffer | undefined { const data = [pk2id(this._ephemeralPublicKey), this._nonce, Buffer.from([0x04])] - const dataRLP = rlp.encode(data) + const dataRLP = Buffer.from(RLP.encode(bufArrToArr(data))) const pad = crypto.randomBytes(100 + Math.floor(Math.random() * 151)) // Random padding between 100, 250 const ackMsg = Buffer.concat([dataRLP, pad]) const overheadLength = 113 @@ -331,7 +332,8 @@ export class ECIES { createHeader(size: number): Buffer | undefined { const bufSize = zfill(int2buffer(size), 3) - let header = Buffer.concat([bufSize, rlp.encode([0, 0])]) // TODO: the rlp will contain something else someday + const headerData = Buffer.from(RLP.encode([0, 0])) // [capability-id, context-id] (currently unused in spec) + let header = Buffer.concat([bufSize, headerData]) header = zfill(header, 16, false) if (!this._egressAes) return header = this._egressAes.update(header) diff --git a/packages/devp2p/src/rlpx/peer.ts b/packages/devp2p/src/rlpx/peer.ts index 934593e2999..a14c6df1030 100644 --- a/packages/devp2p/src/rlpx/peer.ts +++ b/packages/devp2p/src/rlpx/peer.ts @@ -6,7 +6,8 @@ import snappy from 'snappyjs' import { debug as createDebugLogger, Debugger } from 'debug' import { devp2pDebug } from '../util' import Common from '@ethereumjs/common' -import { rlp } from 'ethereumjs-util' +import { arrToBufArr, bufArrToArr } from 'ethereumjs-util' +import RLP from 'rlp' import { ETH, LES } from '../' import { int2buffer, buffer2int, formatLogData } from '../util' import { ECIES } from './ecies' @@ -206,7 +207,7 @@ export class Peer extends EventEmitter { _sendMessage(code: number, data: Buffer) { if (this._closed) return false - const msg = Buffer.concat([rlp.encode(code), data]) + const msg = Buffer.concat([Buffer.from(RLP.encode(code)), data]) const header = this._eciesSession.createHeader(msg.length) if (!header || this._socket.destroyed) return this._socket.write(header) @@ -235,7 +236,12 @@ export class Peer extends EventEmitter { ] if (!this._closed) { - if (this._sendMessage(PREFIXES.HELLO, rlp.encode(payload as any))) { + if ( + this._sendMessage( + PREFIXES.HELLO, + Buffer.from(RLP.encode(bufArrToArr(payload as unknown as Buffer[]))) + ) + ) { this._weHello = payload } if (this._hello) { @@ -252,7 +258,7 @@ export class Peer extends EventEmitter { const reasonName = this.getDisconnectPrefix(reason) const debugMsg = `Send DISCONNECT to ${this._socket.remoteAddress}:${this._socket.remotePort} (reason: ${reasonName})` this.debug('DISCONNECT', debugMsg, reasonName) - const data = rlp.encode(reason) + const data = Buffer.from(RLP.encode(reason)) if (!this._sendMessage(PREFIXES.DISCONNECT, data)) return this._disconnectReason = reason @@ -267,7 +273,7 @@ export class Peer extends EventEmitter { _sendPing() { const debugMsg = `Send PING to ${this._socket.remoteAddress}:${this._socket.remotePort}` this.debug('PING', debugMsg) - let data = rlp.encode([]) + let data = Buffer.from(RLP.encode([])) if (this._hello?.protocolVersion && this._hello.protocolVersion >= 5) { data = snappy.compress(data) } @@ -286,7 +292,7 @@ export class Peer extends EventEmitter { _sendPong() { const debugMsg = `Send PONG to ${this._socket.remoteAddress}:${this._socket.remotePort}` this.debug('PONG', debugMsg) - let data = rlp.encode([]) + let data = Buffer.from(RLP.encode([])) if (this._hello?.protocolVersion && this._hello.protocolVersion >= 5) { data = snappy.compress(data) @@ -530,7 +536,7 @@ export class Peer extends EventEmitter { } try { - let payload = body.slice(1) + let payload: any = body.slice(1) // Use snappy uncompression if peer supports DevP2P >=v5 let compressed = false @@ -555,13 +561,13 @@ export class Peer extends EventEmitter { // if (protocolName === 'Peer') { try { - payload = rlp.decode(payload) + payload = arrToBufArr(RLP.decode(Uint8Array.from(payload))) } catch (e: any) { if (msgCode === PREFIXES.DISCONNECT) { if (compressed) { - payload = rlp.decode(origPayload) + payload = arrToBufArr(RLP.decode(Uint8Array.from(origPayload))) } else { - payload = rlp.decode(snappy.uncompress(payload)) + payload = arrToBufArr(RLP.decode(Uint8Array.from(snappy.uncompress(payload)))) } } else { throw new Error(e) diff --git a/packages/devp2p/src/util.ts b/packages/devp2p/src/util.ts index f7c30a97d08..08b015fbcfb 100644 --- a/packages/devp2p/src/util.ts +++ b/packages/devp2p/src/util.ts @@ -2,10 +2,10 @@ import assert from 'assert' import { randomBytes } from 'crypto' import { privateKeyVerify, publicKeyConvert } from 'secp256k1' import createKeccakHash from 'keccak' -import { rlp } from 'ethereumjs-util' +import { arrToBufArr } from 'ethereumjs-util' +import RLP from 'rlp' import { ETH } from './protocol/eth' import { LES } from './protocol/les' - import { debug as createDebugLogger } from 'debug' export const devp2pDebug = createDebugLogger('devp2p') @@ -135,7 +135,7 @@ export function createDeferred(): Deferred { export function unstrictDecode(value: Buffer) { // rlp library throws on remainder.length !== 0 // this utility function bypasses that - return (rlp.decode(value, true) as any).data + return arrToBufArr(RLP.decode(Uint8Array.from(value), true).data) } // multiaddr 8.0.0 expects an Uint8Array with internal buffer starting at 0 offset diff --git a/packages/devp2p/tsconfig.prod.json b/packages/devp2p/tsconfig.prod.json index 72d633f26b4..f7f612b2c0f 100644 --- a/packages/devp2p/tsconfig.prod.json +++ b/packages/devp2p/tsconfig.prod.json @@ -10,6 +10,7 @@ }, "references": [ { "path": "../common/tsconfig.prod.json" }, + { "path": "../rlp/tsconfig.prod.json" }, { "path": "../util/tsconfig.prod.json" } ], } diff --git a/packages/ethash/package.json b/packages/ethash/package.json index 7a8d0257850..1d23a7f8f03 100644 --- a/packages/ethash/package.json +++ b/packages/ethash/package.json @@ -36,7 +36,8 @@ "bigint-crypto-utils": "^3.0.23", "buffer-xor": "^2.0.1", "ethereum-cryptography": "^1.0.3", - "ethereumjs-util": "^7.1.4" + "ethereumjs-util": "^7.1.4", + "rlp": "^3.0.0" }, "devDependencies": { "@ethereumjs/common": "^2.6.4", diff --git a/packages/ethash/src/index.ts b/packages/ethash/src/index.ts index 8fafffadbd9..4526bedb0d8 100644 --- a/packages/ethash/src/index.ts +++ b/packages/ethash/src/index.ts @@ -1,13 +1,13 @@ import { keccak256, keccak512 } from 'ethereum-cryptography/keccak' import { - rlp, zeros, TWO_POW256, bigIntToBuffer, + bufArrToArr, bufferToBigInt, setLengthLeft, - toBuffer, } from 'ethereumjs-util' +import RLP from 'rlp' import { params, fnv, @@ -161,17 +161,17 @@ export default class Ethash { mkcache(cacheSize: number, seed: Buffer) { // console.log(`generating cache\nsize: ${cacheSize}\nseed: ${seed.toString('hex')}`) const n = Math.floor(cacheSize / params.HASH_BYTES) - const o = [toBuffer(keccak512(seed))] + const o = [Buffer.from(keccak512(seed))] let i for (i = 1; i < n; i++) { - o.push(toBuffer(keccak512(o[o.length - 1]))) + o.push(Buffer.from(keccak512(o[o.length - 1]))) } for (let _ = 0; _ < params.CACHE_ROUNDS; _++) { for (i = 0; i < n; i++) { const v = o[i].readUInt32LE(0) % n - o[i] = toBuffer(keccak512(xor(o[(i - 1 + n) % n], o[v]))) + o[i] = Buffer.from(keccak512(xor(o[(i - 1 + n) % n], o[v]))) } } @@ -184,12 +184,12 @@ export default class Ethash { const r = Math.floor(params.HASH_BYTES / params.WORD_BYTES) let mix = Buffer.from(this.cache[i % n]) mix.writeInt32LE(mix.readUInt32LE(0) ^ i, 0) - mix = toBuffer(keccak512(mix)) + mix = Buffer.from(keccak512(mix)) for (let j = 0; j < params.DATASET_PARENTS; j++) { const cacheIndex = fnv(i ^ j, mix.readUInt32LE((j % r) * 4)) mix = fnvBuffer(mix, this.cache[cacheIndex % n]) } - return toBuffer(keccak512(mix)) + return Buffer.from(keccak512(mix)) } run(val: Buffer, nonce: Buffer, fullSize?: number) { @@ -201,7 +201,7 @@ export default class Ethash { } const n = Math.floor(fullSize / params.HASH_BYTES) const w = Math.floor(params.MIX_BYTES / params.WORD_BYTES) - const s = toBuffer(keccak512(Buffer.concat([val, bufReverse(nonce)]))) + const s = Buffer.from(keccak512(Buffer.concat([val, bufReverse(nonce)]))) const mixhashes = Math.floor(params.MIX_BYTES / params.HASH_BYTES) let mix = Buffer.concat(Array(mixhashes).fill(s)) @@ -227,16 +227,16 @@ export default class Ethash { return { mix: cmix, - hash: toBuffer(keccak256(Buffer.concat([s, cmix]))), + hash: Buffer.from(keccak256(Buffer.concat([s, cmix]))), } } cacheHash() { - return toBuffer(keccak256(Buffer.concat(this.cache))) + return Buffer.from(keccak256(Buffer.concat(this.cache))) } headerHash(rawHeader: Buffer[]) { - return toBuffer(keccak256(rlp.encode(rawHeader.slice(0, -2)))) + return Buffer.from(keccak256(RLP.encode(bufArrToArr(rawHeader.slice(0, -2))))) } /** diff --git a/packages/ethash/src/util.ts b/packages/ethash/src/util.ts index 97927b05b7c..c68d50b4516 100644 --- a/packages/ethash/src/util.ts +++ b/packages/ethash/src/util.ts @@ -1,6 +1,5 @@ import { isProbablyPrime } from 'bigint-crypto-utils' import { keccak256 } from 'ethereum-cryptography/keccak' -import { toBuffer } from 'ethereumjs-util' export const params = { DATASET_BYTES_INIT: 1073741824, // 2^30 @@ -51,7 +50,7 @@ export function getEpoc(blockNumber: bigint) { */ export function getSeed(seed: Buffer, begin: number, end: number) { for (let i = begin; i < end; i++) { - seed = toBuffer(keccak256(seed)) + seed = Buffer.from(keccak256(seed)) } return seed } diff --git a/packages/ethash/test/block.spec.ts b/packages/ethash/test/block.spec.ts index fd79dc46a4d..b59a45924e6 100644 --- a/packages/ethash/test/block.spec.ts +++ b/packages/ethash/test/block.spec.ts @@ -1,6 +1,7 @@ import tape from 'tape' import { Block } from '@ethereumjs/block' import Common, { Chain, Hardfork } from '@ethereumjs/common' +import { toBuffer } from 'ethereumjs-util' import Ethash from '../src' const level = require('level-mem') @@ -28,7 +29,7 @@ tape('Verify POW for valid and invalid blocks', async function (t) { t.ok(!invalidBlockResult, 'should be invalid') const testData = require('./block_tests_data.json') - const blockRlp = testData.blocks[0].rlp + const blockRlp = toBuffer(testData.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp, { common }) const uncleBlockResult = await e.verifyPOW(block) t.ok(uncleBlockResult, 'should be valid') diff --git a/packages/ethash/tsconfig.json b/packages/ethash/tsconfig.json index ec77a108e23..2ddad803030 100644 --- a/packages/ethash/tsconfig.json +++ b/packages/ethash/tsconfig.json @@ -1,4 +1,5 @@ { "extends": "../../config/tsconfig.json", - "include": ["src/**/*.ts", "test/**/*.ts"] + "include": ["src/**/*.ts", "test/**/*.ts"], + } diff --git a/packages/ethash/tsconfig.prod.json b/packages/ethash/tsconfig.prod.json index ccdb828f075..15147653b8d 100644 --- a/packages/ethash/tsconfig.prod.json +++ b/packages/ethash/tsconfig.prod.json @@ -9,6 +9,7 @@ "include": ["src/**/*.ts"], "references": [ { "path": "../block/tsconfig.prod.json" }, + { "path": "../rlp/tsconfig.prod.json" }, { "path": "../util/tsconfig.prod.json" } ] } diff --git a/packages/statemanager/package.json b/packages/statemanager/package.json index 617a197048d..0c8069308eb 100644 --- a/packages/statemanager/package.json +++ b/packages/statemanager/package.json @@ -38,7 +38,8 @@ "debug": "^4.3.3", "ethereum-cryptography": "^1.0.3", "ethereumjs-util": "^7.1.4", - "functional-red-black-tree": "^1.0.1" + "functional-red-black-tree": "^1.0.1", + "rlp": "^3.0.0" }, "devDependencies": { "@types/node": "^16.11.7", diff --git a/packages/statemanager/src/stateManager.ts b/packages/statemanager/src/stateManager.ts index 4ee25733600..f5354301002 100644 --- a/packages/statemanager/src/stateManager.ts +++ b/packages/statemanager/src/stateManager.ts @@ -5,7 +5,6 @@ import { Address, toBuffer, KECCAK256_NULL, - rlp, unpadBuffer, PrefixedHexString, bufferToHex, @@ -15,6 +14,7 @@ import { short, } from 'ethereumjs-util' import Common from '@ethereumjs/common' +import RLP from 'rlp' import { StateManager, StorageDump } from './interface' import Cache, { getCb, putCb } from './cache' import { BaseStateManager } from './' @@ -122,7 +122,7 @@ export default class DefaultStateManager extends BaseStateManager implements Sta * @param value - The value of the `code` */ async putContractCode(address: Address, value: Buffer): Promise { - const codeHash = toBuffer(keccak256(value)) + const codeHash = Buffer.from(keccak256(value)) if (codeHash.equals(KECCAK256_NULL)) { return @@ -199,8 +199,8 @@ export default class DefaultStateManager extends BaseStateManager implements Sta const trie = await this._getStorageTrie(address) const value = await trie.get(key) - const decoded = rlp.decode(value) - return decoded as Buffer + const decoded = Buffer.from(RLP.decode(Uint8Array.from(value ?? [])) as Uint8Array) + return decoded } /** @@ -253,7 +253,7 @@ export default class DefaultStateManager extends BaseStateManager implements Sta await this._modifyContractStorage(address, async (storageTrie, done) => { if (value && value.length) { // format input - const encodedValue = rlp.encode(value) + const encodedValue = Buffer.from(RLP.encode(Uint8Array.from(value))) if (this.DEBUG) { this._debug(`Update contract storage for account ${address} to ${short(value)}`) } @@ -355,7 +355,7 @@ export default class DefaultStateManager extends BaseStateManager implements Sta * @param proof the proof to prove */ async verifyProof(proof: Proof): Promise { - const rootHash = toBuffer(keccak256(toBuffer(proof.accountProof[0]))) + const rootHash = Buffer.from(keccak256(toBuffer(proof.accountProof[0]))) const key = toBuffer(proof.address) const accountProof = proof.accountProof.map((rlpString: PrefixedHexString) => toBuffer(rlpString) @@ -410,7 +410,10 @@ export default class DefaultStateManager extends BaseStateManager implements Sta const storageValue = setLengthLeft(toBuffer(stProof.value), 32) const storageKey = toBuffer(stProof.key) const proofValue = await Trie.verifyProof(storageRoot, storageKey, storageProof) - const reportedValue = setLengthLeft(rlp.decode(proofValue as Buffer), 32) + const reportedValue = setLengthLeft( + Buffer.from(RLP.decode(Uint8Array.from((proofValue as Buffer) ?? [])) as Uint8Array), + 32 + ) if (!reportedValue.equals(storageValue)) { throw new Error('Reported trie value does not match storage') } diff --git a/packages/statemanager/tests/proofStateManager.spec.ts b/packages/statemanager/tests/proofStateManager.spec.ts index 7f46b81fc1a..b3df1fe41c2 100644 --- a/packages/statemanager/tests/proofStateManager.spec.ts +++ b/packages/statemanager/tests/proofStateManager.spec.ts @@ -45,7 +45,7 @@ tape('ProofStateManager', (t) => { let stateRoot: Buffer | undefined for (const proofData of ropsten_validAccount.accountProof) { const bufferData = toBuffer(proofData) - const key = toBuffer(keccak256(bufferData)) + const key = Buffer.from(keccak256(bufferData)) if (stateRoot === undefined) { stateRoot = key } @@ -72,7 +72,7 @@ tape('ProofStateManager', (t) => { let stateRoot: Buffer | undefined for (const proofData of ropsten_nonexistentAccount.accountProof) { const bufferData = toBuffer(proofData) - const key = toBuffer(keccak256(bufferData)) + const key = Buffer.from(keccak256(bufferData)) if (stateRoot === undefined) { stateRoot = key } @@ -100,7 +100,7 @@ tape('ProofStateManager', (t) => { let stateRoot: Buffer | undefined for (const proofData of ropsten_contractWithStorage.accountProof) { const bufferData = toBuffer(proofData) - const key = toBuffer(keccak256(bufferData)) + const key = Buffer.from(keccak256(bufferData)) if (stateRoot === undefined) { stateRoot = key } @@ -112,7 +112,7 @@ tape('ProofStateManager', (t) => { for (const storageProofsData of ropsten_contractWithStorage.storageProof) { storageKeys.push(toBuffer(storageProofsData.key)) for (const storageProofData of storageProofsData.proof) { - const key = toBuffer(keccak256(toBuffer(storageProofData))) + const key = Buffer.from(keccak256(toBuffer(storageProofData))) await storageTrie.db.put(key, toBuffer(storageProofData)) } } @@ -140,7 +140,7 @@ tape('ProofStateManager', (t) => { let stateRoot: Buffer | undefined for (const proofData of ropsten_contractWithStorage.accountProof) { const bufferData = toBuffer(proofData) - const key = toBuffer(keccak256(bufferData)) + const key = Buffer.from(keccak256(bufferData)) if (stateRoot === undefined) { stateRoot = key } @@ -152,7 +152,7 @@ tape('ProofStateManager', (t) => { for (const storageProofsData of ropsten_contractWithStorage.storageProof) { storageKeys.push(toBuffer(storageProofsData.key)) for (const storageProofData of storageProofsData.proof) { - const key = toBuffer(keccak256(toBuffer(storageProofData))) + const key = Buffer.from(keccak256(toBuffer(storageProofData))) await storageTrie.db.put(key, toBuffer(storageProofData)) } } @@ -207,7 +207,7 @@ tape('ProofStateManager', (t) => { let stateRoot: Buffer | undefined for (const proofData of ropsten_nonexistentAccount.accountProof) { const bufferData = toBuffer(proofData) - const key = toBuffer(keccak256(bufferData)) + const key = Buffer.from(keccak256(bufferData)) if (stateRoot === undefined) { stateRoot = key } diff --git a/packages/trie/README.md b/packages/trie/README.md index b7f3fa1b3e6..5abccabc6c1 100644 --- a/packages/trie/README.md +++ b/packages/trie/README.md @@ -134,8 +134,9 @@ trie ```typescript import level from 'level' -import { Account, BN, bufferToHex, rlp } from 'ethereumjs-util' import { SecureTrie as Trie } from 'merkle-patricia-tree' +import { Account, BN, bufferToHex } from 'ethereumjs-util' +import RLP from 'rlp' const stateRoot = 'STATE_ROOT_OF_A_BLOCK' @@ -162,7 +163,7 @@ async function test() { stream .on('data', (data) => { console.log(`key: ${bufferToHex(data.key)}`) - console.log(`Value: ${bufferToHex(rlp.decode(data.value))}`) + console.log(`Value: ${bufferToHex(Buffer.from(RLP.decode(data.value)))}`) }) .on('end', () => { console.log('Finished reading storage.') diff --git a/packages/trie/benchmarks/random.ts b/packages/trie/benchmarks/random.ts index b7804b55547..1ea4e19fc16 100644 --- a/packages/trie/benchmarks/random.ts +++ b/packages/trie/benchmarks/random.ts @@ -1,6 +1,5 @@ 'use strict' import { keccak256 } from 'ethereum-cryptography/keccak' -import { toBuffer } from 'ethereumjs-util' import { CheckpointTrie as Trie } from '../dist' // References: @@ -15,12 +14,12 @@ export const runTrie = async (eraSize = 9, symmetric = false) => { let key = Buffer.alloc(KEY_SIZE) for (let i = 0; i <= ROUNDS; i++) { - key = toBuffer(keccak256(key)) + key = Buffer.from(keccak256(key)) if (symmetric) { await trie.put(key, key) } else { - const val = toBuffer(keccak256(key)) + const val = Buffer.from(keccak256(key)) await trie.put(key, val) } diff --git a/packages/trie/package.json b/packages/trie/package.json index ffd5f98000b..943edda9c4a 100644 --- a/packages/trie/package.json +++ b/packages/trie/package.json @@ -43,6 +43,7 @@ "level-mem": "^5.0.1", "level-ws": "^2.0.0", "readable-stream": "^3.6.0", + "rlp": "^3.0.0", "semaphore-async-await": "^1.5.1" }, "devDependencies": { diff --git a/packages/trie/src/baseTrie.ts b/packages/trie/src/baseTrie.ts index b557dba7d50..3d8df9efd46 100644 --- a/packages/trie/src/baseTrie.ts +++ b/packages/trie/src/baseTrie.ts @@ -1,6 +1,6 @@ import Semaphore from 'semaphore-async-await' import { keccak256 } from 'ethereum-cryptography/keccak' -import { toBuffer, KECCAK256_RLP } from 'ethereumjs-util' +import { KECCAK256_RLP } from 'ethereumjs-util' import { DB, BatchDBOp, PutBatch } from './db' import { TrieReadStream as ReadStream } from './readStream' import { bufferToNibbles, matchingNibbleLength, doKeysMatch } from './util/nibbles' @@ -580,7 +580,7 @@ export class Trie { if (rlpNode.length >= 32 || topLevel) { // Do not use TrieNode.hash() here otherwise serialize() // is applied twice (performance) - const hashRoot = toBuffer(keccak256(rlpNode)) + const hashRoot = Buffer.from(keccak256(rlpNode)) if (remove) { if (this._deleteFromDB) { @@ -639,7 +639,7 @@ export class Trie { const opStack = proof.map((nodeValue) => { return { type: 'put', - key: toBuffer(keccak256(nodeValue)), + key: Buffer.from(keccak256(nodeValue)), value: nodeValue, } as PutBatch }) diff --git a/packages/trie/src/secure.ts b/packages/trie/src/secure.ts index 4429df91bd8..7f72dc3589a 100644 --- a/packages/trie/src/secure.ts +++ b/packages/trie/src/secure.ts @@ -1,5 +1,4 @@ import { keccak256 } from 'ethereum-cryptography/keccak' -import { toBuffer } from 'ethereumjs-util' import { CheckpointTrie } from './checkpointTrie' import { Proof } from './baseTrie' @@ -18,7 +17,7 @@ export class SecureTrie extends CheckpointTrie { * @returns A Promise that resolves to `Buffer` if a value was found or `null` if no value was found. */ async get(key: Buffer): Promise { - const hash = toBuffer(keccak256(key)) + const hash = Buffer.from(keccak256(key)) const value = await super.get(hash) return value } @@ -33,7 +32,7 @@ export class SecureTrie extends CheckpointTrie { if (!val || val.toString() === '') { await this.del(key) } else { - const hash = toBuffer(keccak256(key)) + const hash = Buffer.from(keccak256(key)) await super.put(hash, val) } } @@ -43,7 +42,7 @@ export class SecureTrie extends CheckpointTrie { * @param key */ async del(key: Buffer): Promise { - const hash = toBuffer(keccak256(key)) + const hash = Buffer.from(keccak256(key)) await super.del(hash) } @@ -63,7 +62,7 @@ export class SecureTrie extends CheckpointTrie { * @param key */ static createProof(trie: SecureTrie, key: Buffer): Promise { - const hash = toBuffer(keccak256(key)) + const hash = Buffer.from(keccak256(key)) return super.createProof(trie, hash) } @@ -76,7 +75,7 @@ export class SecureTrie extends CheckpointTrie { * @returns The value from the key. */ static async verifyProof(rootHash: Buffer, key: Buffer, proof: Proof): Promise { - const hash = toBuffer(keccak256(key)) + const hash = Buffer.from(keccak256(key)) return super.verifyProof(rootHash, hash, proof) } @@ -93,9 +92,9 @@ export class SecureTrie extends CheckpointTrie { ): Promise { return super.verifyRangeProof( rootHash, - firstKey && toBuffer(keccak256(firstKey)), - lastKey && toBuffer(keccak256(lastKey)), - keys.map((k) => toBuffer(keccak256(k))), + firstKey && Buffer.from(keccak256(firstKey)), + lastKey && Buffer.from(keccak256(lastKey)), + keys.map((k) => Buffer.from(keccak256(k))), values, proof ) diff --git a/packages/trie/src/trieNode.ts b/packages/trie/src/trieNode.ts index 07d12af8fd5..18956dad7f6 100644 --- a/packages/trie/src/trieNode.ts +++ b/packages/trie/src/trieNode.ts @@ -1,5 +1,6 @@ import { keccak256 } from 'ethereum-cryptography/keccak' -import { toBuffer, rlp } from 'ethereumjs-util' +import { arrToBufArr, bufArrToArr } from 'ethereumjs-util' +import RLP from 'rlp' import { bufferToNibbles, nibblesToBuffer } from './util/nibbles' import { isTerminator, addHexPrefix, removeHexPrefix } from './util/hex' @@ -42,11 +43,11 @@ export class BranchNode { } serialize(): Buffer { - return rlp.encode(this.raw()) + return Buffer.from(RLP.encode(bufArrToArr(this.raw() as Buffer[]))) } hash(): Buffer { - return toBuffer(keccak256(this.serialize())) + return Buffer.from(keccak256(this.serialize())) } getBranch(i: number) { @@ -116,11 +117,11 @@ export class ExtensionNode { } serialize(): Buffer { - return rlp.encode(this.raw()) + return Buffer.from(RLP.encode(bufArrToArr(this.raw()))) } hash(): Buffer { - return toBuffer(keccak256(this.serialize())) + return Buffer.from(keccak256(this.serialize())) } } @@ -170,11 +171,11 @@ export class LeafNode { } serialize(): Buffer { - return rlp.encode(this.raw()) + return Buffer.from(RLP.encode(bufArrToArr(this.raw()))) } hash(): Buffer { - return toBuffer(keccak256(this.serialize())) + return Buffer.from(keccak256(this.serialize())) } } @@ -193,7 +194,7 @@ export function decodeRawNode(raw: Buffer[]): TrieNode { } export function decodeNode(raw: Buffer): TrieNode { - const des = rlp.decode(raw) + const des = arrToBufArr(RLP.decode(Uint8Array.from(raw))) as Buffer[] if (!Array.isArray(des)) { throw new Error('Invalid node') } diff --git a/packages/trie/test/index.spec.ts b/packages/trie/test/index.spec.ts index 2dfa97855ed..190b07a929e 100644 --- a/packages/trie/test/index.spec.ts +++ b/packages/trie/test/index.spec.ts @@ -1,5 +1,6 @@ import tape from 'tape' -import { KECCAK256_NULL, rlp } from 'ethereumjs-util' +import { bufArrToArr, KECCAK256_NULL } from 'ethereumjs-util' +import RLP from 'rlp' import { BaseTrie, CheckpointTrie } from '../src' // explicitly import buffer, @@ -276,7 +277,7 @@ tape('it should create the genesis state root from ethereum', function (tester) startAmount[0] = 1 const account = [startAmount, 0, stateRoot, KECCAK256_NULL] - const rlpAccount = rlp.encode(account) + const rlpAccount = Buffer.from(RLP.encode(bufArrToArr(account as Buffer[]))) const cppRlp = 'f85e9a010000000000000000000000000000000000000000000000000080a00000000000000000000000000000000000000000000000000000000000000000a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470' diff --git a/packages/trie/tsconfig.prod.json b/packages/trie/tsconfig.prod.json index 497aaac6bdf..b6a8ced1b58 100644 --- a/packages/trie/tsconfig.prod.json +++ b/packages/trie/tsconfig.prod.json @@ -6,5 +6,8 @@ "composite": true }, "include": ["src/**/*.ts"], - "references": [{ "path": "../util/tsconfig.prod.json" }] + "references": [ + { "path": "../rlp/tsconfig.prod.json" }, + { "path": "../util/tsconfig.prod.json" } + ] } diff --git a/packages/tx/README.md b/packages/tx/README.md index c6cd099bc08..6c6f4e58414 100644 --- a/packages/tx/README.md +++ b/packages/tx/README.md @@ -266,7 +266,8 @@ Here is an example of signing txs with `@ledgerhq/hw-app-eth` as of `v6.5.0`: ```typescript import { Transaction, FeeMarketEIP1559Transaction } from '@ethereumjs/tx' import Common, { Chain } from '@ethereumjs/common' -import { rlp } from 'ethereumjs-util' +import { bufArrToArr } from 'ethereumjs-util' +import RLP from 'rlp' import Eth from '@ledgerhq/hw-app-eth' const eth = new Eth(transport) @@ -282,7 +283,7 @@ const run = async () => { // Signing a legacy tx tx = Transaction.fromTxData(txData, { common }) unsignedTx = tx.getMessageToSign(false) - unsignedTx = rlp.encode(unsignedTx) // ledger signTransaction API expects it to be serialized + unsignedTx = Buffer.from(RLP.encode(bufArrToArr(unsignedTx))) // ledger signTransaction API expects it to be serialized let { v, r, s } = await eth.signTransaction(bip32Path, unsignedTx) txData = { ...txData, v, r, s } signedTx = Transaction.fromTxData(txData, { common }) diff --git a/packages/tx/examples/transactions.ts b/packages/tx/examples/transactions.ts index 4133275229e..5cefa0998b5 100644 --- a/packages/tx/examples/transactions.ts +++ b/packages/tx/examples/transactions.ts @@ -13,14 +13,13 @@ const tx = Transaction.fromTxData({ gasPrice: 100, gasLimit: 1000000000, value: 0, - data: - '0x7f4e616d65526567000000000000000000000000000000000000000000000000003057307f4e616d6552656700000000000000000000000000000000000000000000000000573360455760415160566000396000f20036602259604556330e0f600f5933ff33560f601e5960003356576000335700604158600035560f602b590033560f60365960003356573360003557600035335700', + data: '0x7f4e616d65526567000000000000000000000000000000000000000000000000003057307f4e616d6552656700000000000000000000000000000000000000000000000000573360455760415160566000396000f20036602259604556330e0f600f5933ff33560f601e5960003356576000335700604158600035560f602b590033560f60365960003356573360003557600035335700', }) // We sign the transaction with this private key. const privateKey = Buffer.from( 'e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', - 'hex', + 'hex' ) const signedTx = tx.sign(privateKey) @@ -56,7 +55,6 @@ const rawTx = [ const tx2 = Transaction.fromValuesArray(rawTx.map(toBuffer)) // This is also a mainnet transaction -// Note rlp.decode will produce an array of buffers. // So assuming that you were able to parse the transaction, we will now get the sender's address. console.log('Senders Address: ' + tx2.getSenderAddress().toString()) diff --git a/packages/tx/package.json b/packages/tx/package.json index 892e3299d10..0fefc8f0a14 100644 --- a/packages/tx/package.json +++ b/packages/tx/package.json @@ -36,7 +36,8 @@ "dependencies": { "@ethereumjs/common": "^2.6.4", "ethereum-cryptography": "^1.0.3", - "ethereumjs-util": "^7.1.4" + "ethereumjs-util": "^7.1.4", + "rlp": "^3.0.0" }, "devDependencies": { "@types/minimist": "^1.2.0", diff --git a/packages/tx/src/eip1559Transaction.ts b/packages/tx/src/eip1559Transaction.ts index c906e6159bf..f65b6d77607 100644 --- a/packages/tx/src/eip1559Transaction.ts +++ b/packages/tx/src/eip1559Transaction.ts @@ -1,14 +1,16 @@ import { keccak256 } from 'ethereum-cryptography/keccak' import { + arrToBufArr, bigIntToHex, bigIntToUnpaddedBuffer, + bufArrToArr, bufferToBigInt, ecrecover, MAX_INTEGER, - rlp, toBuffer, validateNoLeadingZeroes, } from 'ethereumjs-util' +import RLP from 'rlp' import Common from '@ethereumjs/common' import { BaseTransaction } from './baseTransaction' import { @@ -76,7 +78,7 @@ export default class FeeMarketEIP1559Transaction extends BaseTransaction { * Format: `rlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s])` */ public static fromSerializedTx(serialized: Buffer, opts: TxOptions = {}) { - const values = rlp.decode(serialized) + const values = arrToBufArr(RLP.decode(Uint8Array.from(serialized))) as Buffer[] if (!Array.isArray(values)) { throw new Error('Invalid serialized tx input. Must be array') @@ -175,7 +177,7 @@ export default class Transaction extends BaseTransaction { * representation for external signing use {@link Transaction.getMessageToSign}. */ serialize(): Buffer { - return rlp.encode(this.raw()) + return Buffer.from(RLP.encode(bufArrToArr(this.raw()))) } private _getMessageToSign() { @@ -205,9 +207,10 @@ export default class Transaction extends BaseTransaction { * and you might need to do yourself with: * * ```javascript - * import { rlp } from 'ethereumjs-util' + * import { bufArrToArr } from 'ethereumjs-util' + * import RLP from 'rlp' * const message = tx.getMessageToSign(false) - * const serializedMessage = rlp.encode(message) // use this for the HW wallet input + * const serializedMessage = Buffer.from(RLP.encode(bufArrToArr(message))) // use this for the HW wallet input * ``` * * @param hashMessage - Return hashed message if set to true (default: true) @@ -217,7 +220,7 @@ export default class Transaction extends BaseTransaction { getMessageToSign(hashMessage = true) { const message = this._getMessageToSign() if (hashMessage) { - return toBuffer(keccak256(rlp.encode(message))) + return Buffer.from(keccak256(RLP.encode(bufArrToArr(message)))) } else { return message } @@ -272,12 +275,12 @@ export default class Transaction extends BaseTransaction { if (Object.isFrozen(this)) { if (!this.cache.hash) { - this.cache.hash = toBuffer(keccak256(rlp.encode(this.raw()))) + this.cache.hash = Buffer.from(keccak256(RLP.encode(bufArrToArr(this.raw())))) } return this.cache.hash } - return toBuffer(keccak256(rlp.encode(this.raw()))) + return Buffer.from(keccak256(RLP.encode(bufArrToArr(this.raw())))) } /** @@ -289,7 +292,7 @@ export default class Transaction extends BaseTransaction { throw new Error(msg) } const message = this._getMessageToSign() - return toBuffer(keccak256(rlp.encode(message))) + return Buffer.from(keccak256(RLP.encode(bufArrToArr(message)))) } /** diff --git a/packages/tx/test/eip1559.spec.ts b/packages/tx/test/eip1559.spec.ts index c9f3d015ac2..92cfdfea28c 100644 --- a/packages/tx/test/eip1559.spec.ts +++ b/packages/tx/test/eip1559.spec.ts @@ -1,5 +1,6 @@ import Common, { Chain, Hardfork } from '@ethereumjs/common' -import { rlp, TWO_POW256 } from 'ethereumjs-util' +import { TWO_POW256 } from 'ethereumjs-util' +import RLP from 'rlp' import tape from 'tape' import { FeeMarketEIP1559Transaction } from '../src' @@ -93,7 +94,7 @@ tape('[FeeMarketEIP1559Transaction]', function (t) { const pkey = Buffer.from(data.privateKey.slice(2), 'hex') const txn = FeeMarketEIP1559Transaction.fromTxData(data, { common }) const signed = txn.sign(pkey) - const rlpSerialized = rlp.encode(signed.serialize()) + const rlpSerialized = Buffer.from(RLP.encode(Uint8Array.from(signed.serialize()))) st.ok( rlpSerialized.equals(Buffer.from(data.signedTransactionRLP.slice(2), 'hex')), 'Should sign txs correctly' diff --git a/packages/tx/test/legacy.spec.ts b/packages/tx/test/legacy.spec.ts index 602e32c5862..1fd4da3f54a 100644 --- a/packages/tx/test/legacy.spec.ts +++ b/packages/tx/test/legacy.spec.ts @@ -1,13 +1,14 @@ import tape from 'tape' import { Buffer } from 'buffer' import { - rlp, - toBuffer, + arrToBufArr, + bufferToBigInt, bufferToHex, intToBuffer, + toBuffer, unpadBuffer, - bufferToBigInt, } from 'ethereumjs-util' +import RLP from 'rlp' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Transaction, TxData } from '../src' import { TxsJsonEntry, VitaliksTestsDataEntry } from './types' @@ -206,7 +207,7 @@ tape('[Transaction]', function (t) { t.test('serialize()', function (st) { transactions.forEach(function (tx, i) { const s1 = tx.serialize() - const s2 = rlp.encode(txFixtures[i].raw) + const s2 = Buffer.from(RLP.encode(txFixtures[i].raw)) st.ok(s1.equals(s2)) }) st.end() @@ -501,7 +502,7 @@ tape('[Transaction]', function (t) { tx = Transaction.fromSerializedTx(rawSigned) st.ok(tx.isSigned()) - const signedValues = rlp.decode(rawSigned) as any as Buffer[] + const signedValues = arrToBufArr(RLP.decode(Uint8Array.from(rawSigned))) as Buffer[] tx = Transaction.fromValuesArray(signedValues) st.ok(tx.isSigned()) tx = Transaction.fromValuesArray(signedValues.slice(0, 6)) diff --git a/packages/tx/tsconfig.prod.json b/packages/tx/tsconfig.prod.json index a07938b134d..bb3b3cf6c42 100644 --- a/packages/tx/tsconfig.prod.json +++ b/packages/tx/tsconfig.prod.json @@ -9,6 +9,7 @@ "include": ["src/**/*.ts"], "references": [ { "path": "../common/tsconfig.prod.json" }, + { "path": "../rlp/tsconfig.prod.json" }, { "path": "../util/tsconfig.prod.json" } ], } diff --git a/packages/util/README.md b/packages/util/README.md index 9c991a8ae64..96476a1df8d 100644 --- a/packages/util/README.md +++ b/packages/util/README.md @@ -45,16 +45,12 @@ Read the [API docs](docs/). - e.g. `KECCAK256_NULL_S` for string representation of Keccak-256 hash of null - [hash](src/hash.ts) - Hash functions -- [object](src/object.ts) - - Helper function for creating a binary object (`DEPRECATED`) - [signature](src/signature.ts) - Signing, signature validation, conversion, recovery - [types](src/types.ts) - Helpful TypeScript types - [internal](src/internal.ts) - Internalized helper methods -- [externals](src/externals.ts) - - Re-exports of `BN`, `rlp` ### ethjs-util methods diff --git a/packages/util/package.json b/packages/util/package.json index 0633ce0b85d..efe97b77caf 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -38,7 +38,7 @@ }, "dependencies": { "ethereum-cryptography": "^1.0.3", - "rlp": "^2.2.4" + "rlp": "^3.0.0" }, "devDependencies": { "@types/bn.js": "^5.1.0", diff --git a/packages/util/src/account.ts b/packages/util/src/account.ts index 4c478bb9850..0072e476ec9 100644 --- a/packages/util/src/account.ts +++ b/packages/util/src/account.ts @@ -1,10 +1,18 @@ import { keccak256 } from 'ethereum-cryptography/keccak' import { bytesToHex } from 'ethereum-cryptography/utils' import { Point, utils } from 'ethereum-cryptography/secp256k1' +import RLP from 'rlp' import { stripHexPrefix } from './internal' import { KECCAK256_RLP, KECCAK256_NULL } from './constants' -import { zeros, bufferToHex, toBuffer, bufferToBigInt, bigIntToUnpaddedBuffer } from './bytes' -import { rlp } from './externals' +import { + arrToBufArr, + bigIntToUnpaddedBuffer, + bufArrToArr, + bufferToBigInt, + bufferToHex, + toBuffer, + zeros, +} from './bytes' import { assertIsString, assertIsHexString, assertIsBuffer } from './helpers' import { BigIntLike, BufferLike } from './types' @@ -35,7 +43,7 @@ export class Account { } public static fromRlpSerializedAccount(serialized: Buffer) { - const values = rlp.decode(serialized) + const values = arrToBufArr(RLP.decode(Uint8Array.from(serialized)) as Uint8Array[]) as Buffer[] if (!Array.isArray(values)) { throw new Error('Invalid serialized account input. Must be array') @@ -94,7 +102,7 @@ export class Account { * Returns the RLP serialization of the account as a `Buffer`. */ serialize(): Buffer { - return rlp.encode(this.raw()) + return Buffer.from(RLP.encode(bufArrToArr(this.raw()))) } /** @@ -191,11 +199,11 @@ export const generateAddress = function (from: Buffer, nonce: Buffer): Buffer { if (bufferToBigInt(nonce) === BigInt(0)) { // in RLP we want to encode null in the case of zero nonce // read the RLP documentation for an answer if you dare - return toBuffer(keccak256(rlp.encode([from, null]))).slice(-20) + return Buffer.from(keccak256(RLP.encode(bufArrToArr([from, null] as any)))).slice(-20) } // Only take the lower 160bits of the hash - return toBuffer(keccak256(rlp.encode([from, nonce]))).slice(-20) + return Buffer.from(keccak256(RLP.encode(bufArrToArr([from, nonce])))).slice(-20) } /** @@ -276,7 +284,7 @@ export const pubToAddress = function (pubKey: Buffer, sanitize: boolean = false) throw new Error('Expected pubKey to be of length 64') } // Only take the lower 160bits of the hash - return toBuffer(keccak256(pubKey)).slice(-20) + return Buffer.from(keccak256(pubKey)).slice(-20) } export const publicToAddress = pubToAddress diff --git a/packages/util/src/externals.ts b/packages/util/src/externals.ts deleted file mode 100644 index d644e58528e..00000000000 --- a/packages/util/src/externals.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Re-exports commonly used modules: - * [`rlp`](https://github.com/ethereumjs/rlp). - * @packageDocumentation - */ - -import * as rlp from 'rlp' - -/** - * [`rlp`](https://github.com/ethereumjs/rlp) - */ -export { rlp } diff --git a/packages/util/src/index.ts b/packages/util/src/index.ts index 02689a8106b..4ea77344fe5 100644 --- a/packages/util/src/index.ts +++ b/packages/util/src/index.ts @@ -23,11 +23,6 @@ export * from './signature' */ export * from './bytes' -/** - * External exports (BN, rlp) - */ -export * from './externals' - /** * Helpful TypeScript types */ diff --git a/packages/util/src/signature.ts b/packages/util/src/signature.ts index d137bd1356e..bd127fbdc68 100644 --- a/packages/util/src/signature.ts +++ b/packages/util/src/signature.ts @@ -217,5 +217,5 @@ export const isValidSignature = function ( export const hashPersonalMessage = function (message: Buffer): Buffer { assertIsBuffer(message) const prefix = Buffer.from(`\u0019Ethereum Signed Message:\n${message.length}`, 'utf-8') - return toBuffer(keccak256(Buffer.concat([prefix, message]))) + return Buffer.from(keccak256(Buffer.concat([prefix, message]))) } diff --git a/packages/util/test/account.spec.ts b/packages/util/test/account.spec.ts index 916bdaeccac..51576617426 100644 --- a/packages/util/test/account.spec.ts +++ b/packages/util/test/account.spec.ts @@ -1,4 +1,5 @@ import tape from 'tape' +import RLP from 'rlp' import { Account, isValidPrivate, @@ -13,7 +14,6 @@ import { isValidChecksumAddress, isValidAddress, toChecksumAddress, - rlp, bufferToBigInt, } from '../src' const eip1014Testdata = require('./testdata/eip1014Examples.json') @@ -113,7 +113,9 @@ tape('Account', function (t) { codeHash: '0xc5d2461236f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470', } const account = Account.fromAccountData(raw) - const accountRlp = rlp.encode([raw.nonce, raw.balance, raw.stateRoot, raw.codeHash]) + const accountRlp = Buffer.from( + RLP.encode([raw.nonce, raw.balance, raw.stateRoot, raw.codeHash]) + ) st.ok(account.serialize().equals(accountRlp), 'should serialize correctly') st.end() }) diff --git a/packages/util/test/externals.spec.ts b/packages/util/test/externals.spec.ts deleted file mode 100644 index f42bce3e975..00000000000 --- a/packages/util/test/externals.spec.ts +++ /dev/null @@ -1,99 +0,0 @@ -import tape from 'tape' -import * as rlp_export from 'rlp' -import * as src from '../src' - -tape('External rlp export', (t) => { - t.test('should export `rlp`', (st) => { - st.equal(src.rlp, rlp_export) - st.end() - }) - - t.test('should use a rlp function correctly', (st) => { - const nestedList = [[], [[]], [[], [[]]]] - const encoded = src.rlp.encode(nestedList) - const decoded = src.rlp.decode(encoded) - st.deepEqual(nestedList, decoded) - st.end() - }) - - t.test('should throw on exceptions', (st) => { - // bad values: wrong encoded a zero - const val = Buffer.from( - 'f9005f030182520894b94f5374fce5edbc8e2a8697c15331677e6ebf0b0a801ca098ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4aa08887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3', - 'hex' - ) - let result - try { - result = src.rlp.decode(val) - } catch (e: any) { - // pass - } - st.equal(result, undefined) - - // bad values: invalid length - const a = Buffer.from( - 'f86081000182520894b94f5374fce5edbc8e2a8697c15331677e6ebf0b0a801ca098ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4aa08887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3', - 'hex' - ) - - let res - try { - result = src.rlp.decode(a) - } catch (e: any) { - // pass - } - st.equal(res, undefined) - st.end() - }) -}) - -tape('External ethjsUtil export', (t) => { - t.test('should have all ethjsUtil methods', (st) => { - const expected = [ - 'arrayContainsArray', - 'toBuffer', - 'intToBuffer', - 'getBinarySize', - 'stripHexPrefix', - 'isHexPrefixed', - 'padToEven', - 'intToHex', - 'fromAscii', - 'fromUtf8', - 'toAscii', - 'getKeys', - 'isHexString', - 'toUtf8', - ] - - expected.forEach((prop) => { - st.ok(prop in src) - }) - st.end() - }) - - t.test('should use ethjsUtil functions correctly', (st) => { - // should convert intToHex - st.equal(src.intToHex(0), '0x0') - - // should convert intToHex - const i = 6003400 - const hex = src.intToHex(i) - st.equal(hex, '0x5b9ac8') - - // should convert a int to a buffer - const j = 6003400 - const buf = src.intToBuffer(j) - st.equal(buf.toString('hex'), '5b9ac8') - st.end() - }) - - t.test('should handle exceptions and invalid inputs', (st) => { - // should throw when invalid abi - st.throws(() => src.getKeys([], (3289) as string), Error) - - // should detect invalid length hex string - st.equal(src.isHexString('0x0', 2), false) - st.end() - }) -}) diff --git a/packages/util/tsconfig.prod.json b/packages/util/tsconfig.prod.json index 7d60b7fdbfd..59a668263e3 100644 --- a/packages/util/tsconfig.prod.json +++ b/packages/util/tsconfig.prod.json @@ -5,5 +5,8 @@ "outDir": "./dist", "composite": true, }, - "include": ["src/**/*.ts"] + "include": ["src/**/*.ts"], + "references": [ + { "path": "../rlp/tsconfig.prod.json" }, + ], } diff --git a/packages/vm/package.json b/packages/vm/package.json index f7952ea9f02..13a6f85f925 100644 --- a/packages/vm/package.json +++ b/packages/vm/package.json @@ -60,6 +60,7 @@ "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", + "rlp": "^3.0.0", "rustbn.js": "~0.2.0" }, "devDependencies": { diff --git a/packages/vm/src/bloom/index.ts b/packages/vm/src/bloom/index.ts index 20774f99b74..0dc02f1c575 100644 --- a/packages/vm/src/bloom/index.ts +++ b/packages/vm/src/bloom/index.ts @@ -1,6 +1,6 @@ import assert from 'assert' import { keccak256 } from 'ethereum-cryptography/keccak' -import { toBuffer, zeros } from 'ethereumjs-util' +import { zeros } from 'ethereumjs-util' const BYTE_SIZE = 256 @@ -25,7 +25,7 @@ export default class Bloom { */ add(e: Buffer) { assert(Buffer.isBuffer(e), 'Element should be buffer') - e = toBuffer(keccak256(e)) + e = Buffer.from(keccak256(e)) const mask = 2047 // binary 11111111111 for (let i = 0; i < 3; i++) { @@ -43,7 +43,7 @@ export default class Bloom { */ check(e: Buffer): boolean { assert(Buffer.isBuffer(e), 'Element should be Buffer') - e = toBuffer(keccak256(e)) + e = Buffer.from(keccak256(e)) const mask = 2047 // binary 11111111111 let match = true diff --git a/packages/vm/src/buildBlock.ts b/packages/vm/src/buildBlock.ts index 7059227ea30..399b54eddc8 100644 --- a/packages/vm/src/buildBlock.ts +++ b/packages/vm/src/buildBlock.ts @@ -1,5 +1,6 @@ -import { Address, toBuffer, rlp, toType, TypeOutput } from 'ethereumjs-util' +import { Address, toBuffer, toType, TypeOutput } from 'ethereumjs-util' import { BaseTrie as Trie } from 'merkle-patricia-tree' +import RLP from 'rlp' import { Block, BlockOptions, HeaderData } from '@ethereumjs/block' import { ConsensusType } from '@ethereumjs/common' import { TypedTransaction } from '@ethereumjs/tx' @@ -115,7 +116,7 @@ export class BlockBuilder { private async transactionsTrie() { const trie = new Trie() for (const [i, tx] of this.transactions.entries()) { - await trie.put(rlp.encode(i), tx.serialize()) + await trie.put(Buffer.from(RLP.encode(i)), tx.serialize()) } return trie.root } @@ -140,7 +141,7 @@ export class BlockBuilder { for (const [i, txResult] of this.transactionResults.entries()) { const tx = this.transactions[i] const encodedReceipt = encodeReceipt(txResult.receipt, tx.type) - await receiptTrie.put(rlp.encode(i), encodedReceipt) + await receiptTrie.put(Buffer.from(RLP.encode(i)), encodedReceipt) } return receiptTrie.root } diff --git a/packages/vm/src/evm/opcodes/functions.ts b/packages/vm/src/evm/opcodes/functions.ts index aceae053e9a..d2da678ec63 100644 --- a/packages/vm/src/evm/opcodes/functions.ts +++ b/packages/vm/src/evm/opcodes/functions.ts @@ -3,7 +3,6 @@ import { keccak256 } from 'ethereum-cryptography/keccak' import { bytesToHex } from 'ethereum-cryptography/utils' import { Address, - toBuffer, KECCAK256_NULL, TWO_POW256, MAX_INTEGER_BIGINT, @@ -1033,7 +1032,7 @@ export const handlers: Map = new Map([ const paddedInvokerAddress = setLengthLeft(runState.eei._env.address.buf, 32) const chainId = setLengthLeft(bigIntToBuffer(runState.eei.getChainId()), 32) const message = Buffer.concat([EIP3074MAGIC, chainId, paddedInvokerAddress, commit]) - const msgHash = toBuffer(keccak256(message)) + const msgHash = Buffer.from(keccak256(message)) let recover try { diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index 0cbc330f88c..db0e517374d 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -1,6 +1,7 @@ import { debug as createDebugLogger } from 'debug' import { BaseTrie as Trie } from 'merkle-patricia-tree' -import { Account, Address, intToBuffer, rlp, short } from 'ethereumjs-util' +import { Account, Address, bigIntToBuffer, bufArrToArr, intToBuffer, short } from 'ethereumjs-util' +import RLP from 'rlp' import { Block } from '@ethereumjs/block' import { ConsensusType, Hardfork } from '@ethereumjs/common' import VM from './index' @@ -357,7 +358,7 @@ async function applyTransactions(this: VM, block: Block, opts: RunBlockOpts) { // Add receipt to trie to later calculate receipt root receipts.push(txRes.receipt) const encodedReceipt = encodeReceipt(txRes.receipt, tx.type) - await receiptTrie.put(rlp.encode(txIdx), encodedReceipt) + await receiptTrie.put(Buffer.from(RLP.encode(txIdx)), encodedReceipt) } return { @@ -432,12 +433,19 @@ export async function rewardAccount( * Returns the encoded tx receipt. */ export function encodeReceipt(receipt: TxReceipt, txType: number) { - const encoded = rlp.encode([ - (receipt as PreByzantiumTxReceipt).stateRoot ?? (receipt as PostByzantiumTxReceipt).status, - receipt.gasUsed, - receipt.bitvector, - receipt.logs, - ]) + const encoded = Buffer.from( + RLP.encode( + bufArrToArr([ + (receipt as PreByzantiumTxReceipt).stateRoot ?? + (receipt as PostByzantiumTxReceipt).status === 0 + ? Buffer.from([]) + : Buffer.from('01', 'hex'), + bigIntToBuffer(receipt.gasUsed), + receipt.bitvector, + receipt.logs, + ]) + ) + ) if (txType === 0) { return encoded @@ -475,7 +483,7 @@ async function _applyDAOHardfork(state: VmState) { async function _genTxTrie(block: Block) { const trie = new Trie() for (const [i, tx] of block.transactions.entries()) { - await trie.put(rlp.encode(i), tx.serialize()) + await trie.put(Buffer.from(RLP.encode(i)), tx.serialize()) } return trie.root } diff --git a/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts b/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts index 4c004895b97..e5c50bc7b6c 100644 --- a/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts @@ -64,7 +64,7 @@ function signMessage(commitUnpadded: Buffer, address: Address, privateKey: Buffe const paddedInvokerAddress = setLengthLeft(address.buf, 32) const chainId = setLengthLeft(bigIntToBuffer(common.chainId()), 32) const message = Buffer.concat([Buffer.from('03', 'hex'), chainId, paddedInvokerAddress, commit]) - const msgHash = toBuffer(keccak256(message)) + const msgHash = Buffer.from(keccak256(message)) return ecsign(msgHash, privateKey, 0) } diff --git a/packages/vm/tests/api/runBlock.spec.ts b/packages/vm/tests/api/runBlock.spec.ts index 8294ad9ae95..0383189060b 100644 --- a/packages/vm/tests/api/runBlock.spec.ts +++ b/packages/vm/tests/api/runBlock.spec.ts @@ -1,5 +1,6 @@ import tape from 'tape' -import { Address, rlp, KECCAK256_RLP, Account } from 'ethereumjs-util' +import { Account, Address, toBuffer, KECCAK256_RLP } from 'ethereumjs-util' +import RLP from 'rlp' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block } from '@ethereumjs/block' import { @@ -22,10 +23,10 @@ const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }) tape('runBlock() -> successful API parameter usage', async (t) => { async function simpleRun(vm: VM, st: tape.Test) { - const genesisRlp = testData.genesisRLP + const genesisRlp = toBuffer(testData.genesisRLP) const genesis = Block.fromRLPSerializedBlock(genesisRlp) - const blockRlp = testData.blocks[0].rlp + const blockRlp = toBuffer(testData.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp) //@ts-ignore @@ -57,7 +58,7 @@ tape('runBlock() -> successful API parameter usage', async (t) => { //@ts-ignore await setupPreConditions(vm.vmState, testData) - const block1Rlp = testData.blocks[0].rlp + const block1Rlp = toBuffer(testData.blocks[0].rlp) const block1 = Block.fromRLPSerializedBlock(block1Rlp) await vm.runBlock({ block: block1, @@ -66,7 +67,7 @@ tape('runBlock() -> successful API parameter usage', async (t) => { skipBlockValidation: true, }) - const block2Rlp = testData.blocks[1].rlp + const block2Rlp = toBuffer(testData.blocks[1].rlp) const block2 = Block.fromRLPSerializedBlock(block2Rlp) await vm.runBlock({ block: block2, @@ -75,7 +76,7 @@ tape('runBlock() -> successful API parameter usage', async (t) => { skipBlockValidation: true, }) - const block3Rlp = testData.blocks[2].rlp + const block3Rlp = toBuffer(testData.blocks[2].rlp) const block3 = Block.fromRLPSerializedBlock(block3Rlp) await vm.runBlock({ block: block3, @@ -188,7 +189,7 @@ tape('runBlock() -> API parameter usage/data errors', async (t) => { const vm = await VM.create({ common }) t.test('should fail when runTx fails', async (t) => { - const blockRlp = testData.blocks[0].rlp + const blockRlp = toBuffer(testData.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp) // The mocked VM uses a mocked runTx @@ -217,7 +218,7 @@ tape('runBlock() -> API parameter usage/data errors', async (t) => { t.test('should fail when block validation fails', async (t) => { const vm = await VM.create({ common }) - const blockRlp = testData.blocks[0].rlp + const blockRlp = toBuffer(testData.blocks[0].rlp) const block = Object.create(Block.fromRLPSerializedBlock(blockRlp)) block.validate = async () => { throw new Error('test') @@ -232,7 +233,7 @@ tape('runBlock() -> API parameter usage/data errors', async (t) => { t.test('should fail when tx gas limit higher than block gas limit', async (t) => { const vm = await VM.create({ common }) - const blockRlp = testData.blocks[0].rlp + const blockRlp = toBuffer(testData.blocks[0].rlp) const block = Object.create(Block.fromRLPSerializedBlock(blockRlp)) // modify first tx's gasLimit const { nonce, gasPrice, to, value, data, v, r, s } = block.transactions[0] @@ -258,7 +259,7 @@ tape('runBlock() -> runtime behavior', async (t) => { const vm = await setupVM({ common }) - const block1: any = rlp.decode(testData.blocks[0].rlp) + const block1: any = RLP.decode(testData.blocks[0].rlp) // edit extra data of this block to "dao-hard-fork" block1[0][12] = Buffer.from('dao-hard-fork') const block = Block.fromValuesArray(block1, { common }) @@ -400,7 +401,7 @@ async function runWithHf(hardfork: string) { const common = new Common({ chain: Chain.Mainnet, hardfork }) const vm = await setupVM({ common }) - const blockRlp = testData.blocks[0].rlp + const blockRlp = toBuffer(testData.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp, { common }) // @ts-ignore @@ -437,7 +438,7 @@ tape('runBlock() -> tx types', async (t) => { async function simpleRun(vm: VM, transactions: TypedTransaction[], st: tape.Test) { const common = vm._common - const blockRlp = testData.blocks[0].rlp + const blockRlp = toBuffer(testData.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp, { common, freeze: false }) //@ts-ignore overwrite transactions diff --git a/packages/vm/tests/api/runCall.spec.ts b/packages/vm/tests/api/runCall.spec.ts index 8105ee57c83..97b8ee49279 100644 --- a/packages/vm/tests/api/runCall.spec.ts +++ b/packages/vm/tests/api/runCall.spec.ts @@ -1,6 +1,6 @@ import tape from 'tape' import { keccak256 } from 'ethereum-cryptography/keccak' -import { Account, Address, toBuffer, MAX_UINT64, padToEven } from 'ethereumjs-util' +import { Account, Address, MAX_UINT64, padToEven } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import VM from '../../src' import { ERROR } from '../../src/exceptions' @@ -9,7 +9,7 @@ import { ERROR } from '../../src/exceptions' function create2address(sourceAddress: Address, codeHash: Buffer, salt: Buffer): Address { const rlp_proc_buffer = Buffer.from('ff', 'hex') const hashBuffer = Buffer.concat([rlp_proc_buffer, sourceAddress.buf, salt, codeHash]) - return new Address(toBuffer(keccak256(hashBuffer)).slice(12)) + return new Address(Buffer.from(keccak256(hashBuffer)).slice(12)) } /* @@ -46,7 +46,7 @@ tape('Constantinople: EIP-1014 CREATE2 creates the right contract address', asyn await vm.stateManager.putContractCode(contractAddress, Buffer.from(code, 'hex')) // setup the contract code await vm.stateManager.putAccount(caller, new Account(BigInt(0), BigInt(0x11111111))) // give the calling account a big balance so we don't run out of funds - const codeHash = toBuffer(keccak256(Buffer.from(''))) + const codeHash = Buffer.from(keccak256(Buffer.from(''))) for (let value = 0; value <= 1000; value += 20) { // setup the call arguments const runCallArgs = { diff --git a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts index 074c2b10098..944c8f023d3 100644 --- a/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts +++ b/packages/vm/tests/tester/runners/BlockchainTestsRunner.ts @@ -3,7 +3,8 @@ import { Block } from '@ethereumjs/block' import Blockchain, { EthashConsensus } from '@ethereumjs/blockchain' import Common, { ConsensusAlgorithm } from '@ethereumjs/common' import { TransactionFactory } from '@ethereumjs/tx' -import { toBuffer, rlp, stripHexPrefix, bufferToBigInt, isHexPrefixed } from 'ethereumjs-util' +import { bufferToBigInt, isHexPrefixed, stripHexPrefix, toBuffer } from 'ethereumjs-util' +import RLP from 'rlp' import { SecureTrie as Trie } from 'merkle-patricia-tree' import { setupPreConditions, verifyPostConditions } from '../../util' @@ -110,7 +111,7 @@ export default async function runBlockchainTest(options: any, testData: any, t: // The block library cannot be used, as this throws on certain EIP1559 blocks when trying to convert try { const blockRlp = Buffer.from(raw.rlp.slice(2), 'hex') - const decodedRLP: any = rlp.decode(blockRlp) + const decodedRLP: any = RLP.decode(Uint8Array.from(blockRlp)) currentBlock = bufferToBigInt(decodedRLP[0][8]) } catch (e: any) { await handleError(e, expectException) diff --git a/packages/vm/tests/util.ts b/packages/vm/tests/util.ts index 644f21370af..700bb2e3d7e 100644 --- a/packages/vm/tests/util.ts +++ b/packages/vm/tests/util.ts @@ -11,15 +11,15 @@ import { keccak256 } from 'ethereum-cryptography/keccak' import { bytesToHex } from 'ethereum-cryptography/utils' import { Account, - rlp, - stripHexPrefix, - setLengthLeft, - toBuffer, Address, bigIntToBuffer, bufferToHex, isHexPrefixed, + setLengthLeft, + stripHexPrefix, + toBuffer, } from 'ethereumjs-util' +import RLP from 'rlp' import { VmState } from '../src/vmState' export function dumpState(state: any, cb: Function) { @@ -201,7 +201,7 @@ export function verifyAccountPostConditions( const rs = state.createReadStream() rs.on('data', function (data: any) { let key = data.key.toString('hex') - const val = '0x' + rlp.decode(data.value).toString('hex') + const val = bufferToHex(Buffer.from(RLP.decode(Uint8Array.from(data.value)) as Uint8Array)) if (key === '0x') { key = '0x00' diff --git a/packages/vm/tsconfig.prod.json b/packages/vm/tsconfig.prod.json index d35348b0c47..013bb225602 100644 --- a/packages/vm/tsconfig.prod.json +++ b/packages/vm/tsconfig.prod.json @@ -10,6 +10,7 @@ { "path": "../block/tsconfig.prod.json" }, { "path": "../blockchain/tsconfig.prod.json" }, { "path": "../common/tsconfig.prod.json" }, + { "path": "../rlp/tsconfig.prod.json" }, { "path": "../statemanager/tsconfig.prod.json" }, { "path": "../trie/tsconfig.prod.json" }, { "path": "../tx/tsconfig.prod.json" }, From 44dac5b14c1a8dde91f2fe76b9955d4d75e73bf2 Mon Sep 17 00:00:00 2001 From: Scotty <66335769+ScottyPoi@users.noreply.github.com> Date: Fri, 13 May 2022 05:29:29 -0600 Subject: [PATCH 39/44] blockchain: fix iterator return type, reinstate tests (#1877) * blockchain: remove 'void' from iterator() return * vm: remove void from vm.runBlockchain() return types * client: adapt VMExecution to stricter blockchain.iterator() call * vm: reintroduce deleted tests for blockchain.getIteratorHead() * vm: correct method name in test --- packages/blockchain/src/index.ts | 2 +- packages/client/lib/execution/vmexecution.ts | 7 +++---- packages/vm/src/runBlockchain.ts | 2 +- packages/vm/tests/api/runBlockchain.spec.ts | 9 ++++++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/blockchain/src/index.ts b/packages/blockchain/src/index.ts index 19f100778c6..54d5327fbc6 100644 --- a/packages/blockchain/src/index.ts +++ b/packages/blockchain/src/index.ts @@ -41,7 +41,7 @@ export interface BlockchainInterface { * @param onBlock - Function called on each block with params (block: Block, * reorg: boolean) */ - iterator(name: string, onBlock: OnBlock): Promise + iterator(name: string, onBlock: OnBlock): Promise } /** diff --git a/packages/client/lib/execution/vmexecution.ts b/packages/client/lib/execution/vmexecution.ts index 525f202321e..b22fa4431a8 100644 --- a/packages/client/lib/execution/vmexecution.ts +++ b/packages/client/lib/execution/vmexecution.ts @@ -24,7 +24,7 @@ export class VMExecution extends Execution { public receiptsManager?: ReceiptsManager private pendingReceipts?: Map - private vmPromise?: Promise + private vmPromise?: Promise /** Number of maximum blocks to run per iteration of {@link VMExecution.run} */ private NUM_BLOCKS_PER_ITERATION = 50 @@ -157,7 +157,6 @@ export class VMExecution extends Execution { headBlock = undefined parentState = undefined errorBlock = undefined - this.vmPromise = blockchain.iterator( 'vm', async (block: Block, reorg: boolean) => { @@ -247,7 +246,7 @@ export class VMExecution extends Execution { }, this.NUM_BLOCKS_PER_ITERATION ) - numExecuted = (await this.vmPromise) as number + numExecuted = await this.vmPromise if (errorBlock) { await this.chain.blockchain.setIteratorHead('vm', (errorBlock as Block).header.parentHash) @@ -255,7 +254,7 @@ export class VMExecution extends Execution { } const endHeadBlock = await this.vm.blockchain.getIteratorHead('vm') - if (numExecuted > 0) { + if (numExecuted && numExecuted > 0) { const firstNumber = startHeadBlock.header.number const firstHash = short(startHeadBlock.hash()) const lastNumber = endHeadBlock.header.number diff --git a/packages/vm/src/runBlockchain.ts b/packages/vm/src/runBlockchain.ts index 4a61a9d2670..900c0f25dc1 100644 --- a/packages/vm/src/runBlockchain.ts +++ b/packages/vm/src/runBlockchain.ts @@ -9,7 +9,7 @@ export default async function runBlockchain( this: VM, blockchain?: Blockchain, maxBlocks?: number -): Promise { +): Promise { let headBlock: Block let parentState: Buffer diff --git a/packages/vm/tests/api/runBlockchain.spec.ts b/packages/vm/tests/api/runBlockchain.spec.ts index 1b8563b091a..c3931ec4e01 100644 --- a/packages/vm/tests/api/runBlockchain.spec.ts +++ b/packages/vm/tests/api/runBlockchain.spec.ts @@ -101,6 +101,9 @@ tape('runBlockchain', (t) => { await vm.runBlockchain() + const head = await vm.blockchain.getIteratorHead() + st.equal(head.hash().toString('hex'), testData.blocks[0].blockHeader.hash.slice(2)) + st.end() }) @@ -138,12 +141,16 @@ tape('runBlockchain', (t) => { await blockchain.putBlock(b2) await blockchain.putBlock(b3) + let head = await blockchain.getIteratorHead() + st.deepEqual(head.hash(), genesisBlock.hash(), 'Iterator head should still be at genesis') + try { await vm.runBlockchain() st.fail('should have returned error') } catch (e: any) { st.equal(e.message, 'test') - + head = await blockchain.getIteratorHead() + st.deepEqual(head.hash(), b2.hash(), 'should have removed invalid block from head') st.end() } }) From 66f87791cb8eaaebc9416c9b7b0bca82d34d9c95 Mon Sep 17 00:00:00 2001 From: Gabriel Rocheleau Date: Mon, 23 May 2022 17:50:54 +0200 Subject: [PATCH 40/44] EVM/VM refactor (#1892) * VM -> EVM/VM Refactor: new EVMOpts EVM options dict, move common and supported HFs to EVM * VM -> EVM/VM Refactor: standalone DEBUG property in EVM and Interpreter * VM -> EVM/VM Refactor: standalone EVM stateManager option and property * VM -> EVM/VM Refactor: moved runCall()/runCode() to EVM, deleted dedicated files, top-level EVM instantiation in VM * VM -> EVM/VM Refactor: made EVM AsyncEventEmitter, moved beforeMessage, afterMessage, newContract, step events to EVM * VM -> EVM/VM Refactor: moved allowUnlimitedContractSize option to EVM * VM -> EVM/VM Refactor: moved opcode and gas handler functionality and options to EVM, removed EVM/Precompiles VM dependency * Client: fix cliqueActiveSigners method assignments * VM: refactor TxContext to an interface * VM: improve Message class types and defaults handling * VM: refactor runCall and executeMessage into unified runCall * VM: fix gas refund reset to 0 after tx finishes and fix parenthesis in runBlock receipt ternary * VM: reimplement transient storage clear method * VM: use VM async create method instead of constructor * VM: unify interpreter and evm DEBUG property Co-authored-by: Holger Drewes --- packages/client/lib/rpc/modules/eth.ts | 2 +- .../client/test/integration/merge.spec.ts | 8 +- .../client/test/integration/miner.spec.ts | 8 +- packages/client/test/miner/miner.spec.ts | 2 +- packages/vm/README.md | 11 +- packages/vm/examples/run-code-browser.js | 2 +- packages/vm/examples/run-solidity-contract.ts | 2 +- packages/vm/src/evm/eei.ts | 44 +- packages/vm/src/evm/evm.ts | 578 +++++++++++++----- packages/vm/src/evm/interpreter.ts | 33 +- packages/vm/src/evm/message.ts | 75 ++- .../vm/src/evm/precompiles/0a-bls12-g1add.ts | 2 +- .../vm/src/evm/precompiles/0b-bls12-g1mul.ts | 2 +- .../evm/precompiles/0c-bls12-g1multiexp.ts | 2 +- .../vm/src/evm/precompiles/0d-bls12-g2add.ts | 2 +- .../vm/src/evm/precompiles/0e-bls12-g2mul.ts | 2 +- .../evm/precompiles/0f-bls12-g2multiexp.ts | 2 +- .../src/evm/precompiles/10-bls12-pairing.ts | 2 +- .../evm/precompiles/11-bls12-map-fp-to-g1.ts | 2 +- .../evm/precompiles/12-bls12-map-fp2-to-g2.ts | 2 +- packages/vm/src/evm/precompiles/types.ts | 4 +- packages/vm/src/evm/txContext.ts | 11 - packages/vm/src/evm/types.ts | 148 +++++ packages/vm/src/index.ts | 153 +---- packages/vm/src/runBlock.ts | 6 +- packages/vm/src/runCall.ts | 117 ---- packages/vm/src/runCode.ts | 109 ---- packages/vm/src/runTx.ts | 31 +- packages/vm/src/state/transientStorage.ts | 8 + packages/vm/tests/api/EIPs/eip-1153.spec.ts | 4 +- .../EIPs/eip-1283-net-gas-metering.spec.ts | 2 +- packages/vm/tests/api/EIPs/eip-2315.spec.ts | 4 +- .../vm/tests/api/EIPs/eip-2537-BLS.spec.ts | 6 +- .../api/EIPs/eip-2565-modexp-gas-cost.spec.ts | 2 +- packages/vm/tests/api/EIPs/eip-2929.spec.ts | 2 +- .../api/EIPs/eip-2930-accesslists.spec.ts | 2 +- .../tests/api/EIPs/eip-3074-authcall.spec.ts | 8 +- .../tests/api/EIPs/eip-3198-BaseFee.spec.ts | 2 +- packages/vm/tests/api/EIPs/eip-3529.spec.ts | 8 +- packages/vm/tests/api/EIPs/eip-3541.spec.ts | 4 +- .../api/EIPs/eip-3651-warm-coinbase.spec.ts | 2 +- packages/vm/tests/api/EIPs/eip-3855.spec.ts | 12 +- ...t-difficulty-opcode-with-prevrando.spec.ts | 6 +- packages/vm/tests/api/customChain.spec.ts | 2 +- .../vm/tests/api/customPrecompiles.spec.ts | 24 +- packages/vm/tests/api/events.spec.ts | 8 +- .../vm/tests/api/evm/customOpcodes.spec.ts | 21 +- .../api/evm/precompiles/06-ecadd.spec.ts | 2 +- .../api/evm/precompiles/07-ecmul.spec.ts | 2 +- .../api/evm/precompiles/08-ecpairing.spec.ts | 2 +- .../api/evm/precompiles/hardfork.spec.ts | 6 +- packages/vm/tests/api/evm/stack.spec.ts | 2 +- packages/vm/tests/api/index.spec.ts | 10 - .../vm/tests/api/istanbul/eip-1108.spec.ts | 6 +- .../vm/tests/api/istanbul/eip-1344.spec.ts | 2 +- .../vm/tests/api/istanbul/eip-152.spec.ts | 4 +- .../vm/tests/api/istanbul/eip-1884.spec.ts | 2 +- .../vm/tests/api/istanbul/eip-2200.spec.ts | 2 +- packages/vm/tests/api/opcodes.spec.ts | 30 +- packages/vm/tests/api/runCall.spec.ts | 35 +- packages/vm/tests/api/runCode.spec.ts | 8 +- .../vm/tests/api/state/accountExists.spec.ts | 4 +- .../tester/runners/GeneralStateTestsRunner.ts | 2 +- 63 files changed, 870 insertions(+), 738 deletions(-) delete mode 100644 packages/vm/src/evm/txContext.ts delete mode 100644 packages/vm/src/runCall.ts delete mode 100644 packages/vm/src/runCode.ts diff --git a/packages/client/lib/rpc/modules/eth.ts b/packages/client/lib/rpc/modules/eth.ts index 84495fdfa2b..4a56fa342c5 100644 --- a/packages/client/lib/rpc/modules/eth.ts +++ b/packages/client/lib/rpc/modules/eth.ts @@ -470,7 +470,7 @@ export class Eth { value: toType(value, TypeOutput.BigInt), data: data ? toBuffer(data) : undefined, } - const { execResult } = await vm.runCall(runCallOpts) + const { execResult } = await vm.evm.runCall(runCallOpts) return bufferToHex(execResult.returnValue) } catch (error: any) { throw { diff --git a/packages/client/test/integration/merge.spec.ts b/packages/client/test/integration/merge.spec.ts index 9e85305ca58..dca59075d45 100644 --- a/packages/client/test/integration/merge.spec.ts +++ b/packages/client/test/integration/merge.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import Blockchain from '@ethereumjs/blockchain' +import Blockchain, { CliqueConsensus } from '@ethereumjs/blockchain' import Common, { Chain as ChainCommon, ConsensusType, @@ -78,7 +78,7 @@ tape('[Integration:Merge]', async (t) => { validateBlocks: false, validateConsensus: false, }) - blockchain.cliqueActiveSigners = () => [accounts[0][0]] // stub + ;(blockchain.consensus as CliqueConsensus).cliqueActiveSigners = () => [accounts[0][0]] // stub const serviceConfig = new Config({ common, servers: [server as any], @@ -105,7 +105,9 @@ tape('[Integration:Merge]', async (t) => { height: 0, common: commonPoA, }) - remoteService.chain.blockchain.cliqueActiveSigners = () => [accounts[0][0]] // stub + ;(remoteService.chain.blockchain.consensus as CliqueConsensus).cliqueActiveSigners = () => [ + accounts[0][0], + ] // stub await server.discover('remotePeer1', '127.0.0.2') const targetTTD = BigInt(5) remoteService.config.events.on(Event.SYNC_SYNCHRONIZED, async () => { diff --git a/packages/client/test/integration/miner.spec.ts b/packages/client/test/integration/miner.spec.ts index 6dce3155e96..923fed23de3 100644 --- a/packages/client/test/integration/miner.spec.ts +++ b/packages/client/test/integration/miner.spec.ts @@ -1,5 +1,5 @@ import tape from 'tape' -import Blockchain from '@ethereumjs/blockchain' +import Blockchain, { CliqueConsensus } from '@ethereumjs/blockchain' import Common, { Chain as ChainCommon, ConsensusType, @@ -51,7 +51,7 @@ tape('[Integration:Miner]', async (t) => { validateBlocks: false, validateConsensus: false, }) - blockchain.cliqueActiveSigners = () => [accounts[0][0]] // stub + ;(blockchain.consensus as CliqueConsensus).cliqueActiveSigners = () => [accounts[0][0]] // stub const chain = new Chain({ config, blockchain }) const serviceConfig = new Config({ common, @@ -82,7 +82,9 @@ tape('[Integration:Miner]', async (t) => { height: 0, common, }) - remoteService.chain.blockchain.cliqueActiveSigners = () => [accounts[0][0]] // stub + ;(remoteService.chain.blockchain.consensus as CliqueConsensus).cliqueActiveSigners = () => [ + accounts[0][0], + ] // stub ;(remoteService as FullEthereumService).execution.run = async () => 1 // stub await server.discover('remotePeer1', '127.0.0.2') const targetHeight = BigInt(5) diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index 8a4ccaa3586..5468fb925c7 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -159,7 +159,7 @@ tape('[Miner]', async (t) => { txPool.add(txA01) // disable consensus to skip PoA block signer validation - ;(vm.blockchain as any)._validateConsensus = false + ;(vm.blockchain.consensus as CliqueConsensus).cliqueActiveSigners = () => [A.address] // stub chain.putBlocks = (blocks: Block[]) => { t.equal(blocks[0].transactions.length, 1, 'new block should include tx') diff --git a/packages/vm/README.md b/packages/vm/README.md index 63120edb51c..5c3f18052e0 100644 --- a/packages/vm/README.md +++ b/packages/vm/README.md @@ -30,15 +30,16 @@ const PUSH1 = '60' // Note that numbers added are hex values, so '20' would be '32' as decimal e.g. const code = [PUSH1, '03', PUSH1, '05', ADD, STOP] -vm.on('step', function (data) { +vm.evm.on('step', function (data) { // Note that data.stack is not immutable, i.e. it is a reference to the vm's internal stack object console.log(`Opcode: ${data.opcode.name}\tStack: ${data.stack}`) }) -vm.runCode({ - code: Buffer.from(code.join(''), 'hex'), - gasLimit: new BN(0xffff), -}) +vm.evm + .runCode({ + code: Buffer.from(code.join(''), 'hex'), + gasLimit: new BN(0xffff), + }) .then((results) => { console.log(`Returned: ${results.returnValue.toString('hex')}`) console.log(`gasUsed : ${results.gasUsed.toString()}`) diff --git a/packages/vm/examples/run-code-browser.js b/packages/vm/examples/run-code-browser.js index 3c200ad8938..62b84b7d1c8 100644 --- a/packages/vm/examples/run-code-browser.js +++ b/packages/vm/examples/run-code-browser.js @@ -22,7 +22,7 @@ const run = async () => { // Note that numbers added are hex values, so '20' would be '32' as decimal e.g. const code = [PUSH1, '03', PUSH1, '05', ADD, STOP] - vm.on('step', function (data) { + vm.evm.on('step', function (data) { console.log(`Opcode: ${data.opcode.name}\tStack: ${data.stack}`) }) diff --git a/packages/vm/examples/run-solidity-contract.ts b/packages/vm/examples/run-solidity-contract.ts index 4ef0cb8c632..9d41af041cf 100644 --- a/packages/vm/examples/run-solidity-contract.ts +++ b/packages/vm/examples/run-solidity-contract.ts @@ -135,7 +135,7 @@ async function setGreeting( async function getGreeting(vm: VM, contractAddress: Address, caller: Address) { const sigHash = new Interface(['function greet()']).getSighash('greet') - const greetResult = await vm.runCall({ + const greetResult = await vm.evm.runCall({ to: contractAddress, caller: caller, origin: caller, // The tx.origin is also the caller here diff --git a/packages/vm/src/evm/eei.ts b/packages/vm/src/evm/eei.ts index 5c83e3e6d82..73e8a7450e3 100644 --- a/packages/vm/src/evm/eei.ts +++ b/packages/vm/src/evm/eei.ts @@ -98,7 +98,7 @@ export default class EEI { */ useGas(amount: bigint, context?: string): void { this._gasLeft -= amount - if (this._evm._vm.DEBUG) { + if (this._evm.DEBUG) { debugGas(`${context ? context + ': ' : ''}used ${amount} gas (-> ${this._gasLeft})`) } if (this._gasLeft < BigInt(0)) { @@ -113,7 +113,7 @@ export default class EEI { * @param context - Usage context for debugging */ refundGas(amount: bigint, context?: string): void { - if (this._evm._vm.DEBUG) { + if (this._evm.DEBUG) { debugGas(`${context ? context + ': ' : ''}refund ${amount} gas (-> ${this._evm._refund})`) } this._evm._refund += amount @@ -125,7 +125,7 @@ export default class EEI { * @param context - Usage context for debugging */ subRefund(amount: bigint, context?: string): void { - if (this._evm._vm.DEBUG) { + if (this._evm.DEBUG) { debugGas(`${context ? context + ': ' : ''}sub gas refund ${amount} (-> ${this._evm._refund})`) } this._evm._refund -= amount @@ -140,7 +140,7 @@ export default class EEI { * @param amount - Amount to add */ addStipend(amount: bigint): void { - if (this._evm._vm.DEBUG) { + if (this._evm.DEBUG) { debugGas(`add stipend ${amount} (-> ${this._gasLeft})`) } this._gasLeft += amount @@ -587,7 +587,7 @@ export default class EEI { return BigInt(0) } - const results = await this._evm.executeMessage(msg) + const results = await this._evm.runCall({ message: msg }) if (results.execResult.logs) { this._result.logs = this._result.logs.concat(results.execResult.logs) @@ -618,22 +618,10 @@ export default class EEI { /** * Creates a new contract with a given value. */ - async create( - gasLimit: bigint, - value: bigint, - data: Buffer, - salt: Buffer | null = null - ): Promise { + async create(gasLimit: bigint, value: bigint, data: Buffer, salt?: Buffer): Promise { const selfdestruct = { ...this._result.selfdestruct } - const msg = new Message({ - caller: this._env.address, - gasLimit, - value, - data, - salt, - depth: this._env.depth + 1, - selfdestruct, - }) + const caller = this._env.address + const depth = this._env.depth + 1 // empty the return data buffer this._lastReturned = Buffer.alloc(0) @@ -641,7 +629,7 @@ export default class EEI { // Check if account has enough ether and max depth not exceeded if ( this._env.depth >= Number(this._common.param('vm', 'stackLimit')) || - (msg.delegatecall !== true && this._env.contract.balance < msg.value) + this._env.contract.balance < value ) { return BigInt(0) } @@ -655,12 +643,22 @@ export default class EEI { await this._state.putAccount(this._env.address, this._env.contract) if (this._common.isActivatedEIP(3860)) { - if (msg.data.length > Number(this._common.param('vm', 'maxInitCodeSize'))) { + if (data.length > Number(this._common.param('vm', 'maxInitCodeSize'))) { return BigInt(0) } } - const results = await this._evm.executeMessage(msg) + const message = new Message({ + caller, + gasLimit, + value, + data, + salt, + depth, + selfdestruct, + }) + + const results = await this._evm.runCall({ message }) if (results.execResult.logs) { this._result.logs = this._result.logs.concat(results.execResult.logs) diff --git a/packages/vm/src/evm/evm.ts b/packages/vm/src/evm/evm.ts index f7833c2e9a7..37b93885066 100644 --- a/packages/vm/src/evm/evm.ts +++ b/packages/vm/src/evm/evm.ts @@ -1,3 +1,10 @@ +import { promisify } from 'util' + +import { Block } from '@ethereumjs/block' +import Blockchain from '@ethereumjs/blockchain' +import Common, { Chain, Hardfork } from '@ethereumjs/common' +import { DefaultStateManager } from '@ethereumjs/statemanager' +const AsyncEventEmitter = require('async-eventemitter') import { debug as createDebugLogger } from 'debug' import { Account, @@ -9,25 +16,115 @@ import { MAX_INTEGER, short, } from 'ethereumjs-util' -import { Block } from '@ethereumjs/block' -import { Hardfork } from '@ethereumjs/common' +import { SecureTrie as Trie } from 'merkle-patricia-tree' -import { ERROR, VmError } from '../exceptions' -import { VmState } from '../vmState' -import { PrecompileFunc } from './precompiles' -import TxContext from './txContext' -import Message from './message' import EEI from './eei' -// eslint-disable-next-line -import * as eof from './opcodes/eof' -import { Log } from './types' +import { ERROR, VmError } from '../exceptions' import { default as Interpreter, InterpreterOpts, RunState } from './interpreter' -import VM from '../index' +import Message, { MessageWithTo } from './message' +import * as eof from './opcodes/eof' +import { getOpcodesForHF, OpcodeList, OpHandler } from './opcodes' +import { AsyncDynamicGasHandler, SyncDynamicGasHandler } from './opcodes/gas' +import { CustomPrecompile, getActivePrecompiles, PrecompileFunc } from './precompiles' import { TransientStorage } from '../state' +import { CustomOpcode, Log, RunCallOpts, RunCodeOpts, TxContext } from './types' +import { VmState } from '../vmState' const debug = createDebugLogger('vm:evm') const debugGas = createDebugLogger('vm:evm:gas') +// very ugly way to detect if we are running in a browser +const isBrowser = new Function('try {return this===window;}catch(e){ return false;}') +let mcl: any +let mclInitPromise: any + +if (!isBrowser()) { + mcl = require('mcl-wasm') + mclInitPromise = mcl.init(mcl.BLS12_381) +} + +/** + * Options for instantiating a {@link VM}. + */ +export interface EVMOpts { + /** + * Use a {@link Common} instance for EVM instantiation. + * + * ### Supported EIPs + * + * - [EIP-1153](https://eips.ethereum.org/EIPS/eip-1153) - Transient Storage Opcodes (`experimental`) + * - [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) - EIP-1559 Fee Market + * - [EIP-2315](https://eips.ethereum.org/EIPS/eip-2315) - VM simple subroutines (`experimental`) + * - [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) - BLS12-381 precompiles (`experimental`) + * - [EIP-2565](https://eips.ethereum.org/EIPS/eip-2565) - ModExp Gas Cost + * - [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) - Typed Transactions + * - [EIP-2929](https://eips.ethereum.org/EIPS/eip-2929) - Gas cost increases for state access opcodes + * - [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) - Access List Transaction Type + * - [EIP-3198](https://eips.ethereum.org/EIPS/eip-3198) - BASEFEE opcode + * - [EIP-3529](https://eips.ethereum.org/EIPS/eip-3529) - Reduction in refunds + * - [EIP-3540](https://eips.ethereum.org/EIPS/eip-3541) - EVM Object Format (EOF) v1 (`experimental`) + * - [EIP-3541](https://eips.ethereum.org/EIPS/eip-3541) - Reject new contracts starting with the 0xEF byte + * [EIP-3651](https://eips.ethereum.org/EIPS/eip-3651) - Warm COINBASE (`experimental`) + * - [EIP-3670](https://eips.ethereum.org/EIPS/eip-3670) - EOF - Code Validation (`experimental`) + * - [EIP-3855](https://eips.ethereum.org/EIPS/eip-3855) - PUSH0 instruction (`experimental`) + * - [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860) - Limit and meter initcode (`experimental`) + * - [EIP-4399](https://eips.ethereum.org/EIPS/eip-4399) - Supplant DIFFICULTY opcode with PREVRANDAO (Merge) (`experimental`) + * + * *Annotations:* + * + * - `experimental`: behaviour can change on patch versions + */ + common?: Common + /** + * A {@link VmState} instance to use as the state store + */ + vmState?: VmState + + /** + * A {@link Blockchain} object for storing/retrieving blocks + * + * Temporary + */ + blockchain?: Blockchain + /** + * Allows unlimited contract sizes while debugging. By setting this to `true`, the check for + * contract size limit of 24KB (see [EIP-170](https://git.io/vxZkK)) is bypassed. + * + * Default: `false` [ONLY set to `true` during debugging] + */ + allowUnlimitedContractSize?: boolean + + /** + * Override or add custom opcodes to the VM instruction set + * These custom opcodes are EIP-agnostic and are always statically added + * To delete an opcode, add an entry of format `{opcode: number}`. This will delete that opcode from the VM. + * If this opcode is then used in the VM, the `INVALID` opcode would instead be used. + * To add an opcode, add an entry of the following format: + * { + * // The opcode number which will invoke the custom opcode logic + * opcode: number + * // The name of the opcode (as seen in the `step` event) + * opcodeName: string + * // The base fee of the opcode + * baseFee: number + * // If the opcode charges dynamic gas, add this here. To charge the gas, use the `i` methods of the BN, to update the charged gas + * gasFunction?: function(runState: RunState, gas: BN, common: Common) + * // The logic of the opcode which holds the logic of changing the current state + * logicFunction: function(runState: RunState) + * } + * Note: gasFunction and logicFunction can both be async or synchronous functions + */ + customOpcodes?: CustomOpcode[] + + /* + * Adds custom precompiles. This is hardfork-agnostic: these precompiles are always activated + * If only an address is given, the precompile is deleted + * If an address and a `PrecompileFunc` is given, this precompile is inserted or overridden + * Please ensure `PrecompileFunc` has exactly one parameter `input: PrecompileInput` + */ + customPrecompiles?: CustomPrecompile[] +} + /** * Result of executing a message via the {@link EVM}. */ @@ -129,120 +226,172 @@ export function VmErrorResult(error: VmError, gasUsed: bigint): ExecResult { * and storing them to state (or discarding changes in case of exceptions). * @ignore */ -export default class EVM { - _vm: VM +export default class EVM extends AsyncEventEmitter { _state: VmState - _tx: TxContext - _block: Block + _tx?: TxContext + _block?: Block /** * Amount of gas to refund from deleting storage values */ _refund: bigint _transientStorage: TransientStorage - constructor(vm: VM, txContext: TxContext, block: Block) { - this._vm = vm - this._state = this._vm.vmState - this._tx = txContext - this._block = block - this._refund = BigInt(0) - this._transientStorage = new TransientStorage() + _common: Common + + protected _blockchain: Blockchain + + // This opcode data is always set since `getActiveOpcodes()` is called in the constructor + public _opcodes!: OpcodeList + + public readonly _allowUnlimitedContractSize: boolean + + protected readonly _customOpcodes?: CustomOpcode[] + protected readonly _customPrecompiles?: CustomPrecompile[] + + public _handlers!: Map + public _dynamicGasHandlers!: Map + + protected _precompiles!: Map + + public get precompiles() { + return this._precompiles } /** - * Executes an EVM message, determining whether it's a call or create - * based on the `to` address. It checkpoints the state and reverts changes - * if an exception happens during the message execution. + * Cached emit() function, not for public usage + * set to public due to implementation internals + * @hidden */ - async executeMessage(message: Message): Promise { - await this._vm._emit('beforeMessage', message) + public readonly _emit: (topic: string, data: any) => Promise - if (!message.to && this._vm._common.isActivatedEIP(2929)) { - message.code = message.data - ;(this._state).addWarmedAddress((await this._generateAddress(message)).buf) - } + /** + * Pointer to the mcl package, not for public usage + * set to public due to implementation internals + * @hidden + */ + public readonly _mcl: any // - const oldRefund = this._refund + /** + * EVM is run in DEBUG mode (default: false) + * Taken from DEBUG environment variable + * + * Safeguards on debug() calls are added for + * performance reasons to avoid string literal evaluation + * @hidden + */ + readonly DEBUG: boolean = false - await this._state.checkpoint() - this._transientStorage.checkpoint() + /** + * EVM async constructor. Creates engine instance and initializes it. + * + * @param opts EVM engine constructor options + */ + static async create(opts: EVMOpts): Promise { + const evm = new this(opts) + await evm.init() + return evm + } - if (this._vm.DEBUG) { - debug('-'.repeat(100)) - debug(`message checkpoint`) - } + constructor(opts: EVMOpts) { + super() - let result - if (this._vm.DEBUG) { - const { caller, gasLimit, to, value, delegatecall } = message - debug( - `New message caller=${caller} gasLimit=${gasLimit} to=${ - to?.toString() ?? 'none' - } value=${value} delegatecall=${delegatecall ? 'yes' : 'no'}` - ) + this._refund = BigInt(0) + this._transientStorage = new TransientStorage() + + if (opts.common) { + this._common = opts.common + } else { + const DEFAULT_CHAIN = Chain.Mainnet + this._common = new Common({ chain: DEFAULT_CHAIN }) } - if (message.to) { - if (this._vm.DEBUG) { - debug(`Message CALL execution (to: ${message.to})`) + + // Supported EIPs + const supportedEIPs = [ + 1153, 1559, 2315, 2537, 2565, 2718, 2929, 2930, 3074, 3198, 3529, 3540, 3541, 3607, 3651, + 3670, 3855, 3860, 4399, + ] + + for (const eip of this._common.eips()) { + if (!supportedEIPs.includes(eip)) { + throw new Error(`EIP-${eip} is not supported by the EVM`) } - result = await this._executeCall(message) + } + + if (opts.vmState) { + this._state = opts.vmState } else { - if (this._vm.DEBUG) { - debug(`Message CREATE execution (to undefined)`) + const trie = new Trie() + const stateManager = new DefaultStateManager({ + trie, + common: this._common, + }) + this._state = new VmState({ common: this._common, stateManager }) + } + this._blockchain = opts.blockchain ?? new (Blockchain as any)({ common: this._common }) + + this._allowUnlimitedContractSize = opts.allowUnlimitedContractSize ?? false + this._customOpcodes = opts.customOpcodes + this._customPrecompiles = opts.customPrecompiles + + this._common.on('hardforkChanged', () => { + this.getActiveOpcodes() + }) + + // Initialize the opcode data + this.getActiveOpcodes() + this._precompiles = getActivePrecompiles(this._common, this._customPrecompiles) + + if (this._common.isActivatedEIP(2537)) { + if (isBrowser()) { + throw new Error('EIP-2537 is currently not supported in browsers') + } else { + this._mcl = mcl } - result = await this._executeCreate(message) } - if (this._vm.DEBUG) { - const { gasUsed, exceptionError, returnValue } = result.execResult - debug( - `Received message execResult: [ gasUsed=${gasUsed} exceptionError=${ - exceptionError ? `'${exceptionError.error}'` : 'none' - } returnValue=0x${short(returnValue)} gasRefund=${result.gasRefund ?? 0} ]` - ) + + // Safeguard if "process" is not available (browser) + if (process !== undefined && process.env.DEBUG) { + this.DEBUG = true } - const err = result.execResult.exceptionError - // This clause captures any error which happened during execution - // If that is the case, then set the _refund tracker to the old refund value - if (err) { - this._refund = oldRefund - result.execResult.selfdestruct = {} + + // We cache this promisified function as it's called from the main execution loop, and + // promisifying each time has a huge performance impact. + this._emit = promisify(this.emit.bind(this)) + } + + async init(): Promise { + if (this._isInitialized) { + return } - result.gasRefund = this._refund - if (err) { - if ( - this._vm._common.gteHardfork(Hardfork.Homestead) || - err.error != ERROR.CODESTORE_OUT_OF_GAS - ) { - result.execResult.logs = [] - await this._state.revert() - this._transientStorage.revert() - if (this._vm.DEBUG) { - debug(`message checkpoint reverted`) - } + if (this._common.isActivatedEIP(2537)) { + if (isBrowser()) { + throw new Error('EIP-2537 is currently not supported in browsers') } else { - // we are in chainstart and the error was the code deposit error - // we do like nothing happened. - await this._state.commit() - this._transientStorage.commit() - if (this._vm.DEBUG) { - debug(`message checkpoint committed`) - } - } - } else { - await this._state.commit() - this._transientStorage.commit() - if (this._vm.DEBUG) { - debug(`message checkpoint committed`) + const mcl = this._mcl + await mclInitPromise // ensure that mcl is initialized. + mcl.setMapToMode(mcl.IRTF) // set the right map mode; otherwise mapToG2 will return wrong values. + mcl.verifyOrderG1(1) // subgroup checks for G1 + mcl.verifyOrderG2(1) // subgroup checks for G2 } } - await this._vm._emit('afterMessage', result) + this._isInitialized = true + } - return result + /** + * Returns a list with the currently activated opcodes + * available for VM execution + */ + getActiveOpcodes(): OpcodeList { + const data = getOpcodesForHF(this._common, this._customOpcodes) + this._opcodes = data.opcodes + this._dynamicGasHandlers = data.dynamicGasHandlers + this._handlers = data.handlers + return data.opcodes } - async _executeCall(message: Message): Promise { + async _executeCall(message: MessageWithTo): Promise { const account = await this._state.getAccount(message.authcallOrigin ?? message.caller) let errorMessage // Reduce tx value from sender @@ -269,13 +418,13 @@ export default class EVM { let exit = false if (!message.code || message.code.length === 0) { exit = true - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Exit early on no code`) } } if (errorMessage) { exit = true - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Exit early on value transfer overflowed`) } } @@ -291,7 +440,7 @@ export default class EVM { let result: ExecResult if (message.isCompiled) { - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Run precompile`) } result = await this.runPrecompile( @@ -300,7 +449,7 @@ export default class EVM { message.gasLimit ) } else { - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Start bytecode processing...`) } result = await this.runInterpreter(message) @@ -316,8 +465,8 @@ export default class EVM { // Reduce tx value from sender await this._reduceSenderBalance(account, message) - if (this._vm._common.isActivatedEIP(3860)) { - if (message.data.length > Number(this._vm._common.param('vm', 'maxInitCodeSize'))) { + if (this._common.isActivatedEIP(3860)) { + if (message.data.length > Number(this._common.param('vm', 'maxInitCodeSize'))) { return { createdAddress: message.to, execResult: { @@ -332,7 +481,7 @@ export default class EVM { message.code = message.data message.data = Buffer.alloc(0) message.to = await this._generateAddress(message) - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Generated CREATE contract address ${message.to}`) } let toAccount = await this._state.getAccount(message.to) @@ -342,7 +491,7 @@ export default class EVM { (toAccount.nonce && toAccount.nonce > BigInt(0)) || !toAccount.codeHash.equals(KECCAK256_NULL) ) { - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Returning on address collision`) } return { @@ -362,18 +511,18 @@ export default class EVM { code: message.code, } - await this._vm._emit('newContract', newContractEvent) + await this._emit('newContract', newContractEvent) toAccount = await this._state.getAccount(message.to) // EIP-161 on account creation and CREATE execution - if (this._vm._common.gteHardfork(Hardfork.SpuriousDragon)) { + if (this._common.gteHardfork(Hardfork.SpuriousDragon)) { toAccount.nonce += BigInt(1) } // Add tx value to the `to` account let errorMessage try { - await this._addToBalance(toAccount, message) + await this._addToBalance(toAccount, message as MessageWithTo) } catch (e: any) { errorMessage = e } @@ -381,13 +530,13 @@ export default class EVM { let exit = false if (!message.code || message.code.length === 0) { exit = true - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Exit early on no code`) } } if (errorMessage) { exit = true - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Exit early on value transfer overflowed`) } } @@ -402,7 +551,7 @@ export default class EVM { } } - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Start bytecode processing...`) } @@ -412,9 +561,9 @@ export default class EVM { let returnFee = BigInt(0) if (!result.exceptionError) { returnFee = - BigInt(result.returnValue.length) * this._vm._common.param('gasPrices', 'createData') + BigInt(result.returnValue.length) * BigInt(this._common.param('gasPrices', 'createData')) totalGas = totalGas + returnFee - if (this._vm.DEBUG) { + if (this.DEBUG) { debugGas(`Add return value size fee (${returnFee} to gas used (-> ${totalGas}))`) } } @@ -423,17 +572,17 @@ export default class EVM { let allowedCodeSize = true if ( !result.exceptionError && - this._vm._common.gteHardfork(Hardfork.SpuriousDragon) && - result.returnValue.length > Number(this._vm._common.param('vm', 'maxCodeSize')) + this._common.gteHardfork(Hardfork.SpuriousDragon) && + result.returnValue.length > Number(this._common.param('vm', 'maxCodeSize')) ) { allowedCodeSize = false } // If enough gas and allowed code size let CodestoreOOG = false - if (totalGas <= message.gasLimit && (this._vm._allowUnlimitedContractSize || allowedCodeSize)) { - if (this._vm._common.isActivatedEIP(3541) && result.returnValue[0] === eof.FORMAT) { - if (!this._vm._common.isActivatedEIP(3540)) { + if (totalGas <= message.gasLimit && (this._allowUnlimitedContractSize || allowedCodeSize)) { + if (this._common.isActivatedEIP(3541) && result.returnValue[0] === eof.FORMAT) { + if (!this._common.isActivatedEIP(3540)) { result = { ...result, ...INVALID_BYTECODE_RESULT(message.gasLimit) } } // Begin EOF1 contract code checks @@ -444,7 +593,7 @@ export default class EVM { ...result, ...INVALID_EOF_RESULT(message.gasLimit), } - } else if (this._vm._common.isActivatedEIP(3670)) { + } else if (this._common.isActivatedEIP(3670)) { // EIP-3670 EOF1 opcode check const codeStart = eof1CodeAnalysisResults.data > 0 ? 10 : 7 // The start of the code section of an EOF1 compliant contract will either be @@ -467,14 +616,14 @@ export default class EVM { result.gasUsed = totalGas } } else { - if (this._vm._common.gteHardfork(Hardfork.Homestead)) { - if (this._vm.DEBUG) { + if (this._common.gteHardfork(Hardfork.Homestead)) { + if (this.DEBUG) { debug(`Not enough gas or code size not allowed (>= Homestead)`) } result = { ...result, ...OOGResult(message.gasLimit) } } else { // we are in Frontier - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Not enough gas or code size not allowed (Frontier)`) } if (totalGas - returnFee <= message.gasLimit) { @@ -490,12 +639,12 @@ export default class EVM { // Save code if a new contract was created if (!result.exceptionError && result.returnValue && result.returnValue.toString() !== '') { await this._state.putContractCode(message.to, result.returnValue) - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Code saved on new contract creation`) } } else if (CodestoreOOG) { // This only happens at Frontier. But, let's do a sanity check; - if (!this._vm._common.gteHardfork(Hardfork.Homestead)) { + if (!this._common.gteHardfork(Hardfork.Homestead)) { // Pre-Homestead behavior; put an empty contract. // This contract would be considered "DEAD" in later hard forks. // It is thus an unecessary default item, which we have to save to dik @@ -518,33 +667,33 @@ export default class EVM { */ async runInterpreter(message: Message, opts: InterpreterOpts = {}): Promise { const env = { - blockchain: this._vm.blockchain, // Only used in BLOCKHASH - address: message.to || Address.zero(), - caller: message.caller || Address.zero(), - callData: message.data || Buffer.from([0]), - callValue: message.value || BigInt(0), + blockchain: this._blockchain, // Only used in BLOCKHASH + address: message.to ?? Address.zero(), + caller: message.caller ?? Address.zero(), + callData: message.data ?? Buffer.from([0]), + callValue: message.value ?? BigInt(0), code: message.code as Buffer, - isStatic: message.isStatic || false, - depth: message.depth || 0, - gasPrice: this._tx.gasPrice, - origin: this._tx.origin || message.caller || Address.zero(), - block: this._block || new Block(), - contract: await this._state.getAccount(message.to || Address.zero()), + isStatic: message.isStatic ?? false, + depth: message.depth ?? 0, + gasPrice: this._tx!.gasPrice, + origin: this._tx!.origin ?? message.caller ?? Address.zero(), + block: this._block ?? new Block(), + contract: await this._state.getAccount(message.to ?? Address.zero()), codeAddress: message.codeAddress, } const eei = new EEI( env, this._state, this, - this._vm._common, + this._common, message.gasLimit, this._transientStorage ) if (message.selfdestruct) { - eei._result.selfdestruct = message.selfdestruct + eei._result.selfdestruct = message.selfdestruct as { [key: string]: Buffer } } - const interpreter = new Interpreter(this._vm, eei) + const interpreter = new Interpreter(this, eei) const interpreterRes = await interpreter.run(message.code as Buffer, opts) let result = eei._result @@ -579,12 +728,159 @@ export default class EVM { } } + /** + * Executes an EVM message, determining whether it's a call or create + * based on the `to` address. It checkpoints the state and reverts changes + * if an exception happens during the message execution. + */ + async runCall(opts: RunCallOpts): Promise { + let message = opts.message + if (!message) { + this._block = opts.block ?? Block.fromBlockData({}, { common: this._common }) + this._tx = { + gasPrice: opts.gasPrice ?? BigInt(0), + origin: opts.origin ?? opts.caller ?? Address.zero(), + } + + const caller = opts.caller ?? Address.zero() + const value = opts.value ?? BigInt(0) + if (opts.skipBalance) { + // if skipBalance, add `value` to caller balance to ensure sufficient funds + const callerAccount = await this._state.getAccount(caller) + callerAccount.balance += value + await this._state.putAccount(caller, callerAccount) + } + + message = new Message({ + caller, + gasLimit: opts.gasLimit ?? BigInt(0xffffff), + to: opts.to, + value, + data: opts.data, + code: opts.code, + depth: opts.depth, + isCompiled: opts.isCompiled, + isStatic: opts.isStatic, + salt: opts.salt, + selfdestruct: opts.selfdestruct ?? {}, + delegatecall: opts.delegatecall, + }) + } + + await this._emit('beforeMessage', message) + + if (!message.to && this._common.isActivatedEIP(2929)) { + message.code = message.data + this._state.addWarmedAddress((await this._generateAddress(message)).buf) + } + + const oldRefund = this._refund + + await this._state.checkpoint() + this._transientStorage.checkpoint() + if (this.DEBUG) { + debug('-'.repeat(100)) + debug(`message checkpoint`) + } + + let result + if (this.DEBUG) { + const { caller, gasLimit, to, value, delegatecall } = message + debug( + `New message caller=${caller} gasLimit=${gasLimit} to=${ + to?.toString() ?? 'none' + } value=${value} delegatecall=${delegatecall ? 'yes' : 'no'}` + ) + } + if (message.to) { + if (this.DEBUG) { + debug(`Message CALL execution (to: ${message.to})`) + } + result = await this._executeCall(message as MessageWithTo) + } else { + if (this.DEBUG) { + debug(`Message CREATE execution (to undefined)`) + } + result = await this._executeCreate(message) + } + if (this.DEBUG) { + const { gasUsed, exceptionError, returnValue } = result.execResult + debug( + `Received message execResult: [ gasUsed=${gasUsed} exceptionError=${ + exceptionError ? `'${exceptionError.error}'` : 'none' + } returnValue=0x${short(returnValue)} gasRefund=${result.gasRefund ?? 0} ]` + ) + } + const err = result.execResult.exceptionError + // This clause captures any error which happened during execution + // If that is the case, then set the _refund tracker to the old refund value + if (err) { + this._refund = oldRefund + result.execResult.selfdestruct = {} + } + result.gasRefund = this._refund + if (err) { + if (this._common.gteHardfork(Hardfork.Homestead) || err.error != ERROR.CODESTORE_OUT_OF_GAS) { + result.execResult.logs = [] + await this._state.revert() + this._transientStorage.revert() + if (this.DEBUG) { + debug(`message checkpoint reverted`) + } + } else { + // we are in chainstart and the error was the code deposit error + // we do like nothing happened. + await this._state.commit() + this._transientStorage.commit() + if (this.DEBUG) { + debug(`message checkpoint committed`) + } + } + } else { + await this._state.commit() + this._transientStorage.commit() + if (this.DEBUG) { + debug(`message checkpoint committed`) + } + } + await this._emit('afterMessage', result) + + return result + } + + /** + * Bound to the global VM and therefore + * shouldn't be used directly from the evm class + */ + async runCode(opts: RunCodeOpts): Promise { + this._block = opts.block ?? Block.fromBlockData({}, { common: this._common }) + + this._tx = { + gasPrice: opts.gasPrice ?? BigInt(0), + origin: opts.origin ?? opts.caller ?? Address.zero(), + } + + const message = new Message({ + code: opts.code, + data: opts.data, + gasLimit: opts.gasLimit, + to: opts.address ?? Address.zero(), + caller: opts.caller, + value: opts.value, + depth: opts.depth, + selfdestruct: opts.selfdestruct ?? {}, + isStatic: opts.isStatic, + }) + + return this.runInterpreter(message, { pc: opts.pc }) + } + /** * Returns code for precompile at the given address, or undefined * if no such precompile exists. */ getPrecompile(address: Address): PrecompileFunc | undefined { - return this._vm.precompiles.get(address.buf.toString('hex')) + return this.precompiles.get(address.buf.toString('hex')) } /** @@ -602,8 +898,8 @@ export default class EVM { const opts = { data, gasLimit, - _common: this._vm._common, - _VM: this._vm, + _common: this._common, + _EVM: this, } return code(opts) @@ -640,13 +936,13 @@ export default class EVM { throw new VmError(ERROR.INSUFFICIENT_BALANCE) } const result = this._state.putAccount(message.authcallOrigin ?? message.caller, account) - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Reduced sender (${message.caller}) balance (-> ${account.balance})`) } return result } - async _addToBalance(toAccount: Account, message: Message): Promise { + async _addToBalance(toAccount: Account, message: MessageWithTo): Promise { const newBalance = toAccount.balance + message.value if (newBalance > MAX_INTEGER) { throw new VmError(ERROR.VALUE_OVERFLOW) @@ -654,7 +950,7 @@ export default class EVM { toAccount.balance = newBalance // putAccount as the nonce may have changed for contract creation const result = this._state.putAccount(message.to, toAccount) - if (this._vm.DEBUG) { + if (this.DEBUG) { debug(`Added toAccount (${message.to}) balance (-> ${toAccount.balance})`) } return result diff --git a/packages/vm/src/evm/interpreter.ts b/packages/vm/src/evm/interpreter.ts index 9819113651a..baf3646cb5d 100644 --- a/packages/vm/src/evm/interpreter.ts +++ b/packages/vm/src/evm/interpreter.ts @@ -8,6 +8,8 @@ import Stack from './stack' import EEI from './eei' import { Opcode, OpHandler, AsyncOpHandler } from './opcodes' import * as eof from './opcodes/eof' +import Common from '@ethereumjs/common' +import EVM from './evm' export interface InterpreterOpts { pc?: number @@ -63,14 +65,17 @@ export default class Interpreter { _state: VmState _runState: RunState _eei: EEI + _common: Common + _evm: EVM // Opcode debuggers (e.g. { 'push': [debug Object], 'sstore': [debug Object], ...}) private opDebuggers: { [key: string]: (debug: string) => void } = {} - constructor(vm: any, eei: EEI) { - this._vm = vm - this._state = vm.vmState + constructor(evm: EVM, eei: EEI) { + this._evm = evm this._eei = eei + this._state = this._evm._state + this._common = this._evm._common this._runState = { programCounter: 0, opCode: 0xfe, // INVALID opcode @@ -88,10 +93,10 @@ export default class Interpreter { } async run(code: Buffer, opts: InterpreterOpts = {}): Promise { - if (!this._vm._common.isActivatedEIP(3540) || code[0] !== eof.FORMAT) { + if (!this._common.isActivatedEIP(3540) || code[0] !== eof.FORMAT) { // EIP-3540 isn't active and first byte is not 0xEF - treat as legacy bytecode this._runState.code = code - } else if (this._vm._common.isActivatedEIP(3540)) { + } else if (this._common.isActivatedEIP(3540)) { if (code[1] !== eof.MAGIC) { // Bytecode contains invalid EOF magic byte return { @@ -179,13 +184,13 @@ export default class Interpreter { const gasLimitClone = this._eei.getGasLeft() if (opInfo.dynamicGas) { - const dynamicGasHandler = this._vm._dynamicGasHandlers.get(this._runState.opCode)! + const dynamicGasHandler = this._evm._dynamicGasHandlers.get(this._runState.opCode)! // This function updates the gas in-place. // It needs the base fee, for correct gas limit calculation for the CALL opcodes - gas = await dynamicGasHandler(this._runState, gas, this._vm._common) + gas = await dynamicGasHandler(this._runState, gas, this._common) } - if (this._vm.listenerCount('step') > 0 || this._vm.DEBUG) { + if (this._evm.listenerCount('step') > 0 || this._evm.DEBUG) { // Only run this stepHook function if there is an event listener (e.g. test runner) // or if the vm is running in debug mode (to display opcode debug logs) await this._runStepHook(gas, gasLimitClone) @@ -205,9 +210,9 @@ export default class Interpreter { const opFn = this.getOpHandler(opInfo) if (opInfo.isAsync) { - await (opFn as AsyncOpHandler).apply(null, [this._runState, this._vm._common]) + await (opFn as AsyncOpHandler).apply(null, [this._runState, this._common]) } else { - opFn.apply(null, [this._runState, this._vm._common]) + opFn.apply(null, [this._runState, this._common]) } } @@ -215,7 +220,7 @@ export default class Interpreter { * Get the handler function for an opcode. */ getOpHandler(opInfo: Opcode): OpHandler { - return this._vm._handlers.get(opInfo.code)! + return this._evm._handlers.get(opInfo.code)! } /** @@ -223,7 +228,7 @@ export default class Interpreter { */ lookupOpInfo(op: number): Opcode { // if not found, return 0xfe: INVALID - return this._vm._opcodes.get(op) ?? this._vm._opcodes.get(0xfe) + return this._evm._opcodes.get(op) ?? this._evm._opcodes.get(0xfe)! } async _runStepHook(dynamicFee: bigint, gasLeft: bigint): Promise { @@ -249,7 +254,7 @@ export default class Interpreter { codeAddress: this._eei._env.codeAddress, } - if (this._vm.DEBUG) { + if (this._evm.DEBUG) { // Create opTrace for debug functionality let hexStack = [] hexStack = eventObj.stack.map((item: any) => { @@ -296,7 +301,7 @@ export default class Interpreter { * @property {BigInt} memoryWordCount current size of memory in words * @property {Address} codeAddress the address of the code which is currently being ran (this differs from `address` in a `DELEGATECALL` and `CALLCODE` call) */ - return this._vm._emit('step', eventObj) + return this._evm._emit('step', eventObj) } // Returns all valid jump and jumpsub destinations. diff --git a/packages/vm/src/evm/message.ts b/packages/vm/src/evm/message.ts index 267a3c5ba75..a8176b77014 100644 --- a/packages/vm/src/evm/message.ts +++ b/packages/vm/src/evm/message.ts @@ -1,19 +1,53 @@ import { Address } from 'ethereumjs-util' import { PrecompileFunc } from './precompiles' +const defaults = { + value: BigInt(0), + caller: Address.zero(), + data: Buffer.alloc(0), + depth: 0, + isStatic: false, + isCompiled: false, + delegatecall: false, +} + +interface MessageOpts { + to?: Address + value?: bigint + caller?: Address + gasLimit: bigint + data?: Buffer + depth?: number + code?: Buffer | PrecompileFunc + codeAddress?: Address + isStatic?: boolean + isCompiled?: boolean + salt?: Buffer + /** + * A map of addresses to selfdestruct, see {@link Message.selfdestruct} + */ + selfdestruct?: { [key: string]: boolean } | { [key: string]: Buffer } + delegatecall?: boolean + authcallOrigin?: Address +} + export default class Message { - to: Address + to?: Address value: bigint caller: Address gasLimit: bigint data: Buffer depth: number - code: Buffer | PrecompileFunc - _codeAddress: Address + code?: Buffer | PrecompileFunc + _codeAddress?: Address isStatic: boolean isCompiled: boolean - salt: Buffer - selfdestruct: any + salt?: Buffer + /** + * Map of addresses to selfdestruct. Key is the unprefixed address. + * Value is a boolean when marked for destruction and replaced with a Buffer containing the address where the remaining funds are sent. + */ + selfdestruct?: { [key: string]: boolean } | { [key: string]: Buffer } delegatecall: boolean /** * This is used to store the origin of the AUTHCALL, @@ -21,20 +55,20 @@ export default class Message { */ authcallOrigin?: Address - constructor(opts: any) { + constructor(opts: MessageOpts) { this.to = opts.to - this.value = opts.value ? opts.value : BigInt(0) - this.caller = opts.caller + this.value = opts.value ?? defaults.value + this.caller = opts.caller ?? defaults.caller this.gasLimit = opts.gasLimit - this.data = opts.data || Buffer.alloc(0) - this.depth = opts.depth || 0 + this.data = opts.data ?? defaults.data + this.depth = opts.depth ?? defaults.depth this.code = opts.code this._codeAddress = opts.codeAddress - this.isStatic = opts.isStatic || false - this.isCompiled = opts.isCompiled || false // For CALLCODE, TODO: Move from here - this.salt = opts.salt // For CREATE2, TODO: Move from here - this.selfdestruct = opts.selfdestruct // TODO: Move from here - this.delegatecall = opts.delegatecall || false + this.isStatic = opts.isStatic ?? defaults.isStatic + this.isCompiled = opts.isCompiled ?? defaults.isCompiled + this.salt = opts.salt + this.selfdestruct = opts.selfdestruct + this.delegatecall = opts.delegatecall ?? defaults.delegatecall this.authcallOrigin = opts.authcallOrigin if (this.value < 0) { @@ -42,7 +76,16 @@ export default class Message { } } + /** + * Note: should only be called in instances where `_codeAddress` or `to` is defined. + */ get codeAddress(): Address { - return this._codeAddress ? this._codeAddress : this.to + const codeAddress = this._codeAddress ?? this.to + if (!codeAddress) { + throw new Error('Missing codeAddress') + } + return codeAddress } } + +export type MessageWithTo = Message & Pick, 'to'> diff --git a/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts b/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts index a69ccb131f3..e047e63d2e1 100644 --- a/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts +++ b/packages/vm/src/evm/precompiles/0a-bls12-g1add.ts @@ -7,7 +7,7 @@ const { BLS12_381_ToG1Point, BLS12_381_FromG1Point } = require('./util/bls12_381 export default async function (opts: PrecompileInput): Promise { assert(opts.data) - const mcl = opts._VM._mcl + const mcl = opts._EVM._mcl const inputData = opts.data diff --git a/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts b/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts index 619729840df..ca55c75e442 100644 --- a/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts +++ b/packages/vm/src/evm/precompiles/0b-bls12-g1mul.ts @@ -11,7 +11,7 @@ const { export default async function (opts: PrecompileInput): Promise { assert(opts.data) - const mcl = opts._VM._mcl + const mcl = opts._EVM._mcl const inputData = opts.data diff --git a/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts b/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts index 1c217bdbbda..c43f89216ce 100644 --- a/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts +++ b/packages/vm/src/evm/precompiles/0c-bls12-g1multiexp.ts @@ -11,7 +11,7 @@ const { export default async function (opts: PrecompileInput): Promise { assert(opts.data) - const mcl = opts._VM._mcl + const mcl = opts._EVM._mcl const inputData = opts.data diff --git a/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts b/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts index 8b1f5811530..ca87de8ca99 100644 --- a/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts +++ b/packages/vm/src/evm/precompiles/0d-bls12-g2add.ts @@ -7,7 +7,7 @@ const { BLS12_381_ToG2Point, BLS12_381_FromG2Point } = require('./util/bls12_381 export default async function (opts: PrecompileInput): Promise { assert(opts.data) - const mcl = opts._VM._mcl + const mcl = opts._EVM._mcl const inputData = opts.data diff --git a/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts b/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts index 1e0aa4414fd..8480f15d8ca 100644 --- a/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts +++ b/packages/vm/src/evm/precompiles/0e-bls12-g2mul.ts @@ -11,7 +11,7 @@ const { export default async function (opts: PrecompileInput): Promise { assert(opts.data) - const mcl = opts._VM._mcl + const mcl = opts._EVM._mcl const inputData = opts.data diff --git a/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts b/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts index 3d07e27752a..a6dbdbb4a51 100644 --- a/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts +++ b/packages/vm/src/evm/precompiles/0f-bls12-g2multiexp.ts @@ -12,7 +12,7 @@ const { export default async function (opts: PrecompileInput): Promise { assert(opts.data) - const mcl = opts._VM._mcl + const mcl = opts._EVM._mcl const inputData = opts.data diff --git a/packages/vm/src/evm/precompiles/10-bls12-pairing.ts b/packages/vm/src/evm/precompiles/10-bls12-pairing.ts index 7488af2eb9b..8aa94550312 100644 --- a/packages/vm/src/evm/precompiles/10-bls12-pairing.ts +++ b/packages/vm/src/evm/precompiles/10-bls12-pairing.ts @@ -10,7 +10,7 @@ const oneBuffer = Buffer.concat([Buffer.alloc(31, 0), Buffer.from('01', 'hex')]) export default async function (opts: PrecompileInput): Promise { assert(opts.data) - const mcl = opts._VM._mcl + const mcl = opts._EVM._mcl const inputData = opts.data diff --git a/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts b/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts index b069643c210..67310fca024 100644 --- a/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts +++ b/packages/vm/src/evm/precompiles/11-bls12-map-fp-to-g1.ts @@ -7,7 +7,7 @@ const { BLS12_381_ToFpPoint, BLS12_381_FromG1Point } = require('./util/bls12_381 export default async function (opts: PrecompileInput): Promise { assert(opts.data) - const mcl = opts._VM._mcl + const mcl = opts._EVM._mcl const inputData = opts.data diff --git a/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts b/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts index e321eb6c26e..89209dee7ec 100644 --- a/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts +++ b/packages/vm/src/evm/precompiles/12-bls12-map-fp2-to-g2.ts @@ -7,7 +7,7 @@ const { BLS12_381_ToFp2Point, BLS12_381_FromG2Point } = require('./util/bls12_38 export default async function (opts: PrecompileInput): Promise { assert(opts.data) - const mcl = opts._VM._mcl + const mcl = opts._EVM._mcl const inputData = opts.data diff --git a/packages/vm/src/evm/precompiles/types.ts b/packages/vm/src/evm/precompiles/types.ts index 837d2d0c8f7..8983d57b256 100644 --- a/packages/vm/src/evm/precompiles/types.ts +++ b/packages/vm/src/evm/precompiles/types.ts @@ -1,6 +1,6 @@ import Common from '@ethereumjs/common' import { ExecResult } from '../evm' -import VM from '../../index' +import EVM from '../evm' export interface PrecompileFunc { (input: PrecompileInput): Promise | ExecResult @@ -10,5 +10,5 @@ export interface PrecompileInput { data: Buffer gasLimit: bigint _common: Common - _VM: VM + _EVM: EVM } diff --git a/packages/vm/src/evm/txContext.ts b/packages/vm/src/evm/txContext.ts deleted file mode 100644 index ce48c167711..00000000000 --- a/packages/vm/src/evm/txContext.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Address } from 'ethereumjs-util' - -export default class TxContext { - gasPrice: bigint - origin: Address - - constructor(gasPrice: bigint, origin: Address) { - this.gasPrice = gasPrice - this.origin = origin - } -} diff --git a/packages/vm/src/evm/types.ts b/packages/vm/src/evm/types.ts index 78956834398..a12cf8d9b53 100644 --- a/packages/vm/src/evm/types.ts +++ b/packages/vm/src/evm/types.ts @@ -1,3 +1,7 @@ +import { Block } from '@ethereumjs/block' +import { Address } from 'ethereumjs-util' +import EVM from './evm' +import Message from './message' import { OpHandler } from './opcodes' import { AsyncDynamicGasHandler, SyncDynamicGasHandler } from './opcodes/gas' @@ -19,3 +23,147 @@ export type AddOpcode = { } export type CustomOpcode = AddOpcode | DeleteOpcode + +/** + * Options for running a call (or create) operation + */ +export interface RunCallOpts { + /** + * The `@ethereumjs/block` the `tx` belongs to. If omitted a default blank block will be used. + */ + block?: Block + /** + * The gas price for the call. Defaults to `0` + */ + gasPrice?: bigint + /** + * The address where the call originated from. Defaults to the zero address. + */ + origin?: Address + /** + * The address that ran this code (`msg.sender`). Defaults to the zero address. + */ + caller?: Address + /** + * The gas limit for the call. Defaults to `0xffffff` + */ + gasLimit?: bigint + /** + * The to address. Defaults to the zero address. + */ + to?: Address + /** + * The value in ether that is being sent to `opts.to`. Defaults to `0` + */ + value?: bigint + /** + * The data for the call. + */ + data?: Buffer + /** + * This is for CALLCODE where the code to load is different than the code from the `opts.to` address. + */ + code?: Buffer + /** + * The call depth. Defaults to `0` + */ + depth?: number + /** + * If the code location is a precompile. + */ + isCompiled?: boolean + /** + * If the call should be executed statically. Defaults to false. + */ + isStatic?: boolean + /** + * An optional salt to pass to CREATE2. + */ + salt?: Buffer + /** + * Addresses to selfdestruct. Defaults to none. + */ + selfdestruct?: { [k: string]: boolean } + /** + * Skip balance checks if true. Adds transaction value to balance to ensure execution doesn't fail. + */ + skipBalance?: boolean + /** + * If the call is a DELEGATECALL. Defaults to false. + */ + delegatecall?: boolean + /** + * Optionally pass in an already-built message. + */ + message?: Message +} + +/** + * Options for the runCode method. + */ +export interface RunCodeOpts { + /** + * The `@ethereumjs/block` the `tx` belongs to. If omitted a default blank block will be used. + */ + block?: Block + /** + * Pass a custom {@link EVM} to use. If omitted the default {@link EVM} will be used. + */ + evm?: EVM + /** + * The gas price for the call. Defaults to `0` + */ + gasPrice?: bigint + /** + * The address where the call originated from. Defaults to the zero address. + */ + origin?: Address + /** + * The address that ran this code (`msg.sender`). Defaults to the zero address. + */ + caller?: Address + /** + * The EVM code to run. + */ + code?: Buffer + /** + * The input data. + */ + data?: Buffer + /** + * The gas limit for the call. + */ + gasLimit: bigint + /** + * The value in ether that is being sent to `opts.address`. Defaults to `0` + */ + value?: bigint + /** + * The call depth. Defaults to `0` + */ + depth?: number + /** + * If the call should be executed statically. Defaults to false. + */ + isStatic?: boolean + /** + * Addresses to selfdestruct. Defaults to none. + */ + selfdestruct?: { [k: string]: boolean } + /** + * The address of the account that is executing this code (`address(this)`). Defaults to the zero address. + */ + address?: Address + /** + * The initial program counter. Defaults to `0` + */ + pc?: number +} + +/** + * Tx context for vm execution + */ +export interface TxContext { + gasPrice: bigint + origin: Address +} diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index 952ce72d56e..e545ff95d03 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -2,28 +2,15 @@ import { Account, Address, BigIntLike, toType, TypeOutput } from 'ethereumjs-uti import Blockchain from '@ethereumjs/blockchain' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { StateManager, DefaultStateManager } from '@ethereumjs/statemanager' -import { default as runCode, RunCodeOpts } from './runCode' -import { default as runCall, RunCallOpts } from './runCall' import { default as runTx, RunTxOpts, RunTxResult } from './runTx' import { default as runBlock, RunBlockOpts, RunBlockResult } from './runBlock' import { default as buildBlock, BuildBlockOpts, BlockBuilder } from './buildBlock' -import { EVMResult, ExecResult } from './evm/evm' -import { OpcodeList, getOpcodesForHF, OpHandler } from './evm/opcodes' -import { CustomPrecompile, getActivePrecompiles, PrecompileFunc } from './evm/precompiles' +import EVM from './evm/evm' import runBlockchain from './runBlockchain' const AsyncEventEmitter = require('async-eventemitter') import { promisify } from 'util' -import { CustomOpcode } from './evm/types' -import { AsyncDynamicGasHandler, SyncDynamicGasHandler } from './evm/opcodes/gas' import { VmState } from './vmState' - -// very ugly way to detect if we are running in a browser -const isBrowser = new Function('try {return this===window;}catch(e){ return false;}') -let mcl: any - -if (!isBrowser()) { - mcl = require('mcl-wasm') -} +import { getActivePrecompiles } from './evm/precompiles' /** * Options for instantiating a {@link VM}. @@ -74,7 +61,7 @@ export interface VMOpts { */ common?: Common /** - * A {@link StateManager} instance to use as the state store (Beta API) + * A {@link StateManager} instance to use as the state store */ stateManager?: StateManager /** @@ -102,13 +89,6 @@ export interface VMOpts { * Default: `false` */ activateGenesisState?: boolean - /** - * Allows unlimited contract sizes while debugging. By setting this to `true`, the check for - * contract size limit of 24KB (see [EIP-170](https://git.io/vxZkK)) is bypassed. - * - * Default: `false` [ONLY set to `true` during debugging] - */ - allowUnlimitedContractSize?: boolean /** * Select hardfork based upon block number. This automatically switches to the right hard fork based upon the block number. @@ -127,36 +107,6 @@ export interface VMOpts { * pointing to a Shanghai block: this will lead to set the HF as Shanghai and not the Merge). */ hardforkByTD?: BigIntLike - - /** - * Override or add custom opcodes to the VM instruction set - * These custom opcodes are EIP-agnostic and are always statically added - * To delete an opcode, add an entry of format `{opcode: number}`. This will delete that opcode from the VM. - * If this opcode is then used in the VM, the `INVALID` opcode would instead be used. - * To add an opcode, add an entry of the following format: - * { - * // The opcode number which will invoke the custom opcode logic - * opcode: number - * // The name of the opcode (as seen in the `step` event) - * opcodeName: string - * // The base fee of the opcode - * baseFee: number - * // If the opcode charges dynamic gas, add this here. To charge the gas, use the `i` methods of the BN, to update the charged gas - * gasFunction?: function(runState: RunState, gas: BN, common: Common) - * // The logic of the opcode which holds the logic of changing the current state - * logicFunction: function(runState: RunState) - * } - * Note: gasFunction and logicFunction can both be async or synchronous functions - */ - - customOpcodes?: CustomOpcode[] - /* - * Adds custom precompiles. This is hardfork-agnostic: these precompiles are always activated - * If only an address is given, the precompile is deleted - * If an address and a `PrecompileFunc` is given, this precompile is inserted or overridden - * Please ensure `PrecompileFunc` has exactly one parameter `input: PrecompileInput` - */ - customPrecompiles?: CustomPrecompile[] } /** @@ -178,24 +128,16 @@ export default class VM extends AsyncEventEmitter { readonly _common: Common + /** + * The EVM used for bytecode execution + */ + readonly evm: EVM + protected readonly _opts: VMOpts protected _isInitialized: boolean = false - public readonly _allowUnlimitedContractSize: boolean - // This opcode data is always set since `getActiveOpcodes()` is called in the constructor - protected _opcodes!: OpcodeList - protected _handlers!: Map - protected _dynamicGasHandlers!: Map protected readonly _hardforkByBlockNumber: boolean protected readonly _hardforkByTD?: bigint - protected readonly _customOpcodes?: CustomOpcode[] - protected readonly _customPrecompiles?: CustomPrecompile[] - - protected _precompiles!: Map - - public get precompiles() { - return this._precompiles - } /** * Cached emit() function, not for public usage @@ -203,12 +145,6 @@ export default class VM extends AsyncEventEmitter { * @hidden */ public readonly _emit: (topic: string, data: any) => Promise - /** - * Pointer to the mcl package, not for public usage - * set to public due to implementation internals - * @hidden - */ - public readonly _mcl: any // /** * VM is run in DEBUG mode (default: false) @@ -243,9 +179,6 @@ export default class VM extends AsyncEventEmitter { super() this._opts = opts - this._customOpcodes = opts.customOpcodes - - this._customPrecompiles = opts.customPrecompiles // Throw on chain or hardfork options removed in latest major release // to prevent implicit chain setup on a wrong chain @@ -293,15 +226,6 @@ export default class VM extends AsyncEventEmitter { ) } - this._common.on('hardforkChanged', () => { - this.getActiveOpcodes() - this._precompiles = getActivePrecompiles(this._common, this._customPrecompiles) - }) - - // Set list of opcodes based on HF - this.getActiveOpcodes() - this._precompiles = getActivePrecompiles(this._common, this._customPrecompiles) - if (opts.stateManager) { this.stateManager = opts.stateManager } else { @@ -313,7 +237,11 @@ export default class VM extends AsyncEventEmitter { this.blockchain = opts.blockchain ?? new (Blockchain as any)({ common: this._common }) - this._allowUnlimitedContractSize = opts.allowUnlimitedContractSize ?? false + this.evm = new EVM({ + common: this._common, + vmState: this.vmState, + blockchain: this.blockchain, + }) if (opts.hardforkByBlockNumber !== undefined && opts.hardforkByTD !== undefined) { throw new Error( @@ -324,14 +252,6 @@ export default class VM extends AsyncEventEmitter { this._hardforkByBlockNumber = opts.hardforkByBlockNumber ?? false this._hardforkByTD = toType(opts.hardforkByTD, TypeOutput.BigInt) - if (this._common.isActivatedEIP(2537)) { - if (isBrowser()) { - throw new Error('EIP-2537 is currently not supported in browsers') - } else { - this._mcl = mcl - } - } - // Safeguard if "process" is not available (browser) if (process !== undefined && process.env.DEBUG) { this.DEBUG = true @@ -367,19 +287,6 @@ export default class VM extends AsyncEventEmitter { } await this.vmState.commit() } - - if (this._common.isActivatedEIP(2537)) { - if (isBrowser()) { - throw new Error('EIP-2537 is currently not supported in browsers') - } else { - const mcl = this._mcl - await mcl.init(mcl.BLS12_381) // ensure that mcl is initialized. - mcl.setMapToMode(mcl.IRTF) // set the right map mode; otherwise mapToG2 will return wrong values. - mcl.verifyOrderG1(1) // subgroup checks for G1 - mcl.verifyOrderG2(1) // subgroup checks for G2 - } - } - this._isInitialized = true } @@ -421,28 +328,6 @@ export default class VM extends AsyncEventEmitter { return runTx.bind(this)(opts) } - /** - * runs a call (or create) operation. - * - * This method modifies the state. - * - * @param {RunCallOpts} opts - */ - async runCall(opts: RunCallOpts): Promise { - return runCall.bind(this)(opts) - } - - /** - * Runs EVM code. - * - * This method modifies the state. - * - * @param {RunCodeOpts} opts - */ - async runCode(opts: RunCodeOpts): Promise { - return runCode.bind(this)(opts) - } - /** * Build a block on top of the current state * by adding one transaction at a time. @@ -461,18 +346,6 @@ export default class VM extends AsyncEventEmitter { return buildBlock.bind(this)(opts) } - /** - * Returns a list with the currently activated opcodes - * available for VM execution - */ - getActiveOpcodes(): OpcodeList { - const data = getOpcodesForHF(this._common, this._customOpcodes) - this._opcodes = data.opcodes - this._dynamicGasHandlers = data.dynamicGasHandlers - this._handlers = data.handlers - return data.opcodes - } - /** * Returns a copy of the {@link VM} instance. */ diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index db0e517374d..46d4a8a60d3 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -437,9 +437,9 @@ export function encodeReceipt(receipt: TxReceipt, txType: number) { RLP.encode( bufArrToArr([ (receipt as PreByzantiumTxReceipt).stateRoot ?? - (receipt as PostByzantiumTxReceipt).status === 0 - ? Buffer.from([]) - : Buffer.from('01', 'hex'), + ((receipt as PostByzantiumTxReceipt).status === 0 + ? Buffer.from([]) + : Buffer.from('01', 'hex')), bigIntToBuffer(receipt.gasUsed), receipt.bitvector, receipt.logs, diff --git a/packages/vm/src/runCall.ts b/packages/vm/src/runCall.ts deleted file mode 100644 index 16798816828..00000000000 --- a/packages/vm/src/runCall.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { Address } from 'ethereumjs-util' -import { Block } from '@ethereumjs/block' -import VM from './index' -import TxContext from './evm/txContext' -import Message from './evm/message' -import { default as EVM, EVMResult } from './evm/evm' - -/** - * Options for running a call (or create) operation - */ -export interface RunCallOpts { - /** - * The `@ethereumjs/block` the `tx` belongs to. If omitted a default blank block will be used. - */ - block?: Block - /** - * The gas price for the call. Defaults to `0` - */ - gasPrice?: bigint - /** - * The address where the call originated from. Defaults to the zero address. - */ - origin?: Address - /** - * The address that ran this code (`msg.sender`). Defaults to the zero address. - */ - caller?: Address - /** - * The gas limit for the call. Defaults to `0xffffff` - */ - gasLimit?: bigint - /** - * The to address. Defaults to the zero address. - */ - to?: Address - /** - * The value in ether that is being sent to `opts.to`. Defaults to `0` - */ - value?: bigint - /** - * The data for the call. - */ - data?: Buffer - /** - * This is for CALLCODE where the code to load is different than the code from the `opts.to` address. - */ - code?: Buffer - /** - * The call depth. Defaults to `0` - */ - depth?: number - /** - * If the code location is a precompile. - */ - isCompiled?: boolean - /** - * If the call should be executed statically. Defaults to false. - */ - isStatic?: boolean - /** - * An optional salt to pass to CREATE2. - */ - salt?: Buffer - /** - * Addresses to selfdestruct. Defaults to none. - */ - selfdestruct?: { [k: string]: boolean } - /** - * Skip balance checks if true. Adds transaction value to balance to ensure execution doesn't fail. - */ - skipBalance?: boolean - /** - * If the call is a DELEGATECALL. Defaults to false. - */ - delegatecall?: boolean -} - -/** - * @ignore - */ -export default async function runCall(this: VM, opts: RunCallOpts): Promise { - const block = opts.block ?? Block.fromBlockData({}, { common: this._common }) - - const txContext = new TxContext( - opts.gasPrice ?? BigInt(0), - opts.origin ?? opts.caller ?? Address.zero() - ) - - const caller = opts.caller ?? Address.zero() - const value = opts.value ?? BigInt(0) - - if (opts.skipBalance) { - // if skipBalance, add `value` to caller balance to ensure sufficient funds - const callerAccount = await this.stateManager.getAccount(caller) - callerAccount.balance += value - await this.stateManager.putAccount(caller, callerAccount) - } - - const message = new Message({ - caller, - gasLimit: opts.gasLimit ?? BigInt(0xffffff), - to: opts.to ?? undefined, - value, - data: opts.data, - code: opts.code, - depth: opts.depth ?? 0, - isCompiled: opts.isCompiled ?? false, - isStatic: opts.isStatic ?? false, - salt: opts.salt ?? null, - selfdestruct: opts.selfdestruct ?? {}, - delegatecall: opts.delegatecall ?? false, - }) - - const evm = new EVM(this, txContext, block) - - return evm.executeMessage(message) -} diff --git a/packages/vm/src/runCode.ts b/packages/vm/src/runCode.ts deleted file mode 100644 index 13251375509..00000000000 --- a/packages/vm/src/runCode.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* - -This is the core of the Ethereum Virtual Machine (EVM or just VM). - -NOTES: - -1. Stack items are lazily duplicated, so you must never directly change a buffer -from the stack, instead you should `copy` it first. - -2. Not all stack items are 32 bytes, so if the operation relies on the stack -item length then you must use `utils.pad(, 32)` first. - -*/ -import { Address } from 'ethereumjs-util' -import { Block } from '@ethereumjs/block' -import VM from './index' -import TxContext from './evm/txContext' -import Message from './evm/message' -import { default as EVM, ExecResult } from './evm/evm' - -/** - * Options for the {@link runCode} method. - */ -export interface RunCodeOpts { - /** - * The `@ethereumjs/block` the `tx` belongs to. If omitted a default blank block will be used. - */ - block?: Block - /** - * Pass a custom {@link EVM} to use. If omitted the default {@link EVM} will be used. - */ - evm?: EVM - /** - * The gas price for the call. Defaults to `0` - */ - gasPrice?: bigint - /** - * The address where the call originated from. Defaults to the zero address. - */ - origin?: Address - /** - * The address that ran this code (`msg.sender`). Defaults to the zero address. - */ - caller?: Address - /** - * The EVM code to run. - */ - code?: Buffer - /** - * The input data. - */ - data?: Buffer - /** - * The gas limit for the call. - */ - gasLimit: bigint - /** - * The value in ether that is being sent to `opts.address`. Defaults to `0` - */ - value?: bigint - /** - * The call depth. Defaults to `0` - */ - depth?: number - /** - * If the call should be executed statically. Defaults to false. - */ - isStatic?: boolean - /** - * Addresses to selfdestruct. Defaults to none. - */ - selfdestruct?: { [k: string]: boolean } - /** - * The address of the account that is executing this code (`address(this)`). Defaults to the zero address. - */ - address?: Address - /** - * The initial program counter. Defaults to `0` - */ - pc?: number -} - -/** - * @ignore - */ -export default function runCode(this: VM, opts: RunCodeOpts): Promise { - const block = opts.block ?? Block.fromBlockData({}, { common: this._common }) - - const txContext = new TxContext( - opts.gasPrice ?? BigInt(0), - opts.origin ?? opts.caller ?? Address.zero() - ) - - const message = new Message({ - code: opts.code, - data: opts.data, - gasLimit: opts.gasLimit, - to: opts.address ?? Address.zero(), - caller: opts.caller, - value: opts.value, - depth: opts.depth ?? 0, - selfdestruct: opts.selfdestruct ?? {}, - isStatic: opts.isStatic ?? false, - }) - - const evm = opts.evm ?? new EVM(this, txContext, block) - - return evm.runInterpreter(message, { pc: opts.pc }) -} diff --git a/packages/vm/src/runTx.ts b/packages/vm/src/runTx.ts index 0e652539959..7383d904174 100644 --- a/packages/vm/src/runTx.ts +++ b/packages/vm/src/runTx.ts @@ -13,9 +13,7 @@ import { } from '@ethereumjs/tx' import VM from './index' import Bloom from './bloom' -import { default as EVM, EVMResult } from './evm/evm' -import Message from './evm/message' -import TxContext from './evm/txContext' +import { EVMResult } from './evm/evm' import type { TxReceipt, BaseTxReceipt, @@ -211,7 +209,7 @@ export default async function runTx(this: VM, opts: RunTxOpts): Promise { if (this._common.isActivatedEIP(2929)) { // Add origin and precompiles to warm addresses - const activePrecompiles = this.precompiles + const activePrecompiles = this.evm.precompiles for (const [addressStr] of activePrecompiles.entries()) { state.addWarmedAddress(Buffer.from(addressStr, 'hex')) } @@ -397,16 +395,8 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { /* * Execute message */ - const txContext = new TxContext(gasPrice, caller) const { value, data, to } = tx - const message = new Message({ - caller, - gasLimit, - to, - value: value, - data, - }) - const evm = new EVM(this, txContext, block) + if (this.DEBUG) { debug( `Running tx=0x${ @@ -417,7 +407,16 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { ) } - const results = (await evm.executeMessage(message)) as RunTxResult + const results = (await this.evm.runCall({ + block, + gasPrice, + caller, + gasLimit, + to, + value, + data, + })) as RunTxResult + if (this.DEBUG) { const { gasUsed, exceptionError, returnValue } = results.execResult debug('-'.repeat(100)) @@ -509,8 +508,10 @@ async function _runTx(this: VM, opts: RunTxOpts): Promise { } } } + this.evm._refund = BigInt(0) await state.cleanupTouchedAccounts() state.clearOriginalStorageCache() + if (this._common.isActivatedEIP(1153)) this.evm._transientStorage.clear() // Generate the tx receipt const gasUsed = opts.blockGasUsed !== undefined ? opts.blockGasUsed : block.header.gasUsed diff --git a/packages/vm/src/state/transientStorage.ts b/packages/vm/src/state/transientStorage.ts index 1808bc22c68..ebb2cdc8f71 100644 --- a/packages/vm/src/state/transientStorage.ts +++ b/packages/vm/src/state/transientStorage.ts @@ -117,4 +117,12 @@ export default class TransientStorage { } return result } + + /** + * Clear transient storage state. + */ + public clear(): void { + this._storage = new Map() + this._changeJournal = [] + } } diff --git a/packages/vm/tests/api/EIPs/eip-1153.spec.ts b/packages/vm/tests/api/EIPs/eip-1153.spec.ts index 3543362c719..feadcfe7ecd 100644 --- a/packages/vm/tests/api/EIPs/eip-1153.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-1153.spec.ts @@ -22,9 +22,9 @@ tape('EIP 1153: transient storage', (t) => { const runTest = async function (test: Test, st: tape.Test) { let i = 0 let currentGas = initialGas - const vm = new (VM as any)({ common }) + const vm = await VM.create({ common }) - vm.on('step', function (step: any) { + vm.evm.on('step', function (step: any) { const gasUsed = currentGas - step.gasLeft currentGas = step.gasLeft diff --git a/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts b/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts index 56f61d16cfe..03ec12664fc 100644 --- a/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-1283-net-gas-metering.spec.ts @@ -51,7 +51,7 @@ tape('Constantinople: EIP-1283', async (t) => { } try { - const res = await vm.runCall(runCallArgs) + const res = await vm.evm.runCall(runCallArgs) st.equal(res.execResult.exceptionError, undefined) st.equal(res.execResult.gasUsed, BigInt(testCase.used)) st.equal(res.gasRefund, BigInt(testCase.refund)) diff --git a/packages/vm/tests/api/EIPs/eip-2315.spec.ts b/packages/vm/tests/api/EIPs/eip-2315.spec.ts index 5a68ed23591..6e4b8f288ce 100644 --- a/packages/vm/tests/api/EIPs/eip-2315.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2315.spec.ts @@ -9,7 +9,7 @@ tape('Berlin: EIP 2315 tests', (t) => { let i = 0 const vm = await VM.create({ common }) - vm.on('step', function (step: any) { + vm.evm.on('step', function (step: any) { if (test.steps.length) { st.equal(step.pc, test.steps[i].expectedPC) st.equal(step.opcode.name, test.steps[i].expectedOpcode) @@ -17,7 +17,7 @@ tape('Berlin: EIP 2315 tests', (t) => { i++ }) - const result = await vm.runCode({ + const result = await vm.evm.runCode({ code: Buffer.from(test.code, 'hex'), gasLimit: BigInt(0xffffffffff), }) diff --git a/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts b/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts index cae1a81de53..2eea2b65f85 100644 --- a/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2537-BLS.spec.ts @@ -25,7 +25,7 @@ tape('EIP-2537 BLS tests', (t) => { for (const address of precompiles) { const to = new Address(Buffer.from(address, 'hex')) - const result = await vm.runCall({ + const result = await vm.evm.runCall({ caller: Address.zero(), gasLimit: BigInt(0xffffffffff), to, @@ -56,7 +56,7 @@ tape('EIP-2537 BLS tests', (t) => { for (const address of precompiles) { const to = new Address(Buffer.from(address, 'hex')) - const result = await vm.runCall({ + const result = await vm.evm.runCall({ caller: Address.zero(), gasLimit: BigInt(0xffffffffff), to, @@ -104,7 +104,7 @@ tape('EIP-2537 BLS tests', (t) => { data: Buffer.from(testVector, 'hex'), gasLimit: BigInt(5000000), _common: common, - _VM: vm, + _EVM: vm.evm, }) st.deepEqual( diff --git a/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts b/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts index 9f371f25c81..39f1f949e83 100644 --- a/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2565-modexp-gas-cost.spec.ts @@ -14,7 +14,7 @@ tape('EIP-2565 ModExp gas cost tests', (t) => { for (const test of testData) { const testName = test.Name const to = new Address(Buffer.from('0000000000000000000000000000000000000005', 'hex')) - const result = await vm.runCall({ + const result = await vm.evm.runCall({ caller: Address.zero(), gasLimit: BigInt(0xffffffffff), to, diff --git a/packages/vm/tests/api/EIPs/eip-2929.spec.ts b/packages/vm/tests/api/EIPs/eip-2929.spec.ts index 06c4dfc95dd..111217f6b32 100644 --- a/packages/vm/tests/api/EIPs/eip-2929.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2929.spec.ts @@ -19,7 +19,7 @@ tape('EIP 2929: gas cost tests', (t) => { let currentGas = initialGas const vm = await VM.create({ common }) - vm.on('step', function (step: any) { + vm.evm.on('step', function (step: any) { const gasUsed = currentGas - step.gasLeft currentGas = step.gasLeft diff --git a/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts b/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts index 004e3445def..1363c7b5e9b 100644 --- a/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-2930-accesslists.spec.ts @@ -63,7 +63,7 @@ tape('EIP-2930 Optional Access Lists tests', (t) => { let trace: any = [] - vm.on('step', (o: any) => { + vm.evm.on('step', (o: any) => { trace.push([o.opcode.name, o.gasLeft]) }) diff --git a/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts b/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts index e5c50bc7b6c..ea989ee4b09 100644 --- a/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3074-authcall.spec.ts @@ -327,7 +327,7 @@ tape('EIP-3074 AUTHCALL', (t) => { let gas: bigint - vm.on('step', (e: InterpreterStep) => { + vm.evm.on('step', (e: InterpreterStep) => { if (e.opcode.name === 'AUTHCALL') { gas = e.gasLeft } @@ -371,7 +371,7 @@ tape('EIP-3074 AUTHCALL', (t) => { let gas: bigint - vm.on('step', async (e: InterpreterStep) => { + vm.evm.on('step', async (e: InterpreterStep) => { if (e.opcode.name === 'AUTHCALL') { gas = e.gasLeft // This thus overrides the first time AUTHCALL is used and thus the gas for the second call is stored } @@ -413,7 +413,7 @@ tape('EIP-3074 AUTHCALL', (t) => { let gas: bigint let gasAfterCall: bigint - vm.on('step', async (e: InterpreterStep) => { + vm.evm.on('step', async (e: InterpreterStep) => { if (gas && gasAfterCall === undefined) { gasAfterCall = e.gasLeft } @@ -459,7 +459,7 @@ tape('EIP-3074 AUTHCALL', (t) => { let gas: bigint - vm.on('step', (e: InterpreterStep) => { + vm.evm.on('step', (e: InterpreterStep) => { if (e.opcode.name === 'AUTHCALL') { gas = e.gasLeft } diff --git a/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts b/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts index f724fe61962..023fb3ee88a 100644 --- a/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3198-BaseFee.spec.ts @@ -79,7 +79,7 @@ tape('EIP3198 tests', (t) => { // Track stack let stack: any = [] - vm.on('step', (istep: InterpreterStep) => { + vm.evm.on('step', (istep: InterpreterStep) => { if (istep.opcode.name === 'STOP') { stack = istep.stack } diff --git a/packages/vm/tests/api/EIPs/eip-3529.spec.ts b/packages/vm/tests/api/EIPs/eip-3529.spec.ts index 2e76dd51cfb..70e859e71cd 100644 --- a/packages/vm/tests/api/EIPs/eip-3529.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3529.spec.ts @@ -116,7 +116,7 @@ tape('EIP-3529 tests', (t) => { let gasRefund: bigint let gasLeft: bigint - vm.on('step', (step: InterpreterStep) => { + vm.evm.on('step', (step: InterpreterStep) => { if (step.opcode.name === 'STOP') { gasRefund = step.gasRefund gasLeft = step.gasLeft @@ -138,7 +138,7 @@ tape('EIP-3529 tests', (t) => { await vm.stateManager.getContractStorage(address, key) vm.vmState.addWarmedStorage(address.toBuffer(), key) - await vm.runCode({ + await vm.evm.runCode({ code, address, gasLimit, @@ -146,12 +146,12 @@ tape('EIP-3529 tests', (t) => { const gasUsed = gasLimit - gasLeft! const effectiveGas = gasUsed - gasRefund! - st.equal(effectiveGas, BigInt(testCase.effectiveGas), 'correct effective gas') st.equal(gasUsed, BigInt(testCase.usedGas), 'correct used gas') // clear the storage cache, otherwise next test will use current original value vm.vmState.clearOriginalStorageCache() + vm.evm._refund = 0n } st.end() @@ -185,7 +185,7 @@ tape('EIP-3529 tests', (t) => { let startGas: bigint let finalGas: bigint - vm.on('step', (step: InterpreterStep) => { + vm.evm.on('step', (step: InterpreterStep) => { if (startGas === undefined) { startGas = step.gasLeft } diff --git a/packages/vm/tests/api/EIPs/eip-3541.spec.ts b/packages/vm/tests/api/EIPs/eip-3541.spec.ts index 115be0ffad5..d03ee892dd3 100644 --- a/packages/vm/tests/api/EIPs/eip-3541.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3541.spec.ts @@ -71,7 +71,7 @@ tape('EIP 3541 tests', (t) => { const vm = await VM.create({ common }) let address: Address - vm.on('step', (step: InterpreterStep) => { + vm.evm.on('step', (step: InterpreterStep) => { if (step.depth === 1) { address = step.address } @@ -108,7 +108,7 @@ tape('EIP 3541 tests', (t) => { const vm = await VM.create({ common }) let address: Address - vm.on('step', (step: InterpreterStep) => { + vm.evm.on('step', (step: InterpreterStep) => { if (step.depth === 1) { address = step.address } diff --git a/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts b/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts index 785744f0a10..604aaf0fbe6 100644 --- a/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3651-warm-coinbase.spec.ts @@ -30,7 +30,7 @@ const code = Buffer.from('60008080806001415AF100', 'hex') const contractAddress = new Address(Buffer.from('ee'.repeat(20), 'hex')) async function getVM(common: Common) { - const vm = new (VM as any)({ common: common }) + const vm = await VM.create({ common: common }) const account = await vm.stateManager.getAccount(sender) const balance = GWEI * BigInt(21000) * BigInt(10000000) account.balance = balance diff --git a/packages/vm/tests/api/EIPs/eip-3855.spec.ts b/packages/vm/tests/api/EIPs/eip-3855.spec.ts index 7bc71823dc6..2f67e4487e9 100644 --- a/packages/vm/tests/api/EIPs/eip-3855.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-3855.spec.ts @@ -16,14 +16,14 @@ tape('EIP 3541 tests', (t) => { const vm = await VM.create({ common }) let stack: bigint[] - vm.on('step', (e: InterpreterStep) => { + vm.evm.on('step', (e: InterpreterStep) => { if (stack) { st.fail('should only do PUSH0 once') } stack = e.stack }) - const result = await vm.runCode({ + const result = await vm.evm.runCode({ code: Buffer.from('5F', 'hex'), gasLimit: BigInt(10), }) @@ -38,13 +38,13 @@ tape('EIP 3541 tests', (t) => { const vm = await VM.create({ common }) let stack: bigint[] = [] - vm.on('step', (e: InterpreterStep) => { + vm.evm.on('step', (e: InterpreterStep) => { stack = e.stack }) const depth = Number(common.param('vm', 'stackLimit')) - const result = await vm.runCode({ + const result = await vm.evm.runCode({ code: Buffer.from('5F'.repeat(depth), 'hex'), gasLimit: BigInt(10000), }) @@ -64,7 +64,7 @@ tape('EIP 3541 tests', (t) => { const depth = Number(common.param('vm', 'stackLimit')!) + 1 - const result = await vm.runCode({ + const result = await vm.evm.runCode({ code: Buffer.from('5F'.repeat(depth), 'hex'), gasLimit: BigInt(10000), }) @@ -76,7 +76,7 @@ tape('EIP 3541 tests', (t) => { t.test('push0 is not available if EIP3855 is not activated', async (st) => { const vm = await VM.create({ common: commonNoEIP3855 }) - const result = await vm.runCode({ + const result = await vm.evm.runCode({ code: Buffer.from('5F', 'hex'), gasLimit: BigInt(10000), }) diff --git a/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts b/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts index c12e9d02c5d..7fe56741f6b 100644 --- a/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts +++ b/packages/vm/tests/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts @@ -24,7 +24,7 @@ tape('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', (t) => { // Track stack let stack: any = [] - vm.on('step', (istep: InterpreterStep) => { + vm.evm.on('step', (istep: InterpreterStep) => { if (istep.opcode.name === 'STOP') { stack = istep.stack } @@ -34,7 +34,7 @@ tape('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', (t) => { code: Buffer.from('4400', 'hex'), gasLimit: BigInt(0xffff), } - await vm.runCode({ ...runCodeArgs, block }) + await vm.evm.runCode({ ...runCodeArgs, block }) st.equal(stack[0], block.header.difficulty, '0x44 returns DIFFICULTY (London)') common.setHardfork(Hardfork.Merge) @@ -48,7 +48,7 @@ tape('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', (t) => { }, { common } ) - await vm.runCode({ ...runCodeArgs, block }) + await vm.evm.runCode({ ...runCodeArgs, block }) st.equal(stack[0], prevRandao, '0x44 returns PREVRANDAO (Merge)') st.end() diff --git a/packages/vm/tests/api/customChain.spec.ts b/packages/vm/tests/api/customChain.spec.ts index db3e2f61b37..901bbb655bc 100644 --- a/packages/vm/tests/api/customChain.spec.ts +++ b/packages/vm/tests/api/customChain.spec.ts @@ -93,7 +93,7 @@ tape('VM initialized with custom state ', (t) => { const vm = await VM.create({ common, activateGenesisState: true }) const sigHash = new Interface(['function retrieve()']).getSighash('retrieve') - const callResult = await vm.runCall({ + const callResult = await vm.evm.runCall({ to: Address.fromString(contractAddress), data: Buffer.from(sigHash.slice(2), 'hex'), caller: Address.fromPrivateKey(privateKey), diff --git a/packages/vm/tests/api/customPrecompiles.spec.ts b/packages/vm/tests/api/customPrecompiles.spec.ts index ce534d7b18f..391938b04d4 100644 --- a/packages/vm/tests/api/customPrecompiles.spec.ts +++ b/packages/vm/tests/api/customPrecompiles.spec.ts @@ -2,7 +2,7 @@ import tape from 'tape' import VM from '../../src' import { Address } from 'ethereumjs-util' import { PrecompileInput } from '../../src/evm/precompiles' -import { ExecResult } from '../../src/evm/evm' +import EVM, { ExecResult } from '../../src/evm/evm' const sender = new Address(Buffer.from('44'.repeat(20), 'hex')) const newPrecompile = new Address(Buffer.from('ff'.repeat(20), 'hex')) @@ -17,9 +17,9 @@ function customPrecompile(_input: PrecompileInput): ExecResult { } } -tape('VM -> custom precompiles', (t) => { +tape('EVM -> custom precompiles', (t) => { t.test('should override existing precompiles', async (st) => { - const VMOverride = await VM.create({ + const EVMOverride = await EVM.create({ customPrecompiles: [ { address: shaAddress, @@ -27,7 +27,7 @@ tape('VM -> custom precompiles', (t) => { }, ], }) - const result = await VMOverride.runCall({ + const result = await EVMOverride.runCall({ to: shaAddress, gasLimit: BigInt(30000), data: Buffer.from(''), @@ -38,14 +38,14 @@ tape('VM -> custom precompiles', (t) => { }) t.test('should delete existing precompiles', async (st) => { - const VMOverride = await VM.create({ + const EVMOverride = await EVM.create({ customPrecompiles: [ { address: shaAddress, }, ], }) - const result = await VMOverride.runCall({ + const result = await EVMOverride.runCall({ to: shaAddress, gasLimit: BigInt(30000), data: Buffer.from(''), @@ -56,7 +56,7 @@ tape('VM -> custom precompiles', (t) => { }) t.test('should add precompiles', async (st) => { - const VMOverride = await VM.create({ + const EVMOverride = await EVM.create({ customPrecompiles: [ { address: newPrecompile, @@ -64,7 +64,7 @@ tape('VM -> custom precompiles', (t) => { }, ], }) - const result = await VMOverride.runCall({ + const result = await EVMOverride.runCall({ to: newPrecompile, gasLimit: BigInt(30000), data: Buffer.from(''), @@ -76,13 +76,13 @@ tape('VM -> custom precompiles', (t) => { t.test('should not persist changes to precompiles', async (st) => { let VMSha = await VM.create() - const shaResult = await VMSha.runCall({ + const shaResult = await VMSha.evm.runCall({ to: shaAddress, gasLimit: BigInt(30000), data: Buffer.from(''), caller: sender, }) - const VMOverride = await VM.create({ + const EVMOverride = await EVM.create({ customPrecompiles: [ { address: shaAddress, @@ -90,7 +90,7 @@ tape('VM -> custom precompiles', (t) => { }, ], }) - const result = await VMOverride.runCall({ + const result = await EVMOverride.runCall({ to: shaAddress, gasLimit: BigInt(30000), data: Buffer.from(''), @@ -100,7 +100,7 @@ tape('VM -> custom precompiles', (t) => { st.ok(result.execResult.returnValue.equals(expectedReturn), 'return value is correct') st.ok(result.execResult.gasUsed === expectedGas, 'gas used is correct') VMSha = await VM.create() - const shaResult2 = await VMSha.runCall({ + const shaResult2 = await VMSha.evm.runCall({ to: shaAddress, gasLimit: BigInt(30000), data: Buffer.from(''), diff --git a/packages/vm/tests/api/events.spec.ts b/packages/vm/tests/api/events.spec.ts index 76d9a4150c1..95e647b3c5e 100644 --- a/packages/vm/tests/api/events.spec.ts +++ b/packages/vm/tests/api/events.spec.ts @@ -99,7 +99,7 @@ tape('VM events', (t) => { const address = Address.fromPrivateKey(privKey) await vm.stateManager.putAccount(address, new Account(BigInt(0), BigInt(0x11111111))) let emitted: any - vm.on('beforeMessage', (val: any) => { + vm.evm.on('beforeMessage', (val: any) => { emitted = val }) @@ -123,7 +123,7 @@ tape('VM events', (t) => { const address = Address.fromPrivateKey(privKey) await vm.stateManager.putAccount(address, new Account(BigInt(0), BigInt(0x11111111))) let emitted: any - vm.on('afterMessage', (val: any) => { + vm.evm.on('afterMessage', (val: any) => { emitted = val }) @@ -145,7 +145,7 @@ tape('VM events', (t) => { const vm = await VM.create() let lastEmitted: any - vm.on('step', (val: any) => { + vm.evm.on('step', (val: any) => { lastEmitted = val }) @@ -169,7 +169,7 @@ tape('VM events', (t) => { const vm = await VM.create() let emitted: any - vm.on('newContract', (val: any) => { + vm.evm.on('newContract', (val: any) => { emitted = val }) diff --git a/packages/vm/tests/api/evm/customOpcodes.spec.ts b/packages/vm/tests/api/evm/customOpcodes.spec.ts index 7414760d709..c5b9f84087c 100644 --- a/packages/vm/tests/api/evm/customOpcodes.spec.ts +++ b/packages/vm/tests/api/evm/customOpcodes.spec.ts @@ -2,6 +2,7 @@ import tape from 'tape' import VM from '../../../src' import { AddOpcode } from '../../../src/evm/types' import { InterpreterStep, RunState } from '../../../src/evm/interpreter' +import EVM from '../../../src/evm/evm' tape('VM: custom opcodes', (t) => { const fee = 333 @@ -22,17 +23,17 @@ tape('VM: custom opcodes', (t) => { } t.test('should add custom opcodes to the VM', async (st) => { - const vm = await VM.create({ + const evm = await EVM.create({ customOpcodes: [testOpcode], }) const gas = 123456 let correctOpcodeName = false - vm.on('step', (e: InterpreterStep) => { + evm.on('step', (e: InterpreterStep) => { if (e.pc === 0) { correctOpcodeName = e.opcode.name === testOpcode.opcodeName } }) - const res = await vm.runCode({ + const res = await evm.runCode({ code: Buffer.from('21', 'hex'), gasLimit: BigInt(gas), }) @@ -42,11 +43,11 @@ tape('VM: custom opcodes', (t) => { }) t.test('should delete opcodes from the VM', async (st) => { - const vm = await VM.create({ + const evm = await EVM.create({ customOpcodes: [{ opcode: 0x20 }], // deletes KECCAK opcode }) const gas = BigInt(123456) - const res = await vm.runCode({ + const res = await evm.runCode({ code: Buffer.from('20', 'hex'), gasLimit: BigInt(gas), }) @@ -56,11 +57,11 @@ tape('VM: custom opcodes', (t) => { t.test('should not override default opcodes', async (st) => { // This test ensures that always the original opcode map is used // Thus, each time you recreate a VM, it is in a clean state - const vm = await VM.create({ + const evm = await EVM.create({ customOpcodes: [{ opcode: 0x01 }], // deletes ADD opcode }) const gas = BigInt(123456) - const res = await vm.runCode({ + const res = await evm.runCode({ code: Buffer.from('01', 'hex'), gasLimit: BigInt(gas), }) @@ -76,7 +77,7 @@ tape('VM: custom opcodes', (t) => { // PUSH 01 // RETURNDATA length // PUSH 1F // RETURNDATA offset // RETURN // Returns 0x05 - const result = await vmDefault.runCode({ + const result = await vmDefault.evm.runCode({ code: Buffer.from('60046001016000526001601FF3', 'hex'), gasLimit: BigInt(gas), }) @@ -85,11 +86,11 @@ tape('VM: custom opcodes', (t) => { t.test('should override opcodes in the VM', async (st) => { testOpcode.opcode = 0x20 // Overrides KECCAK - const vm = await VM.create({ + const evm = await EVM.create({ customOpcodes: [testOpcode], }) const gas = 123456 - const res = await vm.runCode({ + const res = await evm.runCode({ code: Buffer.from('20', 'hex'), gasLimit: BigInt(gas), }) diff --git a/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts b/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts index 1a671c68f1f..b0bf26d819b 100644 --- a/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/06-ecadd.spec.ts @@ -14,7 +14,7 @@ tape('Precompiles: ECADD', (t) => { data: Buffer.alloc(0), gasLimit: BigInt(0xffff), _common: common, - _VM: vm, + _EVM: vm.evm, }) st.deepEqual(result.gasUsed, BigInt(500), 'should use petersburg gas costs') diff --git a/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts b/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts index f19b15f957b..a763c00cf74 100644 --- a/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/07-ecmul.spec.ts @@ -13,7 +13,7 @@ tape('Precompiles: ECMUL', (t) => { data: Buffer.alloc(0), gasLimit: BigInt(0xffff), _common: common, - _VM: vm, + _EVM: vm.evm, }) st.deepEqual(result.gasUsed, BigInt(40000), 'should use petersburg gas costs') diff --git a/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts b/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts index 4729de0e3d3..d0b982817dd 100644 --- a/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/08-ecpairing.spec.ts @@ -17,7 +17,7 @@ tape('Precompiles: ECPAIRING', (t) => { ), gasLimit: BigInt(0xffffff), _common: common, - _VM: vm, + _EVM: vm.evm, }) st.deepEqual( diff --git a/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts b/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts index 3a1460543c4..081d271771a 100644 --- a/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts +++ b/packages/vm/tests/api/evm/precompiles/hardfork.spec.ts @@ -21,7 +21,7 @@ tape('Precompiles: hardfork availability', (t) => { } let vm = await VM.create({ common: commonByzantium }) - let result = await vm.runCall({ + let result = await vm.evm.runCall({ caller: Address.zero(), gasLimit: BigInt(0xffffffffff), to: ECPAIR_Address, @@ -40,7 +40,7 @@ tape('Precompiles: hardfork availability', (t) => { } vm = await VM.create({ common: commonPetersburg }) - result = await vm.runCall({ + result = await vm.evm.runCall({ caller: Address.zero(), gasLimit: BigInt(0xffffffffff), to: ECPAIR_Address, @@ -61,7 +61,7 @@ tape('Precompiles: hardfork availability', (t) => { vm = await VM.create({ common: commonHomestead }) - result = await vm.runCall({ + result = await vm.evm.runCall({ caller: Address.zero(), gasLimit: BigInt(0xffffffffff), to: ECPAIR_Address, diff --git a/packages/vm/tests/api/evm/stack.spec.ts b/packages/vm/tests/api/evm/stack.spec.ts index 87e2de36d1e..b6362d35d07 100644 --- a/packages/vm/tests/api/evm/stack.spec.ts +++ b/packages/vm/tests/api/evm/stack.spec.ts @@ -158,7 +158,7 @@ tape('Stack', (t) => { value: BigInt(1), } try { - const res = await vm.runCall(runCallArgs) + const res = await vm.evm.runCall(runCallArgs) const executionReturnValue = res.execResult.returnValue st.assert(executionReturnValue.equals(expectedReturnValue)) st.end() diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index 902ecfdd29c..6e16250b40a 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -53,16 +53,6 @@ tape('VM -> basic instantiation / boolean switches', (t) => { ) st.end() }) - - t.test('should instantiate with async constructor', async (st) => { - const vm = await VM.create({ activatePrecompiles: true }) - st.notDeepEqual( - (vm.stateManager as DefaultStateManager)._trie.root, - KECCAK256_RLP, - 'it has different root' - ) - st.end() - }) }) tape('VM -> supportedHardforks', (t) => { diff --git a/packages/vm/tests/api/istanbul/eip-1108.spec.ts b/packages/vm/tests/api/istanbul/eip-1108.spec.ts index d851430b302..cd375457caa 100644 --- a/packages/vm/tests/api/istanbul/eip-1108.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-1108.spec.ts @@ -14,7 +14,7 @@ tape('Istanbul: EIP-1108 tests', (t) => { data: Buffer.alloc(0), gasLimit: BigInt(0xffff), _common: common, - _VM: vm, + _EVM: vm.evm, }) st.deepEqual(result.gasUsed, BigInt(150), 'should use istanbul gas costs') @@ -31,7 +31,7 @@ tape('Istanbul: EIP-1108 tests', (t) => { data: Buffer.alloc(0), gasLimit: BigInt(0xffff), _common: common, - _VM: vm, + _EVM: vm.evm, }) st.deepEqual(result.gasUsed, BigInt(6000), 'should use istanbul gas costs') @@ -51,7 +51,7 @@ tape('Istanbul: EIP-1108 tests', (t) => { ), gasLimit: BigInt(0xffffff), _common: common, - _VM: vm, + _EVM: vm.evm, }) st.deepEqual( diff --git a/packages/vm/tests/api/istanbul/eip-1344.spec.ts b/packages/vm/tests/api/istanbul/eip-1344.spec.ts index a8a4ca92b96..d18c6595377 100644 --- a/packages/vm/tests/api/istanbul/eip-1344.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-1344.spec.ts @@ -25,7 +25,7 @@ tape('Istanbul: EIP-1344', async (t) => { const common = new Common({ chain, hardfork }) const vm = await VM.create({ common }) try { - const res = await vm.runCode(runCodeArgs) + const res = await vm.evm.runCode(runCodeArgs) if (testCase.err) { st.equal(res.exceptionError?.error, testCase.err) } else { diff --git a/packages/vm/tests/api/istanbul/eip-152.spec.ts b/packages/vm/tests/api/istanbul/eip-152.spec.ts index 249fd3cbe4a..75c5b9f0cc5 100644 --- a/packages/vm/tests/api/istanbul/eip-152.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-152.spec.ts @@ -94,7 +94,7 @@ tape('Istanbul: EIP-152', (t) => { data: Buffer.from(testCase.input, 'hex'), gasLimit: BigInt(20), _common: common, - _VM: vm, + _EVM: vm.evm, }) st.equal(res.exceptionError?.error, testCase.err) } @@ -105,7 +105,7 @@ tape('Istanbul: EIP-152', (t) => { data: Buffer.from(testCase.input, 'hex'), gasLimit: BigInt(10000000), _common: common, - _VM: vm, + _EVM: vm.evm, }) st.equal(res.returnValue.toString('hex'), testCase.expected) } diff --git a/packages/vm/tests/api/istanbul/eip-1884.spec.ts b/packages/vm/tests/api/istanbul/eip-1884.spec.ts index fefaede2f5a..f64afc38c23 100644 --- a/packages/vm/tests/api/istanbul/eip-1884.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-1884.spec.ts @@ -32,7 +32,7 @@ tape('Istanbul: EIP-1884', async (t) => { await vm.stateManager.putAccount(addr, account) try { - const res = await vm.runCode(runCodeArgs) + const res = await vm.evm.runCode(runCodeArgs) if (testCase.err) { st.equal(res.exceptionError?.error, testCase.err) } else { diff --git a/packages/vm/tests/api/istanbul/eip-2200.spec.ts b/packages/vm/tests/api/istanbul/eip-2200.spec.ts index 4c6b84b9a0b..b1982295092 100644 --- a/packages/vm/tests/api/istanbul/eip-2200.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-2200.spec.ts @@ -68,7 +68,7 @@ tape('Istanbul: EIP-2200', async (t) => { } try { - const res = await vm.runCall(runCallArgs) + const res = await vm.evm.runCall(runCallArgs) if (testCase.err) { st.equal(res.execResult.exceptionError?.error, testCase.err) } else { diff --git a/packages/vm/tests/api/opcodes.spec.ts b/packages/vm/tests/api/opcodes.spec.ts index c370e3fb5cf..d2255862ee3 100644 --- a/packages/vm/tests/api/opcodes.spec.ts +++ b/packages/vm/tests/api/opcodes.spec.ts @@ -1,16 +1,16 @@ import tape from 'tape' import Common, { Chain, Hardfork } from '@ethereumjs/common' -import VM from '../../src' +import EVM from '../../src/evm/evm' -tape('VM -> getActiveOpcodes()', (t) => { +tape('EVM -> getActiveOpcodes()', (t) => { const CHAINID = 0x46 //istanbul opcode const BEGINSUB = 0x5c // EIP-2315 opcode t.test('should not expose opcodes from a follow-up HF (istanbul -> petersburg)', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Petersburg }) - const vm = await VM.create({ common }) + const evm = await EVM.create({ common }) st.equal( - vm.getActiveOpcodes().get(CHAINID), + evm.getActiveOpcodes().get(CHAINID), undefined, 'istanbul opcode not exposed (HF: < istanbul (petersburg)' ) @@ -19,17 +19,17 @@ tape('VM -> getActiveOpcodes()', (t) => { t.test('should expose opcodes when HF is active (>= istanbul)', async (st) => { let common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - let vm = await VM.create({ common }) + let evm = await EVM.create({ common }) st.equal( - vm.getActiveOpcodes().get(CHAINID)!.name, + evm.getActiveOpcodes().get(CHAINID)!.name, 'CHAINID', 'istanbul opcode exposed (HF: istanbul)' ) common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.MuirGlacier }) - vm = await VM.create({ common }) + evm = await EVM.create({ common }) st.equal( - vm.getActiveOpcodes().get(CHAINID)!.name, + evm.getActiveOpcodes().get(CHAINID)!.name, 'CHAINID', 'istanbul opcode exposed (HF: > istanbul (muirGlacier)' ) @@ -39,17 +39,17 @@ tape('VM -> getActiveOpcodes()', (t) => { t.test('should expose opcodes when EIP is active', async (st) => { let common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul, eips: [2315] }) - let vm = await VM.create({ common }) + let evm = await EVM.create({ common }) st.equal( - vm.getActiveOpcodes().get(BEGINSUB)!.name, + evm.getActiveOpcodes().get(BEGINSUB)!.name, 'BEGINSUB', 'EIP-2315 opcode BEGINSUB exposed (EIP-2315 activated)' ) common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - vm = await VM.create({ common }) + evm = await EVM.create({ common }) st.equal( - vm.getActiveOpcodes().get(BEGINSUB), + evm.getActiveOpcodes().get(BEGINSUB), undefined, 'EIP-2315 opcode BEGINSUB not exposed (EIP-2315 not activated)' ) @@ -59,18 +59,18 @@ tape('VM -> getActiveOpcodes()', (t) => { t.test('should update opcodes on a hardfork change', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) - const vm = await VM.create({ common }) + const evm = await EVM.create({ common }) common.setHardfork(Hardfork.Byzantium) st.equal( - vm.getActiveOpcodes().get(CHAINID), + evm.getActiveOpcodes().get(CHAINID), undefined, 'opcode not exposed after HF change (-> < istanbul)' ) common.setHardfork(Hardfork.Istanbul) st.equal( - vm.getActiveOpcodes().get(CHAINID)!.name, + evm.getActiveOpcodes().get(CHAINID)!.name, 'CHAINID', 'opcode exposed after HF change (-> istanbul)' ) diff --git a/packages/vm/tests/api/runCall.spec.ts b/packages/vm/tests/api/runCall.spec.ts index 97b8ee49279..ec79ea385e3 100644 --- a/packages/vm/tests/api/runCall.spec.ts +++ b/packages/vm/tests/api/runCall.spec.ts @@ -66,7 +66,7 @@ tape('Constantinople: EIP-1014 CREATE2 creates the right contract address', asyn // calculate expected CREATE2 address const expectedAddress = create2address(contractAddress, codeHash, valueBuffer) // run the actual call - const res = await vm.runCall(runCallArgs) + const res = await vm.evm.runCall(runCallArgs) // retrieve the return value and convert it to an address (remove the first 12 bytes from the 32-byte return value) const executionReturnValue = new Address(res.execResult.returnValue.slice(12)) if (!expectedAddress.equals(executionReturnValue)) { @@ -111,8 +111,8 @@ tape('Byzantium cannot access Constantinople opcodes', async (t) => { to: contractAddress, // call to the contract address } - const byzantiumResult = await vmByzantium.runCall(runCallArgs) - const constantinopleResult = await vmConstantinople.runCall(runCallArgs) + const byzantiumResult = await vmByzantium.evm.runCall(runCallArgs) + const constantinopleResult = await vmConstantinople.evm.runCall(runCallArgs) t.assert( byzantiumResult.execResult.exceptionError && @@ -165,8 +165,8 @@ tape('Ensure that precompile activation creates non-empty accounts', async (t) = value: BigInt(1), } - const resultNotActivated = await vmNotActivated.runCall(runCallArgs) - const resultActivated = await vmActivated.runCall(runCallArgs) + const resultNotActivated = await vmNotActivated.evm.runCall(runCallArgs) + const resultActivated = await vmActivated.evm.runCall(runCallArgs) const diff = resultNotActivated.execResult.gasUsed - resultActivated.execResult.gasUsed const expected = common.param('gasPrices', 'callNewAccount') @@ -219,7 +219,7 @@ tape('Ensure that Istanbul sstoreCleanRefundEIP2200 gas is applied correctly', a gasLimit: BigInt(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas } - const result = await vm.runCall(runCallArgs) + const result = await vm.evm.runCall(runCallArgs) t.equal(result.execResult.gasUsed, BigInt(5812), 'gas used correct') t.equal(result.gasRefund, BigInt(4200), 'gas refund correct') @@ -246,7 +246,7 @@ tape('ensure correct gas for pre-constantinople sstore', async (t) => { gasLimit: BigInt(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas } - const result = await vm.runCall(runCallArgs) + const result = await vm.evm.runCall(runCallArgs) t.equal(result.execResult.gasUsed, BigInt(20006), 'gas used correct') t.equal(result.gasRefund, BigInt(0), 'gas refund correct') @@ -273,7 +273,7 @@ tape('ensure correct gas for calling non-existent accounts in homestead', async gasLimit: BigInt(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas } - const result = await vm.runCall(runCallArgs) + const result = await vm.evm.runCall(runCallArgs) // 7x push + gas + sub + call + callNewAccount // 7*3 + 2 + 3 + 40 + 25000 = 25066 @@ -305,7 +305,7 @@ tape( gasLimit: BigInt(200), } - const result = await vm.runCall(runCallArgs) + const result = await vm.evm.runCall(runCallArgs) t.equal(runCallArgs.gasLimit, result.execResult.gasUsed, 'gas used correct') t.equal(result.gasRefund, BigInt(0), 'gas refund correct') @@ -336,7 +336,7 @@ tape('ensure selfdestruct pays for creating new accounts', async (t) => { gasLimit: BigInt(0xffffffffff), } - const result = await vm.runCall(runCallArgs) + const result = await vm.evm.runCall(runCallArgs) // gas: 5000 (selfdestruct) + 25000 (call new account) + push (1) = 30003 t.equal(result.execResult.gasUsed, BigInt(30003), 'gas used correct') // selfdestruct refund @@ -403,7 +403,7 @@ tape('ensure that sstores pay for the right gas costs pre-byzantium', async (t) value: BigInt(callData.value), } - const result = await vm.runCall(runCallArgs) + const result = await vm.evm.runCall(runCallArgs) t.equal(result.execResult.gasUsed, BigInt(callData.gas), 'gas used correct') t.equal(result.gasRefund, BigInt(callData.refund), 'gas refund correct') } @@ -448,13 +448,13 @@ tape( gasLimit: BigInt(0xffffffffff), // ensure we pass a lot of gas, so we do not run out of gas } - await vm.runCall(runCallArgs) + await vm.evm.runCall(runCallArgs) let storage = await vm.stateManager.getContractStorage(address, slot) // The nonce is MAX_UINT64 - 1, so we are allowed to create a contract (nonce of creating contract is now MAX_UINT64) t.ok(!storage.equals(emptyBuffer), 'succesfully created contract') - await vm.runCall(runCallArgs) + await vm.evm.runCall(runCallArgs) // The nonce is MAX_UINT64, so we are NOT allowed to create a contract (nonce of creating contract is now MAX_UINT64) storage = await vm.stateManager.getContractStorage(address, slot) @@ -491,7 +491,7 @@ tape('Ensure that IDENTITY precompile copies the memory', async (t) => { gasPrice: BigInt(70000000000), } - const result = await vm.runCall(runCallArgs) + const result = await vm.evm.runCall(runCallArgs) const expectedAddress = Buffer.from('8eae784e072e961f76948a785b62c9a950fb17ae', 'hex') const expectedCode = Buffer.from( @@ -513,11 +513,12 @@ tape('Throws on negative call value', async (t) => { // setup the call arguments const runCallArgs = { + to: Address.zero(), value: BigInt(-10), } try { - await vm.runCall(runCallArgs) + await vm.evm.runCall(runCallArgs) t.fail('should not accept a negative call value') } catch (err: any) { t.ok(err.message.includes('value field cannot be negative'), 'throws on negative call value') @@ -551,7 +552,7 @@ tape('runCall() -> skipBalance behavior', async (t) => { for (const balance of [undefined, BigInt(5)]) { await vm.stateManager.modifyAccountFields(sender, { nonce: BigInt(0), balance }) - const res = await vm.runCall(runCallArgs) + const res = await vm.evm.runCall(runCallArgs) t.pass('runCall should not throw with no balance and skipBalance') const senderBalance = (await vm.stateManager.getAccount(sender)).balance t.equal( @@ -562,7 +563,7 @@ tape('runCall() -> skipBalance behavior', async (t) => { t.equal(res.execResult.exceptionError, undefined, 'no exceptionError with skipBalance') } - const res2 = await vm.runCall({ ...runCallArgs, skipBalance: false }) + const res2 = await vm.evm.runCall({ ...runCallArgs, skipBalance: false }) t.equal( res2.execResult.exceptionError?.error, 'insufficient balance', diff --git a/packages/vm/tests/api/runCode.spec.ts b/packages/vm/tests/api/runCode.spec.ts index 43d867f1cce..6eed456a56b 100644 --- a/packages/vm/tests/api/runCode.spec.ts +++ b/packages/vm/tests/api/runCode.spec.ts @@ -30,7 +30,7 @@ tape('VM.runCode: initial program counter', async (t) => { let err try { - const result = await vm.runCode(runCodeArgs) + const result = await vm.evm.runCode(runCodeArgs) if (testData.resultPC !== undefined) { t.equal( result.runState?.programCounter, @@ -64,7 +64,7 @@ tape('VM.runCode: interpreter', (t) => { let result: any try { - result = await vm.runCode(runCodeArgs) + result = await vm.evm.runCode(runCodeArgs) } catch (e: any) { st.fail('should not throw error') } @@ -87,7 +87,7 @@ tape('VM.runCode: interpreter', (t) => { } try { - await vm.runCode(runCodeArgs) + await vm.evm.runCode(runCodeArgs) st.fail('should throw error') } catch (e: any) { st.ok(e.toString().includes('Test'), 'error thrown') @@ -106,7 +106,7 @@ tape('VM.runCode: RunCodeOptions', (t) => { } try { - await vm.runCode(runCodeArgs) + await vm.evm.runCode(runCodeArgs) st.fail('should not accept a negative call value') } catch (err: any) { st.ok(err.message.includes('value field cannot be negative'), 'throws on negative call value') diff --git a/packages/vm/tests/api/state/accountExists.spec.ts b/packages/vm/tests/api/state/accountExists.spec.ts index 8b3108e1c4d..6e38404dc74 100644 --- a/packages/vm/tests/api/state/accountExists.spec.ts +++ b/packages/vm/tests/api/state/accountExists.spec.ts @@ -41,7 +41,7 @@ tape('correctly apply new account gas fee on pre-Spurious Dragon hardforks', asy value: BigInt(0), } - const result = await vm.runCall(runCallArgs) + const result = await vm.evm.runCall(runCallArgs) t.equal(result.execResult.gasUsed, BigInt(53552), 'vm correctly applies new account gas price') t.end() }) @@ -86,7 +86,7 @@ tape( value: BigInt(0), } - const result = await vm.runCall(runCallArgs) + const result = await vm.evm.runCall(runCallArgs) t.equal( result.execResult.gasUsed, BigInt(28552), diff --git a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts index 1787dc5b303..80f6917e12d 100644 --- a/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts +++ b/packages/vm/tests/tester/runners/GeneralStateTestsRunner.ts @@ -87,7 +87,7 @@ async function runTestCase(options: any, testData: any, t: tape.Test) { const block = makeBlockFromEnv(testData.env, { common }) if (options.jsontrace) { - vm.on('step', function (e: InterpreterStep) { + vm.evm.on('step', function (e: InterpreterStep) { let hexStack = [] hexStack = e.stack.map((item: bigint) => { return '0x' + item.toString(16) From e05d6d4a207e5e840a6e1c63531126742771915e Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Wed, 25 May 2022 16:44:02 +0200 Subject: [PATCH 41/44] Util, Block: added Util error module, first exemplary BlockHeader error implementation --- packages/block/src/errors.ts | 12 ++++++++++++ packages/block/src/header.ts | 12 +++++++++--- packages/util/src/errors.ts | 30 ++++++++++++++++++++++++++++++ packages/util/src/index.ts | 5 +++++ 4 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 packages/block/src/errors.ts create mode 100644 packages/util/src/errors.ts diff --git a/packages/block/src/errors.ts b/packages/block/src/errors.ts new file mode 100644 index 00000000000..53d9e39f731 --- /dev/null +++ b/packages/block/src/errors.ts @@ -0,0 +1,12 @@ +import { EthereumJSError } from 'ethereumjs-util' + +export enum HeaderValidationErrorCode { + WRONG_TX_TRIE_LENGTH = 'WRONG_TX_TRIE_LENGTH', +} + +export type HeaderValidationErrorType = { + block: string + received: string +} + +export class HeaderValidationError extends EthereumJSError {} diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index d035515567e..7f06eb775b2 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -26,6 +26,7 @@ import { CLIQUE_DIFF_INTURN, CLIQUE_DIFF_NOTURN, } from './clique' +import { HeaderValidationError, HeaderValidationErrorCode } from './errors' interface HeaderCache { hash: Buffer | undefined @@ -355,10 +356,15 @@ export class BlockHeader { throw new Error(msg) } if (transactionsTrie.length !== 32) { - const msg = this._errorMsg( - `transactionsTrie must be 32 bytes, received ${transactionsTrie.length} bytes` + const e = new HeaderValidationError( + 'transactionsTrie must be 32 bytes', + HeaderValidationErrorCode.WRONG_TX_TRIE_LENGTH, + { + block: this.errorStr(), + received: `${transactionsTrie.toString('hex')} (${transactionsTrie.length} bytes)`, + } ) - throw new Error(msg) + throw e } if (receiptTrie.length !== 32) { const msg = this._errorMsg( diff --git a/packages/util/src/errors.ts b/packages/util/src/errors.ts new file mode 100644 index 00000000000..04306216482 --- /dev/null +++ b/packages/util/src/errors.ts @@ -0,0 +1,30 @@ +/** + * Generic EthereumJS error with metadata attached + * + * Kudos to https://github.com/ChainSafe/lodestar monorepo + * for the inspiration :-) + */ +export class EthereumJSError extends Error { + code: string + errorContext: T + + constructor(msg: string, code: string, errorContext: T) { + super(msg) + this.code = code + this.errorContext = errorContext + } + + getErrorContext(): Record { + return { code: this.code, ...this.errorContext } + } + + /** + * Get the metadata and the stacktrace for the error. + */ + toObject(): Record { + return { + ...this.getErrorContext(), + stack: this.stack ?? '', + } + } +} diff --git a/packages/util/src/index.ts b/packages/util/src/index.ts index 4ea77344fe5..a75631fe7f8 100644 --- a/packages/util/src/index.ts +++ b/packages/util/src/index.ts @@ -13,6 +13,11 @@ export * from './account' */ export * from './address' +/** + * EthereumJS Extended Errors + */ +export * from './errors' + /** * ECDSA signature */ From de70270e7d7418765093fc6165db5010a5a424f9 Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Thu, 26 May 2022 09:55:15 +0200 Subject: [PATCH 42/44] Util, Block: added generic error types like ValidationError, UsageError --- packages/block/src/errors.ts | 23 ++++++++++++++++++++--- packages/block/src/header.ts | 4 ++-- packages/util/src/errors.ts | 20 +++++++++++++++++++- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/packages/block/src/errors.ts b/packages/block/src/errors.ts index 53d9e39f731..7b0001cec62 100644 --- a/packages/block/src/errors.ts +++ b/packages/block/src/errors.ts @@ -1,12 +1,29 @@ -import { EthereumJSError } from 'ethereumjs-util' +import { UsageError, ValidationError } from 'ethereumjs-util' -export enum HeaderValidationErrorCode { +/** + * Always define error codes on the generic Util + * error class level (e.g. associated to `ValidationError`) + */ +export enum ValidationErrorCode { WRONG_TX_TRIE_LENGTH = 'WRONG_TX_TRIE_LENGTH', } +/** + * Additional types extending the generic Util + * error types (e.g. `ValidationErrorType`) + */ export type HeaderValidationErrorType = { block: string received: string } +export type HeaderUsageErrorType = { + block: string +} -export class HeaderValidationError extends EthereumJSError {} +/** + * Dedicated error classes for the specific package, + * always to be subclassed from the generic Util error type + * classes (e.g. `ValidationError`, not: `EthereumJSError`) + */ +export class HeaderValidationError extends ValidationError {} +export class HeaderUsageError extends UsageError {} diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index 7f06eb775b2..b62e05fedfd 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -26,7 +26,7 @@ import { CLIQUE_DIFF_INTURN, CLIQUE_DIFF_NOTURN, } from './clique' -import { HeaderValidationError, HeaderValidationErrorCode } from './errors' +import { HeaderValidationError, ValidationErrorCode } from './errors' interface HeaderCache { hash: Buffer | undefined @@ -358,7 +358,7 @@ export class BlockHeader { if (transactionsTrie.length !== 32) { const e = new HeaderValidationError( 'transactionsTrie must be 32 bytes', - HeaderValidationErrorCode.WRONG_TX_TRIE_LENGTH, + ValidationErrorCode.WRONG_TX_TRIE_LENGTH, { block: this.errorStr(), received: `${transactionsTrie.toString('hex')} (${transactionsTrie.length} bytes)`, diff --git a/packages/util/src/errors.ts b/packages/util/src/errors.ts index 04306216482..a781f2cbf15 100644 --- a/packages/util/src/errors.ts +++ b/packages/util/src/errors.ts @@ -1,5 +1,5 @@ /** - * Generic EthereumJS error with metadata attached + * Generic EthereumJS error class with metadata attached * * Kudos to https://github.com/ChainSafe/lodestar monorepo * for the inspiration :-) @@ -28,3 +28,21 @@ export class EthereumJSError extends Error { } } } + +export type ValidationErrorType = { + received: string +} + +/** + * Error along Object Validation + * + * Use directly or in a subclassed context for error comparison (`e instanceof ValidationError`) + */ +export class ValidationError extends EthereumJSError {} + +/** + * Error along API Usage + * + * Use directly or in a subclassed context for error comparison (`e instanceof UsageError`) + */ +export class UsageError extends EthereumJSError {} From 92f93d97ffcb096bf7ca0e0fa871b79809f451c7 Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Fri, 27 May 2022 09:18:48 +0200 Subject: [PATCH 43/44] Block: allow sub class error to take on the type shapes of the generic error by unionizing the types --- packages/block/src/errors.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/block/src/errors.ts b/packages/block/src/errors.ts index 7b0001cec62..7a387d72347 100644 --- a/packages/block/src/errors.ts +++ b/packages/block/src/errors.ts @@ -1,4 +1,4 @@ -import { UsageError, ValidationError } from 'ethereumjs-util' +import { UsageError, ValidationError, ValidationErrorType } from 'ethereumjs-util' /** * Always define error codes on the generic Util @@ -12,10 +12,12 @@ export enum ValidationErrorCode { * Additional types extending the generic Util * error types (e.g. `ValidationErrorType`) */ -export type HeaderValidationErrorType = { - block: string - received: string -} +export type HeaderValidationErrorType = + | { + block: string + received: string + } + | ValidationErrorType export type HeaderUsageErrorType = { block: string } From 73a487aa8bfbbf681b9f9084393ea7234eb4bb2a Mon Sep 17 00:00:00 2001 From: Holger Drewes Date: Fri, 27 May 2022 11:49:46 +0200 Subject: [PATCH 44/44] Util, Block: Removed 2-layer error structure, removed local package errors file, moved error codes to Util --- packages/block/src/errors.ts | 31 -------- packages/block/src/header.ts | 133 ++++++++++++++++++++++------------- packages/util/src/errors.ts | 70 ++++++++++++++---- 3 files changed, 142 insertions(+), 92 deletions(-) delete mode 100644 packages/block/src/errors.ts diff --git a/packages/block/src/errors.ts b/packages/block/src/errors.ts deleted file mode 100644 index 7a387d72347..00000000000 --- a/packages/block/src/errors.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { UsageError, ValidationError, ValidationErrorType } from 'ethereumjs-util' - -/** - * Always define error codes on the generic Util - * error class level (e.g. associated to `ValidationError`) - */ -export enum ValidationErrorCode { - WRONG_TX_TRIE_LENGTH = 'WRONG_TX_TRIE_LENGTH', -} - -/** - * Additional types extending the generic Util - * error types (e.g. `ValidationErrorType`) - */ -export type HeaderValidationErrorType = - | { - block: string - received: string - } - | ValidationErrorType -export type HeaderUsageErrorType = { - block: string -} - -/** - * Dedicated error classes for the specific package, - * always to be subclassed from the generic Util error type - * classes (e.g. `ValidationError`, not: `EthereumJSError`) - */ -export class HeaderValidationError extends ValidationError {} -export class HeaderUsageError extends UsageError {} diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index b62e05fedfd..fe887c9876f 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -17,6 +17,9 @@ import { toType, TypeOutput, zeros, + ValueError, + UsageError, + ErrorCode, } from 'ethereumjs-util' import RLP from 'rlp' import { Blockchain, BlockHeaderBuffer, BlockOptions, HeaderData, JsonHeader } from './types' @@ -26,7 +29,6 @@ import { CLIQUE_DIFF_INTURN, CLIQUE_DIFF_NOTURN, } from './clique' -import { HeaderValidationError, ValidationErrorCode } from './errors' interface HeaderCache { hash: Buffer | undefined @@ -69,10 +71,13 @@ export class BlockHeader { */ get prevRandao() { if (!this._common.isActivatedEIP(4399)) { - const msg = this._errorMsg( - 'The prevRandao parameter can only be accessed when EIP-4399 is activated' + throw new UsageError( + 'The prevRandao parameter can only be accessed when EIP-4399 is activated', + ErrorCode.EIP_NOT_ACTIVATED, + { + objectContext: this.errorStr(), + } ) - throw new Error(msg) } return this.mixHash } @@ -97,7 +102,10 @@ export class BlockHeader { const values = arrToBufArr(RLP.decode(Uint8Array.from(serialized))) as Buffer[] if (!Array.isArray(values)) { - throw new Error('Invalid serialized header input. Must be array') + throw new ValueError( + 'Invalid serialized header input. Must be array', + ErrorCode.INVALID_VALUE + ) } return BlockHeader.fromValuesArray(values, opts) @@ -130,10 +138,16 @@ export class BlockHeader { ] = values if (values.length > 16) { - throw new Error('invalid header. More values than expected were received') + throw new ValueError( + 'invalid header. More values than expected were received', + ErrorCode.TOO_MANY_VALUES + ) } if (values.length < 15) { - throw new Error('invalid header. Less values than expected were received') + throw new ValueError( + 'invalid header. Less values than expected were received', + ErrorCode.TOO_FEW_VALUES + ) } return new BlockHeader( @@ -187,8 +201,9 @@ export class BlockHeader { } if (options.hardforkByBlockNumber !== undefined && options.hardforkByTD !== undefined) { - throw new Error( - `The hardforkByBlockNumber and hardforkByTD options can't be used in conjunction` + throw new UsageError( + `The hardforkByBlockNumber and hardforkByTD options can't be used in conjunction`, + ErrorCode.INVALID_OPTION_USAGE ) } @@ -251,7 +266,10 @@ export class BlockHeader { } } else { if (baseFeePerGas) { - throw new Error('A base fee for a block can only be set with EIP1559 being activated') + throw new UsageError( + 'A base fee for a block can only be set with EIP1559 being activated', + ErrorCode.EIP_NOT_ACTIVATED + ) } } @@ -348,47 +366,50 @@ export class BlockHeader { } = this if (parentHash.length !== 32) { - const msg = this._errorMsg(`parentHash must be 32 bytes, received ${parentHash.length} bytes`) - throw new Error(msg) + throw new ValueError(`parentHash must be 32 bytes`, ErrorCode.INVALID_VALUE_LENGTH, { + objectContext: this.errorStr(), + received: `${parentHash.length} bytes`, + }) } if (stateRoot.length !== 32) { - const msg = this._errorMsg(`stateRoot must be 32 bytes, received ${stateRoot.length} bytes`) - throw new Error(msg) + throw new ValueError(`stateRoot must be 32 bytes`, ErrorCode.INVALID_VALUE_LENGTH, { + objectContext: this.errorStr(), + received: `${stateRoot.length} bytes`, + }) } if (transactionsTrie.length !== 32) { - const e = new HeaderValidationError( - 'transactionsTrie must be 32 bytes', - ValidationErrorCode.WRONG_TX_TRIE_LENGTH, - { - block: this.errorStr(), - received: `${transactionsTrie.toString('hex')} (${transactionsTrie.length} bytes)`, - } - ) - throw e + throw new ValueError('transactionsTrie must be 32 bytes', ErrorCode.INVALID_VALUE_LENGTH, { + objectContext: this.errorStr(), + received: `${transactionsTrie.toString('hex')} (${transactionsTrie.length} bytes)`, + }) } if (receiptTrie.length !== 32) { - const msg = this._errorMsg( - `receiptTrie must be 32 bytes, received ${receiptTrie.length} bytes` - ) - throw new Error(msg) + throw new ValueError('receiptTrie must be 32 bytes', ErrorCode.INVALID_VALUE_LENGTH, { + objectContext: this.errorStr(), + received: `${receiptTrie.toString('hex')} (${receiptTrie.length} bytes)`, + }) } if (mixHash.length !== 32) { - const msg = this._errorMsg(`mixHash must be 32 bytes, received ${mixHash.length} bytes`) - throw new Error(msg) + throw new ValueError('mixHash must be 32 bytes', ErrorCode.INVALID_VALUE_LENGTH, { + objectContext: this.errorStr(), + received: `${mixHash.toString('hex')} (${mixHash.length} bytes)`, + }) } if (nonce.length !== 8) { // Hack to check for Kovan due to non-standard nonce length (65 bytes) if (this._common.networkId() === BigInt(42)) { if (nonce.length !== 65) { - const msg = this._errorMsg( - `nonce must be 65 bytes on kovan, received ${nonce.length} bytes` - ) - throw new Error(msg) + throw new ValueError('nonce must be 65 bytes on kovan', ErrorCode.INVALID_VALUE_LENGTH, { + objectContext: this.errorStr(), + received: `${nonce.toString('hex')} (${nonce.length} bytes)`, + }) } } else { - const msg = this._errorMsg(`nonce must be 8 bytes, received ${nonce.length} bytes`) - throw new Error(msg) + throw new ValueError('nonce must be 8 bytes', ErrorCode.INVALID_VALUE_LENGTH, { + objectContext: this.errorStr(), + received: `${nonce.toString('hex')} (${nonce.length} bytes)`, + }) } } @@ -418,8 +439,9 @@ export class BlockHeader { error = true } if (error) { - const msg = this._errorMsg(`Invalid PoS block${errorMsg}`) - throw new Error(msg) + throw new ValueError(`Invalid PoS block${errorMsg}`, ErrorCode.INVALID_OBJECT, { + objectContext: this.errorStr(), + }) } } } @@ -431,14 +453,22 @@ export class BlockHeader { */ canonicalDifficulty(parentBlockHeader: BlockHeader): bigint { if (this._common.consensusType() !== ConsensusType.ProofOfWork) { - const msg = this._errorMsg('difficulty calculation is only supported on PoW chains') - throw new Error(msg) + throw new UsageError( + 'difficulty calculation is only supported on PoW chains', + ErrorCode.INVALID_METHOD_CALL, + { + objectContext: this.errorStr(), + } + ) } if (this._common.consensusAlgorithm() !== ConsensusAlgorithm.Ethash) { - const msg = this._errorMsg( - 'difficulty calculation currently only supports the ethash algorithm' + throw new UsageError( + 'difficulty calculation currently only supports the ethash algorithm', + ErrorCode.INVALID_METHOD_CALL, + { + objectContext: this.errorStr(), + } ) - throw new Error(msg) } const hardfork = this._common.hardfork() const blockTs = this.timestamp @@ -516,16 +546,23 @@ export class BlockHeader { validateCliqueDifficulty(blockchain: Blockchain): boolean { this._requireClique('validateCliqueDifficulty') if (this.difficulty !== CLIQUE_DIFF_INTURN && this.difficulty !== CLIQUE_DIFF_NOTURN) { - const msg = this._errorMsg( - `difficulty for clique block must be INTURN (2) or NOTURN (1), received: ${this.difficulty}` + throw new ValueError( + 'difficulty for clique block must be INTURN (2) or NOTURN (1)', + ErrorCode.INVALID_VALUE, + { + objectContext: this.errorStr(), + received: `${this.difficulty}`, + } ) - throw new Error(msg) } if ('cliqueActiveSigners' in (blockchain as any).consensus === false) { - const msg = this._errorMsg( - 'PoA blockchain requires method blockchain.consensus.cliqueActiveSigners() to validate clique difficulty' + throw new UsageError( + 'PoA blockchain requires method blockchain.consensus.cliqueActiveSigners() to validate clique difficulty', + ErrorCode.INCOMPATIBLE_LIBRARY_VERSION, + { + objectContext: this.errorStr(), + } ) - throw new Error(msg) } const signers = (blockchain as any).consensus.cliqueActiveSigners() if (signers.length === 0) { diff --git a/packages/util/src/errors.ts b/packages/util/src/errors.ts index a781f2cbf15..1eba2d31dc9 100644 --- a/packages/util/src/errors.ts +++ b/packages/util/src/errors.ts @@ -4,18 +4,22 @@ * Kudos to https://github.com/ChainSafe/lodestar monorepo * for the inspiration :-) */ -export class EthereumJSError extends Error { +type EthereumJSErrorType = { + objectContext: string +} + +export class EthereumJSError extends Error { code: string - errorContext: T + context: T | {} - constructor(msg: string, code: string, errorContext: T) { + constructor(msg: string, code: string, context?: T) { super(msg) this.code = code - this.errorContext = errorContext + this.context = context ?? {} } - getErrorContext(): Record { - return { code: this.code, ...this.errorContext } + getContext(): Record { + return { code: this.code, ...this.context } } /** @@ -23,26 +27,66 @@ export class EthereumJSError extends Error { */ toObject(): Record { return { - ...this.getErrorContext(), + ...this.getContext(), stack: this.stack ?? '', } } } -export type ValidationErrorType = { - received: string +/** + * Error Codes + */ +export enum ErrorCode { + // Value Errors + INVALID_OBJECT = 'INVALID_OBJECT', + INVALID_VALUE = 'INVALID_VALUE', + INVALID_VALUE_LENGTH = 'INVALID_VALUE_LENGTH', + TOO_FEW_VALUES = 'TOO_FEW_VALUES', + TOO_MANY_VALUES = 'TOO_MANY_VALUES', + + // Usage Errors + EIP_NOT_ACTIVATED = 'EIP_NOT_ACTIVATED', + INCOMPATIBLE_LIBRARY_VERSION = 'INCOMPATIBLE_LIBRARY_VERSION', + INVALID_OPTION_USAGE = 'INVALID_OPTION_USAGE', + INVALID_METHOD_CALL = 'INVALID_METHOD_CALL', } /** - * Error along Object Validation + * Generic error types + */ + +/** + * Type flavors for ValueError + */ +export type ValueErrorType = + | { + received: string + } + | { + objectContext: string + received: string + } + | EthereumJSErrorType + +/** + * Type flavors for UsageError + */ +export type UsageErrorType = EthereumJSErrorType + +/** + * Generic Errors * - * Use directly or in a subclassed context for error comparison (`e instanceof ValidationError`) + * Use directly or in a subclassed context for error comparison (`e instanceof ValueError`) + */ + +/** + * Error along Object Value */ -export class ValidationError extends EthereumJSError {} +export class ValueError extends EthereumJSError {} /** * Error along API Usage * * Use directly or in a subclassed context for error comparison (`e instanceof UsageError`) */ -export class UsageError extends EthereumJSError {} +export class UsageError extends EthereumJSError {}