Skip to content

feat(antd-java): gRPC external-signer prepare/finalize parity with REST - #144

Closed
Nic-dorman wants to merge 1 commit into
nic/v2-284-grpc-external-signer-prepare-finalizefrom
nic/v2-284-antd-java-grpc-external-signer
Closed

feat(antd-java): gRPC external-signer prepare/finalize parity with REST#144
Nic-dorman wants to merge 1 commit into
nic/v2-284-grpc-external-signer-prepare-finalizefrom
nic/v2-284-antd-java-grpc-external-signer

Conversation

@Nic-dorman

Copy link
Copy Markdown
Collaborator

Summary

Adds 7 new methods on GrpcAntdClient mirroring the existing REST AntdClient external-signer surface.

Depends on #140 (antd-side UploadService + chunks prepare/finalize).

Methods

method purpose
prepareUpload(path) / prepareUpload(path, visibility) external-signer prepare for a file
prepareUploadPublic(path) convenience wrapper for visibility="public"
prepareDataUpload(data) / prepareDataUpload(data, visibility) external-signer prepare for in-memory bytes
finalizeUpload(uploadId, txHashes) finalize wave-batch upload
finalizeMerkleUpload(uploadId, winnerPoolHash) / finalizeMerkleUpload(uploadId, winnerPoolHash, storeDataMap) finalize merkle-batch upload
prepareChunkUpload(data) single-chunk external-signer prepare
finalizeChunkUpload(uploadId, txHashes) -> String single-chunk finalize, returns address

The async client (AsyncAntdClient) is REST-only — there is no async-gRPC counterpart in this SDK — so the async paths are unchanged. Async gRPC support would be a separate scope.

Wallet stubs aren't present on GrpcAntdClient; wallet-over-gRPC is a separate ticket.

Proto/build

Gradle's protobuf plugin auto-generates Upload.*, Common.PaymentEntry, and the new Chunks.PrepareChunk* / Chunks.FinalizeChunk* messages from ../antd/proto/. No regen recipe to run — gradle picks up the new upload.proto automatically.

GrpcAntdClient gains an UploadServiceGrpc.UploadServiceBlockingStub uploadStub field, constructed alongside the others.

Helpers prepareResponseToResult / finalizeResponseToResult translate proto into model records, populating merkle-only fields (depth, poolCommitments, merklePaymentTimestamp) only when payment_type == "merkle".

Tests

GrpcAntdClientTest:

  • MockChunkService gains prepareChunk (new + already-stored short-circuit) and finalizeChunk (echoes upload_id into address).
  • New MockUploadService covers wave-batch / merkle response shapes, visibility round-trip via upload_id encoding, and store_data_map true/false branches.
  • 12 new tests parallel to the antd-rust / antd-go / antd-py suites.

Gates passed on dev2

  • ./gradlew compileJava clean
  • ./gradlew test --tests GrpcAntdClientTest — 31/31 passing
  • ./gradlew build — full project (lib + examples) passes

Adds 7 new methods on `GrpcAntdClient` mirroring the existing REST
`AntdClient` external-signer surface:

* `prepareUpload(path, visibility)` / `prepareUpload(path)` /
  `prepareUploadPublic(path)`
* `prepareDataUpload(data, visibility)` / `prepareDataUpload(data)`
* `finalizeUpload(uploadId, txHashes)` (wave-batch)
* `finalizeMerkleUpload(uploadId, winnerPoolHash, storeDataMap)` plus
  arity-2 overload defaulting `storeDataMap` to false
* `prepareChunkUpload(data)`
* `finalizeChunkUpload(uploadId, txHashes) -> String`

The async surface (`AsyncAntdClient`) is REST-only — there is no async
gRPC counterpart in this SDK — so the async paths are unchanged. Async
gRPC support is out of scope here.

Wallet stubs aren't present on `GrpcAntdClient`; the wallet-over-gRPC
surface is a separate ticket.

Proto/build:

* Gradle's protobuf plugin auto-generates `Upload.*`, `Common.PaymentEntry`,
  and the new `Chunks.PrepareChunk*` / `Chunks.FinalizeChunk*` messages
  from `../antd/proto/`. No regen recipe to invoke.
* `GrpcAntdClient` gains an `UploadServiceGrpc.UploadServiceBlockingStub
  uploadStub` field, constructed alongside the others.
* Helpers `prepareResponseToResult` / `finalizeResponseToResult` translate
  proto into model records, populating merkle-only fields (`depth`,
  `poolCommitments`, `merklePaymentTimestamp`) only when
  `payment_type == "merkle"`.

Tests (`GrpcAntdClientTest`):

* `MockChunkService` gains `prepareChunk` (new + already-stored
  short-circuit) and `finalizeChunk` (echoes `upload_id` into address).
* New `MockUploadService` covers wave-batch / merkle / visibility
  round-trip via `upload_id` encoding / `store_data_map` true|false.
* 12 new tests parallel to the antd-rust / antd-go / antd-py suites.

Gates passed on dev2:

* `./gradlew compileJava` clean
* `./gradlew test --tests GrpcAntdClientTest` — 31/31 (the 19 existing
  plus 12 new)
* `./gradlew build` — full project including examples passes

Depends on the antd-side daemon PR landing first.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Nic-dorman
Nic-dorman deleted the branch nic/v2-284-grpc-external-signer-prepare-finalize May 28, 2026 15:47
@Nic-dorman Nic-dorman closed this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant