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(pkg/trie/triedb): node level caching #4239

Open
wants to merge 20 commits into
base: development
Choose a base branch
from

Conversation

timwu20
Copy link
Contributor

@timwu20 timwu20 commented Oct 9, 2024

Changes

  • Introduces CachedNode and CachedValue which is used in the TrieCache interface. These are analogous types to codec.EncodedNode and codec.EncodedValue.
  • Adds CachedNodeAccess to the recorder and is recorded accordingly
  • Adds caching functionality to mutable TrieDB functions.
  • Introduces TrieDB.GetHash and triedb.GetWith functions that use TrieLookup with supplied cache.
  • Tests for proper caching functionality

Tests

go test -tags integration github.com/ChainSafe/gossamer

Issues

closes #4157

@timwu20 timwu20 force-pushed the tim/refactor-triedb-caching branch 4 times, most recently from 30419cd to 941f91d Compare October 11, 2024 17:41
@timwu20 timwu20 marked this pull request as ready for review October 11, 2024 18:02
Base automatically changed from tim/refactor-triedb to development October 15, 2024 14:41
@timwu20 timwu20 requested a review from P1sar as a code owner October 15, 2024 19:45
pkg/trie/triedb/nibbles/nibbleslice.go Outdated Show resolved Hide resolved
pkg/trie/triedb/cache.go Outdated Show resolved Hide resolved
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.

2 participants