Skip to content

Migrate from levelup/subleveldown to classic-level/sublevel #7

@axel-krapotke

Description

@axel-krapotke

Background

The current LevelDB stack uses the deprecated levelup + leveldown + subleveldown packages. These have been superseded by classic-level (or level) with built-in .sublevel() support.

Current State

The persistent command queue (queue.mjs) uses the levelup API:

  • createReadStream() for iterating entries
  • Callback-based batch() and del()
  • subleveldown for namespace isolation

Target State

Migrate to the abstract-level API:

  • iterator().all() instead of createReadStream()
  • Promise-based batch(), del(), get(), put()
  • Built-in .sublevel() instead of subleveldown

Notes

  • The on-disk format is identical between old and new APIs (same LevelDB C++ engine). User data requires no migration.
  • This should be coordinated with the corresponding migration in ODINv2 (see syncpoint/ODINv2 issue).
  • Tests currently use memdown + levelup + subleveldown — migrate to memory-level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions