Skip to content

fix(contract): use the keyword-search contract id in the feature-less fallback - #4873

Merged
QuantumExplorer merged 1 commit into
v4.2-devfrom
fix/data-contracts-keyword-search-fallback-id
Sep 21, 2026
Merged

QuantumExplorer merged 1 commit into
v4.2-devfrom
fix/data-contracts-keyword-search-fallback-id

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

The #[cfg(not(feature = "keyword-search"))] arm of SystemDataContract::id() in packages/data-contracts/src/lib.rs carried a copy of the wallet-utils contract id (7CSFGeF4WNzgDmx94zwvHkYaG3Dx4XEe5LFsFgJswLbm) instead of the keyword-search one (BsjE6tQxG47wffZCRQCovFx5rYrAYYC3rTVRWKro27LA). Introduced in 3c26b56. Any build of the crate without the keyword-search feature therefore answered SystemDataContract::KeywordSearch.id() with the wallet-utils id.

Default builds (all-contracts) were not affected: with the feature on, the arm reads keyword_search_contract::ID_BYTES.

What was done?

  • Replaced the fallback bytes with the keyword-search crate's ID_BYTES.
  • Widened the app_connect_id_matches_the_published_id test (added in feat(platform)!: add app-connect login response system contract #4869) into every_system_contract_id_matches_the_published_id, which walks SystemDataContract::ALL and checks each variant against the contractId published in its crate's lib/systemIds.js. FeatureFlags is skipped: it has no crate and no published id, only a reserved slot. The test runs under both feature settings, so a fallback copy that drifts from the published id now fails CI.

How Has This Been Tested?

cargo test -p data-contracts
cargo test -p data-contracts --no-default-features
cargo clippy -p data-contracts --all-targets -- -D warnings

All green. With the old bytes restored, cargo test -p data-contracts --no-default-features fails with KeywordSearch id does not match its published id, so the test does catch the bug it was written for.

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

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

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

Review profile: CHILL

Plan: Advanced

Run ID: 4bc045ec-2640-422e-80f6-017c1123945b

📥 Commits

Reviewing files that changed from the base of the PR and between 0b89d4d and 46b2310.

📒 Files selected for processing (1)
  • packages/data-contracts/src/lib.rs

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.

@github-actions github-actions Bot added this to the v4.2.0 milestone Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

PR Hygiene

State: waiting-bots · commit 46b23100b782e7fb4c9b7ea87a6065cae578258d

  • coderabbitai has not reported for the current head
  • thepastaclaw has not reported for the current head

Self-review is an author attestation that you have read the diff:
/self-reviewed — covers everything pushed so far; post it again after a new push.
/skip-bots — proceed without the bots that have not reported; anyone with write access may, and the report says who did.

This check passes when the policy is satisfied; the repository decides whether merging requires it.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Sep 21, 2026
… fallback

The `#[cfg(not(feature = "keyword-search"))]` arm of `SystemDataContract::id`
carried a copy of the wallet-utils contract id instead of the keyword-search
one (introduced in 3c26b56), so a build without that feature answered
`SystemDataContract::KeywordSearch.id()` with the wallet-utils id.

Replace the bytes with the keyword-search crate's `ID_BYTES` and widen the
existing App Connect id test into one that checks every variant of
`SystemDataContract::ALL` (except the reserved `FeatureFlags` slot) against
its published base58 id, so a drifted copy fails under both feature settings.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@QuantumExplorer
QuantumExplorer force-pushed the fix/data-contracts-keyword-search-fallback-id branch from b659eaa to 46b2310 Compare September 21, 2026 11:03
@QuantumExplorer QuantumExplorer changed the title fix(data-contracts): use the keyword-search contract id in the feature-less fallback fix(contract): use the keyword-search contract id in the feature-less fallback Sep 21, 2026
@thepastaclaw

thepastaclaw commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

⚠️ DEGRADED — Queued for automated review — 8th in line, estimated start in ~2.2 h (commit 46b2310)
Estimated review time once started: ~35 min (two-phase automated review; median of recent runs).
The primary review models are currently out of quota; this review will run on stand-in models and be marked as degraded.

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

@QuantumExplorer
QuantumExplorer merged commit 693b8bc into v4.2-dev Sep 21, 2026
20 of 21 checks passed
@QuantumExplorer
QuantumExplorer deleted the fix/data-contracts-keyword-search-fallback-id branch September 21, 2026 11:13
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