Repository navigation
fix(dpp): cut long platform value text on a character boundary when displaying it - #5434
Conversation
…aying it `Value`'s `Display` truncated text longer than 20 bytes with `split_at(20)`, which panics when byte 20 falls inside a multi-byte character. It now cuts at the last character boundary at or before byte 20. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
✅ Final review complete — no blockers (commit fcb8b56) · triage: low |
|
Waiting for bot review — coderabbitai not yet · thepastaclaw ✓. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Verified the complete diff at db55f1f: the bounded backward scan safely selects a UTF-8 character boundary and preserves output for previously non-panicking inputs. The regression test covers the reported multibyte failure and unchanged ASCII truncation; no actionable defects remain after verification. This was a static review only; Rust workspace tests were still running in the supplied CI snapshot.
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — This is a small, contained UTF-8 truncation fix in Value's Display implementation with focused regression coverage and easily verified correctness. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— rust-quality (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 99% left, weekly 91% left; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 14% left, 5h 100% left) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort medium); agentphase2-reviewer
Replace the hand-rolled is_char_boundary loops in platform-value Display, the drive-abci query status bound, and the DashPay account label fit with str::floor_char_boundary (stable since Rust 1.91). Output is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — coderabbitai ✓ · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
@coderabbitai review 🤖 Posted autonomously by Claude on behalf of pasta. |
✅ Action performedReview finished.
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Verified the complete diff at fcb8b56: the Value display fix safely truncates UTF-8 while preserving previously successful output, and both accompanying refactors preserve existing behavior. No actionable in-scope findings remain after validating the supplied reviews against the source. Static validation included git diff --check; no builds or tests were run, and the supplied CI snapshot still showed Rust workspace tests and PR Hygiene pending, with no failed checks reported.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 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: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 8: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — The diff is a small, contained UTF-8 truncation fix with a focused regression test and two equivalent standard-library refactors, making correctness straightforward to confirm. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— rust-quality (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 99% left, weekly 91% left; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 14% left, 5h 100% left) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
|
/self-reviewed |
|
Missing human approval. Automatic reviewer requests are paused and this PR is excluded from reviewers' queues. Merge, close, or draft another active PR by this author to free a review slot. Required human review can be satisfied without a slot; once all merge requirements are met, PR Hygiene passes. |
Issue being fixed or feature implemented
Value'sDisplaycuts text longer than 20 bytes to its first 20 bytes withsplit_at(20). When byte 20 falls inside a multi-byte UTF-8 character,split_atpanics. Anything that formats aValuecan hit it, for example theValueWrongTypemessages built from a value indocument_type/property/mod.rs.Split out of #5285.
What was done?
The text is now cut with
str::floor_char_boundary(20), the last character boundary at or before byte 20.Two other byte-limited truncations already did this with a hand-written
is_char_boundaryloop. They now usefloor_char_boundarytoo, with the same output:bounded_messageinrs-drive-abci/src/query/service.rsfit_account_labelinrs-platform-encryption/src/account_label.rsHow Has This Been Tested?
should_truncate_long_text_on_a_character_boundaryindisplay.rs. It covers text whose byte 20 is insideé, and ASCII text, whose output is unchanged.cargo test -p platform-value --lib displaycargo test -p platform-encryption --lib account_labelcargo test -p drive-abci --test query_request_errors should_deliver_bounded_oversized_statuses_over_real_grpcBreaking Changes
None.
In-place changes to shipped generations
None of the changed functions are versioned, and none of the changes can modify consensus:
Value'sDisplay: output is byte-identical for every input that did not panic before. That is all text whose byte 20 is a character boundary, including all ASCII. An input that used to panic aborted the process instead of producing a result to agree on.bounded_messageandfit_account_label:floor_char_boundaryreturns the same index as the loop it replaces, so output is identical for every input. Neither runs during block execution.bounded_messagelimits the length of gRPC query error messages.fit_account_labelis only used by clients (rs-sdk,rs-platform-wallet,rs-sdk-ffi) to prepare a DashPay account label for encryption.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
Summary by CodeRabbit
PR Hygiene ·
fcb8b56rs-drive-abci(packages/rs-drive-abci/src/query/service.rs) — QuantumExplorer or shumkovpackages/rs-platform-encryption/src/account_label.rs,packages/rs-platform-value/src/display.rs) — QuantumExplorer or shumkovWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.