Skip to content

@ethereumjs/statemanager v2.1.0

Compare
Choose a tag to compare
@holgerd77 holgerd77 released this 02 Nov 09:05
· 431 commits to master since this release
c6d8b39

New Diff-Based Code Cache

This release introduces a new code cache implementation, see PR #3022 and #3080. The new cache complements the expanded account and storage caches and now also tracks stored/deployed-code-changes along commits and reverts and so only keeps code in the cache which made it to the final state change.

The new cache is substantially more robust towards various type of revert-based attacks and grows a more-used cache over time, since never-applied values are consecutively sorted out.

Peformance Option to store Storage Keys with Prefix

This release introduces a new option prefixStorageTrieKeys which triggers the underlying trie to store storage key values with a prefix based on the account address, see PR #3023. This significantly increases performance for consecutive storage accesses for the same account on especially larger tries, since trie node accesses get noticeably faster when performed by the underlying key-value store since values are stored close to each other.

While this option is deactivated by default it is recommended for most use cases for it to be activated. Note that this option is not backwards-compatible with existing databases and therefore can't be used if access to existing DBs needs to be guaranteed.

Bugfixes

  • Fix for dumpStorage() for EthersStateManager, PR #3009

Other Changes

  • Allow for users to decide if to either downlevel (so: adopt them for a short-lived scenario) caches or not on shallowCopy() by adding a new downlevelCaches parameter (default: true), PR #3063
  • Return zero values for getProof() as 0x0, PR #3038
  • Deactivate storage/account caches for cache size 0, PR #3012