feat: migrate-publish-datamaps via antd 0.7.0 external-signer chunks#20
Merged
Conversation
Adds `cmd/migrate-publish-datamaps`, an operator binary that walks completed
private uploads carrying a locally-stored DataMap and back-publishes each one
as a single on-network chunk via the new antd `/v1/chunks/prepare` +
`/v1/chunks/finalize` endpoints (antd-go v0.7.0). After it runs, downstream
consumers can fetch each file directly via `autonomi://<addr>` instead of
proxying through indelible.
Payment flows through indelible's existing wallet via the same
`evm.Signer.PayForQuotes` path the upload worker already uses — no daemon
wallet, no env wrangling, no special key handling. The migration uses the
SDK surface as a normal SDK consumer would.
## Surface
- `internal/migrate/publish_datamaps.go` — testable migrator with two
decoupled interfaces (`ChunkPublisher`, `EvmPayer`), JSONLines progress,
`--dry-run` / `--limit` / `--uuid` / `--verify` flags, and an idempotent
"already on network" exit that doesn't re-pay.
- `cmd/migrate-publish-datamaps/main.go` — thin wrapper: loads
`indelible.toml`, opens the existing SQLite, resolves the default wallet
via `WalletService.GetDefault` + `DecryptKey`, wires antd-go and
`evm.Signer`, handles graceful SIGINT.
- `services.UploadService.MarkPublished` / `ListPrivatePublishCandidates` —
minimal additions. `data_map` is preserved on the migrated row; the
download handler prefers it when both columns are populated, so the row
stays downloadable through indelible's API in either form.
## ant-sdk dep bump
- antd-go: v0.6.1 -> v0.7.0 (adds PrepareChunkUpload / FinalizeChunkUpload).
## Test plan
- [x] `go test ./...` clean (handlers, worker, services, migrate, ...)
- [x] Migration unit tests cover: happy path (rows flip to public + correct
call sequencing), already-on-network skip (no payment, row still
flips), `--dry-run` (no calls, no row mutations), generic prepare
error continues, `--verify` mismatch leaves row private,
`--limit` + `--uuid` filters, bad-hex `data_map` skip.
- [x] End-to-end smoke verified against Arbitrum One mainnet at the SDK
layer (ant-sdk#61): 256-byte payload round-tripped via prepare →
payForQuotes (external wallet) → finalize → ChunkGet with full byte
equality.
- [ ] Operator (post-merge): `make migrate-publish-datamaps-linux`,
scp to PROD-01 after the antd v0.7.0 binary is deployed there,
`--dry-run --config /opt/indelible/indelible.toml` -> confirm
candidate count, then run for real.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two fixes in one commit because they're both CI blockers on this PR but neither is load-bearing for the migration logic. 1. `internal/migrate/publish_datamaps_test.go`: remove the unused `failPrepareOnUUID` field on `fakePublisher`. golangci-lint's `unused` check flagged it; it was leftover scaffolding from an earlier draft. 2. `go.mod`: bump Go directive 1.25.9 → 1.25.10 and `golang.org/x/net` v0.51.0 → v0.53.0. Resolves four govulncheck findings (all pre-existing on master — disclosed since the last CI run): - GO-2026-XXXX html/template (stdlib, fixed in go1.25.10) - GO-2026-4971 net Dial/LookupPort NUL byte panic (stdlib, go1.25.10) - GO-2026-XXXX HTTP/2 (net/http, go1.25.10) - GO-2026-4918 HTTP/2 infinite loop (golang.org/x/net v0.53.0) `go mod tidy` also pulled forward x/crypto, x/sys, x/text, x/tools, x/mod, x/sync, x/exp transitively. No code changes required.
2 tasks
Nic-dorman
added a commit
that referenced
this pull request
May 14, 2026
ant-sdk released v0.7.1 today, adding the antd-linux-arm64 release artifact that V2-275 was blocked on. - `.antd-version`: v0.6.1 → v0.7.1. Bundles the daemon that implements /v1/chunks/prepare and /v1/chunks/finalize — the endpoints `cmd/migrate-publish-datamaps` (shipped in #20) was written against. Removes the "drop antd v0.7.0 binary on PROD-01 before running the migrator" step from #20's checklist on the next release deploy. - `.github/workflows/release.yml`: wire `antd-linux-arm64` into the linux/arm64 build leg. Previously empty because no upstream binary existed; now resolved. No go.mod change: antd-go/v0.7.0 is unchanged in this upstream release; v0.7.1 is daemon-side only (ant-core bump + arm64 publish + various non-Go-SDK fixes). Unblocks V2-271 (Docker linux/arm64 images). Co-authored-by: Claude Opus 4.7 (1M context) <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.
Summary
Adds
cmd/migrate-publish-datamaps, an operator binary that walks completed private uploads carrying a locally-stored DataMap and back-publishes each one as a single on-network chunk via antd's new external-signer chunk surface (POST /v1/chunks/prepare+POST /v1/chunks/finalize, shipped in ant-sdk v0.7.0). After it runs, downstream consumers can fetch each file directly viaautonomi://<addr>instead of proxying through indelible.Payment flows through indelible's existing wallet (
WalletService.GetDefault→DecryptKey→evm.Signer.PayForQuotes) — the same path the upload worker uses for normal file uploads. No daemon-wallet provisioning, no env wrangling, no special key handling.Concrete trigger: PROD-01 has ~78 completed-private uploads (the foundations corpus from 2026-05-06) that pre-date public visibility. Migrating them lets pub-library drop the indelible proxy for those papers.
Surface
internal/migrate/publish_datamaps.go— testable migrator with two decoupled interfaces (ChunkPublisherfor antd-go,EvmPayerforevm.Signer), JSONLines progress,--dry-run/--limit/--uuid/--verifyflags, idempotent "already on network" exit that doesn't re-pay.cmd/migrate-publish-datamaps/main.go— thin wrapper: loadsindelible.toml, opens the existing SQLite, resolves the default wallet, wires antd-go +evm.Signer, handles graceful SIGINT.services.UploadService.MarkPublished/ListPrivatePublishCandidates— small additions.data_mapis preserved on the migrated row; the download handler (internal/handlers/uploads.go) prefersdata_mapoverdatamap_addresswhen both are populated, so the row stays downloadable through indelible's existing API either way.ant-sdk dep bump
github.com/WithAutonomi/ant-sdk/antd-go: v0.6.1 → v0.7.0 (addsPrepareChunkUpload/FinalizeChunkUpload).Operational note
The migration binary calls
/v1/chunks/prepareand/v1/chunks/finalizeon the antd daemon indelible manages. PROD-01's antd must be upgraded from v0.6.1 → v0.7.0 before this binary will work — the new endpoints don't exist on older daemons. Drop the v0.7.0 binary at/usr/local/bin/antd(from the ant-sdk release page,antd-linux-amd64) and restartindelible.service; ~30s outage.Test plan
go test ./...clean — handlers, worker, services, migrate, etc.visibility='public'with correctdatamap_address, with correct prepare/pay/finalize call sequencingChunkGetreturns different bytes than were sent--limit+--uuidfiltersdata_mapskip (per-row failure, no network call)make migrate-publish-datamaps-linux, scp to PROD-01../migrate-publish-datamaps-linux-amd64 --config /opt/indelible/indelible.toml --dry-run→ confirm candidate count./api/v2/uploads/{uuid}responses now reportdatamap_address.🤖 Generated with Claude Code