Skip to content

Serve verified uncommitted blocks to seq-only lookups in CachedStorage - #497

Open
samliok wants to merge 10 commits into
mainfrom
fix/cachedstorage-seq-only-lookup
Open

Serve verified uncommitted blocks to seq-only lookups in CachedStorage#497
samliok wants to merge 10 commits into
mainfrom
fix/cachedstorage-seq-only-lookup

Conversation

@samliok

@samliok samliok commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

CachedStorage keeps verified-but-not-yet-finalized blocks in a cache keyed by digest. The msm sealing-block checks (buildBlockOrTransitionEpoch, areWeReadyToTransitionEpoch) look blocks up by sequence only and pass a zero digest, so they can never hit the cache. The lookup falls through to committed storage, and while the sealing block is notarized but not yet indexed, block building fails with failed to retrieve sealing block for previous epoch. The failed build is not retried, so the leader misses its round and the round empty-notarizes.

Comment thread adapters.go Outdated
Comment thread adapters.go Outdated
Comment thread adapters.go Outdated
Comment thread adapters.go

item, exists := cs.cache[digest]
if exists {
cs.lock.RUnlock()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why the locking change?

Comment thread adapters.go

// If we are requesting an empty digest, and the sequence is not found in storage,
// check if we have verified but not indexed this sequence
if err == common.ErrBlockNotFound && digest == (common.Digest{}) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

shouldn't this be: f err == common.ErrBlockNotFound || digest == (common.Digest{}) ?

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