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

TEAL - Produce Assembly Map During Compilation #17

Closed
barnjamin opened this issue Nov 16, 2021 · 3 comments
Closed

TEAL - Produce Assembly Map During Compilation #17

barnjamin opened this issue Nov 16, 2021 · 3 comments

Comments

@barnjamin
Copy link
Contributor

There are 2 valuable bits of information the are available during contract assembly.

  1. Program Counter (pc), the index in the bytecode of a given instruction
  2. Template Variable Locations, the index in the bytecode of a given template variable and its type

Producing an output file with the above would help with debugging and with variable insertion.

More tooling for encoding and inserting template variables would be needed as well.

@pbennett
Copy link

This would be VERY valuable actually. I'd like to see compilation as you mentioned produce the named TMPL_XX byte offsets as a json array in a json object return for eg. Would this be kind of a partial compilation? I'd want to be able to pass teal as-is w/ TMPL_XX placeholders and get the real bytecode back but w/ insertion offsets (which I could adjust for as I inserted) for each of the parameters. This way I could compile the TEAL once and cache it, then replace the parameters efficiently without having to recompile.

@barnjamin
Copy link
Contributor Author

algorand/go-algorand#2921 re-opened this pr which should provide the map during compilation if given the appropriate flag

@barnjamin
Copy link
Contributor Author

algorand/go-algorand#3726

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

No branches or pull requests

2 participants