You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The released antd v0.11.2 gRPC UploadService.FinalizeUpload rejects an empty tx_hashes map for a valid wave-batch prepare where every chunk is already stored. The equivalent REST path and ant-core accept this no-payment finalization.
The gRPC handler also removes the pending upload before validating the empty map, so the rejected request consumes upload_id and cannot be retried.
All typed gRPC bindings inherit the daemon behavior.
Expected behavior
When prepare reports payment_type = "wave_batch" with no payments because every chunk is already stored, calling FinalizeUpload with the same upload_id and an empty tx_hashes map should succeed and return the DataMap/address result. No on-chain payment is needed.
"winner_pool_hash not applicable for wave-batch upload",
));
}
if req.tx_hashes.is_empty(){
returnErr(Status::invalid_argument(
"tx_hashes required for wave-batch upload (this upload used wave_batch payment)",
));
}
The request fails with invalid_argument, and the removed upload_id is no longer available for retry. A repeated/content-deduplicated public upload can therefore prepare successfully over gRPC but fail to finalize and return its DataMap.
Reproduction shape
Prepare and complete a public external-signer upload.
Prepare the identical upload again so all payable chunks are already stored.
Confirm the prepare response is wave_batch with an empty payment collection.
Call gRPC FinalizeUpload using that upload_id and an empty tx_hashes map.
Observe invalid_argument.
Retry with the same upload_id; observe that it has already been consumed.
Suggested fix
Allow an empty tx_hashes map for the wave-batch all-already-stored case, matching REST and ant-core.
Validate the request shape before removing the pending upload, or reinsert/preserve it on validation failure so invalid requests do not consume retry state.
Add a daemon-level gRPC regression test for prepare-all-already-stored → empty-map finalize → successful DataMap result, plus a test proving validation failure does not consume upload_id.
Documentation impact
Until a corrected release ships, developer documentation should warn that gRPC external signing cannot finalize the all-already-stored case and should direct users to REST for that edge case.
Summary
The released
antdv0.11.2 gRPCUploadService.FinalizeUploadrejects an emptytx_hashesmap for a valid wave-batch prepare where every chunk is already stored. The equivalent REST path andant-coreaccept this no-payment finalization.The gRPC handler also removes the pending upload before validating the empty map, so the rejected request consumes
upload_idand cannot be retried.Affected release
ant-sdkv0.11.23264b514dac9ed361a7426d6d6d5ae6a8e7b6b15Expected behavior
When prepare reports
payment_type = "wave_batch"with no payments because every chunk is already stored, callingFinalizeUploadwith the sameupload_idand an emptytx_hashesmap should succeed and return theDataMap/address result. No on-chain payment is needed.This matches:
ant-core, where empty external finalization is valid: https://github.com/WithAutonomi/ant-client/blob/3e6bdd28f5af3c7601ca919640bf8dfccf4f8d6b/ant-core/src/data/client/batch.rs#L337-L342"tx_hashes": {}):ant-sdk/antd/src/rest/upload.rs
Lines 223 to 267 in 3264b51
tx_hashesfor finalize.”Actual behavior
The gRPC handler:
pending_uploads.tx_hash_map.is_empty().Source:
ant-sdk/antd/src/grpc/service.rs
Lines 1078 to 1107 in 3264b51
The request fails with
invalid_argument, and the removedupload_idis no longer available for retry. A repeated/content-deduplicated public upload can therefore prepare successfully over gRPC but fail to finalize and return its DataMap.Reproduction shape
wave_batchwith an empty payment collection.FinalizeUploadusing thatupload_idand an emptytx_hashesmap.invalid_argument.upload_id; observe that it has already been consumed.Suggested fix
tx_hashesmap for the wave-batch all-already-stored case, matching REST andant-core.upload_id.Documentation impact
Until a corrected release ships, developer documentation should warn that gRPC external signing cannot finalize the all-already-stored case and should direct users to REST for that edge case.