Skip to content

Truncate wrapped-record-hashes.pb on restart when writing is enabled (after jumpstart has read it) #26746

Description

@derektriley

Background

Description:

Problem

When hedera.recordStream.writeWrappedRecordFileBlockHashesToDisk is enabled, WrappedRecordFileBlockHashesDiskWriter appends to wrapped-record-hashes.pb
indefinitely across restarts — the file grows without bound and is never reset.

We can't naively truncate it on every restart, though: WrappedRecordBlockHashMigration reads this same file during the jumpstart flow to compute continuing
block-root hashes from a historical checkpoint. If the file were cleared before that read, jumpstart would silently lose the data it needs
(resolveRecentHashesPath() would find no file, or a stale one).

Note that V0760BlockRecordSchema.migrate() already deletes this file when writing is disabled, but that runs during Hedera.initializeStatesApi(), which is
called before the jumpstart migration executes — so that call site can't be reused for this case without reordering startup.

Acceptance Criteria

Implement the above with unit tests

Dependencies

No response

Definition of Ready (DoR) Checklist

  • Clear acceptance criteria
  • Clear and detailed description
  • Dependencies identified
  • Links to documentation
  • Should be completable in 2-3 Days
  • Initial draft of Low-level design document
  • At least high level test plan
  • Groomed/Estimated

Definition of Done (DoD) Checklist

  • Acceptance Criteria complete
  • No Codacy issues greater than minor (in new code)
  • JavaDocs updated/created
  • Code commented
  • Unit tests created/updated
  • 80% test code coverage (in new code)
  • Happy Path and major negative cases in HAPI tests as applicable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions