feat(antd-elixir): gRPC external-signer prepare/finalize parity with REST - #179
Merged
Merged
Conversation
…REST
Adds 7 V2-284 functions on Antd.GrpcClient mirroring the existing REST
Antd.Client external-signer surface:
* prepare_upload(client, path, opts) /
prepare_upload_public(client, path)
* prepare_data_upload(client, data, opts)
* finalize_upload(client, upload_id, tx_hashes) (wave-batch)
* finalize_merkle_upload(client, upload_id, winner_pool_hash, opts)
* prepare_chunk_upload(client, data) /
finalize_chunk_upload(client, upload_id, tx_hashes)
Bang variants (!/N) included throughout. Full canonical 12-test matrix
including the store_data_map=true variant.
Proto regen:
* New lib/antd/v1/upload.pb.ex (UploadService + request/response
messages + PoolCommitmentEntry + CandidateNodeEntry).
* lib/antd/v1/chunks.pb.ex extended with PrepareChunk + FinalizeChunk
RPCs and request/response messages.
* lib/antd/v1/common.pb.ex extended with PaymentEntry.
* All .pb.ex regenerated with protoc-gen-elixir 0.16.0 (was 0.13.0).
This bump fixes a latent runtime bug: protobuf 0.16 dropped the
generated .new/1 constructor — all calls inside Antd.GrpcClient have
been converted to %Module{...} struct literals, the forward-
compatible idiom. Existing gRPC functions did not exercise this at
runtime because the test suite simulates rather than calls the
protobuf modules.
Implementation notes:
* Merkle-only fields (depth, pool_commitments,
merkle_payment_timestamp) are gated on payment_type == "merkle" —
proto3 scalar defaults are not enough because REST omits these
fields entirely on wave-batch and the model layer expects them
empty/zero there.
* visibility is forwarded as the proto3 default "" when not supplied
via opts, preserving the wire shape for daemons that predate the
public-prepare addition.
* prepare_chunk_upload short-circuits the wave-batch mapping when
already_stored == true.
Tests (test/antd/grpc_external_signer_test.exs, new):
* Spins up a real grpc-elixir server on 127.0.0.1:0 via
GRPC.Server.start_endpoint(TestEndpoint, 0) with MockUploadServer +
MockChunkServer, then dials with a real Antd.GrpcClient. Exercises
the actual proto wire-shape mapping (visibility round-trip via
upload_id encoding, MERKLE vs wave-batch branch, EXISTS short-
circuit).
* 12 new tests parallel to the antd-rust / antd-go / antd-py /
antd-java / antd-kotlin / antd-csharp / antd-ruby / antd-dart /
antd-swift / antd-cpp suites.
* The suite starts GRPC.Client.Supervisor in setup_all — grpc-elixir
0.11 does not start it as part of its application supervision tree,
and Antd.GrpcClient.new/1 calls GRPC.Stub.connect/1 which requires
it. async: false because the global supervisor is shared.
Gates on dev2:
* mix compile — clean.
* mix test — 86/86 passing (74 existing + 12 new V2-284).
Depends on the antd-side daemon PR landing first.
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 V2-284 functions on
Antd.GrpcClientmirroring the existing RESTAntd.Clientexternal-signer surface:prepare_upload(client, path, opts)/prepare_upload_public(client, path)prepare_data_upload(client, data, opts)finalize_upload(client, upload_id, tx_hashes)(wave-batch)finalize_merkle_upload(client, upload_id, winner_pool_hash, opts)prepare_chunk_upload(client, data)/finalize_chunk_upload(client, upload_id, tx_hashes)Bang variants throughout. Full canonical 12-test matrix including
store_data_map: true.Depends on #140.
Proto regen
lib/antd/v1/upload.pb.ex—UploadService+ request/response messages +PoolCommitmentEntry+CandidateNodeEntry.lib/antd/v1/chunks.pb.exextended withPrepareChunk+FinalizeChunkRPCs and request/response messages.lib/antd/v1/common.pb.exextended withPaymentEntry..pb.exregenerated withprotoc-gen-elixir0.16.0 (was 0.13.0). The bump fixes a latent runtime bug: protobuf 0.16 dropped the generated.new/1constructor. All calls insideAntd.GrpcClientare now%Module{...}struct literals (the forward-compatible idiom). The existing gRPC functions did not exercise this at runtime because the test suite simulates rather than calls the protobuf modules.Implementation notes
depth,pool_commitments,merkle_payment_timestamp) are gated onpayment_type == "merkle"— proto3 scalar defaults are not enough because REST omits these fields entirely on wave-batch.visibilityis forwarded as the proto3 default""when not supplied viaopts.prepare_chunk_uploadshort-circuits the wave-batch mapping whenalready_stored == true.Tests
New file
test/antd/grpc_external_signer_test.exs. Spins up a real grpc-elixir server on127.0.0.1:0viaGRPC.Server.start_endpoint(TestEndpoint, 0)withMockUploadServer+MockChunkServer, then dials with a realAntd.GrpcClient. Exercises the actual proto wire-shape mapping (visibility round-trip viaupload_idencoding, MERKLE vs wave-batch branch, EXISTS short-circuit).12 new tests parallel to the antd-rust / antd-go / antd-py / antd-java / antd-kotlin / antd-csharp / antd-ruby / antd-dart / antd-swift / antd-cpp suites.
The suite starts
GRPC.Client.Supervisorinsetup_all— grpc-elixir 0.11 does not start it as part of its application supervision tree, andAntd.GrpcClient.new/1callsGRPC.Stub.connect/1which requires it.async: falsebecause the supervisor is process-global.Gates passed on dev2
mix compile— cleanmix test— 86/86 passing (74 existing + 12 new V2-284)Test plan
mix testagainst the real daemon protosprotoc_gen_elixir_versionbump (0.13 → 0.16) does not break downstream applications that depend onantdand construct request types directly (none expected — generated*.pb.exmodules are not part of the public surface)Supersedes #153 (force-push after daemon merge auto-closed the original PR).