-
Notifications
You must be signed in to change notification settings - Fork 51
feat: add fetching cardano database snapshots by epoch in client and cli #2744
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
Test Results 4 files ± 0 168 suites ±0 23m 16s ⏱️ -33s Results for commit 18dfe19. ± Comparison against base commit 29375b2. This pull request removes 11 and adds 31 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
6200f62 to
24af55f
Compare
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 👍
24af55f to
40f0677
Compare
40f0677 to
83ebcc0
Compare
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 👍
83ebcc0 to
d711d4d
Compare
…h/without offset)
- unify error handlings tests by testing the inner function that handle them directly instead of copying those tests for each - use dummy directly instead of modifying them since it does not bring much value here
So it can be re-used accross crates.
- `EpochSpecifier` enum to represents the cases between <{uint}, 'latest',
latest-{uint}>
- add `Epoch::parse_specifier`
- impl `FromStr` to epoch to avoid having downstream code specifying the
inner type of the epoch when parsing from str
- update aggregator `ExpandedEpoch` logic
- move it from the cardano db download module to its parent module so all cardano db commmands can use it. - make the unused parameters list configurable
With `{epoch}` either a number, `latest`, or `latest-x` where X is a
number
+ Add support for `latest` / `latest-x` on the route
`cardano-stake-distribution/epoch/{epoch}`
+ add epoch lists for cardano database (cdb), indexed by epoch number + refactor cardano stake distribution (csd) epoch list gen: - use a common mechanism with cdb - change index from str to epoch number
... to generate cardano stake distribution & cardano database lists per epoch. Note: this means adding `mithril-build-script` as a straight dependency for `mithril-aggregator-fake`, this is fine since it's a test only tool.
The idea was to avoid import of `EpochSpecifier` in callers but since the import is needed anyway to match the result it's more clear for it to be part of the specifier api.
d711d4d to
a03655f
Compare
6560a47 to
fc11abe
Compare
* mithril-build-script from `0.2.27` to `0.2.28` * mithril-aggregator from `0.7.88` to `0.7.89` * mithril-client-cli from `0.12.32` to `0.12.33` * mithril-client-wasm from `0.9.6` to `0.9.7` * mithril-client from `0.12.33` to `0.12.34` * mithril-common from `0.6.23` to `0.6.24` * mithril-aggregator-fake from `0.4.14` to `0.4.15` * mithril-end-to-end from `0.4.105` to `0.4.106` * [js] client-wasm-ci-test from `0.3.11` to `0.3.12` * [js] mithril-client-wasm from `0.9.6` to `0.9.7`
fc11abe to
18dfe19
Compare
Content
This PR add new capabilities to the client library and the client-cli
cardano_database_v2: add new methods to fetch snapshots for a specific epoch, for the latest epoch, or for the latest epoch with an offsetcardano_stake_distribution: add new methods to fetch snapshots for the latest epoch, or for the latest epoch with an offsetcardano-databasecommand: add a new--epochparameter to fetch snapshots for a specific epoch, for the latest epoch, or for the latest epoch with an offset (i.e.--epoch 4,--epoch latest,--epoch latest-4)Details
cardano-database listparameters table.latest-5mithril-commonEpoch:EpochSpecifierto store user inputs in the form of<number>,latest,latest-<number>coming for either http routes path or the cli.Epoch::parse_specifierFromStrtoEpochto allow child crates to do"87".parse::<Epoch>()instead of"87".parse::<u64>().map(Epoch)mithril-clientlibrarycardano_stake_distributionclient:get_for_latest_epochandget_for_latest_epoch_with_offsetcardano_database_v2client:list_by_epoch,list_for_latest_epoch, andlist_for_latest_epoch_with_offsetlatestorlatest-<offset>mithril-client-clicardano-databasecommands:warn_unused_parameter_with_v1_backendlogic so it can be reused in other commands thandownloadlistcommand: add--epochparameter which is parsed into aEpochSpecifierand is only honored if the backend is set tov2(else a warning is print)mithril-client-wasmget_cardano_stake_distribution_for_latest_epochlist_cardano_database_v2_per_epoch,list_cardano_database_v2_for_latest_epoch***_for_latest_epochfunctions allow to pass a json object which contains an optional offset, i.e in js:ci-testnode project to check the new functionsmithril-aggregator-fake/artifact/cardano-database/epoch/{epoch}route with support oflatestandlatest-{offset}/artifact/cardano-stake-distribution/epoch/{epoch}route: add support oflatestandlatest-{offset}mithril-build-scriptcardano_database_snapshot_list_per_epoch,cardano_stake_distributions_per_epochcardano_database_snapshot_epochs(indexed by epoch number)cardano_stake_distribution_epochskey from&strto an epoch numberPre-submit checklist
Issue(s)
Relates to #2704