Skip to content

Refactor StaticFileProvider::check_consistency into separate file and storage checks #20506

@yongkangc

Description

@yongkangc

As noted in PR #20478 review, the current StaticFileProvider::check_consistency method performs two types of consistency checks that need to be separated for correct ordering with RocksDB checks.

Current Behavior

check_consistency does 2 types of checks:

  1. File consistency - When a static file fails to commit but the underlying data was changed (internal to static files)
  2. Storage consistency - Comparing static files vs MDBX checkpoints

Problem

RocksDB consistency checks need static file data to prune transaction hashes. The correct order should be:

  1. static_file_provider.check_file_consistency() - internal static file checks (run first)
  2. rocksdb_provider.check_consistency() - vs MDBX checkpoints, uses SF data for tx hashes
  3. static_file_provider.check_storage_consistency() - vs MDBX checkpoints (run last)

Required Changes

Refactor StaticFileProvider::check_consistency into two separate methods:

  • check_file_consistency() - handles internal file integrity
  • check_storage_consistency() - handles comparison with MDBX checkpoints

Reference: https://github.com/paradigmxyz/reth/blob/main/crates/storage/provider/src/providers/static_file/manager.rs#L995-L1105

Blocked

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-dbRelated to the databaseC-enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions