|
|
@ -43,7 +43,8 @@ export class VmProxy { |
|
|
|
txsMapBlock |
|
|
|
txsMapBlock |
|
|
|
blocks |
|
|
|
blocks |
|
|
|
stateCopy: StateManager |
|
|
|
stateCopy: StateManager |
|
|
|
|
|
|
|
flagDoNotRecordEVMSteps: boolean |
|
|
|
|
|
|
|
|
|
|
|
constructor (vmContext: VMContext) { |
|
|
|
constructor (vmContext: VMContext) { |
|
|
|
this.vmContext = vmContext |
|
|
|
this.vmContext = vmContext |
|
|
|
this.stateCopy |
|
|
|
this.stateCopy |
|
|
@ -109,7 +110,12 @@ export class VmProxy { |
|
|
|
return ret |
|
|
|
return ret |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flagNextAsDoNotRecordEvmSteps () { |
|
|
|
|
|
|
|
this.flagDoNotRecordEVMSteps = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async txWillProcess (data: TypedTransaction) { |
|
|
|
async txWillProcess (data: TypedTransaction) { |
|
|
|
|
|
|
|
if (this.flagDoNotRecordEVMSteps) return |
|
|
|
this.stateCopy = await this.vm.stateManager.copy() |
|
|
|
this.stateCopy = await this.vm.stateManager.copy() |
|
|
|
this.incr++ |
|
|
|
this.incr++ |
|
|
|
this.processingHash = bufferToHex(data.hash()) |
|
|
|
this.processingHash = bufferToHex(data.hash()) |
|
|
@ -148,6 +154,10 @@ export class VmProxy { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async txProcessed (data: AfterTxEvent) { |
|
|
|
async txProcessed (data: AfterTxEvent) { |
|
|
|
|
|
|
|
if (this.flagDoNotRecordEVMSteps) { |
|
|
|
|
|
|
|
this.flagDoNotRecordEVMSteps = false |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
const lastOp = this.vmTraces[this.processingHash].structLogs[this.processingIndex - 1] |
|
|
|
const lastOp = this.vmTraces[this.processingHash].structLogs[this.processingIndex - 1] |
|
|
|
if (lastOp) { |
|
|
|
if (lastOp) { |
|
|
|
lastOp.error = lastOp.op !== 'RETURN' && lastOp.op !== 'STOP' && lastOp.op !== 'DESTRUCT' |
|
|
|
lastOp.error = lastOp.op !== 'RETURN' && lastOp.op !== 'STOP' && lastOp.op !== 'DESTRUCT' |
|
|
@ -205,6 +215,7 @@ export class VmProxy { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async pushTrace (data: InterpreterStep) { |
|
|
|
async pushTrace (data: InterpreterStep) { |
|
|
|
|
|
|
|
if (this.flagDoNotRecordEVMSteps) return |
|
|
|
try { |
|
|
|
try { |
|
|
|
const depth = data.depth + 1 // geth starts the depth from 1
|
|
|
|
const depth = data.depth + 1 // geth starts the depth from 1
|
|
|
|
if (!this.processingHash) { |
|
|
|
if (!this.processingHash) { |
|
|
|