feat(app): name a short id only when the registries of the SF agree, and mark it as a guess - #587
Open
khagele wants to merge 1 commit into
Open
feat(app): name a short id only when the registries of the SF agree, and mark it as a guess#587khagele wants to merge 1 commit into
khagele wants to merge 1 commit into
Conversation
…and mark it as a guess resolveName took the first registry that called a prefix unique, and ambiguous=false is a claim about that registry only: a second one knowing the same 2-byte hash under another name was never asked, and the name reached the ticker and the HUD with nothing to say it was a guess. Every resolver of the companion's SF is now asked at once; a name only when the registries that know the prefix agree, and two different names are a refusal that stays cached. A name on a 2- or 3-byte id wears ~ on every surface. Full keys, channel senders and 8-byte prefixes are unchanged. Closes efiten#452 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Closes #452
The problem
resolveNameasked the configured registries in order and took the first that answeredambiguous: false. That flag is a claim about one registry: a second registry knowing the same 2-byte prefix under another name was never asked, so disagreement could not even be observed. A 2-byte relay hash is the forwarder's hash out of the path, one in 65,536 per registry, and the name it got reached the ticker and the HUD looking like a resolved identity (73s.be repeater_3_on hash2beb, 2026-08-22). Decisions and what stays a guess are indocs/2026-09-05-names-agree-or-nothing.md.My changes in this PR
resolversFor: every registry of the companion's spreading factor, asked at once; a registry of another SF names nodes this radio cannot hear, so it is left out. With the SF unknown, all are asked. Config order no longer means priority (orderResolversis gone).consensusName: one registry knowing the prefix, or several agreeing, is a name. Two different names for one prefix is a refusal, cached as such even when a third registry was unreachable, because no retry can turn disagreement into a name. Silence with a registry unreachable is not cached, as before.isGuessedNameanddisplayNameinapp/src/names.js; a name on a 2- or 3-byte id shows as~namein the ticker (senderText), the HUD (senderReadout), the target list (targetParts) and the map popup. An advert's own name on its full key, a channel sender's name and an 8-byte discover prefix carry no mark; a 1-byte hash never carries a name.Cost
One request per registry of the SF per unknown id instead of one per id, bounded by the session cache and the in-flight coalescing of #230. With the two registries in
config.example.jsonthat is at most double.Verification
parity.test.jsTests with two stub resolvers, as the issue asked: two names for one prefix give none and the refusal is remembered; agreement gives the name, and so does one registry knowing it; only the resolvers of the companion SF are asked; silence with a registry down is not cached; disagreement with a registry down stays refused. Mutation-checked: consensus taking the first name, the SF filter removed, the guess floor at 16 hex and the refusal cache dropped each go red. Three existing tests that asserted an unmarked name on a 3-byte id now assert the mark.
Browser, two stub resolvers of SF 7, three receptions: both registries are asked for both prefixes; the ticker and the target list show
2beb(they disagreed),~Agreed(they agreed) andalpha(an advert's own name, unmarked).Not in this PR
web/names.js: the website resolves prefixes on its own terms and app/web disagree on sender identity in the node-position layer #296's rule for identities is unchanged.🤖 Generated with Claude Code