Bitcoin Forum
May 12, 2024, 07:53:02 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Altcoin Blockchain Timestamp Oddity  (Read 114 times)
antonio_xiii (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 1


View Profile
February 14, 2019, 03:07:29 AM
Merited by Herbert2020 (1)
 #1

Background:

I recently began working on a dead altcoin (been abandoned by the developers for over 4 years) to gain some experience in cryptocurrency development. When I downloaded the last wallet provided by the devs (version 1.6.0) I began to sync with the last node left hosting the blockchain. My wallet stopped syncing after block 72160, with the following error in the log:

ERROR: AcceptBlock() : block's timestamp is too early compare to last block
ERROR: ProcessBlock() : AcceptBlock FAILED

After some further debugging, I found out that block 72161 had a timestamp of an hour before block 72160, hence the error.

When I looked at the source code for the previous version of the wallet (1.5.3), I noted that the code responsible for making sure that blocks with older timestamps did not come after newer ones was missing. Apparently, the devs did not add such functionality until the last released version of the coin.

Question:

What would be the best way to handle this situation? Obviously my end goal here is to patch the 1.6.0 wallet to be able to sync the blockchain. My initial thought is to add in logic to only apply the timestamp check after the problematic blocks. There are several more occurrences of older timestamped blocks being higher in the blockchain than newer ones, but nothing like that occurs after height 80000. However, this solution feels to me as though I am just masking a problem instead of doing a real fix. The only 'real' fixes that I can think of would involve messing with the blockchain, which I feel like would be wrong to do, and probably just break things even further. Anyone kind enough to lend some thoughts to this situation?
1715543582
Hero Member
*
Offline Offline

Posts: 1715543582

View Profile Personal Message (Offline)

Ignore
1715543582
Reply with quote  #2

1715543582
Report to moderator
1715543582
Hero Member
*
Offline Offline

Posts: 1715543582

View Profile Personal Message (Offline)

Ignore
1715543582
Reply with quote  #2

1715543582
Report to moderator
BitcoinCleanup.com: Learn why Bitcoin isn't bad for the environment
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715543582
Hero Member
*
Offline Offline

Posts: 1715543582

View Profile Personal Message (Offline)

Ignore
1715543582
Reply with quote  #2

1715543582
Report to moderator
1715543582
Hero Member
*
Offline Offline

Posts: 1715543582

View Profile Personal Message (Offline)

Ignore
1715543582
Reply with quote  #2

1715543582
Report to moderator
1715543582
Hero Member
*
Offline Offline

Posts: 1715543582

View Profile Personal Message (Offline)

Ignore
1715543582
Reply with quote  #2

1715543582
Report to moderator
Herbert2020
Legendary
*
Offline Offline

Activity: 1946
Merit: 1137


View Profile
February 14, 2019, 07:43:31 AM
 #2

well the blockchain is immutable so you can't change it, specially if a bug existed a while ago that caused something like this which doesn't exactly break anything serious. the only solution is to write a workaround at this point to ignore that bug.

and it is not a problem because at that point in time (block 72161) the consensus rules weren't enforcing timestamp differences to be within a certain range so those blocks are not breaking any consensus rules and are valid. if you introduce a rule at block 80000 then that rule should be valid from 80000 onward instead of being for all of them.

Weak hands have been complaining about missing out ever since bitcoin was $1 and never buy the dip.
Whales are those who keep buying the dip.
antonio_xiii (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 1


View Profile
February 14, 2019, 02:25:58 PM
 #3

Thank you for your response! I will go ahead and modify the 'if' statement checking timestamps to only apply the rule on blocks that are greater than 80000 in height. It just felt like masking a problem instead of fixing it, but your justification for implementing that fix makes sense.

Thanks again!
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!