Skip to content

Commit 9dfc747

Browse files
authored
Merge pull request #1108 from ethereumjs/new-mpt-release
MPT: New Release v4.1.0
2 parents 5fb23ad + 830c9d0 commit 9dfc747

File tree

7 files changed

+32
-12
lines changed

7 files changed

+32
-12
lines changed

packages/block/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"homepage": "https://github.com/ethereumjs/ethereumjs-vm/tree/master/packages/block#readme",
4141
"dependencies": {
4242
"@ethereumjs/common": "^2.0.0",
43-
"merkle-patricia-tree": "^4.0.0",
43+
"merkle-patricia-tree": "^4.1.0",
4444
"@ethereumjs/tx": "^3.0.2",
4545
"@types/bn.js": "^4.11.6",
4646
"ethereumjs-util": "^7.0.8"

packages/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"@ethereumjs/blockchain": "^5.0.0",
5656
"@ethereumjs/common": "^2.0.0",
5757
"@ethereumjs/devp2p": "^3.0.3",
58-
"merkle-patricia-tree": "^4.0.0",
58+
"merkle-patricia-tree": "^4.1.0",
5959
"@ethereumjs/vm": "^5.0.0",
6060
"chalk": "^2.4.2",
6161
"ethereumjs-util": "^7.0.8",

packages/trie/CHANGELOG.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
(modification: no type change headlines) and this project adheres to
77
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
88

9-
## UNRELEASED
9+
## 4.1.0 - 2021-02-16
1010

11-
## New features
11+
This release comes with a reworked checkpointing mechanism (PR [#1030](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1030) and subsequently PR [#1035](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1035)). Instead of copying over the whole DB on checkpoints the operations in between checkpoints are now recorded in memory and either applied in batch on a `Trie.checkpoint()` call or discarded along a `Trie.revert()`. This more fine-grained operational mode leads to a substantial performance gain (up to 50x) when working with larger tries.
1212

13-
There is a new exported `WalkController` class. Also, `trie.walkTrie()` is now a public method. Using the `WalkController`, one can create own custom ways to traverse the trie. [#135](https://github.com/ethereumjs/merkle-patricia-tree/pull/135)
13+
Another performance related bug has been fixed along PR [#127](https://github.com/ethereumjs/merkle-patricia-tree/pull/127) removing an unnecessary double-serialization call on nodes. This gives a general performance gain of 10-20% on putting new values in a trie.
14+
15+
Other changes:
16+
17+
## New Features
18+
19+
A new exported `WalkController` class has been added and `trie.walkTrie()` has been made a public method along. This allows for creating own custom ways to traverse a trie. PR [#135](https://github.com/ethereumjs/merkle-patricia-tree/pull/135)
20+
21+
### Refactoring, Development and Documentation
22+
23+
- Better `Trie` code documentation, PR [#125](https://github.com/ethereumjs/merkle-patricia-tree/pull/125)
24+
- Internal `Trie` function reordering & partial retwrite, PR [#125](https://github.com/ethereumjs/merkle-patricia-tree/pull/125)
25+
- Added simple integrated profiling, PR [#128](https://github.com/ethereumjs/merkle-patricia-tree/pull/128)
26+
- Reworked benchmarking to be based on `benchmark.js`, basic CI integration, PR [#130](https://github.com/ethereumjs/merkle-patricia-tree/pull/130)
27+
- Upgrade to `ethereumjs-config` `2.0` libs for linting and formatting, PR [#133](https://github.com/ethereumjs/merkle-patricia-tree/pull/133)
28+
- Switched coverage from `coverall` to `codecov`, PR [#137](https://github.com/ethereumjs/merkle-patricia-tree/pull/137)
1429

1530
## [4.0.0] - 2020-04-17
1631

packages/trie/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ This is an implementation of the modified merkle patricia tree as specified in t
1212
1313
The only backing store supported is LevelDB through the `levelup` module.
1414

15-
Note: this `README` reflects the state of the library from `v5.0.0` (UNRELEASED) onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/merkle-patricia-tree) for an introduction on the last preceeding release.
16-
1715
# INSTALL
1816

1917
`npm install merkle-patricia-tree`

packages/trie/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "merkle-patricia-tree",
3-
"version": "4.0.0",
3+
"version": "4.1.0",
44
"description": "This is an implementation of the modified merkle patricia tree as specified in Ethereum's yellow paper.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

packages/trie/src/baseTrie.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,28 @@ export class Trie {
5858
this.db = db ? new DB(db) : new DB()
5959
this._root = this.EMPTY_TRIE_ROOT
6060
if (root) {
61-
this._setRoot(root)
61+
this.setRoot(root)
6262
}
6363
}
6464

6565
/** Sets the current root of the `trie` */
6666
set root(value: Buffer) {
67-
this._setRoot(value)
67+
this.setRoot(value)
6868
}
6969

7070
/** Gets the current root of the `trie` */
7171
get root(): Buffer {
7272
return this._root
7373
}
7474

75-
_setRoot(value?: Buffer) {
75+
/**
76+
* This method is deprecated.
77+
* Please use `Trie.root(value)` instead.
78+
*
79+
* @param value
80+
* @deprecated
81+
*/
82+
setRoot(value?: Buffer) {
7683
if (!value) {
7784
value = this.EMPTY_TRIE_ROOT
7885
}

packages/vm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@ethereumjs/block": "^3.0.0",
4747
"@ethereumjs/blockchain": "^5.0.0",
4848
"@ethereumjs/common": "^2.0.0",
49-
"merkle-patricia-tree": "^4.0.0",
49+
"merkle-patricia-tree": "^4.1.0",
5050
"@ethereumjs/tx": "^3.0.2",
5151
"async-eventemitter": "^0.2.4",
5252
"core-js-pure": "^3.0.1",

0 commit comments

Comments
 (0)