Skip to content
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

Merged
merged 40 commits into from
Oct 30, 2024

Conversation

tayfunelmas
Copy link
Contributor

@tayfunelmas tayfunelmas commented Oct 23, 2024

  • 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 the warmup step needs one more block to ensure there is no missing chunk. The changes in the block heights in test_view_requests_to_archival_node is related to this change.

@tayfunelmas tayfunelmas changed the title Draft test2 Draft: Filter new deploys from accesses and add a new testloop test Oct 23, 2024
@tayfunelmas tayfunelmas changed the base branch from master to nayduck-add-blocks October 23, 2024 15:09
@tayfunelmas tayfunelmas changed the base branch from nayduck-add-blocks to master October 23, 2024 15:09
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 78.63248% with 25 lines in your changes missing coverage. Please review.

Project coverage is 71.25%. Comparing base (1e41b11) to head (2d01c1c).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
runtime/near-vm-runner/src/cache.rs 80.00% 9 Missing and 3 partials ⚠️
...src/stateless_validation/state_witness_producer.rs 0.00% 11 Missing ⚠️
...egration-tests/src/test_loop/utils/transactions.rs 95.23% 0 Missing and 2 partials ⚠️
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     
Flag Coverage Δ
backward-compatibility 0.16% <0.00%> (-0.01%) ⬇️
db-migration 0.16% <0.00%> (-0.01%) ⬇️
genesis-check 1.23% <0.00%> (-0.01%) ⬇️
integration-tests 39.04% <49.57%> (+0.02%) ⬆️
linux 70.71% <78.63%> (+0.05%) ⬆️
linux-nightly 70.84% <78.63%> (+<0.01%) ⬆️
macos 50.42% <0.00%> (+0.02%) ⬆️
pytests 1.54% <0.00%> (-0.01%) ⬇️
sanity-checks 1.35% <0.00%> (-0.01%) ⬇️
unittests 64.19% <67.60%> (+<0.01%) ⬆️
upgradability 0.21% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tayfunelmas tayfunelmas changed the title Draft: Filter new deploys from accesses and add a new testloop test feat(contract-distribution): Filter new deploys from accesses and add a new testloop test Oct 24, 2024
@tayfunelmas
Copy link
Contributor Author

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.

@tayfunelmas tayfunelmas added this pull request to the merge queue Oct 30, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 30, 2024
@tayfunelmas tayfunelmas added this pull request to the merge queue Oct 30, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 30, 2024
@tayfunelmas tayfunelmas enabled auto-merge October 30, 2024 11:03
@tayfunelmas tayfunelmas added this pull request to the merge queue Oct 30, 2024
Merged via the queue into near:master with commit 76268e3 Oct 30, 2024
27 of 29 checks passed
@tayfunelmas tayfunelmas deleted the contract-dist-test branch October 30, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants