Skip to content

fix: initialize Curio storage before hashspace startup - #226

Merged
Kubuxu merged 3 commits into
mainfrom
fix/curio-hashspace-setup
Nov 9, 2026
Merged

Kubuxu merged 3 commits into
mainfrom
fix/curio-hashspace-setup

Conversation

@Kubuxu

@Kubuxu Kubuxu commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

Nightly CI fails across all six profiles during PDP upload with HTTP 500: no hash space range owns this hash. Curio discovers long-term storage when initializing its hashspace, but devnet registered storage only after starting the daemon.

Changes

  • Initialize fast/long-term storage metadata and register container-visible paths before launching Curio.
  • Preserve existing storage IDs, policies, and pieces.
  • Replace post-start attachment and fixed startup sleep with RPC readiness. No restart required.
  • Document the startup ordering and add storage-preservation regression coverage.

Verification

  • cargo check --locked passed.
  • cargo test --locked commands::start::curio::storage::tests::repeated_setup_preserves_existing_storage -- --exact passed.
  • Throwaway offline smoke check confirmed generated registration and long-term storage eligibility for hashspace discovery.
  • Did not run foc-devnet locally; CI provides end-to-end verification.

Failing nightly: https://github.com/FilOzone/foc-devnet/actions/runs/42601880167

Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
@Kubuxu
Kubuxu requested review from beck-8 and rvagg as code owners November 9, 2026 14:32
Copilot AI balanced review requested due to automatic review settings November 9, 2026 14:32
@FilOzzy FilOzzy added this to FOC Nov 9, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Nov 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The readiness command can abort setup during normal cold starts, and overwriting storage registrations can make previously attached storage inaccessible after restart.

2 open issues
What changed in this PR

Moves Curio storage initialization ahead of daemon startup so PDP hashspace discovery can include long-term storage on the first launch.

Changes:

  • Creates storage metadata and registers container-visible paths before starting Curio, preserving existing metadata.
  • Replaces post-start storage attachment and the fixed startup delay with an RPC readiness command.
  • Documents the startup order and adds regression coverage for preserving storage identities, policies, and pieces.
File Description
src/​commands/​start/​curio/​storage/​tests.rs Tests metadata and piece preservation across repeated setup.
src/​commands/​start/​curio/​storage.rs Initializes storage metadata and registration before startup.
src/​commands/​start/​curio/​rpc.rs Extracts the RPC readiness command into a dedicated module.
src/​commands/​start/​curio/​mod.rs Registers the RPC module and updates lifecycle documentation.
src/​commands/​start/​curio/​execute.rs Replaces post-start attachment and sleep with RPC readiness.
src/​commands/​start/​curio/​daemon.rs Initializes storage before creating and starting the container.
src/​commands/​start/​curio/​constants.rs Removes the obsolete storage-attachment delay.
README.md Documents storage initialization before hashspace discovery.

Review effort: Balanced

Comment thread src/commands/start/curio/rpc.rs Resolved
Comment thread src/commands/start/curio/storage.rs Resolved
@Kubuxu

Kubuxu commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

Initial CI run: lint and cargo tests passed; integration failed immediately after Curio launch because wait-api returned connection refused before the RPC listener started. Upstream wait-api can return immediately on RPC/version errors. Added the existing bounded fixed-delay retry helper around this read-only readiness probe. Offline smoke verification covers initial refusal followed by success and persistent refusal exhausting the retry limit. No local foc-devnet run.

Initial run: https://github.com/FilOzone/foc-devnet/actions/runs/42635640073

Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
@Kubuxu

Kubuxu commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

Latest CI is green on 4b95135: lint, cargo tests, and the full devnet startup/scenario integration job all passed. Both review comments are addressed and resolved.

Run: https://github.com/FilOzone/foc-devnet/actions/runs/42641489084

No foc-devnet instance was run locally.

@FilOzzy FilOzzy moved this from 📌 Triage to 🔎 Awaiting review in FOC Nov 9, 2026
@Kubuxu
Kubuxu merged commit e055e11 into main Nov 9, 2026
3 checks passed
@Kubuxu
Kubuxu deleted the fix/curio-hashspace-setup branch November 9, 2026 16:05
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to 🎉 Done in FOC Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

2 participants