Skip to content

chore: contracts owns the anchor-name vectors; CI checks our copy - #9

Draft
JamesCarnley wants to merge 1 commit into
mainfrom
chore/name-vectors-sync
Draft

JamesCarnley wants to merge 1 commit into
mainfrom
chore/name-vectors-sync

Conversation

@JamesCarnley

Copy link
Copy Markdown
Member

Draft: merge efs-project/contracts#55 first. Until #55 lands the vectors file on contracts main, the new CI step fails with HTTP 404. Merging this first would turn every SDK PR red.

Summary

  • The anchor-name conformance vectors added in test: shared golden vectors for the canonical anchor-name encoding #7 are now owned by efs-project/contracts, at packages/hardhat/test/fixtures/anchor-names.vectors.json, next to specs/02. The SDK keeps a byte-identical copy.
  • New CI step scripts/check-name-vectors-drift.mjs fails when the SDK copy differs from contracts main and prints the first differing line. It fails hard on network errors, like the existing deployment drift gate.
  • The file's header now names the contracts copy as canonical. The same header change goes into #55, so the two copies stay identical.

Why

The v1 name encoding is defined by contracts specs/02, enforced by the deployed EFSIndexer, and implemented again by EFSRouter (#55) and the SDK's encodeName. The vectors are that rule written as examples, so they belong with the spec. If the SDK and the contract disagree, the SDK is the side that's wrong, and changing a rule shouldn't require an SDK PR first. specs/10's contentHash vectors already follow this pattern.

Two copies with nothing comparing them would let one drift while both test suites stay green. That's how the media-type validators diverged twice.

Test plan

  • Against contracts main today: fails with HTTP 404 (expected until #55 merges)
  • Pointed at #55's current head: reports the first differing line (the old header)
  • names-vectors.test.ts: 177 passed
  • pnpm lint, pnpm changeset status --since=origin/main
  • After #55 merges with the updated file: mark ready; CI should go green

Agents involved

Claude Opus 5.5 (SDK dev session). Coordinated with the contracts-issues agent working on #55.

🤖 Generated with Claude Code

The v1 anchor-name encoding is defined by contracts specs/02 and
enforced by the deployed EFSIndexer; EFSRouter (contracts#55) and
encodeName implement it too. The conformance vectors therefore belong
with the spec, in the contracts repo: when the SDK and the contract
disagree, the SDK is the side that is wrong, and changing a rule
should not require an SDK PR first.

Two copies with nothing comparing them would let one drift while both
suites stay green, so scripts/check-name-vectors-drift.mjs fails CI
when our copy differs from contracts main, network-hard-fail like the
deployment drift gate. The file's header now names the contracts copy
as canonical (both copies change together via contracts#55).

Until contracts#55 merges the file to contracts main, the new step
fails with HTTP 404 — merge #55 first.

Verified: the check fails on the 404 today, and pointed at #55's
current head it reports the first differing line; names-vectors tests
(177), biome ci, changeset status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant