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

[Malleability] Update herocache to use generics and implement BackData. #7151

Open
wants to merge 21 commits into
base: 6646-mempool-refactoring
Choose a base branch
from

Conversation

AndriiDiachuk
Copy link
Contributor

@AndriiDiachuk AndriiDiachuk commented Mar 12, 2025

Context

In this PR Cache and PoolEntity were refactored to use generics enabling them to handle any data type for both the key and the value.

As Cache going to work with flow.Identifier so only V was introduced there.

PoolEntity now uses generic type parameters:

  • Key (K) is constrained with comparable, ensuring that it supports equality checks.
  • Value (V) is defined as any, allowing flexibility.

This PR is part of the broader refactoring effort referenced in EPIC #6646.

Closes: #7074.

@AndriiDiachuk
Copy link
Contributor Author

AndriiDiachuk commented Mar 12, 2025

@jordanschalm Hi, I want to ask for your advice. I added wasEjected to the Add function in pool so we can use it instead of the nil comparison, which was before in the put function of the cache. Another option was to return a pointer and not add wasEjected. What do you think is a better option?

@AndriiDiachuk AndriiDiachuk marked this pull request as ready for review March 12, 2025 15:56
@AndriiDiachuk AndriiDiachuk requested a review from a team as a code owner March 12, 2025 15:56
Copy link
Member

@durkmurder durkmurder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First batch of comments. Overall all good, can you make sure that Tracer is properly integrated, also can you run lint and ensure tests are passing?

…into andron/7074-update-herocache-to-implement-BackData
@AndriiDiachuk
Copy link
Contributor Author

First batch of comments. Overall all good, can you make sure that Tracer is properly integrated, also can you run lint and ensure tests are passing?

Both cache and pool tests are passing. Fixed Tracer implementation as well.

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.

3 participants