Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vm: update default vm sm to simple state manager #3604

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading