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

refactor: allow switching Store.blocks implementation #676

Closed
wants to merge 3 commits into from

Conversation

MegaRedHand
Copy link
Collaborator

Second version of #611

@MegaRedHand MegaRedHand requested a review from a team as a code owner January 23, 2024 18:33
@MegaRedHand MegaRedHand self-assigned this Jan 23, 2024
@spec store_block(t(), Types.root(), SignedBeaconBlock.t()) :: t()
def store_block(%{inner: blocks} = state, block_root, signed_block) do
new_blocks = Map.put(blocks, block_root, signed_block)
%{state | inner: new_blocks}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should find a different solution that doesn't store the blocks in store when they are in memory. There should be a common api to store blocks if it's on memory or on db, and they should not leak like in this case IMO.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand that it is done like this to not break spec test, but there has to be a better way.

@MegaRedHand
Copy link
Collaborator Author

Closing this since we dropped support for in-memory storage

@MegaRedHand MegaRedHand deleted the store-interface-refactor branch January 26, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants