ethereumjs-monorepo
ethereumjs-monorepo copied to clipboard
VM: Support for better debugging and state manipulation
As a user, I need better support for debugging and state manipulation.
For vm.runCode
, I need the ability to:
- define initial stack values before the code runs
- define initial memory before the code runs
- define the program counter to start execution at a specific opcode
Also nice to have would be the ability to get information about memory reads or writes inside
step
events, this can be as simple as
memoryRead: { 'ptr': 2, 'len': 4 }
memoryWritten: { 'ptr': 5, 'len': 9 }
Another feature I thinking about is the ability to 'pause' and 'resume' an execution.
Question is do wan't something like a debugging options-object for these calls or just expand the previous optional arguments?
@holgerd77 @axic Would it make sense to extract runCode
to an EVM library which doesn't have many dependencies, but uses an API like EEI to access data? This could potentially go a long way towards supporting other VMs, mocking them or for debugging purposes.
On a first thought I would probably say: yes, circling in @cdetrio since this is pretty close related to a potential future eWASM kernel integration, also @vpulim.