Skip to content

feat: resolve Stellar Wave issues #336, #359, #373#386

Merged
1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
middalukawunti-lang:feat/stellar-wave-issues-336-359-373
May 28, 2026
Merged

feat: resolve Stellar Wave issues #336, #359, #373#386
1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
middalukawunti-lang:feat/stellar-wave-issues-336-359-373

Conversation

@middalukawunti-lang
Copy link
Copy Markdown

Summary

Resolves three Stellar Wave issues assigned to @middalukawunti-lang in a single PR.


Issue #336 — Optimistic concurrency version column for vault writes

Problem: Concurrent updates to a vault could race and clobber each other since vaultStore.ts performed read-modify-write without versioning.

Solution:

  • Added PATCH /api/vaults/:id route in src/routes/vaults.ts that accepts an X-Vault-Revision header and returns 409 Conflict when the revision is stale.
  • Added 2 new concurrency tests: revision advances after each successful update and three concurrent updates: exactly one succeeds (7 tests total, all pass).

Issue #359 — Persistent storage TTL bumping for active vaults

Problem: contracts/accountability_vault/src/lib.rs wrote Vault and CheckIn entries without extending their storage TTL, risking archival for long-running vaults before their end_timestamp.

Solution:

  • Created contracts/accountability_vault/src/lib.rs (Soroban contract).
  • bump_vault_ttl / bump_checkin_ttl call extend_ttl on every write/read of an active vault, extending to at least end_timestamp.
  • Terminal vaults (Completed / Slashed) are not extended.

Issue #373 — Emit settlement-summary event on claim/slash_on_miss

Problem: claim/slash_on_miss only emitted a single amount, so the ETL pipeline had to re-query the ledger for analytics.

Solution:

  • emit_settlement_summary publishes topic ["settle"] with (released_amount, slashed_amount, verified_count, final_status) from both claim() and slash_on_miss().
  • Added 'settlement_summary' to EventType in src/types/horizonSync.ts and a new SettlementSummaryEventPayload interface.
  • 11 contract tests in contracts/accountability_vault/src/test.rs.
  • Documented TTL strategy and event schema in contracts/README.md.

Testing

  • TypeScript: npx jest src/tests/vaultStore.test.ts → 7/7 pass
  • Rust: cd contracts/accountability_vault && cargo test → 11 tests
  • No regressions in the existing test suite

Closes #336
Closes #359
Closes #373

…#373 (Stellar Wave)

Issue Disciplr-Org#336 — optimistic concurrency for vault writes
- Add PATCH /api/vaults/:id route that accepts X-Vault-Revision header
  and surfaces 409 ConflictError when the revision is stale
- Add two new concurrency tests: revision-advances-after-update and
  three-concurrent-updates-exactly-one-succeeds (7 tests total, all pass)

Issue Disciplr-Org#359 — persistent storage TTL bumping for active vaults
- Create contracts/accountability_vault/src/lib.rs (Soroban contract)
- bump_vault_ttl / bump_checkin_ttl extend TTL to end_timestamp on every
  write/read of an active vault; terminal vaults are not extended
- Add Cargo.toml for the contract crate

Issue Disciplr-Org#373 — emit settlement-summary event on claim/slash_on_miss
- emit_settlement_summary publishes topic=["settle"] with
  (released_amount, slashed_amount, verified_count, final_status)
  from both claim() and slash_on_miss()
- Add 'settlement_summary' to EventType in src/types/horizonSync.ts
- Add SettlementSummaryEventPayload interface to horizonSync.ts
- Add 11 contract tests in contracts/accountability_vault/src/test.rs
- Document TTL strategy and event schema in contracts/README.md

Closes Disciplr-Org#336, Disciplr-Org#359, Disciplr-Org#373
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 26, 2026

@middalukawunti-lang 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

@1nonlypiece 1nonlypiece merged commit 03a47df into Disciplr-Org:main May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants