Skip to content

p2p: name $DOG Mode in the user agent - #11

Open
dogofbitcoin wants to merge 1 commit into
bitcoindogmode:31.1-dogmodefrom
dogofbitcoin:dogmode-user-agent
Open

dogofbitcoin wants to merge 1 commit into
bitcoindogmode:31.1-dogmodefrom
dogofbitcoin:dogmode-user-agent

Conversation

@dogofbitcoin

Copy link
Copy Markdown

Every $DOG Mode node sends the user agent of plain Bitcoin Core, /Satoshi:31.1.0/. A peer, a DNS seed's crawler or anyone reading getpeerinfo can tell a $DOG Mode node only by its NODE_DOG_MODE bit, and nobody can tell which $DOG Mode it runs.

This appends a second BIP 14 component after the Bitcoin Core one, the way Bitcoin Knots names itself (/Satoshi:<Core version>/Knots:<release date>/):

/Satoshi:31.1.0/DOGMode:20260902/

The Bitcoin Core component is unchanged, so whatever reads it still does, and -uacomment comments still attach to it (/Satoshi:31.1.0(foo)/DOGMode:20260902/). The version is a date because BIP 14 recommends one for repository builds. 20260902 is the day #3 merged; it is one constant, UA_DOGMODE in src/clientversion.cpp, to set to the release date when you tag. The name and the version format are yours to choose, and each is one line.

NODE_DOG_MODE already tells every peer that a node runs $DOG Mode, so the label adds only which release.

Tests. feature_uacomment.py now requires the whole string (the comments on the Bitcoin Core component, then the $DOG Mode component) and that a peer receives the same string in the version message. On 7503240091 it fails at the first check, reading /Satoshi:31.1.0(testnode0)/; with this change it passes. feature_includeconf.py assumed the comments end the string; it now checks that they are present, as Knots' copy of the test does. The full functional suite passes (193 passed, 0 failed, 93 skipped on a macOS build without the wallet). The util_tests unit suite passes. Two regtest nodes on one machine, one started with -uacomment=example, report /Satoshi:31.1.0/DOGMode:20260902/ and /Satoshi:31.1.0(example)/DOGMode:20260902/ in getnetworkinfo, each sees the other's in getpeerinfo, and the bitcoin-cli -netinfo header shows it.

The release note is doc/release-notes-dogmode-user-agent.md. This is independent of #7 and #10.

Every $DOG Mode node sends the user agent of plain Bitcoin Core,
"/Satoshi:31.1.0/", so a peer, a DNS seed's crawler or anyone reading
getpeerinfo can tell a $DOG Mode node only by its NODE_DOG_MODE bit,
and nobody can tell which $DOG Mode a node runs.

Append a second BIP 14 component after the Bitcoin Core one, the way
Bitcoin Knots names itself: "/Satoshi:31.1.0/DOGMode:20260902/". The
Bitcoin Core component, and the -uacomment comments on it, are
unchanged. The version is a date, as BIP 14 recommends: the day the
$DOG Mode policy merged, to be set to the release date when a release
is tagged.

feature_uacomment.py now requires the whole string, and that a peer
receives the same string in the version message. It and
feature_includeconf.py no longer assume the comments end the string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant