cache data tries between blocks#7554
Merged
BeniaminDrasovean merged 10 commits intofeat/collapse-trie-based-on-sizefrom Apr 7, 2026
Merged
cache data tries between blocks#7554BeniaminDrasovean merged 10 commits intofeat/collapse-trie-based-on-sizefrom
BeniaminDrasovean merged 10 commits intofeat/collapse-trie-based-on-sizefrom
Conversation
…data-tries-caching-between-blocks # Conflicts: # state/accountsDB.go # state/triesHolder/dataTriesHolder.go
Base automatically changed from
collapse-main-trie-leaves
to
feat/collapse-trie-based-on-size
April 6, 2026 10:32
…' into data-tries-caching-between-blocks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to cache account data tries across block commits by avoiding full resets of the data-tries holder and instead tracking which cached tries were modified (“dirty”) between commits.
Changes:
- Extend
common.TriesHolderwith aMarkAsDirty([]byte)method to explicitly flag cached tries as modified. - Update
AccountsDB.saveDataTrieto mark an already-cached trie as dirty instead of re-inserting it, and stop resettingdataTriesduringcommit(). - Enhance
dataTriesHolderto supportMarkAsDirtyand add additional trace logging around cache/eviction behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| testscommon/trie/triesHolderStub.go | Adds MarkAsDirty to the test stub. |
| state/triesHolder/triesHolder.go | Adds no-op MarkAsDirty for the simple holder implementation. |
| state/triesHolder/dataTriesHolder.go | Implements MarkAsDirty and adds trace logs for cache operations/evictions. |
| state/accountsDB.go | Marks cached data tries as dirty and keeps cached tries across commits. |
| common/interface.go | Extends TriesHolder interface with MarkAsDirty. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ssd04
previously approved these changes
Apr 6, 2026
ssd04
approved these changes
Apr 6, 2026
miiu96
approved these changes
Apr 7, 2026
0a430b9
into
feat/collapse-trie-based-on-size
8 of 9 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?