Bitcoin Forum
September 25, 2018, 04:08:55 AM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Compact Blocks: How are blocks validated in high bandwidth mode?  (Read 443 times)
1t0ph20
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
March 17, 2017, 02:50:23 PM
 #1

Hi! Quick clarifying question.

Compact blocks can be used in both high-bandwidth mode and low-bandwidth mode. In high-bandwidth mode, peer A (sending to B) validates just the block header then relays cmpctblock.

My question is what if the rest of the block is invalid? If the majority of the network was using compact blocks in high-bandwidth mode, wouldn't this mean many only partially validated blocks circulating the network?

Thanks!
Make a difference with your Ether.
Donate Ether for the greater good.
SPRING.WETRUST.IO
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1656


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
March 17, 2017, 03:26:23 PM
 #2

No. The partially validated block may propagate but nodes will still validate it fully and then reject the block if it is invalid. Relaying a block before validation does not mean that the block will never be validated by the node; the node will still validate it fully.

1t0ph20
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
March 17, 2017, 04:15:47 PM
 #3

Thank you for the reply.  A follow up then, how are the compact blocks uncompressed (if you get relayed a cmpctblock)?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1656


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
March 17, 2017, 04:19:47 PM
 #4

Thank you for the reply.  A follow up then, how are the compact blocks uncompressed (if you get relayed a cmpctblock)?
The compact block contains shortened versions of the transaction ids in a block. The node, when it receives the cmpctblock message, will calculate the shortened txids of all of the transactions that it has in its mempool. It retrieves the transactions that have matching shortened txids from the mempool in order to rebuild the full block. If it cannot find a transaction, it will request it from the peer that sent it the cmpctblock message. In this way the block is relayed without needing to actually send all of the data for the block when the block is relayed; most, if not all, of the transactions in the block will likely be found in the node's mempool and can be rebuilt from there.

1t0ph20
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
March 17, 2017, 06:12:30 PM
 #5

Great explanation! Thank you!
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!