Skip to content

fix: synchronize root cache initialization - #341

Open
loglapa wants to merge 1 commit into
celestiaorg:mainfrom
loglapa:fix-338-root-race
Open

fix: synchronize root cache initialization#341
loglapa wants to merge 1 commit into
celestiaorg:mainfrom
loglapa:fix-338-root-race

Conversation

@loglapa

@loglapa loglapa commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Overview

  • synchronize lazy root cache initialization so concurrent Root calls do not race through the shared hasher or cache
  • keep a read-locked fast path for an already cached root
  • strengthen the existing concurrent regression with a simultaneous start barrier and result equality checks
  • document that concurrent Root calls are supported after tree mutation is complete

Closes #338

Verification

  • GOCACHE=/private/tmp/nmt-go-build GOMODCACHE=/private/tmp/nmt-go-mod go test -race ./...
  • GOCACHE=/private/tmp/nmt-go-build GOMODCACHE=/private/tmp/nmt-go-mod go vet ./...
  • git diff --check

@loglapa
loglapa requested a review from a team as a code owner August 28, 2026 19:04
@loglapa
loglapa requested review from vgonkivs and removed request for a team August 28, 2026 19:04
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.

NamespacedMerkleTree.Root has a data race during concurrent cache initialization

1 participant