Skip to content

Dev hyper aos migration - #30

Open
jim-toth wants to merge 2 commits into
mainfrom
dev-hyper-aos-migration
Open

Dev hyper aos migration#30
jim-toth wants to merge 2 commits into
mainfrom
dev-hyper-aos-migration

Conversation

@jim-toth

Copy link
Copy Markdown
Contributor

No description provided.

jim-toth added 2 commits July 28, 2026 12:44
Fifth W4 port. Replaces @permaweb/aoconnect 0.0.85 and the local
send-aos-message.ts wrapper with the shared client. This service is read-only,
so no signer is constructed — the wrapper's sendAosMessage half had no callers
at all.

D17 — explicit endpoints. CU_URL/GATEWAY_URL/GRAPHQL_URL are gone, replaced by a
single HB_URL with NO default (nodeUrlFromEnv fails closed). Two of the three
removed vars were unset in both HCLs and silently defaulted into aoconnect's
public endpoints.

The read is not a like-for-like swap. /operators was a View-State dryrun that
downloaded all five registry maps so the service could uniq the values of one
and difference them against the keys of another. The native contract added the
`operators` view for exactly this consumer and does that on-device, returning an
already-deduped, already-blocked-filtered SET. So the read now ships 830
addresses instead of five maps totalling ~1MB, and the lodash pipeline collapses
into Object.keys — lodash was its only remaining user in the service and is
dropped.

Verified against a real migrated registry (7932 verified fingerprints, 830
unique operators): addresses come back EIP-55 rather than legacynet ALLCAPS, and
blocking an address out-of-band drops it from the view (830 -> 829), so the
filter the service used to apply client-side is genuinely preserved.

src/util/operator-registry.ts is deleted rather than ported: it was a
byte-identical copy of the same dryrun with no importers anywhere.

The TTL cache is kept but now caches the derived address list. Serving stale on
a failed refresh is deliberate and is now covered by a test — this backs a public
endpoint, where an empty list would read as "every operator left the network".

Test harness, all pre-existing breakage surfaced by adding a suite that must
actually run:

  - tsconfig `types: ["node"]` excluded @types/jest, so every test in tests/
    failed to compile. Neither existing suite had been running.
  - jest testRegex made the (test|spec) group optional, matching every .ts under
    tests/ including helpers.
  - src/app.ts constructs OperatorRegistryService at module scope, so importing
    the app needs the registry env present; tests/setup-env.ts supplies
    placeholders. The integration tests key off the process id being a real
    43-char AO id, not off the vars merely existing.

skipLibCheck matches the ported Nest services: ao-client's .d.ts reaches
@dha-team/arbundles through an `exports` subpath that this CJS project's node10
resolution cannot follow, though runtime require() resolves it fine.

17/17 against a local node holding real migrated state; 14 + 3 skipped without
one.
This service only ever reads. Under the D4 design a read is an unsigned GET
against the process's own device — no signing, no scheduled message, no new slot
— so it needs none of the ANS-104 machinery @anyone-protocol/ao-client exists to
provide.

The cost of the dependency was concrete. ao-client peer-depends on
@dha-team/arbundles: 7 MB and 12 direct deps, including the whole @ethersproject
v5 stack, arweave, keccak and secp256k1 — pulled in alongside the ethers v6 this
service already used, to sign nothing. It also forced skipLibCheck into tsconfig,
because ao-client's .d.ts reaches arbundles through an `exports` subpath this CJS
project's node10 resolution cannot follow. Removing the dependency removes that
too, so tsconfig goes back to its original strictness.

src/util/ao-read.ts replaces it: fail-closed HB_URL, one GET, JSON.parse, and
retry on 5xx and network errors only. A 404 means the view or process does not
exist and will not start existing, so it is not retried — the old wrapper's
substring match on '500' retried nothing else either, but by accident rather than
by intent.

The file is deliberately read-only, and says so. If a write is ever needed here,
take the dependency rather than growing a signer — that is the line the seven
divergent send-aos-message.ts copies crossed.

uns-record-indexer, the other state-only consumer, turned out to have no AO
dependency at all, so there was nothing to remove there.

17/17 against a local node holding real migrated state; 14 + 3 skipped without
one.
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