Expose stale and failed randomness metadata states#131
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 (18)
✅ Files skipped from review due to trivial changes (9)
🚧 Files skipped from review as they are similar to previous changes (7)
📝 WalkthroughWalkthroughAdds lifecycle-aware metadata states (pending, stale, failed, final) by extending StreamCore to query randomizer lifecycle contracts, mapping lifecycle request states to token display states; introduces a lifecycle mock and golden-fixture tests; and updates ADRs, docs, release manifests, and checksums. ChangesLifecycle-Aware Metadata State Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
🚥 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.
|
|
@coderabbitai review Head moved only to persist the prior review request in |
|
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/status.md (1)
241-247:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winClarify that freeze rejects stale and failed live tokens too.
ADR 0006 treats live
StaleandFailedPostProcessingtokens as non-freeze-eligible, so this summary shouldn’t read as if onlypendingblocks freeze.🤖 Prompt for 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. In `@docs/status.md` around lines 241 - 247, Update the status summary text to explicitly state that freeze excludes live tokens in the Stale and FailedPostProcessing states as well as pending; reference ADR 0006 and change any phrasing that implies only "pending" blocks freeze to something like "freeze rejects pending, Stale, and FailedPostProcessing live tokens" so readers understand all non-freeze-eligible live token states are covered.
🤖 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 `@ops/AUTONOMOUS_RUN.md`:
- Around line 35-40: Update the run-state to reference the actual open PR:
replace the "Active PR" value currently set to `TBD` with `#131` and likewise
update the "Active PR branch" / repository-state table entry if needed to
reflect `codex/metadata-randomness-state-display` → PR `#131`; also edit the Queue
Item 68 worklog to record PR `#131` (apply the same change to entries covering PRs
129-135 where "TBD" appears) so the handoff is self-contained and consistent.
In `@smart-contracts/StreamCore.sol`:
- Around line 820-848: In _pendingTokenMetadataState, don’t assume the
randomizer supports the lifecycle API: first staticcall the
collectionAdditionalData[collectionId].randomizerContract for
IRandomizerLifecycle.supportsRandomizerLifecycle and only proceed to call
randomnessRequestStateForToken (the current selector/assembly block) if that
supports call returns true; otherwise immediately return
_METADATA_STATE_PENDING. Ensure you use the supportsRandomizerLifecycle
selector/result to gate the existing assembly staticcall and state checks so a
contract that exposes randomnessRequestStateForToken but returns false from
supportsRandomizerLifecycle falls back to pending.
---
Outside diff comments:
In `@docs/status.md`:
- Around line 241-247: Update the status summary text to explicitly state that
freeze excludes live tokens in the Stale and FailedPostProcessing states as well
as pending; reference ADR 0006 and change any phrasing that implies only
"pending" blocks freeze to something like "freeze rejects pending, Stale, and
FailedPostProcessing live tokens" so readers understand all non-freeze-eligible
live token states are covered.
🪄 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: f7618779-cfc4-48f1-b860-dbf3ab0da60b
📒 Files selected for processing (26)
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/0005-randomness.mddocs/adr/0006-metadata-freeze.mddocs/adr/0007-upgrade-redeployment.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/StreamCore.soltest/README.mdtest/StreamMetadataGolden.t.soltest/fixtures/metadata/offchain-failed-token-uri.txttest/fixtures/metadata/offchain-stale-token-uri.txttest/fixtures/metadata/onchain-failed-schema-v1-token-uri.txttest/fixtures/metadata/onchain-stale-schema-v1-token-uri.txt
|
Addressed CodeRabbit review:
Validation:
@coderabbitai review |
|
🐇 ✅ ✅ Action performedReview finished.
|
|
A few notes on the updates:
Triggering a review of the latest head now. 🐇 ✅ ✅ Action performedReview finished.
|
Summary
StaleandFailedPostProcessingrequests into publictokenMetadataState, off-chain token URI suffixes, and schema-v1 on-chain JSON while preserving unsupported/missing lifecycle fallback topendingand nonzero-hash override tofinal.StreamCoreis EIP-170 compliant at 24,348 runtime bytes with 228 bytes of headroom, below the repo's 384-byte internal release floor.Tests
forge test --match-path test\StreamMetadataGolden.t.sol -vvvforge build --sizes --via-ir --skip test --skip script --forcemake release-checksumsmake release-checksums-checkmake checkpowershell -NoProfile -ExecutionPolicy Bypass -File scripts\check.ps1forge fmt --check smart-contracts\StreamCore.sol test\StreamMetadataGolden.t.solgit diff --checkCloses #130
Summary by CodeRabbit
New Features
Documentation
Tests
Fixtures