Skip to content

Latest commit

 

History

History
744 lines (495 loc) · 40.6 KB

CHANGELOG.md

File metadata and controls

744 lines (495 loc) · 40.6 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog (modification: no type change headlines) and this project adheres to Semantic Versioning.

3.6.1 - 2022-02-02

  • Use initial configured base fee as default for EIP-1559-enabled blocks, PR #1581

3.6.0 - 2021-11-09

ArrowGlacier HF Support

This release adds support for the upcoming ArrowGlacier HF (see PR #1527) targeted for December 2021. The only included EIP is EIP-4345 which delays the difficulty bomb to June/July 2022, the difficulty formula on a block will work accordingly if instantiated on the ArrowGlacier HF.

Please note that for backwards-compatibility reasons the associated Common is still instantiated with istanbul by default.

An ArrowGlacier block can be instantiated with:

import { Block } from '@ethereumjs/block'
import Common, { Chain, Hardfork } from '@ethereumjs/common'

const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.ArrowGlacier })
const block = Block.fromBlockData({
  // Provide your block data here or use default values
}, { common })

Additional Error Context for Error Messages

This release extends the text of the error messages in the library with some consistent context information (see PR #1540), here an example for illustration:

Before:

invalid transaction trie

New:

invalid transaction trie (block number=1 hash=0xe074b7b8d725c4000f278ae55cedbc76262e28906c283899d996cd27ab19b145 hf=istanbul baseFeePerGas=none txs=7 uncles=0)

The extended errors give substantial more object and chain context and should ease debugging.

Potentially breaking: Attention! If you do react on errors in your code and do exact errror matching (error.message === 'invalid transaction trie') things will break. Please make sure to do error comparisons with something like error.message.includes('invalid transaction trie') instead. This should generally be the pattern used for all error message comparisions and is assured to be future proof on all error messages (we won't change the core text in non-breaking releases).

Other Changes

  • Fix blockHeaderFromRpc() method to continue to work for pre-London blocks, PR #1509
  • Allow instantiation of post-London genesis blocks receiving a baseFeePerGas value from the associated Common object, PR #1512
  • Deprecated bloom parameter in favor of logsBloom to align with RPC names (as an object parameter, as RPC output in toJSON() method and in the TypeScript HeaderData interface), please update your code base!, PR #1509
  • Deprecated baseFee parameter in toJSON() method in favor of baseFeePerGas to align with RPC names, please update your code base!, PR #1509

3.5.1 - 2021-09-28

  • Fixed a bug not initializing the HF correctly when run on a custom chain with the london HF happening on block 0 or 1, PR #1492

3.5.0 - 2021-09-24

Experimental Merge/PoS Support

This release comes with experimental support for the Merge HF as defined in EIP-3675 respectively support for creating PoS compatible Block objects (from an Eth 1.0 perspective).

PoS Block Instantiation

Proof-of-Stake compatible execution blocks come with its own set of header field simplifications and associated validation rules. The difficuly is set to 0 since not relevant any more, just to name an example. For a full list of changes see EIP-3675.

You can instantiate a Merge/PoS block like this:

import { Block } from '@ethereumjs/block'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Merge, })
const block = Block.fromBlockData({
  // Provide your block data here or use default values
}, { common })

See: PR #1393 and PR #1408

Set Hardfork by Total Difficulty

There is a new hardforkByTD option which expands the current hardforkByBlockNumber option and allows for setting the hardfork either by total difficulty or a Common-matching block number. The supportive functionality within the Common library has been introduced along the v2.5.0 release.

See. PR #1473

Other Changes

  • The hash from the block.hash() method now gets cached for blocks created with the freeze option (activated by default), PR #1445

3.4.0 - 2021-07-08

Finalized London HF Support

This release integrates a Common library version which provides the london HF blocks for all networks including mainnet and is therefore the first release with finalized London HF support.

Included Source Files

Source files from the src folder are now included in the distribution build, see PR #1301. This allows for a better debugging experience in debug tools like Chrome DevTools by having working source map references to the original sources available for inspection.

Other Changes

  • Fixed RPC value handling for difficulty, gasPrice and value in blockFromRpc() when value is provided as a number (thanks @Ghorbanian for the contribution), PR #1316
  • Added baseFeePerGas to blockHeaderFromRpc() (thanks @mfornet for the contribution), PR #1330

3.3.0 - 2021-05-26

Functional London HF Support (no finalized HF blocks yet)

This Block release comes with full functional support for the london hardfork (all EIPs are finalized and integrated and london HF can be activated, there are no final block numbers for the HF integrated though yet). 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 london HF activated:

import { BN } from 'ethereumjs-util'
import { Block } from '@ethereumjs/block'
import Common from '@ethereumjs/common'
const common = new Common({ chain: 'mainnet', hardfork: 'london' })

const block = Block.fromBlockData({
  header: {
    baseFeePerGas: new BN(10),
    gasLimit: new BN(100),
    gasUsed: new BN(60)
  }
}, { common })

// Base fee will increase for next block since the
// gas used is greater than half the gas limit
block.header.calcNextBaseFee().toNumber() // 11

EIP-1559: Fee market change for ETH 1.0 chain

This library now supports block structure and related logic coming with the new fee market mechanism introduced by EIP-1559, see PR #1148.

Blocks now have an extra baseFeePerGas field which can be passed in on instantiation with a london (or EIP-1559) enabled common (otherwise baseFeePerGas will default to new BN(7), which is the minimum possible baseFeePerGas value).

A block can now also encompass FeeMarketEIP1559Transaction txs (type 2) which are supported by @ethereumjs/tx v3.2.0 or higher. Transaction legacy txs (internal type 0) and AccessListEIP2930Transaction txs (type 1) are still valid.

On block (header) validation with BlockHeader.validate() there is a new validity check if the base fee of a block matches the expected calculated base fee derived from the gas used in the parent block and taking the former virtual gas target (gas limit // ELASTICITY_MULTIPLIER (2)) into account.

EIP-3554: Difficulty Bomb Delay to December 2021

Support for the london difficulty bomb (EIP-3554) delay has been added along PR #1245. A london-activated block is now doing difficulty calculation and validation with the updated EIP parameters (only PoW chains).

3.2.1 - 2021-04-09

  • Fixed BlockData interface transactions typing for EIP-2930 typed txs, PR #1185

3.2.0 - 2021-03-18

Berlin HF Support

This release gets the Block library ready for the berlin HF by adding support for EIP2718 Typed Transactions. Transaction objects are now created with the new TransactionFactory introduced with the @ethereumjs/tx v3.1.0 release which chooses the correct tx type for the data. The initial tx release supports the old legacy transactions and the newly added EIP2930 Access List Transaction Type, see PR #1048.

Please note that the default HF is still set to istanbul. You therefore need to explicitly set the hardfork parameter for instantiating a Block instance with a berlin HF activated:

import { Block } from 'ethereumjs-block'
import Common from '@ethereumjs/common'
const common = new Common({ chain: 'mainnet', hardfork: 'berlin' })
const block = Block.fromBlockData({}, { common })

EthereumJS Libraries - Typed Transactions Readiness

If you are using this library in conjunction with other EthereumJS libraries make sure to minimally have the following library versions installed for typed transaction support:

  • @ethereumjs/common v2.2.0
  • @ethereumjs/tx v3.1.0
  • @ethereumjs/block v3.2.0
  • @ethereumjs/blockchain v5.2.0
  • @ethereumjs/vm v5.2.0

Other Changes

  • Added support for very large chain IDs when using Block cliqueSigner() address recovery, PR #1139
  • Fixed a TS compilation failure on install relating to ethereumjs-util v7.0.9, PR #1136

3.1.0 - 2021-02-22

Clique/PoA Support

This release introduces Clique/PoA support for the Block library, see the main PR #1032 as well as the follow-up PRs #1074 and PR #1088. The BlockHeader.validate() function now properly validates the various Clique/PoA-specific properties (extraData checks and others, see API documentation) and BlockHeader.validateConsensus() can be used to properly validate that a Clique/PoA block has the correct signature.

For sealing a block on instantiation there is a new cliqueSigner constructor option:

const cliqueSigner = Buffer.from('PRIVATE_KEY_HEX_STRING', 'hex')
const block = Block.fromHeaderData(headerData, { cliqueSigner })

Additionally there are the following new utility methods for Clique/PoA related functionality in the BlockHeader class:

  • BlockHeader.validateCliqueDifficulty(blockchain: Blockchain): boolean
  • BlockHeader.cliqueSigHash()
  • BlockHeader.cliqueIsEpochTransition(): boolean
  • BlockHeader.cliqueExtraVanity(): Buffer
  • BlockHeader.cliqueExtraSeal(): Buffer
  • BlockHeader.cliqueEpochTransitionSigners(): Address[]
  • BlockHeader.cliqueVerifySignature(signerList: Address[]): boolean
  • BlockHeader.cliqueSigner(): Address

See the API docs for a detailed documentation. Note that these methods will throw if called in a non-Clique/PoA context.

Other Changes

  • The Common instance passed is now copied to avoid side-effects towards the outer common instance on HF updates, PR #1089
  • Fixed a bug where txs have been created with the wrong HF when hardforkByBlockNumber is used along with the static constructors, PR #1089
  • Fixed a bug where Common has not been passed to the returned block in the blockFromRpc() method, PR #1032

3.0.0 - 2020-11-24

New Package Name

Attention! This new version is part of a series of EthereumJS releases all moving to a new scoped package name format. In this case the library is renamed as follows:

  • ethereumjs-block -> @ethereumjs/block

Please update your library references accordingly or install with:

npm i @ethereumjs/block

TypeScript/Library Import

This is the first TypeScript based release of the library, see PR #72. The import structure has slightly changed along:

TypeScript

import { BlockHeader } from 'ethereumjs-block'
import { Block } from 'ethereumjs-block'

JavaScript/Node.js

const BlockHeader = require('ethereumjs-block').BlockHeader
const Block = require('ethereumjs-block').Block

The library now also comes with a type declaration file distributed along with the package published.

Major Refactoring - Breaking Changes

This release is a major refactoring of the block library to simplify and strengthen its code base. Refactoring work has been done along PR #72 (Promises) and PR #883 (refactoring of API and internal code structure).

New Constructor Params

The way to instantiate a new BlockHeader or Block object has been completely reworked and is now more explicit, less error prone and produces more TypeScript friendly and readable code.

The old direct constructor usage is now discouraged in favor of different dedicated static factory methods to create new objects.

Breaking: While the main constructors can still be called, signatures changed significantly and your old new Block(...), new BlockHeader(...) instantiations won't work any more and needs to be updated.

BlockHeader Class

There are three new factory methods to create a new BlockHeader:

  1. Pass in a Header-attribute named dictionary to BlockHeader.fromHeaderData(headerData: HeaderData = {}, opts?: BlockOptions):
const headerData = {
  number: 15,
  parentHash: '0x6bfee7294bf44572b7266358e627f3c35105e1c3851f3de09e6d646f955725a7',
  difficulty: 131072,
  gasLimit: 8000000,
  timestamp: 1562422144,
}
const header = BlockHeader.fromHeaderData(headerData)
  1. Create a BlockHeader from an RLP-serialized header Buffer with BlockHeader.fromRLPSerializedHeader(serialized: Buffer, opts: BlockOptions).
const serialized = Buffer.from(
  'f901f7a06bfee7294bf44572b7266358e627f3c35105e1c3851f3de09e6d646f955725a7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830200000f837a120080845d20ab8080a00000000000000000000000000000000000000000000000000000000000000000880000000000000000',
  'hex'
)
const header = BlockHeader.fromRLPSerializedHeader(serialized)
  1. Create a BlockHeader from an array of Buffer values, you can do a first short roundtrip test with:
const valuesArray = header.raw()
BlockHeader.fromValuesArray(valuesArray)

Generally internal types representing block header values are now closer to their domain representation (number, difficulty, gasLimit) instead of having everthing represented as a Buffer.

Block Class

There are analog new static factories for the Block class:

  • Block.fromBlockData(blockData: BlockData = {}, opts?: BlockOptions)
  • Block.fromRLPSerializedBlock(serialized: Buffer, opts?: BlockOptions)
  • Block.fromValuesArray(values: BlockBuffer, opts?: BlockOptions)

Learn more about the full API in the docs.

Immutability

The returned block is now frozen and immutable. To work with a maliable block, copy it with const fakeBlock = Object.create(block).

If you need Block mutability - e.g. because you want to subclass Block and modifiy its behavior - there is a freeze option to prevent the Object.freeze() call on initialization, see PR #941.

Promise-based API

The API of this library is now completely promise-based and the old callback-style interface has been dropped.

This affects the following methods of the API now being defined as async and returning a Promise:

Header Class

  • BlockHeader.validate(blockchain: Blockchain, height?: BN): Promise<void>

Block Class

  • Block.genTxTrie(): Promise<void>
  • Block.validate(blockChain: Blockchain): Promise<void>
  • Block.validateUncles(blockchain: Blockchain): Promise<void>

Usage example:

try {
  await block.validate(blockchain)
  // Block validation has passed
} catch (err) {
  // handle errors appropriately
}

Header Validation Methods > Signature Changes

Breaking: The signatures of the following header validation methods have been updated to take a parentBlockHeader instead of a parentBlock input parameter for consistency and removing a circling dependency with Block:

  • BlockHeader.canonicalDifficulty(parentBlockHeader: BlockHeader): BN
  • BlockHeader.validateDifficulty(parentBlockHeader: BlockHeader): boolean
  • BlockHeader.validateGasLimit(parentBlockHeader: BlockHeader): boolean

On the Block library new corresponding methods have been added which both operate on a block instance and expect a parentBlock as an input parameter.

Breaking: Note that canonicalDifficulty() and validateDifficulty() in block and header now throw on non-PoW chains, see PR #937.

Breaking: Non-blockchain dependent validation checks have been extracted from validate() to its own Block.validateData() function. For the validate() method in block and header blockchain is now a mandatory parameter, see PR #942

New Default Hardfork

Breaking: The default HF on the library has been updated from petersburg to istanbul, see PR #906.

The HF setting is now automatically taken from the HF set for Common.DEAULT_HARDFORK, see PR #863.

Dual ES5 and ES2017 Builds

We significantly updated our internal tool and CI setup along the work on PR #913 with an update to ESLint from TSLint for code linting and formatting and the introduction of a new build setup.

Packages now target ES2017 for Node.js builds (the main entrypoint from package.json) and introduce a separate ES5 build distributed along using the browser directive as an entrypoint, see PR #921. This will result in performance benefits for Node.js consumers, see here for a releated discussion.

Other Changes

Features

  • Added Block.genesis() and BlockHeader.genesis() aliases to create a genesis block or header, PR #883
  • Added DAO hardfork support (check for extraData attribute if DAO HF is active), PR #843
  • Added the calcDifficultyFromHeader constructor option. If this BlockHeader is supplied, then the difficulty of the constructed BlockHeader will be set to the canonical difficulty (also if difficulty is set as parameter in the constructor). See #929
  • Added full uncle validation, which verifies if the uncles' parentHash points to the canonical chain, is not yet included and also is an uncle and not a canonical block. See PR #935
  • Additional consistency and validation checks in Block.validateUncles() for included uncle headers, PR #935

Changes and Refactoring

  • Added Node 10, 12 support, dropped Node 7 support, PR #72
  • Passing in a blockchain is now optional on Block.validate(), PR #883
  • Breaking: Block.validateTransactions(stringError: true) now returns a string[], PR #883
  • Breaking: Decoupling of the Block.serialize() and Block.raw() methods, Block.serialize() now always returns the RLP-encoded block (signature change!), Block.raw() always returns the pure Buffer array, PR #883
  • Breaking: Block.toJSON() now always returns the labeled JSON representation, removal of the labeled function parameter, PR #883
  • Updated merkle-patricia-tree dependency to v4, PR #787
  • Updated ethereumjs-util dependency to v7, PR #748
  • Removal of the async dependency, PR #72

CI and Testing

  • Browser test run on CI, PR #72
  • Karma browser test run config modernization and simplification, PR #72
  • Updated test source files to TypeScript, PR #72

Bug Fixes

  • Signature fix for pre-homestead blocks, PR #67
  • Fixed bug where block options have not been passed on to the main constructor from the static factory methods, see PR #941

3.0.0-rc.1 - 2020-11-19

This is the first release candidate towards a final library release, see beta.2 and especially beta.1 release notes for an overview on the full changes since the last publicly released version.

  • Additional consistency and validation checks in Block.validateUncles() for included uncle headers, PR #935

3.0.0-beta.2 - 2020-11-12

This is the second beta release towards a final library release, see beta.1 release notes for an overview on the full changes since the last publicly released version.

  • Added freeze option to allow for block freeze deactivation (e.g. to allow for subclassing block and adding additional parameters), see PR #941
  • Breaking: Difficulty-depending methods canonicalDifficulty() and validateDifficulty() in block and header now throw on non-PoW chains, see PR #937
  • Breaking: Non-blockchain dependent validation checks have been extracted from validate() to its own Block.validateData() function. For the validate() method in block and header blockchain is now a mandatory parameter, see PR #942
  • Fixed bug where block options have not been passed on to the main constructor from the static factory methods, see PR #941
  • Added full uncle validation, which verifies if the uncles' parentHash points to the canonical chain, is not yet included and also is an uncle and not a canonical block. See PR #935.

3.0.0-beta.1 - 2020-10-22

New Package Name

Attention! This new version is part of a series of EthereumJS releases all moving to a new scoped package name format. In this case the library is renamed as follows:

  • ethereumjs-block -> @ethereumjs/block

Please update your library references accordingly or install with:

npm i @ethereumjs/block

TypeScript/Library Import

This is the first TypeScript based release of the library, see PR #72. The import structure has slightly changed along:

TypeScript

import { BlockHeader } from 'ethereumjs-block'
import { Block } from 'ethereumjs-block'

JavaScript/Node.js

const BlockHeader = require('ethereumjs-block').BlockHeader
const Block = require('ethereumjs-block').Block

The library now also comes with a type declaration file distributed along with the package published.

Major Refactoring - Breaking Changes

This release is a major refactoring of the block library to simplify and strengthen its code base. Refactoring work has been done along PR #72 (Promises) and PR #883 (refactoring of API and internal code structure).

New Constructor Params

The way to instantiate a new BlockHeader or Block object has been completely reworked and is now more explicit, less error prone and produces more TypeScript friendly and readable code.

The old direct constructor usage is now discouraged in favor of different dedicated static factory methods to create new objects.

Breaking: While the main constructors can still be called, signatures changed significantly and your old new Block(...), new BlockHeader(...) instantiations won't work any more and needs to be updated.

BlockHeader Class

There are three new factory methods to create a new BlockHeader:

  1. Pass in a Header-attribute named dictionary to BlockHeader.fromHeaderData(headerData: HeaderData = {}, opts?: BlockOptions):
const headerData = {
  number: 15,
  parentHash: '0x6bfee7294bf44572b7266358e627f3c35105e1c3851f3de09e6d646f955725a7',
  difficulty: 131072,
  gasLimit: 8000000,
  timestamp: 1562422144,
}
const header = BlockHeader.fromHeaderData(headerData)
  1. Create a BlockHeader from an RLP-serialized header Buffer with BlockHeader.fromRLPSerializedHeader(serialized: Buffer, opts: BlockOptions).
const serialized = Buffer.from(
  'f901f7a06bfee7294bf44572b7266358e627f3c35105e1c3851f3de09e6d646f955725a7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830200000f837a120080845d20ab8080a00000000000000000000000000000000000000000000000000000000000000000880000000000000000',
  'hex'
)
const header = BlockHeader.fromRLPSerializedHeader(serialized)
  1. Create a BlockHeader from an array of Buffer values, you can do a first short roundtrip test with:
const valuesArray = header.raw()
BlockHeader.fromValuesArray(valuesArray)

Generally internal types representing block header values are now closer to their domain representation (number, difficulty, gasLimit) instead of having everthing represented as a Buffer.

Block Class

There are analog new static factories for the Block class:

  • Block.fromBlockData(blockData: BlockData = {}, opts?: BlockOptions)
  • Block.fromRLPSerializedBlock(serialized: Buffer, opts?: BlockOptions)
  • Block.fromValuesArray(values: BlockBuffer, opts?: BlockOptions)

Learn more about the full API in the docs.

Immutability

The returned block is now frozen and immutable. To work with a maliable block, copy it with const fakeBlock = Object.create(block).

Promise-based API

The API of this library is now completely promise-based and the old callback-style interface has been dropped.

This affects the following methods of the API now being defined as async and returning a Promise:

Header Class

  • BlockHeader.validate(blockchain: Blockchain, height?: BN): Promise<void>

Block Class

  • Block.genTxTrie(): Promise<void>
  • Block.validate(blockChain: Blockchain): Promise<void>
  • Block.validateUncles(blockchain: Blockchain): Promise<void>

Usage example:

try {
  await block.validate(blockchain)
  // Block validation has passed
} catch (err) {
  // handle errors appropriately
}

Header Validation Methods > Signature Changes

Breaking: The signatures of the following header validation methods have been updated to take a parentBlockHeader instead of a parentBlock input parameter for consistency and removing a circling dependency with Block:

  • BlockHeader.canonicalDifficulty(parentBlockHeader: BlockHeader): BN
  • BlockHeader.validateDifficulty(parentBlockHeader: BlockHeader): boolean
  • BlockHeader.validateGasLimit(parentBlockHeader: BlockHeader): boolean

On the Block library new corresponding methods have been added which both operate on a block instance and expect a parentBlock as an input parameter.

New Default Hardfork

Breaking: The default HF on the library has been updated from petersburg to istanbul, see PR #906. The HF setting is now automatically taken from the HF set for Common.DEAULT_HARDFORK, see PR #863.

Dual ES5 and ES2017 Builds

We significantly updated our internal tool and CI setup along the work on PR #913 with an update to ESLint from TSLint for code linting and formatting and the introduction of a new build setup.

Packages now target ES2017 for Node.js builds (the main entrypoint from package.json) and introduce a separate ES5 build distributed along using the browser directive as an entrypoint, see PR #921. This will result in performance benefits for Node.js consumers, see here for a releated discussion.

Other Changes

Features

  • Added Block.genesis() and BlockHeader.genesis() aliases to create a genesis block or header, PR #883
  • Added DAO hardfork support (check for extraData attribute if DAO HF is active), PR #843
  • Added the calcDifficultyFromHeader constructor option. If this BlockHeader is supplied, then the difficulty of the constructed BlockHeader will be set to the canonical difficulty (also if difficulty is set as parameter in the constructor). See #929

Changes and Refactoring

  • Added Node 10, 12 support, dropped Node 7 support, PR #72
  • Passing in a blockchain is now optional on Block.validate(), PR #883
  • Breaking: Block.validateTransactions(stringError: true) now returns a string[], PR #883
  • Breaking: Decoupling of the Block.serialize() and Block.raw() methods, Block.serialize() now always returns the RLP-encoded block (signature change!), Block.raw() always returns the pure Buffer array, PR #883
  • Breaking: Block.toJSON() now always returns the labeled JSON representation, removal of the labeled function parameter, PR #883
  • Updated merkle-patricia-tree dependency to v4, PR #787
  • Updated ethereumjs-util dependency to v7, PR #748
  • Removal of the async dependency, PR #72

CI and Testing

  • Browser test run on CI, PR #72
  • Karma browser test run config modernization and simplification PR #72
  • Updated test source files to TypeScript, PR #72

Bug Fixes

  • Signature fix for pre-homestead blocks, PR #67

2.2.2 - 2019-12-17

MuirGlacier support by updating to the new difficulty formula as stated in EIP-2384.

Please note that this release does not contain all the changes merged into master since the v2.2.0 release and only backports the difficulty formula adjustments to support MuirGlacier without having to go through migration to the v3.0.0 which contains breaking changes.

2.2.1 - 2019-11-14

Istanbul support by updating to the most recent ethereumjs-tx version v2.1.1.

Please note that this release does not contain all the changes merged into master since the v2.2.0 release and only backports the most recent ethereumjs-tx version to allow users to support Istanbul without having to go through migration to the v3.0.0 which contains breaking changes.

2.2.0 - 2019-02-06

Petersburg (aka constantinopleFix) as well as Goerli support/readiness by updating to a supporting ethereumjs-common version v1.1.0, PR #64

Other Changes:

  • Fixed package size issue by excluding tests and docs from being included in the package, PR #66
  • Error message fixes in index.js, PR #62
  • Replace uses of deprecated new Buffer with Buffer.from, PR #60
  • Remove ethereumjs-testing dependency (much smaller dev dependencies), PR #61

2.1.0 - 2018-10-19

  • Constantinople support, added difficulty bomb delay (EIP-1234), PR #54
  • Updated test data, added Constantinople tests, PR #56, #57
  • Added timestamp field to setGenesisParams(), PR #52

2.0.1 - 2018-08-08

  • Fixes BlockHeader.prototype.validate() bug, see PR #49

2.0.0 - 2018-06-25

This release introduces both support for different chains (mainnet, ropsten, ...) and hardforks up to the latest applied HF (byzantium). Parameters and genesis values are provided by the new ethereumjs-common library which also defines the set of supported chains and forks.

Changes in detail:

  • New initialization parameters opts.chain (default: mainnet) and opts.hardfork (default: null, block number-based behaviour), PR #44
  • Alternatively a Common class object can be provided directly with the opts.common parameter, see API docs
  • Correct block validation for all know hardforks, PR #47, if no hardfork is set validation logic is determined by block number in combination with the chain set
  • Genesis block initialization depending on the chain set (see ethereumjs-common for supported chains)
  • Extensive test additions to cover the newly introduced capabilities and changes
  • Fix default value for nonce (empty buffer -> <Buffer 00 00 00 00 00 00 00 00>), PR #42

1.7.1 - 2018-02-15

  • Fix browserify issue blocking updates for packages depending on ethereumjs-block library, PR #40
  • Updated ethereumjs/common dependency, PR #38

1.7.0 - 2017-10-11

  • Metro-Byzantium compatible
  • New difficulty formula (EIP 100)
  • Difficulty bomb delay (EIP 649)
  • Removed isHomestead, isHomesteadReprice from API methods

1.6.0 - 2017-07-12

  • Breakout header-from-rpc as separate module

1.5.1 - 2017-06-04

  • Dev dependency updates
  • BN for gas limit

Older releases: