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(lib/runtime/storage): Don't rely on trie snapshots for storage transactions #3777

Merged
merged 60 commits into from
Mar 26, 2024

Conversation

dimartiro
Copy link
Contributor

@dimartiro dimartiro commented Feb 27, 2024

Changes

This PR aims to change the way we manage storage transactions to rely on a new StorageDiff structure instead of using trie snapshots.

Trie snapshots are a feature that makes sense for in-memory tries but makes our code too coupled and prevents us from starting to use lazy loading tries.

What I'm doing is storing the diff (trie changes) between different transactions and applying them to the trie when the last transaction is committed.

This is not only useful for decoupling this from our trie implementation but will also reduce the amount of memory we need to perform storage transactions.

Tests

make test
I also did run a node until reach more than 1.6M blocks

Issues

closes #3775

Note to reviewers

Most of the changes happen in lib/runtime/storage/trie.go and lib/runtime/storage/trie_test.go but github collapses those files. I encourage you to expand and review these files because these are the most important changes

Primary Reviewer

@EclesioMeloJunior

@dimartiro dimartiro force-pushed the diego/decouple-storage_transaction-management branch from da441fb to 3c20dae Compare February 27, 2024 23:25
dimartiro and others added 19 commits February 29, 2024 21:22
…nto diego/decouple-storage_transaction-management
…nto diego/decouple-storage_transaction-management
…3.14 (#3786)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1.19.0 (#3785)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… to 10.19.0 (#3784)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Diego <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…3793)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…nto diego/decouple-storage_transaction-management
dot/state/storage_test.go Outdated Show resolved Hide resolved
lib/runtime/interfaces.go Outdated Show resolved Hide resolved
lib/runtime/storage/storagediff.go Outdated Show resolved Hide resolved
lib/runtime/storage/storagediff.go Show resolved Hide resolved
lib/runtime/storage/storagediff.go Show resolved Hide resolved
lib/runtime/storage/storagediff.go Show resolved Hide resolved
lib/runtime/storage/storagediff.go Show resolved Hide resolved
lib/runtime/storage/storagediff.go Outdated Show resolved Hide resolved
lib/runtime/storage/storagediff.go Show resolved Hide resolved
lib/runtime/storage/storagediff.go Show resolved Hide resolved
dot/state/storage_test.go Outdated Show resolved Hide resolved
lib/runtime/interfaces.go Show resolved Hide resolved
lib/runtime/storage/storagediff.go Show resolved Hide resolved
@dimartiro dimartiro merged commit ca61197 into development Mar 26, 2024
23 of 24 checks passed
@dimartiro dimartiro deleted the diego/decouple-storage_transaction-management branch March 26, 2024 13:16
timwu20 pushed a commit that referenced this pull request Apr 19, 2024
…ge transactions (#3777)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Radosvet M <[email protected]>
Co-authored-by: Kirill <[email protected]>
Co-authored-by: JimboJ <[email protected]>
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.

(lib/runtime/storage): Modify transactions support to not rely on trie snapshots
5 participants