-
Notifications
You must be signed in to change notification settings - Fork 493
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
AVM: inner appls can call v4 #3896
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3896 +/- ##
==========================================
+ Coverage 50.01% 50.05% +0.04%
==========================================
Files 393 393
Lines 68295 68316 +21
==========================================
+ Hits 34156 34196 +40
+ Misses 30433 30415 -18
+ Partials 3706 3705 -1
Continue to review full report at Codecov.
|
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.
Mostly just browsing
AllowV4InnerAppls also means that apps can not perform an inner opt-in to apps with <v4 CSP (since they might then be locked in). And no app can downgrade, as that is a straightforward rule to prevent an app from lowering its CSP and locking other apps into it.
The DoubleLedger does a lot of double checking on ledgers produced by rerunning transactions after creating blocks, deserializing the txns from the block and validating the results. testConsensusRange makes it easy for ledger tests to test behavior in many protocol levels. A particular problem it handles is that test can be written to run from some consensus version and in every subsequent version. So if we change behavior in a new version, we'll find out.
Co-authored-by: algochoi <[email protected]>
Co-authored-by: algochoi <[email protected]>
Co-authored-by: algochoi <[email protected]>
also converted more tests to testConsensusRange, and t.Parallel()
Review dog found an unused variable, which was a bug. Added tests to check for the bug that would have existed.
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.
@jannotti Thanks for working through a few rounds of feedback from my side. ☕
This PR allows inner app calls to v4 and v5 teal versions. The following prohibitions were added to make this safe.
Rule 1 ensures that an app can call the clearstate program as an inner. Rule 2 prevents an end-run around rule #1, by preventing an app with v5 CSP from downgrading to v3 at a later time.
The PR also introduces a DoubleLedger and testConsensusRange to make it easier to write ledger tests that need to operate over different consensus versions. It also makes it easy to write the tests in such a way that they continue to test the functionality they care about as we change the consensus version, but also continue to test the behavior on old version, to prevent regressions.