Skip to content

fix(registry): enforce safe username charset and add season rank lookup - #1507

Open
Ranjeet2063 wants to merge 1 commit into
ada-nwali:testnet-implementationfrom
Ranjeet2063:fix/registry-username-charset-and-season-rank
Open

Ranjeet2063 wants to merge 1 commit into
ada-nwali:testnet-implementationfrom
Ranjeet2063:fix/registry-username-charset-and-season-rank

Conversation

@Ranjeet2063

Copy link
Copy Markdown

Summary of Changes

This PR addresses two registry issues by strengthening username security and adding season-level rank lookup capabilities:

  1. Safe Username Charset Enforcement (Usernames can contain invisible and lookalike characters #1454):

    • Enforces safe charset [a-zA-Z0-9_] in RegistryContract::register before lowercasing normalization.
    • Rejects invisible unicode characters, zero-width spaces (\u{200b}), control bytes, spaces, and punctuation with RegistryError::InvalidUsername.
    • Prevents lookalike spoofing and homoglyph attacks on the leaderboard.
  2. Season Rank Lookup (Add season rank lookup and show it on the leaderboard #1452):

    • Implements get_season_rank(env: Env, season: u32, user: Address) -> Result<u32, RegistryError>.
    • Scans the bounded SeasonTop(season) list for the caller and returns 1-based rank or UNRANKED (u32::MAX).
    • Returns RegistryError::NotRegistered if the target address has not registered a profile.
  3. Leaderboard Maintenance & Bugfix:

  4. Testing:

    • Added issue_1454_1452_tests verifying safe/invalid username charset rejection and multi-season rank lookups.
    • All 114 unit tests pass with zero warnings: cargo test -p automint-registry.

Closes #1454
Closes #1452

- Enforce safe charset [a-zA-Z0-9_] on register to reject invisible unicode, zero-width spaces, and lookalikes
- Implement get_season_rank(season, user) for per-season leaderboard ranking lookup
- Fix broken upstream apply_to_top merge conflict
- Add regression test suite for charset validation and season rank

Closes ada-nwali#1454
Closes ada-nwali#1452
Copilot AI balanced review requested due to automatic review settings November 10, 2026 10:52
@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown

@Ranjeet2063 is attempting to deploy a commit to the Ada's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
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.

Usernames can contain invisible and lookalike characters Add season rank lookup and show it on the leaderboard

2 participants