near / nearcore

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

test: chunk validator kickout #11672

Closed Longarithm closed 6 days ago

Longarithm commented 1 week ago

Express the power of TestLoop by implementing scenario where chunk validator-only node is kicked out due to low endorsement stats.

The logic is to simply prevent all chunks validated by selected accounts from appearing on chain. But implementing this without adding extra logic to Client, ShardsManagerActor and Network is a challenge. TestLoop, however, can add overrides to itself, which are generic enough to use for testing other scenarios, like ones in chunks_management tests. New components are:

Longarithm commented 1 week ago

Added another scenario to check that if BP has low endorsement stats, it's not kicked out.

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 92.68293% with 9 lines in your changes missing coverage. Please review.

Project coverage is 71.78%. Comparing base (80f08d7) to head (0713312).

Files Patch % Lines
core/chain-configs/src/test_genesis.rs 41.66% 7 Missing :warning:
integration-tests/src/test_loop/builder.rs 97.64% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #11672 +/- ## ========================================== + Coverage 71.73% 71.78% +0.04% ========================================== Files 790 790 Lines 161838 161945 +107 Branches 161838 161945 +107 ========================================== + Hits 116096 116246 +150 + Misses 40703 40666 -37 + Partials 5039 5033 -6 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/11672/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/11672/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/11672/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/11672/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/11672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `37.89% <92.68%> (+0.08%)` | :arrow_up: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/11672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `69.11% <39.02%> (-0.04%)` | :arrow_down: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/11672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.27% <92.68%> (+0.02%)` | :arrow_up: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/11672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `52.62% <14.28%> (+0.25%)` | :arrow_up: | | [pytests](https://app.codecov.io/gh/near/nearcore/pull/11672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.58% <0.00%> (-0.01%)` | :arrow_down: | | [sanity-checks](https://app.codecov.io/gh/near/nearcore/pull/11672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.38% <0.00%> (-0.01%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/near/nearcore/pull/11672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `66.33% <14.28%> (-0.01%)` | :arrow_down: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/11672/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.