|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project will be documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) |
| 6 | +(modification: no type change headlines) and this project adheres to |
| 7 | +[Semantic Versioning](http://semver.org/spec/v2.0.0.html). |
| 8 | + |
| 9 | +## UNRELEASED |
| 10 | + |
| 11 | +## New features |
| 12 | + |
| 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) |
| 14 | + |
| 15 | +## [4.0.0] - 2020-04-17 |
| 16 | + |
| 17 | +This release introduces a major API upgrade from callbacks to Promises. |
| 18 | + |
| 19 | +Example using async/await syntax: |
| 20 | + |
| 21 | +```typescript |
| 22 | +import { BaseTrie as Trie } from 'merkle-patricia-tree' |
| 23 | +const trie = new Trie() |
| 24 | +async function test() { |
| 25 | + await trie.put(Buffer.from('test'), Buffer.from('one')) |
| 26 | + const value = await trie.get(Buffer.from('test')) |
| 27 | + console.log(value.toString()) // 'one' |
| 28 | +} |
| 29 | +test() |
| 30 | +``` |
| 31 | + |
| 32 | +### Breaking Changes |
| 33 | + |
| 34 | +#### Trie methods |
| 35 | + |
| 36 | +See the [docs](https://github.com/ethereumjs/merkle-patricia-tree/tree/master/docs) for the latest Promise-based method signatures. |
| 37 | + |
| 38 | +#### Trie.prove renamed to Trie.createProof |
| 39 | + |
| 40 | +To clarify the method's purpose `Trie.prove` has been renamed to `Trie.createProof`. `Trie.prove` has been deprecated but will remain as an alias for `Trie.createProof` until removed. |
| 41 | + |
| 42 | +#### Trie raw methods |
| 43 | + |
| 44 | +`getRaw`, `putRaw` and `delRaw` were deprecated in `v3.0.0` and have been removed from this release. Instead, please use `trie.db.get`, `trie.db.put`, and `trie.db.del`. If using a `SecureTrie` or `CheckpointTrie`, use `trie._maindb` to override the checkpointing mechanism and interact directly with the db. |
| 45 | + |
| 46 | +#### SecureTrie.copy |
| 47 | + |
| 48 | +`SecureTrie.copy` now includes checkpoint metadata by default. To maintain original behavior of _not_ copying checkpoint state, pass `false` to param `includeCheckpoints`. |
| 49 | + |
| 50 | +### Changed |
| 51 | + |
| 52 | +- Convert trieNode to ES6 class ([#71](https://github.com/ethereumjs/merkle-patricia-tree/pull/71)) |
| 53 | +- Merge checkpoint and secure interface with their ES6 classes ([#73](https://github.com/ethereumjs/merkle-patricia-tree/pull/73)) |
| 54 | +- Extract db-related methods from baseTrie ([#74](https://github.com/ethereumjs/merkle-patricia-tree/pull/74)) |
| 55 | +- \_lookupNode callback to use standard error, response pattern ([#83](https://github.com/ethereumjs/merkle-patricia-tree/pull/83)) |
| 56 | +- Accept leveldb in constructor, minor fixes ([#92](https://github.com/ethereumjs/merkle-patricia-tree/pull/92)) |
| 57 | +- Refactor TrieNode, add levelup types ([#98](https://github.com/ethereumjs/merkle-patricia-tree/pull/98)) |
| 58 | +- Promisify rest of library ([#107](https://github.com/ethereumjs/merkle-patricia-tree/pull/107)) |
| 59 | +- Use `Nibbles` type for `number[]` ([#115](https://github.com/ethereumjs/merkle-patricia-tree/pull/115)) |
| 60 | +- Upgrade ethereumjs-util to 7.0.0 / Upgrade level-mem to 5.0.1 ([#116](https://github.com/ethereumjs/merkle-patricia-tree/pull/116)) |
| 61 | +- Create dual ES5 and ES2017 builds ([#117](https://github.com/ethereumjs/merkle-patricia-tree/pull/117)) |
| 62 | +- Include checkpoints by default in SecureTrie.copy ([#119](https://github.com/ethereumjs/merkle-patricia-tree/pull/119)) |
| 63 | +- Rename Trie.prove to Trie.createProof ([#122](https://github.com/ethereumjs/merkle-patricia-tree/pull/122)) |
| 64 | + |
| 65 | +### Added |
| 66 | + |
| 67 | +- Support for proofs of null/absence. Dried up prove/verify. ([#82](https://github.com/ethereumjs/merkle-patricia-tree/pull/82)) |
| 68 | +- Add more Ethereum state DB focused example accessing account values ([#89](https://github.com/ethereumjs/merkle-patricia-tree/pull/89)) |
| 69 | + |
| 70 | +### Fixed |
| 71 | + |
| 72 | +- Drop ethereumjs-testing dep and fix bug in branch value update ([#69](https://github.com/ethereumjs/merkle-patricia-tree/pull/69)) |
| 73 | +- Fix prove and verifyProof in SecureTrie ([#79](https://github.com/ethereumjs/merkle-patricia-tree/pull/79)) |
| 74 | +- Fixed src code links in docs ([#93](https://github.com/ethereumjs/merkle-patricia-tree/pull/93)) |
| 75 | + |
| 76 | +### Dev / Testing / CI |
| 77 | + |
| 78 | +- Update tape to v4.10.1 ([#81](https://github.com/ethereumjs/merkle-patricia-tree/pull/81)) |
| 79 | +- Org links and git hooks ([#87](https://github.com/ethereumjs/merkle-patricia-tree/pull/87)) |
| 80 | +- Use module.exports syntax in util files ([#90](https://github.com/ethereumjs/merkle-patricia-tree/pull/90)) |
| 81 | +- Rename deprecated sha3 consts and func to keccak256 ([#91](https://github.com/ethereumjs/merkle-patricia-tree/pull/91)) |
| 82 | +- Migrate to Typescript ([#96](https://github.com/ethereumjs/merkle-patricia-tree/pull/96)) |
| 83 | +- Fix Travis's xvfb service ([#97](https://github.com/ethereumjs/merkle-patricia-tree/pull/97)) |
| 84 | +- Fix test cases and docs ([#104](https://github.com/ethereumjs/merkle-patricia-tree/pull/104)) |
| 85 | +- Upgrade CI Provider from Travis to GH Actions ([#105](https://github.com/ethereumjs/merkle-patricia-tree/pull/105)) |
| 86 | +- Upgrade test suite to TS ([#106](https://github.com/ethereumjs/merkle-patricia-tree/pull/106)) |
| 87 | +- Better document `_formatNode` ([#109](https://github.com/ethereumjs/merkle-patricia-tree/pull/109)) |
| 88 | +- Move `failingRefactorTests` to `secure.spec.ts` ([#110](https://github.com/ethereumjs/merkle-patricia-tree/pull/110)) |
| 89 | +- Fix test suite typos ([#114](https://github.com/ethereumjs/merkle-patricia-tree/pull/110)) |
| 90 | + |
| 91 | +[4.0.0]: https://github.com/ethereumjs/merkle-patricia-tree/compare/v3.0.0...v4.0.0 |
| 92 | + |
| 93 | +## [3.0.0] - 2019-01-03 |
| 94 | + |
| 95 | +This release comes along with some major version bump of the underlying `level` |
| 96 | +database storage backend. If you have the library deeper integrated in one of |
| 97 | +your projects make sure that the new DB version plays well with the rest of the |
| 98 | +code. |
| 99 | + |
| 100 | +The release also introduces modern `ES6` JavaScript for the library (thanks @alextsg) |
| 101 | +switching to `ES6` classes and clean inheritance on all the modules. |
| 102 | + |
| 103 | +- Replace `levelup` 1.2.1 + `memdown` 1.0.0 with `level-mem` 3.0.1 and upgrade `level-ws` to 1.0.0, PR [#56](https://github.com/ethereumjs/merkle-patricia-tree/pull/56) |
| 104 | +- Support for `ES6` classes, PRs [#57](https://github.com/ethereumjs/merkle-patricia-tree/pull/57), [#61](https://github.com/ethereumjs/merkle-patricia-tree/pull/61) |
| 105 | +- Updated `async` and `readable-stream` dependencies (resulting in smaller browser builds), PR [#60](https://github.com/ethereumjs/merkle-patricia-tree/pull/60) |
| 106 | +- Updated, automated and cleaned up [API documentation](https://github.com/ethereumjs/merkle-patricia-tree/blob/master/docs/index.md) build, PR [#63](https://github.com/ethereumjs/merkle-patricia-tree/pull/63) |
| 107 | + |
| 108 | +[3.0.0]: https://github.com/ethereumjs/merkle-patricia-tree/compare/v2.3.2...v3.0.0 |
| 109 | + |
| 110 | +## [2.3.2] - 2018-09-24 |
| 111 | + |
| 112 | +- Fixed a bug in verify proof if the tree contains an extension node with an embedded branch node, PR [#51](https://github.com/ethereumjs/merkle-patricia-tree/pull/51) |
| 113 | +- Fixed `_scratch` 'leak' to global/window, PR [#42](https://github.com/ethereumjs/merkle-patricia-tree/pull/42) |
| 114 | +- Fixed coverage report leaving certain tests, PR [#53](https://github.com/ethereumjs/merkle-patricia-tree/pull/53) |
| 115 | + |
| 116 | +[2.3.2]: https://github.com/ethereumjs/merkle-patricia-tree/compare/v2.3.1...v2.3.2 |
| 117 | + |
| 118 | +## [2.3.1] - 2018-03-14 |
| 119 | + |
| 120 | +- Fix OutOfMemory bug when trying to create a read stream on large trie structures |
| 121 | + (e.g. a current state DB from a Geth node), PR [#38](https://github.com/ethereumjs/merkle-patricia-tree/pull/38) |
| 122 | +- Fix race condition due to mutated `_getDBs`/`_putDBs`, PR [#28](https://github.com/ethereumjs/merkle-patricia-tree/pull/28) |
| 123 | + |
| 124 | +[2.3.1]: https://github.com/ethereumjs/merkle-patricia-tree/compare/v2.3.0...v2.3.1 |
| 125 | + |
| 126 | +## [2.3.0] - 2017-11-30 |
| 127 | + |
| 128 | +- Methods for merkle proof generation `Trie.prove()` and verification `Trie.verifyProof()` (see [./proof.js](./proof.js)) |
| 129 | + |
| 130 | +[2.3.0]: https://github.com/ethereumjs/merkle-patricia-tree/compare/v2.2.0...v2.3.0 |
| 131 | + |
| 132 | +## [2.2.0] - 2017-08-03 |
| 133 | + |
| 134 | +- Renamed `root` functions argument to `nodeRef` for passing a node reference |
| 135 | +- Make `findPath()` (path to node for given key) a public method |
| 136 | + |
| 137 | +[2.2.0]: https://github.com/ethereumjs/merkle-patricia-tree/compare/v2.1.2...v2.2.0 |
| 138 | + |
| 139 | +## [2.1.2] - 2016-03-01 |
| 140 | + |
| 141 | +- Added benchmark (see [./benchmarks/](./benchmarks/)) |
| 142 | +- Updated dependencies |
| 143 | + |
| 144 | +[2.1.2]: https://github.com/ethereumjs/merkle-patricia-tree/compare/v2.1.1...v2.1.2 |
| 145 | + |
| 146 | +## [2.1.1] - 2016-01-06 |
| 147 | + |
| 148 | +- Added README, API documentation |
| 149 | +- Dependency updates |
| 150 | + |
| 151 | +[2.1.1]: https://github.com/ethereumjs/merkle-patricia-tree/compare/2.0.3...v2.1.1 |
| 152 | + |
| 153 | +## [2.0.3] - 2015-09-24 |
| 154 | + |
| 155 | +- Initial, first of the currently released version on npm |
| 156 | + |
| 157 | +[2.0.3]: https://github.com/ethereumjs/merkle-patricia-tree/compare/1.1.x...2.0.3 |
0 commit comments