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

Use current protocol version in MockEpochManager #12304

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

jancionear
Copy link
Contributor

KeyValueRuntime creates a MockEpochManager which returns epoch infos with protocol versions set to 1.
The fact that some tests run with protocol version 1, but still use structs from the current protocol version messes up some checks that I'm trying to add.
Let's use the current protocol version in the mock epoch info. Running things with protocol version 1 isn't very realisitic anyway.

I had to fix one test which tests the "maintenance windows" feature - the maintenance windows (heights where a specific validator is not a block or chunk producer) were different in protocol version 1, I think this is because the validator assignment algorithm has changed. I think it's better to test the latest assignment algorithm.

I checked the new validator assignments by adding manual prints in the get_maintenance_windows function.

@jancionear jancionear requested a review from a team as a code owner October 24, 2024 18:13
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.51%. Comparing base (cd319ac) to head (8931a7f).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12304      +/-   ##
==========================================
- Coverage   71.55%   71.51%   -0.05%     
==========================================
  Files         836      836              
  Lines      168170   168288     +118     
  Branches   168170   168288     +118     
==========================================
+ Hits       120335   120349      +14     
- Misses      42585    42683      +98     
- Partials     5250     5256       +6     
Flag Coverage Δ
backward-compatibility 0.16% <0.00%> (-0.01%) ⬇️
db-migration 0.16% <0.00%> (-0.01%) ⬇️
genesis-check 1.24% <0.00%> (-0.01%) ⬇️
integration-tests 38.78% <100.00%> (-0.05%) ⬇️
linux 71.15% <100.00%> (-0.05%) ⬇️
linux-nightly 71.10% <100.00%> (-0.03%) ⬇️
macos 54.27% <100.00%> (-0.05%) ⬇️
pytests 1.55% <0.00%> (-0.01%) ⬇️
sanity-checks 1.36% <0.00%> (-0.01%) ⬇️
unittests 65.27% <100.00%> (-0.05%) ⬇️
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.

@jancionear jancionear added this pull request to the merge queue Oct 25, 2024
Merged via the queue into near:master with commit 20fa012 Oct 25, 2024
29 checks passed
@jancionear jancionear deleted the current-manager branch October 25, 2024 11:58
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