feat(p2p): ION overlay discovery — service bit + detection + seed flag (#114)#121
Merged
Merged
Conversation
#114) Third piece of the ION fast-sync overlay (epic #111). Lets ion-nodes find each other over the Bitcoin P2P network so a new node can fast-sync from a peer. - scripts/pick_service_bit.py: picks the overlay's Bitcoin service bit by dice roll within Bitcoin's experimental range (bits 24-31, reserved for exactly this), five rolls take the fifth. Result: bit 30. - internal/p2p/overlay.go: ServiceION = 1<<30 (0x40000000); SpeaksION(services); Client.IONPeerCount()/IONPeerAddrs() (the discovered overlay neighbourhood among connected peers); speaksION(peer) gate for later phases (only send overlay messages to peers that advertised the bit, so a vanilla Bitcoin peer is never sent an unknown command). - internal/p2p/peer.go: advertise ServiceION in our version message (we still serve no Bitcoin services). - internal/config + cmd/ion-node: --ion-peer (repeatable) → cfg.IONPeers, overlay seed addresses. No public ION seeds exist yet, so they are operator-supplied via the flag; a real seed will be chosen when the ecosystem is ready. This is a placeholder bit for the wider ecosystem; it can change before any real overlay deployment. Dialing/preference of ION peers and the wire protocol land in #115/#118. Tests: SpeaksION over defined/experimental bits (asserts no collision with NODE_NETWORK/WITNESS/etc and bit==1<<30); an end-to-end handshake where a stub server advertising ServiceION is counted as an ION peer (and a vanilla server is not); --ion-peer config plumbing; peerConfig advertises ServiceION. go test -race ./... green. Co-authored-by: Liran Cohen <liranlasvegas@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <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.
Summary
Third piece of the ION fast-sync overlay (epic #111). Lets ion-nodes find each other over the Bitcoin P2P network so a new node can fast-sync from a peer.
The service bit (rolled, as decreed 🎲)
scripts/pick_service_bit.pypicks the bit by dice roll within Bitcoin's experimental range (bits 24–31, reserved for exactly this so it can't collide withNODE_NETWORK/WITNESS/COMPACT_FILTERS/…), five rolls, take the fifth:What's here
internal/p2p/overlay.go—ServiceION = 1<<30;SpeaksION(services);Client.IONPeerCount()/IONPeerAddrs()(the discovered overlay neighbourhood among connected peers); an internalspeaksION(peer)gate so later phases only send overlay messages to peers that advertised the bit (a vanilla Bitcoin peer is never sent an unknown command).internal/p2p/peer.go— advertiseServiceIONin ourversionmessage (we still serve no Bitcoin services).internal/config+cmd/ion-node—--ion-peer(repeatable) →cfg.IONPeers. No public ION seeds exist yet, so they're operator-supplied via the flag for now; the running node we stood up could be the first seed when you're ready.ServiceIONis a placeholder for the wider ecosystem and can change before any real deployment. Dialing/preferring ION peers and the wire protocol land in #115 / #118.Tests
SpeaksIONover defined + experimental bits — asserts no collision with defined service bits andbit == 1<<30.ServiceIONis counted as an ION peer; a vanilla server is not.--ion-peerconfig plumbing;peerConfigadvertisesServiceION.go test -race ./...green (28 packages).Post-Deploy Monitoring & Validation
0x40000000in itsversion; peers that are also ion-nodes become visible viaIONPeerCount(). No behavior change for header/block sync.Part of #111. Closes #114
🤖 Generated with Claude Code