Skip to content

fix(aggregator): make IPFS uploads resilient to a large MFS directory - #3546

Merged
jpraynaud merged 5 commits into
mainfrom
jpraynaud/fix-ipfs-timeout
Sep 17, 2026
Merged

jpraynaud merged 5 commits into
mainfrom
jpraynaud/fix-ipfs-timeout

Conversation

@jpraynaud

@jpraynaud jpraynaud commented Sep 16, 2026

Copy link
Copy Markdown
Member

Content

This PR includes fixes for the IPFS upload of immutable archives failing with operation timed out on a network with a large MFS directory:

  • List the MFS directory entries without their nodes: the long listing made Kubo load every child node from the datastore while only the entry names are used to skip already uploaded archives.
  • Raise the default Kubo RPC query timeout from 1 to 10 seconds, which covers the files/stat and files/mkdir queries on a sharded directory right after a batch of uploads.
  • Retry the directory CID query in batch uploads with the uploader retry policy, so a single slow answer no longer discards a batch whose uploads all succeeded.

The original error received was:

Failed to upload immutable archive

Failed to send request to Kubo RPC endpoint: 'api/v0/files/stat'

Caused by:
    0: error sending request for url (http://ipfs-node-aggregator:5001/api/v0/files/stat?arg=%2Fmithril%2F)
    1: operation timed out

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

@jpraynaud jpraynaud self-assigned this Sep 16, 2026
Copilot AI lite review requested due to automatic review settings September 16, 2026 16:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Directory CID retry errors should use operation-appropriate context before approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Improves aggregator IPFS uploads for large MFS directories by reducing listing overhead, increasing RPC timeouts, and retrying directory CID lookups.

Changes:

  • Lists MFS entries by name without loading child nodes.
  • Raises the default Kubo RPC timeout to 10 seconds.
  • Retries directory CID retrieval and updates fixtures and package versions.
File summaries
File Summary
mithril-aggregator/src/tools/kubo_rpc_client/query/ipfs_files_ls.rs Optimizes MFS directory listings.
mithril-aggregator/src/tools/kubo_rpc_client/api.rs Increases the default RPC timeout.
mithril-aggregator/src/file_uploaders/ipfs_uploader.rs Adds directory CID retries; retry errors need operation-appropriate context.
mithril-aggregator/src/artifact_builder/cardano_database_artifacts/immutable.rs Updates IPFS uploader test fixtures.
mithril-aggregator/Cargo.toml Bumps the aggregator version.
Cargo.lock Synchronizes the locked version.
Review details
  • Files reviewed: 5/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread mithril-aggregator/src/file_uploaders/ipfs_uploader.rs
@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown

Test Results

     5 files  ±0     221 suites  ±0   1h 0m 27s ⏱️ - 4m 36s
 3 627 tests +2   3 627 ✅ +2  0 💤 ±0  0 ❌ ±0 
11 765 runs  +6  11 765 ✅ +6  0 💤 ±0  0 ❌ ±0 

Results for commit 6afbd8b. ± Comparison against base commit 4afa36e.

♻️ This comment has been updated with latest results.

@jpraynaud
jpraynaud deployed to testing-2-preview September 16, 2026 16:41 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-preview September 16, 2026 16:41 — with GitHub Actions Active
@jpraynaud
jpraynaud force-pushed the jpraynaud/fix-ipfs-timeout branch from b9a7b64 to 2a18b01 Compare September 16, 2026 16:52
@jpraynaud
jpraynaud deployed to testing-2-preview September 16, 2026 17:06 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-preview September 16, 2026 17:06 — with GitHub Actions Active
Comment thread mithril-aggregator/src/file_uploaders/ipfs_uploader.rs Outdated
@jpraynaud
jpraynaud force-pushed the jpraynaud/fix-ipfs-timeout branch from 2a18b01 to 066c36c Compare September 17, 2026 10:06
@jpraynaud
jpraynaud deployed to testing-preview September 17, 2026 10:26 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-2-preview September 17, 2026 10:26 — with GitHub Actions Active
The long listing made Kubo load every child node from the datastore
while only the entry names are used to skip already uploaded files.
A one second budget expired on 'files/stat' of a large sharded MFS
directory right after a batch of uploads.
The helper is about to wrap the IPFS directory CID query, whose
exhaustion must not be reported as an upload failure.
A single slow answer discarded a batch whose uploads all succeeded.
* mithril-aggregator from `0.10.6` to `0.10.7`
@jpraynaud
jpraynaud force-pushed the jpraynaud/fix-ipfs-timeout branch from 066c36c to 6afbd8b Compare September 17, 2026 14:27
@jpraynaud
jpraynaud deployed to testing-preview September 17, 2026 14:44 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-2-preview September 17, 2026 14:44 — with GitHub Actions Active
@jpraynaud
jpraynaud merged commit f92a069 into main Sep 17, 2026
52 checks passed
@jpraynaud
jpraynaud deleted the jpraynaud/fix-ipfs-timeout branch September 17, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants