Skip to content

feat: add ephemeral flag#29

Merged
bmuddha merged 1 commit into
mainfrom
bmuddha/feat/ephemeral-flag
Feb 18, 2026
Merged

feat: add ephemeral flag#29
bmuddha merged 1 commit into
mainfrom
bmuddha/feat/ephemeral-flag

Conversation

@bmuddha
Copy link
Copy Markdown
Collaborator

@bmuddha bmuddha commented Jan 20, 2026

Summary by CodeRabbit

  • New Features

    • Added ephemeral flag support for accounts with public methods to set and read ephemeral status.
  • Tests

    • Added a comprehensive test suite verifying copy-on-write account behavior, serialization, ownership transitions, flag persistence, and rollback scenarios.
  • Documentation

    • Debug output updated to include ephemeral flag state.
  • Chores

    • Manifest formatting cleaned up (non-functional).

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 20, 2026

Walkthrough

Adds an ephemeral flag to AccountSharedData (EPHEMERAL_FLAG_INDEX) with getter/setter and Debug output, exposes ACCOUNT_STATIC_SIZE, moves and expands tests into a new crate-level tests module, removes an internal test module from cow.rs, and applies non-functional formatting to Cargo.toml.

Changes

Cohort / File(s) Summary
Build configuration
Cargo.toml
Formatting-only edits to feature lists and consolidation of frozen-abi feature; removed commented patch.crates-io block. No functional dependency changes.
Cow internals & constants
src/cow.rs
Added EPHEMERAL_FLAG_INDEX (pub(crate) const), added RELATIVE_DATA_LEN_POINTER_OFFSET_TEST (pub(crate)), removed RELATIVE_DATA_CAP_POINTER_OFFSET, changed ACCOUNT_STATIC_SIZE visibility to pub, and removed the file-local #[cfg(test)] test module.
Library API & behavior
src/lib.rs
Re-exported EPHEMERAL_FLAG_INDEX, added pub fn set_ephemeral(&mut self, ephemeral: bool) and pub fn ephemeral(&self) -> bool on AccountSharedData, extended Debug output to include ephemeral state, and added a crate-level #[cfg(test)] mod tests;.
Tests — CoW behavior
src/tests.rs
New comprehensive CoW test suite exercising layout/serialization, borrow→own transitions, shadow-switch commit/rollback, data ops, and flag persistence (including ephemeral).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • thlorenz
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding an ephemeral flag to the codebase. This is evident from EPHEMERAL_FLAG_INDEX constant additions, new ephemeral() and set_ephemeral() methods, and comprehensive test coverage for the ephemeral flag feature across multiple files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bmuddha/feat/ephemeral-flag

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 and usage tips.

@bmuddha bmuddha force-pushed the bmuddha/feat/ephemeral-flag branch from 3257dec to dfa756e Compare January 20, 2026 11:56
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/lib.rs`:
- Around line 43-44: The build fails because the declared test module mod
cow_tests; in lib.rs has no corresponding src/cow_tests.rs or
src/cow_tests/mod.rs; either add the missing test file containing the cow_tests
module (with its tests) or remove the stray declaration from lib.rs (the line
"mod cow_tests;") to resolve the E0583 error; locate the declaration in lib.rs
and perform one of those two fixes depending on whether the tests were moved or
omitted.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/lib.rs`:
- Around line 43-44: There is a duplicate tests module: the new external
declaration `mod tests;` conflicts with the existing inline `#[cfg(test)] pub
mod tests { ... }`; fix by removing or renaming the inline module (e.g., change
`pub mod tests` to `pub mod inline_tests` or move its contents into the new
`src/tests.rs`) and ensure only one `tests` module exists, keeping the external
`mod tests;` as the canonical test module while updating any test references
accordingly.

Comment thread src/lib.rs
@bmuddha bmuddha force-pushed the bmuddha/feat/ephemeral-flag branch from dfa756e to 6eae52b Compare January 20, 2026 12:08
@bmuddha bmuddha merged commit b88512e into main Feb 18, 2026
2 checks passed
@bmuddha bmuddha deleted the bmuddha/feat/ephemeral-flag branch February 18, 2026 08:31
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