Skip to content

fix: enforce lowercase asset filenames - #435

Merged
bearpong merged 2 commits into
mainfrom
fix/force-lowercase-filenames
Aug 14, 2026
Merged

fix: enforce lowercase asset filenames#435
bearpong merged 2 commits into
mainfrom
fix/force-lowercase-filenames

Conversation

@bearpong

Copy link
Copy Markdown
Collaborator

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….png and tokens/0xabc….png are two different images for the same address. The repo had both conventions live at once — roughly 60% checksummed, 40% lowercase — while logoURI had 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 to true for 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.ignorecase hides that, so git status looked clean.

How

  • Renamed 202 assets to lowercase, dropped the 11 duplicate index entries (kept the lowercase twin, content is byte-identical)
  • uploadAssets.ts lowercases the filename before building the CF id. Removed the EIP-55 check that came with it since it validated nothing
  • validateImages.ts now errors on any mixed-case asset filename, with the corrected name in the message
  • logoURI schema patterns tightened to [0-9a-f]
  • Lowercased the 4 remaining mixed-case logoURIs in src/tokens/mainnet.json
  • Docs: CONTRIBUTING, AGENTS, generate-vault-pair-image skill

Also fixes

validateMetadataImages looked 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-uploads approval. That job re-uploads all 202 renamed assets under their lowercase ids. The 4 logoURIs 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in src/tokens/mainnet.json and tightened JSON schema logoURI patterns 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.

@bearpong
bearpong deployed to cloudflare-uploads August 14, 2026 08:59 — with GitHub Actions Active
@bearpong
bearpong merged commit 9352eff into main Aug 14, 2026
9 checks passed
@bearpong
bearpong deleted the fix/force-lowercase-filenames branch August 14, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants