Repository navigation
test: follow the test conventions in tests added in 4.1 and 4.2 - #5062
Conversation
- rs-platform-encryption: the round-trip tests drew keys and IVs from thread_rng; seed them with StdRng::seed_from_u64 so a failure reproduces. - try_from_schema v3, validate_update keep-history repair, the withdrawal asset-unlock info v1 and the token evaluate v1 tests pinned protocol version 14 although they test the latest generation; run them at PlatformVersion::latest() (pinning happens when a newer generation arrives). The one test named for the v14 fee cap stays pinned. - v14.rs: drop ranked_feature_slots_exist_but_are_dormant, which only restated PLATFORM_V14 slot values, and put the meta-schema doc comment back on the test it describes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 17 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 (9)
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 |
|
🔍 Review in progress — actively reviewing now (commit 8e26f1e) · triage: low |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Verified the supplied findings against head 577b0e8 and the base-to-head diff. The changes are confined to tests and comments, with no production behavior or consensus changes; two non-blocking documentation/naming inconsistencies remain. Static inspection and git diff --check passed; reviewer-reported test and clippy results were not independently rerun.
💬 2 nitpick(s)
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: architecture-layering); reviewer 3: glm-5.3-flash (agent: phase1-reviewer, role: platform-versioning); reviewer 4: glm-5.3-flash (agent: phase1-reviewer, role: rust-quality); reviewer 5: glm-5.3-flash (agent: phase1-reviewer, role: security-auditor); reviewer 6: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 7: gpt-6-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 8: gpt-6-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 9: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); reviewer 10: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
- Triage:
lowbygpt-6-astra(effort low) — The diff is straightforward test-only maintenance—seeding randomness, using the latest protocol version, and removing a redundant assertion—with no changes to production behavior or critical surfaces. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— architecture-layering (completed, effort high); agentphase1-reviewer,glm-5.3-flash— platform-versioning (completed, effort high); agentphase1-reviewer,glm-5.3-flash— rust-quality (completed, effort high); agentphase1-reviewer,glm-5.3-flash— security-auditor (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 74% left, weekly 29% left; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 13% left, 5h 100% left) - Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort medium); agentphase2-reviewer,gpt-6-astra— architecture-layering (completed, effort medium); agentphase2-reviewer,gpt-6-astra— platform-versioning (completed, effort medium); agentphase2-reviewer,gpt-6-astra— rust-quality (completed, effort medium); agentphase2-reviewer,gpt-6-astra— security-auditor (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/mod.rs`:
- [NITPICK] packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/mod.rs:1287-1293: Update the remaining PV14-specific test name and diagnostics
This test now calls latest(), but its name, doc comment, and expect message still describe a PV14-specific run. Unlike the explicitly pinned historical tests, it will follow the next protocol version, making its failure output identify the wrong version. Rename it to use at_latest and update the accompanying version-specific prose, as this PR already does for sibling test names. The nearby latest-based dispatcher test also retains PV14-specific diagnostics; historical explanations and genuinely pinned tests should keep their version references.
In `packages/rs-platform-version/src/version/v14.rs`:
- [NITPICK] packages/rs-platform-version/src/version/v14.rs:1656-1657: Restore the retained freeze test's replay rationale
Removing ranked_feature_slots_exist_but_are_dormant also deletes the separate six-line rationale belonging to contested_index_cross_check_is_v14_only, although that test remains. The deleted comment explains why changing the v13 structure-validation slot would retroactively reject historical transitions. That is the replay rationale required by the book's exception for historical table-freeze tests, and the PR description explicitly cites those rationales as the reason for retaining these tests. Restore the comment above the surviving test; this is documentation loss, not a runtime or consensus defect.
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Extend test-RNG seeding to the remaining unseeded randomness in test code outside rs-platform-encryption — Out of scope: the cited OsRng uses exist in unchanged shield and state-transition tests, but this PR neither introduces nor worsens them. A workspace-wide RNG cleanup is routine adjacent work, not an exceptional high-value follow-up to preserve in this review.
- Follow-up: Consider creating a separate issue or author/maintainer-requested PR for this.
|
Your move: thepastaclaw left review threads unresolved; resolve them. |
Review follow-ups: removing the dormant-slots test also removed the replay rationale of contested_index_cross_check_is_v14_only; put it back. The generation 3 tests that now run at the latest protocol version no longer name protocol version 14 in their name, docs or failure messages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Basic explanation
What this does: tidies tests written during 4.1 and 4.2 so they follow the project's test rules. Three kinds of fix: some encryption tests used a new random key every run (now they use a fixed seed, so a failure can be reproduced); some tests of the newest version of a function were locked to "protocol version 14" instead of "the latest protocol version" (the project's rule is that the newest code is tested at the latest version, and tests get locked to a number only when a newer version replaces that code); and one test only restated numbers from a settings table, which the project's rules say not to write.
Value: reproducible failures, and tests that follow the tip without churn when protocol version 15 arrives.
Risks: None for behaviour: test code only, and
PlatformVersion::latest()is protocol version 14 today, so every converted test runs exactly as before.Issue being fixed or feature implemented
book/src/contributing/coding-conventions.md, "Tests":StdRng::seed_from_u64)": the rs-platform-encryption tests from feat: complete dashpay in platform wallet and swift example app #3841 usedthread_rng().PlatformVersion::latest(). Only frozen older generations pin an explicit version... Pinning the current generation to today's number only creates churn when the next version lands." (the same call you made on fix(dpp): make document type index update validation name-order independent #4291 forvalidate_updatev1).foois 0 inPLATFORM_V13and 1 inPLATFORM_V14' restates the table literal and cannot fail without the edit being deliberate; do not write it."What was done?
rs-platform-encryption(aes.rs,ecdh.rs,compact_xpub.rs,account_label.rs): keys and IVs come fromStdRng::seed_from_u64.PlatformVersion::latest(): thetry_from_schemav3 tests (thepv14()helper, whose doc argued for pinning, is replaced bylatest()), the keep-history repair tests ofvalidate_update, three of the fourdocument_try_into_asset_unlock_base_transaction_infov1 tests (the one named for the v14 fee cap stays pinned), and theevaluatev1 stability test.v14.rs: removedranked_feature_slots_exist_but_are_dormant(it asserted only that fourPLATFORM_V14slots are 0) and moved a doc comment that had drifted onto the wrong test back toranked_index_keywords_are_gated_by_meta_schema_v3.Not changed here: the tests in
v14.rs,v13.rs,protocol_version.rsandsystem_limits/mod.rsthat assert a shipped version's slot next to protocol version 14's. They carry a replay rationale for the shipped half, which the book allows for freeze tests; whether to keep their protocol version 14 halves is a separate call.How Has This Been Tested?
cargo test -p platform-encryption,cargo test -p dpp --libfortry_from_schema::v3(332),document_try_into_asset_unlock_base_transaction_info(5) anddistribution_function::evaluate(127),cargo test -p platform-version;cargo clippy -p dpp -p platform-encryption -p platform-version --all-features --all-targets -- -D warnings.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
PR Hygiene ·
8e26f1e/skip-botsproceeds without the ones not yet reported/self-reviewedonce the bots are doneWhen every box is checked the
PR Hygienecheck passes and this can merge.