-
Notifications
You must be signed in to change notification settings - Fork 214
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
[Merged by Bors] - datastore: parametrize and increase cache size #4882
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4882 +/- ##
=========================================
- Coverage 76.8% 76.8% -0.1%
=========================================
Files 261 261
Lines 30160 30251 +91
=========================================
+ Hits 23189 23247 +58
- Misses 5476 5504 +28
- Partials 1495 1500 +5
|
if err != nil { | ||
lg.Fatal("failed to create atx cache", err) | ||
} | ||
|
||
malfeasanceCache, err := lru.New[types.NodeID, *types.MalfeasanceProof](malfeasanceCacheSize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the malfeasanceCacheSize
constant can be removed.
// NewCachedDB create an instance of a CachedDB. | ||
func NewCachedDB(db *sql.Database, lg log.Log) *CachedDB { | ||
atxHdrCache, err := lru.New[types.ATXID, *types.ActivationTxHeader](atxHdrCacheSize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that atxHdrCacheSize
is still used but only for the vrfNonceCache
, so it could be renamed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small points, otherwise looks good!
thanks, i removed both constants, and using ATXSize for vrf nonce too |
bors merge |
tried to sync node and noticed that it spends a lot of time looping over activeset in eligibility validation. i will open an issue to optimize that code path, but for now we need to increase number of activations stored in cache. related: #4883
Pull request successfully merged into develop. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
tried to sync node and noticed that it spends a lot of time looping over activeset in eligibility validation. i will open an issue to optimize that code path, but for now we need to increase number of activations stored in cache.
related: #4883