Skip to content

Implement chainsync ChainReader with pallas #1680

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

Merged
merged 49 commits into from
May 28, 2024

Conversation

jpraynaud
Copy link
Member

@jpraynaud jpraynaud commented May 15, 2024

Content

This PR includes an implementation of

  • ChainReader trait
  • PallasChainReader implementation of the chainsync mini protocol with pallas
  • FakeChainReader fake implementation

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

Issue(s)

Closes #1590

@jpraynaud jpraynaud self-assigned this May 15, 2024
Copy link

github-actions bot commented May 15, 2024

Test Results

    3 files  ±0     43 suites  ±0   8m 32s ⏱️ -2s
  991 tests +4    991 ✅ +4  0 💤 ±0  0 ❌ ±0 
1 089 runs  +4  1 089 ✅ +4  0 💤 ±0  0 ❌ ±0 

Results for commit 968f0b9. ± Comparison against base commit 7b08974.

♻️ This comment has been updated with latest results.

@falcucci falcucci temporarily deployed to testing-preview May 20, 2024 20:43 — with GitHub Actions Inactive
@falcucci falcucci temporarily deployed to testing-sanchonet May 20, 2024 20:43 — with GitHub Actions Inactive
@falcucci falcucci temporarily deployed to testing-preview May 20, 2024 22:00 — with GitHub Actions Inactive
@falcucci falcucci temporarily deployed to testing-sanchonet May 20, 2024 22:00 — with GitHub Actions Inactive
Copy link
Member Author

@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.

Thanks @falcucci for updating the PR!

Here is a list of comments following a first review of it 🙂

@falcucci falcucci temporarily deployed to testing-preview May 21, 2024 09:32 — with GitHub Actions Inactive
@falcucci falcucci temporarily deployed to testing-sanchonet May 21, 2024 09:32 — with GitHub Actions Inactive
@falcucci falcucci temporarily deployed to testing-preview May 21, 2024 10:17 — with GitHub Actions Inactive
@falcucci falcucci temporarily deployed to testing-sanchonet May 21, 2024 10:17 — with GitHub Actions Inactive
@jpraynaud jpraynaud temporarily deployed to testing-preview May 21, 2024 14:18 — with GitHub Actions Inactive
@jpraynaud jpraynaud temporarily deployed to testing-sanchonet May 21, 2024 14:18 — with GitHub Actions Inactive
falcucci and others added 24 commits May 28, 2024 11:03
- remove duplicated comment in the test code
- update error handling in the test code
- remove `pallas_network` import in `interface.rs`
- update comments in the `setup_server` function in `pallas_chain_reader.rs`
- add an enum `serveraction` with variants `rollbackwards` and `rollforwards`
- change the type of the `action` parameter in setup_server function from string to serveraction
- modify the match expressions in `setup_server` function to use `serveraction` enum variants instead of string literals
- remove unnecessary panic message from the code
- remove unnecessary comment in serveraction::rollforwards block
…nreader` and `pallaschainreader`

- add a new method `intersect_tip` to `fakechainreader`
- modify the signature of `get_next_chain_block` in `fakechainreader`
- update the `get_next_chain_block` method in `fakechainreader` implementation
- modify the signature of `get_next_chain_block` in `chainblockreader` trait
- update the `get_next_chain_block` method in `pallaschainreader` implementation
- add a new method `intersect_tip` to `pallaschainreader`
- add enums `serveraction` and `hasagency` with associated variants
- implement server setup with `hasagency` consideration for actions
- test `intersect_tip` method with agency `yes` for `pallaschainreader`
- test `get_next_chain_block` method with agency `yes` for `pallaschainreader`
- test `get_next_chain_block` method with agency `no` for `pallaschainreader`
- remove unused import `entities::chainpoint`
- update import path for `stdresult` in `chain_reader/interface.rs`
- add a new method `intersect_tip` to intersect the tip of the chain with a given point
- remove the `intersect_tip` method from the `fakechainreader` implementation
- add the `intersect_point` method to the `fakechainreader` implementation
- modify the `chain_reader` usage in the test module to call `intersect_point` instead of `intersect_tip`
- update the `interface.rs` file to include the `intersect_point` method definition for the `chainblockreader` trait in the common chain reader module
- remove the `intersect_tip` method from the `pallaschainreader` implementation
- add the `intersect_point` method to the `pallaschainreader` implementation
- update the `chain_reader` usage in the test module for the `pallaschainreader` to call `intersect_point` instead of `intersect_tip`
- uncomment intersect_point method in the chainblockreader trait
- add the `set_chain_point` method to the `chainblockreader` trait in `interface.rs`
- add the `set_chain_point` method to the `fakechainreader` struct
- add the `set_chain_point` method to the `pallaschainreader` struct
- change function name `get_fake_chain_point_backwards` to `get_fake_specific_point`
- modify function `get_fake_chain_point_backwards` to use the updated function `get_fake_specific_point`
- remove function `get_fake_chain_point_forwards`
- update references to `get_fake_intersection_point` to use `get_fake_specific_point`
- delete `default.profraw` from `mithril-common` directory
@jpraynaud jpraynaud force-pushed the jpraynaud/1590-chainsync-pallas branch from 5c550ba to 871db12 Compare May 28, 2024 09:03
- 'mithril-common' from '0.4.7' to '0.4.8wq'.
@jpraynaud jpraynaud temporarily deployed to testing-preview May 28, 2024 09:14 — with GitHub Actions Inactive
@jpraynaud jpraynaud temporarily deployed to testing-sanchonet May 28, 2024 09:14 — with GitHub Actions Inactive
@jpraynaud jpraynaud merged commit 1dd6495 into main May 28, 2024
40 of 41 checks passed
@jpraynaud jpraynaud deleted the jpraynaud/1590-chainsync-pallas branch May 28, 2024 09:26
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.

Retrieve Cardano blocks with chainsync in pallas
5 participants