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

Refactor Service and move it to platform-sdk #13084

Closed
Tracked by #10988
imalygin opened this issue May 6, 2024 · 1 comment · Fixed by #13331
Closed
Tracked by #10988

Refactor Service and move it to platform-sdk #13084

imalygin opened this issue May 6, 2024 · 1 comment · Fixed by #13331
Assignees
Labels
Platform Tickets pertaining to the platform

Comments

@imalygin
Copy link
Member

imalygin commented May 6, 2024

The goal of this ticket is to make it possible for PlatformState to utilize schema framework that allows a service to have a protobuf definition and provides a way to migrate from one version to the other.

To make it work, several things have to happen:

  1. Current service Service interface needs to be split in two parts:

Service:

public interface Service {
    String getServiceName();
    void registerSchemas(@NonNull SchemaRegistry registry, @NonNull SemanticVersion version);
}

amd
RpcService:

public interface RpcService extends Service {   
    Set<RpcServiceDefinition> rpcDefinitions();
}
  1. RpcService remains in hedera-app-spi while Service and a set of related classes such as:
MigrationContext
GenesisRecordsBuilder
NodeInfo
NetworkInfo
SelfNodeInfo
SchemaRegistry
StateDefinition

should migrate to platform-sdk.

Here is how the class dependencies look like:

image

This refactoring will unblock the next refactoring #11771

@imalygin imalygin self-assigned this May 6, 2024
@imalygin imalygin changed the title Extract AppState interface from Service and use it where it's applicable Split Service into two interfaces - RpcService and Service. Move Service to platform-sdk May 15, 2024
@imalygin imalygin changed the title Split Service into two interfaces - RpcService and Service. Move Service to platform-sdk Define PlatformState as Service May 15, 2024
@imalygin imalygin changed the title Define PlatformState as Service Refactor Service and move it to platform-sdk May 15, 2024
@netopyr
Copy link
Contributor

netopyr commented May 28, 2024

I think it is wrong to move GenesisRecordsBuilder, NodeInfo, NetworkInfo, and SelfNodeInfo to platform.

If platform wants to reuse the migration functionality, we need to find a different design to provide additional data.

@poulok poulok added the Platform Tickets pertaining to the platform label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform Tickets pertaining to the platform
Projects
None yet
3 participants