near / nearcore

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

Unconditionally enable SHA-NI extensions #11711

Closed nagisa closed 2 weeks ago

nagisa commented 2 weeks ago

We rely on this extension to accelerate computation of SHA2 hashes quickly. This extension not being present will slow down node beyond what's reasonable and the node will not be able to keep up with others. Enabling this extension unconditionally and having the node fail early on machines where the extension is not available seems like a reasonable option here.

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.22%. Comparing base (ced534f) to head (7532758). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #11711 +/- ## ========================================== + Coverage 70.19% 70.22% +0.02% ========================================== Files 791 791 Lines 161937 161937 Branches 161937 161937 ========================================== + Hits 113671 113715 +44 + Misses 43298 43257 -41 + Partials 4968 4965 -3 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/11711/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/11711/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.23% <ø> (ø)` | | | [db-migration](https://app.codecov.io/gh/near/nearcore/pull/11711/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.23% <ø> (ø)` | | | [genesis-check](https://app.codecov.io/gh/near/nearcore/pull/11711/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.35% <ø> (ø)` | | | [integration-tests](https://app.codecov.io/gh/near/nearcore/pull/11711/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `37.90% <ø> (-0.07%)` | :arrow_down: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/11711/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `69.96% <ø> (-0.01%)` | :arrow_down: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/11711/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `69.80% <ø> (-0.02%)` | :arrow_down: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/11711/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `54.55% <ø> (+1.62%)` | :arrow_up: | | [pytests](https://app.codecov.io/gh/near/nearcore/pull/11711/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.58% <ø> (ø)` | | | [sanity-checks](https://app.codecov.io/gh/near/nearcore/pull/11711/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.38% <ø> (ø)` | | | [unittests](https://app.codecov.io/gh/near/nearcore/pull/11711/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `64.51% <ø> (+0.04%)` | :arrow_up: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/11711/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.28% <ø> (ø)` | | 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.

nagisa commented 2 weeks ago

If they are running without SHA-NI, their node is pretty slow and with stateless this problem would likely get exacerbated to the point where the node cannot keep up with the network at all (if it is still able to right now.)