Skip to content

Comments

feat: add previewnet profile#371

Merged
brunodam merged 2 commits intomainfrom
00358-previewnet-profile
Feb 20, 2026
Merged

feat: add previewnet profile#371
brunodam merged 2 commits intomainfrom
00358-previewnet-profile

Conversation

@brunodam
Copy link
Contributor

Description

This pull request introduces several improvements and refactors to the hardware requirements and profile handling logic for node deployment. The most notable changes are the addition of support for the previewnet deployment profile, the consolidation of node specification creation into a unified registry-based approach, and enhanced storage validation logic. The test suite has also been updated to reflect these changes, with new and improved mock host profiles and test cases.

Deployment profile enhancements:

  • Added support for the previewnet deployment profile throughout the codebase, including documentation, constants, supported profiles, and factory logic. [1] [2] [3]

Node specification and requirements refactor:

  • Replaced the old per-node-type spec constructors (blockNode, consensusNode) with a unified NewNodeSpec function that uses a requirements registry, improving separation of concerns between node type and deployment profile. [1] [2] [3]
  • Refactored CreateNodeSpec to validate both node type and profile, and to use the new registry-based spec creation.

Storage validation improvements:

  • Enhanced ValidateStorage in baseNode to handle separate SSD and HDD requirements, providing more granular error messages and validation logic.

Testing improvements and updates:

  • Extended MockHostProfile to support explicit SSD/HDD storage and updated its constructors and methods. [1] [2] [3]
  • Updated hardware tests to use the new node spec creation logic and expanded test cases to cover different profiles and node types, including storage validation. [1] [2] [3] [4]

These changes collectively improve the flexibility, correctness, and maintainability of node deployment and hardware validation logic.

Related Issues

Signed-off-by: Bruno De Assis Marques <bruno.marques@swirldslabs.com>
@brunodam brunodam requested a review from a team as a code owner February 19, 2026 23:54
@brunodam brunodam requested review from Copilot and crypto-pablo and removed request for crypto-pablo February 19, 2026 23:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for the previewnet deployment profile to enable proper validation of hardware requirements for Hedera Previewnet deployments. The PR refactors the hardware requirements system to use a registry-based approach that separates node type (block/consensus) from deployment profile (local/perfnet/testnet/previewnet/mainnet), and enhances storage validation to support separate SSD and HDD requirements.

Changes:

  • Added previewnet profile constant and integrated it across the codebase (constants, factory, documentation)
  • Refactored hardware requirements into a centralized registry mapping (nodeType, profile) combinations to specific BaselineRequirements
  • Enhanced storage validation to support both total storage and separate SSD/HDD storage requirements
  • Removed legacy node-specific constructors (NewBlockNodeSpec, NewConsensusNodeSpec, NewLocalNodeSpec) in favor of unified NewNodeSpec function
  • Updated test suite with new mock helpers and comprehensive test coverage for previewnet profile

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
internal/core/const.go Added ProfilePreviewnet constant and updated allProfiles list
pkg/hardware/requirements.go New file implementing the requirements registry with previewnet profile definitions
pkg/hardware/requirements_test.go New comprehensive test suite for requirements registry and previewnet validation
pkg/hardware/node_spec.go New unified node spec implementation using registry-based requirements lookup
pkg/hardware/spec.go Enhanced BaselineRequirements struct with SSD/HDD storage fields and updated String() method
pkg/hardware/factory.go Added previewnet to supported profiles and refactored CreateNodeSpec to use registry
pkg/hardware/base_node.go Enhanced storage validation with separate SSD/HDD validation logic
pkg/hardware/host_profile.go Added GetSSDStorageGB() and GetHDDStorageGB() methods to HostProfile interface
pkg/hardware/hardware_test.go Updated mock implementations and test cases for new registry-based approach
pkg/hardware/block_node.go Removed file - functionality consolidated into registry
pkg/hardware/consensus_node.go Removed file - functionality consolidated into registry
pkg/hardware/local_node.go Removed file - functionality consolidated into registry
docs/quickstart.md Updated documentation to include previewnet profile

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@brunodam brunodam force-pushed the 00358-previewnet-profile branch from 64171cd to 4021502 Compare February 20, 2026 01:28
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Bruno Marques <bruno.marques@swirldslabs.com>
Signed-off-by: Bruno De Assis Marques <bruno.marques@swirldslabs.com>
@brunodam brunodam force-pushed the 00358-previewnet-profile branch from 4021502 to 3304147 Compare February 20, 2026 04:01
@brunodam brunodam requested review from a team and leninmehedy February 20, 2026 04:31
@brunodam brunodam merged commit d9b94ff into main Feb 20, 2026
12 checks passed
@brunodam brunodam deleted the 00358-previewnet-profile branch February 20, 2026 05:42
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.

Enable support for a previewnet profile configuration

2 participants