Skip to content

DomainLatestIterFile: skip DB entries within file range #20474

@sudeepdino008

Description

@sudeepdino008

Parent issue

Part of #16239 -- avoiding inconsistency due to lexicographic prune.

Problem

DomainLatestIterFile.initCursorMDBX() and advanceInFiles() in db/state/domain_stream.go push DB entries into the priority heap without checking whether their step falls within the file range. The comment // DB can store not-finished step, it means - then set first txn in step - it anyway will be ahead of files is incorrect for prunable data — DB entries whose step overlaps with files have step * stepSize < files.EndTxNum().

Affected locations

  • initCursorMDBX() LargeValues path (line ~210)
  • initCursorMDBX() DupSort path (line ~228)
  • advanceInFiles() LargeValues DB_CURSOR branch (line ~292)
  • advanceInFiles() DupSort DB_CURSOR branch (line ~312)

All four locations have the same misleading comment and lack a filesEndTxNum check.

Fix

Apply the same "skip DB entries within file range" pattern used in:

DomainLatestIterFile would need a filesEndTxNum uint64 field set during init() from domainRoTx.files.EndTxNum(), since advanceInFiles() doesn't have access to domainRoTx.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions