fix(rfc64): resolve cold selected CG name hashes - #2043
Open
branarakic wants to merge 4 commits into
Open
Conversation
|
|
||
| /** Offline-development parity for the EVM exact name-hash reverse lookup. */ | ||
| async resolveContextGraphIdByNameHash(nameHash: string): Promise<bigint | null> { | ||
| if (!ethers.isHexString(nameHash, 32)) { |
There was a problem hiding this comment.
💡 Suggestion: Share the name-hash normalizer between EVM and mock adapters
Why it matters
The mock is meant to mirror the EVM adapter contract. Duplicating the boundary parsing in two places makes parity depend on matching strings and normalization behavior by convention rather than by construction.
Suggestion
Export a small normalizeContextGraphNameHash helper from the resolver module or a chain-level utility, and use it in both the resolver and MockChainAdapter. Keep the zero-hash opt-out handling either in the helper or in one clearly documented callsite.
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.
User impact
An Edge user can select an existing public Context Graph after its creation event has aged out of the node's bounded live-event lookback. The node can now recover that selected graph's authoritative numeric on-chain ID directly from the indexed creation commitment, without requiring the ontology graph to have synchronized first.
This removes the cold-start identity deadlock that kept policy, ownership, era, VM and SWM validation pending for an otherwise valid selected graph.
It does not make Edge nodes enumerate or synchronize every public Context Graph. Historical lookup is admitted only for an explicitly selected subscription or a Core-hosted record; arbitrary remote identifiers and passive records cannot start a chain scan.
Stack base: #2041
Before
sequenceDiagram actor User participant Edge participant Poller as "Live event poller" participant Ontology as "Local ontology graph" participant Chain User->>Edge: Select an existing public CG Edge->>Poller: Resolve creation event Poller-->>Edge: Event is older than bounded lookback Edge->>Ontology: Legacy reverse lookup Ontology-->>Edge: No binding in cold store Edge-->>Edge: Numeric CG ID remains unresolved Note over Edge,Chain: Policy, VM and SWM validation cannot establish the authoritative CG bindingAfter
sequenceDiagram actor User participant Edge participant Chain as "ContextGraphStorage" participant DKG User->>Edge: Select an existing public CG Edge->>Edge: Confirm local sync admission Edge->>Chain: Exact indexed ContextGraphCreated(nameHash) lookup Chain-->>Edge: One numeric CG ID candidate Edge->>Chain: getNameHash(CG ID) Chain-->>Edge: Current matching commitment Edge->>Edge: Persist hash-to-ID binding Edge->>Chain: Read policy, ownership and era Edge->>DKG: Continue selected VM/SWM synchronizationImplementation
ContextGraphNameHashResolver;ContextGraphCreated.nameHashtopics in deploy-block-anchored, RPC-safe pages;Validation
Isolated testnet canary evidence
Production Core services were not changed. A fresh isolated Edge used only three selected cleartext public CG IDs and the exact stack head.
m1-20260803o-1 -> 222,-2 -> 223,-3 -> 224;ec7f2bd9restarted healthy with the same peer identity, 3/3 bindings, 18 graphs and 432 triples intact;Review feedback closed
11b87b893: removed permanent positive caching, preserved hash-shaped cleartext IDs, extracted resolver state, reused the canonical cache, and added Core-hosted plus negative-TTL coverage;ec7f2bd9e: collapsed the generic scan framework into one concrete EVM loader and added fail-closed scan-budget coverage.M1 gate status
This PR removes the observed cold selected-CG identity-resolution blocker and has a real-network cold Edge VM+SWM payload proof. It does not by itself claim the entire M1 release gate: the final release evidence must compose the full stack's on-demand, always-on, unselected, restart and Core-coverage cells without treating legacy
syncedmetadata as payload completion.