-
Notifications
You must be signed in to change notification settings - Fork 44
fix(dashmate): incompatible tenderdash version #2786
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
Conversation
WalkthroughAdds four new unary Platform RPC endpoints across Java, Python, Objective-C, and Web clients: getIdentityByNonUniquePublicKeyHash, getFinalizedEpochInfos, getTokenContractInfo, and getTokenPerpetualDistributionLastClaim. Updates generated stubs, service registration, message/types (notably Objective-C/Web), and dashmate config/migrations to use tenderdash image dashpay/tenderdash:1-dev. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Platform as Platform gRPC Service
note over Client,Platform: New unary endpoints
rect rgba(200,235,255,0.25)
Client->>Platform: getIdentityByNonUniquePublicKeyHash(req)
Platform-->>Client: IdentityResponse | Proof | Metadata
end
rect rgba(200,255,220,0.25)
Client->>Platform: getFinalizedEpochInfos(req)
Platform-->>Client: FinalizedEpochInfos (epochs, proposers) | Metadata
end
rect rgba(255,235,200,0.25)
Client->>Platform: getTokenContractInfo(req)
Platform-->>Client: TokenContractInfoData | Proof | Metadata
end
rect rgba(235,220,255,0.25)
Client->>Platform: getTokenPerpetualDistributionLastClaim(req)
Platform-->>Client: LastClaimInfo | Proof | Metadata
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.39.5)packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.javaThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
🧹 Nitpick comments (7)
packages/dashmate/configs/getConfigFileMigrationsFactory.js (1)
1109-1109
: Use base.get(...) instead of hardcoding the Tenderdash tag.Keeps the migration in sync with defaults and avoids drift if the default image changes.
- options.platform.drive.tenderdash.docker.image = 'dashpay/tenderdash:1-dev'; + options.platform.drive.tenderdash.docker.image = base.get('platform.drive.tenderdash.docker.image');packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java (1)
514-543
: Add proto docs for new RPCs to propagate to all languages.Python stubs show “Missing associated documentation comment in .proto file.” Consider adding brief comments in platform.proto for these four RPCs.
Also applies to: 700-729, 1227-1256, 1289-1319
packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts (2)
7075-7130
: Direct purchase prices request retainedIf this surface is planned for deprecation in favor of contract‑info, consider marking the proto field/message as deprecated to propagate @deprecated into generated typings.
Confirm intended support status of GetTokenDirectPurchasePrices alongside the new contract-info RPC.
8703-8729
: BurnEvent gains burnFromId: backward‑compatible, but check consumersProtobuf addition is wire‑compatible; TS AsObject now always includes burnFromId (empty when absent). Verify any UI/SDK logic that previously assumed only amount/publicNote.
If needed, update docs/changelogs to mention the new field to integrators.
packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h (3)
2485-2502
: Clarify pagination semantics for startAfter“Give one result after a previous result” is ambiguous. Please document what
startAfter
is (identity ID? serialized identity? cursor token?) and whether repeated calls iterate all matches deterministically.
6085-6214
: Verify request param naming vs SDK usage (tokenId vs contractId)This request expects
tokenId
(32 bytes). In packages/js-evo-sdk/src/tokens/facade.ts (Lines 91‑94) the method iscontractInfo(contractId: string)
and passes that togetTokenContractInfo
. If callers pass a contract ID here, results will be wrong.Rename parameter to
tokenId
and update any call sites.Apply in JS SDK (illustrative):
-async contractInfo(contractId: string): Promise<any> { +async contractInfo(tokenId: string): Promise<any> { - const w = await this sdk.getWasmSdkConnected(); - return w.getTokenContractInfo(contractId); + const w = await this sdk.getWasmSdkConnected(); + return w.getTokenContractInfo(tokenId); }
6085-6130
: Naming nit: avoid ‘data_p’ in new public response if possible
GetTokenContractInfoResponseV0
usesdata_p
due to reserved naming. If the proto is still malleable, consider naming the fieldcontractInfo
to avoid_p
suffix in generated Obj‑C and improve readability across languages.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
📒 Files selected for processing (10)
packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java
(27 hunks)packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h
(10 hunks)packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h
(9 hunks)packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m
(4 hunks)packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py
(13 hunks)packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts
(8 hunks)packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts
(10 hunks)packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js
(8 hunks)packages/dashmate/configs/defaults/getBaseConfigFactory.js
(1 hunks)packages/dashmate/configs/getConfigFileMigrationsFactory.js
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
packages/**/**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
packages/**/**/*.{js,ts,jsx,tsx}
: Adhere to ESLint with Airbnb/TypeScript configs for JS/TS code
Use camelCase for JS/TS variables and functions
Use PascalCase for JS/TS classes
Prefer kebab-case filenames within JS packages
Files:
packages/dashmate/configs/getConfigFileMigrationsFactory.js
packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts
packages/dashmate/configs/defaults/getBaseConfigFactory.js
packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js
packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts
🧬 Code graph analysis (7)
packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts (2)
packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py (1)
Platform
(789-1589)packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts (8)
GetIdentityByNonUniquePublicKeyHashRequest
(2562-2577)GetIdentityByNonUniquePublicKeyHashResponse
(2624-2639)GetFinalizedEpochInfosRequest
(3565-3580)GetFinalizedEpochInfosResponse
(3629-3644)GetTokenContractInfoRequest
(7309-7324)GetTokenContractInfoResponse
(7363-7378)GetTokenPerpetualDistributionLastClaimRequest
(7701-7716)GetTokenPerpetualDistributionLastClaimResponse
(7793-7808)
packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java (2)
packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts (8)
GetIdentityByNonUniquePublicKeyHashRequest
(2562-2577)GetIdentityByNonUniquePublicKeyHashResponse
(2624-2639)GetFinalizedEpochInfosRequest
(3565-3580)GetFinalizedEpochInfosResponse
(3629-3644)GetTokenContractInfoRequest
(7309-7324)GetTokenContractInfoResponse
(7363-7378)GetTokenPerpetualDistributionLastClaimRequest
(7701-7716)GetTokenPerpetualDistributionLastClaimResponse
(7793-7808)packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py (10)
getIdentityByNonUniquePublicKeyHash
(353-357)getIdentityByNonUniquePublicKeyHash
(1065-1079)getFinalizedEpochInfos
(389-393)getFinalizedEpochInfos
(1167-1181)getTokenContractInfo
(496-500)getTokenContractInfo
(1456-1470)getTokenPreProgrammedDistributions
(502-506)getTokenPreProgrammedDistributions
(1473-1487)getTokenPerpetualDistributionLastClaim
(508-512)getTokenPerpetualDistributionLastClaim
(1490-1504)
packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py (1)
packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts (8)
GetIdentityByNonUniquePublicKeyHashRequest
(2562-2577)GetIdentityByNonUniquePublicKeyHashResponse
(2624-2639)GetFinalizedEpochInfosRequest
(3565-3580)GetFinalizedEpochInfosResponse
(3629-3644)GetTokenContractInfoRequest
(7309-7324)GetTokenContractInfoResponse
(7363-7378)GetTokenPerpetualDistributionLastClaimRequest
(7701-7716)GetTokenPerpetualDistributionLastClaimResponse
(7793-7808)
packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js (2)
packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py (9)
Platform
(789-1589)getIdentityByNonUniquePublicKeyHash
(353-357)getIdentityByNonUniquePublicKeyHash
(1065-1079)getFinalizedEpochInfos
(389-393)getFinalizedEpochInfos
(1167-1181)getTokenContractInfo
(496-500)getTokenContractInfo
(1456-1470)getTokenPerpetualDistributionLastClaim
(508-512)getTokenPerpetualDistributionLastClaim
(1490-1504)packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts (2)
Platform
(430-479)PlatformClient
(509-936)
packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h (2)
packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts (1)
Proof
(9-44)packages/js-evo-sdk/src/tokens/facade.ts (1)
contractInfo
(92-95)
packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts (1)
packages/dapi-grpc/clients/drive/v0/web/drive_pb.d.ts (2)
AsObject
(24-26)AsObject
(51-54)
packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h (2)
packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts (10)
GetFinalizedEpochInfosRequest
(3565-3580)GetFinalizedEpochInfosResponse
(3629-3644)GetIdentityByNonUniquePublicKeyHashRequest
(2562-2577)GetIdentityByNonUniquePublicKeyHashResponse
(2624-2639)GetTokenContractInfoRequest
(7309-7324)GetTokenContractInfoResponse
(7363-7378)GetTokenPerpetualDistributionLastClaimRequest
(7701-7716)GetTokenPerpetualDistributionLastClaimResponse
(7793-7808)GetTokenPreProgrammedDistributionsRequest
(7458-7473)GetTokenPreProgrammedDistributionsResponse
(7558-7573)packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py (10)
getIdentityByNonUniquePublicKeyHash
(353-357)getIdentityByNonUniquePublicKeyHash
(1065-1079)getFinalizedEpochInfos
(389-393)getFinalizedEpochInfos
(1167-1181)getTokenContractInfo
(496-500)getTokenContractInfo
(1456-1470)getTokenPreProgrammedDistributions
(502-506)getTokenPreProgrammedDistributions
(1473-1487)getTokenPerpetualDistributionLastClaim
(508-512)getTokenPerpetualDistributionLastClaim
(1490-1504)
🪛 Ruff (0.13.1)
packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py
353-353: Unused method argument: request
(ARG002)
389-389: Unused method argument: request
(ARG002)
496-496: Unused method argument: request
(ARG002)
502-502: Unused method argument: request
(ARG002)
508-508: Unused method argument: request
(ARG002)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: Rust packages (rs-dapi-client) / Tests
- GitHub Check: Rust packages (dapi-grpc) / Formatting
- GitHub Check: Rust packages (dapi-grpc) / Check each feature
- GitHub Check: Rust packages (dapi-grpc) / Linting
- GitHub Check: Rust packages (dapi-grpc) / Tests
- GitHub Check: Rust packages (wasm-sdk) / Tests
- GitHub Check: Build Docker images (DAPI, dapi, dapi) / Build DAPI image
- GitHub Check: Build Docker images (Drive, drive, drive-abci) / Build Drive image
- GitHub Check: Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image
- GitHub Check: Build JS packages / Build JS
🔇 Additional comments (32)
packages/dashmate/configs/defaults/getBaseConfigFactory.js (1)
316-316
: Tenderdash image pinned to 1-dev — LGTM.This aligns the dev branch with the compatible Tenderdash series and matches the new migration.
Run to confirm there are no stray default configs still pinning Tenderdash to non-dev tags:
packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js (8)
211-218
: Add getFinalizedEpochInfos descriptor — LGTMName and types align; consistent with Python stubs and TS d.ts.
364-371
: Add getTokenContractInfo descriptor — LGTMDescriptor wiring mirrors existing token RPCs.
382-389
: Add getTokenPerpetualDistributionLastClaim descriptor — LGTMCorrect method name and platform_pb types.
939-968
: Web client: getIdentityByNonUniquePublicKeyHash method — LGTMUnary setup, error handling, and cancel semantics match existing methods.
1125-1154
: Web client: getFinalizedEpochInfos method — LGTMPattern consistent with neighboring RPCs.
1652-1681
: Web client: getTokenContractInfo method — LGTMCorrectly bound to Platform.getTokenContractInfo descriptor.
1714-1743
: Web client: getTokenPerpetualDistributionLastClaim method — LGTMStandard unary wiring; no issues spotted.
157-164
: Approve — getIdentityByNonUniquePublicKeyHash descriptor added and verifiedVerified request/response types exist in packages/dapi-grpc/clients/platform/v0/web/platform_pb.js and the method (static + client signatures) is exported in packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts.
packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java (3)
514-543
: LGTM: New RPCs are fully wired (descriptors, stubs, impl base, and binding).Descriptors, async/blocking/future stubs, and PlatformImplBase methods for:
- getIdentityByNonUniquePublicKeyHash
- getFinalizedEpochInfos
- getTokenContractInfo
- getTokenPerpetualDistributionLastClaim
are added consistently and follow existing patterns.Also applies to: 700-729, 1227-1256, 1289-1319, 1635-1641, 1677-1683, 1811-1817, 1825-1831, 1981-1987, 2023-2029, 2143-2149, 2156-2162, 2344-2351, 2392-2399, 2543-2550, 2559-2566, 2734-2740, 2776-2782, 2910-2916, 2924-2930, 3109-3115, 3157-3163, 3308-3314, 3324-3330
3389-3420
: LGTM: Method IDs, handlers switch, and service descriptor registration are consistent.IDs are contiguous, handler cases match, and serviceDescriptor includes all four new methods.
Also applies to: 3502-3505, 3526-3529, 3594-3597, 3602-3605, 3703-3704, 3709-3710, 3726-3727, 3728-3729
514-543
: Confirmed — platform.proto and generated clients are in sync.platform/v0/platform.proto declares the RPCs and matching generated symbols were found in Platform.pbobjc.h, packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py, and packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts.
packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h (2)
44-46
: LGTM: Obj‑C surface declares new messages and RPCs in both v2 and legacy protocols.Forward declarations and method signatures for the four new RPCs are consistent with the rest of the API.
Also applies to: 66-68, 92-98, 204-207, 228-231, 311-314, 319-322, 463-469, 505-510, 674-679, 688-693
44-46
: Verified pbobjc message availability & header/source alignment. Platform.pbobjc.h declares the listed messages and Platform.pbobjc.m contains the matching GPBObjCClassDeclaration/@implementation entries (GetFinalizedEpochInfos*, GetGroupActionSigners*, GetIdentityByNonUniquePublicKeyHash*, GetTokenContractInfo*, GetTokenPerpetualDistributionLastClaim*); no header/source mismatches found.packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts (3)
151-158
: Generated code looks correct.The type definitions for the four new RPC endpoints follow the established pattern in the file. Each type correctly defines the readonly properties with appropriate request and response types from the platform_pb module.
Also applies to: 205-212, 358-365, 376-383
448-448
: Service class properly extended with new endpoints.The Platform service class correctly exposes the four new static readonly properties referencing their respective type definitions.
Also applies to: 454-454, 471-471, 473-473
657-665
: Client methods follow consistent overload pattern.The PlatformClient class correctly implements two overloads for each new endpoint - one with metadata and one without - matching the existing pattern in the file.
Also applies to: 711-719, 864-872, 882-890
packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m (1)
393-412
: Objective-C implementations follow established patterns.All four new RPC methods are properly implemented with:
- Pragma mark sections for documentation
- Request handler methods that call the RPC builder
- RPC builder methods returning GRPCProtoCall objects
- Message-based methods returning GRPCUnaryProtoCall objects
The implementations correctly use the respective request/response classes and follow the same pattern as existing RPCs in the file.
Also applies to: 513-532, 918-937, 958-977
packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py (4)
97-101
: Client stub properly initialized with new endpoints.The PlatformStub correctly registers the four new unary-unary channel methods with appropriate serializers and deserializers.
Also applies to: 127-131, 212-216, 222-226
353-357
: Server method stubs correctly added.The four new servicer methods follow the established pattern with unimplemented placeholders. The static analysis hints about unused
request
parameters are expected for these stub implementations.Also applies to: 389-393, 496-500, 508-512
627-631
: Service registration properly updated.The add_PlatformServicer_to_server function correctly registers the four new RPC method handlers with appropriate serializers and deserializers.
Also applies to: 657-661, 742-746, 752-756
1064-1079
: Experimental API properly extended.The static methods in the experimental Platform class correctly implement the four new RPCs with all necessary parameters for channel configuration.
Also applies to: 1166-1181, 1455-1470, 1489-1504
packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts (6)
3565-3814
: Finalized epoch infos RPC: types align with existing EpochsInfo; big ints appropriately stringsInclusive boundary flags and result oneof are consistent. No issues spotted.
Please validate the proto used for this generation sets the correct numeric widths (e.g., block heights and fee totals as 64-bit mapping to string) to avoid JS number overflow.
7131-7138
: Direct purchase prices response: no functional concernsInterface remains consistent with existing token pricing model.
7309-7362
: New GetTokenContractInfoRequest: request shape is coherentToken ID + prove flag follow convention. Looks good.
Ensure platform_pb_service.* exposes getTokenContractInfo and that backend handlers are in place.
7363-7456
: New GetTokenContractInfoResponse: data/proof/metadata oneof correctly modeledTokenContractInfoData fields (contractId, tokenContractPosition) look correct.
7701-7912
: Perpetual distribution last-claim RPC: oneof PaidAtCase is modeled properlyMix of string for 64‑bit scalars (timestampMs, blockHeight) and number for small ints is appropriate. No issues.
Please confirm JSON/AsObject consumers honor the oneof (only one of timestampMs/blockHeight/epoch/rawBytes set).
2562-2745
: New non‑unique PKH lookup: shape looks consistent; pagination via startAfter is clearMessages mirror existing identity RPC patterns (proof/metadata oneof). LGTM. Please confirm server + service wiring for this new RPC across clients.
Run to verify service stubs are present (web/java/python/objc):
packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h (4)
3267-3483
: GetFinalizedEpochInfos API surface looks goodTypes, oneofs, and field coverage (incl. fee multiplier, proposer counts, rewards, totals) are coherent and match the intended endpoint.
5868-5924
: Token direct purchase prices request: LGTMGood validation docs (non‑empty, 32‑byte IDs, uniqueness). Matches response types.
6390-6552
: Perpetual distribution last-claim: LGTMField numbering preserves a gap (3) — good for wire‑compat. Oneof exposure and metadata/proof pattern matches other endpoints.
Please confirm server enforces exactly one “paidAt” subfield and documents precedence when multiple are set by clients (shouldn’t be allowed).
7149-7166
: Potential wire‑compat break: BurnEvent field renumbering
BurnEvent
now assigns:
- 1 = Amount
- 2 = BurnFromId
- 3 = PublicNote
If
PublicNote
was previously field 2, this is a breaking wire change (older payloads’ field 2 will populateburnFromId
). Field numbers are the ABI — they must not be renumbered in place.If 2 was previously PublicNote, keep it as 2 and add
BurnFromId
as 3 (or next free). If 3 was already PublicNote, this is fine; please confirm history across all client stubs and the proto.
Issue being fixed or feature implemented
What was done?
How Has This Been Tested?
WIth existing
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit