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

test(congestion_control) - Implemented nayduck tests for congestion control #11429

Merged
merged 3 commits into from
May 30, 2024

Conversation

wacban
Copy link
Contributor

@wacban wacban commented May 30, 2024

Implemented a nayduck test for congestion control. It's more complex than I was hoping for and it still only check a simple scenario all to one, one hop transactions. Still it's a good starting point.

@wacban wacban requested a review from jakmeier May 30, 2024 13:53
@wacban wacban requested a review from a team as a code owner May 30, 2024 13:53
Copy link

codecov bot commented May 30, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 71.35%. Comparing base (dfa392b) to head (a0ba35a).
Report is 6 commits behind head on master.

Files Patch % Lines
runtime/near-vm-runner/src/logic/logic.rs 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11429      +/-   ##
==========================================
- Coverage   71.36%   71.35%   -0.01%     
==========================================
  Files         784      784              
  Lines      158134   158137       +3     
  Branches   158134   158137       +3     
==========================================
- Hits       112853   112845       -8     
- Misses      40408    40422      +14     
+ Partials     4873     4870       -3     
Flag Coverage Δ
backward-compatibility 0.24% <0.00%> (-0.01%) ⬇️
db-migration 0.24% <0.00%> (-0.01%) ⬇️
genesis-check 1.38% <0.00%> (-0.01%) ⬇️
integration-tests 37.45% <40.00%> (+0.05%) ⬆️
linux 68.88% <40.00%> (+<0.01%) ⬆️
linux-nightly 70.79% <40.00%> (+0.01%) ⬆️
macos 50.81% <40.00%> (-1.62%) ⬇️
pytests 1.60% <0.00%> (-0.01%) ⬇️
sanity-checks 1.39% <0.00%> (-0.01%) ⬇️
unittests 65.71% <40.00%> (-0.03%) ⬇️
upgradability 0.28% <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.

Copy link
Contributor

@jakmeier jakmeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, we can always iterate and extend as much as we think we have to.

Also, thinking about this e2e kind of testing, you might be interested in my draft for RPC level rejections (#11419), which would open the door to look for ShardCongested errors in the assertions.

But it's still a draft, mostly just so I had something to point the tooling community to. I think the rough idea should stay the same, unless someone finds an issue with my approach. But I'll need to fix existing congestion tests that don't like that RPCs return an error before it's ready to review and merge.

gas_used = chunk['header']['gas_used']
self.assertGreaterEqual(gas_used, 1000 * TGAS)

# Check that the congestion info has no buffered receipts and some deleted receipts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably you meant delayed here?

Suggested change
# Check that the congestion info has no buffered receipts and some deleted receipts.
# Check that the congestion info has no buffered receipts and some delayed receipts.

Comment on lines +293 to +297

// Burn the given amount of gas. This is the ultimate overcharging function
// as it doesn't take almost any resources to execute but burns a lot of
// gas.
##["test_features"] burn_gas<[gas: u64] -> []>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @nagisa just as FYI

@wacban wacban enabled auto-merge May 30, 2024 16:10
@wacban wacban added this pull request to the merge queue May 30, 2024
Merged via the queue into master with commit 722a56b May 30, 2024
27 of 29 checks passed
@wacban wacban deleted the waclaw-cc branch May 30, 2024 16:43
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.

2 participants