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

change: Rearrange crates by feature #571

Merged
merged 1 commit into from
Mar 21, 2025
Merged

Conversation

AmbientTea
Copy link
Contributor

@AmbientTea AmbientTea commented Mar 13, 2025

Description

This is a starting point for a discussion on how to better structure our code, keeping in mind that:

  • we want to de-focus the demo node/runtime in how we think about our code
  • we want to focus instead on our offering being a loosely-coupled, modular features
  • we adopted from Substrate some of their conventions, in particular their strict division of "pallet" and "primitive" crates, but for us a domain partitioning of the code would possibly make more sense (imo).

This PR groups the crates mostly by-feature (where "feature" in some cases means whatever grouping I came up with really), with some supporting crates and executables living in separate folders. The idea is that we want to better control cross-feature dependencies.

The grouping is as follows:

  • utils - self-explanatory
  • substrate-extensions - all the crates that we copied and modified from Susbtrate
  • sidechain - a "core" sidechain "feature": the domain crate, sidechain-pallet and the mc-hash functionality. I imagine this being the base feature that makes a Substrate chain a Cardano "sidechain", by referencing a genesis UTXO, dividing up slots into sidechain epochs and referencing MC blocks in header
  • committee-selection - selection, authority-selection-inherents and session-validator-management crates. This is the feature that builds on the "sidechain" feature by tying committee selection to data observable on Cardano
  • block-production-log and block-participation - I'm tempted to group those into one "feature" that builds on committee-selection by tracking the block production
  • address-associations - this builds on "sidechain" feature, by introducing an ability to tie your identity on Cardano to that on a Partner Chain
  • native-token-management - self-explanatory
  • smart-contracts - plutus-data, offchain and commands
  • mainchain-follower - no changes here, it uses types from smart-contracts to provide data to all the features above that use observability
  • cli - all CLIs that go directly into the node, including the wizard

This is following this attempted division of our system into modular "features":

image

Checklist

  • Commit sequence broadly makes sense and commits have useful messages.
  • The size limit of 400 LOC isn't needlessly exceeded
  • The PR refers to a JIRA ticket (if one exists)
  • New tests are added if needed and existing tests are updated.
  • Relevant logging and metrics added
  • Any changes are noted in the changelog.md for affected crate
  • Self-reviewed the diff

@AmbientTea AmbientTea force-pushed the rearrange-crates-by-feature branch from c90f424 to 9d3f65f Compare March 13, 2025 15:29
@AmbientTea AmbientTea changed the base branch from master to remove-block-rewards March 13, 2025 15:29
@AmbientTea AmbientTea force-pushed the rearrange-crates-by-feature branch from 9d3f65f to 870250e Compare March 13, 2025 15:34
@AmbientTea AmbientTea marked this pull request as ready for review March 13, 2025 15:44
Base automatically changed from remove-block-rewards to master March 13, 2025 15:47
@AmbientTea AmbientTea force-pushed the rearrange-crates-by-feature branch from 870250e to 16d738f Compare March 13, 2025 15:58
@AmbientTea AmbientTea force-pushed the rearrange-crates-by-feature branch 2 times, most recently from a67fd6c to d13bf82 Compare March 18, 2025 06:40
@AmbientTea AmbientTea changed the base branch from master to move-ariadne-to-selection-crate March 18, 2025 06:40
@AmbientTea AmbientTea force-pushed the move-ariadne-to-selection-crate branch 3 times, most recently from 806c1af to a7ccd2c Compare March 19, 2025 05:08
Base automatically changed from move-ariadne-to-selection-crate to master March 19, 2025 05:35
@AmbientTea AmbientTea force-pushed the rearrange-crates-by-feature branch 2 times, most recently from b3fb972 to 22815a7 Compare March 20, 2025 21:49
Signed-off-by: Nikolaos Dymitriadis <[email protected]>
@AmbientTea AmbientTea force-pushed the rearrange-crates-by-feature branch from 22815a7 to 0c20d95 Compare March 21, 2025 09:42
@AmbientTea AmbientTea enabled auto-merge (squash) March 21, 2025 09:46
@AmbientTea AmbientTea merged commit 1f8775a into master Mar 21, 2025
24 checks passed
@AmbientTea AmbientTea deleted the rearrange-crates-by-feature branch March 21, 2025 10:00
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.

2 participants