feat(antd-go): multi-batch external merkle support - #237
Merged
Conversation
- 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>
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.
What
Go client support for the multi-batch external merkle wire API (#235) — the first client to consume it.
antd/proto/antd/v1(addsmerkle_batchesto the prepare response andwinner_pool_hashesto 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.FinalizeMerkleUploadMultion bothClient(REST) andGrpcClient: one winner pool hash perMerkleBatchesentry, index-aligned,""marking a batch the signer never paid. The existingFinalizeMerkleUploadstays as the single-batch form.PartialUploadError: the daemon'sPARTIAL_UPLOAD(REST 502 with structuredchunks_stored/chunks_failed/total_chunks; gRPCABORTED) previously collapsed into a genericNetworkError. 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.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
go build/go vet/go test ./..., gofmt clean):ABORTED(gRPC),NetworkError.merkle_external_batch_capseam) is the follow-up now that a client can drive it.🤖 Generated with Claude Code