Dev hyper aos migration - #30
Open
jim-toth wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.