feat: multibyte capability map overlay (#903)#916
Open
efiten wants to merge 14 commits intoKpa-clawbot:masterfrom
Open
feat: multibyte capability map overlay (#903)#916efiten wants to merge 14 commits intoKpa-clawbot:masterfrom
efiten wants to merge 14 commits intoKpa-clawbot:masterfrom
Conversation
…ot#903) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…old start Load() previously loaded all transmissions regardless of retentionHours, causing buildSubpathIndex() to process the full DB history on every startup. On a DB with 277K paths this produces 13.5M subpath index entries, OOM-killing the process before it ever starts listening. Apply the same retentionHours cutoff to Load()'s SQL that Evict() already uses at runtime. Startup now builds indexes only over the retention window, matching steady-state behaviour and keeping index size proportional to recent activity. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The server opens SQLite with mode=ro so persistMultiByteCapability() silently failed on every UPDATE, leaving all nodes at multibyte_sup=0. Replace DB persist with an in-memory cache: GetHashSizes() stores the computeMultiByteCapability() result in mbCapSnapshot (under cacheMu), GetMultibyteCapMap() exposes a pubkey→entry snapshot, and routes enrich node responses from that map alongside EnrichNodeWithHashSize — the same pattern already used for hash_size. Data refreshes each analytics cycle (~15s); no DB writes needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
loadNodes() is called on every incoming ADVERT packet, which called renderMarkers() and destroyed any open popup. Track popup visibility via Leaflet's popupopen/popupclose map events; skip renderMarkers() during data refresh while a popup is open so the user can read it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…yte suspected detection A node whose own adverts confirm hash_size=1 cannot forward multibyte packets. If it appeared as a 'suspected' hop it was due to a prefix collision (1-byte hash prefix shared with a multibyte-capable node), not actual multibyte capability. Mark it 'unknown' instead of 'suspected'. Adds TestMultiByteCapability_SuspectedGuard_OwnHashSize1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
A node can send hash_size=1 adverts but still have multibyte firmware and forward multibyte packets. The guard incorrectly suppressed legitimate suspected classifications. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ction Pre-Kpa-clawbot#886 ingestor data stored path bytes individually (1-byte entries per hop) even for hs=2 packets. This caused 1-byte node prefixes to match single-byte path fragments from hs=2 packets, incorrectly marking nodes as suspected. Fix: require hop string length (len(pfx)/2) to equal the packet hash_size. A 1-byte hop in an hs=2 packet is stale/malformed data and must not trigger a suspected classification. Adds TestMultiByteCapability_HopLengthMismatch; updates PrefixCollision test to use proper 2-byte hops instead of the now-filtered 1-byte case. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8 tasks
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.
Summary
multibyte_sup/multibyte_evidencecolumns tonodes+inactive_nodesvia ingestor migration (multibyte_sup_v1)/api/nodesresponses:multibyte_sup= 0/1/2,multibyte_evidence="advert"/"path"/nullLoad()now applies theretentionHourscutoff at startup, matchingEvictStale()behaviourTest plan
cd cmd/ingestor && go test ./...— coversmultibyte_sup_v1migration for nodes + inactive_nodescd cmd/server && go test ./...— covers node enrichment, multibyte capability detection, bounded_load OOM fixCloses #903
Generated with Claude Code