Skip to content

Split mithril-common crate - Phase 2 #2392

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

Open
27 tasks
jpraynaud opened this issue Mar 25, 2025 · 0 comments
Open
27 tasks

Split mithril-common crate - Phase 2 #2392

jpraynaud opened this issue Mar 25, 2025 · 0 comments
Labels
refactoring 🛠️ Code refactoring and enhancements

Comments

@jpraynaud
Copy link
Member

Why

We want to implement the phase 2 of the split of the mithril-common crate and delegate some of its responsibilities to new crates.

What

Split responsibilities to new crates:

  • Mithril era
  • Mithril ticker
  • Cardano node internal database
  • Cardano node mini protocols
  • Web test tools (Test HTTP server and API spec)

How

  • Mithril Era:
    • Create a new crate internal/mithril-era
    • Move mithril-common/era to src
    • Except for mithril-common/era/supported_era.rs which is moved to mithril-common/entities
  • Mithril ticker:
    • Create a new crate internal/mithril-ticker
    • Move mithril-common/ticker_service.rs to src
  • Cardano node internal database:
    • Create a new crate in internal/cardano-node/mithril-cardano-node-internal-database
    • Move mithril-common/digester to src/digester
    • Move digester/immutable_file_observer.rs in src
    • Move digester/dummy_cardano_db.rs in src/test
    • Move digester/immutable_file.rs to src/entities
    • Move digester/ledger_file.rs to src/entities
    • Add the publication of the crate on crates.io
  • Cardano node chain:
    • Create an new crate in internal/cardano-node/mithril-cardano-node-chain
    • Move mithril-common/chain_observer to src
    • Move mithril-common/chain_reader to src
    • Move mithril-common/cardano_chain_scanner to src and rename it to chain_scanner
    • Move entities from src/chain_reader and src/chain_scanner to an src/entity module (ChainScannedBlocks, ScannedBlock, RawCardanoPoint, ChainBlockNextAction)
    • Web test tools (Test HTTP server and API spec):
      • Create new crates in internal/tests/mithril-api-spec and internal/tests/mithril-test-http-server
      • Remove the dependency to SupportedEra in APISpec and replace it with a String
      • Move mithril-common/test_utils/apispecs.rs to mithril-api-spec/src
      • Move mithril-common/test_utils/test_http_server.rs to mithril-test-http-server/src
  • Remove the unnecessary features in mithril-common
@jpraynaud jpraynaud added the refactoring 🛠️ Code refactoring and enhancements label Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring 🛠️ Code refactoring and enhancements
Projects
None yet
Development

No branches or pull requests

1 participant