prose: finalize accepts empty tx_hashes when every chunk is already stored - #97
Merged
JimCollinson merged 2 commits intoAug 20, 2026
Merged
Conversation
The external-signer wave-batch finalize surface now accepts an empty tx_hashes object when the prepare step reported no payments (every chunk already stored on the network). Document this on the external-signer how-to, the REST /v1/upload/finalize reference, and the gRPC FinalizeUpload reference, and refresh their ant-sdk verification stamps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A53iW8cysQfKpo2XXasPRJ
dirvine
approved these changes
Aug 20, 2026
dirvine
left a comment
Member
There was a problem hiding this comment.
Reviewed the current PR head a198de3b34a25c45841e021c72551dc4a86a73c0 for API accuracy and developer usability.
No blocking correctness or usability findings.
What I verified:
- The documented empty-map contract matches
ant-sdkata4accf1fb617a8b4d8b53e928a279d212411540f: both REST and gRPC inspect the stored prepare result and accept emptytx_hashesonly when its expected-payment list is empty. The same shared resolver rejects an empty or incomplete map when payments were expected, before consuming theupload_id. - The locked
ant-coredependency (22f83ffffde41809a139ed5e1aca70cc90e834de) accepts an empty batch/payment map and completes the existing prepared upload path, returning its DataMap and stored-chunk count. - The REST curl payload and gRPC field guidance are consistent across all three changed pages. The guide makes the no-payment branch explicit before the finalize example, so a reader should not infer that a transaction is still required.
cargo test -p antdpassed all 50 tests, including both empty-map cases and the pre-consume incomplete-map check. The focusedant-coreempty-finalization test passed. Repository governance/sweep checks, Markdown links/fences, JSON shape checks, andgit diff --checkalso passed.
Validation limit: I did not run a live network-backed prepare/finalize cycle; antd does not currently have a network-backed gRPC harness for this case. The transport handlers, shared resolver, locked core path, schemas, and deterministic tests were checked directly.
From an accuracy and usability perspective, this is ready to merge.
JimCollinson
marked this pull request as ready for review
August 20, 2026 14:45
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.
Prose update from the daily upstream sweep.
Upstream:
ant-sdk: 8378338 → a4accf1Source artifacts inspected:
antd/openapi.yaml(FinalizeUploadRequest.tx_hashesschema),antd/proto/antd/v1/upload.proto(FinalizeUploadRequest.tx_hashes),antd/src/rest/upload.rs(finalize_upload, newresolve_wave_tx_hashes),antd/src/grpc/service.rs(UploadServicefinalize) — all ata4accf1.Developer-facing change: for the external-signer wave-batch flow,
POST /v1/upload/finalizeand the gRPCFinalizeUploadnow accept an emptytx_hashesobject when the prepare step reported no payments (every chunk already stored on the network — e.g. a repeated upload). Finalize then completes without any on-chain payment and returns the DataMap. An empty map is still rejected when prepare reported payments, andtx_hashesmust still be empty for Merkle uploads. The single-chunk finalize (/v1/chunks/finalize,FinalizeChunk) is unchanged.Files changed in this PR:
docs/sdk/how-to-guides/use-external-signers-for-upload-payments.mddocs/sdk/reference/rest-api.mddocs/sdk/reference/grpc-services.mdEach page's
ant-sdkverification stamp is refreshed toa4accf1; theant-clientandevmlibblocks on the how-to page are untouched (those repos did not drift).Why prose changed:
tx_hashesfinalize example for the all-already-stored case, and step 3 notes there is nothing to submit when prepare returned nopayments. Tracks theFinalizeUploadRequest.tx_hashesbehaviour inantd/src/rest/upload.rs./v1/upload/finalizeguidance and examples now cover sending an emptytx_hashesobject when prepare reported no payments. Tracksantd/openapi.yamlandantd/src/rest/upload.rs.FinalizeUploadtx_hashesfield description now records that an empty map is valid for wave-batch when the prepare RPC reported no payments. Tracksantd/proto/antd/v1/upload.protoandantd/src/grpc/service.rs.Verification run:
python3 scripts/sweep_poll.pyon this branch:status: "ok"; the three edited pages no longer report ant-sdk drift.{"upload_id":"<hex_id>","tx_hashes":{}}) parse withpython3 -m json.tool.docs/**/*.mdchanged; noscripts/,.github/, registry, or skill-release fields touched.SKILL.mdbody unchanged, so no linked release.ant-sdkSHAs fetched into a pinned tmp checkout; the diff was read againsta4accf1, never a moving branch.Uncertainties: none.
🤖 Generated with Claude Code
https://claude.ai/code/session_01A53iW8cysQfKpo2XXasPRJ
Generated by Claude Code