Skip to content

feat: file upload cost reporting and ClientConfig CLI flags#24

Merged
Nic-dorman merged 6 commits intomainfrom
feat/upload-cost-and-client-config
Apr 15, 2026
Merged

feat: file upload cost reporting and ClientConfig CLI flags#24
Nic-dorman merged 6 commits intomainfrom
feat/upload-cost-and-client-config

Conversation

@Nic-dorman
Copy link
Copy Markdown
Collaborator

Summary

  • Bumps ant-core to c7d9ee1 (ant-cli v0.1.2) and surfaces the new FileUploadResult cost fields — storage_cost_atto, gas_cost_wei, chunks_stored, payment_mode_used — through the daemon REST/gRPC/OpenAPI and all 16 SDKs. The always-empty cost field is dropped (proto field 1 reserved); verified no external consumer reads it (indelible uses the external-signer flow with different fields, ant-webex is download-only).
  • Exposes ant-core's split timeout and concurrency knobs as antd CLI flags / env vars: --quote-timeout-secs, --store-timeout-secs, --quote-concurrency, --store-concurrency (backed by ANTD_QUOTE_TIMEOUT_SECS etc.). Defaults come from ClientConfig::default(); unset flags do nothing.
  • Fixes pre-existing antd-dart gRPC breakage: generates 23 committed proto stubs via protoc_plugin, bumps protobuf dep from ^3.1.0 → ^4.1.0 to match the plugin's $_clearField / $_setField calls. Adds antd-dart/tool/generate_proto.sh for reproducible regen.

ant-node is now published on crates.io (0.10.0) so a sibling ../ant-node checkout is no longer required for daemon or ffi builds.

Test plan

  • antd cargo test --bin antd — 6/6 pass
  • antd-go go build ./... && go vet ./... && go test ./... — clean
  • antd-rust cargo check --tests --examples — clean (1 pre-existing dead_code warning on do_head)
  • antd-js npm run build — tsup build ok
  • antd-py python -m pytest tests/ — 46 passed, 7 skipped (network-dependent)
  • antd-dart dart analyze && dart test — clean aside from 2 pre-existing unrelated warnings; 40/40 tests pass
  • CI green across all SDKs
  • Review contract changes to FileUploadPublicResponse / DirUploadPublicResponse / UploadPublicResponse proto

🤖 Generated with Claude Code

Nic-dorman and others added 6 commits April 15, 2026 09:53
Updates antd to latest ant-core and pulls in ant-node 0.10.0 (now
published on crates.io instead of a git rev), removing the need for
a sibling ant-node checkout to build the daemon.

ClientConfig field renames (timeout_secs -> quote/store_timeout_secs,
chunk_concurrency -> quote/store_concurrency) do not affect antd
because it constructs ClientConfig via ::default(). DataUploadResult
and FileUploadResult public fields used by antd are unchanged, so
no source changes are required for this bump.

ffi/rust is intentionally left at its existing pin — it has
pre-existing source drift from the ant-core external-signer refactor
and needs a dedicated migration pass before it can track c7d9ee1.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Surfaces the storage_cost_atto and gas_cost_wei fields that ant-core
now returns on FileUploadResult. Adds them alongside chunks_stored and
payment_mode_used (parity with data upload responses) on the file and
directory public upload responses in REST, gRPC, and OpenAPI.

The existing "cost" field is retained as a deprecated alias populated
with storage_cost_atto, so any consumer that was parsing the previously
empty string now gets a meaningful value without a hard break. u128 gas
cost is serialized as a decimal string because values can exceed the
JSON safe-integer range.

Adds four new antd CLI flags / env vars exposing ant-core's split
timeout and concurrency knobs: --quote-timeout-secs, --store-timeout-secs,
--quote-concurrency, --store-concurrency. When unset the ant-core
defaults apply (quote_timeout=10s, store_timeout=10s, quote_concurrency=32,
store_concurrency=8).

All 6 antd unit tests pass. SDK propagation follows in a separate commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removes the always-empty 'cost' alias from FileUploadPublicResponse
and DirUploadPublicResponse across REST, gRPC, and OpenAPI. Verified
no external consumer (indelible, ant-webex, other sibling projects)
reads the field before dropping — indelible uses the external-signer
flow with different response fields, ant-webex is download-only.

Proto field number 1 and name 'cost' are reserved to prevent any
cached generated stubs from colliding on the wire.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Updates every SDK's file_upload_public and dir_upload_public return
shape to match the daemon's new response: address, storage_cost_atto,
gas_cost_wei, chunks_stored, payment_mode_used. The old empty 'cost'
field is removed everywhere.

Most SDKs grew a new FileUploadResult type distinct from the existing
PutResult (which still carries .cost for data/chunk puts, unchanged).
Where gRPC stubs are checked in, they were regenerated to reflect the
proto's reserved field 1. Examples and tests updated to assert the new
shape; the deprecated 'cost' references in data/chunk examples are
intentionally retained — those endpoints still return PutResult.

Spot-checked: antd-go (build + vet + test clean), antd-rust (cargo
check clean aside from a pre-existing dead_code warning), antd-js
(tsup build ok), antd-py (46 passed, 7 skipped network tests).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The antd-dart gRPC client has always imported lib/src/generated/**
stubs that were never checked in, so the gRPC surface didn't analyze
or run. Generate them once with protoc + protoc_plugin and commit.

protoc_plugin's current output calls \$_clearField / \$_setField which
only exist in protobuf 4.x, so bump the dependency from ^3.1.0 to
^4.1.0. grpc 4.0.1 already coexists with protobuf 4.x.

Adds tool/generate_proto.sh so future regenerations are a single
command; includes the Windows hint about PATH for protoc-gen-dart.bat.

Verified: dart analyze clean (only two pre-existing unrelated
warnings about a missing lints package and an unused _doHead), dart
test 40/40 passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two X.509 Name Constraints validation advisories were published against
rustls-webpki 0.103.10 after main's last CI run. 0.103.12 is the
semver-compatible patch; rustls' ^0.103 constraint already permits it,
so this is a lockfile-only bump — no Cargo.toml edits.

Real-world exploitability for antd is narrow (impacts only trust chains
that rely on Name-Constrained CAs, which public WebPKI and our p2p
QUIC transport generally don't use) but the advisory is legitimate and
CI should stay green.

ant-client's lockfile is already at 0.103.12. ant-node's lockfile is
still at 0.103.10; a follow-up PR there will apply the same fix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Nic-dorman Nic-dorman merged commit 9f40bef into main Apr 15, 2026
3 checks passed
@Nic-dorman Nic-dorman deleted the feat/upload-cost-and-client-config branch April 15, 2026 12:33
Nic-dorman added a commit that referenced this pull request Apr 16, 2026
Prepares the first cross-platform daemon binary release. 0.3.0 under
pre-1.0 semver is the minor bump for the breaking REST/gRPC contract
change that landed in PR #24: FileUploadPublicResponse and
DirUploadPublicResponse (and the UploadPublicResponse proto message)
dropped the always-empty 'cost' field in favour of explicit
storage_cost_atto, gas_cost_wei, chunks_stored, and payment_mode_used.
Parallel to the antd-go/v0.3.0 Go-module tag cut earlier so the daemon
binary and the Go SDK stay on the same version line.

After merge, pushing tag v0.3.0 at the merge commit will trigger
.github/workflows/release.yml for its first real run, producing
antd-linux-amd64 / antd-darwin-arm64 / antd-windows-amd64.exe plus
SHA256SUMS on the GitHub Release.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Nic-dorman Nic-dorman mentioned this pull request Apr 16, 2026
5 tasks
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