Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Re-add raw methods, accept leveldb in constructor, minor fixes #92

Merged
merged 3 commits into from
Jun 27, 2019

Conversation

s1na
Copy link
Contributor

@s1na s1na commented Jun 25, 2019

tl;dr Changes since the v3.0.0 release had introduced breaking changes (and bugs). This PR makes those changes backwards compatible, and fixes the bugs. ethereumjs-vm passes all tests without any modifications after integrating this PR.

The changes are:

  • Re-introduce getRaw, putRaw, delRaw methods (but mark them as deprecated)
  • Instead of a DB object, instantiate the trie via a leveldb object (like before). This necessitated some other changes in checkpointTrie and secureTrie.
  • Fixed a bug in CheckpointTrie._exitCpMode which passed the wrong object to WriteStream
  • The first two changes created a (difficult to track) bug: SecureTrie.copy would copy CheckpointTrie's scratch db and use that as the underlying database, which meant the actual state data wasn't available and this caused quite a few failures.

@coveralls
Copy link

coveralls commented Jun 25, 2019

Coverage Status

Coverage decreased (-0.6%) to 93.575% when pulling d2199a4 on db-methods into 4d918be on master.

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment to update, rest looks good.

src/baseTrie.js Show resolved Hide resolved
src/baseTrie.js Show resolved Hide resolved
Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, thanks for the update.

@s1na s1na merged commit 2685d67 into master Jun 27, 2019
@s1na s1na deleted the db-methods branch June 27, 2019 17:42
@holgerd77
Copy link
Member

@s1na Phew, I am just realizing while scimming through the merged PR history that doing releases on this library got completely lost. 😕 Last release (v3.0.0) was from January 2019.

Do you think it is still worth to do a pre-TypeScript v3.1.0 release or should we rather get the refactoring changes @ryanio is doing right now together and do a bigger v4.0.0 release? Any opinion or preference? Could we in that case branch off for such a release from this PR?

@s1na
Copy link
Contributor Author

s1na commented Mar 31, 2020

@holgerd77 that's not a bad idea actually. It seems this PR is backwards-compatible (this should be tested again though).

@ryanio ryanio mentioned this pull request Apr 17, 2020
@ryanio
Copy link
Contributor

ryanio commented Apr 17, 2020

I realized I removed the @deprecated getRaw/putRaw/delRaw methods during the refactor in #107, so just a note that they won't be included in v4.0.0. If there is a good reason for them to be included please let me know :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants