refactor: remove old diffsync (DiffType_V2) support - #231
Open
cheggaaa wants to merge 3 commits into
Open
Conversation
Companion to any-sync's V2 diffsync removal: all connectable peers (compatible versions 12+) negotiate DiffType_V3, and the diff migration had already overwritten old hashes with new ones, so nothing served real V2 data anymore. - nodehead: single head per space, drop oldHashes map and GetOldHead - rpchandler: nodehead fast path answers only V3 head-sync requests - nodestorage: single hash in SpaceUpdate/SpaceStatusEntry/index, drop the v2->v3 diff hash migration machinery - oldstorage: drop unused OnWriteOldHash
Review follow-up for the diffsync-V2 removal: a crafted non-V3 HeadSync request could bypass the removed nodehead fast path and force a full space load only to be rejected by HandleRangeRequest. Reject unsupported types up front (a future V4 requester falls back to V3 on this error, see the upgrade recipe in any-sync's diffmanager.go).
Temporary pseudo-version so CI builds against the companion any-sync PR; replace with a tagged release before merging into files-v2.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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
Companion to anyproto/any-sync#728 — removes node-side support for the dead V2 diffsync. All connectable peers (compatible versions 12+) negotiate
DiffType_V3, and the node's own v2→v3 diff migration had already overwritten stored old hashes with new ones, so V2 responses served no real data.nodehead: single head per space —oldHashesmap,GetOldHead, and the old-head parameter ofSetHeadremovedrpchandler: unsupported diff types are rejected up front, before the deep-sync fallback — a crafted non-V3 request can no longer force a full space load just to be rejected (review finding); a future V4 requester falls back to V3 on this error per the upgrade recipe in any-sync'sdiffmanager.gonodestorage: single hash inSpaceUpdate/SpaceStatusEntry/index; the v2→v3 diff-hash migration machinery is deleted (it only backfilled the now-unread"oh"index key)oldstorage: drop the never-calledOnWriteOldHashhookStale-hash healing for very old space stores is unchanged: wrong/legacy
nhvalues still self-correct via the hash-mismatch → deep-sync →FillDiff→SetHashloop.go.modtemporarily pins any-sync to the companion branch (pseudo-version); replace with a tagged release before merge.Test plan
go test ./...green against the pinned any-sync"oh"mirror in the any-sync PR🤖 Generated with Claude Code