@ethereumjs/common
Advanced tools
Comparing version 3.0.0-beta.2 to 3.0.0-beta.3
@@ -5,3 +5,3 @@ { | ||
"networkId": 5, | ||
"defaultHardfork": "london", | ||
"defaultHardfork": "merge", | ||
"consensus": { | ||
@@ -76,4 +76,11 @@ "type": "poa", | ||
{ | ||
"//_comment": "The forkHash will remain same as mergeForkIdTransition is post merge", | ||
"name": "merge", | ||
"ttd": "10790000", | ||
"block": null, | ||
"forkHash": "0xb8c6299d" | ||
}, | ||
{ | ||
"name": "mergeForkIdTransition", | ||
"block": null, | ||
"forkHash": null | ||
@@ -80,0 +87,0 @@ }, |
@@ -5,3 +5,3 @@ { | ||
"networkId": 3, | ||
"defaultHardfork": "london", | ||
"defaultHardfork": "merge", | ||
"consensus": { | ||
@@ -79,3 +79,3 @@ "type": "pow", | ||
"name": "merge", | ||
"td": 50000000000000000, | ||
"ttd": "50000000000000000", | ||
"block": null, | ||
@@ -82,0 +82,0 @@ "forkHash": "0x7119b6b3" |
@@ -5,3 +5,3 @@ { | ||
"networkId": 11155111, | ||
"defaultHardfork": "london", | ||
"defaultHardfork": "merge", | ||
"consensus": { | ||
@@ -80,3 +80,3 @@ "type": "pow", | ||
"name": "merge", | ||
"td": 17000000000000000, | ||
"ttd": "17000000000000000", | ||
"block": null, | ||
@@ -87,4 +87,4 @@ "forkHash": "0xfe3366e7" | ||
"name": "mergeForkIdTransition", | ||
"block": null, | ||
"forkHash": null | ||
"block": 1735371, | ||
"forkHash": "0xb96cbd13" | ||
}, | ||
@@ -91,0 +91,0 @@ { |
@@ -5,4 +5,4 @@ /// <reference types="node" /> | ||
import { BigIntLike } from '@ethereumjs/util'; | ||
import { Hardfork, Chain, ConsensusAlgorithm, ConsensusType, CustomChain } from './enums'; | ||
import { BootstrapNodeConfig, ChainConfig, GenesisBlockConfig, HardforkConfig, ChainsConfig, CliqueConfig, EthashConfig, CasperConfig, CommonOpts, CustomCommonOpts } from './types'; | ||
import { Chain, ConsensusAlgorithm, ConsensusType, CustomChain, Hardfork } from './enums'; | ||
import { BootstrapNodeConfig, CasperConfig, ChainConfig, ChainsConfig, CliqueConfig, CommonOpts, CustomCommonOpts, EthashConfig, GenesisBlockConfig, HardforkConfig } from './types'; | ||
/** | ||
@@ -186,2 +186,8 @@ * Common class to access chain and hardfork parameters and to provide | ||
/** | ||
* Returns the hardfork change block for eip | ||
* @param eip EIP number | ||
* @returns Block number or null if unscheduled | ||
*/ | ||
eipBlock(eip: number): bigint | null; | ||
/** | ||
* Returns the hardfork change total difficulty (Merge HF) for hardfork provided or set | ||
@@ -191,3 +197,3 @@ * @param hardfork Hardfork name, optional if HF set | ||
*/ | ||
hardforkTD(hardfork?: string | Hardfork): bigint | null; | ||
hardforkTTD(hardfork?: string | Hardfork): bigint | null; | ||
/** | ||
@@ -194,0 +200,0 @@ * True if block number provided is the hardfork (given or set) change block |
@@ -5,13 +5,13 @@ "use strict"; | ||
const events_1 = require("events"); | ||
const util_1 = require("@ethereumjs/util"); | ||
const crc_32_1 = require("crc-32"); | ||
const util_1 = require("@ethereumjs/util"); | ||
const hardforks_1 = require("./hardforks"); | ||
const eips_1 = require("./eips"); | ||
const enums_1 = require("./enums"); | ||
const goerli = require("./chains/goerli.json"); | ||
const kovan = require("./chains/kovan.json"); | ||
const mainnet = require("./chains/mainnet.json"); | ||
const rinkeby = require("./chains/rinkeby.json"); | ||
const ropsten = require("./chains/ropsten.json"); | ||
const rinkeby = require("./chains/rinkeby.json"); | ||
const kovan = require("./chains/kovan.json"); | ||
const goerli = require("./chains/goerli.json"); | ||
const sepolia = require("./chains/sepolia.json"); | ||
const eips_1 = require("./eips"); | ||
const enums_1 = require("./enums"); | ||
const hardforks_1 = require("./hardforks"); | ||
/** | ||
@@ -31,3 +31,3 @@ * Common class to access chain and hardfork parameters and to provide | ||
this._chainParams = this.setChain(opts.chain); | ||
this.DEFAULT_HARDFORK = this._chainParams.defaultHardfork ?? enums_1.Hardfork.London; | ||
this.DEFAULT_HARDFORK = this._chainParams.defaultHardfork ?? enums_1.Hardfork.Merge; | ||
this._hardfork = this.DEFAULT_HARDFORK; | ||
@@ -220,4 +220,4 @@ if ((0, util_1.isTruthy)(opts.hardfork)) { | ||
if (hf.block === null) { | ||
if (td !== undefined && td !== null && hf.td !== undefined && hf.td !== null) { | ||
if (td >= BigInt(hf.td)) { | ||
if (td !== undefined && td !== null && hf.ttd !== undefined && hf.ttd !== null) { | ||
if (td >= BigInt(hf.ttd)) { | ||
return hf.name; | ||
@@ -231,4 +231,4 @@ } | ||
} | ||
if (td && (0, util_1.isTruthy)(hf.td)) { | ||
if (td >= BigInt(hf.td)) { | ||
if (td && (0, util_1.isTruthy)(hf.ttd)) { | ||
if (td >= BigInt(hf.ttd)) { | ||
minTdHF = hf.name; | ||
@@ -492,2 +492,19 @@ } | ||
/** | ||
* Returns the hardfork change block for eip | ||
* @param eip EIP number | ||
* @returns Block number or null if unscheduled | ||
*/ | ||
eipBlock(eip) { | ||
for (const hfChanges of hardforks_1.hardforks) { | ||
const hf = hfChanges[1]; | ||
if ('eips' in hf) { | ||
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions | ||
if (hf['eips'].includes(eip)) { | ||
return this.hardforkBlock(hfChanges[0]); | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
/** | ||
* Returns the hardfork change total difficulty (Merge HF) for hardfork provided or set | ||
@@ -497,9 +514,9 @@ * @param hardfork Hardfork name, optional if HF set | ||
*/ | ||
hardforkTD(hardfork) { | ||
hardforkTTD(hardfork) { | ||
hardfork = hardfork ?? this._hardfork; | ||
const td = this._getHardfork(hardfork)?.['td']; | ||
if (td === undefined || td === null) { | ||
const ttd = this._getHardfork(hardfork)?.['ttd']; | ||
if (ttd === undefined || ttd === null) { | ||
return null; | ||
} | ||
return BigInt(td); | ||
return BigInt(ttd); | ||
} | ||
@@ -588,3 +605,3 @@ /** | ||
const data = this._getHardfork(hardfork); | ||
if (data === null || (data?.block === null && data?.td === undefined)) { | ||
if (data === null || (data?.block === null && data?.ttd === undefined)) { | ||
const msg = 'No fork hash calculation possible for future hardfork'; | ||
@@ -757,10 +774,3 @@ throw new Error(msg); | ||
} | ||
const chains = { | ||
mainnet, | ||
ropsten, | ||
rinkeby, | ||
kovan, | ||
goerli, | ||
sepolia, | ||
}; | ||
const chains = { mainnet, ropsten, rinkeby, kovan, goerli, sepolia }; | ||
if (customChains) { | ||
@@ -767,0 +777,0 @@ for (const chain of customChains) { |
@@ -43,3 +43,132 @@ { | ||
"Bls12381MultiExpGasDiscount": { | ||
"v": [[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]], | ||
"v": [ | ||
[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] | ||
], | ||
"d": "Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair" | ||
@@ -46,0 +175,0 @@ } |
@@ -8,5 +8,3 @@ { | ||
"minimumHardfork": "london", | ||
"requiredEIPs": [ | ||
3541 | ||
], | ||
"requiredEIPs": [3541], | ||
"gasConfig": {}, | ||
@@ -13,0 +11,0 @@ "gasPrices": {}, |
@@ -8,5 +8,3 @@ { | ||
"minimumHardfork": "london", | ||
"requiredEIPs": [ | ||
3540 | ||
], | ||
"requiredEIPs": [3540], | ||
"gasConfig": {}, | ||
@@ -13,0 +11,0 @@ "gasPrices": {}, |
@@ -26,11 +26,3 @@ { | ||
"tierStep": { | ||
"v": [ | ||
0, | ||
2, | ||
3, | ||
5, | ||
8, | ||
10, | ||
20 | ||
], | ||
"v": [0, 2, 3, 5, 8, 10, 20], | ||
"d": "Once per operation, for a selection of them" | ||
@@ -37,0 +29,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
import { ConsensusAlgorithm, ConsensusType, Hardfork, Chain } from './enums'; | ||
import { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from './enums'; | ||
export interface ChainName { | ||
@@ -44,3 +44,3 @@ [chainId: string]: string; | ||
block: number | null; | ||
td?: number; | ||
ttd?: bigint | string; | ||
forkHash?: string | null; | ||
@@ -47,0 +47,0 @@ } |
{ | ||
"name": "@ethereumjs/common", | ||
"version": "3.0.0-beta.2", | ||
"version": "3.0.0-beta.3", | ||
"description": "Resources common to all Ethereum implementations", | ||
"license": "MIT", | ||
"keywords": [ | ||
@@ -15,2 +14,19 @@ "ethereum", | ||
], | ||
"homepage": "https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common#readme", | ||
"bugs": { | ||
"url": "https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aissue+label%3A%22package%3A+common%22" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ethereumjs/ethereumjs-monorepo.git" | ||
}, | ||
"license": "MIT", | ||
"maintainers": [ | ||
{ | ||
"name": "Holger Drewes", | ||
"email": "Holger.Drewes@gmail.com" | ||
} | ||
], | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
@@ -20,21 +36,20 @@ "dist", | ||
], | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"build": "../../config/cli/ts-build.sh", | ||
"prepublishOnly": "../../config/cli/prepublish.sh", | ||
"clean": "../../config/cli/clean-package.sh", | ||
"coverage": "../../config/cli/coverage.sh", | ||
"tsc": "../../config/cli/ts-compile.sh", | ||
"docs:build": "typedoc --options typedoc.js", | ||
"lint": "../../config/cli/lint.sh", | ||
"lint:diff": "../../config/cli/lint-diff.sh", | ||
"lint:fix": "../../config/cli/lint-fix.sh", | ||
"prepublishOnly": "../../config/cli/prepublish.sh", | ||
"tape": "tape -r ts-node/register", | ||
"test": "npm run test:node && npm run test:browser", | ||
"test:browser": "karma start karma.conf.js", | ||
"test:node": "npm run tape -- ./tests/*.spec.ts", | ||
"test:browser": "karma start karma.conf.js", | ||
"docs:build": "typedoc --options typedoc.js" | ||
"tsc": "../../config/cli/ts-compile.sh" | ||
}, | ||
"dependencies": { | ||
"crc-32": "^1.2.0", | ||
"@ethereumjs/util": "8.0.0-beta.2" | ||
"@ethereumjs/util": "8.0.0-beta.3", | ||
"crc-32": "^1.2.0" | ||
}, | ||
@@ -44,3 +59,3 @@ "devDependencies": { | ||
"@types/tape": "^4.13.2", | ||
"eslint": "^6.8.0", | ||
"eslint": "^8.0.0", | ||
"karma": "^6.3.2", | ||
@@ -52,22 +67,6 @@ "karma-chrome-launcher": "^3.1.0", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.0.5", | ||
"tape": "^5.3.1", | ||
"typedoc": "^0.22.4", | ||
"ts-node": "^10.2.1", | ||
"typescript": "^4.4.2" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ethereumjs/ethereumjs-monorepo.git" | ||
}, | ||
"homepage": "https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common#readme", | ||
"bugs": { | ||
"url": "https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aissue+label%3A%22package%3A+common%22" | ||
}, | ||
"maintainers": [ | ||
{ | ||
"name": "Holger Drewes", | ||
"email": "Holger.Drewes@gmail.com" | ||
} | ||
] | ||
} | ||
} |
@@ -44,3 +44,3 @@ # @ethereumjs/common | ||
Current `DEFAULT_HARDFORK`: `Hardfork.London` | ||
Current `DEFAULT_HARDFORK`: `Hardfork.Merge` | ||
@@ -218,4 +218,4 @@ Here are some simple usage examples: | ||
- `berlin` (`Hardfork.Berlin`) (since `v2.2.0`) | ||
- `london` (`Hardfork.London`) (`DEFAULT_HARDFORK`) (since `v2.4.0`) | ||
- `merge` (`Hardfork.Merge`) (since `v2.5.0`) | ||
- `london` (`Hardfork.London`) (since `v2.4.0`) | ||
- `merge` (`Hardfork.Merge`) (`DEFAULT_HARDFORK`) (since `v2.5.0`) | ||
@@ -222,0 +222,0 @@ ### Future Hardforks |
@@ -5,3 +5,3 @@ { | ||
"networkId": 5, | ||
"defaultHardfork": "london", | ||
"defaultHardfork": "merge", | ||
"consensus": { | ||
@@ -76,4 +76,11 @@ "type": "poa", | ||
{ | ||
"//_comment": "The forkHash will remain same as mergeForkIdTransition is post merge", | ||
"name": "merge", | ||
"ttd": "10790000", | ||
"block": null, | ||
"forkHash": "0xb8c6299d" | ||
}, | ||
{ | ||
"name": "mergeForkIdTransition", | ||
"block": null, | ||
"forkHash": null | ||
@@ -80,0 +87,0 @@ }, |
@@ -5,3 +5,3 @@ { | ||
"networkId": 3, | ||
"defaultHardfork": "london", | ||
"defaultHardfork": "merge", | ||
"consensus": { | ||
@@ -79,3 +79,3 @@ "type": "pow", | ||
"name": "merge", | ||
"td": 50000000000000000, | ||
"ttd": "50000000000000000", | ||
"block": null, | ||
@@ -82,0 +82,0 @@ "forkHash": "0x7119b6b3" |
@@ -5,3 +5,3 @@ { | ||
"networkId": 11155111, | ||
"defaultHardfork": "london", | ||
"defaultHardfork": "merge", | ||
"consensus": { | ||
@@ -80,3 +80,3 @@ "type": "pow", | ||
"name": "merge", | ||
"td": 17000000000000000, | ||
"ttd": "17000000000000000", | ||
"block": null, | ||
@@ -87,4 +87,4 @@ "forkHash": "0xfe3366e7" | ||
"name": "mergeForkIdTransition", | ||
"block": null, | ||
"forkHash": null | ||
"block": 1735371, | ||
"forkHash": "0xb96cbd13" | ||
}, | ||
@@ -91,0 +91,0 @@ { |
import { EventEmitter } from 'events' | ||
import { BigIntLike, intToBuffer, isFalsy, isTruthy, toType, TypeOutput } from '@ethereumjs/util' | ||
import { buf as crc32Buffer } from 'crc-32' | ||
import { BigIntLike, toType, TypeOutput, intToBuffer, isTruthy, isFalsy } from '@ethereumjs/util' | ||
import * as goerli from './chains/goerli.json' | ||
import * as kovan from './chains/kovan.json' | ||
import * as mainnet from './chains/mainnet.json' | ||
import * as rinkeby from './chains/rinkeby.json' | ||
import * as ropsten from './chains/ropsten.json' | ||
import * as sepolia from './chains/sepolia.json' | ||
import { EIPs } from './eips' | ||
import { Chain, ConsensusAlgorithm, ConsensusType, CustomChain, Hardfork } from './enums' | ||
import { hardforks as HARDFORK_CHANGES } from './hardforks' | ||
import { EIPs } from './eips' | ||
import { Hardfork, Chain, ConsensusAlgorithm, ConsensusType, CustomChain } from './enums' | ||
import { | ||
BootstrapNodeConfig, | ||
CasperConfig, | ||
ChainConfig, | ||
GenesisBlockConfig, | ||
HardforkConfig, | ||
ChainName, | ||
ChainsConfig, | ||
CliqueConfig, | ||
EthashConfig, | ||
CasperConfig, | ||
CommonOpts, | ||
CustomCommonOpts, | ||
EthashConfig, | ||
GenesisBlockConfig, | ||
HardforkConfig, | ||
} from './types' | ||
import * as mainnet from './chains/mainnet.json' | ||
import * as ropsten from './chains/ropsten.json' | ||
import * as rinkeby from './chains/rinkeby.json' | ||
import * as kovan from './chains/kovan.json' | ||
import * as goerli from './chains/goerli.json' | ||
import * as sepolia from './chains/sepolia.json' | ||
@@ -189,3 +190,3 @@ /** | ||
this._chainParams = this.setChain(opts.chain) | ||
this.DEFAULT_HARDFORK = this._chainParams.defaultHardfork ?? Hardfork.London | ||
this.DEFAULT_HARDFORK = this._chainParams.defaultHardfork ?? Hardfork.Merge | ||
this._hardfork = this.DEFAULT_HARDFORK | ||
@@ -271,4 +272,4 @@ if (isTruthy(opts.hardfork)) { | ||
if (hf.block === null) { | ||
if (td !== undefined && td !== null && hf.td !== undefined && hf.td !== null) { | ||
if (td >= BigInt(hf.td)) { | ||
if (td !== undefined && td !== null && hf.ttd !== undefined && hf.ttd !== null) { | ||
if (td >= BigInt(hf.ttd)) { | ||
return hf.name | ||
@@ -282,4 +283,4 @@ } | ||
} | ||
if (td && isTruthy(hf.td)) { | ||
if (td >= BigInt(hf.td)) { | ||
if (td && isTruthy(hf.ttd)) { | ||
if (td >= BigInt(hf.ttd)) { | ||
minTdHF = hf.name | ||
@@ -554,2 +555,20 @@ } else { | ||
/** | ||
* Returns the hardfork change block for eip | ||
* @param eip EIP number | ||
* @returns Block number or null if unscheduled | ||
*/ | ||
eipBlock(eip: number): bigint | null { | ||
for (const hfChanges of HARDFORK_CHANGES) { | ||
const hf = hfChanges[1] | ||
if ('eips' in hf) { | ||
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions | ||
if (hf['eips'].includes(eip)) { | ||
return this.hardforkBlock(hfChanges[0]) | ||
} | ||
} | ||
} | ||
return null | ||
} | ||
/** | ||
* Returns the hardfork change total difficulty (Merge HF) for hardfork provided or set | ||
@@ -559,9 +578,9 @@ * @param hardfork Hardfork name, optional if HF set | ||
*/ | ||
hardforkTD(hardfork?: string | Hardfork): bigint | null { | ||
hardforkTTD(hardfork?: string | Hardfork): bigint | null { | ||
hardfork = hardfork ?? this._hardfork | ||
const td = this._getHardfork(hardfork)?.['td'] | ||
if (td === undefined || td === null) { | ||
const ttd = this._getHardfork(hardfork)?.['ttd'] | ||
if (ttd === undefined || ttd === null) { | ||
return null | ||
} | ||
return BigInt(td) | ||
return BigInt(ttd) | ||
} | ||
@@ -658,3 +677,3 @@ | ||
const data = this._getHardfork(hardfork) | ||
if (data === null || (data?.block === null && data?.td === undefined)) { | ||
if (data === null || (data?.block === null && data?.ttd === undefined)) { | ||
const msg = 'No fork hash calculation possible for future hardfork' | ||
@@ -841,10 +860,3 @@ throw new Error(msg) | ||
} | ||
const chains: ChainsConfig = { | ||
mainnet, | ||
ropsten, | ||
rinkeby, | ||
kovan, | ||
goerli, | ||
sepolia, | ||
} | ||
const chains = { mainnet, ropsten, rinkeby, kovan, goerli, sepolia } as ChainsConfig | ||
if (customChains) { | ||
@@ -851,0 +863,0 @@ for (const chain of customChains) { |
{ | ||
"name": "EIP-1153", | ||
"number": 1153, | ||
"comment": "Transient Storage", | ||
"url": "https://eips.ethereum.org/EIPS/eip-1153", | ||
"status": "Review", | ||
"minimumHardfork": "chainstart", | ||
"requiredEIPs": [], | ||
"gasConfig": {}, | ||
"gasPrices": { | ||
"tstore": { | ||
"v": 100, | ||
"d": "Base fee of the TSTORE opcode" | ||
}, | ||
"tload": { | ||
"v": 100, | ||
"d": "Base fee of the TLOAD opcode" | ||
} | ||
"name": "EIP-1153", | ||
"number": 1153, | ||
"comment": "Transient Storage", | ||
"url": "https://eips.ethereum.org/EIPS/eip-1153", | ||
"status": "Review", | ||
"minimumHardfork": "chainstart", | ||
"requiredEIPs": [], | ||
"gasConfig": {}, | ||
"gasPrices": { | ||
"tstore": { | ||
"v": 100, | ||
"d": "Base fee of the TSTORE opcode" | ||
}, | ||
"vm": {}, | ||
"pow": {} | ||
"tload": { | ||
"v": 100, | ||
"d": "Base fee of the TLOAD opcode" | ||
} | ||
}, | ||
"vm": {}, | ||
"pow": {} | ||
} |
@@ -29,11 +29,11 @@ { | ||
"d": "Base gas cost of BLS12-381 pairing check" | ||
}, | ||
}, | ||
"Bls12381PairingPerPairGas": { | ||
"v": 23000, | ||
"d": "Per-pair gas cost of BLS12-381 pairing check" | ||
}, | ||
}, | ||
"Bls12381MapG1Gas": { | ||
"v": 5500, | ||
"d": "Gas cost of BLS12-381 map field element to G1" | ||
}, | ||
}, | ||
"Bls12381MapG2Gas": { | ||
@@ -44,3 +44,132 @@ "v": 110000, | ||
"Bls12381MultiExpGasDiscount": { | ||
"v": [[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]], | ||
"v": [ | ||
[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] | ||
], | ||
"d": "Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair" | ||
@@ -51,2 +180,2 @@ } | ||
"pow": {} | ||
} | ||
} |
{ | ||
"name": "EIP-3540", | ||
"number": 3540, | ||
"comment": "EVM Object Format (EOF) v1", | ||
"url": "https://eips.ethereum.org/EIPS/eip-3540", | ||
"status": "Review", | ||
"minimumHardfork": "london", | ||
"requiredEIPs": [ | ||
3541 | ||
], | ||
"gasConfig": {}, | ||
"gasPrices": {}, | ||
"vm": {}, | ||
"pow": {} | ||
} | ||
"name": "EIP-3540", | ||
"number": 3540, | ||
"comment": "EVM Object Format (EOF) v1", | ||
"url": "https://eips.ethereum.org/EIPS/eip-3540", | ||
"status": "Review", | ||
"minimumHardfork": "london", | ||
"requiredEIPs": [3541], | ||
"gasConfig": {}, | ||
"gasPrices": {}, | ||
"vm": {}, | ||
"pow": {} | ||
} |
{ | ||
"name": "EIP-3670", | ||
"number": 3670, | ||
"comment": "EOF - Code Validation", | ||
"url": "https://eips.ethereum.org/EIPS/eip-3670", | ||
"status": "Review", | ||
"minimumHardfork": "london", | ||
"requiredEIPs": [ | ||
3540 | ||
], | ||
"gasConfig": {}, | ||
"gasPrices": {}, | ||
"vm": {}, | ||
"pow": {} | ||
} | ||
"name": "EIP-3670", | ||
"number": 3670, | ||
"comment": "EOF - Code Validation", | ||
"url": "https://eips.ethereum.org/EIPS/eip-3670", | ||
"status": "Review", | ||
"minimumHardfork": "london", | ||
"requiredEIPs": [3540], | ||
"gasConfig": {}, | ||
"gasPrices": {}, | ||
"vm": {}, | ||
"pow": {} | ||
} |
{ | ||
"name": "arrowGlacier", | ||
"comment": "HF to delay the difficulty bomb", | ||
"url": "https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md", | ||
"status": "Final", | ||
"eips": [4345], | ||
"gasConfig": {}, | ||
"gasPrices": {}, | ||
"vm": {}, | ||
"pow": {} | ||
"name": "arrowGlacier", | ||
"comment": "HF to delay the difficulty bomb", | ||
"url": "https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md", | ||
"status": "Final", | ||
"eips": [4345], | ||
"gasConfig": {}, | ||
"gasPrices": {}, | ||
"vm": {}, | ||
"pow": {} | ||
} |
@@ -26,11 +26,3 @@ { | ||
"tierStep": { | ||
"v": [ | ||
0, | ||
2, | ||
3, | ||
5, | ||
8, | ||
10, | ||
20 | ||
], | ||
"v": [0, 2, 3, 5, 8, 10, 20], | ||
"d": "Once per operation, for a selection of them" | ||
@@ -447,2 +439,2 @@ }, | ||
} | ||
} | ||
} |
{ | ||
"name": "grayGlacier", | ||
"comment": "Delaying the difficulty bomb to Mid September 2022", | ||
"url": "https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md", | ||
"status": "Draft", | ||
"eips": [5133], | ||
"gasConfig": {}, | ||
"gasPrices": {}, | ||
"vm": {}, | ||
"pow": {} | ||
} | ||
"name": "grayGlacier", | ||
"comment": "Delaying the difficulty bomb to Mid September 2022", | ||
"url": "https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md", | ||
"status": "Draft", | ||
"eips": [5133], | ||
"gasConfig": {}, | ||
"gasPrices": {}, | ||
"vm": {}, | ||
"pow": {} | ||
} |
@@ -1,2 +0,2 @@ | ||
import { ConsensusAlgorithm, ConsensusType, Hardfork, Chain } from './enums' | ||
import { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from './enums' | ||
@@ -50,3 +50,3 @@ export interface ChainName { | ||
block: number | null | ||
td?: number | ||
ttd?: bigint | string | ||
forkHash?: string | null | ||
@@ -53,0 +53,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
252555
12
7042
+ Added@ethereumjs/rlp@4.0.1(transitive)
+ Added@ethereumjs/util@8.0.0-beta.3(transitive)
- Removed@ethereumjs/util@8.0.0-beta.2(transitive)
- Removedrlp@4.0.0-beta.2(transitive)