fix: enforce lowercase asset filenames - #435
Merged
Merged
Conversation
bearpong
had a problem deploying
to
cloudflare-uploads
August 14, 2026 08:44 — with
GitHub Actions
Failure
There was a problem hiding this comment.
Pull request overview
This PR standardizes Berachain metadata image handling by enforcing lowercase asset filenames and Cloudflare Images IDs to avoid case-sensitive duplicates and mismatches between committed assets and published logoURIs.
Changes:
- Lowercased remaining mixed-case
logoURIs insrc/tokens/mainnet.jsonand tightened JSON schemalogoURIpatterns to require lowercase hex addresses. - Updated image validation and Cloudflare upload scripts to enforce/assume lowercase asset filenames and to lowercase Cloudflare image IDs.
- Updated contributor/docs and the vault-pair image generation skill to reflect the lowercase filename requirement.
Reviewed changes
Copilot reviewed 9 out of 222 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/tokens/mainnet.json | Lowercases 4 remaining mixed-case logoURI paths to match lowercase asset IDs. |
| scripts/validateImages.ts | Enforces lowercase asset filenames and lowercases metadata-address lookups when resolving asset paths. |
| scripts/uploadAssets.ts | Lowercases the Cloudflare upload ID filename component and removes ineffective EIP-55 filename validation. |
| schemas/tokens.schema.json | Requires lowercase hex addresses in logoURI patterns. |
| schemas/vaults.schema.json | Requires lowercase hex addresses in logoURI patterns. |
| schemas/validators.schema.json | Requires lowercase hex addresses in logoURI patterns. |
| skills/generate-vault-pair-image/SKILL.md | Updates instructions/examples to use lowercased vault/token asset filenames and logoURIs. |
| CONTRIBUTING.md | Documents lowercase asset filename requirement for new images. |
| AGENTS.md | Documents lowercase asset filename requirement and Cloudflare case-sensitivity rationale. |
| src/assets/vaults/0xc6de36eced67db9c17919708865b3ee94a7d987c.png | Adds/updates a vault asset with a lowercase filename. |
| src/assets/vaults/0x5540e29749f6c8f5dcf49fcc17c67e97a8e7335b.png | Adds/updates a vault asset with a lowercase filename. |
| src/assets/vaults/0x3d0d211365c8a483394426dacd5a73b0154feedb.png | Adds/updates a vault asset with a lowercase filename. |
| src/assets/vaults/0x347106734e7b129dde92333a0007d64a4b08e266.png | Adds/updates a vault asset with a lowercase filename. |
| src/assets/tokens/0xf9ee98099f5078078bb8e17e6b4a4f95137e2037.png | Adds/updates a token asset with a lowercase filename. |
| src/assets/tokens/0x75a226792e574918855740ebe24ad2f06d4d0fb9.png | Adds/updates a token asset with a lowercase filename. |
| src/assets/tokens/0x6698ede14709a9dd8379744cc2d28f276e3d2eac.png | Adds/updates a token asset with a lowercase filename. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
All files under
src/assets/**are now lowercase, and the Cloudflare upload forces lowercase ids regardless of how a contributor names the file.Why
Cloudflare image ids are case-sensitive, so
tokens/0xABC….pngandtokens/0xabc….pngare two different images for the same address. The repo had both conventions live at once — roughly 60% checksummed, 40% lowercase — whilelogoURIhad already drifted to lowercase almost everywhere (only 4 mixed-case URLs left). So for most assets the committed filename and the published URL disagreed.The checksum validation we had was never enforcing this: it calls viem's
isAddress, which short-circuits totruefor any all-lowercase address before it ever checks the checksum. Lowercase filenames passed the "EIP-55 required" gate silently.11 addresses were also tracked twice, under both casings with identical blobs. macOS
core.ignorecasehides that, sogit statuslooked clean.How
uploadAssets.tslowercases the filename before building the CF id. Removed the EIP-55 check that came with it since it validated nothingvalidateImages.tsnow errors on any mixed-case asset filename, with the corrected name in the messagelogoURIschema patterns tightened to[0-9a-f]logoURIs insrc/tokens/mainnet.jsonAlso fixes
validateMetadataImageslooked up assets by the checksummed metadata address, so on Linux CI it never matched a lowercase-named file and downgraded to a warning. Lowercased the lookup — missing assets on a case-sensitive FS drops 189 → 161 (the rest genuinely have no committed image).Note for review
Needs
cloudflare-uploadsapproval. That job re-uploads all 202 renamed assets under their lowercase ids. The 4logoURIs changed here 404 until it runs, since those images only exist on CF under mixed-case ids atm. Old ids stay orphaned but keep working for anyone still hitting them.