Skip to content

Implement a simple aggregator discovery mechanism #2726

@jpraynaud

Description

@jpraynaud

Why

We want to allow the discovery of available aggregators in a Mithril network by the client. This will allow a more decentralized, reliable and scalable the network, and ease of use for the end users

What

Create an interface for a aggregator discovery mechanism and use a first simple implementation in the client.

How

Create the aggregator discoverer

  • Create a new internal/mithril-aggregator-discovery crate
  • Create a AggregatorDiscoverer trait which gives access to a list of aggregator endpoints (given Cardano network and expected capabilities of the aggregator -needs to be specified, can be a type of signed entity or the type of proof in the certificate chain, or is the aggregator a leader-) and returns an error otherwise
  • Implement a centralized aggregator discoverer based on the networks.json file at the root of the repository:
    • Do we need to add a weight to the aggregators in the list for a network?
    • Do we support the configuration in a local file?
  • Do we need to support a customizable URL for the networks.json file
  • Implement the test doubles

Use the aggregator discoverer in the client

  • In the client library:
    • Add a automatic_aggregator_discovery function to specify the usage of the aggregator discoverer.
    • If no aggregator is found, the build fails. The endpoint aggregator of the builder is filled with the one given by the inner discoverer.
  • In the client CLI:
    • Add a aggregator discovery command in tools (list the available aggregators)
    • Add an expansion of AGGREGATOR_ENDPOINT=auto to use the automatic aggregator discovery (no guarantee to use the same aggregator for 2 distinct command calls)
    • No breaking change in the commands API

Documentation

  • Document how to add a new aggregator in the discovery for a network
  • Publish manually the first version of the crate on crates.io + setup crate owner (@jpraynaud)

Later

  • In a follower aggregator, use the auto discovery for the chain synchronization to be able to match the capabilities of the aggregator (e.g. synchonize on a certificate chain with the same proof type)
  • Can we make an auto-configuration also for the verification keys and the other parameters of the client?
  • Implement a discoverer with SRV records (see CIP-0155)
  • Implement a discoverer that queries multiple discoverers

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions