near / nearcore

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

fix: Use current validator for tracked shards check #11828

Closed staffik closed 1 month ago

staffik commented 1 month ago

See https://github.com/near/nearcore/issues/11821 for context.

Check if this is a current validator using current epoch info, not merely the fact that validator key exists.

Testing

Current Mainnet (protocol version 67)

Pre-requirements for the check to kick-in:

Tested with different validator IDs:

Current Testnet (protocol version 69)

Pre-requirements for the check to kick-in:

Tested with different validator IDs:

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 6.25000% with 15 lines in your changes missing coverage. Please review.

Project coverage is 71.78%. Comparing base (229d287) to head (4b7da47). Report is 1 commits behind head on master.

Files Patch % Lines
chain/client/src/client_actor.rs 6.25% 14 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #11828 +/- ## ========================================== - Coverage 71.80% 71.78% -0.02% ========================================== Files 796 796 Lines 163200 163227 +27 Branches 163200 163227 +27 ========================================== - Hits 117182 117175 -7 - Misses 40973 41005 +32 - Partials 5045 5047 +2 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/11828/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/11828/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.23% <0.00%> (-0.01%)` | :arrow_down: | | [db-migration](https://app.codecov.io/gh/near/nearcore/pull/11828/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.23% <0.00%> (-0.01%)` | :arrow_down: | | [genesis-check](https://app.codecov.io/gh/near/nearcore/pull/11828/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.35% <0.00%> (-0.01%)` | :arrow_down: | | [integration-tests](https://app.codecov.io/gh/near/nearcore/pull/11828/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `37.74% <6.25%> (-0.01%)` | :arrow_down: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/11828/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.55% <6.25%> (+<0.01%)` | :arrow_up: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/11828/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.37% <6.25%> (-0.03%)` | :arrow_down: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/11828/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `53.43% <6.25%> (+0.36%)` | :arrow_up: | | [pytests](https://app.codecov.io/gh/near/nearcore/pull/11828/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.62% <0.00%> (-0.01%)` | :arrow_down: | | [sanity-checks](https://app.codecov.io/gh/near/nearcore/pull/11828/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.42% <0.00%> (-0.01%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/near/nearcore/pull/11828/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `66.22% <6.25%> (-0.04%)` | :arrow_down: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/11828/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.28% <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.