Enforce production raw attribute schema#123
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (13)
✅ Files skipped from review due to trivial changes (8)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThis PR enforces production raw-attribute schema: nonempty fragments must be comma-separated JSON objects each with exactly "trait_type" and "value" JSON string fields; StreamMetadataRenderer.isSafeRawAttributes was rewritten, tests added, docs/ops updated, and release/deployment checksums regenerated to reflect the bytecode change. ChangesProduction raw attribute schema enforcement
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@smart-contracts/StreamMetadataRenderer.sol`:
- Around line 306-309: The code currently treats whitespace-only fragments as
valid by skipping leading spaces then returning true when index == input.length;
change this so that in production schema mode a fragment that is only spaces is
rejected: after calling _skipRawAttributeSpaces(input, 0) and computing index,
if index == input.length then, when in production schema mode, return false
(reject) instead of true; keep the existing behavior outside production mode.
Update the branch that returns true to consult the production/schema-mode flag
and flip the result when appropriate so the "nonempty must be object sequence"
rule cannot be bypassed by whitespace-only input.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1c77452d-1b9d-44af-b02a-b693573b2020
📒 Files selected for processing (20)
CHANGELOG.mddeployments/address-books/anvil-6529stream-v0.1.0-001-broadcast.jsondeployments/address-books/anvil-6529stream-v0.1.0-001.jsondeployments/examples/anvil-6529stream-v0.1.0-001-broadcast.jsondeployments/examples/anvil-6529stream-v0.1.0-001.jsondocs/adr/0006-metadata-freeze.mddocs/known-blockers.mddocs/metadata.mddocs/status.mdops/AUTONOMOUS_RUN.mdops/ROADMAP.mdrelease-artifacts/latest/SHA256SUMSrelease-artifacts/latest/abi-checksums.jsonrelease-artifacts/latest/release-artifact-manifest.jsonrelease-artifacts/latest/release-checksums.jsonrelease-artifacts/latest/release-manifest.jsonrelease-artifacts/latest/source-verification-inputs.jsonsmart-contracts/StreamMetadataRenderer.soltest/README.mdtest/StreamMetadataEscaping.t.sol
Closes #122.
Refs #51.
Summary
StreamMetadataRenderer.isSafeRawAttributesso production token attributes are either empty or comma-separated objects with exactlytrait_typeandvalueJSON string fields.Notes
StreamCoreremains 24,135 runtime bytes with 441 bytes of EIP-170 headroom; linkedStreamMetadataRendereris 8,591 runtime bytes.Validation
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\bootstrap-windows.ps1forge fmt smart-contracts\StreamMetadataRenderer.sol test\StreamMetadataEscaping.t.solforge fmt --check smart-contracts\StreamMetadataRenderer.sol test\StreamMetadataEscaping.t.solforge test --match-path test\StreamMetadataEscaping.t.sol -vvvmake release-checksumsmake checkpowershell -NoProfile -ExecutionPolicy Bypass -File scripts\check.ps1bash -n scripts/check.shgit diff --checkmake release-manifest-checkmake release-checksums-checkSummary by CodeRabbit
New Features
trait_typeandvaluestring fields; on-chain guard added.Documentation
Tests
Chores