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

Refactor ChainPoint conversion from pallas Point #2049

Merged
merged 8 commits into from
Oct 25, 2024

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Oct 24, 2024

Content

This PR introduce a new type, RawCardanoPoint, that is used in place of our ChainPoint in the transaction import process.

The RawCardanoPoint doesn't have a block number unlike ChainPoint, this allow a lossless conversion from and to the pallas point used in their chainsync implementation, avoiding the creation of ChainPoint with a block number of 0.

Also this PR changes the ScannedBlock block hash to be a bytes array as this reduce the number of conversion needed when working with pallas types as this type is only used in conjunction with those types (RawCardanoPoint also use a bytes array for the same reason).

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)

Issue(s)

Closes #2037

@Alenar Alenar self-assigned this Oct 24, 2024
Copy link

github-actions bot commented Oct 24, 2024

Test Results

    4 files  ±0     55 suites  ±0   10m 37s ⏱️ -2s
1 401 tests +4  1 401 ✅ +4  0 💤 ±0  0 ❌ ±0 
1 615 runs  +4  1 615 ✅ +4  0 💤 ±0  0 ❌ ±0 

Results for commit ddc7211. ± Comparison against base commit bf48df5.

This pull request removes 9 and adds 13 tests. Note that renamed tests count towards both.
mithril-aggregator ‑ services::cardano_transactions_importer::tests::transactions_import_start_point::cloning_keep_last_polled_chain_point
mithril-aggregator ‑ services::cardano_transactions_importer::tests::transactions_import_start_point::start_at_last_scanned_chain_point_even_if_something_stored
mithril-aggregator ‑ services::cardano_transactions_importer::tests::transactions_import_start_point::start_at_last_scanned_chain_point_when_nothing_stored
mithril-aggregator ‑ services::cardano_transactions_importer::tests::transactions_import_start_point::start_at_last_stored_chain_point_if_nothing_scanned
mithril-common ‑ cardano_block_scanner::chain_reader_block_streamer::tests::test_latest_polled_chain_point_is_none_if_nothing_was_polled
mithril-signer ‑ services::cardano_transactions::importer::service::tests::transactions_import_start_point::cloning_keep_last_polled_chain_point
mithril-signer ‑ services::cardano_transactions::importer::service::tests::transactions_import_start_point::start_at_last_scanned_chain_point_even_if_something_stored
mithril-signer ‑ services::cardano_transactions::importer::service::tests::transactions_import_start_point::start_at_last_scanned_chain_point_when_nothing_stored
mithril-signer ‑ services::cardano_transactions::importer::service::tests::transactions_import_start_point::start_at_last_stored_chain_point_if_nothing_scanned
mithril-aggregator ‑ services::cardano_transactions_importer::tests::transactions_import_start_point::cloning_keep_last_polled_point
mithril-aggregator ‑ services::cardano_transactions_importer::tests::transactions_import_start_point::importing_transactions_dont_update_start_point_if_streamer_did_nothing
mithril-aggregator ‑ services::cardano_transactions_importer::tests::transactions_import_start_point::start_at_last_scanned_point_even_if_something_stored
mithril-aggregator ‑ services::cardano_transactions_importer::tests::transactions_import_start_point::start_at_last_scanned_point_when_nothing_stored
mithril-aggregator ‑ services::cardano_transactions_importer::tests::transactions_import_start_point::start_at_last_stored_point_if_nothing_scanned
mithril-common ‑ cardano_block_scanner::chain_reader_block_streamer::tests::test_last_polled_point_is_none_if_nothing_was_polled
mithril-common ‑ cardano_block_scanner::raw_cardano_point::tests::from_chain_point_to_raw_cardano_point_conversions
mithril-common ‑ cardano_block_scanner::raw_cardano_point::tests::from_scanned_block_to_raw_cardano_point_conversions
mithril-signer ‑ services::cardano_transactions::importer::service::tests::transactions_import_start_point::cloning_keep_last_polled_point
mithril-signer ‑ services::cardano_transactions::importer::service::tests::transactions_import_start_point::importing_transactions_dont_update_start_point_if_streamer_did_nothing
…

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@sfauvel sfauvel left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@dlachaume dlachaume left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

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 force-pushed the djo/2037/refactor_chain_point branch from d4518bc to ddc7211 Compare October 25, 2024 12:55
@Alenar Alenar merged commit aad95c1 into main Oct 25, 2024
47 checks passed
@Alenar Alenar deleted the djo/2037/refactor_chain_point branch October 25, 2024 13:11
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.

Refactor ChainPoint conversion from pallas Point
4 participants