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

chore: wiring framework module #17385

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import com.hedera.node.config.types.BlockStreamWriterMode;
import com.hedera.node.config.types.DiskNetworkExport;
import com.hedera.pbj.runtime.io.buffer.Bytes;
import com.swirlds.common.wiring.tasks.AbstractTask;
import com.swirlds.config.api.Configuration;
import com.swirlds.platform.state.service.PlatformStateService;
import com.swirlds.platform.state.service.schemas.V0540PlatformStateSchema;
Expand Down Expand Up @@ -90,6 +89,7 @@
import javax.inject.Singleton;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.hiero.wiring.framework.tasks.AbstractTask;

@Singleton
public class BlockStreamManagerImpl implements BlockStreamManager {
Expand Down
17 changes: 17 additions & 0 deletions hedera-node/hedera-app/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (C) 2025 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import com.hedera.node.app.config.ServicesConfigExtension;
import com.swirlds.config.api.ConfigurationExtension;

Expand Down Expand Up @@ -42,6 +58,7 @@
requires com.swirlds.merkle;
requires com.swirlds.merkledb;
requires com.swirlds.virtualmap;
requires org.hiero.wiring.framework;
requires com.google.common;
requires com.google.protobuf;
requires io.grpc.netty;
Expand Down
30 changes: 17 additions & 13 deletions platform-sdk/swirlds-common/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (C) 2025 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module com.swirlds.common {

/* Exported packages. This list should remain alphabetized. */
Expand Down Expand Up @@ -61,17 +77,6 @@
exports com.swirlds.common.utility.throttle;
exports com.swirlds.common.jackson;
exports com.swirlds.common.units;
exports com.swirlds.common.wiring;
exports com.swirlds.common.wiring.component;
exports com.swirlds.common.wiring.counters;
exports com.swirlds.common.wiring.model;
exports com.swirlds.common.wiring.schedulers;
exports com.swirlds.common.wiring.schedulers.builders;
exports com.swirlds.common.wiring.tasks;
exports com.swirlds.common.wiring.transformers;
exports com.swirlds.common.wiring.wires;
exports com.swirlds.common.wiring.wires.input;
exports com.swirlds.common.wiring.wires.output;

/* Targeted exports */
exports com.swirlds.common.crypto.internal to
Expand Down Expand Up @@ -140,18 +145,17 @@
com.swirlds.platform.gui;
exports com.swirlds.common.startup;
exports com.swirlds.common.threading.atomic;
exports com.swirlds.common.wiring.model.diagram;
exports com.swirlds.common.concurrent;
exports com.swirlds.common.merkle.synchronization.stats;

requires transitive com.hedera.pbj.runtime;
requires transitive com.swirlds.base;
requires transitive com.swirlds.config.api;
requires transitive com.swirlds.logging;
requires transitive com.swirlds.metrics.api;
requires transitive com.swirlds.metrics.impl;
requires transitive com.fasterxml.jackson.core;
requires transitive com.fasterxml.jackson.databind;
requires transitive com.hedera.pbj.runtime;
requires transitive io.prometheus.simpleclient;
requires transitive lazysodium.java;
requires transitive org.apache.logging.log4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 Hedera Hashgraph, LLC
* Copyright (C) 2021-2025 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,6 @@

import com.hedera.pbj.runtime.io.buffer.BufferedData;
import com.hedera.pbj.runtime.io.buffer.Bytes;
import com.swirlds.common.wiring.tasks.AbstractTask;
import com.swirlds.config.api.Configuration;
import com.swirlds.merkledb.FileStatisticAware;
import com.swirlds.merkledb.Snapshotable;
Expand Down Expand Up @@ -51,6 +50,7 @@
import org.apache.logging.log4j.Logger;
import org.eclipse.collections.api.tuple.primitive.IntObjectPair;
import org.eclipse.collections.impl.map.mutable.primitive.IntObjectHashMap;
import org.hiero.wiring.framework.tasks.AbstractTask;

/**
* This is a hash map implementation where the bucket index is in RAM and the buckets are on disk.
Expand Down
26 changes: 13 additions & 13 deletions platform-sdk/swirlds-merkledb/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* (c) 2016-2021 Swirlds, Inc.
* Copyright (C) 2016-2025 Hedera Hashgraph, LLC
*
* This software is the confidential and proprietary information of
* Swirlds, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Swirlds.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* SWIRLDS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
* THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
* TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SWIRLDS SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
Expand All @@ -27,11 +26,12 @@
exports com.swirlds.merkledb.files.hashmap;
exports com.swirlds.merkledb.utilities;

requires transitive com.hedera.pbj.runtime;
requires transitive com.swirlds.common;
requires transitive com.swirlds.config.api;
requires transitive com.swirlds.metrics.api;
requires transitive com.swirlds.virtualmap;
requires transitive com.hedera.pbj.runtime;
requires transitive org.hiero.wiring.framework;
requires com.swirlds.base;
requires com.swirlds.config.extensions;
requires com.swirlds.logging;
Expand Down
17 changes: 16 additions & 1 deletion platform-sdk/swirlds-platform-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
// SPDX-License-Identifier: Apache-2.0
/*
* Copyright (C) 2025 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id("org.hiero.gradle.module.library")
id("org.hiero.gradle.feature.publish-artifactregistry")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
import com.swirlds.common.crypto.Signature;
import com.swirlds.common.notification.NotificationEngine;
import com.swirlds.common.platform.NodeId;
import com.swirlds.common.wiring.WiringConfig;
import com.swirlds.common.wiring.model.WiringModel;
import com.swirlds.common.wiring.model.WiringModelBuilder;
import com.swirlds.config.api.Configuration;
import com.swirlds.platform.SwirldsPlatform;
import com.swirlds.platform.consensus.ConsensusSnapshot;
Expand Down Expand Up @@ -73,6 +70,9 @@
import java.util.function.Consumer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.hiero.wiring.framework.WiringConfig;
import org.hiero.wiring.framework.model.WiringModel;
import org.hiero.wiring.framework.model.WiringModelBuilder;

/**
* Builds a {@link SwirldsPlatform} instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.swirlds.common.context.PlatformContext;
import com.swirlds.common.notification.NotificationEngine;
import com.swirlds.common.platform.NodeId;
import com.swirlds.common.wiring.model.WiringModel;
import com.swirlds.platform.consensus.ConsensusSnapshot;
import com.swirlds.platform.crypto.KeysAndCerts;
import com.swirlds.platform.event.PlatformEvent;
Expand All @@ -46,6 +45,7 @@
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import org.hiero.wiring.framework.model.WiringModel;

/**
* This record contains core utilities and basic objects needed to build a platform. It should not contain any platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.Objects;
import org.hiero.wiring.framework.component.ComponentWiring;

/**
* The advanced platform builder is responsible for constructing platform components. This class is exposed so that
Expand All @@ -116,7 +117,7 @@
* <li>A component must not communicate with other components except through the wiring framework
* (with a very small number of exceptions due to tech debt that has not yet been paid off).</li>
* <li>A component should have an interface and at default implementation.</li>
* <li>A component should use {@link com.swirlds.common.wiring.component.ComponentWiring ComponentWiring} to define
* <li>A component should use {@link ComponentWiring ComponentWiring} to define
* wiring API.</li>
* <li>The order in which components are constructed should not matter.</li>
* <li>A component must not be a static singleton or use static stateful variables in any way.</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2024 Hedera Hashgraph, LLC
* Copyright (C) 2023-2025 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,11 +20,6 @@
import com.swirlds.cli.utility.AbstractCommand;
import com.swirlds.cli.utility.SubcommandOf;
import com.swirlds.common.context.PlatformContext;
import com.swirlds.common.wiring.model.WiringModel;
import com.swirlds.common.wiring.model.WiringModelBuilder;
import com.swirlds.common.wiring.model.diagram.ModelEdgeSubstitution;
import com.swirlds.common.wiring.model.diagram.ModelGroup;
import com.swirlds.common.wiring.model.diagram.ModelManualLink;
import com.swirlds.config.api.Configuration;
import com.swirlds.config.api.ConfigurationBuilder;
import com.swirlds.platform.builder.ApplicationCallbacks;
Expand All @@ -38,6 +33,11 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.hiero.wiring.framework.model.WiringModel;
import org.hiero.wiring.framework.model.WiringModelBuilder;
import org.hiero.wiring.framework.model.diagram.ModelEdgeSubstitution;
import org.hiero.wiring.framework.model.diagram.ModelGroup;
import org.hiero.wiring.framework.model.diagram.ModelManualLink;
import picocli.CommandLine;

@CommandLine.Command(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2024 Hedera Hashgraph, LLC
* Copyright (C) 2023-2025 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,14 +19,6 @@
import com.swirlds.cli.utility.AbstractCommand;
import com.swirlds.cli.utility.SubcommandOf;
import com.swirlds.common.context.PlatformContext;
import com.swirlds.common.wiring.model.WiringModel;
import com.swirlds.common.wiring.model.WiringModelBuilder;
import com.swirlds.common.wiring.model.diagram.ModelEdgeSubstitution;
import com.swirlds.common.wiring.model.diagram.ModelGroup;
import com.swirlds.common.wiring.model.diagram.ModelManualLink;
import com.swirlds.common.wiring.schedulers.TaskScheduler;
import com.swirlds.common.wiring.schedulers.builders.TaskSchedulerType;
import com.swirlds.common.wiring.wires.SolderType;
import com.swirlds.config.api.Configuration;
import com.swirlds.config.api.ConfigurationBuilder;
import com.swirlds.platform.config.DefaultConfiguration;
Expand All @@ -35,6 +27,14 @@
import java.util.Base64;
import java.util.List;
import java.util.Set;
import org.hiero.wiring.framework.model.WiringModel;
import org.hiero.wiring.framework.model.WiringModelBuilder;
import org.hiero.wiring.framework.model.diagram.ModelEdgeSubstitution;
import org.hiero.wiring.framework.model.diagram.ModelGroup;
import org.hiero.wiring.framework.model.diagram.ModelManualLink;
import org.hiero.wiring.framework.schedulers.TaskScheduler;
import org.hiero.wiring.framework.schedulers.builders.TaskSchedulerType;
import org.hiero.wiring.framework.wires.SolderType;
import picocli.CommandLine;

@CommandLine.Command(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Hedera Hashgraph, LLC
* Copyright (C) 2024-2025 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,14 +16,14 @@

package com.swirlds.platform.components;

import com.swirlds.common.wiring.component.InputWireLabel;
import com.swirlds.platform.components.appcomm.CompleteStateNotificationWithCleanup;
import com.swirlds.platform.listeners.ReconnectCompleteNotification;
import com.swirlds.platform.listeners.StateWriteToDiskCompleteNotification;
import com.swirlds.platform.system.state.notifications.IssNotification;
import com.swirlds.platform.system.state.notifications.StateHashedNotification;
import com.swirlds.platform.system.status.PlatformStatus;
import edu.umd.cs.findbugs.annotations.NonNull;
import org.hiero.wiring.framework.component.InputWireLabel;

/**
* A component that wraps around a notification engine, for sending notifications to the app.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Hedera Hashgraph, LLC
* Copyright (C) 2024-2025 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,10 +16,10 @@

package com.swirlds.platform.components;

import com.swirlds.common.wiring.component.InputWireLabel;
import com.swirlds.platform.consensus.EventWindow;
import com.swirlds.platform.internal.ConsensusRound;
import edu.umd.cs.findbugs.annotations.NonNull;
import org.hiero.wiring.framework.component.InputWireLabel;

/**
* The gateway for disseminating {@link EventWindow} instances to the rest of the platform.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Hedera Hashgraph, LLC
* Copyright (C) 2024-2025 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,11 +16,11 @@

package com.swirlds.platform.components;

import com.swirlds.common.wiring.component.InputWireLabel;
import com.swirlds.platform.state.signed.ReservedSignedState;
import com.swirlds.platform.state.signed.SignedState;
import com.swirlds.platform.wiring.components.StateAndRound;
import edu.umd.cs.findbugs.annotations.NonNull;
import org.hiero.wiring.framework.component.InputWireLabel;

/**
* Controls which signed states should be written to disk based on input from other components.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Hedera Hashgraph, LLC
* Copyright (C) 2024-2025 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,10 +16,10 @@

package com.swirlds.platform.components.appcomm;

import com.swirlds.common.wiring.component.InputWireLabel;
import com.swirlds.platform.state.signed.ReservedSignedState;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import org.hiero.wiring.framework.component.InputWireLabel;

/**
* Responsible for notifying the app of the latest complete state.
Expand Down
Loading