diff --git a/package-lock.json b/package-lock.json index a9861f5325..899ea19405 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2711,82 +2711,6 @@ "node": ">=18" } }, - "node_modules/@puppeteer/browsers/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "optional": true, - "peer": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@puppeteer/browsers/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==", - "optional": true, - "peer": true - }, - "node_modules/@puppeteer/browsers/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==", - "optional": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@puppeteer/browsers/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==", - "optional": true, - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@puppeteer/browsers/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "optional": true, - "peer": true, - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@puppeteer/browsers/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "optional": true, - "peer": true, - "engines": { - "node": ">=12" - } - }, "node_modules/@rollup/plugin-virtual": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-virtual/-/plugin-virtual-3.0.2.tgz", @@ -5585,6 +5509,45 @@ "node": ">= 12" } }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/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==" + }, + "node_modules/cliui/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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/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==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/color": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", @@ -11440,53 +11403,6 @@ } } }, - "node_modules/msw/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "optional": true, - "peer": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/msw/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==", - "optional": true, - "peer": true - }, - "node_modules/msw/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==", - "optional": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/msw/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==", - "optional": true, - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/msw/node_modules/type-fest": { "version": "4.32.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.32.0.tgz", @@ -11500,35 +11416,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/msw/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "optional": true, - "peer": true, - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/msw/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "optional": true, - "peer": true, - "engines": { - "node": ">=12" - } - }, "node_modules/multiformats": { "version": "13.3.1", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.3.1.tgz", @@ -13299,35 +13186,6 @@ } } }, - "node_modules/rollup-plugin-visualizer/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/rollup-plugin-visualizer/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==", - "dev": true - }, - "node_modules/rollup-plugin-visualizer/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==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/rollup-plugin-visualizer/node_modules/picomatch": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", @@ -13340,47 +13198,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/rollup-plugin-visualizer/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==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/rollup-plugin-visualizer/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/rollup-plugin-visualizer/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -16423,6 +16240,57 @@ "node": ">= 14" } }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/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==" + }, + "node_modules/yargs/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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/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==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", @@ -16610,70 +16478,6 @@ "node": ">=18" } }, - "packages/client/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "packages/client/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==" - }, - "packages/client/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==", - "engines": { - "node": ">=8" - } - }, - "packages/client/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==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "packages/client/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "packages/client/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "engines": { - "node": ">=12" - } - }, "packages/common": { "name": "@ethereumjs/common", "version": "5.0.0-alpha.1", @@ -16945,76 +16749,6 @@ "node": ">=18" } }, - "packages/tx/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "packages/tx/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==", - "dev": true - }, - "packages/tx/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==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "packages/tx/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==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "packages/tx/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "packages/tx/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "packages/util": { "name": "@ethereumjs/util", "version": "10.0.0-alpha.1", @@ -17091,7 +16825,8 @@ "node-dir": "^0.1.17", "nyc": "^15.1.0", "solc": "^0.8.1", - "tape": "^5.3.1" + "tape": "^5.3.1", + "yargs": "^17.7.1" }, "engines": { "node": ">=18" diff --git a/packages/block/examples/clique.ts b/packages/block/examples/clique.ts index 43630a1ca8..f8e87c5064 100644 --- a/packages/block/examples/clique.ts +++ b/packages/block/examples/clique.ts @@ -1,5 +1,7 @@ import { createBlock } from '@ethereumjs/block' -import { Common, Goerli, Hardfork } from '@ethereumjs/common' +import { Common, Hardfork } from '@ethereumjs/common' + +import { Goerli } from '../test/testdata/goerliCommon.js' const common = new Common({ chain: Goerli, hardfork: Hardfork.Chainstart }) diff --git a/packages/block/test/block.spec.ts b/packages/block/test/block.spec.ts index 2ae7f1d62a..c0a59dc05c 100644 --- a/packages/block/test/block.spec.ts +++ b/packages/block/test/block.spec.ts @@ -1,4 +1,4 @@ -import { Common, Goerli, Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common' +import { Common, Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common' import { RLP } from '@ethereumjs/rlp' import { createLegacyTx } from '@ethereumjs/tx' import { KECCAK256_RLP_ARRAY, bytesToHex, equalsBytes, hexToBytes, toBytes } from '@ethereumjs/util' @@ -17,6 +17,7 @@ import { } from '../src/index.js' import { genesisHashesTestData } from './testdata/genesisHashesTest.js' +import { Goerli } from './testdata/goerliCommon.js' import { testdataFromRPCGoerliData } from './testdata/testdata-from-rpc-goerli.js' import { testdataPreLondon2Data } from './testdata/testdata_pre-london-2.js' import { testdataPreLondonData } from './testdata/testdata_pre-london.js' @@ -126,7 +127,7 @@ describe('[Block]: block functions', () => { }) it('should initialize with null parameters without throwing', () => { - const common = new Common({ chain: Goerli }) + const common = new Common({ chain: Mainnet }) const opts = { common } assert.doesNotThrow(function () { createBlock({}, opts) diff --git a/packages/block/test/clique.spec.ts b/packages/block/test/clique.spec.ts index a170d42c80..07b7dbd7be 100644 --- a/packages/block/test/clique.spec.ts +++ b/packages/block/test/clique.spec.ts @@ -1,4 +1,4 @@ -import { Common, Goerli, Hardfork } from '@ethereumjs/common' +import { Common, Hardfork } from '@ethereumjs/common' import { Address, createZeroAddress, hexToBytes } from '@ethereumjs/util' import { assert, describe, it } from 'vitest' @@ -13,6 +13,8 @@ import { createSealedCliqueBlockHeader, } from '../src/index.js' +import { Goerli } from './testdata/goerliCommon.js' + describe('[Header]: Clique PoA Functionality', () => { const common = new Common({ chain: Goerli, hardfork: Hardfork.Chainstart }) diff --git a/packages/block/test/from-rpc.spec.ts b/packages/block/test/from-rpc.spec.ts index a2f94c710a..fb5ca05b2e 100644 --- a/packages/block/test/from-rpc.spec.ts +++ b/packages/block/test/from-rpc.spec.ts @@ -1,4 +1,4 @@ -import { Common, Goerli, Hardfork, Mainnet } from '@ethereumjs/common' +import { Common, Hardfork, Mainnet } from '@ethereumjs/common' import { bytesToHex, equalsBytes, hexToBytes, randomBytes } from '@ethereumjs/util' import { assert, describe, it } from 'vitest' @@ -9,6 +9,7 @@ import { } from '../src/index.js' import { alchemy14151203Data } from './testdata/alchemy14151203.js' +import { Goerli } from './testdata/goerliCommon.js' import { infuraGoerliBlock10536893Data } from './testdata/infura-goerli-block-10536893.js' import { infura15571241Data } from './testdata/infura15571241.js' import { infura15571241withTransactionsData } from './testdata/infura15571241withTransactions.js' diff --git a/packages/block/test/header.spec.ts b/packages/block/test/header.spec.ts index dce30df1da..d975c02ed7 100644 --- a/packages/block/test/header.spec.ts +++ b/packages/block/test/header.spec.ts @@ -1,4 +1,4 @@ -import { Common, Goerli, Hardfork, Mainnet } from '@ethereumjs/common' +import { Common, Hardfork, Mainnet } from '@ethereumjs/common' import { RLP } from '@ethereumjs/rlp' import { KECCAK256_RLP, @@ -23,6 +23,7 @@ import { import { bcBlockGasLimitTestData } from './testdata/bcBlockGasLimitTest.js' import { blocksGoerliData } from './testdata/blocks_goerli.js' import { blocksMainnetData } from './testdata/blocks_mainnet.js' +import { Goerli } from './testdata/goerliCommon.js' import type { BlockHeader } from '../src/index.js' import type { CliqueConfig } from '@ethereumjs/common' diff --git a/packages/block/test/testdata/goerliCommon.ts b/packages/block/test/testdata/goerliCommon.ts new file mode 100644 index 0000000000..247aa11d55 --- /dev/null +++ b/packages/block/test/testdata/goerliCommon.ts @@ -0,0 +1,162 @@ +import type { ChainConfig } from '@ethereumjs/common' + +export const Goerli: ChainConfig = { + name: 'goerli', + chainId: 5, + defaultHardfork: 'cancun', + consensus: { + type: 'poa', + algorithm: 'clique', + clique: { + period: 15, + epoch: 30000, + }, + }, + comment: 'Cross-client PoA test network', + url: 'https://github.com/goerli/testnet', + genesis: { + timestamp: '0x5c51a607', + gasLimit: 10485760, + difficulty: 1, + nonce: '0x0000000000000000', + extraData: + '0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + }, + hardforks: [ + { + name: 'chainstart', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'homestead', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'tangerineWhistle', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'spuriousDragon', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'byzantium', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'constantinople', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'petersburg', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'istanbul', + block: 1561651, + forkHash: '0xc25efa5c', + }, + { + name: 'berlin', + block: 4460644, + forkHash: '0x757a1c47', + }, + { + name: 'london', + block: 5062605, + forkHash: '0xb8c6299d', + }, + { + // The forkHash will remain same as mergeForkIdTransition is post merge, + // terminal block: https://goerli.etherscan.io/block/7382818 + name: 'paris', + block: 7382819, + forkHash: '0xb8c6299d', + }, + { + name: 'mergeForkIdTransition', + block: null, + forkHash: null, + }, + { + name: 'shanghai', + block: null, + timestamp: '1678832736', + forkHash: '0xf9843abf', + }, + { + name: 'cancun', + block: null, + timestamp: '1705473120', + forkHash: '0x70cc14e2', + }, + ], + bootstrapNodes: [ + { + ip: '51.141.78.53', + port: 30303, + id: '011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a', + location: '', + comment: 'Upstream bootnode 1', + }, + { + ip: '13.93.54.137', + port: 30303, + id: '176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b', + location: '', + comment: 'Upstream bootnode 2', + }, + { + ip: '94.237.54.114', + port: 30313, + id: '46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291', + location: '', + comment: 'Upstream bootnode 3', + }, + { + ip: '18.218.250.66', + port: 30313, + id: 'b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949', + location: '', + comment: 'Upstream bootnode 4', + }, + { + ip: '3.11.147.67', + port: 30303, + id: 'a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91', + location: '', + comment: 'Ethereum Foundation bootnode', + }, + { + ip: '51.15.116.226', + port: 30303, + id: 'a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 30303, + id: '807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 40303, + id: 'a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + ], + dnsNetworks: [ + 'enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net', + ], +} diff --git a/packages/blockchain/examples/clique.ts b/packages/blockchain/examples/clique.ts index 2a67eb3e4c..61d9063c90 100644 --- a/packages/blockchain/examples/clique.ts +++ b/packages/blockchain/examples/clique.ts @@ -1,5 +1,7 @@ import { CliqueConsensus, createBlockchain } from '@ethereumjs/blockchain' -import { Common, ConsensusAlgorithm, Goerli, Hardfork } from '@ethereumjs/common' +import { Common, ConsensusAlgorithm, Hardfork } from '@ethereumjs/common' + +import { Goerli } from '../test/testdata/goerliCommon.js' import type { ConsensusDict } from '@ethereumjs/blockchain' diff --git a/packages/blockchain/test/clique.spec.ts b/packages/blockchain/test/clique.spec.ts index 08effb50b7..b84caaee3b 100644 --- a/packages/blockchain/test/clique.spec.ts +++ b/packages/blockchain/test/clique.spec.ts @@ -7,7 +7,6 @@ import { Common, ConsensusAlgorithm, ConsensusType, - Goerli, Hardfork, createCustomCommon, } from '@ethereumjs/common' @@ -23,6 +22,8 @@ import { assert, describe, it } from 'vitest' import { CLIQUE_NONCE_AUTH, CLIQUE_NONCE_DROP, CliqueConsensus } from '../src/consensus/clique.js' import { createBlockchain } from '../src/index.js' +import { Goerli } from './testdata/goerliCommon.js' + import type { Blockchain, ConsensusDict } from '../src/index.js' import type { Block } from '@ethereumjs/block' import type { CliqueConfig } from '@ethereumjs/common' diff --git a/packages/blockchain/test/index.spec.ts b/packages/blockchain/test/index.spec.ts index 1e7fd0acbc..2f594c5ac5 100644 --- a/packages/blockchain/test/index.spec.ts +++ b/packages/blockchain/test/index.spec.ts @@ -4,13 +4,14 @@ import { createBlockHeader, createBlockHeaderFromBytesArray, } from '@ethereumjs/block' -import { Common, Goerli, Hardfork, Holesky, Mainnet, Sepolia } from '@ethereumjs/common' +import { Common, Hardfork, Holesky, Mainnet, Sepolia } from '@ethereumjs/common' import { MapDB, bytesToHex, equalsBytes, hexToBytes, utf8ToBytes } from '@ethereumjs/util' import { assert, describe, it } from 'vitest' import { Blockchain, createBlockchain, createBlockchainFromBlocksData } from '../src/index.js' import { blocksMainnetData } from './testdata/blocks_mainnet.js' +import { Goerli } from './testdata/goerliCommon.js' import { preLondonData } from './testdata/testdata_pre-london.js' import { createTestDB, generateBlockchain, generateBlocks, isConsecutive } from './util.js' diff --git a/packages/blockchain/test/reorg.spec.ts b/packages/blockchain/test/reorg.spec.ts index 19382953b9..1e298a4ea1 100644 --- a/packages/blockchain/test/reorg.spec.ts +++ b/packages/blockchain/test/reorg.spec.ts @@ -1,11 +1,12 @@ import { cliqueSigner, createBlock } from '@ethereumjs/block' -import { Common, ConsensusAlgorithm, Goerli, Hardfork, Mainnet } from '@ethereumjs/common' +import { Common, ConsensusAlgorithm, Hardfork, Mainnet } from '@ethereumjs/common' import { Address, equalsBytes, hexToBytes } from '@ethereumjs/util' import { assert, describe, it } from 'vitest' import { CLIQUE_NONCE_AUTH, CliqueConsensus } from '../src/consensus/clique.js' import { createBlockchain } from '../src/index.js' +import { Goerli } from './testdata/goerliCommon.js' import { generateConsecutiveBlock } from './util.js' import type { ConsensusDict } from '../src/index.js' diff --git a/packages/blockchain/test/testdata/goerliCommon.ts b/packages/blockchain/test/testdata/goerliCommon.ts new file mode 100644 index 0000000000..247aa11d55 --- /dev/null +++ b/packages/blockchain/test/testdata/goerliCommon.ts @@ -0,0 +1,162 @@ +import type { ChainConfig } from '@ethereumjs/common' + +export const Goerli: ChainConfig = { + name: 'goerli', + chainId: 5, + defaultHardfork: 'cancun', + consensus: { + type: 'poa', + algorithm: 'clique', + clique: { + period: 15, + epoch: 30000, + }, + }, + comment: 'Cross-client PoA test network', + url: 'https://github.com/goerli/testnet', + genesis: { + timestamp: '0x5c51a607', + gasLimit: 10485760, + difficulty: 1, + nonce: '0x0000000000000000', + extraData: + '0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + }, + hardforks: [ + { + name: 'chainstart', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'homestead', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'tangerineWhistle', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'spuriousDragon', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'byzantium', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'constantinople', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'petersburg', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'istanbul', + block: 1561651, + forkHash: '0xc25efa5c', + }, + { + name: 'berlin', + block: 4460644, + forkHash: '0x757a1c47', + }, + { + name: 'london', + block: 5062605, + forkHash: '0xb8c6299d', + }, + { + // The forkHash will remain same as mergeForkIdTransition is post merge, + // terminal block: https://goerli.etherscan.io/block/7382818 + name: 'paris', + block: 7382819, + forkHash: '0xb8c6299d', + }, + { + name: 'mergeForkIdTransition', + block: null, + forkHash: null, + }, + { + name: 'shanghai', + block: null, + timestamp: '1678832736', + forkHash: '0xf9843abf', + }, + { + name: 'cancun', + block: null, + timestamp: '1705473120', + forkHash: '0x70cc14e2', + }, + ], + bootstrapNodes: [ + { + ip: '51.141.78.53', + port: 30303, + id: '011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a', + location: '', + comment: 'Upstream bootnode 1', + }, + { + ip: '13.93.54.137', + port: 30303, + id: '176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b', + location: '', + comment: 'Upstream bootnode 2', + }, + { + ip: '94.237.54.114', + port: 30313, + id: '46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291', + location: '', + comment: 'Upstream bootnode 3', + }, + { + ip: '18.218.250.66', + port: 30313, + id: 'b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949', + location: '', + comment: 'Upstream bootnode 4', + }, + { + ip: '3.11.147.67', + port: 30303, + id: 'a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91', + location: '', + comment: 'Ethereum Foundation bootnode', + }, + { + ip: '51.15.116.226', + port: 30303, + id: 'a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 30303, + id: '807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 40303, + id: 'a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + ], + dnsNetworks: [ + 'enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net', + ], +} diff --git a/packages/client/src/config.ts b/packages/client/src/config.ts index 337c4ee31e..bbd6ffeadf 100644 --- a/packages/client/src/config.ts +++ b/packages/client/src/config.ts @@ -717,11 +717,11 @@ export class Config { /** * Returns specified option or the default setting for whether DNS-based peer discovery - * is enabled based on chainName. `true` for goerli + * is enabled based on chainName. */ getDnsDiscovery(option: boolean | undefined): boolean { if (option !== undefined) return option - const dnsNets = ['goerli', 'sepolia', 'holesky'] + const dnsNets = ['sepolia', 'holesky'] return dnsNets.includes(this.chainCommon.chainName()) } } diff --git a/packages/client/test/config.spec.ts b/packages/client/test/config.spec.ts index eb80d9505d..ff0954edf9 100644 --- a/packages/client/test/config.spec.ts +++ b/packages/client/test/config.spec.ts @@ -1,8 +1,10 @@ -import { Common, Goerli, Mainnet } from '@ethereumjs/common' +import { Common, Mainnet } from '@ethereumjs/common' import { assert, describe, it } from 'vitest' import { Config, DataDirectory } from '../src/config.js' +import { Goerli } from './testdata/common/goerliCommon.js' + describe('[Config]', () => { it('Initialization with default parameters', () => { const config = new Config() diff --git a/packages/client/test/execution/vmexecution.spec.ts b/packages/client/test/execution/vmexecution.spec.ts index cef68c1acc..31aa472ccb 100644 --- a/packages/client/test/execution/vmexecution.spec.ts +++ b/packages/client/test/execution/vmexecution.spec.ts @@ -1,7 +1,13 @@ import { createBlockFromExecutionPayload } from '@ethereumjs/block' import { createBlockchain, createBlockchainFromBlocksData } from '@ethereumjs/blockchain' -import { Common, Goerli, Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common' -import { bytesToHex } from '@ethereumjs/util' +import { + Common, + Hardfork, + Mainnet, + createCommonFromGethGenesis, + createCustomCommon, +} from '@ethereumjs/common' +import { bytesToHex, parseGethGenesisState } from '@ethereumjs/util' import { createVM } from '@ethereumjs/vm' import { assert, describe, it } from 'vitest' @@ -12,6 +18,7 @@ import { closeRPC, setupChain, testSetup } from '../rpc/helpers.js' import { goerliData } from '../testdata/blocks/goerli.js' import { mainnetData } from '../testdata/blocks/mainnet.js' import { testnetData } from '../testdata/common/testnet.js' +import { goerliGenesis } from '../testdata/geth-genesis/goerliGenesis.js' import { withdrawalsData } from '../testdata/geth-genesis/withdrawals.js' import type { ExecutionPayload } from '@ethereumjs/block' @@ -159,13 +166,24 @@ describe('[VMExecution]', () => { }) it('Block execution / Hardforks PoA (goerli)', async () => { - const common = new Common({ chain: Goerli, hardfork: Hardfork.Chainstart }) + const goerliState = parseGethGenesisState(goerliGenesis) + const common = createCommonFromGethGenesis(goerliGenesis, {}) let blockchain = await createBlockchain({ validateBlocks: true, validateConsensus: false, common, + genesisState: goerliState, }) - let exec = await testSetup(blockchain, common) + + let config = new Config({ common, accountCache: 10000, storageCache: 1000 }) + let chain = await Chain.create({ + config, + blockchain, + genesisState: goerliState, + }) + let exec = new VMExecution({ config, chain }) + await chain.open() + await exec.open() const oldHead = await (exec.vm.blockchain as Blockchain).getIteratorHead!() await exec.run() let newHead = await (exec.vm.blockchain as Blockchain).getIteratorHead!() @@ -175,8 +193,17 @@ describe('[VMExecution]', () => { validateBlocks: true, validateConsensus: false, common, + genesisState: goerliState, }) - exec = await testSetup(blockchain, common) + config = new Config({ common, accountCache: 10000, storageCache: 1000 }) + chain = await Chain.create({ + config, + blockchain, + genesisState: goerliState, + }) + exec = new VMExecution({ config, chain }) + await chain.open() + await exec.open() await exec.run() newHead = await (exec.vm.blockchain as Blockchain).getIteratorHead!() assert.equal(newHead.header.number, BigInt(7), 'should run all blocks') diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts index 4476c69fc9..372fb795fb 100644 --- a/packages/client/test/miner/miner.spec.ts +++ b/packages/client/test/miner/miner.spec.ts @@ -1,7 +1,6 @@ import { BlockHeader, createBlock, createBlockHeader } from '@ethereumjs/block' import { Common, - Goerli, Hardfork, createCommonFromGethGenesis, createCustomCommon, @@ -19,6 +18,7 @@ import { Miner } from '../../src/miner/index.js' import { FullEthereumService } from '../../src/service/index.js' // import { Event } from '../../src/types' import { wait } from '../integration/util.js' +import { Goerli } from '../testdata/common/goerliCommon.js' import type { FullSynchronizer } from '../../src/sync/index.js' import type { Block } from '@ethereumjs/block' diff --git a/packages/client/test/miner/pendingBlock.spec.ts b/packages/client/test/miner/pendingBlock.spec.ts index 91354c83f6..2abbd8286c 100644 --- a/packages/client/test/miner/pendingBlock.spec.ts +++ b/packages/client/test/miner/pendingBlock.spec.ts @@ -1,6 +1,6 @@ import { BlockHeader, createBlockHeader } from '@ethereumjs/block' import { createBlockchain } from '@ethereumjs/blockchain' -import { Common, Goerli, Hardfork, Mainnet, createCommonFromGethGenesis } from '@ethereumjs/common' +import { Common, Hardfork, Mainnet, createCommonFromGethGenesis } from '@ethereumjs/common' import { MerkleStateManager } from '@ethereumjs/statemanager' import { createBlob4844Tx, createFeeMarket1559Tx, createLegacyTx } from '@ethereumjs/tx' import { @@ -27,6 +27,7 @@ import { getLogger } from '../../src/logging.js' import { PendingBlock } from '../../src/miner/index.js' import { TxPool } from '../../src/service/txpool.js' import { mockBlockchain } from '../rpc/mockBlockchain.js' +import { Goerli } from '../testdata/common/goerliCommon.js' import type { Blockchain } from '@ethereumjs/blockchain' import type { TypedTransaction } from '@ethereumjs/tx' diff --git a/packages/client/test/rpc/eth/chainId.spec.ts b/packages/client/test/rpc/eth/chainId.spec.ts index 85f02c996c..406a5f0482 100644 --- a/packages/client/test/rpc/eth/chainId.spec.ts +++ b/packages/client/test/rpc/eth/chainId.spec.ts @@ -1,6 +1,7 @@ -import { Common, Goerli } from '@ethereumjs/common' +import { Common } from '@ethereumjs/common' import { assert, describe, it } from 'vitest' +import { Goerli } from '../../testdata/common/goerliCommon.js' import { baseSetup, createClient, createManager, getRPCClient, startRPC } from '../helpers.js' const method = 'eth_chainId' diff --git a/packages/client/test/rpc/net/version.spec.ts b/packages/client/test/rpc/net/version.spec.ts index 1357299ef9..4b30736b63 100644 --- a/packages/client/test/rpc/net/version.spec.ts +++ b/packages/client/test/rpc/net/version.spec.ts @@ -1,6 +1,7 @@ -import { Common, Goerli, Holesky } from '@ethereumjs/common' +import { Common, Holesky } from '@ethereumjs/common' import { assert, describe, it, vi } from 'vitest' +import { Goerli } from '../../testdata/common/goerliCommon.js' import { baseSetup, createClient, createManager, getRPCClient, startRPC } from '../helpers.js' const method = 'net_version' diff --git a/packages/client/test/testdata/common/goerliCommon.ts b/packages/client/test/testdata/common/goerliCommon.ts new file mode 100644 index 0000000000..247aa11d55 --- /dev/null +++ b/packages/client/test/testdata/common/goerliCommon.ts @@ -0,0 +1,162 @@ +import type { ChainConfig } from '@ethereumjs/common' + +export const Goerli: ChainConfig = { + name: 'goerli', + chainId: 5, + defaultHardfork: 'cancun', + consensus: { + type: 'poa', + algorithm: 'clique', + clique: { + period: 15, + epoch: 30000, + }, + }, + comment: 'Cross-client PoA test network', + url: 'https://github.com/goerli/testnet', + genesis: { + timestamp: '0x5c51a607', + gasLimit: 10485760, + difficulty: 1, + nonce: '0x0000000000000000', + extraData: + '0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + }, + hardforks: [ + { + name: 'chainstart', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'homestead', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'tangerineWhistle', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'spuriousDragon', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'byzantium', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'constantinople', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'petersburg', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'istanbul', + block: 1561651, + forkHash: '0xc25efa5c', + }, + { + name: 'berlin', + block: 4460644, + forkHash: '0x757a1c47', + }, + { + name: 'london', + block: 5062605, + forkHash: '0xb8c6299d', + }, + { + // The forkHash will remain same as mergeForkIdTransition is post merge, + // terminal block: https://goerli.etherscan.io/block/7382818 + name: 'paris', + block: 7382819, + forkHash: '0xb8c6299d', + }, + { + name: 'mergeForkIdTransition', + block: null, + forkHash: null, + }, + { + name: 'shanghai', + block: null, + timestamp: '1678832736', + forkHash: '0xf9843abf', + }, + { + name: 'cancun', + block: null, + timestamp: '1705473120', + forkHash: '0x70cc14e2', + }, + ], + bootstrapNodes: [ + { + ip: '51.141.78.53', + port: 30303, + id: '011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a', + location: '', + comment: 'Upstream bootnode 1', + }, + { + ip: '13.93.54.137', + port: 30303, + id: '176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b', + location: '', + comment: 'Upstream bootnode 2', + }, + { + ip: '94.237.54.114', + port: 30313, + id: '46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291', + location: '', + comment: 'Upstream bootnode 3', + }, + { + ip: '18.218.250.66', + port: 30313, + id: 'b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949', + location: '', + comment: 'Upstream bootnode 4', + }, + { + ip: '3.11.147.67', + port: 30303, + id: 'a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91', + location: '', + comment: 'Ethereum Foundation bootnode', + }, + { + ip: '51.15.116.226', + port: 30303, + id: 'a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 30303, + id: '807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 40303, + id: 'a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + ], + dnsNetworks: [ + 'enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net', + ], +} diff --git a/packages/client/test/testdata/geth-genesis/goerliGenesis.ts b/packages/client/test/testdata/geth-genesis/goerliGenesis.ts new file mode 100644 index 0000000000..9c2737fe6e --- /dev/null +++ b/packages/client/test/testdata/geth-genesis/goerliGenesis.ts @@ -0,0 +1,314 @@ +export const goerliGenesis = { + config: { + chainId: 5, + homesteadBlock: 0, + daoForkSupport: true, + eip150Block: 0, + eip150Hash: '0x0000000000000000000000000000000000000000000000000000000000000000', + eip155Block: 0, + eip158Block: 0, + byzantiumBlock: 0, + constantinopleBlock: 0, + petersburgBlock: 0, + istanbulBlock: 1561651, + clique: { period: 15, epoch: 30000 }, + trustedCheckpoint: { + sectionIndex: 66, + sectionHead: '0xeea3a7b2cb275956f3049dd27e6cdacd8a6ef86738d593d556efee5361019475', + chtRoot: '0x11712af50b4083dc5910e452ca69fbfc0f2940770b9846200a573f87a0af94e6', + bloomRoot: '0x331b7a7b273e81daeac8cafb9952a16669d7facc7be3b0ebd3a792b4d8b95cc5', + }, + trustedCheckpointOracle: { + address: '0x18ca0e045f0d772a851bc7e48357bcaab0a0795d', + signers: [ + '0x4769bcad07e3b938b7f43eb7d278bc7cb9effb38', + '0x78d1ad571a1a09d60d9bbf25894b44e4c8859595', + '0x286834935f4a8cfb4ff4c77d5770c2775ae2b0e7', + '0xb86e2b0ab5a4b1373e40c51a7c712c70ba2f9f8e', + '0x0df8fa387c602ae62559cc4afa4972a7045d6707', + ], + threshold: 2, + }, + }, + nonce: '0x0', + timestamp: '0x5c51a607', + extraData: + '0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + gasLimit: '0xa00000', + difficulty: '0x1', + mixHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + coinbase: '0x0000000000000000000000000000000000000000', + alloc: { + '0000000000000000000000000000000000000000': { balance: '0x1' }, + '0000000000000000000000000000000000000001': { balance: '0x1' }, + '0000000000000000000000000000000000000002': { balance: '0x1' }, + '0000000000000000000000000000000000000003': { balance: '0x1' }, + '0000000000000000000000000000000000000004': { balance: '0x1' }, + '0000000000000000000000000000000000000005': { balance: '0x1' }, + '0000000000000000000000000000000000000006': { balance: '0x1' }, + '0000000000000000000000000000000000000007': { balance: '0x1' }, + '0000000000000000000000000000000000000008': { balance: '0x1' }, + '0000000000000000000000000000000000000009': { balance: '0x1' }, + '000000000000000000000000000000000000000a': { balance: '0x1' }, + '000000000000000000000000000000000000000b': { balance: '0x1' }, + '000000000000000000000000000000000000000c': { balance: '0x1' }, + '000000000000000000000000000000000000000d': { balance: '0x1' }, + '000000000000000000000000000000000000000e': { balance: '0x1' }, + '000000000000000000000000000000000000000f': { balance: '0x1' }, + '0000000000000000000000000000000000000010': { balance: '0x1' }, + '0000000000000000000000000000000000000011': { balance: '0x1' }, + '0000000000000000000000000000000000000012': { balance: '0x1' }, + '0000000000000000000000000000000000000013': { balance: '0x1' }, + '0000000000000000000000000000000000000014': { balance: '0x1' }, + '0000000000000000000000000000000000000015': { balance: '0x1' }, + '0000000000000000000000000000000000000016': { balance: '0x1' }, + '0000000000000000000000000000000000000017': { balance: '0x1' }, + '0000000000000000000000000000000000000018': { balance: '0x1' }, + '0000000000000000000000000000000000000019': { balance: '0x1' }, + '000000000000000000000000000000000000001a': { balance: '0x1' }, + '000000000000000000000000000000000000001b': { balance: '0x1' }, + '000000000000000000000000000000000000001c': { balance: '0x1' }, + '000000000000000000000000000000000000001d': { balance: '0x1' }, + '000000000000000000000000000000000000001e': { balance: '0x1' }, + '000000000000000000000000000000000000001f': { balance: '0x1' }, + '0000000000000000000000000000000000000020': { balance: '0x1' }, + '0000000000000000000000000000000000000021': { balance: '0x1' }, + '0000000000000000000000000000000000000022': { balance: '0x1' }, + '0000000000000000000000000000000000000023': { balance: '0x1' }, + '0000000000000000000000000000000000000024': { balance: '0x1' }, + '0000000000000000000000000000000000000025': { balance: '0x1' }, + '0000000000000000000000000000000000000026': { balance: '0x1' }, + '0000000000000000000000000000000000000027': { balance: '0x1' }, + '0000000000000000000000000000000000000028': { balance: '0x1' }, + '0000000000000000000000000000000000000029': { balance: '0x1' }, + '000000000000000000000000000000000000002a': { balance: '0x1' }, + '000000000000000000000000000000000000002b': { balance: '0x1' }, + '000000000000000000000000000000000000002c': { balance: '0x1' }, + '000000000000000000000000000000000000002d': { balance: '0x1' }, + '000000000000000000000000000000000000002e': { balance: '0x1' }, + '000000000000000000000000000000000000002f': { balance: '0x1' }, + '0000000000000000000000000000000000000030': { balance: '0x1' }, + '0000000000000000000000000000000000000031': { balance: '0x1' }, + '0000000000000000000000000000000000000032': { balance: '0x1' }, + '0000000000000000000000000000000000000033': { balance: '0x1' }, + '0000000000000000000000000000000000000034': { balance: '0x1' }, + '0000000000000000000000000000000000000035': { balance: '0x1' }, + '0000000000000000000000000000000000000036': { balance: '0x1' }, + '0000000000000000000000000000000000000037': { balance: '0x1' }, + '0000000000000000000000000000000000000038': { balance: '0x1' }, + '0000000000000000000000000000000000000039': { balance: '0x1' }, + '000000000000000000000000000000000000003a': { balance: '0x1' }, + '000000000000000000000000000000000000003b': { balance: '0x1' }, + '000000000000000000000000000000000000003c': { balance: '0x1' }, + '000000000000000000000000000000000000003d': { balance: '0x1' }, + '000000000000000000000000000000000000003e': { balance: '0x1' }, + '000000000000000000000000000000000000003f': { balance: '0x1' }, + '0000000000000000000000000000000000000040': { balance: '0x1' }, + '0000000000000000000000000000000000000041': { balance: '0x1' }, + '0000000000000000000000000000000000000042': { balance: '0x1' }, + '0000000000000000000000000000000000000043': { balance: '0x1' }, + '0000000000000000000000000000000000000044': { balance: '0x1' }, + '0000000000000000000000000000000000000045': { balance: '0x1' }, + '0000000000000000000000000000000000000046': { balance: '0x1' }, + '0000000000000000000000000000000000000047': { balance: '0x1' }, + '0000000000000000000000000000000000000048': { balance: '0x1' }, + '0000000000000000000000000000000000000049': { balance: '0x1' }, + '000000000000000000000000000000000000004a': { balance: '0x1' }, + '000000000000000000000000000000000000004b': { balance: '0x1' }, + '000000000000000000000000000000000000004c': { balance: '0x1' }, + '000000000000000000000000000000000000004d': { balance: '0x1' }, + '000000000000000000000000000000000000004e': { balance: '0x1' }, + '000000000000000000000000000000000000004f': { balance: '0x1' }, + '0000000000000000000000000000000000000050': { balance: '0x1' }, + '0000000000000000000000000000000000000051': { balance: '0x1' }, + '0000000000000000000000000000000000000052': { balance: '0x1' }, + '0000000000000000000000000000000000000053': { balance: '0x1' }, + '0000000000000000000000000000000000000054': { balance: '0x1' }, + '0000000000000000000000000000000000000055': { balance: '0x1' }, + '0000000000000000000000000000000000000056': { balance: '0x1' }, + '0000000000000000000000000000000000000057': { balance: '0x1' }, + '0000000000000000000000000000000000000058': { balance: '0x1' }, + '0000000000000000000000000000000000000059': { balance: '0x1' }, + '000000000000000000000000000000000000005a': { balance: '0x1' }, + '000000000000000000000000000000000000005b': { balance: '0x1' }, + '000000000000000000000000000000000000005c': { balance: '0x1' }, + '000000000000000000000000000000000000005d': { balance: '0x1' }, + '000000000000000000000000000000000000005e': { balance: '0x1' }, + '000000000000000000000000000000000000005f': { balance: '0x1' }, + '0000000000000000000000000000000000000060': { balance: '0x1' }, + '0000000000000000000000000000000000000061': { balance: '0x1' }, + '0000000000000000000000000000000000000062': { balance: '0x1' }, + '0000000000000000000000000000000000000063': { balance: '0x1' }, + '0000000000000000000000000000000000000064': { balance: '0x1' }, + '0000000000000000000000000000000000000065': { balance: '0x1' }, + '0000000000000000000000000000000000000066': { balance: '0x1' }, + '0000000000000000000000000000000000000067': { balance: '0x1' }, + '0000000000000000000000000000000000000068': { balance: '0x1' }, + '0000000000000000000000000000000000000069': { balance: '0x1' }, + '000000000000000000000000000000000000006a': { balance: '0x1' }, + '000000000000000000000000000000000000006b': { balance: '0x1' }, + '000000000000000000000000000000000000006c': { balance: '0x1' }, + '000000000000000000000000000000000000006d': { balance: '0x1' }, + '000000000000000000000000000000000000006e': { balance: '0x1' }, + '000000000000000000000000000000000000006f': { balance: '0x1' }, + '0000000000000000000000000000000000000070': { balance: '0x1' }, + '0000000000000000000000000000000000000071': { balance: '0x1' }, + '0000000000000000000000000000000000000072': { balance: '0x1' }, + '0000000000000000000000000000000000000073': { balance: '0x1' }, + '0000000000000000000000000000000000000074': { balance: '0x1' }, + '0000000000000000000000000000000000000075': { balance: '0x1' }, + '0000000000000000000000000000000000000076': { balance: '0x1' }, + '0000000000000000000000000000000000000077': { balance: '0x1' }, + '0000000000000000000000000000000000000078': { balance: '0x1' }, + '0000000000000000000000000000000000000079': { balance: '0x1' }, + '000000000000000000000000000000000000007a': { balance: '0x1' }, + '000000000000000000000000000000000000007b': { balance: '0x1' }, + '000000000000000000000000000000000000007c': { balance: '0x1' }, + '000000000000000000000000000000000000007d': { balance: '0x1' }, + '000000000000000000000000000000000000007e': { balance: '0x1' }, + '000000000000000000000000000000000000007f': { balance: '0x1' }, + '0000000000000000000000000000000000000080': { balance: '0x1' }, + '0000000000000000000000000000000000000081': { balance: '0x1' }, + '0000000000000000000000000000000000000082': { balance: '0x1' }, + '0000000000000000000000000000000000000083': { balance: '0x1' }, + '0000000000000000000000000000000000000084': { balance: '0x1' }, + '0000000000000000000000000000000000000085': { balance: '0x1' }, + '0000000000000000000000000000000000000086': { balance: '0x1' }, + '0000000000000000000000000000000000000087': { balance: '0x1' }, + '0000000000000000000000000000000000000088': { balance: '0x1' }, + '0000000000000000000000000000000000000089': { balance: '0x1' }, + '000000000000000000000000000000000000008a': { balance: '0x1' }, + '000000000000000000000000000000000000008b': { balance: '0x1' }, + '000000000000000000000000000000000000008c': { balance: '0x1' }, + '000000000000000000000000000000000000008d': { balance: '0x1' }, + '000000000000000000000000000000000000008e': { balance: '0x1' }, + '000000000000000000000000000000000000008f': { balance: '0x1' }, + '0000000000000000000000000000000000000090': { balance: '0x1' }, + '0000000000000000000000000000000000000091': { balance: '0x1' }, + '0000000000000000000000000000000000000092': { balance: '0x1' }, + '0000000000000000000000000000000000000093': { balance: '0x1' }, + '0000000000000000000000000000000000000094': { balance: '0x1' }, + '0000000000000000000000000000000000000095': { balance: '0x1' }, + '0000000000000000000000000000000000000096': { balance: '0x1' }, + '0000000000000000000000000000000000000097': { balance: '0x1' }, + '0000000000000000000000000000000000000098': { balance: '0x1' }, + '0000000000000000000000000000000000000099': { balance: '0x1' }, + '000000000000000000000000000000000000009a': { balance: '0x1' }, + '000000000000000000000000000000000000009b': { balance: '0x1' }, + '000000000000000000000000000000000000009c': { balance: '0x1' }, + '000000000000000000000000000000000000009d': { balance: '0x1' }, + '000000000000000000000000000000000000009e': { balance: '0x1' }, + '000000000000000000000000000000000000009f': { balance: '0x1' }, + '00000000000000000000000000000000000000a0': { balance: '0x1' }, + '00000000000000000000000000000000000000a1': { balance: '0x1' }, + '00000000000000000000000000000000000000a2': { balance: '0x1' }, + '00000000000000000000000000000000000000a3': { balance: '0x1' }, + '00000000000000000000000000000000000000a4': { balance: '0x1' }, + '00000000000000000000000000000000000000a5': { balance: '0x1' }, + '00000000000000000000000000000000000000a6': { balance: '0x1' }, + '00000000000000000000000000000000000000a7': { balance: '0x1' }, + '00000000000000000000000000000000000000a8': { balance: '0x1' }, + '00000000000000000000000000000000000000a9': { balance: '0x1' }, + '00000000000000000000000000000000000000aa': { balance: '0x1' }, + '00000000000000000000000000000000000000ab': { balance: '0x1' }, + '00000000000000000000000000000000000000ac': { balance: '0x1' }, + '00000000000000000000000000000000000000ad': { balance: '0x1' }, + '00000000000000000000000000000000000000ae': { balance: '0x1' }, + '00000000000000000000000000000000000000af': { balance: '0x1' }, + '00000000000000000000000000000000000000b0': { balance: '0x1' }, + '00000000000000000000000000000000000000b1': { balance: '0x1' }, + '00000000000000000000000000000000000000b2': { balance: '0x1' }, + '00000000000000000000000000000000000000b3': { balance: '0x1' }, + '00000000000000000000000000000000000000b4': { balance: '0x1' }, + '00000000000000000000000000000000000000b5': { balance: '0x1' }, + '00000000000000000000000000000000000000b6': { balance: '0x1' }, + '00000000000000000000000000000000000000b7': { balance: '0x1' }, + '00000000000000000000000000000000000000b8': { balance: '0x1' }, + '00000000000000000000000000000000000000b9': { balance: '0x1' }, + '00000000000000000000000000000000000000ba': { balance: '0x1' }, + '00000000000000000000000000000000000000bb': { balance: '0x1' }, + '00000000000000000000000000000000000000bc': { balance: '0x1' }, + '00000000000000000000000000000000000000bd': { balance: '0x1' }, + '00000000000000000000000000000000000000be': { balance: '0x1' }, + '00000000000000000000000000000000000000bf': { balance: '0x1' }, + '00000000000000000000000000000000000000c0': { balance: '0x1' }, + '00000000000000000000000000000000000000c1': { balance: '0x1' }, + '00000000000000000000000000000000000000c2': { balance: '0x1' }, + '00000000000000000000000000000000000000c3': { balance: '0x1' }, + '00000000000000000000000000000000000000c4': { balance: '0x1' }, + '00000000000000000000000000000000000000c5': { balance: '0x1' }, + '00000000000000000000000000000000000000c6': { balance: '0x1' }, + '00000000000000000000000000000000000000c7': { balance: '0x1' }, + '00000000000000000000000000000000000000c8': { balance: '0x1' }, + '00000000000000000000000000000000000000c9': { balance: '0x1' }, + '00000000000000000000000000000000000000ca': { balance: '0x1' }, + '00000000000000000000000000000000000000cb': { balance: '0x1' }, + '00000000000000000000000000000000000000cc': { balance: '0x1' }, + '00000000000000000000000000000000000000cd': { balance: '0x1' }, + '00000000000000000000000000000000000000ce': { balance: '0x1' }, + '00000000000000000000000000000000000000cf': { balance: '0x1' }, + '00000000000000000000000000000000000000d0': { balance: '0x1' }, + '00000000000000000000000000000000000000d1': { balance: '0x1' }, + '00000000000000000000000000000000000000d2': { balance: '0x1' }, + '00000000000000000000000000000000000000d3': { balance: '0x1' }, + '00000000000000000000000000000000000000d4': { balance: '0x1' }, + '00000000000000000000000000000000000000d5': { balance: '0x1' }, + '00000000000000000000000000000000000000d6': { balance: '0x1' }, + '00000000000000000000000000000000000000d7': { balance: '0x1' }, + '00000000000000000000000000000000000000d8': { balance: '0x1' }, + '00000000000000000000000000000000000000d9': { balance: '0x1' }, + '00000000000000000000000000000000000000da': { balance: '0x1' }, + '00000000000000000000000000000000000000db': { balance: '0x1' }, + '00000000000000000000000000000000000000dc': { balance: '0x1' }, + '00000000000000000000000000000000000000dd': { balance: '0x1' }, + '00000000000000000000000000000000000000de': { balance: '0x1' }, + '00000000000000000000000000000000000000df': { balance: '0x1' }, + '00000000000000000000000000000000000000e0': { balance: '0x1' }, + '00000000000000000000000000000000000000e1': { balance: '0x1' }, + '00000000000000000000000000000000000000e2': { balance: '0x1' }, + '00000000000000000000000000000000000000e3': { balance: '0x1' }, + '00000000000000000000000000000000000000e4': { balance: '0x1' }, + '00000000000000000000000000000000000000e5': { balance: '0x1' }, + '00000000000000000000000000000000000000e6': { balance: '0x1' }, + '00000000000000000000000000000000000000e7': { balance: '0x1' }, + '00000000000000000000000000000000000000e8': { balance: '0x1' }, + '00000000000000000000000000000000000000e9': { balance: '0x1' }, + '00000000000000000000000000000000000000ea': { balance: '0x1' }, + '00000000000000000000000000000000000000eb': { balance: '0x1' }, + '00000000000000000000000000000000000000ec': { balance: '0x1' }, + '00000000000000000000000000000000000000ed': { balance: '0x1' }, + '00000000000000000000000000000000000000ee': { balance: '0x1' }, + '00000000000000000000000000000000000000ef': { balance: '0x1' }, + '00000000000000000000000000000000000000f0': { balance: '0x1' }, + '00000000000000000000000000000000000000f1': { balance: '0x1' }, + '00000000000000000000000000000000000000f2': { balance: '0x1' }, + '00000000000000000000000000000000000000f3': { balance: '0x1' }, + '00000000000000000000000000000000000000f4': { balance: '0x1' }, + '00000000000000000000000000000000000000f5': { balance: '0x1' }, + '00000000000000000000000000000000000000f6': { balance: '0x1' }, + '00000000000000000000000000000000000000f7': { balance: '0x1' }, + '00000000000000000000000000000000000000f8': { balance: '0x1' }, + '00000000000000000000000000000000000000f9': { balance: '0x1' }, + '00000000000000000000000000000000000000fa': { balance: '0x1' }, + '00000000000000000000000000000000000000fb': { balance: '0x1' }, + '00000000000000000000000000000000000000fc': { balance: '0x1' }, + '00000000000000000000000000000000000000fd': { balance: '0x1' }, + '00000000000000000000000000000000000000fe': { balance: '0x1' }, + '00000000000000000000000000000000000000ff': { balance: '0x1' }, + '4c2ae482593505f0163cdefc073e81c63cda4107': { + balance: '0x152d02c7e14af6800000', + }, + a8e8f14732658e4b51e8711931053a8a69baf2b1: { + balance: '0x152d02c7e14af6800000', + }, + d9a5179f091d85051d3c982785efd1455cec8699: { + balance: '0x84595161401484a000000', + }, + e0a2bd4258d2768837baa26a28fe71dc079f84c7: { + balance: '0x4a47e3c12448f4ad000000', + }, + }, + number: '0x0', + gasUsed: '0x0', + parentHash: '0x0000000000000000000000000000000000000000000000000000000000000000', +} diff --git a/packages/common/src/chains.ts b/packages/common/src/chains.ts index e917b8e9f1..986ac4a423 100644 --- a/packages/common/src/chains.ts +++ b/packages/common/src/chains.ts @@ -161,167 +161,6 @@ export const Mainnet: ChainConfig = { ], } -export const Goerli: ChainConfig = { - name: 'goerli', - chainId: 5, - defaultHardfork: 'cancun', - consensus: { - type: 'poa', - algorithm: 'clique', - clique: { - period: 15, - epoch: 30000, - }, - }, - comment: 'Cross-client PoA test network', - url: 'https://github.com/goerli/testnet', - genesis: { - timestamp: '0x5c51a607', - gasLimit: 10485760, - difficulty: 1, - nonce: '0x0000000000000000', - extraData: - '0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - }, - hardforks: [ - { - name: 'chainstart', - block: 0, - forkHash: '0xa3f5ab08', - }, - { - name: 'homestead', - block: 0, - forkHash: '0xa3f5ab08', - }, - { - name: 'tangerineWhistle', - block: 0, - forkHash: '0xa3f5ab08', - }, - { - name: 'spuriousDragon', - block: 0, - forkHash: '0xa3f5ab08', - }, - { - name: 'byzantium', - block: 0, - forkHash: '0xa3f5ab08', - }, - { - name: 'constantinople', - block: 0, - forkHash: '0xa3f5ab08', - }, - { - name: 'petersburg', - block: 0, - forkHash: '0xa3f5ab08', - }, - { - name: 'istanbul', - block: 1561651, - forkHash: '0xc25efa5c', - }, - { - name: 'berlin', - block: 4460644, - forkHash: '0x757a1c47', - }, - { - name: 'london', - block: 5062605, - forkHash: '0xb8c6299d', - }, - { - // The forkHash will remain same as mergeForkIdTransition is post merge, - // terminal block: https://goerli.etherscan.io/block/7382818 - name: 'paris', - block: 7382819, - forkHash: '0xb8c6299d', - }, - { - name: 'mergeForkIdTransition', - block: null, - forkHash: null, - }, - { - name: 'shanghai', - block: null, - timestamp: '1678832736', - forkHash: '0xf9843abf', - }, - { - name: 'cancun', - block: null, - timestamp: '1705473120', - forkHash: '0x70cc14e2', - }, - ], - bootstrapNodes: [ - { - ip: '51.141.78.53', - port: 30303, - id: '011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a', - location: '', - comment: 'Upstream bootnode 1', - }, - { - ip: '13.93.54.137', - port: 30303, - id: '176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b', - location: '', - comment: 'Upstream bootnode 2', - }, - { - ip: '94.237.54.114', - port: 30313, - id: '46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291', - location: '', - comment: 'Upstream bootnode 3', - }, - { - ip: '18.218.250.66', - port: 30313, - id: 'b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949', - location: '', - comment: 'Upstream bootnode 4', - }, - { - ip: '3.11.147.67', - port: 30303, - id: 'a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91', - location: '', - comment: 'Ethereum Foundation bootnode', - }, - { - ip: '51.15.116.226', - port: 30303, - id: 'a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd', - location: '', - comment: 'Goerli Initiative bootnode', - }, - { - ip: '51.15.119.157', - port: 30303, - id: '807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33', - location: '', - comment: 'Goerli Initiative bootnode', - }, - { - ip: '51.15.119.157', - port: 40303, - id: 'a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd', - location: '', - comment: 'Goerli Initiative bootnode', - }, - ], - dnsNetworks: [ - 'enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net', - ], -} - export const Sepolia: ChainConfig = { name: 'sepolia', chainId: 11155111, diff --git a/packages/common/src/enums.ts b/packages/common/src/enums.ts index 8f4f673d57..8acfcffe04 100644 --- a/packages/common/src/enums.ts +++ b/packages/common/src/enums.ts @@ -2,7 +2,6 @@ import { BIGINT_0, hexToBytes } from '@ethereumjs/util' export enum Chain { Mainnet = 1, - Goerli = 5, Sepolia = 11155111, Holesky = 17000, Kaustinen6 = 69420, @@ -29,11 +28,6 @@ export const ChainGenesis: Record = { blockNumber: BIGINT_0, stateRoot: hexToBytes('0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544'), }, - [Chain.Goerli]: { - name: 'goerli', - blockNumber: BIGINT_0, - stateRoot: hexToBytes('0x5d6cded585e73c4e322c30c2f782a336316f17dd85a4863b9d838d2d4b8b3008'), - }, [Chain.Sepolia]: { name: 'sepolia', blockNumber: BIGINT_0, diff --git a/packages/common/src/utils.ts b/packages/common/src/utils.ts index 551847425c..ac80e737ff 100644 --- a/packages/common/src/utils.ts +++ b/packages/common/src/utils.ts @@ -1,6 +1,6 @@ import { intToHex, isHexString, stripHexPrefix } from '@ethereumjs/util' -import { Goerli, Holesky, Kaustinen6, Mainnet, Sepolia } from './chains.js' +import { Holesky, Kaustinen6, Mainnet, Sepolia } from './chains.js' import { Hardfork } from './enums.js' import type { PrefixedHexString } from '@ethereumjs/util' @@ -253,9 +253,6 @@ export function parseGethGenesis(json: any, name?: string) { */ export const getPresetChainConfig = (chain: string | number) => { switch (chain) { - case 'goerli': - case 5: - return Goerli case 'holesky': case 17000: return Holesky diff --git a/packages/common/test/chains.spec.ts b/packages/common/test/chains.spec.ts index f55f9e7ba6..61e27ab55c 100644 --- a/packages/common/test/chains.spec.ts +++ b/packages/common/test/chains.spec.ts @@ -4,12 +4,13 @@ import { Common, ConsensusAlgorithm, ConsensusType, - Goerli, Hardfork, Mainnet, getPresetChainConfig, } from '../src/index.js' +import { Goerli } from './data/goerliCommon.js' + import type { ChainConfig } from '../src/index.js' describe('[Common/Chains]: Initialization / Chain params', () => { @@ -52,9 +53,6 @@ describe('[Common/Chains]: Initialization / Chain params', () => { let chain = getPresetChainConfig('mainnet') let c = new Common({ chain }) assert.equal(c.chainName(), 'mainnet') - chain = getPresetChainConfig(5) - c = new Common({ chain }) - assert.equal(c.chainName(), 'goerli') chain = getPresetChainConfig(123) c = new Common({ chain }) assert.equal(c.chainName(), 'mainnet') diff --git a/packages/common/test/data/goerliCommon.ts b/packages/common/test/data/goerliCommon.ts new file mode 100644 index 0000000000..247aa11d55 --- /dev/null +++ b/packages/common/test/data/goerliCommon.ts @@ -0,0 +1,162 @@ +import type { ChainConfig } from '@ethereumjs/common' + +export const Goerli: ChainConfig = { + name: 'goerli', + chainId: 5, + defaultHardfork: 'cancun', + consensus: { + type: 'poa', + algorithm: 'clique', + clique: { + period: 15, + epoch: 30000, + }, + }, + comment: 'Cross-client PoA test network', + url: 'https://github.com/goerli/testnet', + genesis: { + timestamp: '0x5c51a607', + gasLimit: 10485760, + difficulty: 1, + nonce: '0x0000000000000000', + extraData: + '0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + }, + hardforks: [ + { + name: 'chainstart', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'homestead', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'tangerineWhistle', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'spuriousDragon', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'byzantium', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'constantinople', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'petersburg', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'istanbul', + block: 1561651, + forkHash: '0xc25efa5c', + }, + { + name: 'berlin', + block: 4460644, + forkHash: '0x757a1c47', + }, + { + name: 'london', + block: 5062605, + forkHash: '0xb8c6299d', + }, + { + // The forkHash will remain same as mergeForkIdTransition is post merge, + // terminal block: https://goerli.etherscan.io/block/7382818 + name: 'paris', + block: 7382819, + forkHash: '0xb8c6299d', + }, + { + name: 'mergeForkIdTransition', + block: null, + forkHash: null, + }, + { + name: 'shanghai', + block: null, + timestamp: '1678832736', + forkHash: '0xf9843abf', + }, + { + name: 'cancun', + block: null, + timestamp: '1705473120', + forkHash: '0x70cc14e2', + }, + ], + bootstrapNodes: [ + { + ip: '51.141.78.53', + port: 30303, + id: '011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a', + location: '', + comment: 'Upstream bootnode 1', + }, + { + ip: '13.93.54.137', + port: 30303, + id: '176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b', + location: '', + comment: 'Upstream bootnode 2', + }, + { + ip: '94.237.54.114', + port: 30313, + id: '46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291', + location: '', + comment: 'Upstream bootnode 3', + }, + { + ip: '18.218.250.66', + port: 30313, + id: 'b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949', + location: '', + comment: 'Upstream bootnode 4', + }, + { + ip: '3.11.147.67', + port: 30303, + id: 'a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91', + location: '', + comment: 'Ethereum Foundation bootnode', + }, + { + ip: '51.15.116.226', + port: 30303, + id: 'a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 30303, + id: '807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 40303, + id: 'a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + ], + dnsNetworks: [ + 'enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net', + ], +} diff --git a/packages/common/test/hardforks.spec.ts b/packages/common/test/hardforks.spec.ts index 228e947eab..12fd132add 100644 --- a/packages/common/test/hardforks.spec.ts +++ b/packages/common/test/hardforks.spec.ts @@ -5,7 +5,6 @@ import { Common, ConsensusAlgorithm, ConsensusType, - Goerli, Hardfork, Holesky, Mainnet, @@ -14,6 +13,8 @@ import { createCustomCommon, } from '../src/index.js' +import { Goerli } from './data/goerliCommon.js' + import type { ChainConfig } from '../src/index.js' describe('[Common]: Hardfork logic', () => { diff --git a/packages/genesis/src/index.ts b/packages/genesis/src/index.ts index 45242dce32..5fdf4c2137 100644 --- a/packages/genesis/src/index.ts +++ b/packages/genesis/src/index.ts @@ -1,6 +1,5 @@ import { Chain } from '@ethereumjs/common' -import { goerliGenesis } from './genesisStates/goerli.js' import { holeskyGenesis } from './genesisStates/holesky.js' import { mainnetGenesis } from './genesisStates/mainnet.js' import { sepoliaGenesis } from './genesisStates/sepolia.js' @@ -16,8 +15,6 @@ export function getGenesis(chainId: number): GenesisState | undefined { switch (chainId) { case Chain.Mainnet: return mainnetGenesis - case Chain.Goerli: - return goerliGenesis case Chain.Sepolia: return sepoliaGenesis case Chain.Holesky: diff --git a/packages/genesis/src/genesisStates/goerli.ts b/packages/genesis/test/goerli.ts similarity index 100% rename from packages/genesis/src/genesisStates/goerli.ts rename to packages/genesis/test/goerli.ts diff --git a/packages/statemanager/test/vmState.spec.ts b/packages/statemanager/test/vmState.spec.ts index 244c52b3ab..7555dc071a 100644 --- a/packages/statemanager/test/vmState.spec.ts +++ b/packages/statemanager/test/vmState.spec.ts @@ -36,10 +36,7 @@ describe('stateManager', () => { it(`should generate the genesis state root correctly for all other chains`, async () => { const chains: [Chain, Uint8Array][] = [ - [ - Chain.Goerli, - hexToBytes('0x5d6cded585e73c4e322c30c2f782a336316f17dd85a4863b9d838d2d4b8b3008'), - ], + // TODO: add Holesky [ Chain.Sepolia, hexToBytes('0x5eb6e371a698b8d68f665192350ffcecbbbf322916f4b51bd79bb6887da3f494'), diff --git a/packages/tx/test/legacy.spec.ts b/packages/tx/test/legacy.spec.ts index f8743778de..2d10a185ad 100644 --- a/packages/tx/test/legacy.spec.ts +++ b/packages/tx/test/legacy.spec.ts @@ -1,4 +1,4 @@ -import { Common, Goerli, Hardfork, Mainnet, Sepolia, createCustomCommon } from '@ethereumjs/common' +import { Common, Hardfork, Mainnet, Sepolia, createCustomCommon } from '@ethereumjs/common' import { RLP } from '@ethereumjs/rlp' import { bytesToBigInt, @@ -17,6 +17,7 @@ import { createLegacyTxFromRLP, } from '../src/index.js' +import { Goerli } from './testData/goerliCommon.js' import { transactionTestEip155VitalikTestsData } from './testData/transactionTestEip155VitalikTests.js' import { txsData } from './testData/txs.js' diff --git a/packages/tx/test/testData/goerliCommon.ts b/packages/tx/test/testData/goerliCommon.ts new file mode 100644 index 0000000000..247aa11d55 --- /dev/null +++ b/packages/tx/test/testData/goerliCommon.ts @@ -0,0 +1,162 @@ +import type { ChainConfig } from '@ethereumjs/common' + +export const Goerli: ChainConfig = { + name: 'goerli', + chainId: 5, + defaultHardfork: 'cancun', + consensus: { + type: 'poa', + algorithm: 'clique', + clique: { + period: 15, + epoch: 30000, + }, + }, + comment: 'Cross-client PoA test network', + url: 'https://github.com/goerli/testnet', + genesis: { + timestamp: '0x5c51a607', + gasLimit: 10485760, + difficulty: 1, + nonce: '0x0000000000000000', + extraData: + '0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + }, + hardforks: [ + { + name: 'chainstart', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'homestead', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'tangerineWhistle', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'spuriousDragon', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'byzantium', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'constantinople', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'petersburg', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'istanbul', + block: 1561651, + forkHash: '0xc25efa5c', + }, + { + name: 'berlin', + block: 4460644, + forkHash: '0x757a1c47', + }, + { + name: 'london', + block: 5062605, + forkHash: '0xb8c6299d', + }, + { + // The forkHash will remain same as mergeForkIdTransition is post merge, + // terminal block: https://goerli.etherscan.io/block/7382818 + name: 'paris', + block: 7382819, + forkHash: '0xb8c6299d', + }, + { + name: 'mergeForkIdTransition', + block: null, + forkHash: null, + }, + { + name: 'shanghai', + block: null, + timestamp: '1678832736', + forkHash: '0xf9843abf', + }, + { + name: 'cancun', + block: null, + timestamp: '1705473120', + forkHash: '0x70cc14e2', + }, + ], + bootstrapNodes: [ + { + ip: '51.141.78.53', + port: 30303, + id: '011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a', + location: '', + comment: 'Upstream bootnode 1', + }, + { + ip: '13.93.54.137', + port: 30303, + id: '176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b', + location: '', + comment: 'Upstream bootnode 2', + }, + { + ip: '94.237.54.114', + port: 30313, + id: '46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291', + location: '', + comment: 'Upstream bootnode 3', + }, + { + ip: '18.218.250.66', + port: 30313, + id: 'b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949', + location: '', + comment: 'Upstream bootnode 4', + }, + { + ip: '3.11.147.67', + port: 30303, + id: 'a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91', + location: '', + comment: 'Ethereum Foundation bootnode', + }, + { + ip: '51.15.116.226', + port: 30303, + id: 'a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 30303, + id: '807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 40303, + id: 'a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + ], + dnsNetworks: [ + 'enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net', + ], +} diff --git a/packages/tx/test/typedTxsAndEIP2930.spec.ts b/packages/tx/test/typedTxsAndEIP2930.spec.ts index b7d49166d9..fd405d3518 100644 --- a/packages/tx/test/typedTxsAndEIP2930.spec.ts +++ b/packages/tx/test/typedTxsAndEIP2930.spec.ts @@ -1,4 +1,4 @@ -import { Common, Goerli, Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common' +import { Common, Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common' import { Address, MAX_INTEGER, @@ -26,6 +26,8 @@ import { paramsTx, } from '../src/index.js' +import { Goerli } from './testData/goerliCommon.js' + import type { AccessList, AccessListBytesItem, JSONTx } from '../src/index.js' const pKey = hexToBytes('0x4646464646464646464646464646464646464646464646464646464646464646') diff --git a/packages/vm/examples/runGoerliBlock.ts b/packages/vm/examples/runGoerliBlock.ts index 01f756fe8a..8d290cec74 100644 --- a/packages/vm/examples/runGoerliBlock.ts +++ b/packages/vm/examples/runGoerliBlock.ts @@ -1,8 +1,9 @@ import { createBlockFromRPC } from '@ethereumjs/block' -import { Common, Goerli } from '@ethereumjs/common' +import { Common } from '@ethereumjs/common' import { bytesToHex } from '@ethereumjs/util' import { createVM, runBlock } from '../src/index.js' +import { Goerli } from '../test/api/testdata/goerliCommon.js' import goerliBlock2 from './testData/goerliBlock2.json' diff --git a/packages/vm/package.json b/packages/vm/package.json index 31e0fc9587..c8c6e8b605 100644 --- a/packages/vm/package.json +++ b/packages/vm/package.json @@ -85,7 +85,8 @@ "node-dir": "^0.1.17", "nyc": "^15.1.0", "solc": "^0.8.1", - "tape": "^5.3.1" + "tape": "^5.3.1", + "yargs": "^17.7.1" }, "engines": { "node": ">=18" diff --git a/packages/vm/test/api/runBlock.spec.ts b/packages/vm/test/api/runBlock.spec.ts index 30d91605c6..964294a84c 100644 --- a/packages/vm/test/api/runBlock.spec.ts +++ b/packages/vm/test/api/runBlock.spec.ts @@ -5,7 +5,7 @@ import { createSealedCliqueBlock, } from '@ethereumjs/block' import { createBlockchain } from '@ethereumjs/blockchain' -import { Common, Goerli, Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common' +import { Common, Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common' import { RLP } from '@ethereumjs/rlp' import { type MerkleStateManager, StatefulVerkleStateManager } from '@ethereumjs/statemanager' import { @@ -41,6 +41,7 @@ import { createVM, runBlock } from '../../src/index.js' import { getDAOCommon, setupPreConditions } from '../util.js' import { blockchainData } from './testdata/blockchain.js' +import { Goerli } from './testdata/goerliCommon.js' import { testnetData } from './testdata/testnet.js' import { createAccountWithDefaults, setBalance, setupVM } from './utils.js' diff --git a/packages/vm/test/api/runTx.spec.ts b/packages/vm/test/api/runTx.spec.ts index 4d50d93e13..ce5021db20 100644 --- a/packages/vm/test/api/runTx.spec.ts +++ b/packages/vm/test/api/runTx.spec.ts @@ -1,6 +1,6 @@ import { createBlock, createBlockHeader } from '@ethereumjs/block' import { Blockchain, createBlockchain } from '@ethereumjs/blockchain' -import { Common, Goerli, Hardfork, Mainnet, createCommonFromGethGenesis } from '@ethereumjs/common' +import { Common, Hardfork, Mainnet, createCommonFromGethGenesis } from '@ethereumjs/common' import { Blob4844Tx, EOACode7702Tx, @@ -29,6 +29,7 @@ import { assert, describe, it } from 'vitest' import { createVM, runTx } from '../../src/index.js' +import { Goerli } from './testdata/goerliCommon.js' import { createAccountWithDefaults, getTransaction, setBalance } from './utils.js' import type { VM } from '../../src/vm.js' diff --git a/packages/vm/test/api/testdata/goerliCommon.ts b/packages/vm/test/api/testdata/goerliCommon.ts new file mode 100644 index 0000000000..247aa11d55 --- /dev/null +++ b/packages/vm/test/api/testdata/goerliCommon.ts @@ -0,0 +1,162 @@ +import type { ChainConfig } from '@ethereumjs/common' + +export const Goerli: ChainConfig = { + name: 'goerli', + chainId: 5, + defaultHardfork: 'cancun', + consensus: { + type: 'poa', + algorithm: 'clique', + clique: { + period: 15, + epoch: 30000, + }, + }, + comment: 'Cross-client PoA test network', + url: 'https://github.com/goerli/testnet', + genesis: { + timestamp: '0x5c51a607', + gasLimit: 10485760, + difficulty: 1, + nonce: '0x0000000000000000', + extraData: + '0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + }, + hardforks: [ + { + name: 'chainstart', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'homestead', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'tangerineWhistle', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'spuriousDragon', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'byzantium', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'constantinople', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'petersburg', + block: 0, + forkHash: '0xa3f5ab08', + }, + { + name: 'istanbul', + block: 1561651, + forkHash: '0xc25efa5c', + }, + { + name: 'berlin', + block: 4460644, + forkHash: '0x757a1c47', + }, + { + name: 'london', + block: 5062605, + forkHash: '0xb8c6299d', + }, + { + // The forkHash will remain same as mergeForkIdTransition is post merge, + // terminal block: https://goerli.etherscan.io/block/7382818 + name: 'paris', + block: 7382819, + forkHash: '0xb8c6299d', + }, + { + name: 'mergeForkIdTransition', + block: null, + forkHash: null, + }, + { + name: 'shanghai', + block: null, + timestamp: '1678832736', + forkHash: '0xf9843abf', + }, + { + name: 'cancun', + block: null, + timestamp: '1705473120', + forkHash: '0x70cc14e2', + }, + ], + bootstrapNodes: [ + { + ip: '51.141.78.53', + port: 30303, + id: '011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a', + location: '', + comment: 'Upstream bootnode 1', + }, + { + ip: '13.93.54.137', + port: 30303, + id: '176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b', + location: '', + comment: 'Upstream bootnode 2', + }, + { + ip: '94.237.54.114', + port: 30313, + id: '46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291', + location: '', + comment: 'Upstream bootnode 3', + }, + { + ip: '18.218.250.66', + port: 30313, + id: 'b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949', + location: '', + comment: 'Upstream bootnode 4', + }, + { + ip: '3.11.147.67', + port: 30303, + id: 'a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91', + location: '', + comment: 'Ethereum Foundation bootnode', + }, + { + ip: '51.15.116.226', + port: 30303, + id: 'a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 30303, + id: '807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33', + location: '', + comment: 'Goerli Initiative bootnode', + }, + { + ip: '51.15.119.157', + port: 40303, + id: 'a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd', + location: '', + comment: 'Goerli Initiative bootnode', + }, + ], + dnsNetworks: [ + 'enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net', + ], +} diff --git a/packages/vm/vitest.config.coverage.ts b/packages/vm/vitest.config.coverage.ts index 6af50d7af1..37a9095743 100644 --- a/packages/vm/vitest.config.coverage.ts +++ b/packages/vm/vitest.config.coverage.ts @@ -7,7 +7,6 @@ export default defineConfig({ exclude: ['kzg-wasm'], }, test: { - exclude: ['test/api/t8ntool'], coverage: { provider: 'v8', enabled: true,