Peer Behaviour Flags
satd keeps a small record of what each peer does on the wire, judges from it
which implementation the peer runs and whether it behaves like a crawler, a
transaction spy or a peer that lies about its chain, and reports the result.
By default it only reports: no flag changes how a peer is treated. With
-peerflagpolicy=evict some flags
decide which inbound peer goes first when an inbound slot is needed, and
nothing else.
An opt-in network survey applies the same judgement to short connections of its own, across the address book.
What is judged
Every 5 seconds the node judges each connected peer, and once more when a peer leaves, so that a peer gone in a few seconds is judged on its whole session. Two things come out of it.
A fingerprint. The commands a peer sends from its version through the
end of its connection setup, with its version fields (protocol version,
services, relay), are compared against a table of rows, one or more per
implementation: Bitcoin Core (Knots and other Core forks are in the Core
family, since they share its networking code), btcd, bcoin, libbitcoin,
Floresta, rbitcoin, satd, and the bitcoin-seeder and bitnodes crawlers. A
row names the traits that set its family apart (which feature messages it
sends between version and verack, which announcements follow verack
before its first other message, what that message is, and for some
families the protocol version, relay and whether any service bit is
set), not the whole transcript of one release, and covers the directions
it was captured in (which side dialled). Each row was checked against
captures of that implementation against a local node, inbound and
outbound, of several releases where more than one could be run, committed
with the sources (contrib/peer-fingerprint/); a test replays every
capture and checks that it classifies as its own family and no other. The
result is one of:
| Result | Means |
|---|---|
known | The transcript matches one family's row, and the user agent names that family or none. confidence is high when the traits alone tell, low when another family's row has the same traits and the version fields told them apart. |
claimed | No row matches, or one matches but nothing rules out the family the user agent names (see mismatch): claimed is that family. Nothing the peer did confirmed it, so it is never counted as an observed family and is never a mismatch. A release that behaves unlike every captured one, or a connection that closed before showing its traits (Core's feeler, rbitcoin's catch-up connection), ends here. |
unknown | No row matches and the user agent names no family, or the transcript is not settled yet (less than 10 seconds connected and still open). |
mismatch | The user agent names one family, the transcript matches another's row, and every row of the named family rules out what the peer did (its version fields aside, which it states as it states its user agent). A named family with no row, or one whose row admits the transcript too, is claimed instead: a mismatch accuses the peer, so it needs behaviour the named client does not show. |
The network crawl (-crawl) judges its own sessions against rows of their
own, captured against the crawl's version (services 0, relay off),
since peers answer it differently: none sends getheaders. A crawl row
also pins what every capture showed of the BIP 324 greeting (no decoy
packet, an empty version packet), of the probes (notfound for the
unknown transaction from satd and rbitcoin, silence for the unknown
message, no disconnect; Core answers the unknown transaction only when its
operator grants the crawler relay, so its row leaves that open) and of the
getaddr answer (addrv2), so a crawl session can be known with high
confidence where the survey could only say low. Crawl rows exist for
Bitcoin Core, satd, rbitcoin, btcd, bcoin and libbitcoin (see
Network Crawl); a crawl session no row matches is claimed or
unknown as above, a crawl session can be
closed early or fake as a survey connection can,
and one no row matched keeps its transcript,
relay flag, BIP 324 greeting and getaddr answer in crawlbook.dat, so
a new implementation shows up as many records of one shape. A crawl
discovery session also runs a chain check on the getheaders probe's
answer: the peer is on our chain (it has our tip), behind (it has nothing
past our tip's parent, or only our older blocks), on a fork (another block
after our tip's parent, or blocks off our chain), or on another chain under
this network's magic (its answer starts from a block we do not know).
Flags, each carried with the numbers that raised it:
| Code | Name | Raised when |
|---|---|---|
C | crawler | An inbound peer connected for under 300 s has sent getaddr and no getheaders or block request, and either its handshake is a known crawler's (bitnodes, bitcoin-seeder) or its network group has opened at least 3 inbound connections in the last hour. Onion and unroutable peers have no network group to count, so they get C only by the crawler handshake. |
S | spy | A peer that asked for transaction relay has been sent at least 500 transaction announcements, asked for at least 90% of them, with a 10th-percentile delay of 5 ms or less, announced none itself, asked for no block, and been connected at least 2 hours. |
F | fingerprint-mismatch | The fingerprint is a mismatch. |
A | addr-abuse | More than one getaddr in the connection (Core answers one), or more than 1,000 of its addresses dropped by the address rate limit. |
H | height-lie | Its start_height was at least 6 blocks above the chain it then served in answer to our getheaders. |
N | notfound-pattern | At least 10 notfound for transactions it announced and was asked for, and at least 10% of what it announced. |
T | stalling | At least 3 block-download stalls charged to it. |
The thresholds are provisional. They are placeholders until they are calibrated against the distribution measured on a synced mainnet node, and may change in any release. Flags are recomputed on every pass, so a flag clears when its shape goes, except where the counters behind it only grow.
getpeerbehavior
getpeerbehavior [peer_id] is a satd RPC. With no argument it returns every
peer, ordered by id; with a peer_id it returns an array holding that peer,
or error -8 if no peer has the id. getpeerinfo is unchanged. A client
talking to a node without the method gets "Method not found".
sat-cli getpeerbehavior 7
[
{
"id": 7,
"connection_type": "inbound",
"session_secs": 4,
"subver": "/bitcoin-seeder:0.01/",
"evaluated": true,
"fingerprint": {
"result": "known", "family": "bitcoin-seeder", "confidence": "low",
"settled": true, "handshake": ["version", "verack", "getaddr"]
},
"flag_codes": "C",
"flags": [
{"code": "C", "name": "crawler",
"evidence": {"session_secs": 4, "getaddr_in": 1, "headers_req": 0, "blocks_req": 0, "netgroup_seen": 5}}
],
"counters": { "inv_tx_in": 0, "getdata_tx_in": 0, "getaddr_in": 1, "...": "..." }
}
]
| Field | What |
|---|---|
id | The peer id getpeerinfo uses. No address is reported. |
connection_type | As getpeerinfo.connection_type. |
session_secs | Seconds since the connection opened. |
subver | The user agent, sanitized as getpeerinfo.subver is. It is the peer's own text. |
evaluated | Whether the peer has been judged yet; a peer connected in the last 5 seconds may not have been. |
fingerprint | result and its fields (above), settled, and handshake, the commands the fingerprint was judged on. |
flag_codes, flags | The flags from the last pass, each with its evidence. |
alt_slot | Only for a peer in an alt-slot: the rule it matched, the trust its user agent got, and fallback. |
counters | The raw record: inv_tx_in, getdata_tx_in, getdata_latency (count, p10_ms, median_ms, and the histogram), inv_tx_announced_to, headers_req, blocks_req, getaddr_in, addr_in, addr_out, addr_rate_limited, notfound_after_inv, height_claim_gap, stalls, and the version fields. |
It is a read: allowed on the read-only listener, and for a bearer token it
needs rpc:read. Over MCP it is get_peer_behavior, which needs mcp:*:
the read-only mcp:read profile leaves it out.
In sat-tui
sat-tui shows the flags in a column of its peers tables, marks a
mismatched agent with ≠, opens a detail overlay with the evidence and
counters on Enter, filters to flagged peers on f, and counts Peer
clients by observed family. See sat-tui.
Metrics, status page and log
satd_peer_flagged{flag}: connected peers carrying each flag, one series per code, zeros included.satd_peer_fingerprint{family}: connected peers per observed family (a mismatch counts under the family its transcript matched), plusfamily="unknown", which counts the claimed ones too.satd_peer_fingerprint_claimed{family}: the connected peers no row matched whose user agent names that family. They are never counted under the family insatd_peer_fingerprint.- The status page lists the number of connected peers carrying each flag, and only the flags some peer carries.
- With
-debug=net, one line when a peer first gains a flag in a connection, with its evidence, fingerprint and quoted user agent.
None of these carries an address, and a user agent appears only escaped.
Soft enforcement (-peerflagpolicy)
-peerflagpolicy=observe|evict, default observe.
observe: the flags are information only. The inbound eviction is Bitcoin Core's, unchanged.evict: an inbound peer flaggedC,SorFloses the protection Core's eviction gives it (network group, ping time, recent transactions and blocks, privacy network, uptime) and is the first evicted when an inbound slot is needed. Among several flagged peers, Core's last rule picks: the youngest of the network group with the most of them.
evict only reorders an eviction that would happen anyway:
- Nothing is disconnected while an inbound slot is free, nor because a peer gained a flag. An eviction happens, as in Core, when a new inbound connection arrives with every inbound slot taken, or when a transaction-relaying inbound peer arrives past the transaction-relay share of them.
- Nothing is banned or discouraged; an evicted peer may connect again.
- Peers with the
noban,relayorforcerelaypermission (-whitelist,-whitebind) are exempt and keep Core's protection.nobanpeers are never evicted at all, as in Core. - Outbound peers, manual connections and alt-slot peers are never touched: the surplus outbound eviction after IBD ignores the flags.
- The
A,H,NandTflags play no part.
An eviction the policy decided is logged (peer=<id> evicted first under -peerflagpolicy=evict, flagged <codes>), and the peer's disconnect reason
is evicted-flagged. A node that does not accept inbound connections
(-listen=0) never evicts, so the policy has nothing to act on there.
The flag thresholds are provisional (see above), so under evict a
threshold change in a later release changes which peers go first. The
policy is read at startup; a reload that changes it reports it as needing
a restart. getconfig reports it as p2p.peer_flag_policy.
Network survey
Off by default. With -peersurvey=1 the node surveys the network: which
implementations are reachable, and how many of each. It samples, from the
node's own address book; the network crawl (-crawl) counts,
and supersedes the survey while it is on.
The survey's file holds peer addresses.
peersurvey.datin the data directory keeps one record per address the survey reached, andgetpeersurvey truereturns them. The file is written with the data directory's permissions, execute bits dropped, and nothing serves it but the authenticated RPC. Probing makes survey connections recognisable: no ordinary connection sends an unknown message or asks for a transaction that does not exist, so a peer that logs them can tell a satd surveyor from an ordinary node, and follow it across address changes. The node's own peers are never probed.-peersurveyprobes=0turns the probes off.
What a survey connection does
Every -peersurveyinterval seconds (60 by default), if no survey connection
is open, the node draws an address uniformly from its whole address book,
new and tried entries alike, and opens a survey connection to it. Nothing
about the address weighs the draw. It passes over what an automatic dial
passes over: an address the operator named, a banned one, one on a network
the node does not reach, one connected or being dialled, one backing off
after failed dials, and a bad port. It is dialled as any automatic
connection is, so -onlynet, -proxy and -onion apply: a node that only
reaches Tor surveys only over Tor. It tries BIP 324 first under
-v2transport, as an ordinary outbound does.
The connection is outside every connection budget: it takes no outbound
slot, at most one is open at a time, and getpeerinfo and
getconnectioncount leave it out. It does not run under -connect or with
networking off.
It sends the same version (with relay set), wtxidrelay, sendaddrv2,
verack, sendheaders, sendcmpct and feefilter an ordinary full-relay
outbound sends, and answers a ping. It sends no getaddr, no
getheaders and none of the node's addresses. It listens for up to 10
seconds while the peer announces what it supports, until the handshake
transcript the fingerprint is judged on is complete, then sends the probes
and closes. It carries no blocks, transactions or addresses either way.
The address book learns what a feeler would teach it: a completed handshake
moves the address to the tried table, the peer's version updates its
services, and a failed dial counts as an attempt. Nothing else.
Closed early and fake
Two kinds of survey connection say nothing about which implementation answered, and are counted apart from every family:
- Closed early. The peer closed the connection during the listening,
before its handshake transcript was complete. The record keeps what the
versionsaid (user agent, protocol version, services) and gets no fingerprint. The usual cause is an ordinary node whose inbound slots are full: when a new inbound connection arrives, Bitcoin Core evicts one it already has, protecting peers by network group, ping time, recent transaction and block relay, and connection age, then dropping the youngest connection of the largest network group. A survey connection a few seconds old is that connection. This is Core's default behaviour; no setting on either side is involved. Dialled again, the same address can close at once one time and relay normally another. On a synced mainnet node 105 of 183 records no row matched were closed early, almost all under Core 26 to 32 user agents. - Fake. The user agent names Core, the common protocol version (the
lower of the peer's and the node's) is 70016 or more, the transcript is
exactly
versionthenverack, and the connection was still open when the 10 seconds of listening ran out. Every Core release since 0.21 sendswtxidrelayandsendaddrv2before itsverackat that version, and a message after it within the wait, so such a peer is not the Core it claims to be. On a synced mainnet node 74 such records claimed/Satoshi:25.0.0/or/Satoshi:25.1.0/, and most did not answer apingprobe. Only Core has this rule, since only Core's claim has been seen used this way.
A connection the node closes itself (disconnectnode, a ban,
setnetworkactive false, shutdown) is neither, and records nothing.
A closed-early address is dialled again later, since a node that had no
room for one connection often has room for the next. After a
closed-early session the address gets a retry, due 15 minutes later; after
each further closed-early session (or a retry whose dial or handshake
failed) the next is due after 30 minutes, 1 hour, 2 hours, then 4 hours
for every later one. Each wait is moved at random by up to a fifth either
way, so the retries are not predictable. A due retry takes the next survey
connection ahead of the uniform draw, and is passed over as a drawn
address would be (a peer the operator named, a banned address, one
connected or being dialled, a network the node does not reach, a bad
port); the survey still opens one connection at a time, and each retry
counts in connections like any other. After ten retries none is
scheduled: the address stays closed early until the draw reaches it again,
and a closed-early session then does not start the retries over. The
first session that settles (a fingerprint, or fake) clears the schedule.
A closed-early session never replaces a settled record. An address
already recorded with a fingerprint (at any confidence, claimed included)
or as fake keeps that record, transcript and probes included, and only its
last_seen moves on; it gets no retry. A fake session still replaces a
classified record, and a settled session replaces any record.
Probes
With -peersurveyprobes=1 (the default with the survey), each survey
connection sends a random subset of these, in random order, after the
listening and before it closes:
| Probe | Sends | Records |
|---|---|---|
ping | ping with a random nonce | the pong's round trip, in milliseconds |
getheaders | getheaders with the parent of the node's tip as the locator and the tip as the stop; not sent while the node is at genesis, where a peer would answer with 2,000 headers | how many headers come back |
getdata | getdata for a random transaction id (by wtxid to a peer that relays by wtxid) | whether notfound names it |
unknown | a message of a random type no implementation defines, empty | whether the peer closes the connection over it |
Each was checked against Bitcoin Core v32.1: none raises a misbehaviour
score or costs the connection. Nothing Core punishes is sent (mempool
without NODE_BLOOM, filter requests to a peer that does not serve them, a
second getaddr). Probes are sent on survey connections only, never to the
node's own peers.
getpeersurvey
getpeersurvey [verbose] returns the aggregate of what the store holds:
{
"addresses": 812,
"families": {
"core": {"count": 690, "share": 0.8497},
"btcd": {"count": 9, "share": 0.0111},
"...": "...",
"unknown": {"count": 4, "share": 0.0049}
},
"claimed": {
"core": {"count": 37, "share": 0.0456},
"btcd": {"count": 2, "share": 0.0025},
"...": "..."
},
"fake": {
"core": {"count": 6, "share": 0.0074},
"btcd": {"count": 0, "share": 0.0},
"...": "..."
},
"closed_early": {"count": 9, "share": 0.0111},
"mismatches": 3,
"v2": {"count": 402, "share": 0.495},
"top_as": [{"asn": 64496, "count": 57}],
"countries": null,
"probed": 405,
"retries": {"pending": 5, "exhausted": 2},
"enabled": true,
"probes": true,
"interval": 60,
"connections": {"completed": 815, "failed": 1311,
"last": {"time": 1795000000, "result": "completed"}}
}
| Field | What |
|---|---|
addresses | Records in the store: addresses the survey reached in the last 30 days. |
families | Records per observed family (a mismatch counts under the family its handshake matched), with each one's share of addresses. unknown counts the records no row matched whose user agent names no family, and nothing claimed, fake or closed early. |
claimed | The records no row matched whose user agent names a family, per family: what the peers say they run, kept apart from what the survey saw. |
fake | The fake records, per family the user agent claims. Only core is ever counted. |
closed_early | The closed-early records. |
mismatches | Records whose user agent names one family and handshake matches another. |
v2 | Records reached over BIP 324. |
top_as | The ten autonomous systems with the most records. Empty without -asmap. |
countries | With -countryfile, the records per country, each with its share of addresses: ISO codes, other (countries with fewer records than -crawlexportmink, the crawl's fold), unknown and onion. null without one. No row carries a country. |
Each record is counted once among families, claimed, fake and
closed_early, so their counts add up to addresses. Every share is of
addresses, all records whatever their kind.
| probed | Records with at least one probe outcome. |
| retries | Closed-early records with a retry scheduled (pending), and with none left after ten (exhausted). |
| enabled, probes, interval | The survey's settings. With the survey off, enabled is false and every count is zero. |
| connections | Survey connections since start: completed, and failed at the dial or the handshake; last, the most recent to end, with its time (Unix seconds) and result (completed or failed), null until one ends. |
| alt_slots | The alt-slots: configured, matched, fallback and empty. Reported with the survey off too. |
Over MCP, get_peer_survey returns this aggregate, in the read-only
mcp:read profile. MCP has no per-address form.
getpeersurvey true adds peers, one row per address, most recently seen
first: addr, network, fingerprint (as in getpeerbehavior, for
example core/high), family, claimed (the family the user agent names),
mismatch, subver (sanitized peer text), version, services, v2,
asn, first_seen, last_seen (Unix seconds) and probes, each probe
sent with its result (answered, silent or disconnected) and, when
answered, its value. A claimed record has fingerprint core/claimed
(for example) and a null family; a fake one fake/core, and a
closed-early one closed-early, each with a null family and the user
agent's family in claimed. A closed-early row also carries retry: its
count of retries scheduled so far and next_due, when the next is due
(Unix seconds; null once all ten are spent). A record no row matched, claimed, fake,
closed early or unknown, also carries handshake, the commands it was judged on, and
relay, its version's relay flag, so that the shapes no row knows can
be told apart and given rows; with -debug=net the same is logged when its
survey connection ends.
The RPC is operator control: it is refused on the read-only listener, and
for a bearer token it needs rpc:write.
getpeersurveyuseragents
getpeersurveyuseragents [count] lists the user agents of the records
getpeersurvey counts as unknown (no handshake row matched and the user
agent names no family), in the same form as the crawl's
getcrawluseragents: the count most
common (default 10, at most 100, a larger one refused), largest first,
ties in user agent order, and other, the rest, so the listed counts and
other add up to unknown. Claimed, fake and closed-early records are not
listed.
A user agent is text the peer chose, and an uncommon one can single out a
node, so it is never part of getpeersurvey's aggregate, which a
read-only MCP token can read. The RPC is operator control in the same way
as getpeersurvey. sat-tui draws the five most common in its
Network survey panel.
The store
peersurvey.dat (format satdsrv4) keeps one record per address: the
fingerprint, user agent, protocol version, services, whether it spoke v2,
its autonomous system, when it was first and last seen, the last probe
outcomes, whether it was fake or closed early, for a closed-early record
its retry count and next due time, and, for a record no row matched, its
handshake transcript (at most 16 commands) and relay flag. A satdsrv3
file is read whole, each record kept with no retry scheduled: its
closed-early addresses get one after their next closed-early session. A
file in an older format still is dropped at startup, with its record count
logged, and the survey starts empty: satdsrv1 records were judged before
the current rows, satdsrv2 records never stored whether the peer closed
the connection early, and a uniform draw from the address book revisits an
address too rarely to replace them. A damaged old file is set aside like
any other. A record not seen
for 30 days is dropped, and past 250,000 records (about 25 MB) the least
recently seen go first. It is written every 10 minutes and at shutdown, and
read at startup; a file that does not read is renamed with a .bad-<unix time> suffix, with a warning, and
the survey starts empty.
Metrics
satd_peer_survey_enabled: 1 while the survey runs.satd_peer_survey_records,satd_peer_survey_family{family},satd_peer_survey_mismatchesandsatd_peer_survey_v2: the store's counts.family="unknown"counts only the records no row matched whose user agent names no family.satd_peer_survey_claimed{family}: the records no row matched whose user agent names that family; never counted insatd_peer_survey_family.satd_peer_survey_fake{family}: the fake records, by the family the user agent claims.satd_peer_survey_closed_early: the closed-early records.satd_peer_survey_closed_early_retries: the closed-early records with a retry scheduled.satd_peer_survey_connections_total{result}:completedandfailedsurvey connections.satd_peer_survey_probes_total{probe,outcome}: probe outcomes.satd_peer_survey_country{country}: with-countryfileonly, the records per country, under the same keys ascountries.
None carries an address.
Alt-slots
Off by default. -altslots=N sets aside N of the full-relay outbound
slots for peers that match the operator's preference rules, for example to
keep connections to implementations other than Core. The rest of the slots
are filled from the address book exactly as without it. Alt-slot peers are
ordinary full-relay connections in every other respect: they relay blocks,
transactions and addresses, and getpeerinfo reports them as
outbound-full-relay. The two block-relay-only connections are never
alt-slots.
The eclipse trade-off. The peers that match your rules are a far smaller pool than the address book. An attacker who runs nodes matching them competes for those slots against a few honest nodes instead of thousands. With
-altslotsequal to-maxoutboundfullrelay, every full-relay outbound comes from that small pool, and transaction and address relay could be served entirely by the attacker's nodes. The two block-relay-only connections stay ordinary and remain the backstop for block delivery. What limits it: the network-group rule every outbound obeys, flagged and contradicted candidates kept out by default, and fingerprints that are harder to fake than user agents. The node logs a warning when-altslotsis above 4. The choice is yours; satd does not refuse it.
Rules
-altprefer=<rule>, repeatable; earlier rules have priority. A rule is one
or more terms joined by +, all of which must hold, with an optional @k
cap on how many slots it may fill:
| Term | Matches |
|---|---|
family:<name> | The family the peer's handshake matched: core, btcd, bcoin, libbitcoin, floresta, rbitcoin, satd, bitcoin-seeder, bitnodes, or non-core for any family but Core's. Knots and other Core forks are in Core's family. A peer whose handshake matched nothing matches no family: term. |
ua:<glob> | The claimed user agent, * and ? wildcards, case-sensitive, subject to -altuatrust. |
svc:<name> | An advertised service: network, bloom, witness, compact_filters, network_limited, p2p_v2, intact_blocks, nap (getpeerinfo's servicesnames, in lower case). |
altslots=6
altprefer=family:btcd@2
altprefer=family:floresta+svc:compact_filters@2
altprefer=ua:/Satoshi:*Knots:*@1
altprefer=family:non-core
With -altslots above 0 and no -altprefer, the one rule is
family:non-core. An unknown term, family or service is a startup error.
How far a user agent is trusted
A ua: term never rests on the user agent alone. Each candidate is
verified (its handshake matched the family its agent names; a Knots
agent with a Core-family handshake is verified), unverified (its
handshake matched no row, so its fingerprint is unknown or only
claimed, or its agent names no known family) or contradicted (its handshake matched another family; the peer
carries the F flag). -altuatrust:
strict:ua:terms match verified candidates only.consistent(default): verified and unverified match; verified ones are tried first.any: the agent alone decides, contradicted candidates included. Meant for a client the fingerprint table does not know yet. It is the easiest rule to game.
Under strict and consistent, a peer carrying C, S or F never
fills an alt-slot, whatever the rule.
Filling the slots
Ordinary dials leave the alt-slots empty. Each reconnect pass (every 10
seconds) may dial one trial: an address whose survey record matches a
rule with a slot left (with -peersurvey; without it, the results of
earlier trials, kept in memory), or else an address-book entry, drawn as
any automatic dial is, whose recorded services can meet such a rule. Once
the trial's handshake has settled (at most about 15 seconds), it takes the
slot under the first rule it matches, with one net log line naming the
rule; otherwise it is disconnected (alt-slot-no-match), its address is
passed over by trials for 24 hours, and the next trial waits 30 seconds, as
it does when no candidate is found. One trial at a time. Every alt-slot dial obeys the same
network-group rule as every other outbound.
A slot still empty after -altfillwait seconds (600) gets an ordinary
fallback peer, so the node keeps all its outbounds even when no
matching peer is reachable. Trials go on; when one matches, it takes the
slot and the fallback is disconnected (alt-slot-fallback-replaced). A
fallback that turns out to match takes the slot itself.
The full-relay outbound count
-maxoutboundfullrelay=<n> (default 8, Core's
MAX_OUTBOUND_FULL_RELAY_CONNECTIONS) sets how many full-relay outbound
peers the node keeps once synced; alt-slots are carved out of it. Core has
no such option. Every extra outbound takes an inbound slot on another
node, and Core holds everyone at 8 partly so the network does not run out
of them:
- above 8: a warning at startup and on reload;
- above 16: a startup error, and a refused reload, unless
-enable-dangerously-large-outbound-peer-limitis also set; - above 64: always an error, even with the override.
It also sizes the automatic outbound connections (full-relay, 2
block-relay-only, 1 feeler), so the inbound slots are -maxconnections
less that. During initial block download the full-relay target stays at
64. -altslots above -maxoutboundfullrelay, or above -maxconnections,
is a startup error.
Reload
All six options reload on SIGHUP. A value past its limits refuses the
whole reload, with the running values kept. Raising -altslots fills the
new slots from the next pass; when every full-relay slot is taken, a match
pushes the count one over and the usual surplus rule then drops an ordinary
peer. Lowering -altslots, or a rule change that a peer no longer matches,
turns the peer into an ordinary outbound without disconnecting it
(fallbacks first). Lowering -maxoutboundfullrelay sheds the surplus one
peer at a time, as after initial block download, never a peer that holds an
alt-slot by its rules.
Visibility
getpeerbehaviorgives each alt-slot peer"alt_slot": {"rule": "family:btcd@2", "trust": "verified", "fallback": false}; a fallback has"rule": null, "trust": null, "fallback": true. A trial still being judged has none.getpeersurveyreports"alt_slots": {"configured", "matched", "fallback", "empty"}, with the survey on or off.satd_peer_alt_slots{state="matched|fallback|empty"}, with-altslotsabove 0. No addresses.sat-tuitags alt-slot peersalt(alt*for a fallback) in the Flags column, names the rule and trust in the detail overlay, and Peer clients counts them.