Skip to content

Emergency force-cancel, protocol health script, deprecation policy, event schema reference - #507

Merged
misrasamuelisiguzor-oss merged 2 commits into
WHEELBACK:mainfrom
joel-metal:feat/batch-457-460-admin-tooling-and-docs
Aug 29, 2026
Merged

Emergency force-cancel, protocol health script, deprecation policy, event schema reference#507
misrasamuelisiguzor-oss merged 2 commits into
WHEELBACK:mainfrom
joel-metal:feat/batch-457-460-admin-tooling-and-docs

Conversation

@joel-metal

@joel-metal joel-metal commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #457
closes #458
closes #459
closes #460

  • Add an emergency admin-override entrypoint to force-cancel a stuck settlement #457contracts/treasury/src/settlements.rs: adds force_cancel_settlement, an admin-only emergency escape hatch that force-cancels a settlement stuck in Pending/OnHold when normal cancel_settlement/dispute-resolution quorum is unreachable. Deliberately narrow (single settlement by ID, no signer/threshold changes), emits a distinct settlement_force_cancelled event carrying the invoking admin, and documented as emergency-only in the treasury README (candidate for a future timelock gate if one lands).
  • Add a read-only 'protocol health' aggregation entrypoint or off-chain script summarizing key metrics across all contracts #458scripts/protocol-health.sh: off-chain aggregation script (styled like scripts/init-contracts.sh) reporting pending settlement count, blocked address count, and pause state across treasury/compliance/invoice/settlement-workflow. Chose off-chain over an on-chain aggregation entrypoint since none of this needs on-chain atomicity/composability — rationale is in the script's header comment. Pause state has no dedicated getter on any contract today, so it's derived via a harmless --send=no simulated probe call per contract (documented in-script).
  • Add a documented process for gracefully sunsetting/deprecating a contract entrypoint #459CONTRIBUTING.md: new "Deprecating an entrypoint" section — mark-deprecated-first with a signal event, minimum one-minor-version notice period, actual removal only at that boundary, and how this interacts with abi-drift-check.yml.
  • Publish a formal event schema reference document for off-chain indexers #460docs/event-schema.md: formal schema for every env.events().publish(...) call site across all four contracts (topics, data type, emitting entrypoint), derived directly from source. Found and fixed a real discrepancy along the way: reject_refund / refund_rejected existed in contracts/invoice/src/entrypoints/lifecycle.rs but were entirely missing from contracts/invoice/README.md.

Testing

Per-task instruction, test suites were intentionally skipped for this batch. No cargo/stellar toolchain was available in this environment to run cargo test/clippy/fmt; changes were reviewed by hand against the existing code style and call patterns (append-only error enum, existing event/topic conventions, existing README table formats).

…ation policy, event schema

- treasury: admin-only force_cancel_settlement escape hatch for settlements
  stuck in Pending/OnHold with unreachable quorum (Closes WHEELBACK#457)
- scripts/protocol-health.sh: off-chain aggregation of pending settlements,
  blocked addresses, and pause state across all contracts (Closes WHEELBACK#458)
- CONTRIBUTING.md: document entrypoint deprecation policy and its
  interaction with abi-drift-check.yml (Closes WHEELBACK#459)
- docs/event-schema.md: formal event schema reference derived from every
  env.events().publish() call site; fixes a real discrepancy found in
  invoice/README.md where reject_refund/refund_rejected were undocumented
  (Closes WHEELBACK#460)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VapsGRDxvezFWJ8R724RoH
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@joel-metal 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! 🚀

Learn more about application limits

@misrasamuelisiguzor-oss
misrasamuelisiguzor-oss merged commit 46f35ea into WHEELBACK:main Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment