near / nearcore

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

Revisit caching and thread-safety aspects of ChunkEndorsementTracker #11474

Open tayfunelmas opened 5 months ago

tayfunelmas commented 5 months ago

Follow up from https://github.com/near/nearcore/pull/11452.

We should investigate the current operation of the ChunkEndorsementTracker, understand why it is accessed by multiple threads and having two caches, and if not, eliminate the complexities due to 1) use of the mutex and 2) having multiple caches and possibly a single cache to provide the same functionality.

shreyan-gupta commented 5 months ago

I have a quick and a long term solution for this. The PR https://github.com/near/nearcore/pull/11513 is the quick solution to make the tests pass while keeping the complexity low.

The long term solution here would be to merge the validation efforts across the partial witness and chunk endorsement.