Teal version 3.
There are 5 transactions grouped together:
Both stateful and stateless compiled fine, but whenever signed grouped txn is sent to the network:
cat signout-0.tx signout-1.tx signout-2.tx signout-3.tx signout-4.tx > signout.tx
goal clerk rawsend -f signout.tx
getting the whole log of transactions and error, which says:
rejected by logic err=stack underflow in &&
Then I run debugger:
goal clerk dryrun -t signout.tx --dryrun-dump -o dr.msgp
tealdbg debug --remote-debugging-port 1234 stateful.teal -d dr.msgp --group-index 0 &
socat tcp-listen:9392,reuseaddr,fork tcp:localhost:1234
2021/05/18 14:08:03 Using proto: https://github.com/algorandfoundation/specs/tree/d050b3cade6d5c664df8bd729bf219f179812595
2021/05/18 14:08:03 Run mode: stateful
2021/05/18 14:08:03 Debug error: all 1 program(s) failed in less than a second, invocation error?
to dive into the problem, I reduced the number of txs to 3. So, I changed the approval program in stateful and stateless as well. After that, was able to run teal debugger. First transaction, which is a call to stateful, passed. Second transaction from the group is asset transfer approved by Escrow contract. Debugger command:
tealdbg debug --remote-debugging-port 12345 escrow.teal -d dr.msgp --group-index 1 & socat tcp-listen:9392,reuseaddr,fork tcp:localhost:12345
Code snippet where execution is paused:
gtxn 0 TypeEnum
int appl // 6
== // 6
&& // Stack has 1, but error: Exception: stack underflow in &&
gtxn 1 TypeEnum
gtxn 2 TypeEnum
Can’t figure out yet what raises this undeflow error and if this is directly connected to the ‘’ invocation error’ when debugger wasn’t able to run.
Any suggestions are appreciated!