algorand / algorand/go-algorand

Improve dryrun/TEAL debugger

Abierto
#2,637 1 comentario 0 reacciones 1 asignado Reclamado por @algoanne Ver en GitHub
new-feature-request Team Scytale
Lenguaje dominante
Go
Estrellas
1.4k
Forks
537
Merge medio
1 d 7 h
PR fusionados (30 d)
18

Descripción

## Problem

To the best of my knowledge, the dryrun endpoint and tealdbg program do not share the same underlying logic for evaluating transactions. This results in different TEAL features being supported by each debug tool. Additionally, transaction groups are currently being evaluated in a way that does not reflect the real-life evaluation behavior. Some examples of this are: [foreign apps/assets](#2609), creatable IDs, apps which access global state mutated in the first transaction from within the second transaction, and many more. This is because, in the case of the dryrun endpoint, transactions are evaluated using only a subset of all the evaluation systems.

And while rewriting the debugger logic to fix the problems above, it would be nice if dryrun requests default to using actual data found on the chain when an execution environment has not been given. This issue of using actual data was tracked previously by #2520.

In theory, these changes should be able to be made in a way which preserves backwards compatibility. Dryrun environments that explicitly set apps, assets, and balances should still work exactly as before. The only case in which code that previously worked will stop working is if that code had a bug which had not been caught yet, or perhaps had a program that assumed incorrectly about the nature of how applied data works between transactions in a group.

## Solution

There are three main steps in improving the dryrun/tealdbg tools:

1. Consolidate dryrun/debugger logic into a single location/package.
2. Use the real transaction evaluation system (`ledger/eval.go` plus logicsig logic) instead of how the dryrun request currently works.
3. Default to using live data from the chain when running dryrun/debug requests _unless_ overwritten by a provided environment.

## Dependencies

None.

## Urgency

Providing improved debugging tools will be invaluable as people start writing more complex apps with the AVM 1.0 release.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.