Bitcoin Forum
November 09, 2024, 08:37:20 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about ServiceFlags: None and NetworkLimited  (Read 169 times)
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1042
Merit: 2805


Bitcoin and C♯ Enthusiast


View Profile WWW
December 15, 2020, 09:34:58 AM
Merited by ABCbits (1)
 #1

1. Why or when would a node set its ServiceFlags to NONE?
I'm probably testing "fake" nodes again but they seem to be providing me with headers without an issue.

2. Are NetworkLimited nodes capable of supplying all block headers even though they don't have most of the blocks?

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
NotATether
Legendary
*
Offline Offline

Activity: 1778
Merit: 7372


Top Crypto Casino


View Profile WWW
December 16, 2020, 12:24:17 AM
 #2

According to the source code, NetworkLimited nodes can only sere the latest 288 block headers. https://github.com/bitcoin/bitcoin/blob/42ed7f51fafa9f5de3b4262d28dbb7493c1eeb0f/src/protocol.h#L286-L289

NodeNone basically means it doesn't have NodeNetwork or any of the other ServiceFlags set. And since (paraphrasing from the code) "NODE_NETWORK means that the node is capable of serving the complete block chain" (source), and it's "currently set by all Bitcoin Core non pruned nodes, and is unset by SPV clients or other light clients" (same line), that implies SPV nodes are running with a ServiceFlags of NodeNone.

I don't think fake, Sybil-kind nodes would use this ServiceFlag because they have to run in NodeNetwork mode for peers to download blockchain data from them.

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4270
Merit: 8805



View Profile WWW
December 16, 2020, 01:17:15 AM
Merited by Coding Enthusiast (2), ABCbits (1)
 #3

According to the source code, NetworkLimited nodes can only sere the latest 288 block headers. https://github.com/bitcoin/bitcoin/blob/42ed7f51fafa9f5de3b4262d28dbb7493c1eeb0f/src/protocol.h#L286-L289
Blocks are not blockheaders.

Limited peers can serve all headers, but they only serve the latest 288 blocks from their tip.

https://github.com/bitcoin/bips/blob/master/bip-0159.mediawiki


If something is accepting connections but has a service flag of 0 it's probably some weird spything.  If it makes a connection to you with a service flag of zero it may be a SPV wallet, but its more likely a spynode pretending to be a spv wallet (as there are more spynodes than p2p spv wallets).
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1042
Merit: 2805


Bitcoin and C♯ Enthusiast


View Profile WWW
December 16, 2020, 02:46:40 PM
 #4

I don't think fake, Sybil-kind nodes would use this ServiceFlag because they have to run in NodeNetwork mode for peers to download blockchain data from them.
There are all kinds of crazy "nodes" out there that weird service flag doesn't surprise me.
Just before I started this topic I received fake block headers with height <20000 from one; sadly I thought there was a bug in my code so I didn't record its IP address or the block hashes, just remember the useragent was saying bitcoinABC.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
NotATether
Legendary
*
Offline Offline

Activity: 1778
Merit: 7372


Top Crypto Casino


View Profile WWW
December 16, 2020, 03:09:49 PM
Last edit: December 16, 2020, 03:44:50 PM by NotATether
 #5

I don't think fake, Sybil-kind nodes would use this ServiceFlag because they have to run in NodeNetwork mode for peers to download blockchain data from them.
There are all kinds of crazy "nodes" out there that weird service flag doesn't surprise me.
Just before I started this topic I received fake block headers with height <20000 from one; sadly I thought there was a bug in my code so I didn't record its IP address or the block hashes, just remember the useragent was saying bitcoinABC.

That user agent name sounds like an unsynchronized bitcoin cash node back from when they could still connect to bitcoin nodes (CMIIW but I believe there was a timeframe when BCH nodes could connect to BTC nodes before a BIP was rolled out that prevented this?), maybe they defined a bunch of flags that are unrecognized in bitcoin. But the height doesn't correspond, but even then we know that someone had to have forked Bitcoin core to add those extra flags.

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1042
Merit: 2805


Bitcoin and C♯ Enthusiast


View Profile WWW
December 16, 2020, 03:19:40 PM
 #6

They user agent name sounds like an unsynchronized bitcoin cash node back from when they could still connect to bitcoin nodes (CMIIW but I believe there was a timeframe when BCH nodes could connect to BTC nodes before a BIP was rolled out that prevented this?), maybe they defined a bunch of flags that are unrecognized in bitcoin. But the height doesn't correspond, but even then we know that someone had to have forked Bitcoin core to add those extra flags.
As far as I can tell there is no code in bitcoin core that blocks connection based on user-agent. There was a optional patch back in 2017 that people could use to block certain ones if they chose to IIRC.
That is irrelevant here since any of those fork-coins start from blocks in 2017 (height 500k maybe), this was a fake block in early days (height <20k).

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!