Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gloads not working in dryrun mode #3244

Closed
hernandp opened this issue Nov 23, 2021 · 1 comment · Fixed by #3664
Closed

gloads not working in dryrun mode #3244

hernandp opened this issue Nov 23, 2021 · 1 comment · Fixed by #3664

Comments

@hernandp
Copy link

Subject of the issue

Using gloads to load scratch space values from transactions in a group does not work in dryrun mode, it always return 0.

Your environment

Steps to reproduce

  1. Use the following TEAL sources:

The intention is to save the group index in slot 254 for TX0, TX1 and TX2.
TX3 must check saved values with gloads.

#pragma version 5
txn GroupIndex
int 3
==
bnz checkgload
txn GroupIndex
store 254
b exit
checkgload:
int 0
gloads 254
int 0
==
int 1
gloads 254
int 1
==
int 2
gloads 254
int 2
==
&&
assert

exit:
int 1

Clear program is trivial:

#pragma version 5
int 1

Expected behaviour

gloads should load 0, 1 and 2, not zero.

Actual behaviour

It always seems to retrieve zero value.

Dryrun dump follows:

root@ad1fa94c5147:~/testnetwork/Node/test# goal clerk dryrun-remote -D grouped.dr -v
tx[0] cost: 9
tx[0] messages:
ApprovalProgram
PASS
tx[0] trace:
   1 (0001): #pragma version 5 []
   2 (0006): intcblock 1 0 2 []
   3 (0008): txn GroupIndex [0]
   4 (000a): pushint 3 [0 3]
   5 (000b): == [0]
   6 (000e): bnz label1 []
   7 (0010): txn GroupIndex [0]
   8 (0012): store 254 []
  25 (0026): label2: []
  26 (0027): intc_0 // 1 [1]
tx[1] cost: 9
tx[1] messages:
ApprovalProgram
PASS
tx[1] trace:
   1 (0001): #pragma version 5 []
   2 (0006): intcblock 1 0 2 []
   3 (0008): txn GroupIndex [1]
   4 (000a): pushint 3 [1 3]
   5 (000b): == [0]
   6 (000e): bnz label1 []
   7 (0010): txn GroupIndex [1]
   8 (0012): store 254 []
  25 (0026): label2: []
  26 (0027): intc_0 // 1 [1]
tx[2] cost: 9
tx[2] messages:
ApprovalProgram
PASS
tx[2] trace:
   1 (0001): #pragma version 5 []
   2 (0006): intcblock 1 0 2 []
   3 (0008): txn GroupIndex [2]
   4 (000a): pushint 3 [2 3]
   5 (000b): == [0]
   6 (000e): bnz label1 []
   7 (0010): txn GroupIndex [2]
   8 (0012): store 254 []
  25 (0026): label2: []
  26 (0027): intc_0 // 1 [1]
tx[3] cost: 19
tx[3] messages:
ApprovalProgram
REJECT
logic eval error: assert failed pc=37
tx[3] trace:
   1 (0001): #pragma version 5 []
   2 (0006): intcblock 1 0 2 []
   3 (0008): txn GroupIndex [3]
   4 (000a): pushint 3 [3 3]
   5 (000b): == [1]
  10 (0015): label1: []
  11 (0016): intc_1 // 0 [0]
  12 (0018): gloads 254 [0]
  13 (0019): intc_1 // 0 [0 0]
  14 (001a): == [1]
  15 (001b): intc_0 // 1 [1 1]
  16 (001d): gloads 254 [1 0]
  17 (001e): intc_0 // 1 [1 0 1]
  18 (001f): == [1 0]
  19 (0020): intc_2 // 2 [1 0 2]
  20 (0022): gloads 254 [1 0 0]
  21 (0023): intc_2 // 2 [1 0 0 2]
  22 (0024): == [1 0 0]
  23 (0025): && [1 0]
  23 (0025): && [1 0]

Thanks.

@algorandskiy
Copy link
Contributor

This appears to be fixed in master now after c2c merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants