- 
                Notifications
    You must be signed in to change notification settings 
- Fork 44
feat(drive-abci): preliminary support for event subscriptions in Platform #2795
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
base: v2.2-dev
Are you sure you want to change the base?
Changes from all commits
7e242f7
              187fd80
              c3b1c1a
              e3e5715
              aa44c32
              2c68c4c
              953664c
              15664fb
              bcc8a07
              8dcd14a
              b8ae8cb
              9b8bc40
              1b82c1b
              c1b30bd
              7771e32
              1d7ca2e
              1bc5fb7
              2d66a4c
              9122a58
              a326b8a
              3e25658
              66a756d
              7c81629
              fe39bb9
              cb04779
              068dcd7
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|  | @@ -1472,6 +1472,37 @@ org.dash.platform.dapi.v0.PlatformOuterClass.GetGroupActionSignersResponse> getG | |||||||||||||||||||||||||||||||||||||||||
| return getGetGroupActionSignersMethod; | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||
| private static volatile io.grpc.MethodDescriptor<org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionRequest, | ||||||||||||||||||||||||||||||||||||||||||
| org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionResponse> getSubscribePlatformEventsMethod; | ||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||
| @io.grpc.stub.annotations.RpcMethod( | ||||||||||||||||||||||||||||||||||||||||||
| fullMethodName = SERVICE_NAME + '/' + "SubscribePlatformEvents", | ||||||||||||||||||||||||||||||||||||||||||
| requestType = org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionRequest.class, | ||||||||||||||||||||||||||||||||||||||||||
| responseType = org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionResponse.class, | ||||||||||||||||||||||||||||||||||||||||||
| methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) | ||||||||||||||||||||||||||||||||||||||||||
| public static io.grpc.MethodDescriptor<org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionRequest, | ||||||||||||||||||||||||||||||||||||||||||
| org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionResponse> getSubscribePlatformEventsMethod() { | ||||||||||||||||||||||||||||||||||||||||||
| io.grpc.MethodDescriptor<org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionRequest, org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionResponse> getSubscribePlatformEventsMethod; | ||||||||||||||||||||||||||||||||||||||||||
| if ((getSubscribePlatformEventsMethod = PlatformGrpc.getSubscribePlatformEventsMethod) == null) { | ||||||||||||||||||||||||||||||||||||||||||
| synchronized (PlatformGrpc.class) { | ||||||||||||||||||||||||||||||||||||||||||
| if ((getSubscribePlatformEventsMethod = PlatformGrpc.getSubscribePlatformEventsMethod) == null) { | ||||||||||||||||||||||||||||||||||||||||||
| PlatformGrpc.getSubscribePlatformEventsMethod = getSubscribePlatformEventsMethod = | ||||||||||||||||||||||||||||||||||||||||||
| io.grpc.MethodDescriptor.<org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionRequest, org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionResponse>newBuilder() | ||||||||||||||||||||||||||||||||||||||||||
| .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) | ||||||||||||||||||||||||||||||||||||||||||
| .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SubscribePlatformEvents")) | ||||||||||||||||||||||||||||||||||||||||||
| .setSampledToLocalTracing(true) | ||||||||||||||||||||||||||||||||||||||||||
| .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( | ||||||||||||||||||||||||||||||||||||||||||
| org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionRequest.getDefaultInstance())) | ||||||||||||||||||||||||||||||||||||||||||
| .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( | ||||||||||||||||||||||||||||||||||||||||||
| org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionResponse.getDefaultInstance())) | ||||||||||||||||||||||||||||||||||||||||||
| .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("SubscribePlatformEvents")) | ||||||||||||||||||||||||||||||||||||||||||
| .build(); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| return getSubscribePlatformEventsMethod; | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||
| * Creates a new async stub that supports all call types for the service | ||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||
|  | @@ -1864,6 +1895,16 @@ public void getGroupActionSigners(org.dash.platform.dapi.v0.PlatformOuterClass.G | |||||||||||||||||||||||||||||||||||||||||
| io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetGroupActionSignersMethod(), responseObserver); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||
| * <pre> | ||||||||||||||||||||||||||||||||||||||||||
| * Bi-directional stream for multiplexed platform events subscriptions | ||||||||||||||||||||||||||||||||||||||||||
| * </pre> | ||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||
| public void subscribePlatformEvents(org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionRequest request, | ||||||||||||||||||||||||||||||||||||||||||
| io.grpc.stub.StreamObserver<org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionResponse> responseObserver) { | ||||||||||||||||||||||||||||||||||||||||||
| io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSubscribePlatformEventsMethod(), responseObserver); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| 
      Comment on lines
    
      +1898
     to 
      +1906
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Javadoc mismatch: it’s server‑streaming, not bi‑di. Doc says “Bi-directional” but the method and handlers are SERVER_STREAMING. Update proto comments (then regenerate) to prevent confusion. -   * Bi-directional stream for multiplexed platform events subscriptions
+   * Server-streaming subscription for platform events (one request → stream of responses)📝 Committable suggestion
 
        Suggested change
       
 🤖 Prompt for AI Agents | ||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||
| @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { | ||||||||||||||||||||||||||||||||||||||||||
| return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) | ||||||||||||||||||||||||||||||||||||||||||
| .addMethod( | ||||||||||||||||||||||||||||||||||||||||||
|  | @@ -2195,6 +2236,13 @@ public void getGroupActionSigners(org.dash.platform.dapi.v0.PlatformOuterClass.G | |||||||||||||||||||||||||||||||||||||||||
| org.dash.platform.dapi.v0.PlatformOuterClass.GetGroupActionSignersRequest, | ||||||||||||||||||||||||||||||||||||||||||
| org.dash.platform.dapi.v0.PlatformOuterClass.GetGroupActionSignersResponse>( | ||||||||||||||||||||||||||||||||||||||||||
| this, METHODID_GET_GROUP_ACTION_SIGNERS))) | ||||||||||||||||||||||||||||||||||||||||||
| .addMethod( | ||||||||||||||||||||||||||||||||||||||||||
| getSubscribePlatformEventsMethod(), | ||||||||||||||||||||||||||||||||||||||||||
| io.grpc.stub.ServerCalls.asyncServerStreamingCall( | ||||||||||||||||||||||||||||||||||||||||||
| new MethodHandlers< | ||||||||||||||||||||||||||||||||||||||||||
| org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionRequest, | ||||||||||||||||||||||||||||||||||||||||||
| org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionResponse>( | ||||||||||||||||||||||||||||||||||||||||||
| this, METHODID_SUBSCRIBE_PLATFORM_EVENTS))) | ||||||||||||||||||||||||||||||||||||||||||
| .build(); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|  | @@ -2603,6 +2651,17 @@ public void getGroupActionSigners(org.dash.platform.dapi.v0.PlatformOuterClass.G | |||||||||||||||||||||||||||||||||||||||||
| io.grpc.stub.ClientCalls.asyncUnaryCall( | ||||||||||||||||||||||||||||||||||||||||||
| getChannel().newCall(getGetGroupActionSignersMethod(), getCallOptions()), request, responseObserver); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||
| * <pre> | ||||||||||||||||||||||||||||||||||||||||||
| * Bi-directional stream for multiplexed platform events subscriptions | ||||||||||||||||||||||||||||||||||||||||||
| * </pre> | ||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||
| public void subscribePlatformEvents(org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionRequest request, | ||||||||||||||||||||||||||||||||||||||||||
| io.grpc.stub.StreamObserver<org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionResponse> responseObserver) { | ||||||||||||||||||||||||||||||||||||||||||
| io.grpc.stub.ClientCalls.asyncServerStreamingCall( | ||||||||||||||||||||||||||||||||||||||||||
| getChannel().newCall(getSubscribePlatformEventsMethod(), getCallOptions()), request, responseObserver); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| 
      Comment on lines
    
      +2655
     to 
      +2664
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Client async stub: fix Javadoc to “Server‑streaming”. Call uses asyncServerStreamingCall (correct); only the comment needs updating (do it in proto and regenerate). -   * Bi-directional stream for multiplexed platform events subscriptions
+   * Server-streaming subscription for platform events📝 Committable suggestion
 
        Suggested change
       
 🤖 Prompt for AI Agents | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||
|  | @@ -2962,6 +3021,17 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.GetGroupActionSignersRespons | |||||||||||||||||||||||||||||||||||||||||
| return io.grpc.stub.ClientCalls.blockingUnaryCall( | ||||||||||||||||||||||||||||||||||||||||||
| getChannel(), getGetGroupActionSignersMethod(), getCallOptions(), request); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||
| * <pre> | ||||||||||||||||||||||||||||||||||||||||||
| * Bi-directional stream for multiplexed platform events subscriptions | ||||||||||||||||||||||||||||||||||||||||||
| * </pre> | ||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||
| public java.util.Iterator<org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionResponse> subscribePlatformEvents( | ||||||||||||||||||||||||||||||||||||||||||
| org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionRequest request) { | ||||||||||||||||||||||||||||||||||||||||||
| return io.grpc.stub.ClientCalls.blockingServerStreamingCall( | ||||||||||||||||||||||||||||||||||||||||||
| getChannel(), getSubscribePlatformEventsMethod(), getCallOptions(), request); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| 
      Comment on lines
    
      +3025
     to 
      +3034
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blocking stub: fix Javadoc; returns Iterator for server stream. Implementation is correct; adjust wording to server‑streaming. -   * Bi-directional stream for multiplexed platform events subscriptions
+   * Server-streaming subscription for platform events🤖 Prompt for AI Agents | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||
|  | @@ -3417,6 +3487,7 @@ public com.google.common.util.concurrent.ListenableFuture<org.dash.platform.dapi | |||||||||||||||||||||||||||||||||||||||||
| private static final int METHODID_GET_GROUP_INFOS = 44; | ||||||||||||||||||||||||||||||||||||||||||
| private static final int METHODID_GET_GROUP_ACTIONS = 45; | ||||||||||||||||||||||||||||||||||||||||||
| private static final int METHODID_GET_GROUP_ACTION_SIGNERS = 46; | ||||||||||||||||||||||||||||||||||||||||||
| private static final int METHODID_SUBSCRIBE_PLATFORM_EVENTS = 47; | ||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||
| private static final class MethodHandlers<Req, Resp> implements | ||||||||||||||||||||||||||||||||||||||||||
| io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, | ||||||||||||||||||||||||||||||||||||||||||
|  | @@ -3623,6 +3694,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserv | |||||||||||||||||||||||||||||||||||||||||
| serviceImpl.getGroupActionSigners((org.dash.platform.dapi.v0.PlatformOuterClass.GetGroupActionSignersRequest) request, | ||||||||||||||||||||||||||||||||||||||||||
| (io.grpc.stub.StreamObserver<org.dash.platform.dapi.v0.PlatformOuterClass.GetGroupActionSignersResponse>) responseObserver); | ||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||
| case METHODID_SUBSCRIBE_PLATFORM_EVENTS: | ||||||||||||||||||||||||||||||||||||||||||
| serviceImpl.subscribePlatformEvents((org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionRequest) request, | ||||||||||||||||||||||||||||||||||||||||||
| (io.grpc.stub.StreamObserver<org.dash.platform.dapi.v0.PlatformOuterClass.PlatformSubscriptionResponse>) responseObserver); | ||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||
| throw new AssertionError(); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|  | @@ -3731,6 +3806,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { | |||||||||||||||||||||||||||||||||||||||||
| .addMethod(getGetGroupInfosMethod()) | ||||||||||||||||||||||||||||||||||||||||||
| .addMethod(getGetGroupActionsMethod()) | ||||||||||||||||||||||||||||||||||||||||||
| .addMethod(getGetGroupActionSignersMethod()) | ||||||||||||||||||||||||||||||||||||||||||
| .addMethod(getSubscribePlatformEventsMethod()) | ||||||||||||||||||||||||||||||||||||||||||
| .build(); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
New method descriptor correctly defined as SERVER_STREAMING; verify RPC naming style consistency.
Wiring looks correct for server streaming. However, fullMethodName uses “SubscribePlatformEvents” (PascalCase) while legacy RPCs are lowerCamel. If this wasn’t intentional at the proto level, consider aligning before release to avoid mixed conventions across languages.
Run to check proto(s) for naming consistency:
🏁 Script executed:
Length of output: 29
🏁 Script executed:
Length of output: 5999
🏁 Script executed:
Length of output: 199
🏁 Script executed:
Length of output: 62
🏁 Script executed:
Length of output: 1148
Fix RPC naming in proto to match established lowerCamel convention.
The naming inconsistency is confirmed at the proto level:
rpc SubscribePlatformEvents(...)uses PascalCase while all 45+ other RPCs in the same service use lowerCamel (e.g.,broadcastStateTransition,getConsensusParams,getDataContracts).Rename to
subscribePlatformEventsinpackages/dapi-grpc/protos/platform/v0/platform.proto(line 171) and regenerate the Java stubs to maintain consistency before release.🤖 Prompt for AI Agents