Skip to content

Fix canonical bridge classification and content-based token list versions - #54

Merged
SilasZhr merged 2 commits into
mainfrom
fix/tokenlist-bridge-and-versioning
Sep 18, 2026
Merged

SilasZhr merged 2 commits into
mainfrom
fix/tokenlist-bridge-and-versioning

Conversation

@0xBreadguy

Copy link
Copy Markdown
Member

Problem and result

The Ethereum ETH entry is currently labeled bridgeType: "others" because its lowercase bridge address is compared against a checksummed string. Both generated lists also hardcode version 1.0.0, preventing version-aware consumers from reliably identifying list updates.

Normalize bridge addresses for comparison while preserving the published address. Version each list against its own previous output: removals (including address/chain replacements) bump major, additions bump minor, and metadata changes bump patch. Unchanged content preserves the previous version and timestamp; token ordering and object property ordering do not create updates. A missing output starts at 1.0.0; malformed or unreadable existing history fails instead of resetting the version.

Publication and regression coverage

  • Regenerate on generator/source and generation-workflow changes, with a manual trigger available.
  • Serialize generation and check out current main so queued runs use the latest committed list history.
  • Run Jest and TypeScript checks in PR validation. Stop ignoring the test directory and format its existing test file to satisfy the repository-wide formatting check.
  • Cover bridge casing, noncanonical/missing bridges, no-op runs, metadata/add/remove/address/chain changes, first generation, corrupt/unreadable history, and independent mainnet/testnet versions.
  • Generated outputs remain CI-owned and are not included in this diff.

Updated assessment of #52

Supersedes #52 and the implementation proposed in closed PR #51. Thanks to @Nexory for identifying the two underlying bugs. Against main at 87fe2b0, the confirmed casing mismatch affects the Ethereum ETH entry, not all Ethereum entries. The commit-count/patch-only alternative suggested in #52 would not encode the token-list standard's addition/removal semantics. The implementation in #51 also advanced unchanged lists and did not actually retain 1.0.0 on initial generation.

This is a maintainer-level repository change involving generator logic and CI, rather than a routine token submission; external-contributor rules restrict such changes to maintainers.

Validation

  • npm test -- --runInBand: 39 tests passed across 3 suites.
  • npx tsc --noEmit: passed.
  • npx prettier --check . and git diff --check: passed.
  • Actual generation: mainnet retains 42 entries, changes only Ethereum ETH to canonical, and advances 1.0.0 to 1.0.1; testnet retains its 2 entries and 1.0.0 version.
  • A second generation produces byte-identical files for both lists. Generated files were restored after this check.
  • Existing dependency audit is not clean: the unchanged lockfile reports 5 vulnerabilities (1 low, 1 moderate, 3 high). Dependency remediation is outside this fix.

@0xBreadguy

Copy link
Copy Markdown
Member Author

Clean-up wave for the repo coming in.

Features:

  • cleaned up capitalization for canonical bridge contract
  • automated versioning based on what's changed (removal: major, addition: minor, metadata: patch)
  • merge generator updates now also re-publish
  • regression testing

Assisted by Astra but had it run several checks. Also create PR#55 to address the linting issues which came up when I created this.

@0xBreadguy
0xBreadguy requested a review from SilasZhr September 15, 2026 19:33

@SilasZhr SilasZhr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@SilasZhr
SilasZhr merged commit fd06ab5 into main Sep 18, 2026
6 checks passed
@SilasZhr
SilasZhr deleted the fix/tokenlist-bridge-and-versioning branch September 18, 2026 14:13
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