Skip to content

WIRE-339/WIRE-353: keep all four claim ledgers claimable indefinitely - #639

Merged
huangminghuang merged 15 commits into
masterfrom
chore/wire-339-remove-unused-claim-expiry
Oct 8, 2026
Merged

huangminghuang merged 15 commits into
masterfrom
chore/wire-339-remove-unused-claim-expiry

Conversation

@huangminghuang

@huangminghuang huangminghuang commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Keep earned operator pay, per-token returned collateral, and DClaim rewards/imported balances claimable indefinitely. Remove expiry fields, indexes, configuration, and DClaim expiry-cleanup actions.
  • Preserve earned operator shadow yield when a terminated operator is pruned or re-registers. Archive banked balances in yielddebts without blocking registration; claimyield works after the operator record is gone.
  • Bound yield collection by the token-specific backing pool and remaining WIRE remit capacity. Large debts can be collected in portions; unpaid balances neither expire nor accrue again. Preserve claimant authorization, custody, reward deduplication, and finalized import locking.
  • Integrate the current syndication architecture: retain the retirement of sysio.reserv/sysio.uwrit and the existing unpaid-claim protection in sysio.bond. Rebuild the affected artifacts and document fresh-state schema and rollback requirements.

Why

WIRE-339 establishes the no-expiry policy; the approved WIRE-353 scope includes DClaim rewards and imported credits. Administrative operator removal must not erase earned yield or returned collateral. The upstream collateral redesign introduced a new forfeiture path during pruning and re-registration; the separate debt ledger preserves that entitlement without retaining an obsolete operator registration.

This is a pre-launch schema change for fresh state. Claim and debt rows intentionally retain system-funded storage until collected. Uncovered yield remains an obligation and becomes a payable WIRE remit only when its yield pool has backing. Slashing, settlement rulings, transport retention, and cleanup of fully paid bond requests keep their existing semantics.

Validation

  • After merging master a16738c488, focused JIT operator-registry, DClaim, AuthEx, and emissions suites plus three bond-retention regressions passed 221 cases / 7,878 assertions. Coverage includes years of inactivity, delayed linking, repeated registrations, archived debt plus new yield, token identity, zero backing, bounded large-debt collection, and downstream LIQ-failure rollback.
  • The incoming HTTP exception/response suite passed 16 cases / 380 assertions. The existing contract build passed, all 52 ABI/WASM comparisons matched, and CTest discovered all 39 contract suites.
  • Both depot-flow coverage-map checks pass after updating the operator-termination reference to the renamed no-expiry regression; all 13 flow mappings retain their 67 native cases.
  • Regenerated contract TypeScript passed standalone type checking. It includes token-aware claimremit and the new yielddebts table; the companion SDK still needs regeneration against this contract set.
  • Independent correctness, architecture, and compliance reviews found no remaining actionable issues after correcting bounded debt collection and the boundary-test fixture.
  • Earlier local operator-termination and emissions flows passed at Sysio 20591bfd, SDK fdbddd26, and Tools 78f39784. Those historical results do not validate the new syndication/debt interface; no current coordinated E2E result is claimed.

Companion PRs

  • wire-libraries-ts #87: downstream SDK work must regenerate the current contract set, including token-aware collateral, archived yield debt, and retired-contract removal. Merge Sysio, then compatible SDK source, then publish through the normal release process.
  • wire-tools-ts #107: consumer/bootstrap updates require the compatible SDK and registry-only validation. That downstream delivery remains pending and does not block review of this contract producer.

Change-Id: I9229d58dd4e48493d2e68fdd19919e07fec3b8af
…ve-unused-claim-expiry

Change-Id: I8da3a94ceab8b263078acd69bd996bbcde8e2cea
Change-Id: I0cd043b6256feb8929f893936f9553f781fda072
@huangminghuang huangminghuang changed the title WIRE-339: enforce no-expiry policy for pay and collateral claims WIRE-339/WIRE-353: keep pay, collateral and DClaim balances claimable indefinitely Sep 24, 2026
@huangminghuang
huangminghuang marked this pull request as ready for review September 24, 2026 23:47
@huangminghuang
huangminghuang marked this pull request as draft September 25, 2026 15:22
@heifner

heifner commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Could you add sysio.reserv to this PR as well? The 9/18 no-expiry decision (WIRE-339) covered all four claim ledgers, including sysio.reserv::wireclaims. That's the only ledger with a live sweep today. It holds swap payouts and refunds (paywire and refundwire credit it), so forfeiting there is the worst case of the four. Dropping the field and index is a schema change, so it should land before launch with the rest of this PR.

What would need to go:

  • wire_claim::expires_at_sec, the byexpiry index, WIRE_CLAIM_WINDOW_SEC and MAX_CLAIM_SWEEP_PER_EPOCH
  • sweep_expired_wire_claims and the sweepclaims action
  • the forfeit-before-credit branch and the on-write sweep in credit_wire_claim
  • the expiry refusal in claimwire
  • the inline sweepclaims call in sysio.epoch::advance
  • the expiry tests in sysio.reserv_tests.cpp, and the two sweepclaims entries in docs/contract-upgrade-order.md

The deploy order flips compared with when the sweep was added. sysio.epoch has to stop calling sweepclaims before sysio.reserv drops the action, or in the same transaction; otherwise every advance aborts. That also means rebuilding sysio.epoch.wasm, which #603 touches too, so whichever PR lands second rebuilds it. wire-libraries-ts #87 would also need the updated sysio.reserv types.

Change-Id: I6ebfaa8f417e512494ae02d74f9f03c1f9607158
Change-Id: I221d108b3debaa86d66088ea2542de2714e48045
Change-Id: Ia3391aaba071c612e791b4b386780bcf2e03b748
Change-Id: I9095a408fb17f356d5779a536794261eb1ab687c
Change-Id: Ic779128aa04e5b646ad293bae68c762e57ab3e86
@huangminghuang huangminghuang changed the title WIRE-339/WIRE-353: keep pay, collateral and DClaim balances claimable indefinitely WIRE-339/WIRE-353: keep all four claim ledgers claimable indefinitely Sep 25, 2026
@huangminghuang
huangminghuang marked this pull request as ready for review September 26, 2026 01:11

@heifner heifner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No code issues. The contracts compile from source, and every committed wasm/abi reproduces byte-for-byte.

  • docs/contract-upgrade-order.md: rule 3 contradicts the call-edge bullet and the "inverts" paragraph below it (L216-225). For a removed action the caller deploys first, which is this release's order. Maybe phrase it as: every action the deployed caller inlines must exist in the deployed callee (added → callee first, removed → caller first). Downgrades step 2 still says "all three claim tables", but dclaim's rows changed too.
  • Leftovers:
    • RESERV_ACCOUNT (sysio.epoch.hpp:129) and ../sysio.reserv/include (sysio.epoch/CMakeLists.txt:40) are unused now.
    • <sysio/system.hpp> in sysio.dclaim.hpp:8 only served now_sec().
    • The "nobody ever pulls" comment at emissions_tests.cpp:5096 no longer fits the test.

@huangminghuang
huangminghuang marked this pull request as draft September 26, 2026 18:07
Change-Id: I1a326bfd964f4dba5c90d0665d8878204bc4fad0
Change-Id: I4913da0e42c5a3d148dc738b246063fb0d85b2fe
@huangminghuang
huangminghuang marked this pull request as ready for review September 26, 2026 19:14
heifner
heifner previously approved these changes Sep 26, 2026

@heifner heifner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All addressed; contracts rebuild to the committed artifacts at b907fbb.

Change-Id: I676f909612da757d8ebdefe95a044df3a1111588
@huangminghuang
huangminghuang requested a review from heifner October 1, 2026 15:19
Change-Id: I72f6bbebeee123afa5a3a14b7c3d394952f1d5f3
Change-Id: Ied58d7d7db71232b59c3eb08c4c62ac63bd82f58
Change-Id: I6fc94229e235433149f394c3d1ee07f87e7aa0d5
@huangminghuang
huangminghuang marked this pull request as draft October 7, 2026 19:31
@huangminghuang
huangminghuang marked this pull request as ready for review October 7, 2026 20:08
Change-Id: I62d1cec60eb56ca2af23a0151a14cc9d319cd825
@huangminghuang
huangminghuang merged commit f3a887e into master Oct 8, 2026
13 checks passed
dtaghavi pushed a commit to dtaghavi/wire-sysio that referenced this pull request Oct 26, 2026
CertiK WNS-63 (WIRE-413) is fixed on master by Wire-Network#594 (links sweep unmapped credits), Wire-Network#639 (credits never expire) and Wire-Network#670 (onreward retired). The SVM createlink sweep had no unit test; the new one also checks that a credit sharing the key's 8-byte bychainad prefix stays put.

A link sweeps once and createlink does not check that the DClaim import is sealed, so the upgrade-order doc now says to finish the import before the first link.

Change-Id: I50e69a120633181dd3d9e0dd100c3e5a663af844
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants