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
I'd like to be able to set a Debugger on the EvalContext from public code.
Currently the only way to do this is to modify the code within eval.go somewhere around here: https://github.com/algorand/go-algorand/blob/master/data/transactions/logic/eval.go#L836
I'd like to be able to set the debugger somewhere through a public interface, probably at the Ledger level.
Why?
In AlgoJig I am creating a Ledger and evaluating txns against a predetermined ledger state. I have a nice feature that captures traces of all contract evaluations and stores them so that additional analysis can be performed. This allows the developer to step through the contracts line by line post execution (whether execution failed or not) and it also allows for producing code coverage reports for contracts by aggregating the outputs of all tests.
I have a POC of this feature but it relies on a manually edited version of go-algorand (i.e. a fork). This is not really practical for a public project.
The current DebuggerHook interface works perfectly well btw so far. I have been able to write a custom debugger for collecting all the necessary information that adheres to the existing interface. (But just to be clear, I am not talking about the WebDebuggerHook)
Solution
I suggest having a public setter for a debugger somewhere on the Ledger object or possibly an argument to StartEvaluator.
BTW AlgoJig does a bunch of things that neither Dryrun nor Simulate do so switching to those to get traces is not an option.
Dependencies
No.
Urgency
What can I say? It's not blocking anyone but it could dramatically improve the contract development & testing experience if this was available.
The text was updated successfully, but these errors were encountered:
I just came across #4438
It looks like BlockEvaluator.Tracer might actually be exactly what I am looking for! I'll try to play with this a bit and see if it meets my needs.
I finally had a chance to look into this. The EvalTracer interface does look useful but unfortunately at the moment it is of very limited use in external code because most of the EvalContext fields are private.
For example I'd like to use this AfterOpcode(cx *EvalContext, evalError error) to access and record the stack and scratch space usage after each opcode. But I can't do this because EvalContext.stack, . scratch etc are all private without accessors.
Is there any plans to make these public (and their dependents like stackValue)? I'd like to see pretty much every field of EvalContext made public so external developers can go crazy creating useful tracing tools.
Problem
I'd like to be able to set a Debugger on the
EvalContext
from public code.Currently the only way to do this is to modify the code within eval.go somewhere around here: https://github.com/algorand/go-algorand/blob/master/data/transactions/logic/eval.go#L836
I'd like to be able to set the debugger somewhere through a public interface, probably at the Ledger level.
Why?
In AlgoJig I am creating a Ledger and evaluating txns against a predetermined ledger state. I have a nice feature that captures traces of all contract evaluations and stores them so that additional analysis can be performed. This allows the developer to step through the contracts line by line post execution (whether execution failed or not) and it also allows for producing code coverage reports for contracts by aggregating the outputs of all tests.
I have a POC of this feature but it relies on a manually edited version of go-algorand (i.e. a fork). This is not really practical for a public project.
The current
DebuggerHook
interface works perfectly well btw so far. I have been able to write a custom debugger for collecting all the necessary information that adheres to the existing interface. (But just to be clear, I am not talking about theWebDebuggerHook
)Solution
I suggest having a public setter for a debugger somewhere on the Ledger object or possibly an argument to
StartEvaluator
.BTW AlgoJig does a bunch of things that neither Dryrun nor Simulate do so switching to those to get traces is not an option.
Dependencies
No.
Urgency
What can I say? It's not blocking anyone but it could dramatically improve the contract development & testing experience if this was available.
The text was updated successfully, but these errors were encountered: