@ethereumjs/common
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -9,2 +9,52 @@ # Changelog | ||
## 2.2.0 - 2021-03-18 | ||
### Berlin HF Support | ||
This `Common` release comes with full support for the `berlin` hardfork. Please note that the default HF is still set to `istanbul`. You therefore need to explicitly set the `hardfork` parameter for instantiating a `Common` instance with a `berlin` HF activated: | ||
```typescript | ||
import Common from '@ethereumjs/common' | ||
const common = new Common({ chain: 'mainnet', hardfork: 'berlin' }) | ||
``` | ||
**Berlin HF Changes** | ||
- Added final list of `berlin` EIPs (`EIP-2565`, `EIP-2929`, `EIP-2718`, `EIP-2930`), PR [#1124](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1124) and PR [#1048](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1048) | ||
- Corrected base gas costs for `EIP-2929` related opcodes, PR [#1124](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1124) | ||
- New EIP configuration files for `EIP-2718` (typed txs) and `EIP-2930` (optional access lists), PR [#1048](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1048) | ||
- Added `berlin` hardfork block numbers for `mainnet`, `ropsten`, `rinkeby` and `goerli`, PR [#1142](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1142) | ||
### BN Support for high Chain IDs and Block Numbers | ||
The library has been updated to support very high chain IDs and block numbers exceeding the `Number.MAX_SAFE_INTEGER` limit (9007199254740991). | ||
Methods with a respective input parameter now allow for a `BNLike` input (`number` (as before), `Buffer`, (Hex)`String` or `BN`). The following function signatures have been updated: | ||
- `chain` constructor parameter now additionally allowing `BN` | ||
- `setChain(chain: string | number | object)` -> `setChain(chain: string | number | BN | object)` | ||
- `getHardforkByBlockNumber(blockNumber: BNLike): string` | ||
- `setHardforkByBlockNumber(blockNumber: BNLike): string` | ||
- `paramByBlock(topic: string, name: string, blockNumber: BNLike): any` | ||
- `hardforkIsActiveOnBlock(hardfork: string | null, blockNumber: BNLike, opts?: hardforkOptions): boolean` | ||
- `activeOnBlock(blockNumber: BNLike, opts?: hardforkOptions): boolean` | ||
- `activeHardforks(blockNumber?: BNLike | null, opts: hardforkOptions = {}): Array<any>` | ||
- `activeHardfork(blockNumber?: BNLike | null, opts: hardforkOptions = {}): string` | ||
- `isHardforkBlock(blockNumber: BNLike, hardfork?: string): boolean` | ||
- `isNextHardforkBlock(blockNumber: BNLike, hardfork?: string): boolean` | ||
For methods with a respective `number` return value corresponding [METHOD_NAME]BN methods have been added: | ||
- `hardforkBlockBN(hardfork?: string): BN` | ||
- `nextHardforkBlockBN(hardfork?: string): BN | null` | ||
- `chainIdBN(): BN` | ||
- `networkIdBN(): BN` | ||
Note that in the next major release these methods will be unified again by switching to use the original version names for the new BN-output functions. | ||
### Other Changes | ||
- Added chain config and genesis file for `yolov3` testnet, PR [#1129](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1129) | ||
- New `Common.copy()` function to easily receive a deep copy of a `Common` instance, PR [#1144](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1144) | ||
## 2.1.0 - 2021-02-22 | ||
@@ -11,0 +61,0 @@ |
@@ -73,4 +73,4 @@ { | ||
"name": "berlin", | ||
"block": null, | ||
"forkHash": null | ||
"block": 4460644, | ||
"forkHash": "0x757a1c47" | ||
} | ||
@@ -77,0 +77,0 @@ ], |
@@ -23,2 +23,3 @@ "use strict"; | ||
var goerli_json_1 = __importDefault(require("./goerli.json")); | ||
var yolov3_json_1 = __importDefault(require("./yolov3.json")); | ||
/** | ||
@@ -35,2 +36,3 @@ * @hidden | ||
'5': 'goerli', | ||
'34180983699157880': 'yolov3', | ||
}; | ||
@@ -43,2 +45,3 @@ var chains = { | ||
goerli: goerli_json_1.default, | ||
yolov3: yolov3_json_1.default, | ||
}; | ||
@@ -45,0 +48,0 @@ if (customChains) { |
@@ -75,4 +75,4 @@ { | ||
"name": "berlin", | ||
"block": null, | ||
"forkHash": null | ||
"block": 12244000, | ||
"forkHash": "0xeb440f6" | ||
} | ||
@@ -79,0 +79,0 @@ ], |
@@ -73,4 +73,4 @@ { | ||
"name": "berlin", | ||
"block": null, | ||
"forkHash": null | ||
"block": 8290928, | ||
"forkHash": "0x6910c8bd" | ||
} | ||
@@ -77,0 +77,0 @@ ], |
@@ -75,4 +75,4 @@ { | ||
"name": "berlin", | ||
"block": null, | ||
"forkHash": null | ||
"block": 9812189, | ||
"forkHash": "0xa157d377" | ||
} | ||
@@ -79,0 +79,0 @@ ], |
@@ -20,2 +20,62 @@ { | ||
"d": "Gas cost of reading storage locations which have already loaded 'cold'" | ||
}, | ||
"sstoreCleanGasEIP2200": { | ||
"v": 2900, | ||
"d": "Once per SSTORE operation from clean non-zero to something else" | ||
}, | ||
"sstoreNoopGasEIP2200": { | ||
"v": 100, | ||
"d": "Once per SSTORE operation if the value doesn't change" | ||
}, | ||
"sstoreDirtyGasEIP2200": { | ||
"v": 100, | ||
"d": "Once per SSTORE operation if a dirty value is changed" | ||
}, | ||
"sstoreInitRefundEIP2200": { | ||
"v": 19900, | ||
"d": "Once per SSTORE operation for resetting to the original zero value" | ||
}, | ||
"sstoreCleanRefundEIP2200": { | ||
"v": 4900, | ||
"d": "Once per SSTORE operation for resetting to the original non-zero value" | ||
}, | ||
"call": { | ||
"v": 0, | ||
"d": "Base fee of the CALL opcode" | ||
}, | ||
"callcode": { | ||
"v": 0, | ||
"d": "Base fee of the CALLCODE opcode" | ||
}, | ||
"delegatecall": { | ||
"v": 0, | ||
"d": "Base fee of the DELEGATECALL opcode" | ||
}, | ||
"staticcall": { | ||
"v": 0, | ||
"d": "Base fee of the STATICCALL opcode" | ||
}, | ||
"balance": { | ||
"v": 0, | ||
"d": "Base fee of the BALANCE opcode" | ||
}, | ||
"extcodesize": { | ||
"v": 0, | ||
"d": "Base fee of the EXTCODESIZE opcode" | ||
}, | ||
"extcodecopy": { | ||
"v": 0, | ||
"d": "Base fee of the EXTCODECOPY opcode" | ||
}, | ||
"extcodehash": { | ||
"v": 0, | ||
"d": "Base fee of the EXTCODEHASH opcode" | ||
}, | ||
"sload": { | ||
"v": 0, | ||
"d": "Base fee of the SLOAD opcode" | ||
}, | ||
"sstore": { | ||
"v": 0, | ||
"d": "Base fee of the SSTORE opcode" | ||
} | ||
@@ -22,0 +82,0 @@ }, |
@@ -8,4 +8,6 @@ "use strict"; | ||
2565: require('./2565.json'), | ||
2718: require('./2718.json'), | ||
2929: require('./2929.json'), | ||
2930: require('./2930.json'), | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -11,2 +11,3 @@ "use strict"; | ||
'5': 'goerli', | ||
'34180983699157880': 'yolov3', | ||
}, | ||
@@ -18,2 +19,3 @@ mainnet: require('./mainnet.json'), | ||
goerli: require('./goerli.json'), | ||
yolov3: require('./yolov3.json'), | ||
}; | ||
@@ -20,0 +22,0 @@ /** |
@@ -6,3 +6,3 @@ { | ||
"status": "Draft", | ||
"eips": [2315] | ||
"eips": [2565, 2929, 2718, 2930] | ||
} |
@@ -0,3 +1,5 @@ | ||
/// <reference types="bn.js" /> | ||
/// <reference types="node" /> | ||
import { EventEmitter } from 'events'; | ||
import { BN, BNLike } from 'ethereumjs-util'; | ||
import { Chain } from './types'; | ||
@@ -12,3 +14,3 @@ /** | ||
*/ | ||
chain: string | number | object; | ||
chain: string | number | BN | object; | ||
/** | ||
@@ -84,3 +86,3 @@ * String identifier ('byzantium') for hardfork | ||
*/ | ||
setChain(chain: string | number | object): any; | ||
setChain(chain: string | number | BN | object): any; | ||
/** | ||
@@ -96,3 +98,3 @@ * Sets the hardfork to get params for | ||
*/ | ||
getHardforkByBlockNumber(blockNumber: number): string; | ||
getHardforkByBlockNumber(blockNumber: BNLike): string; | ||
/** | ||
@@ -103,3 +105,3 @@ * Sets a new hardfork based on the block number provided | ||
*/ | ||
setHardforkByBlockNumber(blockNumber: number): string; | ||
setHardforkByBlockNumber(blockNumber: BNLike): string; | ||
/** | ||
@@ -162,3 +164,3 @@ * Internal helper function to choose between hardfork set and hardfork provided as param | ||
*/ | ||
paramByBlock(topic: string, name: string, blockNumber: number): any; | ||
paramByBlock(topic: string, name: string, blockNumber: BNLike): any; | ||
/** | ||
@@ -181,3 +183,3 @@ * Checks if an EIP is activated by either being included in the EIPs | ||
*/ | ||
hardforkIsActiveOnBlock(hardfork: string | null, blockNumber: number, opts?: hardforkOptions): boolean; | ||
hardforkIsActiveOnBlock(hardfork: string | null, blockNumber: BNLike, opts?: hardforkOptions): boolean; | ||
/** | ||
@@ -189,3 +191,3 @@ * Alias to hardforkIsActiveOnBlock when hardfork is set | ||
*/ | ||
activeOnBlock(blockNumber: number, opts?: hardforkOptions): boolean; | ||
activeOnBlock(blockNumber: BNLike, opts?: hardforkOptions): boolean; | ||
/** | ||
@@ -219,3 +221,3 @@ * Sequence based check if given or set HF1 is greater than or equal HF2 | ||
*/ | ||
activeHardforks(blockNumber?: number | null, opts?: hardforkOptions): Array<any>; | ||
activeHardforks(blockNumber?: BNLike | null, opts?: hardforkOptions): Array<any>; | ||
/** | ||
@@ -227,3 +229,3 @@ * Returns the latest active hardfork name for chain or block or throws if unavailable | ||
*/ | ||
activeHardfork(blockNumber?: number | null, opts?: hardforkOptions): string; | ||
activeHardfork(blockNumber?: BNLike | null, opts?: hardforkOptions): string; | ||
/** | ||
@@ -233,5 +235,12 @@ * Returns the hardfork change block for hardfork provided or set | ||
* @returns Block number | ||
* @deprecated Please use hardforkBlockBN() for large number support | ||
*/ | ||
hardforkBlock(hardfork?: string): number; | ||
/** | ||
* Returns the hardfork change block for hardfork provided or set | ||
* @param hardfork Hardfork name, optional if HF set | ||
* @returns Block number | ||
*/ | ||
hardforkBlockBN(hardfork?: string): BN; | ||
/** | ||
* True if block number provided is the hardfork (given or set) change block | ||
@@ -242,3 +251,3 @@ * @param blockNumber Number of the block to check | ||
*/ | ||
isHardforkBlock(blockNumber: number, hardfork?: string): boolean; | ||
isHardforkBlock(blockNumber: BNLike, hardfork?: string): boolean; | ||
/** | ||
@@ -248,5 +257,12 @@ * Returns the change block for the next hardfork after the hardfork provided or set | ||
* @returns Block number or null if not available | ||
* @deprecated Please use nextHardforkBlockBN() for large number support | ||
*/ | ||
nextHardforkBlock(hardfork?: string): number | null; | ||
/** | ||
* Returns the change block for the next hardfork after the hardfork provided or set | ||
* @param hardfork Hardfork name, optional if HF set | ||
* @returns Block number or null if not available | ||
*/ | ||
nextHardforkBlockBN(hardfork?: string): BN | null; | ||
/** | ||
* True if block number provided is the hardfork change block following the hardfork given or set | ||
@@ -257,3 +273,3 @@ * @param blockNumber Number of the block to check | ||
*/ | ||
isNextHardforkBlock(blockNumber: number, hardfork?: string): boolean; | ||
isNextHardforkBlock(blockNumber: BNLike, hardfork?: string): boolean; | ||
/** | ||
@@ -304,5 +320,11 @@ * Internal helper function to calculate a fork hash | ||
* @returns chain Id | ||
* @deprecated Please use chainIdBN() for large number support | ||
*/ | ||
chainId(): number; | ||
/** | ||
* Returns the Id of current chain | ||
* @returns chain Id | ||
*/ | ||
chainIdBN(): BN; | ||
/** | ||
* Returns the name of current chain | ||
@@ -315,5 +337,11 @@ * @returns chain name (lower case) | ||
* @returns network Id | ||
* @deprecated Please use networkIdBN() for large number support | ||
*/ | ||
networkId(): number; | ||
/** | ||
* Returns the Id of current network | ||
* @returns network Id | ||
*/ | ||
networkIdBN(): BN; | ||
/** | ||
* Returns the active EIPs | ||
@@ -347,3 +375,7 @@ * @returns List of EIPs | ||
consensusConfig(): any; | ||
/** | ||
* Returns a deep copy of this common instance. | ||
*/ | ||
copy(): Common; | ||
} | ||
export {}; |
@@ -40,2 +40,3 @@ "use strict"; | ||
var crc_32_1 = require("crc-32"); | ||
var ethereumjs_util_1 = require("ethereumjs-util"); | ||
var chains_1 = require("./chains"); | ||
@@ -92,3 +93,4 @@ var hardforks_1 = require("./hardforks"); | ||
var initializedChains = chains_1._getInitializedChains(customChains); | ||
if (typeof chain === 'number') { | ||
if (typeof chain === 'number' || ethereumjs_util_1.BN.isBN(chain)) { | ||
chain = chain.toString(); | ||
if (initializedChains['names'][chain]) { | ||
@@ -113,3 +115,3 @@ var name_1 = initializedChains['names'][chain]; | ||
var e_1, _a; | ||
if (typeof chain === 'number' || typeof chain === 'string') { | ||
if (typeof chain === 'number' || typeof chain === 'string' || ethereumjs_util_1.BN.isBN(chain)) { | ||
this._chainParams = Common._getChainParams(chain, this._customChains); | ||
@@ -119,3 +121,3 @@ } | ||
if (this._customChains.length > 0) { | ||
throw new Error('Chain must be a string or number when initialized with customChains passed in'); | ||
throw new Error('Chain must be a string, number, or BN when initialized with customChains passed in'); | ||
} | ||
@@ -185,2 +187,3 @@ var required = ['networkId', 'genesis', 'hardforks', 'bootstrapNodes']; | ||
var e_3, _a; | ||
blockNumber = ethereumjs_util_1.toType(blockNumber, ethereumjs_util_1.TypeOutput.BN); | ||
var hardfork = 'chainstart'; | ||
@@ -190,8 +193,7 @@ try { | ||
var hf = _c.value; | ||
var hardforkBlock = hf.block; | ||
// Skip comparison for not applied HFs | ||
if (hardforkBlock === null) { | ||
if (hf.block === null) { | ||
continue; | ||
} | ||
if (blockNumber >= hardforkBlock) { | ||
if (blockNumber.gte(new ethereumjs_util_1.BN(hf.block))) { | ||
hardfork = hf.name; | ||
@@ -216,2 +218,3 @@ } | ||
Common.prototype.setHardforkByBlockNumber = function (blockNumber) { | ||
blockNumber = ethereumjs_util_1.toType(blockNumber, ethereumjs_util_1.TypeOutput.BN); | ||
var hardfork = this.getHardforkByBlockNumber(blockNumber); | ||
@@ -294,13 +297,26 @@ this.setHardfork(hardfork); | ||
var e_6, _a; | ||
var _this = this; | ||
if (eips === void 0) { eips = []; } | ||
var _loop_1 = function (eip) { | ||
if (!(eip in eips_1.EIPs)) { | ||
throw new Error(eip + " not supported"); | ||
} | ||
var minHF = this_1.gteHardfork(eips_1.EIPs[eip]['minimumHardfork']); | ||
if (!minHF) { | ||
throw new Error(eip + " cannot be activated on hardfork " + this_1.hardfork() + ", minimumHardfork: " + minHF); | ||
} | ||
if (eips_1.EIPs[eip].requiredEIPs) { | ||
// eslint-disable-next-line prettier/prettier | ||
eips_1.EIPs[eip].requiredEIPs.forEach(function (elem) { | ||
if (!(eips.includes(elem) || _this.isActivatedEIP(elem))) { | ||
throw new Error(eip + " requires EIP " + elem + ", but is not included in the EIP list"); | ||
} | ||
}); | ||
} | ||
}; | ||
var this_1 = this; | ||
try { | ||
for (var eips_2 = __values(eips), eips_2_1 = eips_2.next(); !eips_2_1.done; eips_2_1 = eips_2.next()) { | ||
var eip = eips_2_1.value; | ||
if (!(eip in eips_1.EIPs)) { | ||
throw new Error(eip + " not supported"); | ||
} | ||
var minHF = this.gteHardfork(eips_1.EIPs[eip]['minimumHardfork']); | ||
if (!minHF) { | ||
throw new Error(eip + " cannot be activated on hardfork " + this.hardfork() + ", minimumHardfork: " + minHF); | ||
} | ||
_loop_1(eip); | ||
} | ||
@@ -479,8 +495,11 @@ } | ||
Common.prototype.hardforkIsActiveOnBlock = function (hardfork, blockNumber, opts) { | ||
opts = opts !== undefined ? opts : {}; | ||
var onlySupported = opts.onlySupported === undefined ? false : opts.onlySupported; | ||
var _a; | ||
if (opts === void 0) { opts = {}; } | ||
blockNumber = ethereumjs_util_1.toType(blockNumber, ethereumjs_util_1.TypeOutput.BN); | ||
var onlySupported = (_a = opts.onlySupported) !== null && _a !== void 0 ? _a : false; | ||
hardfork = this._chooseHardfork(hardfork, onlySupported); | ||
var hfBlock = this.hardforkBlock(hardfork); | ||
if (hfBlock !== null && blockNumber >= hfBlock) | ||
var hfBlock = this.hardforkBlockBN(hardfork); | ||
if (hfBlock && blockNumber.gte(hfBlock)) { | ||
return true; | ||
} | ||
return false; | ||
@@ -506,3 +525,3 @@ }; | ||
var e_11, _a; | ||
opts = opts !== undefined ? opts : {}; | ||
if (opts === void 0) { opts = {}; } | ||
var onlyActive = opts.onlyActive === undefined ? false : opts.onlyActive; | ||
@@ -555,8 +574,9 @@ hardfork1 = this._chooseHardfork(hardfork1, opts.onlySupported); | ||
var e_12, _a; | ||
opts = opts !== undefined ? opts : {}; | ||
var onlySupported = opts.onlySupported === undefined ? false : opts.onlySupported; | ||
var _b; | ||
if (opts === void 0) { opts = {}; } | ||
var onlySupported = (_b = opts.onlySupported) !== null && _b !== void 0 ? _b : false; | ||
hardfork = this._chooseHardfork(hardfork, onlySupported); | ||
try { | ||
for (var _b = __values(this.hardforks()), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var hf = _c.value; | ||
for (var _c = __values(this.hardforks()), _d = _c.next(); !_d.done; _d = _c.next()) { | ||
var hf = _d.value; | ||
if (hf['name'] === hardfork && hf['block'] !== null) | ||
@@ -569,3 +589,3 @@ return true; | ||
try { | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
if (_d && !_d.done && (_a = _c.return)) _a.call(_c); | ||
} | ||
@@ -584,3 +604,3 @@ finally { if (e_12) throw e_12.error; } | ||
var e_13, _a; | ||
opts = opts !== undefined ? opts : {}; | ||
if (opts === void 0) { opts = {}; } | ||
var activeHardforks = []; | ||
@@ -616,3 +636,3 @@ var hfs = this.hardforks(); | ||
Common.prototype.activeHardfork = function (blockNumber, opts) { | ||
opts = opts !== undefined ? opts : {}; | ||
if (opts === void 0) { opts = {}; } | ||
var activeHardforks = this.activeHardforks(blockNumber, opts); | ||
@@ -630,6 +650,15 @@ if (activeHardforks.length > 0) { | ||
* @returns Block number | ||
* @deprecated Please use hardforkBlockBN() for large number support | ||
*/ | ||
Common.prototype.hardforkBlock = function (hardfork) { | ||
return ethereumjs_util_1.toType(this.hardforkBlockBN(hardfork), ethereumjs_util_1.TypeOutput.Number); | ||
}; | ||
/** | ||
* Returns the hardfork change block for hardfork provided or set | ||
* @param hardfork Hardfork name, optional if HF set | ||
* @returns Block number | ||
*/ | ||
Common.prototype.hardforkBlockBN = function (hardfork) { | ||
hardfork = this._chooseHardfork(hardfork, false); | ||
return this._getHardfork(hardfork)['block']; | ||
return new ethereumjs_util_1.BN(this._getHardfork(hardfork)['block']); | ||
}; | ||
@@ -643,4 +672,5 @@ /** | ||
Common.prototype.isHardforkBlock = function (blockNumber, hardfork) { | ||
blockNumber = ethereumjs_util_1.toType(blockNumber, ethereumjs_util_1.TypeOutput.BN); | ||
hardfork = this._chooseHardfork(hardfork, false); | ||
return this.hardforkBlock(hardfork) === blockNumber; | ||
return this.hardforkBlockBN(hardfork).eq(blockNumber); | ||
}; | ||
@@ -651,6 +681,16 @@ /** | ||
* @returns Block number or null if not available | ||
* @deprecated Please use nextHardforkBlockBN() for large number support | ||
*/ | ||
Common.prototype.nextHardforkBlock = function (hardfork) { | ||
var block = this.nextHardforkBlockBN(hardfork); | ||
return block === null ? null : ethereumjs_util_1.toType(block, ethereumjs_util_1.TypeOutput.Number); | ||
}; | ||
/** | ||
* Returns the change block for the next hardfork after the hardfork provided or set | ||
* @param hardfork Hardfork name, optional if HF set | ||
* @returns Block number or null if not available | ||
*/ | ||
Common.prototype.nextHardforkBlockBN = function (hardfork) { | ||
hardfork = this._chooseHardfork(hardfork, false); | ||
var hfBlock = this.hardforkBlock(hardfork); | ||
var hfBlock = this.hardforkBlockBN(hardfork); | ||
// Next fork block number or null if none available | ||
@@ -661,3 +701,4 @@ // Logic: if accumulator is still null and on the first occurence of | ||
var nextHfBlock = this.hardforks().reduce(function (acc, hf) { | ||
return hf.block > hfBlock && acc === null ? hf.block : acc; | ||
var block = new ethereumjs_util_1.BN(hf.block); | ||
return block.gt(hfBlock) && acc === null ? block : acc; | ||
}, null); | ||
@@ -673,4 +714,6 @@ return nextHfBlock; | ||
Common.prototype.isNextHardforkBlock = function (blockNumber, hardfork) { | ||
blockNumber = ethereumjs_util_1.toType(blockNumber, ethereumjs_util_1.TypeOutput.BN); | ||
hardfork = this._chooseHardfork(hardfork, false); | ||
return this.nextHardforkBlock(hardfork) === blockNumber; | ||
var nextHardforkBlock = this.nextHardforkBlockBN(hardfork); | ||
return nextHardforkBlock === null ? false : nextHardforkBlock.eq(blockNumber); | ||
}; | ||
@@ -740,3 +783,3 @@ /** | ||
}); | ||
return resArray.length === 1 ? resArray[0] : null; | ||
return resArray.length >= 1 ? resArray[resArray.length - 1] : null; | ||
}; | ||
@@ -781,7 +824,15 @@ /** | ||
* @returns chain Id | ||
* @deprecated Please use chainIdBN() for large number support | ||
*/ | ||
Common.prototype.chainId = function () { | ||
return this._chainParams['chainId']; | ||
return ethereumjs_util_1.toType(this.chainIdBN(), ethereumjs_util_1.TypeOutput.Number); | ||
}; | ||
/** | ||
* Returns the Id of current chain | ||
* @returns chain Id | ||
*/ | ||
Common.prototype.chainIdBN = function () { | ||
return new ethereumjs_util_1.BN(this._chainParams['chainId']); | ||
}; | ||
/** | ||
* Returns the name of current chain | ||
@@ -796,7 +847,15 @@ * @returns chain name (lower case) | ||
* @returns network Id | ||
* @deprecated Please use networkIdBN() for large number support | ||
*/ | ||
Common.prototype.networkId = function () { | ||
return this._chainParams['networkId']; | ||
return ethereumjs_util_1.toType(this.networkIdBN(), ethereumjs_util_1.TypeOutput.Number); | ||
}; | ||
/** | ||
* Returns the Id of current network | ||
* @returns network Id | ||
*/ | ||
Common.prototype.networkIdBN = function () { | ||
return new ethereumjs_util_1.BN(this._chainParams['networkId']); | ||
}; | ||
/** | ||
* Returns the active EIPs | ||
@@ -838,2 +897,8 @@ * @returns List of EIPs | ||
}; | ||
/** | ||
* Returns a deep copy of this common instance. | ||
*/ | ||
Common.prototype.copy = function () { | ||
return Object.assign(Object.create(Object.getPrototypeOf(this)), this); | ||
}; | ||
return Common; | ||
@@ -840,0 +905,0 @@ }(events_1.EventEmitter)); |
@@ -0,1 +1,3 @@ | ||
/// <reference types="bn.js" /> | ||
import { BN } from 'ethereumjs-util'; | ||
export interface genesisStatesType { | ||
@@ -15,4 +17,4 @@ names: { | ||
name: string; | ||
chainId: number; | ||
networkId: number; | ||
chainId: number | BN; | ||
networkId: number | BN; | ||
defaultHardfork?: string; | ||
@@ -19,0 +21,0 @@ comment: string; |
@@ -73,4 +73,4 @@ { | ||
"name": "berlin", | ||
"block": null, | ||
"forkHash": null | ||
"block": 4460644, | ||
"forkHash": "0x757a1c47" | ||
} | ||
@@ -77,0 +77,0 @@ ], |
@@ -12,2 +12,3 @@ "use strict"; | ||
const goerli_json_1 = __importDefault(require("./goerli.json")); | ||
const yolov3_json_1 = __importDefault(require("./yolov3.json")); | ||
/** | ||
@@ -23,2 +24,3 @@ * @hidden | ||
'5': 'goerli', | ||
'34180983699157880': 'yolov3', | ||
}; | ||
@@ -31,2 +33,3 @@ const chains = { | ||
goerli: goerli_json_1.default, | ||
yolov3: yolov3_json_1.default, | ||
}; | ||
@@ -33,0 +36,0 @@ if (customChains) { |
@@ -75,4 +75,4 @@ { | ||
"name": "berlin", | ||
"block": null, | ||
"forkHash": null | ||
"block": 12244000, | ||
"forkHash": "0xeb440f6" | ||
} | ||
@@ -79,0 +79,0 @@ ], |
@@ -73,4 +73,4 @@ { | ||
"name": "berlin", | ||
"block": null, | ||
"forkHash": null | ||
"block": 8290928, | ||
"forkHash": "0x6910c8bd" | ||
} | ||
@@ -77,0 +77,0 @@ ], |
@@ -75,4 +75,4 @@ { | ||
"name": "berlin", | ||
"block": null, | ||
"forkHash": null | ||
"block": 9812189, | ||
"forkHash": "0xa157d377" | ||
} | ||
@@ -79,0 +79,0 @@ ], |
@@ -20,2 +20,62 @@ { | ||
"d": "Gas cost of reading storage locations which have already loaded 'cold'" | ||
}, | ||
"sstoreCleanGasEIP2200": { | ||
"v": 2900, | ||
"d": "Once per SSTORE operation from clean non-zero to something else" | ||
}, | ||
"sstoreNoopGasEIP2200": { | ||
"v": 100, | ||
"d": "Once per SSTORE operation if the value doesn't change" | ||
}, | ||
"sstoreDirtyGasEIP2200": { | ||
"v": 100, | ||
"d": "Once per SSTORE operation if a dirty value is changed" | ||
}, | ||
"sstoreInitRefundEIP2200": { | ||
"v": 19900, | ||
"d": "Once per SSTORE operation for resetting to the original zero value" | ||
}, | ||
"sstoreCleanRefundEIP2200": { | ||
"v": 4900, | ||
"d": "Once per SSTORE operation for resetting to the original non-zero value" | ||
}, | ||
"call": { | ||
"v": 0, | ||
"d": "Base fee of the CALL opcode" | ||
}, | ||
"callcode": { | ||
"v": 0, | ||
"d": "Base fee of the CALLCODE opcode" | ||
}, | ||
"delegatecall": { | ||
"v": 0, | ||
"d": "Base fee of the DELEGATECALL opcode" | ||
}, | ||
"staticcall": { | ||
"v": 0, | ||
"d": "Base fee of the STATICCALL opcode" | ||
}, | ||
"balance": { | ||
"v": 0, | ||
"d": "Base fee of the BALANCE opcode" | ||
}, | ||
"extcodesize": { | ||
"v": 0, | ||
"d": "Base fee of the EXTCODESIZE opcode" | ||
}, | ||
"extcodecopy": { | ||
"v": 0, | ||
"d": "Base fee of the EXTCODECOPY opcode" | ||
}, | ||
"extcodehash": { | ||
"v": 0, | ||
"d": "Base fee of the EXTCODEHASH opcode" | ||
}, | ||
"sload": { | ||
"v": 0, | ||
"d": "Base fee of the SLOAD opcode" | ||
}, | ||
"sstore": { | ||
"v": 0, | ||
"d": "Base fee of the SSTORE opcode" | ||
} | ||
@@ -22,0 +82,0 @@ }, |
@@ -8,4 +8,6 @@ "use strict"; | ||
2565: require('./2565.json'), | ||
2718: require('./2718.json'), | ||
2929: require('./2929.json'), | ||
2930: require('./2930.json'), | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -11,2 +11,3 @@ "use strict"; | ||
'5': 'goerli', | ||
'34180983699157880': 'yolov3', | ||
}, | ||
@@ -18,2 +19,3 @@ mainnet: require('./mainnet.json'), | ||
goerli: require('./goerli.json'), | ||
yolov3: require('./yolov3.json'), | ||
}; | ||
@@ -20,0 +22,0 @@ /** |
@@ -6,3 +6,3 @@ { | ||
"status": "Draft", | ||
"eips": [2315] | ||
"eips": [2565, 2929, 2718, 2930] | ||
} |
@@ -0,3 +1,5 @@ | ||
/// <reference types="bn.js" /> | ||
/// <reference types="node" /> | ||
import { EventEmitter } from 'events'; | ||
import { BN, BNLike } from 'ethereumjs-util'; | ||
import { Chain } from './types'; | ||
@@ -12,3 +14,3 @@ /** | ||
*/ | ||
chain: string | number | object; | ||
chain: string | number | BN | object; | ||
/** | ||
@@ -84,3 +86,3 @@ * String identifier ('byzantium') for hardfork | ||
*/ | ||
setChain(chain: string | number | object): any; | ||
setChain(chain: string | number | BN | object): any; | ||
/** | ||
@@ -96,3 +98,3 @@ * Sets the hardfork to get params for | ||
*/ | ||
getHardforkByBlockNumber(blockNumber: number): string; | ||
getHardforkByBlockNumber(blockNumber: BNLike): string; | ||
/** | ||
@@ -103,3 +105,3 @@ * Sets a new hardfork based on the block number provided | ||
*/ | ||
setHardforkByBlockNumber(blockNumber: number): string; | ||
setHardforkByBlockNumber(blockNumber: BNLike): string; | ||
/** | ||
@@ -162,3 +164,3 @@ * Internal helper function to choose between hardfork set and hardfork provided as param | ||
*/ | ||
paramByBlock(topic: string, name: string, blockNumber: number): any; | ||
paramByBlock(topic: string, name: string, blockNumber: BNLike): any; | ||
/** | ||
@@ -181,3 +183,3 @@ * Checks if an EIP is activated by either being included in the EIPs | ||
*/ | ||
hardforkIsActiveOnBlock(hardfork: string | null, blockNumber: number, opts?: hardforkOptions): boolean; | ||
hardforkIsActiveOnBlock(hardfork: string | null, blockNumber: BNLike, opts?: hardforkOptions): boolean; | ||
/** | ||
@@ -189,3 +191,3 @@ * Alias to hardforkIsActiveOnBlock when hardfork is set | ||
*/ | ||
activeOnBlock(blockNumber: number, opts?: hardforkOptions): boolean; | ||
activeOnBlock(blockNumber: BNLike, opts?: hardforkOptions): boolean; | ||
/** | ||
@@ -219,3 +221,3 @@ * Sequence based check if given or set HF1 is greater than or equal HF2 | ||
*/ | ||
activeHardforks(blockNumber?: number | null, opts?: hardforkOptions): Array<any>; | ||
activeHardforks(blockNumber?: BNLike | null, opts?: hardforkOptions): Array<any>; | ||
/** | ||
@@ -227,3 +229,3 @@ * Returns the latest active hardfork name for chain or block or throws if unavailable | ||
*/ | ||
activeHardfork(blockNumber?: number | null, opts?: hardforkOptions): string; | ||
activeHardfork(blockNumber?: BNLike | null, opts?: hardforkOptions): string; | ||
/** | ||
@@ -233,5 +235,12 @@ * Returns the hardfork change block for hardfork provided or set | ||
* @returns Block number | ||
* @deprecated Please use hardforkBlockBN() for large number support | ||
*/ | ||
hardforkBlock(hardfork?: string): number; | ||
/** | ||
* Returns the hardfork change block for hardfork provided or set | ||
* @param hardfork Hardfork name, optional if HF set | ||
* @returns Block number | ||
*/ | ||
hardforkBlockBN(hardfork?: string): BN; | ||
/** | ||
* True if block number provided is the hardfork (given or set) change block | ||
@@ -242,3 +251,3 @@ * @param blockNumber Number of the block to check | ||
*/ | ||
isHardforkBlock(blockNumber: number, hardfork?: string): boolean; | ||
isHardforkBlock(blockNumber: BNLike, hardfork?: string): boolean; | ||
/** | ||
@@ -248,5 +257,12 @@ * Returns the change block for the next hardfork after the hardfork provided or set | ||
* @returns Block number or null if not available | ||
* @deprecated Please use nextHardforkBlockBN() for large number support | ||
*/ | ||
nextHardforkBlock(hardfork?: string): number | null; | ||
/** | ||
* Returns the change block for the next hardfork after the hardfork provided or set | ||
* @param hardfork Hardfork name, optional if HF set | ||
* @returns Block number or null if not available | ||
*/ | ||
nextHardforkBlockBN(hardfork?: string): BN | null; | ||
/** | ||
* True if block number provided is the hardfork change block following the hardfork given or set | ||
@@ -257,3 +273,3 @@ * @param blockNumber Number of the block to check | ||
*/ | ||
isNextHardforkBlock(blockNumber: number, hardfork?: string): boolean; | ||
isNextHardforkBlock(blockNumber: BNLike, hardfork?: string): boolean; | ||
/** | ||
@@ -304,5 +320,11 @@ * Internal helper function to calculate a fork hash | ||
* @returns chain Id | ||
* @deprecated Please use chainIdBN() for large number support | ||
*/ | ||
chainId(): number; | ||
/** | ||
* Returns the Id of current chain | ||
* @returns chain Id | ||
*/ | ||
chainIdBN(): BN; | ||
/** | ||
* Returns the name of current chain | ||
@@ -315,5 +337,11 @@ * @returns chain name (lower case) | ||
* @returns network Id | ||
* @deprecated Please use networkIdBN() for large number support | ||
*/ | ||
networkId(): number; | ||
/** | ||
* Returns the Id of current network | ||
* @returns network Id | ||
*/ | ||
networkIdBN(): BN; | ||
/** | ||
* Returns the active EIPs | ||
@@ -347,3 +375,7 @@ * @returns List of EIPs | ||
consensusConfig(): any; | ||
/** | ||
* Returns a deep copy of this common instance. | ||
*/ | ||
copy(): Common; | ||
} | ||
export {}; |
@@ -5,2 +5,3 @@ "use strict"; | ||
const crc_32_1 = require("crc-32"); | ||
const ethereumjs_util_1 = require("ethereumjs-util"); | ||
const chains_1 = require("./chains"); | ||
@@ -55,3 +56,4 @@ const hardforks_1 = require("./hardforks"); | ||
const initializedChains = chains_1._getInitializedChains(customChains); | ||
if (typeof chain === 'number') { | ||
if (typeof chain === 'number' || ethereumjs_util_1.BN.isBN(chain)) { | ||
chain = chain.toString(); | ||
if (initializedChains['names'][chain]) { | ||
@@ -75,3 +77,3 @@ const name = initializedChains['names'][chain]; | ||
setChain(chain) { | ||
if (typeof chain === 'number' || typeof chain === 'string') { | ||
if (typeof chain === 'number' || typeof chain === 'string' || ethereumjs_util_1.BN.isBN(chain)) { | ||
this._chainParams = Common._getChainParams(chain, this._customChains); | ||
@@ -81,3 +83,3 @@ } | ||
if (this._customChains.length > 0) { | ||
throw new Error('Chain must be a string or number when initialized with customChains passed in'); | ||
throw new Error('Chain must be a string, number, or BN when initialized with customChains passed in'); | ||
} | ||
@@ -125,10 +127,10 @@ const required = ['networkId', 'genesis', 'hardforks', 'bootstrapNodes']; | ||
getHardforkByBlockNumber(blockNumber) { | ||
blockNumber = ethereumjs_util_1.toType(blockNumber, ethereumjs_util_1.TypeOutput.BN); | ||
let hardfork = 'chainstart'; | ||
for (const hf of this.hardforks()) { | ||
const hardforkBlock = hf.block; | ||
// Skip comparison for not applied HFs | ||
if (hardforkBlock === null) { | ||
if (hf.block === null) { | ||
continue; | ||
} | ||
if (blockNumber >= hardforkBlock) { | ||
if (blockNumber.gte(new ethereumjs_util_1.BN(hf.block))) { | ||
hardfork = hf.name; | ||
@@ -145,2 +147,3 @@ } | ||
setHardforkByBlockNumber(blockNumber) { | ||
blockNumber = ethereumjs_util_1.toType(blockNumber, ethereumjs_util_1.TypeOutput.BN); | ||
const hardfork = this.getHardforkByBlockNumber(blockNumber); | ||
@@ -207,2 +210,10 @@ this.setHardfork(hardfork); | ||
} | ||
if (eips_1.EIPs[eip].requiredEIPs) { | ||
// eslint-disable-next-line prettier/prettier | ||
eips_1.EIPs[eip].requiredEIPs.forEach((elem) => { | ||
if (!(eips.includes(elem) || this.isActivatedEIP(elem))) { | ||
throw new Error(`${eip} requires EIP ${elem}, but is not included in the EIP list`); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -329,9 +340,11 @@ this._eips = eips; | ||
*/ | ||
hardforkIsActiveOnBlock(hardfork, blockNumber, opts) { | ||
opts = opts !== undefined ? opts : {}; | ||
const onlySupported = opts.onlySupported === undefined ? false : opts.onlySupported; | ||
hardforkIsActiveOnBlock(hardfork, blockNumber, opts = {}) { | ||
var _a; | ||
blockNumber = ethereumjs_util_1.toType(blockNumber, ethereumjs_util_1.TypeOutput.BN); | ||
const onlySupported = (_a = opts.onlySupported) !== null && _a !== void 0 ? _a : false; | ||
hardfork = this._chooseHardfork(hardfork, onlySupported); | ||
const hfBlock = this.hardforkBlock(hardfork); | ||
if (hfBlock !== null && blockNumber >= hfBlock) | ||
const hfBlock = this.hardforkBlockBN(hardfork); | ||
if (hfBlock && blockNumber.gte(hfBlock)) { | ||
return true; | ||
} | ||
return false; | ||
@@ -355,4 +368,3 @@ } | ||
*/ | ||
hardforkGteHardfork(hardfork1, hardfork2, opts) { | ||
opts = opts !== undefined ? opts : {}; | ||
hardforkGteHardfork(hardfork1, hardfork2, opts = {}) { | ||
const onlyActive = opts.onlyActive === undefined ? false : opts.onlyActive; | ||
@@ -393,5 +405,5 @@ hardfork1 = this._chooseHardfork(hardfork1, opts.onlySupported); | ||
*/ | ||
hardforkIsActiveOnChain(hardfork, opts) { | ||
opts = opts !== undefined ? opts : {}; | ||
const onlySupported = opts.onlySupported === undefined ? false : opts.onlySupported; | ||
hardforkIsActiveOnChain(hardfork, opts = {}) { | ||
var _a; | ||
const onlySupported = (_a = opts.onlySupported) !== null && _a !== void 0 ? _a : false; | ||
hardfork = this._chooseHardfork(hardfork, onlySupported); | ||
@@ -410,4 +422,3 @@ for (const hf of this.hardforks()) { | ||
*/ | ||
activeHardforks(blockNumber, opts) { | ||
opts = opts !== undefined ? opts : {}; | ||
activeHardforks(blockNumber, opts = {}) { | ||
const activeHardforks = []; | ||
@@ -432,4 +443,3 @@ const hfs = this.hardforks(); | ||
*/ | ||
activeHardfork(blockNumber, opts) { | ||
opts = opts !== undefined ? opts : {}; | ||
activeHardfork(blockNumber, opts = {}) { | ||
const activeHardforks = this.activeHardforks(blockNumber, opts); | ||
@@ -447,6 +457,15 @@ if (activeHardforks.length > 0) { | ||
* @returns Block number | ||
* @deprecated Please use hardforkBlockBN() for large number support | ||
*/ | ||
hardforkBlock(hardfork) { | ||
return ethereumjs_util_1.toType(this.hardforkBlockBN(hardfork), ethereumjs_util_1.TypeOutput.Number); | ||
} | ||
/** | ||
* Returns the hardfork change block for hardfork provided or set | ||
* @param hardfork Hardfork name, optional if HF set | ||
* @returns Block number | ||
*/ | ||
hardforkBlockBN(hardfork) { | ||
hardfork = this._chooseHardfork(hardfork, false); | ||
return this._getHardfork(hardfork)['block']; | ||
return new ethereumjs_util_1.BN(this._getHardfork(hardfork)['block']); | ||
} | ||
@@ -460,4 +479,5 @@ /** | ||
isHardforkBlock(blockNumber, hardfork) { | ||
blockNumber = ethereumjs_util_1.toType(blockNumber, ethereumjs_util_1.TypeOutput.BN); | ||
hardfork = this._chooseHardfork(hardfork, false); | ||
return this.hardforkBlock(hardfork) === blockNumber; | ||
return this.hardforkBlockBN(hardfork).eq(blockNumber); | ||
} | ||
@@ -468,6 +488,16 @@ /** | ||
* @returns Block number or null if not available | ||
* @deprecated Please use nextHardforkBlockBN() for large number support | ||
*/ | ||
nextHardforkBlock(hardfork) { | ||
const block = this.nextHardforkBlockBN(hardfork); | ||
return block === null ? null : ethereumjs_util_1.toType(block, ethereumjs_util_1.TypeOutput.Number); | ||
} | ||
/** | ||
* Returns the change block for the next hardfork after the hardfork provided or set | ||
* @param hardfork Hardfork name, optional if HF set | ||
* @returns Block number or null if not available | ||
*/ | ||
nextHardforkBlockBN(hardfork) { | ||
hardfork = this._chooseHardfork(hardfork, false); | ||
const hfBlock = this.hardforkBlock(hardfork); | ||
const hfBlock = this.hardforkBlockBN(hardfork); | ||
// Next fork block number or null if none available | ||
@@ -478,3 +508,4 @@ // Logic: if accumulator is still null and on the first occurence of | ||
const nextHfBlock = this.hardforks().reduce((acc, hf) => { | ||
return hf.block > hfBlock && acc === null ? hf.block : acc; | ||
const block = new ethereumjs_util_1.BN(hf.block); | ||
return block.gt(hfBlock) && acc === null ? block : acc; | ||
}, null); | ||
@@ -490,4 +521,6 @@ return nextHfBlock; | ||
isNextHardforkBlock(blockNumber, hardfork) { | ||
blockNumber = ethereumjs_util_1.toType(blockNumber, ethereumjs_util_1.TypeOutput.BN); | ||
hardfork = this._chooseHardfork(hardfork, false); | ||
return this.nextHardforkBlock(hardfork) === blockNumber; | ||
const nextHardforkBlock = this.nextHardforkBlockBN(hardfork); | ||
return nextHardforkBlock === null ? false : nextHardforkBlock.eq(blockNumber); | ||
} | ||
@@ -546,3 +579,3 @@ /** | ||
}); | ||
return resArray.length === 1 ? resArray[0] : null; | ||
return resArray.length >= 1 ? resArray[resArray.length - 1] : null; | ||
} | ||
@@ -587,7 +620,15 @@ /** | ||
* @returns chain Id | ||
* @deprecated Please use chainIdBN() for large number support | ||
*/ | ||
chainId() { | ||
return this._chainParams['chainId']; | ||
return ethereumjs_util_1.toType(this.chainIdBN(), ethereumjs_util_1.TypeOutput.Number); | ||
} | ||
/** | ||
* Returns the Id of current chain | ||
* @returns chain Id | ||
*/ | ||
chainIdBN() { | ||
return new ethereumjs_util_1.BN(this._chainParams['chainId']); | ||
} | ||
/** | ||
* Returns the name of current chain | ||
@@ -602,7 +643,15 @@ * @returns chain name (lower case) | ||
* @returns network Id | ||
* @deprecated Please use networkIdBN() for large number support | ||
*/ | ||
networkId() { | ||
return this._chainParams['networkId']; | ||
return ethereumjs_util_1.toType(this.networkIdBN(), ethereumjs_util_1.TypeOutput.Number); | ||
} | ||
/** | ||
* Returns the Id of current network | ||
* @returns network Id | ||
*/ | ||
networkIdBN() { | ||
return new ethereumjs_util_1.BN(this._chainParams['networkId']); | ||
} | ||
/** | ||
* Returns the active EIPs | ||
@@ -644,4 +693,10 @@ * @returns List of EIPs | ||
} | ||
/** | ||
* Returns a deep copy of this common instance. | ||
*/ | ||
copy() { | ||
return Object.assign(Object.create(Object.getPrototypeOf(this)), this); | ||
} | ||
} | ||
exports.default = Common; | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,3 @@ | ||
/// <reference types="bn.js" /> | ||
import { BN } from 'ethereumjs-util'; | ||
export interface genesisStatesType { | ||
@@ -15,4 +17,4 @@ names: { | ||
name: string; | ||
chainId: number; | ||
networkId: number; | ||
chainId: number | BN; | ||
networkId: number | BN; | ||
defaultHardfork?: string; | ||
@@ -19,0 +21,0 @@ comment: string; |
{ | ||
"name": "@ethereumjs/common", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Resources common to all Ethereum implementations", | ||
@@ -26,3 +26,3 @@ "main": "./dist/index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/ethereumjs/ethereumjs-vm.git" | ||
"url": "git+https://github.com/ethereumjs/ethereumjs-monorepo.git" | ||
}, | ||
@@ -41,7 +41,8 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/ethereumjs/ethereumjs-vm/issues?q=is%3Aissue+label%3A%22package%3A+common%22" | ||
"url": "https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aissue+label%3A%22package%3A+common%22" | ||
}, | ||
"homepage": "https://github.com/ethereumjs/ethereumjs-vm/tree/master/packages/common#readme", | ||
"homepage": "https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common#readme", | ||
"dependencies": { | ||
"crc-32": "^1.2.0" | ||
"crc-32": "^1.2.0", | ||
"ethereumjs-util": "^7.0.9" | ||
}, | ||
@@ -48,0 +49,0 @@ "devDependencies": { |
@@ -98,2 +98,3 @@ # @ethereumjs/common | ||
- `goerli` | ||
- `yolov3` | ||
- Private/custom chain parameters | ||
@@ -184,12 +185,9 @@ | ||
- `istanbul` (`DEFAULT_HARDFORK` (`v2.0.0` release series)) | ||
- `muirGlacier` (since `v1.5.0`) | ||
- `muirGlacier` | ||
- `berlin` (since `v2.2.0`) | ||
### Future Hardforks | ||
General support for the `berlin` hardfork has been added along `v2.0.0`, specification of the hardfork regarding EIPs included was not finalized upon release date. | ||
The `london` hardfork targeted for summer 2021 is currently not yet supported by this library. | ||
Currently supported `berlin` EIPs: | ||
- `EIP-2315` | ||
### Parameter Access | ||
@@ -226,3 +224,5 @@ | ||
- [EIP-2565](https://eips.ethereum.org/EIPS/eip-2565): ModExp gas cost | ||
- [EIP-2718](https://eips.ethereum.org/EIPS/eip-2565): Transaction Types | ||
- [EIP-2929](https://eips.ethereum.org/EIPS/eip-2929): gas cost increases for state access opcodes | ||
- [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930): Optional accesss list tx type | ||
@@ -229,0 +229,0 @@ ## Bootstrap Nodes |
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
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
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
1721795
98
25977
2
+ Addedethereumjs-util@^7.0.9
+ Added@types/bn.js@5.1.6(transitive)
+ Added@types/node@22.9.0(transitive)
+ Added@types/pbkdf2@3.1.2(transitive)
+ Added@types/secp256k1@4.0.6(transitive)
+ Addedbase-x@3.0.10(transitive)
+ Addedblakejs@1.2.1(transitive)
+ Addedbn.js@4.12.15.2.1(transitive)
+ Addedbrorand@1.1.0(transitive)
+ Addedbrowserify-aes@1.2.0(transitive)
+ Addedbs58@4.0.1(transitive)
+ Addedbs58check@2.1.2(transitive)
+ Addedbuffer-xor@1.0.3(transitive)
+ Addedcipher-base@1.0.4(transitive)
+ Addedcreate-hash@1.2.0(transitive)
+ Addedcreate-hmac@1.1.7(transitive)
+ Addedelliptic@6.6.1(transitive)
+ Addedethereum-cryptography@0.1.3(transitive)
+ Addedethereumjs-util@7.1.5(transitive)
+ Addedevp_bytestokey@1.0.3(transitive)
+ Addedhash-base@3.1.0(transitive)
+ Addedhash.js@1.1.7(transitive)
+ Addedhmac-drbg@1.0.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedkeccak@3.0.4(transitive)
+ Addedmd5.js@1.3.5(transitive)
+ Addedminimalistic-assert@1.0.1(transitive)
+ Addedminimalistic-crypto-utils@1.0.1(transitive)
+ Addednode-addon-api@2.0.25.1.0(transitive)
+ Addednode-gyp-build@4.8.3(transitive)
+ Addedpbkdf2@3.1.2(transitive)
+ Addedrandombytes@2.1.0(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedripemd160@2.0.2(transitive)
+ Addedrlp@2.2.7(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedscrypt-js@3.0.1(transitive)
+ Addedsecp256k1@4.0.4(transitive)
+ Addedsetimmediate@1.0.5(transitive)
+ Addedsha.js@2.4.11(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedundici-types@6.19.8(transitive)
+ Addedutil-deprecate@1.0.2(transitive)