feat(wire): rename ConnectionKind::Regular to OutboundFullRelay, add BlockRelayOnly and AddrFetch#970
Open
Sandipmandal25 wants to merge 1 commit into
Conversation
…BlockRelayOnly and AddrFetch
Contributor
Author
|
Friendly ping @Davidson-Souza @jaoleal |
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.
Description and Notes
Renames
ConnectionKind::RegulartoOutboundFullRelayand addsBlockRelayOnlyandAddrFetchvariants to align with Bitcoin Coresconnection_typestrings ingetpeerinfo.Changes
Rename
Regular(ServiceFlags)toOutboundFullRelay(ServiceFlags)Add
BlockRelayOnly(ServiceFlags)for block-relay-only anchor peersAdd
AddrFetchfor short-lived address discovery connectionsExtranow serializes as"block-relay-only"Add peer limits to
NodeContext:MAX_FULL_RELAY_PEERSMAX_BLOCKS_ONLY_PEERSMAX_MANUAL_PEERSUpdate connection selection logic:
maybe_open_connectionselectsOutboundFullRelayorBlockRelayOnlybased on available full relay slotsmaybe_open_connection_with_added_peersappliesMAX_MANUAL_PEERSbased on connected peersupgrade:
Extrapeer delivers new headers, it is promoted toOutboundFullRelayorBlockRelayOnlydepending on available slotsReplace
.unwrap()with?incheck_for_stale_tipAdd
WireError::OutboundPeersExceededResult
The
connection_typefield ingetpeerinforpc responses right now matches Bitcoin Core values:Closes #623