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
Consumer-side follow-up to WithAutonomi/ant-client#140. Once ant-core makes a post-payment finalize failure recoverable, the ant-ffi external-signer surface must be updated to actually retain and retry the paid attempt instead of dropping it.
Background
The external-signer flow (PR #199) works like: prepare_* → external wallet pays payForQuotes → finalize_upload(upload_id, {quote_hash: tx_hash}). Today finalize_inner (ffi/rust/ant-ffi/src/client.rs) removes the PreparedUpload from the in-memory session map and passes it by value into ant-core's finalize_upload_with_progress, which consumes it. Tx-hash syntax is now validated before removal (bad input is retryable), but a genuine network/storage failure after payment still consumes the prepared state and strands the on-chain payment — see ant-client#140 for the root cause (quote hashes are timestamp+signature-derived, so re-prepare yields a non-matching tx map).
As of #199 this is documented as non-retryable after payment (the honest-contract stopgap). This issue tracks the real fix.
What needs doing here (after ant-client#140 lands)
Bump the ant-core rev pin in ffi/rust/ant-ffi/Cargo.toml (ant-core = { git = "...", rev = "..." }) to the commit carrying the retry-state API. Re-verify the ant-protocol = "2.2.2" pin still matches.
Retain the session on failure. In finalize_inner, stop discarding the upload when finalize fails post-payment. Keep the entry keyed by upload_id (or re-insert the returned retry-state) so a subsequent finalize_upload(upload_id, same_tx_map) retries storage of the unstored chunks against the same payment.
Update the docs/comments on finalize_upload / finalize_upload_with_progress and the sessions field to describe the new retryable contract (remove the "non-retryable after payment" language added in feat(ffi): re-add external-signer upload surface (wave-batch) #199).
Add a test exercising a simulated post-payment store failure → retry → success.
Summary
Consumer-side follow-up to WithAutonomi/ant-client#140. Once ant-core makes a post-payment finalize failure recoverable, the
ant-ffiexternal-signer surface must be updated to actually retain and retry the paid attempt instead of dropping it.Background
The external-signer flow (PR #199) works like:
prepare_*→ external wallet payspayForQuotes→finalize_upload(upload_id, {quote_hash: tx_hash}). Todayfinalize_inner(ffi/rust/ant-ffi/src/client.rs) removes thePreparedUploadfrom the in-memory session map and passes it by value into ant-core'sfinalize_upload_with_progress, which consumes it. Tx-hash syntax is now validated before removal (bad input is retryable), but a genuine network/storage failure after payment still consumes the prepared state and strands the on-chain payment — see ant-client#140 for the root cause (quote hashes are timestamp+signature-derived, so re-prepare yields a non-matching tx map).As of #199 this is documented as non-retryable after payment (the honest-contract stopgap). This issue tracks the real fix.
What needs doing here (after ant-client#140 lands)
ffi/rust/ant-ffi/Cargo.toml(ant-core = { git = "...", rev = "..." }) to the commit carrying the retry-state API. Re-verify theant-protocol = "2.2.2"pin still matches.finalize_inner, stop discarding the upload when finalize fails post-payment. Keep the entry keyed byupload_id(or re-insert the returned retry-state) so a subsequentfinalize_upload(upload_id, same_tx_map)retries storage of the unstored chunks against the same payment.finalize_upload/finalize_upload_with_progressand thesessionsfield to describe the new retryable contract (remove the "non-retryable after payment" language added in feat(ffi): re-add external-signer upload surface (wave-batch) #199).Links