Improve legacy vs peer syncing#565
Draft
oskarszoon wants to merge 4 commits intobsv-blockchain:mainfrom
Draft
Conversation
…rchestration Implements the improve-legacy-peer-sync OpenSpec change. Summary of what changed: Adds CentralizedPeerRegistry to the blockchain service — a transport-agnostic store for peers from both P2P (HTTP/DataHub) and Legacy (wire protocol) services. Includes reputation scoring, atomic file persistence, and TTL-based cleanup. Exposed over a new PeerRegistryService gRPC endpoint (RegisterPeer, UpdatePeerMetrics, RemovePeer, ListPeers). P2P registers connected peers in the centralized registry on connect/disconnect and reports bytes/height changes. Legacy registers wire-protocol peers on version handshake and removes them on disconnect. Adds CatchupTransport interface with two implementations: - HTTPTransport: wraps existing DataHub HTTP fetch logic - WireTransport: delegates to Legacy's new FetchHeadersFromPeer / FetchBlockFromPeer gRPC methods, which send getheaders/getdata wire protocol messages to a connected legacy peer BlockValidation now drives catchup independently via the centralized peer registry. A registry poller detects when any peer (HTTP or wire) reports a height higher than our best block and initiates catchup. Peer selection is transport-agnostic (ranked by reputation score); the transport is dispatched based on the selected peer's TransportType. - Removes LEGACYSYNCING FSM state and LEGACYSYNC event — CATCHINGBLOCKS is the single catchup state. Proto enum slots reserved for backward wire compat. - Removes Kafka-based catchup trigger from P2P SyncCoordinator - Removes LegacySync() from blockchain service interface and server BlockValidation is wired with a PeerRegistryClient and WireTransport at startup.
cd79d69 to
37eeff4
Compare
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.