Commit 3c377a66 authored by yann300's avatar yann300

don't use checkpoint anymore

parent 45515594
...@@ -63,13 +63,7 @@ async getStateRoot (force: boolean = false): Promise<Buffer> { ...@@ -63,13 +63,7 @@ async getStateRoot (force: boolean = false): Promise<Buffer> {
// throw new Error('Cannot get state root with uncommitted checkpoints') // throw new Error('Cannot get state root with uncommitted checkpoints')
} }
/*
try {
await this._cache.flush() await this._cache.flush()
} catch (e) {
console.error(e)
}
*/
const stateRoot = this._trie.root const stateRoot = this._trie.root
return stateRoot return stateRoot
...@@ -152,7 +146,6 @@ export class ExecutionContext { ...@@ -152,7 +146,6 @@ export class ExecutionContext {
createVm (hardfork) { createVm (hardfork) {
const stateManager = new StateManagerCommonStorageDump() const stateManager = new StateManagerCommonStorageDump()
stateManager.checkpoint()
const common = new Common({ chain: 'mainnet', hardfork }) const common = new Common({ chain: 'mainnet', hardfork })
const vm = new VM({ const vm = new VM({
common, common,
...@@ -253,9 +246,11 @@ export class ExecutionContext { ...@@ -253,9 +246,11 @@ export class ExecutionContext {
if (!infoCb) infoCb = () => {} if (!infoCb) infoCb = () => {}
if (context === 'vm') { if (context === 'vm') {
this.executionContext = context this.executionContext = context
/*
this.vms[this.currentFork].stateManager.revert().then(() => { this.vms[this.currentFork].stateManager.revert().then(() => {
this.vms[this.currentFork].stateManager.checkpoint() this.vms[this.currentFork].stateManager.checkpoint()
}) })
*/
this.event.trigger('contextChanged', ['vm']) this.event.trigger('contextChanged', ['vm'])
return cb() return cb()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment