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

Remove Sparse Merkle tree usage from the ContractsState and ContractsAssets tables #2042

Closed
xgreenx opened this issue Jul 23, 2024 · 0 comments · Fixed by #2048
Closed

Remove Sparse Merkle tree usage from the ContractsState and ContractsAssets tables #2042

xgreenx opened this issue Jul 23, 2024 · 0 comments · Fixed by #2048
Assignees

Comments

@xgreenx
Copy link
Collaborator

xgreenx commented Jul 23, 2024

Overview

Based on the latest research that we did, there exist other Merkle trees that show better performance, less touch the storage, and produce less footprint.

Because of that, we've decided to use a tree other than SMT. But their production-ready audited implementation will take some time. Until that moment, we just need to remove usage of SMT.

Implementation details

Use a Plain blueprint instead of the Sparse for ContractsState and ContractsAssets tables.

Since the Plain blueprint doesn't implement MerkleRootStorage, in the places where we used root, we need to use and root of the empty tree.

image
MitchTurner added a commit that referenced this issue Aug 2, 2024
Fixes #2042

Added "smt" feature to the `fuel-core-storage` to enable old behavior.
The SMT still is used in the tests and in benchmarks but disabled for
the "production" mode.

## Checklist
- [x] Breaking changes are clearly marked as such in the PR description
and changelog
- [x] New behavior is reflected in tests

### Before requesting review
- [x] I have reviewed the code myself

---------

Co-authored-by: Voxelot <brandonkite92@gmail.com>
Co-authored-by: Mitch Turner <james.mitchell.turner@gmail.com>
GoldenPath1109 added a commit to GoldenPath1109/fuel-core that referenced this issue Sep 7, 2024
Fixes FuelLabs/fuel-core#2042

Added "smt" feature to the `fuel-core-storage` to enable old behavior.
The SMT still is used in the tests and in benchmarks but disabled for
the "production" mode.

## Checklist
- [x] Breaking changes are clearly marked as such in the PR description
and changelog
- [x] New behavior is reflected in tests

### Before requesting review
- [x] I have reviewed the code myself

---------

Co-authored-by: Voxelot <brandonkite92@gmail.com>
Co-authored-by: Mitch Turner <james.mitchell.turner@gmail.com>
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 a pull request may close this issue.

3 participants