-
Notifications
You must be signed in to change notification settings - Fork 677
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
feat(contract-distribution): Filter new deploys from accesses and add a new testloop test #12298
Conversation
This reverts commit a4e861a.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12298 +/- ##
==========================================
+ Coverage 71.24% 71.25% +0.01%
==========================================
Files 838 838
Lines 169346 169440 +94
Branches 169346 169440 +94
==========================================
+ Hits 120651 120740 +89
+ Misses 43449 43442 -7
- Partials 5246 5258 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-authored-by: Andrea <[email protected]>
Simplified the test and separated it into two different test files: One with a simple deploy and call a sized contract. Another one with multiple contracts and cross-shard calling. |
Exclude the code-hashes from the newly deployed code from the message sent from chunk-producer to chunk-validators. This is because code for the newly deployed contracts are available in the state witness inside the receipts (they are not excluded from the witness), and the witness is already sent to the validators. Then the chunk validators will update their contract cache while applying the deploy actions. Thus, the validators do not need to request code for these.
Add two testloop tests for contract distribution. A simple test deploys and calls a contract. Another test deploys multiple contracts to two different accounts/shards and calls them from different accounts. We call the contracts before and after clearing the cache. We promote some of the helper functions from the
congestion_control
test to the utils to share with the new test.To support the test, we add a test-only method to the contract cache to revoke the cache. This allows us to test that the chain can still work if the cache is empty. Note that we only add the cleaning functionality for testing, since the reasoning about cleaning the cache while there are ongoing accesses is not trivial (for example see this comment)
We also change
env.rs
because thewarmup
step needs one more block to ensure there is no missing chunk. The changes in the block heights intest_view_requests_to_archival_node
is related to this change.