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.
This release comes with a reworked checkpointing mechanism (PR #1030 and subsequently PR #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.
Another performance related bug has been fixed along PR #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.
Other changes:
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
- Better
Trie
code documentation, PR #125 - Internal
Trie
function reordering & partial retwrite, PR #125 - Added simple integrated profiling, PR #128
- Reworked benchmarking to be based on
benchmark.js
, basic CI integration, PR #130 - Upgrade to
ethereumjs-config
2.0
libs for linting and formatting, PR #133 - Switched coverage from
coverall
tocodecov
, PR #137
4.0.0 - 2020-04-17
This release introduces a major API upgrade from callbacks to Promises.
Example using async/await syntax:
import { BaseTrie as Trie } from 'merkle-patricia-tree'
const trie = new Trie()
async function test() {
await trie.put(Buffer.from('test'), Buffer.from('one'))
const value = await trie.get(Buffer.from('test'))
console.log(value.toString()) // 'one'
}
test()
See the docs for the latest Promise-based method signatures.
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.
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.
SecureTrie.copy
now includes checkpoint metadata by default. To maintain original behavior of not copying checkpoint state, pass false
to param includeCheckpoints
.
- Convert trieNode to ES6 class (#71)
- Merge checkpoint and secure interface with their ES6 classes (#73)
- Extract db-related methods from baseTrie (#74)
- _lookupNode callback to use standard error, response pattern (#83)
- Accept leveldb in constructor, minor fixes (#92)
- Refactor TrieNode, add levelup types (#98)
- Promisify rest of library (#107)
- Use
Nibbles
type fornumber[]
(#115) - Upgrade ethereumjs-util to 7.0.0 / Upgrade level-mem to 5.0.1 (#116)
- Create dual ES5 and ES2017 builds (#117)
- Include checkpoints by default in SecureTrie.copy (#119)
- Rename Trie.prove to Trie.createProof (#122)
- Support for proofs of null/absence. Dried up prove/verify. (#82)
- Add more Ethereum state DB focused example accessing account values (#89)
- Drop ethereumjs-testing dep and fix bug in branch value update (#69)
- Fix prove and verifyProof in SecureTrie (#79)
- Fixed src code links in docs (#93)
- Update tape to v4.10.1 (#81)
- Org links and git hooks (#87)
- Use module.exports syntax in util files (#90)
- Rename deprecated sha3 consts and func to keccak256 (#91)
- Migrate to Typescript (#96)
- Fix Travis's xvfb service (#97)
- Fix test cases and docs (#104)
- Upgrade CI Provider from Travis to GH Actions (#105)
- Upgrade test suite to TS (#106)
- Better document
_formatNode
(#109) - Move
failingRefactorTests
tosecure.spec.ts
(#110) - Fix test suite typos (#114)
3.0.0 - 2019-01-03
This release comes along with some major version bump of the underlying level
database storage backend. If you have the library deeper integrated in one of
your projects make sure that the new DB version plays well with the rest of the
code.
The release also introduces modern ES6
JavaScript for the library (thanks @alextsg)
switching to ES6
classes and clean inheritance on all the modules.
- Replace
levelup
1.2.1 +memdown
1.0.0 withlevel-mem
3.0.1 and upgradelevel-ws
to 1.0.0, PR #56 - Support for
ES6
classes, PRs #57, #61 - Updated
async
andreadable-stream
dependencies (resulting in smaller browser builds), PR #60 - Updated, automated and cleaned up API documentation build, PR #63
2.3.2 - 2018-09-24
- Fixed a bug in verify proof if the tree contains an extension node with an embedded branch node, PR #51
- Fixed
_scratch
'leak' to global/window, PR #42 - Fixed coverage report leaving certain tests, PR #53
2.3.1 - 2018-03-14
- Fix OutOfMemory bug when trying to create a read stream on large trie structures (e.g. a current state DB from a Geth node), PR #38
- Fix race condition due to mutated
_getDBs
/_putDBs
, PR #28
2.3.0 - 2017-11-30
- Methods for merkle proof generation
Trie.prove()
and verificationTrie.verifyProof()
(see ./proof.js)
2.2.0 - 2017-08-03
- Renamed
root
functions argument tonodeRef
for passing a node reference - Make
findPath()
(path to node for given key) a public method
2.1.2 - 2016-03-01
- Added benchmark (see ./benchmarks/)
- Updated dependencies
2.1.1 - 2016-01-06
- Added README, API documentation
- Dependency updates
2.0.3 - 2015-09-24
- Initial, first of the currently released version on npm