Skip to content

refactor(dpp): share one is_transient helper for lookup sources and encryptedFor - #4949

Merged
QuantumExplorer merged 1 commit into
v4.2-devfrom
refactor/share-is-transient-helper
Sep 23, 2026
Merged

QuantumExplorer merged 1 commit into
v4.2-devfrom
refactor/share-is-transient-helper

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

#4943 added a private is_transient(document_type, path) to property/reference_lookup.rs for refersTo lookup key sources. #4948 then moved an identical pub(crate) copy into property/mod.rs for the encryptedFor checks. #4948 merged a minute after #4943 and was not rebased over it, so v4.2-dev now has two identical helpers.

What was done?

  • Removed the private is_transient from reference_lookup.rs.
  • reference_lookup.rs now imports the shared property::is_transient, which already has its own unit test (should_find_a_path_transient_through_itself_or_an_enclosing_object_only).

No behaviour change. The two bodies were identical, so every contract parses exactly as before, and there is no before/after to show. #4940 (open) carries a third private copy in list_element_reference.rs, which should become use super::is_transient; when it is rebased.

In-place changes to shipped generations

None. The only code touched is the referring-side lookup check, which only parser generation 3 reaches. Generation 3 is used only by protocol version 14, which is unreleased, and the edit keeps its output identical.

How Has This Been Tested?

  • cargo test -p dpp --all-features --lib -- reference_lookup transient encrypted_for: 51 passed.
  • cargo clippy -p dpp --all-features --all-targets -- -D warnings: clean. cargo fmt --all: clean.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · 1fdb1c1

  • Bots — coderabbitai ✓ · thepastaclaw not yet — /skip-bots proceeds without the ones not yet reported
  • Self-review — post /self-reviewed once the bots are done
  • Within your 5 open PRs
  • Build running
  • Approvals — you own every area touched; none needed

When every box is checked the PR Hygiene check passes and this can merge.

Summary by CodeRabbit

  • Refactor
    • Consolidated transient-property handling by reusing the existing shared logic.

…ncryptedFor

#4943 added a private is_transient to reference_lookup.rs and #4948
hoisted an identical pub(crate) one into property/mod.rs without
rebasing over it. Drop the private copy and import the shared helper.
No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added this to the v4.2.0 milestone Sep 23, 2026
@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Sep 23, 2026
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: dashpay/platform/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7ee9d37b-96aa-41ce-abd5-14cdf86721dc

📥 Commits

Reviewing files that changed from the base of the PR and between c114ce4 and 1fdb1c1.

📒 Files selected for processing (1)
  • packages/rs-dpp/src/data_contract/document_type/property/reference_lookup.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The reference lookup module now imports the shared is_transient function and uses it in referring_side_error. The module-local helper was removed.

Changes

Transient property lookup

Layer / File(s) Summary
Use the shared transient-property helper
packages/rs-dpp/src/data_contract/document_type/property/reference_lookup.rs
The module imports is_transient from the property module, removes its local helper, and uses the imported function in referring_side_error.

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

Merge Risk: ⚪ Minimal · up to 1fdb1

No behavior change is indicated for transient-property lookup, so no merge-blocking risk remains.

🚥 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 accurately and clearly summarizes the main change: sharing one is_transient helper between lookup sources and encryptedFor.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
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
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@thepastaclaw

thepastaclaw commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

🕓 Queued for automated review — 9th in line, estimated start in ~1.0 h (commit 1fdb1c1)
Estimated review time once started: ~15 min (two-phase automated review; median of recent runs).

  • Request priority review — click to move this review to the front of the queue.

@QuantumExplorer
QuantumExplorer merged commit b24b79b into v4.2-dev Sep 23, 2026
35 of 36 checks passed
@QuantumExplorer
QuantumExplorer deleted the refactor/share-is-transient-helper branch September 23, 2026 14:47
QuantumExplorer added a commit that referenced this pull request Sep 23, 2026
…fersTo

Merges ownerRefersTo/creatorRefersTo (#4941) and the shared is_transient
helper (#4949).

- ownerRefersTo and creatorRefersTo take a listElement as a target (alone or
  as a leaf of an expression): an identity id can be an element of a list of
  identities, the charters' "the writer is a seated member". Meta-schema,
  parser leaf check and docs updated; enforcement needed no change, the owner
  and creator references go through the same validator.
- The listElement registration checks walk reference_declarations(), so an
  owner- or creator-held list element is checked as a property's is.
- list_element_reference uses the shared is_transient; the changelog item is
  now 35, after ownerRefersTo's 34.
- Composing tests: dpp (ownerRefersTo listElement, alone and in an anyOf,
  with a bad $id pair refused) and ABCI (a seatedNote a member may write and
  a stranger may not, refused at $ownerId).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-bots Waiting for the review bots to report on this head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants