1. Apr 22, 2024
  2. Apr 05, 2024
    • Alessandro Siniscalchi's avatar
      [parachain-template] benchmarks into `mod benchmarks` (#3818) · 33bbdb3c
      Alessandro Siniscalchi authored
      
      
      This PR introduces a dedicated module for benchmarks within the
      parachain runtime. By segregating benchmarks into their own module, we
      achieve a cleaner project structure and improved readability,
      facilitating easier maintenance and updates.
      
      ### Key Changes:
      - **New Benchmarks Module**: A new file `benchmarks.rs` is added,
      encapsulating the benchmarking code for various pallets.
      - **Refactoring `lib.rs`**: The main runtime library file (`lib.rs`) has
      been updated to reflect the extraction of benchmark definitions. By
      moving these definitions to `benchmarks.rs`, we reduce clutter in
      `lib.rs`, streamlining the runtime's core logic and configuration.
      
      ### Benefits of This Refactoring:
      - **Focused Benchmarking**: Developers can now easily locate and modify
      benchmarks without navigating through the core runtime logic, enabling
      targeted performance improvements.
      - **Cleaner Codebase**: Segregating benchmarks from the main runtime
      logic helps maintain a clean, well-organized codebase, simplifying
      navigation and maintenance.
      - **Scalability**: As the parachain evolves, adding or updating
      benchmarks becomes more straightforward, supporting scalability and
      adaptability of the runtime.
      
      ### Summary of Changes:
      - Created `benchmarks.rs` to house the benchmarking suite.
      - Streamlined `lib.rs` by removing the inlined benchmark definitions and
      linking to the new benchmarks module.
      
      ---------
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      33bbdb3c
  3. Apr 04, 2024
  4. Apr 02, 2024
  5. Apr 01, 2024
    • Alessandro Siniscalchi's avatar
      [parachain-template] pallet configurations into `mod configs` (#3809) · 8d305343
      Alessandro Siniscalchi authored
      
      
      This PR introduces a refactor of the parachain runtime configuration by
      consolidating all pallet configurations into a new module named
      `configs`. This change aims to improve the readability and
      maintainability of the runtime configuration by centralizing all
      configuration parameters.
      
      ## Changes
      - **Creation of `configs.rs`**: A new file `configs.rs` has been added
      under `templates/parachain/runtime/src/`, containing all the runtime
      configurations previously scattered across `lib.rs`.
      - **Refactoring of `lib.rs`**: The `lib.rs` file has been significantly
      slimmed down by removing the inline pallet configurations and importing
      them from `configs.rs` instead.
      - **Optimization of Import Statements**: Reorganized import statements
      to clarify the runtime's dependency structure.
      
      ### Benefits
      - **Improved Readability**: With configurations being centralized,
      developers can now easily locate and review runtime parameters without
      navigating through the `lib.rs` file.
      
      This refactor does not introduce any changes to the runtime logic but
      improves the project structure for better development experience.
      
      ---------
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      8d305343
  6. Mar 28, 2024
    • Alessandro Siniscalchi's avatar
      [parachain-template] runtime API Implementations into `mod apis` (#3817) · 60846a08
      Alessandro Siniscalchi authored
      This PR significantly refactors the runtime API implementations to
      improve project structure, maintainability, and readability. Key changes
      include:
      
      1. **Enhancing Visibility**: Adjusts the visibility of
      `RUNTIME_API_VERSIONS` in `impl_runtime_apis.rs` to `pub`, making it
      accessible throughout the runtime module.
      2. **Centralizing API Implementations**: Introduces a new file,
      `apis.rs`, within the parachain template's runtime directory.
      3. **Streamlining `lib.rs`**: Updates the main runtime library file to
      reflect these structural changes. It removes redundant API
      implementations and points `VERSION` to the newly exposed
      `RUNTIME_API_VERSIONS` from `apis.rs`, simplifying the overall runtime
      configuration.
      
      ### Motivations Behind the Refactoring:
      - **Improved Project Structure**: Centralizing API implementations in
      `apis.rs` offers a clearer, more navigable project structure.
      - **Better Readability**: Streamlining `lib.rs` and reducing clutter
      enhance readability, making it easier for new contributors to understand
      the project layout and logic.
      
      ### Summary of Changes:
      - Made `RUNTIME_API_VERSIONS` public in `impl_runtime_apis.rs`.
      - Added `apis.rs` to centralize runtime API implementations.
      - Streamlined `lib.rs` to adjust to the refactored project structure.
      60846a08
  7. Mar 27, 2024
  8. Mar 19, 2024
    • Juan Ignacio Rios's avatar
      Add HRMP notification handlers to the xcm-executor (#3696) · 8b3bf39a
      Juan Ignacio Rios authored
      Currently the xcm-executor returns an `Unimplemented` error if it
      receives any HRMP-related instruction.
      What I propose here, which is what we are currently doing in our forked
      executor at polimec, is to introduce a trait implemented by the executor
      which will handle those instructions.
      
      This way, if parachains want to keep the default behavior, they just use
      `()` and it will return unimplemented, but they can also implement their
      own logic to establish HRMP channels with other chains in an automated
      fashion, without requiring to go through governance.
      
      Our implementation is mentioned in the [polkadot HRMP
      docs](https://arc.net/l/quote/hduiivbu
      
      ), and it was suggested to us to
      submit a PR to add these changes to polkadot-sdk.
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: command-bot <>
      8b3bf39a
  9. Mar 18, 2024
  10. Mar 17, 2024
  11. Mar 15, 2024
  12. Mar 13, 2024
  13. Mar 05, 2024
    • Kian Paimani's avatar
      Repot all templates into a single directory (#3460) · 4c810609
      Kian Paimani authored
      The first step towards
      https://github.com/paritytech/polkadot-sdk/issues/3155
      
      Brings all templates under the following structure
      
      ```
      templates
      |   parachain
      |   |   polkadot-launch
      |   |   runtime              --> parachain-template-runtime
      |   |   pallets              --> pallet-parachain-template
      |   |   node                 --> parachain-template-node
      |   minimal
      |   |   runtime              --> minimal-template-runtime
      |   |   pallets              --> pallet-minimal-template
      |   |   node                 --> minimal-template-node
      |   solochain
      |   |   runtime              --> solochain-template-runtime
      |   |   pallets              --> pallet-template (the naming is not consistent here)
      |   |   node                 --> solochain-template-node
      ```
      
      The only note-worthy changes in this PR are: 
      
      - More `Cargo.toml` fields are forwarded to use the one from the
      workspace.
      - parachain template now has weights and benchmarks
      - adds a shell pallet to the minimal template
      - remove a few unused deps 
      
      
      A list of possible follow-ups: 
      
      - [ ] Unify READMEs, create a parent README for all
      - [ ] remove references to `docs.substrate.io` in templates
      - [ ] make all templates use `#[derive_impl]`
      - [ ] update and unify all licenses
      - [ ] Remove polkadot launch, use
      https://github.com/paritytech/polkadot-sdk/blob/35349df993ea2e7c4769914ef5d199e787b23d4c/cumulus/zombienet/examples/small_network.toml
      instead.
      4c810609