feat(antd): wire visibility through /v1/upload/prepare#57
Merged
Conversation
This was referenced May 5, 2026
0816f12 to
5148f7c
Compare
Today /v1/upload/prepare unconditionally calls file_prepare_upload(path), which is private-only. The legacy store_data_map=true on finalize *does* publish the DataMap chunk, but pays for it from the daemon's internal wallet — not the external signer. Indelible needs the truly bundled atomic external-signer public path. This PR: - Adds visibility: Option<String> to PrepareUploadRequest. Accepts "private" (default) or "public". Omitting preserves pre-0.6.x behavior. - Switches prepare_upload to call file_prepare_upload_with_visibility, which is in our pinned ant-cli-v0.2.2. For "public", ant-core bundles the serialized DataMap as one extra chunk in the same PreparedUpload payment batch — the external signer signs ONE EVM tx covering chunks + DataMap. - Adds the same visibility field to PrepareDataUploadRequest, but rejects "public" with 501 because the in-memory data path requires upstream data_prepare_upload_with_visibility (drafted separately as ant-client #73). Once that merges, the 501 flips to a real call. - Adds data_map_address to FinalizeUploadResponse, populated from FileUploadResult.data_map_address when the prepared upload was public. Independent of the legacy store_data_map flag — that field stays honored for backward compat and is documented as legacy. - Bumps antd to 0.6.1 (additive, wire-compat preserved via serde optional fields). - Updates openapi.yaml for the new fields and the 501 response on /v1/data/prepare. Tests cover serde round-trips for the new fields, the visibility parser's accept/reject cases, and that data_map_address is omitted from JSON when None (so old clients see no new fields). Validated end-to-end on Arbitrum One mainnet: external-signer wave-batch public upload of a 10 KB file produced 4 quotes (3 data + 1 DataMap), single payForQuotes tx covered all 4 atomically, finalize returned data_map_address, and download_public via that address round-tripped byte-for-byte. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI's rustfmt 1.95.0 wants the finalize tuple split across lines and the test let-bindings collapsed onto one line; my local formatter had the opposite preference for both. No semantic change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5148f7c to
5940534
Compare
Nic-dorman
added a commit
that referenced
this pull request
May 6, 2026
…al-signer public uploads Mirrors the wire shape landed in antd 0.6.1 (#57): - New method PrepareUploadPublic(ctx, path) — POSTs visibility:"public" to /v1/upload/prepare. The daemon bundles the serialized DataMap as one extra chunk in the same PreparedUpload payment batch, so the external signer signs ONE EVM transaction covering chunks + DataMap. - New field DataMapAddress on FinalizeUploadResult, populated from the daemon's response when the upload was prepared with visibility:"public". - Existing PrepareUpload / FinalizeUpload signatures unchanged. Old daemons (pre-0.6.1) don't return data_map_address, so the new field is empty for callers talking to those — backward compatible. Tests verify: - PrepareUploadPublic actually sends visibility:"public" in the request. - FinalizeUpload surfaces data_map_address when the daemon returns it. - FinalizeUpload leaves DataMapAddress empty for old daemons that don't emit the field (wire-compat). Requires antd >= 0.6.1 to take effect; calls against older daemons silently degrade to the private path (the visibility field is ignored upstream and DataMapAddress stays empty). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nic-dorman
added a commit
that referenced
this pull request
May 6, 2026
…al-signer public uploads (#58) Mirrors the wire shape landed in antd 0.6.1 (#57): - New method PrepareUploadPublic(ctx, path) — POSTs visibility:"public" to /v1/upload/prepare. The daemon bundles the serialized DataMap as one extra chunk in the same PreparedUpload payment batch, so the external signer signs ONE EVM transaction covering chunks + DataMap. - New field DataMapAddress on FinalizeUploadResult, populated from the daemon's response when the upload was prepared with visibility:"public". - Existing PrepareUpload / FinalizeUpload signatures unchanged. Old daemons (pre-0.6.1) don't return data_map_address, so the new field is empty for callers talking to those — backward compatible. Tests verify: - PrepareUploadPublic actually sends visibility:"public" in the request. - FinalizeUpload surfaces data_map_address when the daemon returns it. - FinalizeUpload leaves DataMapAddress empty for old daemons that don't emit the field (wire-compat). Requires antd >= 0.6.1 to take effect; calls against older daemons silently degrade to the private path (the visibility field is ignored upstream and DataMapAddress stays empty). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nic-dorman
added a commit
that referenced
this pull request
May 6, 2026
Cuts v0.6.1 atop v0.6.0. Adds the public-uploads chain: - feat(antd): wire visibility through /v1/upload/prepare (#57) - visibility: Option<String> on PrepareUploadRequest / PrepareDataUploadRequest - data_map_address: Option<String> on FinalizeUploadResponse - prepare_upload now calls file_prepare_upload_with_visibility — public prepare bundles the serialized DataMap chunk into the same external- signer payment batch (one EVM tx covers chunks + DataMap) - /v1/data/prepare returns 501 for visibility:"public" until upstream data_prepare_upload_with_visibility lands - fix(antd): honor is_public on FileCostRequest (#56) - cost endpoint adds +1 chunk and proportional storage cost when is_public=true (was a no-op before) Validated end-to-end on Arbitrum One mainnet against this dep set: external-signer wave-batch public upload of a 10 KB file, atomic payForQuotes for 4 quotes (3 data + 1 DataMap), finalize returned data_map_address, /v1/files/download/public via that address round- tripped byte-for-byte. ~0.047 ANT cost. Same ant-core / evmlib pin as v0.6.0 (ant-cli-v0.2.2, evmlib 0.8.1). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 task
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
Wires
visibilitythrough/v1/upload/prepareand surfaces the bundled-DataMap address on/v1/upload/finalize. Bumps antd to 0.6.1.The file-path side is fully unblocked against the pinned
ant-cli-v0.2.2. The in-memory/v1/data/prepareside returns 501 forvisibility:"public"until upstreamdata_prepare_upload_with_visibilitymerges; once it does, that 501 path flips to a real call (no other changes needed in this PR's footprint).Mainnet validation (2026-05-06)
End-to-end external-signer wave-batch public upload validated on Arbitrum One mainnet against this branch (rebased on top of v0.6.0):
PaymentIntent.payForQuotestx covering all 4 quotes — atomic external-signer payment./v1/upload/finalizereturneddata_map_addresspopulated;chunks_stored=4matched the bundled payment count./v1/files/download/public {address: data_map_address}round-tripped the file byte-for-byte (SHA256 match).Behavior
/v1/upload/prepare {path}visibilityis implicitly private)/v1/upload/prepare {path, visibility:"public"}PreparedUploadpayment batch/v1/upload/finalize{data_map, address?, chunks_stored}data_map_address?when prepare was public/v1/data/prepare {data, visibility:"public"}data_prepare_upload_with_visibilityis exposed upstreamstore_data_map: trueFiles
antd/src/types.rs:PrepareUploadRequest,PrepareDataUploadRequest: optionalvisibility: Option<String>FinalizeUploadResponse: optionaldata_map_address: Option<String>(skipped from JSON when None — old clients see no new fields)parse_visibility(Option<&str>) -> Result<ant_core::data::Visibility, String>antd/src/rest/upload.rs:prepare_uploadnow callsfile_prepare_upload_with_visibilityinstead offile_prepare_uploadprepare_data_uploadreturnsAntdError::NotImplemented(501) when caller asks forvisibility:"public"finalize_uploadthreadsresult.data_map_addressthrough to the response (both wave-batch and merkle branches)antd/openapi.yaml: documents the newvisibilityfield on both prepare requests, the newdata_map_addresson the finalize response, the 501 case on/v1/data/prepareantd/Cargo.toml: 0.6.0 → 0.6.1Wire-compat
Option<String>with serde-default. Old clients that don't sendvisibilityget private behavior. New clients talking to an old daemon (pre-0.6.1) get the field silently ignored — same private behavior as before — anddata_map_addresswill be absent in the response (the new field isomitempty).store_data_map: boolfield is kept and still honored so existing callers don't break. New callers should prefervisibility:"public"instead.Test plan
cargo test— 26 pass (visibility serde round-trip, parser accept/reject, finalize response serialization with/without data_map_address)Follow-ups
data_prepare_upload_with_visibilitylands and antd's pin bumps, replace the early-return inprepare_data_uploadwith a real call.🤖 Generated with Claude Code