Repository navigation
fix(contract): keep failed releases recoverable - #154
Conversation
|
@Ezekiel146 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 PR has merge conflicts with |
|
@Ezekiel146 Thanks for the PR. It can't be merged yet. To unblock it: CI is failing. Here's what broke:
Please fix these errors and run the same steps locally before pushing ( Merge conflicts: this branch conflicts with Push to this same branch and CI will re-run. Once it's green and conflict-free, it'll be reviewed for merge. |
# Conflicts: # ARCHITECTURE_ESSENTIALS.md # README.md # ROADMAP.md # contracts/escrow/src/lib.rs # contracts/escrow/tests/create_escrow.rs # contracts/escrow/tests/malicious_token.rs # contracts/escrow/tests/timeout_refund.rs
|
@afeezorobsco-cyber I merged the latest main, resolved the conflicts, and fixed the failing undeliverable payout fixture. The full escrow Rust test suite and formatting check pass. Please review and merge when ready. |
|
@afeezorobsco-cyber This branch now includes the latest main and is conflict-free. The full escrow Rust test suite and formatting check pass. Please review and merge when ready. |
|
@Ezekiel146 This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-escrow.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared files like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@Ezekiel146 CI is failing on this branch against the latest SDK bindings match contract WASM
cd contracts/escrow && cargo build --target wasm32v1-none --release
stellar contract bindings typescript --wasm target/wasm32v1-none/release/docforum_escrow.wasm --output-dir /tmp/escrow-bindings --overwrite
cp /tmp/escrow-bindings/src/index.ts ../../sdk/src/generated/contract-client.ts( This PR also conflicts with |
|
@afeezorobsco-cyber I resolved the merge conflicts against the latest main, preserved this PR’s feature, regenerated the contract bindings, and updated the affected test snapshots. The escrow contract tests pass. Could you please review the update and merge when ready? |
|
@Ezekiel146 CI is failing on this branch against the latest SDK bindings match contract WASM
cd contracts/escrow && cargo build --target wasm32v1-none --release
stellar contract bindings typescript --wasm target/wasm32v1-none/release/docforum_escrow.wasm --output-dir /tmp/escrow-bindings --overwrite
cp /tmp/escrow-bindings/src/index.ts ../../sdk/src/generated/contract-client.ts( |
|
@Ezekiel146 This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-escrow.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared docs like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@Ezekiel146 This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-escrow.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared docs like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@Ezekiel146 CI is failing on this branch against the latest Soroban contract (test + wasm build) Your change alters what the committed snapshots record. Run Your change alters contract behaviour that the committed Soroban snapshots record. Run This PR also conflicts with |
|
@Ezekiel146 CI is failing on this branch against the latest Soroban contract (test + wasm build) The This PR also conflicts with |
Resolve conflicts with main (d74b961): - contracts/escrow/src/lib.rs: main added InvalidReleaser = 24. Keep it and move Undeliverable to 35, the next free code, so existing discriminants keep their values. - sdk/src/generated/contract-client.ts: take main's file, then regenerate it from the merged contract WASM with stellar CLI 28.1.0 (scripts/check-generated-bindings.sh passes). - ARCHITECTURE_ESSENTIALS.md, docs/threat-model.md: keep both sides.
|
Note for maintainers: the merge with main moved Undeliverable to error code 35, because main's InvalidReleaser keeps 24. The bindings check was failing on this branch and is regenerated. The GitHub title is 'fix(contract): keep failed releases recoverable', not the one in the review list, so please confirm the intended title. The fork's workflow run needs maintainer approval. |
The status-read optimisation on main keeps a separate DataKey::Status entry next to the escrow record. Regenerate the two undeliverable payee snapshots so they include it: Funded after the rejected release, and Released after the retry.
Picked up from merging main's status-read change (DocForum#260): releaser-account's own fixture now also has a separate DataKey::Status entry. Not touched by this PR's change; regenerated by running its test suite.
|
Brought this up to date with Update, not a rebase: merged Conflicts and resolutions
Error codesChecked SnapshotsRan
Diff reviewed: both additions are a single extra Also found the same kind of drift in the sibling Re-ran Bindings
Other checks run locally
Diff reviewFull diff vs Final branch head: |
|
@afeezorobsco-cyber this is ready for a look whenever you have a moment. |
|
@Ezekiel146 This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-escrow.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared docs like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@afeezorobsco-cyber I updated this branch to current |
afeezorobsco-cyber
left a comment
There was a problem hiding this comment.
Sweep: malware scan clean, CI green.
…to a new address (#199) * feat(contract): payee rights transfer: payee reassigns future payout to a new address Closes #45 - Add transfer_payee(escrow_id, current_payee, new_payee) restricted to the current payee (require_auth), only while Funded. - Reject contract address and payer as new_payee (InvalidNewPayee = 8). - Emit pay_xfer event with (escrow_id, old_payee, new_payee). - 12 tests in contracts/escrow/tests/transfer_payee.rs covering: happy path, release/refund after transfer, chained transfers, auth rejection (stranger/payer/releaser), both rejected targets, and state checks (after release, after refund, unknown id). - Threat model: I1 updated to document transfer_payee scope, payee actor updated (new on-chain power), T11 added (payee key surface). - ROADMAP.md Phase E5 item added, changelog entry dated 2026-10-19. - ARCHITECTURE_ESSENTIALS.md and README.md contract surface updated. Design note: this is a rotation tool. A payee who has lost their key cannot use it — they cannot sign current_payee.require_auth(). Key loss remains an off-chain operational risk. Documented in T11. * fix(ci): repair transfer_payee integration after merging main Three CI jobs failed on this branch because the feature was written against a pre-merge main and never re-integrated: - Regenerate sdk/src/generated/contract-client.ts from the merged contract WASM with the pinned stellar CLI 28.1.0: the contract gained transfer_payee and error 35 (InvalidNewPayee), so the committed bindings no longer matched (issue #121 CI job). - Update the create_escrow call in tests/transfer_payee.rs to the current signature (notify_payee + refund_to arguments). - Commit the 12 Soroban test snapshots for the transfer_payee tests, which were never added (issue #120 snapshot-drift CI job). Verified locally: cargo test (all suites incl. proptest model with PROPTEST_CASES=64), snapshot drift clean, wasm build + artifact, releaser-account tests and wasm, byte-identical rebuild via check-wasm-reproducibility.sh, check-generated-bindings.sh OK, resource baseline OK, and sdk typecheck/build/offline/milestones/ unit/runtime suites all pass. * test(snapshots): refresh transfer_payee snapshots for main's cached Status entry After merging main, cargo test writes the cached ["Status", id] ledger entry (status-read optimisation) into the transfer_payee test snapshots, which were generated before that change landed. All 12 files gain exactly one entry, matching main's own snapshots. * feat(contract): bump CONTRACT_VERSION to 1.1.0 for transfer_payee CI (from #153) requires a CONTRACT_VERSION bump whenever lib.rs changes against the base branch. transfer_payee is a new public function, so bump the minor version and update the version_reports_the_contract_semver assertion to match. * fix(contract): keep failed releases recoverable (#154) * fix(contract): keep failed releases recoverable * fix(contract): reserve unique undeliverable error code * fix(contract): reserve unique undeliverable error code * test: enable revocation in undeliverable SAC fixture * test(contract): refresh undeliverable payee snapshots The status-read optimisation on main keeps a separate DataKey::Status entry next to the escrow record. Regenerate the two undeliverable payee snapshots so they include it: Funded after the rejected release, and Released after the retry. * docs(roadmap): record undeliverable payee handling (#55) * test(releaser-account): refresh snapshot for status-read optimisation Picked up from merging main's status-read change (#260): releaser-account's own fixture now also has a separate DataKey::Status entry. Not touched by this PR's change; regenerated by running its test suite. --------- Co-authored-by: Ezekiel146 <320391431+Ezekiel146@users.noreply.github.com> Co-authored-by: Pheelz <afeezorobsco@gmail.com> * ci(contract): contract-change fragments instead of per-PR version bumps (#268) Nine open PRs each bumping CONTRACT_VERSION meant every contract merge put all the others into conflict, and each picked the same 'next' version. - contract-changes.d/: a PR that changes lib.rs adds a fragment (bump level plus summary) and leaves CONTRACT_VERSION alone. New Error variants use a provisional code (issue x 100 + n) so two PRs can't pick the same number. - scripts/check-contract-change.mjs replaces the 'Require a contract version bump' CI step: fragment required, no version edits, error codes append-only, new codes provisional. A fold PR (deletes fragments) may bump and renumber. - scripts/fold-contract-changes.mjs: maintainer fold. Bumps the version once by the largest level, assigns final error codes, writes a changelog.d entry, deletes the fragments. - version test compares with CONTRACT_VERSION instead of a literal. - AGENTS.md and CONTRIBUTING.md document the rule. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * chore(changelog): fold changelog.d fragments into ROADMAP.md (#269) Ran scripts/fold-changelog.mjs during the 2026-10-28 PR sweep. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * feat(contract): payee rights transfer — transfer_payee reassigns the release destination to a new address Only the current payee may authorise this; only while Funded; new_payee may not be the contract address or the payer. Rotation tool, not key-loss recovery. 12 tests in contracts/escrow/tests/transfer_payee.rs. Adds contract-changes.d/45-payee-rights-transfer.md (bump: minor) instead of editing CONTRACT_VERSION, per contract-changes.d/README.md, and gives Error::InvalidNewPayee the provisional code 4500 (issue #45 x 100) for the maintainer fold to renumber. Regenerates the SDK bindings from the rebuilt WASM and adds changelog.d/45-payee-rights-transfer.md for issue #45. Co-authored-by: Codebuff <noreply@codebuff.com> --------- Co-authored-by: Ezekiel <ezekieldigitalz@gmail.com> Co-authored-by: Ezekiel146 <320391431+Ezekiel146@users.noreply.github.com> Co-authored-by: Pheelz <afeezorobsco@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Codebuff <noreply@codebuff.com>
Summary
Error::Undeliverablewhile keeping the escrow funded so the releaser can retry or use the existing refund path.Closes #55
Verification
cargo test --manifest-path contracts/escrow/Cargo.toml -- --test-threads=1passes.cargo fmt --manifest-path contracts/escrow/Cargo.toml --checkpasses.