Skip to content

Conversation

@jpraynaud
Copy link
Member

@jpraynaud jpraynaud commented Nov 14, 2025

Content

This PR introduces a simple Aggregator Discovery functionality to the Mithril client library and CLI, allowing clients to automatically discover and connect to suitable aggregators based on their capabilities rather than requiring a hardcoded aggregator endpoint:

New mithril-aggregator-discovery crate

A standalone crate providing aggregator discovery functionality:

  • AggregatorDiscoverer trait for extensible discovery mechanisms
  • HttpConfigAggregatorDiscoverer for fetching aggregator lists from HTTP endpoints
  • ShuffleAggregatorDiscoverer decorator for randomizing aggregator selection
  • CapableAggregatorDiscoverer decorator for filtering aggregators by required capabilities
  • Added MithrilNetwork type to mithril-common for shared usage
  • Introduced RequiredAggregatorCapabilities type for cleaner capability filtering

Client integration

  • New aggregator_discoverer() method in client builder as the recommended way to configure aggregators
  • Default aggregator discoverer with shuffling support
  • Deprecated aggregator() constructor in favor of new constructor

####CLI enhancements

  • New tools aggregator-discovery command (unstable) to list available aggregators
  • JSON logs support via --json flag

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is 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
  • Documentation
    • No new TODOs introduced

Issue(s)

Closes #2726

@jpraynaud jpraynaud self-assigned this Nov 14, 2025
Copilot finished reviewing on behalf of jpraynaud November 14, 2025 16:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a simple aggregator discovery mechanism to enable the Mithril client to automatically discover and connect to available aggregators in a network.

Key changes:

  • Introduces a new mithril-aggregator-discovery crate with discoverer implementations
  • Refactors the ClientBuilder API to support aggregator discovery modes (automatic vs. explicit URL)
  • Adds capability-based filtering and randomization of aggregator selection

Reviewed Changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/mithril-aggregator-discovery/Cargo.toml Defines the new aggregator discovery crate with dependencies
internal/mithril-aggregator-discovery/src/lib.rs Exports the public API for aggregator discovery
internal/mithril-aggregator-discovery/src/interface.rs Defines the AggregatorDiscoverer trait
internal/mithril-aggregator-discovery/src/model.rs Implements MithrilNetwork and AggregatorEndpoint models
internal/mithril-aggregator-discovery/src/http_config_discoverer.rs HTTP-based discoverer that fetches aggregator lists from remote configuration
internal/mithril-aggregator-discovery/src/capabilities_discoverer.rs Filters aggregators by required capabilities
internal/mithril-aggregator-discovery/src/rand_discoverer.rs Shuffles aggregator order using randomization
internal/mithril-aggregator-discovery/src/test/ Test utilities and doubles for testing
mithril-client/src/client.rs Refactors client builder to support aggregator discovery
mithril-client/Cargo.toml Adds dependency on the new discovery crate
Makefile, Cargo.toml, .github/workflows/ci.yml Build configuration updates
README.md Documentation for the new crate

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Nov 14, 2025

Test Results

    4 files  ± 0    172 suites  +4   22m 53s ⏱️ - 2m 16s
2 242 tests +20  2 242 ✅ +20  0 💤 ±0  0 ❌ ±0 
7 009 runs  +80  7 009 ✅ +80  0 💤 ±0  0 ❌ ±0 

Results for commit 9a0ab5a. ± Comparison against base commit 07cf1c9.

♻️ This comment has been updated with latest results.

@jpraynaud jpraynaud force-pushed the jpraynaud/2726-simple-aggregator-discovery branch from 945d3c2 to c74fb50 Compare November 17, 2025 16:29
@jpraynaud jpraynaud force-pushed the jpraynaud/2726-simple-aggregator-discovery branch from c74fb50 to 434891f Compare November 18, 2025 17:50
@jpraynaud jpraynaud force-pushed the jpraynaud/2726-simple-aggregator-discovery branch from 434891f to c9f8423 Compare November 19, 2025 17:46
@jpraynaud jpraynaud force-pushed the jpraynaud/2726-simple-aggregator-discovery branch from c9f8423 to 8101ed2 Compare November 24, 2025 18:13
@jpraynaud jpraynaud requested a review from Copilot November 24, 2025 18:13
Copilot finished reviewing on behalf of jpraynaud November 24, 2025 18:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 25 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jpraynaud jpraynaud force-pushed the jpraynaud/2726-simple-aggregator-discovery branch from 8101ed2 to 4a5ec0d Compare November 25, 2025 17:41
@jpraynaud jpraynaud force-pushed the jpraynaud/2726-simple-aggregator-discovery branch from 4a5ec0d to bbb18cb Compare November 28, 2025 16:53
@jpraynaud jpraynaud requested a review from Copilot November 28, 2025 16:53
Copilot finished reviewing on behalf of jpraynaud November 28, 2025 16:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 33 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jpraynaud jpraynaud force-pushed the jpraynaud/2726-simple-aggregator-discovery branch from bbb18cb to 9a0ab5a Compare November 28, 2025 17:14
@jpraynaud jpraynaud deployed to testing-preview November 28, 2025 17:30 — with GitHub Actions Active
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.

Implement a simple aggregator discovery mechanism

2 participants