near / nearcore

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

fix(temporary mitigation): Skip genesis bootstrapping for statelessnet #11727

Closed tayfunelmas closed 3 months ago

tayfunelmas commented 3 months ago

This is a mitigation for the failure that is caused by the stabilization PR https://github.com/near/nearcore/pull/11701.

Zulip thread

Context: In statelessnet, the genesis version is above 68, so it assumes that genesis has the congestion control is enabled and hitting an issue that attempts to bootstrap congestion info (again) and hitting missing state roots.

We attempted to move the version numbers for congestion control and stateless validation back to 80 and 81 to mitigate the problem, in this PR but it became unnecessarily complex and risky.

Thus, in this PR, we simply bypass the problematic bootstrap for statelessnet only. We moved the check for the chain id after the genesis protocol version check so we will not run it for testnet and mainnet.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.76%. Comparing base (4e9e742) to head (c1125ff). Report is 1 commits behind head on master.

Files Patch % Lines
chain/chain/src/chain.rs 85.71% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #11727 +/- ## ======================================= Coverage 71.75% 71.76% ======================================= Files 792 792 Lines 162429 162442 +13 Branches 162429 162442 +13 ======================================= + Hits 116556 116570 +14 - Misses 40826 40830 +4 + Partials 5047 5042 -5 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/11727/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/11727/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/11727/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/11727/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/11727/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `37.89% <86.66%> (-0.02%)` | :arrow_down: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/11727/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.32% <86.66%> (+0.01%)` | :arrow_up: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/11727/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.34% <86.66%> (+<0.01%)` | :arrow_up: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/11727/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `52.96% <86.66%> (-1.61%)` | :arrow_down: | | [pytests](https://app.codecov.io/gh/near/nearcore/pull/11727/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/11727/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/11727/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `66.17% <86.66%> (-0.01%)` | :arrow_down: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/11727/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.