Skip to content

Commit

Permalink
vm: update default vm sm to simple state manager
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrocheleau committed Aug 18, 2024
1 parent 4a8761a commit e3ea768
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
17 changes: 11 additions & 6 deletions packages/statemanager/src/simpleStateManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,18 @@ export class SimpleStateManager implements StateManagerInterface {
return copy
}

// State root functionality not implemented
getStateRoot(): Promise<Uint8Array> {
throw new Error('Method not implemented.')
}
setStateRoot(): Promise<void> {
throw new Error('Method not implemented.')
/**
* @deprecated This method is not used by the RPC State Manager and is a stub required by the State Manager interface
*/
getStateRoot = async () => {
return new Uint8Array(32)
}

/**
* @deprecated This method is not used by the RPC State Manager and is a stub required by the State Manager interface
*/
setStateRoot = async (_root: Uint8Array) => {}

hasStateRoot(): Promise<boolean> {
throw new Error('Method not implemented.')
}
Expand Down
5 changes: 2 additions & 3 deletions packages/vm/src/vm.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createBlockchain } from '@ethereumjs/blockchain'
import { Common, Mainnet } from '@ethereumjs/common'
import { createEVM, getActivePrecompiles } from '@ethereumjs/evm'
import { Caches, DefaultStateManager } from '@ethereumjs/statemanager'
import { SimpleStateManager } from '@ethereumjs/statemanager'
import {
Account,
Address,
Expand Down Expand Up @@ -82,8 +82,7 @@ export class VM {
}

if (opts.stateManager === undefined) {
opts.stateManager = new DefaultStateManager({
caches: new Caches(),
opts.stateManager = new SimpleStateManager({
common: opts.common,
})
}
Expand Down

0 comments on commit e3ea768

Please sign in to comment.