fix(contract): use the keyword-search contract id in the feature-less fallback - #4873
Conversation
|
Warning Review limit reachedNext included review available in 21 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Repository: dashpay/platform/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
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. Comment |
PR HygieneState: waiting-bots · commit
Self-review is an author attestation that you have read the diff: This check passes when the policy is satisfied; the repository decides whether merging requires it. |
… 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>
b659eaa to
46b2310
Compare
|
|
Issue being fixed or feature implemented
The
#[cfg(not(feature = "keyword-search"))]arm ofSystemDataContract::id()inpackages/data-contracts/src/lib.rscarried 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 thekeyword-searchfeature therefore answeredSystemDataContract::KeywordSearch.id()with the wallet-utils id.Default builds (
all-contracts) were not affected: with the feature on, the arm readskeyword_search_contract::ID_BYTES.What was done?
ID_BYTES.app_connect_id_matches_the_published_idtest (added in feat(platform)!: add app-connect login response system contract #4869) intoevery_system_contract_id_matches_the_published_id, which walksSystemDataContract::ALLand checks each variant against thecontractIdpublished in its crate'slib/systemIds.js.FeatureFlagsis 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?
All green. With the old bytes restored,
cargo test -p data-contracts --no-default-featuresfails withKeywordSearch id does not match its published id, so the test does catch the bug it was written for.Breaking Changes
None.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code