Skip to content

feat: implement putUnsafe() for time cache #357

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

Closed
wants to merge 2 commits into from
Closed

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Oct 7, 2022

Motivation

  • There is memory leak issue in the case of fastMsgIdFn hash function data collision, which causes validUntilMs to be not in ascending order and prune function does not work well
  • It's not only happen in Memory leak due to hash collision #356, I think the current version of lodestar (v1.1.0) also has this issue that's why we have this pattern

Screen Shot 2022-10-07 at 15 38 12

In very bad case fastMsgIdCache could grow a lot.

Description

  • Implement putUnsafe() function
  • It's noticed that the putUnsafe() is 2x slower than put()

TODO

  • Test in a node for some time

@twoeths
Copy link
Contributor Author

twoeths commented Oct 25, 2022

implemented in #358

@twoeths twoeths closed this Oct 25, 2022
@dapplion dapplion deleted the tuyen/putUnsafe branch October 26, 2022 02:26
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.

1 participant