-
Notifications
You must be signed in to change notification settings - Fork 51
feat: add support for Mithril era transition in clients #2633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e1781c8 to
1d1a974
Compare
There was a problem hiding this 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 adds era-awareness to the Mithril client library and CLI by introducing a common trait for fetching the current Mithril era and allowing it to be overridden via a CLI flag.
- Added an
EraFetchertrait, aFetchedErawrapper, and an HTTP-based implementation in the library - Updated
ClientBuilderandClientto use a pluggableEraFetcher - Extended the CLI with a global
--eraflag and aForcedEraFetcherimplementation - Documentation and website manual updated to reflect the new flag and behavior
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/type_alias.rs |
Exposed SupportedEra in the public type aliases |
src/lib.rs |
Registered the new era_fetcher module and re-exported types |
src/era_fetcher.rs |
Defined EraFetcher, FetchedEra, AggregatorHttpEraFetcher |
src/client.rs |
Stored and exposed a pluggable EraFetcher in Client and builder |
src/aggregator_client.rs |
Added Status request route and a unit test for it |
mithril-client-cli/src/utils/ |
Introduced ForcedEraFetcher and wired it into the utils module |
mithril-client-cli/src/main.rs |
Added --era global argument and registered it in config |
mithril-client-cli/src/commands/mod.rs |
Factored builder config to conditionally inject ForcedEraFetcher |
docs/website/root/manual/develop/nodes/mithril-client.md |
Updated CLI manual to list --era for every command |
docs/website/adr/004-mithril-network-update-strategy.md |
Documented client-side era awareness |
Comments suppressed due to low confidence (1)
mithril-client-cli/src/utils/forced_era_fetcher.rs:1
- Add unit tests for
ForcedEraFetcherto verify thatfetch_current_erareturns the provided era string correctly.
use async_trait::async_trait;
turmelclem
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✨
jpraynaud
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Alenar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I've a concern on how era features will evolve in the client, see the comment below.
8f0eae3 to
6b8f006
Compare
6b8f006 to
72ab260
Compare
…implementation and `FetchedEra` conversion to `SupportedEra`
- Add global `--era` CLI argument to manually override the era used by the client - Implement `ForcedEraFetcher` to bypass the era retrieved from the aggregator's `/status` endpoint - Inject `ForcedEraFetcher` into the `ClientBuilder` when the `era` argument is provided - Refactor shared client builder configuration into `finalize_builder_config` to reduce duplication
…k Upgrade Strategy` ADR
…ty for era-related features - Update `Client` to expose a `MithrilEraClient` - Remove public re-exports of `EraFetcher` and `FetchedEra` from `lib.rs`
72ab260 to
0688700
Compare
Update documentation to reflect new aggregator stores directory with leader/follower feature
…tus` route response
… current Mithril era
* mithril-build-script from `0.2.24` to `0.2.25` * mithril-client-cli from `0.12.20` to `0.12.21` * mithril-client-wasm from `0.9.3` to `0.9.4` * mithril-client from `0.12.20` to `0.12.21` * mithril-aggregator-fake from `0.4.10` to `0.4.11` * [js] mithril-client-wasm from `0.9.3` to `0.9.4`
0688700 to
1ffc3da
Compare
Content
This PR includes changes to the
mithril-clientlibrary and CLI to ease and reduce friction during Mithril era transitions.mithril-client library updates:
MithrilEraClientstruct: client wrapper around anEraFetcherto improve extensibility.EraFetchertrait: defines an interface to retrieve the current Mithril era, returning aFetchedEra.FetchedErastruct: wraps a raw era string and provides conversion to aSupportedEra.AggregatorHttpEraFetcher:EraFetcherimplementation that retrieves the era from the aggregator’s/statusendpoint.ClientAPI: allows setting a customMithrilEraClientand exposes the conversion toSupportedEra.mithril-client CLI updates:
--eraglobal CLI argument: allows users to override the era manually.ForcedEraFetcher: a staticEraFetcherthat always returns the CLI-provided era.mithril-client WASM updates:
fetch_current_mithril_erafunctionPre-submit checklist
Issue(s)
Closes #2619