Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EpochSync] Cache epoch sync proof in memory for multiple requests. #12225

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

robin-near
Copy link
Contributor

It's a very simple cache. We only cache the most recent epoch sync proof, in compressed format. The key of the cache is the EpochId. So whenever the EpochId changes, we recompute it.

Why don't we just store this on disk instead? It's unnecessary, and introduces more state to keep. Deriving the proof is not very expensive anyway (maybe a couple of seconds).

@robin-near robin-near requested a review from a team as a code owner October 15, 2024 16:13
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.85%. Comparing base (8be015e) to head (668d0ed).
Report is 8 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12225   +/-   ##
=======================================
  Coverage   71.84%   71.85%           
=======================================
  Files         827      827           
  Lines      166716   166725    +9     
  Branches   166716   166725    +9     
=======================================
+ Hits       119783   119800   +17     
+ Misses      41718    41708   -10     
- Partials     5215     5217    +2     
Flag Coverage Δ
backward-compatibility 0.17% <0.00%> (-0.01%) ⬇️
db-migration 0.17% <0.00%> (-0.01%) ⬇️
genesis-check 1.25% <0.00%> (-0.01%) ⬇️
integration-tests 38.92% <100.00%> (-0.01%) ⬇️
linux 71.52% <100.00%> (+<0.01%) ⬆️
linux-nightly 71.42% <100.00%> (-0.01%) ⬇️
macos 54.52% <44.44%> (-0.02%) ⬇️
pytests 1.57% <0.00%> (-0.01%) ⬇️
sanity-checks 1.37% <0.00%> (-0.01%) ⬇️
unittests 65.63% <44.44%> (-0.01%) ⬇️
upgradability 0.21% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@staffik staffik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@robin-near robin-near added this pull request to the merge queue Oct 16, 2024
Merged via the queue into near:master with commit 3cb74c2 Oct 16, 2024
28 of 30 checks passed
@robin-near robin-near deleted the esync7 branch October 16, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants