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

[parachain-template] refactor pallet configurations for enhanced modularity #3804

Closed

Conversation

asiniscalchi
Copy link
Contributor

@asiniscalchi asiniscalchi commented Mar 23, 2024

This series of patches refactors the configuration of various pallets into their own separate modules. The primary goal of this refactor is to improve the modularity and readability of the runtime configuration.

  • Moves the configuration for each pallet into its own module under runtime/src/configs. This includes configurations for aura, authorship, balances, and several others.
  • Each module contains the configuration parameter

@asiniscalchi asiniscalchi changed the title Refactor/pallet configs [parachain template] refactor pallet configs into modules Mar 23, 2024
@asiniscalchi asiniscalchi changed the title [parachain template] refactor pallet configs into modules [parachain template] refactor pallet configurations for enhanced modularity Mar 23, 2024
@asiniscalchi asiniscalchi marked this pull request as ready for review March 23, 2024 11:45
@asiniscalchi asiniscalchi changed the title [parachain template] refactor pallet configurations for enhanced modularity [parachain-template] refactor pallet configurations for enhanced modularity Mar 23, 2024
@asiniscalchi asiniscalchi marked this pull request as draft March 23, 2024 17:59
@asiniscalchi asiniscalchi marked this pull request as ready for review March 23, 2024 18:16
@bkchr
Copy link
Member

bkchr commented Mar 24, 2024

I'm not convinced that this improves the readability. You split up 250 lines across multiple files. IMO this makes it much harder to find all the configs. For bigger runtimes this probably makes sense, but not for such small runtimes.

@asiniscalchi
Copy link
Contributor Author

asiniscalchi commented Mar 24, 2024

An 800-line lib.rs could suggest a refactor is due for clarity and maintainability, might aligning with the parachain-template-runtime module's goal to exemplify best practices.

This proposal for refactoring is merely an initial step towards this objective.

@bkchr
Copy link
Member

bkchr commented Mar 24, 2024

Then maybe add all of them to the same config.rs. I honestly see no justification for splitting it up into that many files.

@asiniscalchi
Copy link
Contributor Author

asiniscalchi commented Mar 24, 2024

Placing all configurations in a single config.rs file is a more cautious approach.

It's a good middle ground: #3809

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