Skip to content

ScratchVar: Disallow @Subroutine recursion #242

@michaeldiamant

Description

@michaeldiamant

Problem

Unintentionally, #198 opens the door to unintended interactions between ScratchVar and recursive @Subroutines. #230 explores the topic.

We must either implement an improvement or revert #198 to avoid releasing software with known unintended behavior.

Solution

Fail TEAL source compilation when a recursive @Subroutine containing a ScratchVar parameter exists.

Rationale:

  • Since DynamicScratchVar is a new abstraction and we don't know how pervasively it'll be used, the ticket requests constraining usage until we get feedback otherwise.
  • We discussed these alternatives and deemed the benefit-vs-cost tradeoff to be weaker than the proposed solution:
    • Support for recursion.
    • Add guard rails around allowed recursion cases.

Additionally:

Dependencies

N/A

Urgency

High - master cannot be safely tagged.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions