Skip to content

feat(antd-go): multi-batch external merkle support - #237

Merged
Nic-dorman merged 1 commit into
mainfrom
feat/antd-go-multi-batch
Aug 13, 2026
Merged

feat(antd-go): multi-batch external merkle support#237
Nic-dorman merged 1 commit into
mainfrom
feat/antd-go-multi-batch

Conversation

@Nic-dorman

@Nic-dorman Nic-dorman commented Aug 13, 2026

Copy link
Copy Markdown
Member

What

Go client support for the multi-batch external merkle wire API (#235) — the first client to consume it.

  • Proto stubs regenerated from the updated antd/proto/antd/v1 (adds merkle_batches to the prepare response and winner_pool_hashes to finalize; unrelated files churn only their generator-version comment, protoc-gen-go 1.36.11 → 1.36.12).
  • PrepareUploadResult.MerkleBatches: every merkle payment batch in order, each with depth / pool commitments / timestamp. The legacy singular fields keep working exactly as before for single-batch uploads and stay empty on multi-batch ones, mirroring the daemon's compatibility rule.
  • FinalizeMerkleUploadMulti on both Client (REST) and GrpcClient: one winner pool hash per MerkleBatches entry, index-aligned, "" marking a batch the signer never paid. The existing FinalizeMerkleUpload stays as the single-batch form.
  • PartialUploadError: the daemon's PARTIAL_UPLOAD (REST 502 with structured chunks_stored / chunks_failed / total_chunks; gRPC ABORTED) previously collapsed into a generic NetworkError. It now surfaces as a typed error carrying the counts (REST; gRPC keeps them in the message), so callers can drive a re-prepare retry of just the missing remainder.
  • README: method-table entries + a short multi-batch/partial-upload section.

Base

Supersedes #236, which was stacked on #235's branch and got closed by GitHub (rather than retargeted) when that branch was deleted on merge. Now that #235 is on main, this PR's diff is exactly the antd-go commit.

Testing

  • 7 new tests, all green alongside the existing suite (go build / go vet / go test ./..., gofmt clean):
    • multi-batch prepare parsing on both transports (including legacy-fields-empty assertion),
    • REST request shape for the winner-hash list (and that the legacy field is not sent),
    • partial-upload mapping with counts (REST) and via ABORTED (gRPC),
    • regression: a plain 502 still maps to NetworkError.
  • Live multi-batch round-trip against a devnet daemon (via ant-core's merkle_external_batch_cap seam) is the follow-up now that a client can drive it.

🤖 Generated with Claude Code

- Regenerate proto stubs from the 0.12.0 wire (merkle_batches on prepare,
  winner_pool_hashes on finalize; protoc-gen-go 1.36.12).
- PrepareUploadResult.MerkleBatches: every payment batch in order; the
  legacy Depth/PoolCommitments/MerklePaymentTimestamp fields stay
  populated only for single-batch uploads (mirroring the daemon).
- FinalizeMerkleUploadMulti (REST + gRPC): one winner hash per batch,
  index-aligned, "" marking a batch the signer never paid.
- PartialUploadError: PARTIAL_UPLOAD (REST 502 body with structured
  chunks_stored/chunks_failed/total_chunks; gRPC ABORTED) now maps to a
  typed error instead of a generic NetworkError, so callers can drive a
  re-prepare retry of just the missing remainder.
- 7 new tests: multi-batch parse (both transports), hash-list request
  shape, partial-upload mapping with counts, plain-502 regression.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Nic-dorman
Nic-dorman merged commit 518db55 into main Aug 13, 2026
8 checks passed
@Nic-dorman
Nic-dorman deleted the feat/antd-go-multi-batch branch August 13, 2026 08:52
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