Skip to content

statetrie: continue in-memory merkle patricia trie implementation#6514

Draft
cce wants to merge 7 commits intoalgorand:masterfrom
cce:trienodes_2
Draft

statetrie: continue in-memory merkle patricia trie implementation#6514
cce wants to merge 7 commits intoalgorand:masterfrom
cce:trienodes_2

Conversation

@cce
Copy link
Copy Markdown
Contributor

@cce cce commented Dec 9, 2025

Continues work from #5767

bbroder-uji and others added 5 commits January 3, 2024 13:51
Convert triestats fields from int to atomic.Uint64 to allow safe
concurrent access from parallel tests and goroutines. Update all
increment operations to use .Add(1) and accessor methods to use
.Load() and .Store().

Replace global bytes.Buffer variables (bnbuffer, lnbuffer) with
stack-local buffers in serialize() methods to avoid data races
when multiple goroutines serialize nodes concurrently.
@cce cce added the Enhancement label Dec 9, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 64.00000% with 117 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.76%. Comparing base (3780647) to head (6333889).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crypto/statetrie/branch.go 62.16% 24 Missing and 4 partials ⚠️
crypto/statetrie/ext.go 71.27% 17 Missing and 10 partials ⚠️
crypto/statetrie/stats.go 0.00% 20 Missing ⚠️
crypto/statetrie/nodes.go 0.00% 12 Missing ⚠️
crypto/statetrie/backing.go 54.54% 10 Missing ⚠️
crypto/statetrie/leaf.go 85.91% 10 Missing ⚠️
crypto/statetrie/trie.go 65.51% 5 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6514      +/-   ##
==========================================
- Coverage   47.86%   47.76%   -0.10%     
==========================================
  Files         662      662              
  Lines       87936    88173     +237     
==========================================
+ Hits        42087    42114      +27     
- Misses      43085    43269     +184     
- Partials     2764     2790      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants