Skip to content
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

Incremental storage of Cardano transactions #1619

Merged
merged 26 commits into from
Apr 9, 2024

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Apr 8, 2024

Content

This PR optimize the retrieval of cardano transactions. Before each time a Cardano Transaction signed entity type was signed the whole cardano chain was parsed. Now we only parse the immutables that was not parsed before, with a parameter that allow to re-parse previous immutables in case of a previous failure.

There's several internal mithril-common api changes to handle that:

  • Remove TransactionStore trait: persistence is now defined by the nodes themselves.
  • Add TransactionsImporter trait to handle both parsing and (possibly if the node need it) persistence.
  • Add from_immutable parameter to TransactionParser trait: an optional lower bound, if None it tell the parser to parse everything from the start.

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
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)

Comments

We simplified some signatures that were using a CardanoDbBeacon but only needed it's immutable_file_number part.

Issue(s)

Relates to #1591

Alenar and others added 21 commits April 4, 2024 12:26
If data are stored in db returns it and don't parse/store anything
When data are partially stored in the database.
Before it would aggregate result from the not update db and the parser.
This allow to rescan immutables in case of a previous partial scan
likely when this scan failed.
The beacon parameter wasn't clearly expressing that it was an upper bound.
Since it's a sqlite limitation, it's the repository job to handle that.
Copy link

github-actions bot commented Apr 8, 2024

Test Results

    3 files  ± 0     42 suites  ±0   8m 34s ⏱️ -48s
  962 tests +16    962 ✅ +16  0 💤 ±0  0 ❌ ±0 
1 056 runs  +16  1 056 ✅ +16  0 💤 ±0  0 ❌ ±0 

Results for commit ed4d46d. ± Comparison against base commit 336c070.

♻️ This comment has been updated with latest results.

@Alenar Alenar temporarily deployed to testing-sanchonet April 8, 2024 10:14 — with GitHub Actions Inactive
@Alenar Alenar self-assigned this Apr 8, 2024
- Fix comments typo
- Rename function name
- Change `from` type to `ImmutableFileNumber` in `parse_and_store_transactions_not_imported_yet` signature
Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Alenar Alenar merged commit b9e810f into main Apr 9, 2024
41 checks passed
@Alenar Alenar deleted the ensemble/1591/incremental-storage-of-cardano-tx branch April 9, 2024 07:37
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.

None yet

4 participants