Page MenuHomePhabricator

[avalanche] Implement cleanup for stake contender cache
Needs RevisionPublic

Authored by roqqit on Wed, Sep 18, 16:24.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Summary

The stake contender cache needs a way to be cleaned up so that it does not grow unbounded. The intent is to call cleanup() when a block becomes newly finalized since there is no need to maintain the cache for finalized blocks.

Test Plan
ninja check-avalanche

Event Timeline

Owners added a reviewer: Restricted Owners Package.Wed, Sep 18, 16:24
roqqit requested review of this revision.Wed, Sep 18, 16:24
Fabien requested changes to this revision.Wed, Sep 18, 19:05
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/avalanche/stakecontendercache.cpp
27

I think you can make this more effective and not require cs_main by adding the block height to the cache. Manual winners could also be made a multi index to achieve the same

This revision now requires changes to proceed.Wed, Sep 18, 19:05