Repository navigation
feat(aggregator): better ipfs timeouts handling - #3746
Merged
Merged
Conversation
Alenar
requested review from
damrobi,
jpraynaud and
turmelclem
as code owners
December 4, 2026 11:03
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Active critical and documentation issues remain, including a failure counter that never records errors and an unupdated maintained documentation copy.
3 open issues
What changed in this PR
Improves aggregator resilience to slow or cold Kubo nodes and adds metrics for upload and artifact creation failures.
Changes:
- Extends IPFS directory-listing timeouts and adds retries.
- Adds labelled upload and artifact failure metrics.
- Updates documentation and changelog.
| File | Description |
|---|---|
| mithril-aggregator/src/tools/kubo_rpc_client/query/ipfs_files_ls.rs | Uses the slow-query timeout for IPFS directory listings. |
| mithril-aggregator/src/services/signed_entity.rs | Records artifact creation failures through the metrics service. |
| mithril-aggregator/src/metrics/service.rs | Defines metrics for immutable upload and artifact creation failures. |
| mithril-aggregator/src/file_uploaders/ipfs_uploader.rs | Retries IPFS directory creation and listing operations. |
| mithril-aggregator/src/dependency_injection/builder/protocol/artifacts.rs | Injects the metrics service into artifact construction. |
| mithril-aggregator/src/artifact_builder/cardano_database.rs | Updates cardano database artifact test construction. |
| mithril-aggregator/src/artifact_builder/cardano_database_artifacts/immutable.rs | Records immutable upload failures by location type. |
| docs/website/root/manual/operate/run-aggregator-node.md | Documents the new aggregator failure metrics. |
| CHANGELOG.md | Records the IPFS timeout, retry, and metrics changes. |
Review effort: Lite
Listing the immutables MFS directory, a HAMT shard of several thousand blocks, can exceed the default 10s timeout when the Kubo node cache is cold, e.g. after a restart of the node.
Creating the MFS directory can fail on a Kubo node that was just restarted, which made the whole IPFS upload fail without retrying.
Listing the immutables MFS directory can time out when the Kubo node cache is cold, which made the whole IPFS upload fail without retrying.
…ifact builder Add a test-only `new_for_test` constructor to limit the impact on the tests.
… location type Allows the monitoring to detect a Cardano database artifact certified without one of its immutable files locations, e.g. IPFS when the Kubo node is unreachable.
… signed entity type Artifact creation failures were only visible as a warning log, they can now be monitored alongside the produced artifacts counters.
Alenar
force-pushed
the
djo/3712/aggregator-ipfs-better-timeout-handling
branch
from
December 4, 2026 14:08
2d144ab to
f02a939
Compare
* mithril-aggregator from `0.11.4` to `0.11.5`
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Content
This PR fixes the IPFS upload of the immutable files archives failing after a restart of the Kubo node. When it failed, the Cardano database artifact was certified without an IPFS location, and the aggregator kept advertising an IPFS share.
Root cause
IpfsUploader::batch_upload_to_dirlists the whole MFS directory (files/ls /mithril) to find which archives are already uploaded. The request had the default 10s timeout.testing-preview, the directory holds about 30 000 immutable archives, so Kubo stores it as a HAMT-sharded directory (made of 5 448 blocks).files lstook between about 1s and 12.5s. A warm node answers in 0.8s.Changes
files/lsquery uses the slow-query timeout (3 min per attempt) instead of the default 10s.mithril_aggregator_cardano_db_immutables_upload_total_failed_since_startup: failed upload attempts of the immutable files archives, labelled bylocation_type(ipfs,cloud_storage). This reports an artifact certified without one of its locations.ImmutableFilesUploadertrait has a newlocation_type()method.ImmutableArtifactBuildernow receives theMetricsService. Tests use the newnew_for_testconstructor.mithril_aggregator_artifact_total_failed_since_startup: artifact creation tasks that returned an error, labelled bysigned_entity_type. Until now these failures only appeared as a warning log.Pre-submit checklist
Comments
Issue(s)
Closes #3712