-
Notifications
You must be signed in to change notification settings - Fork 39
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
Redesign mithril client api #1332
Commits on Nov 13, 2023
-
Remove lib section from
mithril-client-cli
cargo tomlElse the new `mithril-client` crate will conflict with it as they would share the same name. Note: current lib usages, and rust doc, had to be updated since this change the import path.
Configuration menu - View commit details
-
Copy full SHA for 52fe45b - Browse repository at this point
Copy the full SHA 52fe45bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 999db69 - Browse repository at this point
Copy the full SHA 999db69View commit details -
Configuration menu - View commit details
-
Copy full SHA for cba498e - Browse repository at this point
Copy the full SHA cba498eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2ad48a6 - Browse repository at this point
Copy the full SHA 2ad48a6View commit details -
CertificateClient can now validate Certificates
Doing this required to address a circular dependency: The certificate client need to have a certificate verifier that need to have a certificate retriever that was implemented by the certificate client. To solve this a internal type, `InternalCertificateRetriever` is added to implement the `CertificateRetriever` trait.
Configuration menu - View commit details
-
Copy full SHA for af61ea7 - Browse repository at this point
Copy the full SHA af61ea7View commit details -
(re)Add the
Client
type + implement most of theClientBuilder
This new `Client` is just a struct that hold an Arc to each of the available subclients.
Configuration menu - View commit details
-
Copy full SHA for 1a08b4d - Browse repository at this point
Copy the full SHA 1a08b4dView commit details -
Scaffold a complete mithril stake distribution integration tests
Including: list, get (latest hash from list), verify certificate chain, and message validation.
Configuration menu - View commit details
-
Copy full SHA for f867487 - Browse repository at this point
Copy the full SHA f867487View commit details -
Configuration menu - View commit details
-
Copy full SHA for f29e53f - Browse repository at this point
Copy the full SHA f29e53fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 696094c - Browse repository at this point
Copy the full SHA 696094cView commit details -
Refactor
AggregatorClient
to pass explicit operation to its methodsThis allow to hide from the trait that the aggregator client works using http, making this design more robust if we change the way to communicate to an aggregator.
Configuration menu - View commit details
-
Copy full SHA for 4d37a90 - Browse repository at this point
Copy the full SHA 4d37a90View commit details -
+ Change the snapshot client `show` method into a `get` method that return an option. This is in order to have the same method name on all clients. + Note: the test doesn't handle the download right now, it will be added later.
Configuration menu - View commit details
-
Copy full SHA for 83bbd35 - Browse repository at this point
Copy the full SHA 83bbd35View commit details -
Rework message computation to be able to take in dependencies
Using a builder pattern, manually setting dependencies is optional since if they're missing the builder will be able to construct them by itself.
Configuration menu - View commit details
-
Copy full SHA for 9f7d70b - Browse repository at this point
Copy the full SHA 9f7d70bView commit details -
Move Message to and from Certificate conversions in a try into impl
and adapt existing adapters to just use the try into. This make far more simple to switch between the message and the concrete type, we don't need to define an adapter anymore (are the adapters really usefull ?).
Configuration menu - View commit details
-
Copy full SHA for fde7d2f - Browse repository at this point
Copy the full SHA fde7d2fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e4845f8 - Browse repository at this point
Copy the full SHA e4845f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e9a653 - Browse repository at this point
Copy the full SHA 0e9a653View commit details -
Configuration menu - View commit details
-
Copy full SHA for 46a658c - Browse repository at this point
Copy the full SHA 46a658cView commit details -
Split snapshot downloading responsability appart from the aggregator …
…client It was strange that the aggregator client was handling the snapshot download since by design a snapshot can be downloaded using something else than http (ipfs, torrent, ...). This make easier to add new snapshot location type to the client.
Configuration menu - View commit details
-
Copy full SHA for 006fa94 - Browse repository at this point
Copy the full SHA 006fa94View commit details -
Configuration menu - View commit details
-
Copy full SHA for 87f73c9 - Browse repository at this point
Copy the full SHA 87f73c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 985a87c - Browse repository at this point
Copy the full SHA 985a87cView commit details -
Correcly handle
Url::join
behaviour with trailing slashThe trailing slash is significant. Without it, the last path component is considered to be a “file” name to be removed. When `aggregator_url` is ending with a trailing slash (ex: https://whatever/aggregator/), the `Url::join` with the endpoint works fine => https://whatever/aggregator/endpoint In case there is no trailing slash in the `aggregator_url` (ex: https://whatever/aggregator), the `Url::join` with the endpoint remove the last part of the url => https://whatever/endpoint
Configuration menu - View commit details
-
Copy full SHA for adefecd - Browse repository at this point
Copy the full SHA adefecdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5baae8b - Browse repository at this point
Copy the full SHA 5baae8bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d75b34 - Browse repository at this point
Copy the full SHA 2d75b34View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0fb89b3 - Browse repository at this point
Copy the full SHA 0fb89b3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ed284cf - Browse repository at this point
Copy the full SHA ed284cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for de325a4 - Browse repository at this point
Copy the full SHA de325a4View commit details -
Add complementary data in snapshot download events
- `download_id`: a unique identifier (build using uuid::v4) to track individual download even with simultaneous downloads. - `size` to the 'progress' event: allow a completion percentage without the need to keep data in memory.
Configuration menu - View commit details
-
Copy full SHA for 743ef86 - Browse repository at this point
Copy the full SHA 743ef86View commit details -
Use feedback system in certificate chain validation
In order to do so the `verify_certificate_chain` method of the verifier could not be used since we can't known when an individual certificate is valid.
Configuration menu - View commit details
-
Copy full SHA for 2936258 - Browse repository at this point
Copy the full SHA 2936258View commit details -
Configuration menu - View commit details
-
Copy full SHA for e8ea932 - Browse repository at this point
Copy the full SHA e8ea932View commit details -
Refactor Certificate verification so all traits are defined by the cl…
…ient This allow to reduce the number of re-export of `mithril-common` needed since we can now use a `CerticateMessage` as our main certicate type instead of using the `mithril_common::entities::Certificate` full type. Meaning that we don't have to re-export crypto helpers or types anymore ! To do so we define a new `CertificateVerifier` trait that only have a method that validate a chain and implement it with a new `MithrilCertificateVerifier` struct that use internally the verifier from `mithril-common`. As with the `InternalCertificateRetriever` this add some complexity to this specific part but the trade-off for it are worth it (as said before: no crypto type re-export leading to far less mithril-common dependency on the api level).
Configuration menu - View commit details
-
Copy full SHA for 4320842 - Browse repository at this point
Copy the full SHA 4320842View commit details -
Remove unneeded common re-export and rework the those who are left
Using `pub use` instead of `pub type` lead to a better rust-doc since the re-exported type are displayed as 'internal' type instead of alias. + Move all alias to a dedicated mod to cleanup the `lib.rs`.
Configuration menu - View commit details
-
Copy full SHA for 7e959cc - Browse repository at this point
Copy the full SHA 7e959ccView commit details -
Export content of the client & message submodules in the lib
This simplify the import of those types that are likely the one that will be the most used by third parties. Co-authored-by: Damien Lachaume <dlachaumepalo@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for b50b344 - Browse repository at this point
Copy the full SHA b50b344View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1587b81 - Browse repository at this point
Copy the full SHA 1587b81View commit details -
Configuration menu - View commit details
-
Copy full SHA for 02727a7 - Browse repository at this point
Copy the full SHA 02727a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 40ee582 - Browse repository at this point
Copy the full SHA 40ee582View commit details -
Configuration menu - View commit details
-
Copy full SHA for 76597aa - Browse repository at this point
Copy the full SHA 76597aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 717c97d - Browse repository at this point
Copy the full SHA 717c97dView commit details -
Fix typos and move `certificate().verify_chain` before `snapshot().download_unpack` in integration test, doc and example.
Configuration menu - View commit details
-
Copy full SHA for c04bd7a - Browse repository at this point
Copy the full SHA c04bd7aView commit details -
Fix rust doc url in developer docs and update missing replacements of…
… 'mithril-client' to 'mithril-client-cli'
Configuration menu - View commit details
-
Copy full SHA for a82986f - Browse repository at this point
Copy the full SHA a82986fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 636690e - Browse repository at this point
Copy the full SHA 636690eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0cfca39 - Browse repository at this point
Copy the full SHA 0cfca39View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7166920 - Browse repository at this point
Copy the full SHA 7166920View commit details -
- Fix outdated `utils` module documentation. - Add more details on a hack comment. - rename `aggregator_url` to `aggregator_endpoint`. - rename `SnapshotDownloadComplete` mithril event to `SnapshotDownloadCompleted`. - Add a Todo on the verify chain to specify that we want to merge most of its code in the `mithril-common` codebase.
Configuration menu - View commit details
-
Copy full SHA for 0da1e2d - Browse repository at this point
Copy the full SHA 0da1e2dView commit details -
Remove
build-binary
feature frommithril-client-cli
Since the cli won't be used anymore to define the client library.
Configuration menu - View commit details
-
Copy full SHA for dda5462 - Browse repository at this point
Copy the full SHA dda5462View commit details -
Configuration menu - View commit details
-
Copy full SHA for 86d7577 - Browse repository at this point
Copy the full SHA 86d7577View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b450ab - Browse repository at this point
Copy the full SHA 1b450abView commit details -
Typos in dev documentation and lib.rs
Configuration menu - View commit details
-
Copy full SHA for b5bdb83 - Browse repository at this point
Copy the full SHA b5bdb83View commit details -
Simplify
mithril-client
dependency to tokioOnly use the features that we needs
Configuration menu - View commit details
-
Copy full SHA for 89ef912 - Browse repository at this point
Copy the full SHA 89ef912View commit details -
Configuration menu - View commit details
-
Copy full SHA for d35906f - Browse repository at this point
Copy the full SHA d35906fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 53a0dc7 - Browse repository at this point
Copy the full SHA 53a0dc7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 64150ca - Browse repository at this point
Copy the full SHA 64150caView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3148bf4 - Browse repository at this point
Copy the full SHA 3148bf4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 76347c5 - Browse repository at this point
Copy the full SHA 76347c5View commit details