feat(antd-go): gRPC external-signer prepare/finalize parity with REST - #170
Merged
Merged
Conversation
Adds 7 new methods on `GrpcClient` mirroring the existing REST `Client` external-signer surface: * `PrepareUpload(ctx, path)` / `PrepareUploadPublic(ctx, path)` * `PrepareDataUpload(ctx, data)` * `FinalizeUpload(ctx, uploadID, txHashes, storeDataMap)` (wave-batch) * `FinalizeMerkleUpload(ctx, uploadID, winnerPoolHash, storeDataMap)` * `PrepareChunkUpload(ctx, content)` / `FinalizeChunkUpload(ctx, uploadID, txHashes)` All call into the new `UploadService` and the extended `ChunkService` RPCs added on the daemon side. Consumers can swap a REST `Client` for a `GrpcClient` without code change in the external-signer flow. Proto regen: * All `.pb.go` files regenerated under `antd-go/proto/antd/v1/`. New `upload.pb.go` + `upload_grpc.pb.go`; `chunks.pb.go` + `chunks_grpc.pb.go` gain `PrepareChunk` / `FinalizeChunk` shapes; `common.pb.go` adds `PaymentEntry`. Other files: header-only version diff. Client (`grpc_client.go`): * New `upload pb.UploadServiceClient` field on `GrpcClient`, constructed in `NewGrpcClient`. * `prepareResponseToResult` helper maps proto `PrepareUploadResponse` to the REST-style `*PrepareUploadResult`, only populating merkle fields (`Depth`, `PoolCommitments`, `MerklePaymentTimestamp`) when `payment_type == "merkle"`. Tests (`grpc_client_test.go`): * `mockChunkService` gains `PrepareChunk` / `FinalizeChunk` (new + already-stored short-circuit + echo upload_id). * New `mockUploadService` covers wave-batch + merkle response shapes, visibility round-trip via upload_id encoding, and `store_data_map` true/false branches. * 12 new `Test*` cases parallel to the antd-rust suite, covering visibility forwarded/omitted, wave-batch vs merkle, data_map_address presence, merkle store_data_map toggle, chunk already-stored short-circuit, and chunk finalize body forwarding. Gates passed on dev2: * `go vet` clean * `golangci-lint run` clean * `go test -race -count=1` — all pass (new tests + existing) * `govulncheck` — no new vulnerabilities (3 pre-existing transitive, none called by our code) Depends on the antd-side PR (UploadService + chunks prepare/finalize) to land first so consumers building from a published antd binary get the matching wire shape. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nic-dorman
added a commit
that referenced
this pull request
May 28, 2026
Closes the gRPC parity gap with REST: external-signer (UploadService + chunks PrepareChunk/FinalizeChunk) and WalletService are now reachable over gRPC, plus stream-download stubs return honest UNIMPLEMENTED/501 instead of pretending. All 11 gRPC-capable SDKs follow with matching fan-out. ## Additive (antd daemon) - gRPC UploadService + chunks prepare/finalize — external-signer two-phase upload + single-chunk publish over gRPC, mirroring REST 1:1 (#140) - gRPC WalletService — GetAddress / GetBalance / Approve, parity with REST /v1/wallet/* (#154) - /v1/data/prepare now honors visibility for public DataMap chunk bundling via data_prepare_upload_with_visibility (#138) ## Fixes (antd daemon) - Stream-download stubs (DataServiceStub.StreamDownload, REST /v1/data/stream/*) now return UNIMPLEMENTED / 501 honestly rather than empty success (#155) ## SDK fan-out — external-signer (gRPC prepare/finalize) All 11 gRPC-capable SDKs replace their stub raises with real gRPC calls to the new UploadService + ChunkService PrepareChunk/FinalizeChunk RPCs: - antd-rust (#169), antd-go (#170), antd-py (#171), antd-java (#172), antd-kotlin (#173), antd-csharp (#174), antd-ruby (#175), antd-dart (#176), antd-swift (#177), antd-cpp (#178), antd-elixir (#179) ## SDK fan-out — WalletService Same 11 SDKs gain walletAddress / walletBalance / walletApprove over gRPC: - antd-rust (#180), antd-go (#181), antd-py (#182), antd-java (#183), antd-kotlin (#184), antd-csharp (#185), antd-ruby (#186), antd-dart (#187), antd-swift (#188), antd-cpp (#189), antd-elixir (#190) ## SDK examples + build fixes - antd-ruby: payForQuotes tuple args as Hash for eth-0.5.13 compatibility (#131) - antd-go + ant-dev: add 03-chunks + 06-private-data examples; renumber 03-files to 04-files (#132) - antd-java + antd-cpp: close async client surface gaps (#133) - ant-dev: pull antd[rest,grpc] extras so 08_grpc example runs out of the box (#134) - antd-js + antd-py + antd-go READMEs: surface external-signer methods + 07 example (#135) - antd-elixir: 07_external_signer example via cast shell-out (#136) - antd-swift: 07_external_signer example + fix FinalizeUploadDTO optional address (#137) - antd-php: empty tx_hashes serializes as JSON object on finalize (#139) ## FFI - ant-ffi refresh against current ant-core API + Swift xcframework build pipeline (#150) - Android AAR build pipeline (#156) ## Infra - CI: auto-tag Go submodules on umbrella release tag push (#129) - Deploy: publish multi-arch withautonomi/antd image from ant-sdk release (#130) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 7 new methods on
GrpcClientmirroring the existing RESTClient's external-signer surface, so consumers can swap a RESTClientfor aGrpcClientwithout code change in the prepare/finalize flow.Depends on #140 (antd-side
UploadService+ chunks prepare/finalize).Methods added
PrepareUpload(ctx, path)PrepareUploadPublic(ctx, path)PrepareDataUpload(ctx, data)FinalizeUpload(ctx, uploadID, txHashes, storeDataMap)FinalizeMerkleUpload(ctx, uploadID, winnerPoolHash, storeDataMap)PrepareChunkUpload(ctx, content)FinalizeChunkUpload(ctx, uploadID, txHashes)Proto regen
All
.pb.gofiles regenerated underantd-go/proto/antd/v1/:upload.pb.go+upload_grpc.pb.gochunks.pb.go+chunks_grpc.pb.gogainPrepareChunk/FinalizeChunkshapescommon.pb.goaddsPaymentEntryImplementation notes
upload pb.UploadServiceClientfield onGrpcClient, constructed inNewGrpcClient.prepareResponseToResulthelper maps protoPrepareUploadResponseto the REST-style*PrepareUploadResult, populating merkle fields (Depth,PoolCommitments,MerklePaymentTimestamp) only whenpayment_type == "merkle".Tests
mockChunkServicegainsPrepareChunk(new + already-stored short-circuit) andFinalizeChunk(echoes upload_id into address).mockUploadServicecovers wave-batch + merkle response shapes, visibility round-trip via upload_id encoding, andstore_data_maptrue/false branches.Test*cases parallel to the antd-rust suite, covering visibility forwarded/omitted, wave-batch vs merkle,data_map_addresspresence on public, merklestore_data_maptoggle, chunk already-stored short-circuit, and chunk finalize body forwarding.Gates passed on dev2
go vetcleangolangci-lint run --timeout 5mcleangofmt -l— clean on touched files (models.gohas pre-existing nits unrelated to this PR)go test -race -count=1— all passgovulncheck— no new vulnerabilitiesSupersedes #142 (force-push after daemon merge auto-closed the original PR).