Skip to content

fix(shard): disk persistence test after encryption + compression #432

Closed

Description

@gHashTag

Problem

The "5-node simulation with disk persistence" test in shard_manager.zig
was failing because it expected .

Root Cause

After encryption + ternary encoding + RLE compression, the data size
becomes much smaller than the original 2048 bytes. With shard_size=64,
this results in far fewer shards than the expected 32.

For example: 2048 bytes → compressed → 100 bytes → 2 shards (not 32)

Fix

  • Changed assertion to check instead of >= shard_count
  • Added loaded_count tracking to verify loadFromDisk() works correctly
  • Added comments explaining compression effect

Results

All 101 shard_manager tests now pass.

Files

  • src/trinity_node/shard_manager.zig

Status: ✅ Ready for merge

Activity

  1. gHashTag commented on Apr 29, 2026

    @gHashTag
    OwnerAuthor

    Issue body states fix is done. Closing.

  2. added a commit that references this issue on Apr 29, 2026
    035b2a9
  3. added a commit that references this issue on Aug 14, 2026
    c1b8a60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions