near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.32k stars 623 forks source link

fix: Fix Nayduck test rpc_hash.py and test_inflation and update BlockHeaderView and genesis header #12087

Closed tayfunelmas closed 1 month ago

tayfunelmas commented 1 month ago

The test rpc_hash.py revealed two problems for the changes previously done for task #11900. 1) BlockHeaderView was not updated to represent BlockHeaderV5, so added chunk endorsements bitmap there (we add the inner vector instead of exposing ChunkEndorsementBitmap struct there). 2) Genesis block header was not updated to represent BlockHeaderV5, so added an empty bitmap to the genesis block header.

Then we updated the test rpc_hash.py to check for nightly version producing BlockHeaderV5 with endorsements bitmap as well.

TODO: We noticed that there are 3 places that we generate BlockHeader versions using BlockHeader::new() function (when producing blocks, for genesis block, and from view to header conversion). Added a TODO to consolidate them instead of needing to update separate places.

Also fix test_inflation integration test by updating the validator reward multiplier.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 98.80952% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.60%. Comparing base (52b4684) to head (c59ba95). Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
core/primitives/src/views.rs 97.56% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #12087 +/- ## ========================================== + Coverage 71.57% 71.60% +0.02% ========================================== Files 815 815 Lines 164304 164388 +84 Branches 164304 164388 +84 ========================================== + Hits 117597 117703 +106 + Misses 41571 41545 -26 - Partials 5136 5140 +4 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | Coverage Δ | | |---|---|---| | [backward-compatibility](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.17% <0.00%> (-0.01%)` | :arrow_down: | | [db-migration](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.17% <0.00%> (-0.01%)` | :arrow_down: | | [genesis-check](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.26% <0.00%> (-0.01%)` | :arrow_down: | | [integration-tests](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `38.70% <98.80%> (+0.02%)` | :arrow_up: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.18% <4.76%> (-0.02%)` | :arrow_down: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.11% <98.80%> (+<0.01%)` | :arrow_up: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `54.02% <4.76%> (+<0.01%)` | :arrow_up: | | [pytests](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.53% <0.00%> (-0.01%)` | :arrow_down: | | [sanity-checks](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.33% <0.00%> (-0.01%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `65.38% <98.80%> (+0.03%)` | :arrow_up: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/12087/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.22% <0.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.