Skip to content

docs: scope sponsor rent recovery to terminal subscriptions#218

Open
dev-jodee wants to merge 1 commit into
fix/guard-same-slot-abandoned-recoveryfrom
fix/doc-sponsor-subscription-rent-scope
Open

docs: scope sponsor rent recovery to terminal subscriptions#218
dev-jodee wants to merge 1 commit into
fix/guard-same-slot-abandoned-recoveryfrom
fix/doc-sponsor-subscription-rent-scope

Conversation

@dev-jodee

@dev-jodee dev-jodee commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #217.

Summary

Docs-only. The intro claimed rent "stays recoverable" via the abandoned-recovery instructions after any authority close/reinit — but those only fire once the authority is terminal (closed or init_id rotated) or the plan ends. A subscriber who revokes only their ATA delegate leaves the subscription open and uncollectable; on a perpetual (end_ts == 0) plan the sponsor cannot reclaim its rent until the subscriber cancels or closes the authority.

  • Corrects the intro recoverability claim (README.md) to scope it to terminal states.
  • Expands the "Active is not proof of collectability" note to spell out the sponsor rent implication and recommend a finite end_ts when sponsoring subscriptions.

Test Plan

  • Docs only; just fmt clean. No code/ABI/behavior change.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solana-subscriptions-program Ready Ready Preview, Comment Jul 21, 2026 6:51pm

Request Review

@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown

Greptile Summary

This docs-only PR corrects two inaccuracies in README.md about when a sponsor can recover rent from abandoned subscription PDAs.

  • Intro paragraph: Tightens the rent-recoverability claim from "after any close/re-init" to "once terminal" (SA closed, init_id rotated, or plan ended), and adds a cross-reference to Security Considerations for the ATA-delegate-only revocation edge case.
  • Security Considerations bullet: Extends "Active is not proof of collectability" to explain that revoking the ATA delegate leaves the subscription non-terminal, locking sponsor rent until the subscriber cancels or closes the SA — and recommends a finite end_ts when sponsoring subscriptions.

Confidence Score: 5/5

Documentation-only change with no program code, ABI, or behavior modification — safe to merge.

Both changed sentences correct genuine inaccuracies and are consistent with the on-chain logic described elsewhere in the README. The Rent Costs section (line 39) still reads broadly but does not contradict the new text — it covers the direct-close happy path while the intro now covers the abandoned-recovery path. No code, IDL, or client is touched.

No files require special attention.

Important Files Changed

Filename Overview
README.md Corrects the intro's rent-recoverability claim to scope it to terminal states (SA closed/rotated or plan ended), and extends the "Active is not proof of collectability" security bullet to explain sponsor rent implications and recommend finite end_ts.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Subscriber revokes ATA delegate] --> B{Is SA closed or\ninit_id rotated?}
    B -- No --> C[Subscription stays open\nand active on-chain]
    C --> D{Perpetual plan?\nend_ts == 0}
    D -- Yes --> E[Sponsor rent locked until\nsubscriber cancels/closes SA]
    D -- No --> F[Sponsor rent locked until\nplan end_ts passes]
    B -- Yes --> G[Subscription is terminal]
    G --> H[Sponsor can call\nRevokeAbandonedSubscription]
    H --> I[Sponsor reclaims rent]

    style E fill:#ffcccc,stroke:#cc0000
    style F fill:#fff3cd,stroke:#cc8800
    style I fill:#ccffcc,stroke:#007700
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[Subscriber revokes ATA delegate] --> B{Is SA closed or\ninit_id rotated?}
    B -- No --> C[Subscription stays open\nand active on-chain]
    C --> D{Perpetual plan?\nend_ts == 0}
    D -- Yes --> E[Sponsor rent locked until\nsubscriber cancels/closes SA]
    D -- No --> F[Sponsor rent locked until\nplan end_ts passes]
    B -- Yes --> G[Subscription is terminal]
    G --> H[Sponsor can call\nRevokeAbandonedSubscription]
    H --> I[Sponsor reclaims rent]

    style E fill:#ffcccc,stroke:#cc0000
    style F fill:#fff3cd,stroke:#cc8800
    style I fill:#ccffcc,stroke:#007700
Loading

Reviews (5): Last reviewed commit: "docs: scope sponsor rent recovery to ter..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

Compute Unit Report

Instruction Samples CUs Est Cost (Low) [SOL] Est Cost (Med) [SOL] Est Cost (High) [SOL] Δ Avg vs main
cancel_subscription 28 1838 0.000005000 0.000005073 0.000005919
cancel_subscription_now 5 1873 0.000005000 0.000005074 0.000005936
close_subscription_authority 22 1804 0.000005000 0.000005072 0.000005902
create_fixed_delegation 50 3524 0.000005001 0.000005140 0.000006762
create_plan 138 3501 0.000005001 0.000005140 0.000006750
create_recurring_delegation 35 3564 0.000005001 0.000005142 0.000006782
delete_plan 9 359 0.000005000 0.000005014 0.000005179
init_subscription_authority 231 6310 0.000005001 0.000005252 0.000008155
resume_subscription 4 2041 0.000005000 0.000005081 0.000006020
revoke_abandoned_delegation 3 403 0.000005000 0.000005016 0.000005201
revoke_abandoned_subscription 2 2052 0.000005000 0.000005082 0.000006026
revoke_delegation 24 282 0.000005000 0.000005011 0.000005141
revoke_subscription_authority 8 3576 0.000005001 0.000005143 0.000006788
subscribe 52 6642 0.000005001 0.000005265 0.000008321
transfer_fixed 10 5641 0.000005001 0.000005225 0.000007820
transfer_recurring 21 5749 0.000005001 0.000005229 0.000007874
transfer_subscription 14 5990 0.000005001 0.000005239 0.000007995
update_plan 30 1958 0.000005000 0.000005078 0.000005979

🔺 increase · 🔻 decrease · – unchanged · 🆕 new · 🗑 removed (vs main)

Generated: 2026-07-21

@dev-jodee
dev-jodee force-pushed the fix/guard-same-slot-abandoned-recovery branch from 5051d43 to f59d979 Compare July 21, 2026 18:37
@dev-jodee
dev-jodee force-pushed the fix/doc-sponsor-subscription-rent-scope branch from 60ce239 to f51e5fe Compare July 21, 2026 18:37
@dev-jodee
dev-jodee force-pushed the fix/doc-sponsor-subscription-rent-scope branch from f51e5fe to 5d752df Compare July 21, 2026 18:43
@dev-jodee
dev-jodee force-pushed the fix/guard-same-slot-abandoned-recovery branch from f59d979 to e7d2d9c Compare July 21, 2026 18:43
@dev-jodee
dev-jodee force-pushed the fix/guard-same-slot-abandoned-recovery branch from e7d2d9c to ef5a8db Compare July 21, 2026 18:48
@dev-jodee
dev-jodee force-pushed the fix/doc-sponsor-subscription-rent-scope branch from 5d752df to 8f630cb Compare July 21, 2026 18:48
The intro claimed rent "stays recoverable" via the abandoned-recovery
instructions after any authority close/reinit, but those only fire once the
authority is terminal (closed or init_id rotated) or the plan ends. A
subscriber who revokes only their ATA delegate leaves the subscription open
and uncollectable, and on a perpetual plan the sponsor cannot reclaim its
rent until the subscriber cancels or closes the authority.

Correct the intro claim and expand the collectability note to spell out the
sponsor rent implication and recommend a finite end_ts when sponsoring.
@dev-jodee
dev-jodee force-pushed the fix/doc-sponsor-subscription-rent-scope branch from 8f630cb to 4f830b9 Compare July 21, 2026 18:51
@dev-jodee
dev-jodee force-pushed the fix/guard-same-slot-abandoned-recovery branch from ef5a8db to b7545af Compare July 21, 2026 18:51
@dev-jodee
dev-jodee requested a review from tiago18c July 21, 2026 20:36
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.

1 participant