Skip to content

feat: ephemeral is rent exempt - #29

Merged
Dodecahedr0x merged 1 commit into
mainfrom
dode/fix-ephemeral-accounts
Jul 2, 2026
Merged

Dodecahedr0x merged 1 commit into
mainfrom
dode/fix-ephemeral-accounts

Conversation

@Dodecahedr0x

@Dodecahedr0x Dodecahedr0x commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Makes ephemeral accounts rent exempt

Summary by CodeRabbit

  • Bug Fixes
    • Writable ephemeral accounts are now treated as rent-exempt during transaction processing, preventing valid transactions from failing rent checks.
    • Existing rent handling for non-ephemeral accounts remains unchanged.
  • Tests
    • Added coverage to verify ephemeral writable accounts are recognized as rent-exempt even when their balance is below the usual threshold.

@Dodecahedr0x
Dodecahedr0x requested a review from bmuddha July 1, 2026 13:01
@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 15854eb3-d5d2-4ae2-8e0f-fc5e33bde22f

📥 Commits

Reviewing files that changed from the base of the PR and between dbd63e0 and 24cea3e.

📒 Files selected for processing (1)
  • svm/src/transaction_account_state_info.rs

Walkthrough

The rent-state computation in TransactionAccountStateInfo::new now special-cases ephemeral writable accounts, forcing their rent_state to RentExempt instead of computing it via get_account_rent_state. A unit test validates this behavior for an ephemeral account below the standard rent-exempt threshold.

Changes

Ephemeral Rent-State Handling

Layer / File(s) Summary
Ephemeral account rent-exemption logic
svm/src/transaction_account_state_info.rs
TransactionAccountStateInfo::new checks account.ephemeral() for writable accounts, forcing rent_state to Some(RentState::RentExempt) when true, otherwise preserving the existing get_account_rent_state computation; a new test verifies an ephemeral account below the rent-exempt lamport threshold is reported as RentExempt.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Related PRs: None identified.

Suggested labels: enhancement, svm

Suggested reviewers: None identified.

🐰 A tiny hop, an account so light,
Ephemeral and free, exempt from the fight,
No rent to pay, no lamports to spare,
Just RentExempt, floating in air! 🌙

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: marking ephemeral accounts as rent exempt.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dode/fix-ephemeral-accounts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bmuddha bmuddha left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Dodecahedr0x
Dodecahedr0x merged commit 190146a into main Jul 2, 2026
2 checks passed
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.

2 participants