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

ARC56: Extended App Description #258

Merged
merged 60 commits into from
Nov 22, 2024

Conversation

joe-p
Copy link
Contributor

@joe-p joe-p commented Nov 15, 2023

Basically takes most of the ideas in ARC32 and reorgs it in a way that is backwards compatible with ARC4 clients. Main benefit of this is HLLs can simply generate one JSON artifact.

@robdmoore
Copy link
Contributor

I know the eventual goal is to use simulate, but I wonder if we add in optional per-method hints for things like:

  • Fees
  • Boxes
  • Foreign arrays (? where you don't want that in the method selector)

And also:

  • Template variables?

Are there other things that have come up in the past worth considering while we are looking at this?

@joe-p
Copy link
Contributor Author

joe-p commented Nov 15, 2023

I know the eventual goal is to use simulate, but I wonder if we add in optional per-method hints for things like:

Fees
Boxes
Foreign arrays (? where you don't want that in the method selector)

My rationale for not including a field for these sort of things is that they can be dynamic which can be hard to describe in JSON and they could be network dependent. It also is not easy for a HLL to autogenerate these sorts of things and if the dev is required to manually write them out might as well just have them write a standardized readonly method that returns this information so they have the full power of the language and contract state/methods at their disposal (see ARC51).

Template variables?

Yes good call.

Co-authored-by: Rob Moore (MakerX) <[email protected]>
@joe-p
Copy link
Contributor Author

joe-p commented Oct 10, 2024

@daniel-makerx @robdmoore In 35a19b3 I added ProgramSourceInfo interface that includes a pcOffsetMethod key.

I think it would be good to have an optional tealOffset key if the pcOffset is cBlock to avoid the extra byte code lookup, but it's not a hill I'd die on so comfortable if we don't have it.

Depending on consistency in decompiled output makes me a bit nervous. I think it's unlikely to change but I also think it's relatively easy to parse the cblocks if they are at the top of the program.

ARCs/arc-0056.md Outdated Show resolved Hide resolved
ARCs/arc-0056.md Outdated Show resolved Hide resolved
ARCs/arc-0056.md Outdated Show resolved Hide resolved
ARCs/arc-0056.md Outdated Show resolved Hide resolved
ARCs/arc-0056.md Outdated Show resolved Hide resolved
};
/** The scratch variables used during runtime */
scratchVariables?: {
[name: string]: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume name is meant to be a variable name?

Wondering if this should be an array with an optional name (and maybe description?) as scratch slots might be used without an associated name? Or perhaps the key should be the slot number since that is required and unique?

Additionally I also assume this is just for documenting scratch variables intended to be read by other applications, not necessarily every scratch slot used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally I also assume this is just for documenting scratch variables intended to be read by other applications, not necessarily every scratch slot used?

Yeah exactly. The main purpose of having this field is so other contracts can easily access scratch variables. For example, TEALScript compiler uses scratch but this is only populated by user-defined scratch slots. I think forcing a name to be defined is fine because that's how it would be defined in the HLL. You can't have a property that is just a number so a name needs to be defined. I definitely like adding a desc though

};
};
/** Named structs use by the application. Each struct field appears in the same order as ABI encoding. */
structs: { [structName: StructName]: StructField[] };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing, noticed both StructField and this mapping don't have any sort of desc property, might be useful to have?

@joe-p
Copy link
Contributor Author

joe-p commented Oct 23, 2024

In 19c6269 I removed teal from SourceInfo because we agreed it was only useful for developers reading the file. I realized, however, that the TEAL line numbers are also used to give better error messages even without an explicit error message, so I've added it back as an optional field RECOMMENDED for development, along with a source string

ARCs/arc-0056.md Outdated Show resolved Hide resolved
ARCs/arc-0056.md Outdated Show resolved Hide resolved
ARCs/arc-0056.md Outdated Show resolved Hide resolved
ARCs/arc-0056.md Outdated Show resolved Hide resolved
@github-actions github-actions bot added c-status and removed s-draft labels Nov 22, 2024
@github-actions github-actions bot removed the c-status label Nov 22, 2024
@SudoWeezy SudoWeezy merged commit b4ac7ef into algorandfoundation:main Nov 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants