-
Notifications
You must be signed in to change notification settings - Fork 114
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
Utility for increasing budget during execution of PyTeal applications #274
Conversation
I think method 1 is essential, but I'm not as sure about method 2. On the face of it, |
I updated the PR description to further elaborate on the use cases for maximize_budget(). I do think it's useful to have a fee_for_budget() method available as well. |
a769bc5
to
e0c894b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for my one minor comment, this looks good to me, thank you for incorporating my feedback.
The one comment is about shrinking the on call program code. I edited the TEAL by hand, and even though it's a simple change I'd still recommend you briefly test it in sandbox again just to make sure there are no unintended consequences.
Co-authored-by: Jason Paulos <jasonpaulos@users.noreply.github.com>
Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com>
Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com>
Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com>
Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@algoidurovic Thanks for your effort here - I'm excited to see the feature used by the community! ☕
I left an optional remark in #274 (comment). I'd appreciate considering it before merging though it need not hold us up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs look great, I just have some suggestions, only one of which is important (the 700 vs ~700 comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, I just have one comment that I missed before
examples/application/opup.py
Outdated
|
||
from pyteal import * | ||
|
||
from pyteal.ast.opup import OpUp, OpUpMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line shouldn't be necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one question about ensure_budget
|
||
|
||
ON_CALL_APP = Bytes("base16", "068101") # v6 teal program "int 1" | ||
MIN_TXN_FEE = Int(1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor proposal, do you think MIN_TXN_FEE
should be available in a larger scope, say it lives in pyteal/config.py
? I guess some folks would want this available not just in opup
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Global.min_txn_fee()
is available to PyTeal, perhaps this code should use that instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ sounds pretty reasonable to me
This PR implements a PyTeal utility for increasing the opcode budget during execution of an app call using inner app call transactions.
Two modes are provided:
Two budget increase methods are provided:
Testing
Unit tests for type checking enforcement and sandbox tests for e2e functionality. The PyTeal programs I used for testing in sandbox are located in examples/application/opup.py