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

Avoid cloning of in-memory structs on apply_block #149

Closed
bobbinth opened this issue Jan 16, 2024 · 2 comments
Closed

Avoid cloning of in-memory structs on apply_block #149

bobbinth opened this issue Jan 16, 2024 · 2 comments
Assignees
Labels
store Related to the store component
Milestone

Comments

@bobbinth
Copy link
Contributor

Currently, we clone in-memory data structures before we apply changes to them (e.g., see here). This is done to make sure that the received changes result in a valid update before applying them.

While this works, it will probably get pretty expensive once we have more data in the chain. A better approach would be to compute the updates without cloning the data, then validate the changes, and then apply the updates. To enable this, 0xPolygonMiden/crypto#222 will need to be implemented first.

@bobbinth bobbinth added the store Related to the store component label Jan 16, 2024
@bobbinth bobbinth changed the title Avoid cloning of in-memory structs on `apply_block Avoid cloning of in-memory structs on apply_block Jan 16, 2024
@bobbinth bobbinth added this to the v0.4 milestone May 4, 2024
@bobbinth bobbinth modified the milestones: v0.4, v0.5 Jun 10, 2024
@bobbinth bobbinth modified the milestones: v0.5, v0.6 Jul 22, 2024
@bobbinth
Copy link
Contributor Author

Once #528 is merged, we should be able to address this issue by using the new compute_mutations() and apply_mutations() method of the Sparse Merkle trees.

@polydez
Copy link
Contributor

polydez commented Oct 30, 2024

Resolved by #532

@polydez polydez closed this as completed Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
store Related to the store component
Projects
Status: Done
Development

No branches or pull requests

2 participants