Bitcoin Forum
May 08, 2024, 12:58:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Network - Calling Blocks  (Read 113 times)
agahebr (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
April 12, 2018, 03:41:17 AM
 #1

Hello,

I've been thinking about this for a while and can't seem to understand part of the network. Lets assume that I'm a node that has been offline for 5 months and I want to retrieve the new blocks, when I broadcast the getblocks message different nodes see it, so does that mean that they all respond or do some of them respond and the others ignore it because of the other responses? and if they all respond back, would my node then choose which one/ones it wants to get the data from, or would it get the data from all of them? If it gets the data from all of them then wouldn't that slow the system down a lot and create a lot more traffic on the network?
Generally, what I don't understand is if a node wants older blocks or the whole blockchain for that matter, what are the communications, it's just a bad system if all of the nodes respond with the whole blockchain and if it's selecting a node then how would the selection work?

Thank you in advance
Activity + Trust + Earned Merit == The Most Recognized Users on Bitcointalk
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715129912
Hero Member
*
Offline Offline

Posts: 1715129912

View Profile Personal Message (Offline)

Ignore
1715129912
Reply with quote  #2

1715129912
Report to moderator
1715129912
Hero Member
*
Offline Offline

Posts: 1715129912

View Profile Personal Message (Offline)

Ignore
1715129912
Reply with quote  #2

1715129912
Report to moderator
hushan
Member
**
Offline Offline

Activity: 61
Merit: 15


View Profile
April 12, 2018, 07:12:17 AM
 #2

When a node sends GetBlocks, it includes hashes of its local blocks, so that the peers can find out from which point the sending node is behind, also it does not reply with block data, it replies with hashes of the blocks that the node is missing. When the node receives the hashes, it can request block data from peers with GetData messages.

BTC: 38ykUxZeSv5aqav1keCc4KUxXLPPGkfrm5 LTC: MPpWNvqDCVB1PHJt4A28j9oFfc6Y1KKDno ETH: 0x07C8c68d5253247038947EF9495b054160c8737c
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
April 12, 2018, 03:11:45 PM
 #3

The term "broadcast" is used loosely around here to describe the process of a node sharing information with other nodes.

Technically, a bitcoin node never "broadcasts" anything to the entire network (nor even to a set of multiple nodes).

A Bitcoin node establishes a direct connection to another node.
The bitcoin node might only establish one such connection, or it could establish similar direct connections to many different nodes.

When a "getblocks" message is sent, it is sent over a direct connection.  The node could choose to only send that on one of the connections, meaning that only 1 connected peers would receive that message, or it could choose to send the message across multiple connections (reaching 1 additional node for each additional connection that it sends the message across.

It is up to the node software to decide how many of the connected nodes (and which of the connected nodes) to send the getblocks messages to.  If it is getting blocks from a single connection faster than it can process them, then it may not request from additional nodes.  If a node is receiving some bad blocks on a connection, or is receiving blocks slower than it can process them then it may send additional getblocks messages across other connections to increase the speed and quantity of good blocks (and may even disconnect the slow connection or the connection to the peer with the bad blocks.
agahebr (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
April 12, 2018, 11:00:21 PM
Last edit: April 12, 2018, 11:32:41 PM by agahebr
 #4

So it's a unicast?
In that case, shouldn't there be a DNS type of thing which holds the address for the nodes so that each individual node can contact other nodes and not broadcast it?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
April 12, 2018, 11:27:30 PM
 #5

So it's a unicast?
In that case, shouldn't there be a DNS type of thing which hold the address for the nodes so that each individual node can contact other nodes and not broadcast it?

Correct.

Each node software creator is allowed to use whatever method they like to find and keep track of the IP addresses and port numbers of other nodes

Bitcoin Core keeps a list of all the other nodes that it has connected or is aware of from the past.

When a Bitcoin Core node first connects to another node, it immediately uses a "getaddr" message to ask that node for a list of all the IP addresses and ports that node knows about, and it adds them to ts own list.

During the very first time that a node powers up, there is a node discovery process that it uses to find out about some Bitcoin Nodes.  You can read about that process here:
https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery
agahebr (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
April 12, 2018, 11:33:26 PM
 #6

Thank you  Smiley
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!