algorand / algorand/pyteal

Allow Users to Allocate Space for DynamicScratchVar's

オープン
#200 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
new-feature-request Team Scytale
主要言語
Python
スター
288
フォーク
138
PR マージ指標
30日以内にマージされた PR はありません

説明

## Problem

When a user creates a `DynamicScratchVar`, the compiler -by design- does not block-off slot space for this variable. Typically, the compiler allocates scratch slots at runtime with slot numbers which are as small as possible. However, without knowing at compile time what slots the compiler will create, there is always the possibility that the compiler will _step on_ a user's dynamic slots. In the worst case, this could lead to unpredictable run-time behavior.

## Solution

We should allow users to allocate a range of dynamic scratch var's at compile time. For example, the following API might work:

```python
def approval_program():
DynamicScratchVar.allocate(range(128, 256)) # allocates slot id's [128, 255] for use only by DynamicScratchVar's

return Seq( ... the actual pyteal ... )
```

## Dependencies

#195

## Urgency

Medium

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。