sim(storage): set_len bypasses disk-degradation episodes that read, write and sync honour

Open Beginner friendly
#255 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Start in crates/moonpool-sim/src/storage/sim/engine.rs at schedule_set_len: compare it with schedule_read, schedule_write, and schedule_sync, which call update_disk_episode. Trace update_disk_episode and the existing storage-latency path, then verify that set_len participates in disk episodes and uses the same latency calculation as its siblings.

Written by the indexing model from the issue text.

Description

bug simulation

Found during the pre-release source audit of 8d9e779 (read-only, nothing compiled or run). Severity: medium. Status: confirmed.

Where

  • crates/moonpool-sim/src/storage/sim/engine.rs:972 (schedule_set_len)
  • crates/moonpool-sim/src/storage/sim/engine.rs:849, :891, :936 (schedule_read / schedule_write / schedule_sync, each calls update_disk_episode)
  • crates/moonpool-sim/src/storage/sim/engine.rs:1815 (update_disk_episode)

What

schedule_set_len samples write_latency directly and never calls update_disk_episode(owner_ip, now). A disk under a stall episode completes truncations and preallocations promptly while every other operation is frozen. set_len also cannot enter or expire an episode, so it shifts which operation draws the episode coin relative to a run that does the same work with writes.

Proposed fix

Route schedule_set_len through update_disk_episode and calculate_storage_latency like its siblings.

Dominant language
Rust
Stars
49
Forks
3
Avg merge
1h 4m
Merged PRs (30d)
41

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PierreZ/moonpool

All issues in PierreZ/moonpool

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.