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

Remove witnesses which are no longer needed from OrphanStateWitnessPool #10649

Closed
jancionear opened this issue Feb 23, 2024 · 0 comments · Fixed by #10658
Closed

Remove witnesses which are no longer needed from OrphanStateWitnessPool #10649

jancionear opened this issue Feb 23, 2024 · 0 comments · Fixed by #10658
Labels
A-stateless-validation Area: stateless validation

Comments

@jancionear
Copy link
Contributor

The OprhanWitnessPool, introduced in #10613, keeps a cache of orphaned witnesses which are waiting for some block to appear. The witnesses are removed from the cache once the desired block appears, but if the block never comes, then the witnesses stay in the pool. They are eventually ejected when the cache hits full capacity, but it means that for most of the time the cache will be full of useless witnesses, wasting memory.
As an optimization we could periodically remove witnesses which are no longer needed (e.g their height is less than the final height on the chain). This would reduce memory usage of the orphan witness pool.

Refs: #10613 (comment)

@jancionear jancionear added the A-stateless-validation Area: stateless validation label Feb 23, 2024
jancionear added a commit to jancionear/nearcore that referenced this issue Feb 26, 2024
Orphaned witnesses which are below the final height of the
chain will never be processed, so let's remove them from
the orphan pool to save memory.

Fixes: near#10649
github-merge-queue bot pushed a commit that referenced this issue Feb 27, 2024
Orphaned witnesses which are below the final height of the chain will
never be processed, so let's remove them from the orphan pool to free up
memory.

Fixes: #10649
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stateless-validation Area: stateless validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant