Repository navigation
feat: invoice cloning, archival system, recipient authentication and reversible operations (#926, #927, #928, #929) - #986
Open
Barbieple-Devstem wants to merge 4 commits into
Conversation
…ail (Stellar-split#926) - clone_invoice_partial copies only selected recipients and their per-recipient settings - validate cloned recipients, amounts and deadline before saving - reset approval/progress state (signatures, approved, condition_met, released_stages) on clones - record CloneRecord per clone and per-source clone history, append audit entries on source and clone, emit part_cln event
…tracking (Stellar-split#927) - ArchivalPolicy (admin-configured) drives a rate-limited, cursor-based run_archival_sweep over completed invoices past archive_after_ledgers - restore_archived_invoice moves archived data back to persistent storage, with a restore hold that exempts it from re-archival - purge_archived_invoices / auto_purge drop payment shards of invoices archived longer than retention_ledgers - ArchivalRecord per invoice and ArchivalStats counters track status across lazy, explicit, batch and scheduled archival - audit entries and events for archive, restore, purge, sweep and policy updates
…yout (Stellar-split#928) - RecipientAuth record and RecipientAuthStatus state machine (Unverified, ChallengeIssued, Verified, Failed, Expired, Revoked) - creators opt invoices in with set_recipient_auth_required and issue per-recipient challenges with a bounded TTL - recipients prove address control by authorizing respond_recipient_challenge with sha256(challenge || recipient_xdr) - timeouts mark challenges Expired; repeated wrong responses mark Failed - _release refuses to pay out and milestone payouts stay escrowed until every recipient is verified - per-invoice verification audit log, audit entries and rcp_auth events
…ndo (Stellar-split#929) - ReversibleOp records with a Recorded -> Undone / Expired state machine - reversible_update_deadline, reversible_update_amounts and reversible_cancel_invoice capture an OperationSnapshot before mutating - undo_operation restores the snapshot within the admin-configurable rollback window (set_rollback_window, default 1 hour) - undo is validated against a hash of the post-operation state so it is rejected if the invoice changed since the operation - audit entries plus rv_rec / rv_undo events for every operation
|
@Barbieple-Devstem Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Implements four features in the
splitcontract, one commit per issue.#926: Invoice cloning
clone_invoice_partial(creator, source_id, recipient_indices, overrides)copies only the selected recipients, along with their amounts and per-recipient settings (swap tokens, split rules, priorities, payout caps).CloneRecordper clone (get_clone_record) and a clone history per source (get_clone_history), audit entries on both invoices, and apart_clnevent.#927: Invoice archival system
ArchivalPolicycontrolsrun_archival_sweep. The sweep is permissionless, runs at most once per interval, and resumes from a stored cursor. It archives completed invoices older thanarchive_after_ledgers.restore_archived_invoicemoves an archived invoice back to persistent storage. The restored invoice is then exempt from re-archival for a hold period.purge_archived_invoices(orauto_purgeduring sweeps) drops the payment shards of invoices archived for longer thanretention_ledgers.ArchivalRecordper invoice (get_archival_status) andArchivalStatscounters, kept up to date by lazy, explicit, batch and scheduled archival.#928: Recipient authentication
RecipientAuthrecord with the states Unverified, ChallengeIssued, Verified, Failed, Expired and Revoked.set_recipient_auth_requiredand callissue_recipient_challengewith a bounded TTL. Each recipient then authorizesrespond_recipient_challengewithsha256(challenge || recipient_xdr)._releaserefuses to pay out, and milestone payouts stay in escrow, until every recipient is verified.get_recipient_auth_log) and emitted as anrcp_authevent.#929: Reversible operations
reversible_update_deadline,reversible_update_amountsandreversible_cancel_invoicesave anOperationSnapshotbefore changing the invoice.undo_operationrestores the snapshot within the rollback window (admin-set throughset_rollback_window, default 1 hour). The state machine is Recorded, then either Undone or Expired.rv_rec/rv_undoevents.Closes #926
Closes #927
Closes #928
Closes #929