Skip to content

cache data tries between blocks#7554

Merged
BeniaminDrasovean merged 10 commits intofeat/collapse-trie-based-on-sizefrom
data-tries-caching-between-blocks
Apr 7, 2026
Merged

cache data tries between blocks#7554
BeniaminDrasovean merged 10 commits intofeat/collapse-trie-based-on-sizefrom
data-tries-caching-between-blocks

Conversation

@BeniaminDrasovean
Copy link
Copy Markdown
Contributor

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:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

Base automatically changed from collapse-main-trie-leaves to feat/collapse-trie-based-on-size April 6, 2026 10:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.TriesHolder with a MarkAsDirty([]byte) method to explicitly flag cached tries as modified.
  • Update AccountsDB.saveDataTrie to mark an already-cached trie as dirty instead of re-inserting it, and stop resetting dataTries during commit().
  • Enhance dataTriesHolder to support MarkAsDirty and 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.

Comment thread testscommon/trie/triesHolderStub.go Outdated
Comment thread state/triesHolder/dataTriesHolder.go Outdated
Comment thread state/triesHolder/dataTriesHolder.go Outdated
Comment thread state/triesHolder/dataTriesHolder.go
Comment thread state/triesHolder/dataTriesHolder.go
@BeniaminDrasovean BeniaminDrasovean marked this pull request as ready for review April 6, 2026 12:03
ssd04
ssd04 previously approved these changes Apr 6, 2026
@BeniaminDrasovean BeniaminDrasovean merged commit 0a430b9 into feat/collapse-trie-based-on-size Apr 7, 2026
8 of 9 checks passed
@BeniaminDrasovean BeniaminDrasovean deleted the data-tries-caching-between-blocks branch April 7, 2026 10:50
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.

4 participants