near / nearcore

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

[cleanup] Remove no_cache feature #12459

Closed shreyan-gupta closed 2 days ago

shreyan-gupta commented 1 week ago

In future PRs we plan to get rid of the caches in ChainStore as we don't believe them to be too useful and is a complication to the current codebase.

As a pre-step, this PR gets rid of the no_cache feature. This was being used in ChainStore TrieStore, and EpochManager.

Here are the associated caches that are affected

Effect on Parameter Estimator

While the param estimator hasn't been run for a long time since the introduction of memtries, it used to rely on the no_cache feature to effectively test the worst case performance with the cache removed from Trie.

With the introduction on memtrie, this check is now redundant as we no longer use the Trie Store Cache after the introduction of memtrie.

However, as of today, some nodes like RPC nodes (which track all shards) do not use memtries and this might be relevant for them. That said, it's probably not worth it to block this change on potential future use of no_cache for RPC nodes where we are moving towards a memtrie world.

Native transfer workloads

This change is backed up by Moritz's tests on native transfer workload with 10k accounts and unlimited configs.

This shows that the caches don't have a significant impact on the workloads.

codecov[bot] commented 1 week ago

Codecov Report

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

Project coverage is 71.44%. Comparing base (fecce01) to head (567d45f). Report is 16 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #12459 +/- ## ======================================= Coverage 71.44% 71.44% ======================================= Files 838 838 Lines 169339 169335 -4 Branches 169339 169335 -4 ======================================= + Hits 120985 120989 +4 + Misses 43006 43000 -6 + Partials 5348 5346 -2 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/12459/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/12459/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.16% <ø> (ø)` | | | [db-migration](https://app.codecov.io/gh/near/nearcore/pull/12459/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.16% <ø> (ø)` | | | [genesis-check](https://app.codecov.io/gh/near/nearcore/pull/12459/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.29% <ø> (ø)` | | | [integration-tests](https://app.codecov.io/gh/near/nearcore/pull/12459/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `39.34% <ø> (+<0.01%)` | :arrow_up: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/12459/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `70.78% <ø> (-0.01%)` | :arrow_down: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/12459/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.01% <ø> (+0.01%)` | :arrow_up: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/12459/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `51.05% <ø> (+0.03%)` | :arrow_up: | | [pytests](https://app.codecov.io/gh/near/nearcore/pull/12459/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.60% <ø> (ø)` | | | [sanity-checks](https://app.codecov.io/gh/near/nearcore/pull/12459/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.40% <ø> (ø)` | | | [unittests](https://app.codecov.io/gh/near/nearcore/pull/12459/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `63.97% <ø> (+<0.01%)` | :arrow_up: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/12459/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.21% <ø> (ø)` | | 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.


🚨 Try these New Features: