js-libp2p-gossipsub
js-libp2p-gossipsub copied to clipboard
feat: implement putUnsafe() for time cache
Motivation
- There is memory leak issue in the case of
fastMsgIdFnhash function data collision, which causesvalidUntilMsto be not in ascending order andprunefunction does not work well - It's not only happen in #356, I think the current version of lodestar (v1.1.0) also has this issue that's why we have this pattern
In very bad case fastMsgIdCache could grow a lot.
Description
- Implement
putUnsafe()function - It's noticed that the
putUnsafe()is 2x slower thanput()
TODO
- [ ] Test in a node for some time