Bitcoin Forum
May 21, 2024, 09:38:30 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why not use fixed time instead of median for time in the past for new blocks?  (Read 90 times)
bushstar (OP)
Hero Member
*****
Offline Offline

Activity: 617
Merit: 531


View Profile
October 18, 2021, 07:06:40 AM
Merited by o_e_l_e_o (4), ABCbits (2)
 #1

New blocks that are more than 2 hours ahead of the local time are rejected. For backwards time blocks cannot be less than than the median time of the last eleven blocks. Why not use a fixed time going backwards like the forwards time? The longer we go without a block the larger the backwards time range becomes, a fixed time provides a fixed range from past to future blocks.

o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18565


View Profile
October 18, 2021, 09:26:45 AM
Merited by pooya87 (2), ABCbits (1)
 #2

Why not use a fixed time going backwards like the forwards time?
Because then that time would change. If the rules said a block could not be mined more than 2 hours behind network time, and I mine a block with a timestamp 1:59:59 behind current network time, then by the time I broadcast it to the network, some nodes will start to reject it since it will now be greater than 2 hours behind network time by the time they receive it. By using a median of the last 11 blocks, the lower limit for the timestamp is fixed before the block is mined.

The longer we go without a block the larger the backwards time range becomes, a fixed time provides a fixed range from past to future blocks.
Note that we use the median, not the mean. The median of the last 11 blocks is the timestamp of the 6th last block. It doesn't matter if one of the blocks took 1 second or 1 hour to mine - the median will not change.
bushstar (OP)
Hero Member
*****
Offline Offline

Activity: 617
Merit: 531


View Profile
October 18, 2021, 09:39:34 AM
 #3

Thanks, that makes sense, otherwise a block on the edge could start being rejected during propagation.

DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
October 18, 2021, 03:24:28 PM
Merited by PrimeNumber7 (1)
 #4

Wouldn't it also then be impossible to sync up a new node?  Since nearly ALL blocks received would be older than whatever time you choose.
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!