Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7e242f7
feat(drive-abci): preliminary support for event subscriptions in Plat…
lklimek Oct 2, 2025
187fd80
fix: Dockerfile
lklimek Oct 2, 2025
c3b1c1a
chore: cargo fmt
lklimek Oct 2, 2025
e3e5715
feat: rs-sdk add subscriptions feature
lklimek Oct 2, 2025
aa44c32
rs-dash-event-bus edition 2024
lklimek Oct 2, 2025
2c68c4c
chore: cargo.lock
lklimek Oct 2, 2025
953664c
dash-event-bus fixes
lklimek Oct 8, 2025
15664fb
fmt
lklimek Oct 8, 2025
bcc8a07
cargo clippy + cargo machete
lklimek Oct 8, 2025
8dcd14a
Merge remote-tracking branch 'origin/v2.1-dev' into feat/drive-event-bus
lklimek Oct 21, 2025
b8ae8cb
chore: fix build
lklimek Oct 21, 2025
9b8bc40
refactor: rewrite subscriptions to not use bi-directional streams
lklimek Oct 21, 2025
1b82c1b
chore: fix build
lklimek Oct 21, 2025
c1b30bd
chore: fmt
lklimek Oct 21, 2025
7771e32
Merge remote-tracking branch 'origin/v2.1-dev' into feat/drive-event-bus
lklimek Oct 21, 2025
1d7ca2e
chore: fix sdk
lklimek Oct 21, 2025
1bc5fb7
Merge remote-tracking branch 'origin/v2.1-dev' into feat/drive-event-bus
lklimek Oct 23, 2025
2d66a4c
chore: rabbit review and other small stuff
lklimek Oct 23, 2025
9122a58
chore: update grpc clients
lklimek Oct 23, 2025
a326b8a
chore: improve platform_events example
lklimek Oct 23, 2025
3e25658
fix(dashmate): dashmate restart --platform should restart rs-dapi and…
lklimek Oct 23, 2025
66a756d
feat(rs-dapi): keepalives for event stream
lklimek Oct 24, 2025
7c81629
chore(dapi-grpc): update protobuf clients
lklimek Oct 24, 2025
fe39bb9
Merge branch 'v2.2-dev' into feat/drive-event-bus
lklimek Oct 27, 2025
cb04779
test: exclude SubscribePlatformEvents from coverage checks
lklimek Oct 29, 2025
068dcd7
Merge remote-tracking branch 'origin/v2.2-dev' into feat/drive-event-bus
lklimek Oct 29, 2025
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
1 change: 1 addition & 0 deletions .github/scripts/check-grpc-coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# Queries that should be excluded from the check
EXCLUDED_QUERIES = {
'broadcastStateTransition', # Explicitly excluded as per requirement
'SubscribePlatformEvents', # Streaming RPC, excluded
}

# Mapping of proto query names to their expected SDK implementations
Expand Down
13 changes: 8 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2,495 changes: 2,495 additions & 0 deletions packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Comment on lines +1475 to +1504
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 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:

#!/bin/bash
# Find RPC declarations and spot mixed casing for SubscribePlatformEvents
rg -nP -C2 --type=proto $'rpc\\s+(SubscribePlatformEvents|subscribePlatformEvents)\\s*\\('

Length of output: 29


🏁 Script executed:

#!/bin/bash
# Find .proto files and search for RPC declarations to verify naming convention
fd -e proto -x cat {} + | rg -nP -C2 'rpc\s+([A-Za-z]+)\s*\(' | head -100

Length of output: 5999


🏁 Script executed:

#!/bin/bash
# Alternatively, find proto files and list them first
fd -e proto

Length of output: 199


🏁 Script executed:

#!/bin/bash
# Search for SubscribePlatformEvents in platform.proto specifically
rg -nP 'SubscribePlatformEvents|subscribePlatformEvents' packages/dapi-grpc/protos/platform/v0/platform.proto

Length of output: 62


🏁 Script executed:

#!/bin/bash
# Get full list of all RPCs in platform.proto to check overall naming pattern
rg -nP 'rpc\s+([a-zA-Z]+)\s*\(' packages/dapi-grpc/protos/platform/v0/platform.proto | grep -oP 'rpc\s+\K[a-zA-Z]+' | sort | uniq

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 subscribePlatformEvents in packages/dapi-grpc/protos/platform/v0/platform.proto (line 171) and regenerate the Java stubs to maintain consistency before release.

🤖 Prompt for AI Agents
In
packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java
around lines 1475-1504, the RPC name was generated from a proto RPC using
PascalCase; update the proto at
packages/dapi-grpc/protos/platform/v0/platform.proto (around line 171) to rename
rpc SubscribePlatformEvents(...) to rpc subscribePlatformEvents(...), then
regenerate the Java gRPC stubs so PlatformGrpc.java and any other generated
artifacts reflect the lowerCamel name; ensure you update any internal call sites
or references to use subscribePlatformEvents and run build/tests to confirm no
remaining references to the old name.


/**
* Creates a new async stub that supports all call types for the service
*/
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* <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);
}
/**
* <pre>
* Server-streaming subscription for platform events (one requeststream of responses)
* </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);
}
🤖 Prompt for AI Agents
In
packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java
around lines 1898 to 1906, the Javadoc incorrectly says "Bi-directional stream"
while the RPC is server-streaming; update the proto comment for the RPC to
describe it as "Server-streaming" (or "Server‑side streaming") instead of
bi‑directional, then re-run the proto code generation to regenerate the Java
gRPC stubs so the generated Javadoc matches the actual streaming type.


@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* <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);
}
/**
* <pre>
* Server-streaming subscription for platform events
* </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);
}
🤖 Prompt for AI Agents
In
packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java
around lines 2655 to 2664, the method Javadoc incorrectly says "Bi-directional
stream for multiplexed platform events subscriptions" while the code uses
asyncServerStreamingCall; update the RPC comment in the .proto file to describe
this RPC as "Server‑streaming" (or otherwise correct wording), then re-run
protoc to regenerate the Java stubs so the generated Javadoc reflects the
server-streaming contract (do not manually edit generated Java).

}

/**
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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
In
packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java
around lines 3025 to 3034, the Javadoc incorrectly describes the RPC as
bi-directional; update the comment to indicate this is a server-streaming
(blocking) call that returns an Iterator over PlatformSubscriptionResponse.
Change the Javadoc phrasing to mention "Server-streaming RPC; returns an
Iterator for the server stream of PlatformSubscriptionResponse" so it matches
the implementation.

}

/**
Expand Down Expand Up @@ -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>,
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -3731,6 +3806,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
.addMethod(getGetGroupInfosMethod())
.addMethod(getGetGroupActionsMethod())
.addMethod(getGetGroupActionSignersMethod())
.addMethod(getSubscribePlatformEventsMethod())
.build();
}
}
Expand Down
Loading
Loading