Skip to content

Namespace regex too restrictive — blocks provider names with digits #47

@a6b8

Description

@a6b8

Problem

The namespace validation in MainValidator.mjs uses the regex ^[a-z]+$, which only allows lowercase letters. This blocks legitimate provider names that contain digits:

  • x402 — payment protocol
  • erc8004 — ERC standard
  • a2a — Google Agent-to-Agent protocol
  • web3 — common prefix

Current Behavior

// Rejects these:
namespace: 'x402'      // ✗ contains digit
namespace: 'erc8004'   // ✗ contains digit
namespace: 'web3'      // ✗ contains digit

// Accepts these:
namespace: 'etherscan'  // ✓
namespace: 'defilama'   // ✓

Proposed Fix

Change regex to ^[a-z][a-z0-9]*$:

  • Must start with a lowercase letter (prevents 123provider)
  • Then allows lowercase letters and digits
  • Still no hyphens, underscores, or uppercase (keeps namespaces as valid identifiers)

Breaking Change Assessment

No existing schemas are affected (all current namespaces are pure lowercase letters). This only expands what is accepted.

Priority

P1 — Blocks onboarding of certain providers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions