algorand / go-algorand

Algorand's official implementation in Go.
https://developer.algorand.org/
Other
1.35k stars 473 forks source link

[Investigate] tealdbg --- infinite loop on ApplicationCreate txn followed by UpdateApplication #1572

Closed jeapostrophe closed 4 years ago

jeapostrophe commented 4 years ago

I ran tealdbg last night and sent an application create txn. I visited the debugged once and everything worked but then the debugger was stuck afterwards printing out this infinitely:

2020/09/29 22:56:54 Unk event:
2020/09/29 22:56:54 received:
2020/09/29 22:56:54 Unk event:
2020/09/29 22:56:54 received:
2020/09/29 22:56:54 Unk event:
2020/09/29 22:56:54 received:
2020/09/29 22:56:54 received:
2020/09/29 22:56:54 Unk event:
2020/09/29 22:56:54 received:
2020/09/29 22:56:54 Unk event:
2020/09/29 22:56:54 received:
2020/09/29 22:56:54 Unk event:
2020/09/29 22:56:54 received:
2020/09/29 22:56:54 Unk event:
2020/09/29 22:56:54 received:

I can't tell if the loop was caused by trying to debug one txn and then another or if the details of these transactions are the culprit.

Here's a base64 of the first:

gqNzaWfEQNhgeG0mIkWrjmD5tbT3NqA60Tw9OLsboq8N3tpDvgdf7PPlGNbJl0ujI0pxuRP9zWPDVvljtqLOYauzr+B9dgmjdHhuiqRhcGFwxHYCIAQGAQQAJgQgVE3wvgdX/7tSvMjybL4oBxh/ClaFaraPtw9YjnhENsoBcwFsAWgxECISQQA7MSAyAxJBADMyBCMSQQAsMQAoEkEAJTE
YQQAWMRkkEkEAGSklFgJnKjIGZyslZ0IADDEZJRJBAANCAAIlQyNDpGFwZ3OCo25icwGjbnVpAqRhcHN1xB4CIAIBACYBAWgyBCISQQAKKGQiEkEAA0IAAiNDIkOjZmVlzQPoomZ2CKNnZW6pZGV2bmV0LXYxomdoxCBVMFHLovFADLo6Guk6UW425uH8TwyQ4qA2la2lPx+nAKJsds0D8KNzbmTEIFRN8L4HV/+7UrzI8
my+KAcYfwpWhWq2j7cPWI54RDbKpHR5cGWkYXBwbA=

and a base64 of the second:

gqNzaWfEQE0DDoMswTrjtF67H1DaRlOvS1Phlp8Ndy03kUFU4ha8zkaZ119Ozeu4Fycxkn2lJDGI/oOGU3puPo6WlAHG5gijdHhui6RhcGFuBKRhcGFwxPYCIAUGAAQFASYGAWggiHjHOAFtMBjRU1z2Wwl2oJPjGA3s54HTbaShw0NACQEgXH2Od3sLB93u41VyvD//xE0yHH4GvUUrfhF
I36S/VIkgrXPNG2q8uJ6PA5Ok8ojsHSUgZK2sbvMMRhGkezTBDMkBcwFsMRAiEkEAdzEgMgMSQQBvKGRAAFgxGSMSQQBjMgQkD0EAXDEWIxJBAFUjMwEAKRIRMwEAKhIRMwEAKxIRQQA/JwRkNwEwABJBADQnBWQ3ATADFxJBACgnBDcBMAFnJwUyBmcoNwEwAhdnQgAUMRklEkEACzIEIQQSQQADQgACI0MhBEOkYXBpZ
AOkYXBzdcQeAiACAQAmAQFoMgQiEkEACihkIhJBAANCAAIjQyJDo2ZlZc0D6KJmdgqjZ2VuqWRldm5ldC12MaJnaMQgVTBRy6LxQAy6OhrpOlFuNubh/E8MkOKgNpWtpT8fpwCibHbNA/Kjc25kxCBUTfC+B1f/u1K8yPJsvigHGH8KVoVqto+3D1iOeEQ2yqR0eXBlpGFwcGw=

I don't have a good way of just testing these because I don't have a way of exporting the state from the running algod (i.e. they reference application and accounts).

algorandskiy commented 4 years ago

if you have txn object, you can create a dryrun request object with something like this:

goal clerk dryrun -t signout.stxn --dryrun-dump  -o dr.msgp

where signout.stxn is a signed (or not) txn or group.

algorandskiy commented 4 years ago

Plus, what version of Chrome do you use?

jeapostrophe commented 4 years ago

goal is not helpful here, because I exclusively use the JS SDK to generate transactions, since I am writing an interactive DApp, and not a terminal script.

This was on Version 85.0.4183.121 (Official Build) (64-bit)

algorandskiy commented 4 years ago

How did you run the debugger? Command line example would be great. Were both txn in the same txn group? In the code, this loop can happen when CDT adapter (listens for event from the evaluator) is alive but the debugging core (runs eval and dispatches events from it) quited.

jeapostrophe commented 4 years ago

I ran the debugger by running tealdbg, then submitted the txns in sequence in different groups with the JS SDK.

I am no longer relying on the debugger, because I just made my own simple thing that logs all of the requests and I just read the JSON directly. My fake server is this --- https://github.com/reach-sh/reach-lang/blob/master/scripts/algorand-devnet/server.rkt --- and I start it like this --- https://github.com/reach-sh/reach-lang/blob/master/scripts/algorand-devnet/start.sh#L13-L19

ian-algorand commented 4 years ago

@algorandskiy can you take another look at this issue? If you can't reproduce, let's close for now. Otherwise, we can mark it as a TEAL bug that we can prioritize. @jeapostrophe let us know if you have any additional information that would be helpful in replicating this issue. Thanks to you both.

jeapostrophe commented 4 years ago

I can't replicate it. I'm happy closing this and I'll reopen if I hit it again.