You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are currently able to simulate transaction using the web3 module in the mirror-node. However we does not track and set anywhere the logs from executions in the form of opcodes.
As first step we should create a new list in the ContractCallContext, which is a list of objects with the following fields:
pc — the current program counter of the transaction, which represents the location of the current opcode being executed. A register that keeps track of the address of the next instruction to be executed in a program.
op — the current being executed, such as PUSH1, ADD, or SWAP1. A code that represents a specific operation or instruction that a computer or processor can understand and execute.
gas — the amount of gas remaining in the transaction at the current step of execution.
gasCost — the amount of gas consumed by the current opcode being executed.
depth — the current depth of the call stack for the transaction, reflecting the number of active frames representing nested function calls.
stack — the contents of the EVM stack at the current step of the transaction's execution. The stack is a data structure used by the EVM to manage and manipulate data during the execution of opcodes
memory — the contents of the memory at the current step of execution. A temporary data storage location that is available to smart contracts during execution.
We can reuse most of the flow used for calls, but we'd have to have our own implementation of the tracePrecompileCall, which will happen when we implement OperationTracer interface. Then for the current stack we can get the opcode using currentFrame.getCurrentOperation().getOpcode() and push inside the list we previously created in the ContractCallContext.
For Hedera Precompiles is more complex, as this approach won't work. If they are not successfull, we will populate wrong opcodes, therefore we'd need to check the sidecars for their result and set the opreration as REVERT at the right moment, in order to simulate the transaction 100% correctly.
The text was updated successfully, but these errors were encountered:
We are currently able to simulate transaction using the web3 module in the mirror-node. However we does not track and set anywhere the logs from executions in the form of opcodes.
As first step we should create a new list in the
ContractCallContext
, which is a list of objects with the following fields:We can reuse most of the flow used for calls, but we'd have to have our own implementation of the
tracePrecompileCall
, which will happen when we implementOperationTracer
interface. Then for the current stack we can get the opcode usingcurrentFrame.getCurrentOperation().getOpcode()
and push inside the list we previously created in the ContractCallContext.For Hedera Precompiles is more complex, as this approach won't work. If they are not successfull, we will populate wrong opcodes, therefore we'd need to check the sidecars for their result and set the opreration as
REVERT
at the right moment, in order to simulate the transaction 100% correctly.The text was updated successfully, but these errors were encountered: