Skip to content

Commit

Permalink
Apply code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerd77 committed Sep 28, 2023
1 parent 29b3ac4 commit 4d48796
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/statemanager/src/stateManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,8 @@ export class DefaultStateManager implements EVMStateManagerInterface {
* Both adoptions can be deactivated by setting `downlevelCaches` to
* `false`.
*
* Cache values are generally not copied along.
* Cache values are generally not copied along regardless of the
* `downlevelCaches` setting.
*/
shallowCopy(downlevelCaches = true): DefaultStateManager {
const common = this.common.copy()
Expand Down
8 changes: 5 additions & 3 deletions packages/vm/src/vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,11 @@ export class VM {
*
* Note that the returned copy will share the same db as the original for the blockchain and the statemanager.
*
* Associated state and trie caches will be deleted and caches will be re-initialized for a more short-term
* focused usage, being less memory intense. To fine-tune this behavior (if the shallow copy has a longer life
* span e.g.) you can set the `downlevelCaches` option to `false`.
* Associated caches will be deleted and caches will be re-initialized for a more short-term focused
* usage, being less memory intense (the statemanager caches will switch to using an ORDERED_MAP cache
* datastructure more suitable for short-term usage, the trie node LRU cache will not be activated at all).
* To fine-tune this behavior (if the shallow-copy-returned object has a longer life span e.g.) you can set
* the `downlevelCaches` option to `false`.
*
* @param downlevelCaches Downlevel (so: adopted for short-term usage) associated state caches (default: true)
*/
Expand Down

0 comments on commit 4d48796

Please sign in to comment.