Bitcoin Forum
May 08, 2024, 04:10:26 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Error "Potential stale tip detected, will try using extra outbound peer"  (Read 429 times)
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
March 01, 2018, 09:43:11 AM
 #1

Ok, so current status is,

if I run with ./bitcoind,  then get error of

----------
ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)
2018-03-01 08:55:21 *** Failed to read block
2018-03-01 08:55:21 Error: Error: A fatal internal error occurred, see debug.log for details
----------

and if I run with ./bitcoind -reindex,  then get error of

----------
2018-03-01 08:55:45 Reindexing block file blk00000.dat...
2018-03-01 08:55:45
case 2
2018-03-01 08:55:45 ERROR: AcceptBlock: high-hash, proof of work failed (code 16)
2018-03-01 08:55:45 Reindexing finished
2018-03-01 08:55:45 Failed to open mempool file from disk. Continuing anyway.
2018-03-01 08:59:30 Potential stale tip detected, will try using extra outbound peer (last tip update: 180 seconds ago)
2018-03-01 09:02:30 Potential stale tip detected, will try using extra outbound peer (last tip update: 360 seconds ago)
2018-03-01 09:05:30 Potential stale tip detected, will try using extra outbound peer (last tip update: 540 seconds ago)
2018-03-01 09:08:30 Potential stale tip detected, will try using extra outbound peer (last tip update: 720 seconds ago)
2018-03-01 09:11:30 Potential stale tip detected, will try using extra outbound peer (last tip update: 900 seconds ago)
2018-03-01 09:14:30 Potential stale tip detected, will try using extra outbound peer (last tip update: 1080 seconds ago)
2018-03-01 09:17:30 Potential stale tip detected, will try using extra outbound peer (last tip update: 1260 seconds ago)
..... continuing forever.....
-------------

above's case 2 means, I added manually like,

Code:
bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params& params)
{
    bool fNegative;
    bool fOverflow;
    arith_uint256 bnTarget;

    bnTarget.SetCompact(nBits, &fNegative, &fOverflow);

    // Check range
    if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
    {
LogPrintf("\ncase 1\n");
        return false;
    }

    // Check proof of work matches claimed amount
    if (UintToArith256(hash) > bnTarget)
    {
LogPrintf("\ncase 2\n");
        return false;
    }
    return true;
}

Any comments appreciated..
1715184626
Hero Member
*
Offline Offline

Posts: 1715184626

View Profile Personal Message (Offline)

Ignore
1715184626
Reply with quote  #2

1715184626
Report to moderator
1715184626
Hero Member
*
Offline Offline

Posts: 1715184626

View Profile Personal Message (Offline)

Ignore
1715184626
Reply with quote  #2

1715184626
Report to moderator
1715184626
Hero Member
*
Offline Offline

Posts: 1715184626

View Profile Personal Message (Offline)

Ignore
1715184626
Reply with quote  #2

1715184626
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715184626
Hero Member
*
Offline Offline

Posts: 1715184626

View Profile Personal Message (Offline)

Ignore
1715184626
Reply with quote  #2

1715184626
Report to moderator
1715184626
Hero Member
*
Offline Offline

Posts: 1715184626

View Profile Personal Message (Offline)

Ignore
1715184626
Reply with quote  #2

1715184626
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
March 01, 2018, 03:43:44 PM
 #2

You still have failed to generate a valid genesis block. Reindexing isn't going to do anything.

Since you seem to be having such a hard time creating the genesis block, why don't you use a script like https://github.com/lhartikk/GenesisH0 to do it for you?

wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
March 02, 2018, 03:51:50 AM
 #3

You still have failed to generate a valid genesis block. Reindexing isn't going to do anything.

Since you seem to be having such a hard time creating the genesis block, why don't you use a script like https://github.com/lhartikk/GenesisH0 to do it for you?
Very strange.
So my chainparams is like this,

Code:
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
    const char* pszTimestamp = "Now is 2018-02-20";
    const CScript genesisOutputScript = CScript() << ParseHex("0438b425136a6d49d84513c38e12204f9cbd22c6dfa7efce443d9582db7df1b6862d36de74db2c13e0d96b749ca7949ccbe2640e8ec4e10982a84a06cfb6071d66") << OP_CHECKSIG;
    return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}
genesis = CreateGenesisBlock(1519619579, 44453, 0x1f00ffff, 1, 500 * COIN);

consensus.hashGenesisBlock = genesis.GetHash();
printf("genesis.GetHash = %s\n", genesis.GetHash().ToString().c_str());
printf("genesis.merkleroot = %s\n", genesis.hashMerkleRoot.ToString().c_str());
assert(consensus.hashGenesisBlock == uint256S("0x00001e1f488925de2046bfb8bb24bd821f9b4ac3762b4da908a2e3ade576f5ac")); 
assert(genesis.hashMerkleRoot == uint256S("0x88e2acfcaec30f35652d10b861700def63129f9ac8176cdda889fed7baa730bb"));

So I did GenesisH0 command like,

python genesis.py -z "Now is 2018-02-20" -p "0438b425136a6d49d84513c38e12204f9cbd22c6dfa7efce443d9582db7df1b6862d36de74db2c1 3e0d96b749ca7949ccbe2640e8ec4e10982a84a06cfb6071d66" -t 1519619579 -n 44453 -b 0x1f00ffff -a scrypt

But result is

04ffff001d0104114e6f7720697320323031382d30322d3230
algorithm: scrypt
merkle hash: eeed278f4f20eceeafe7a2dc728c611b3aef1656a6b8404d8b68a48d03e53991
pszTimestamp: Now is 2018-02-20
pubkey: 0438b425136a6d49d84513c38e12204f9cbd22c6dfa7efce443d9582db7df1b6862d36de74db2c1 3e0d96b749ca7949ccbe2640e8ec4e10982a84a06cfb6071d66
time: 1519619579
bits: 0x1f00ffff
Searching for genesis hash..
genesis hash found!
nonce: 172682
genesis hash: d79fa40dc89f83ef4ff182f915bd5e778127e654909351debac676978effe31f


So nonce and genesis hash is different with [ assert(consensus.hashGenesisBlock == ] part?

Anyway, I changed nonce and genesis hash like below to follow above result,

genesis = CreateGenesisBlock(1519619579, 172682, 0x1f00ffff, 1, 500 * COIN);
assert(consensus.hashGenesisBlock == uint256S("0xd79fa40dc89f83ef4ff182f915bd5e778127e654909351debac676978effe31f")); 

But after compile this with [make, make install], run ./(my coin name)d

error says,

genesis.GetHash = 0000c978c4bf731c7e48018bc21f658b37394b5d18bd2ceca383768387578d76
genesis.merkleroot = 88e2acfcaec30f35652d10b861700def63129f9ac8176cdda889fed7baa730bb
bitcoinessenced: chainparams.cpp:285: CMainParams::CMainParams(): Assertion `consensus.hashGenesisBlock == uint256S("0xd79fa40dc89f83ef4ff182f915bd5e778127e654909351debac676978effe31f")' failed.
Aborted (core dumped)


So then this means genesish0 is not work with current source? (litecoin 0.15.1)

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
March 02, 2018, 04:06:20 AM
 #4

So nonce and genesis hash is different with [ assert(consensus.hashGenesisBlock == ] part?
Of course it will be, that's how mining works!

The nonce is part of the block header which is used for computing the block hash. It is what is changed to make a valid proof of work. Your nonce and thus the genesis hash were invalid, the script produces values that will be different which will be valid.

So then this means genesish0 is not work with current source? (litecoin 0.15.1)
No, it worked correctly, just that the script is a little wrong. It still found a valid block, but it printed the wrong value for the block hash. You can see that the block hash was printed in your error, it's 0000c978c4bf731c7e48018bc21f658b37394b5d18bd2ceca383768387578d76. So you need to set your genesis block assertion to that value.

wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
March 02, 2018, 04:29:05 AM
Last edit: March 03, 2018, 06:22:51 AM by wsxdrfv
 #5

yes so I changed again to that value,

   consensus.hashGenesisBlock = genesis.GetHash();
   printf("genesis.GetHash = %s\n", genesis.GetHash().ToString().c_str());
   printf("genesis.merkleroot = %s\n", genesis.hashMerkleRoot.ToString().c_str());
        assert(consensus.hashGenesisBlock == uint256S("0x0000c978c4bf731c7e48018bc21f658b37394b5d18bd2ceca383768387578d76"));  
        assert(genesis.hashMerkleRoot == uint256S("0x88e2acfcaec30f35652d10b861700def63129f9ac8176cdda889fed7baa730bb"));

but still debug.log says,

.....
.....
...
2018-03-02 04:25:09
case 2
2018-03-02 04:25:09
case 2
2018-03-02 04:25:09
case 2
2018-03-02 04:25:09
case 2
2018-03-02 04:25:09
case 2
2018-03-02 04:25:09 Genesisblock : CBlock(hash=0000c978c4bf731c7e48018bc21f658b37394b5d18bd2ceca383768387578d76, ver=0x00000001, hashPrevBlock=0000000000000000000000000000000000000000000000000000000000000000, hashMerkleRoot=88e2acfcaec30f35652d10b861700def63129f9ac8176cdda889fed7baa730bb, nTime=1519619579, nBits=1f00ffff, nNonce=210708, vtx=1)
  CTransaction(hash=88e2acfcae, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 04ffff001d0104114e6f7720697320323031382d30322d3230)
    CScriptWitness()
    CTxOut(nValue=500.00000000, scriptPubKey=410438b425136a6d49d84513c38e12)

2018-03-02 04:25:09

2018-03-02 04:25:09 Bitcoinessence version v0.15.1.0-unk
2018-03-02 04:25:09 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-03-02 04:25:09 Assuming ancestors of block 59c9b9d3fec105bdc716d84caa7579503d5b05b73618d0bf2d5fa639f780a011 have valid signatures.
2018-03-02 04:25:09 Setting nMinimumChainWork=00000000000000000000000000000000000000000000002ebcfe2dd9eff82666
2018-03-02 04:25:09 Using the 'standard' SHA256 implementation
2018-03-02 04:25:09 Using RdRand as an additional entropy source
2018-03-02 04:25:09 Default data directory /home/lee/.bitcoinessence
2018-03-02 04:25:09 Using data directory /home/lee/.bitcoinessence
2018-03-02 04:25:09 Using config file /home/lee/.bitcoinessence/bitcoinessence.conf
2018-03-02 04:25:09 Using at most 125 automatic connections (1024 file descriptors available)
2018-03-02 04:25:09 Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2018-03-02 04:25:09 Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2018-03-02 04:25:09 Using 4 threads for script verification
2018-03-02 04:25:09 scheduler thread start
2018-03-02 04:25:09 HTTP: creating work queue of depth 16
2018-03-02 04:25:09 No rpcpassword set - using random cookie authentication
2018-03-02 04:25:09 Generated RPC authentication cookie /home/lee/.bitcoinessence/.cookie
2018-03-02 04:25:09 HTTP: starting 4 worker threads
2018-03-02 04:25:09 init message: Verifying wallet(s)...
2018-03-02 04:25:09 Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2018-03-02 04:25:09 Using wallet wallet.dat
2018-03-02 04:25:09 CDBEnv::Open: LogDir=/home/lee/.bitcoinessence/database ErrorFile=/home/lee/.bitcoinessence/db.log
2018-03-02 04:25:09 Cache configuration:
2018-03-02 04:25:09 * Using 2.0MiB for block index database
2018-03-02 04:25:09 * Using 8.0MiB for chain state database
2018-03-02 04:25:09 * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2018-03-02 04:25:09 init message: Loading block index...
2018-03-02 04:25:09 Opening LevelDB in /home/lee/.bitcoinessence/blocks/index
2018-03-02 04:25:09 Opened LevelDB successfully
2018-03-02 04:25:09 Using obfuscation key for /home/lee/.bitcoinessence/blocks/index: 0000000000000000
2018-03-02 04:25:09 LoadBlockIndexDB: last block file = 0
2018-03-02 04:25:09 LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
2018-03-02 04:25:09 Checking all blk files are present...
2018-03-02 04:25:09 LoadBlockIndexDB: transaction index disabled
2018-03-02 04:25:09 Initializing databases...
2018-03-02 04:25:09 Pre-allocating up to position 0x1000000 in blk00000.dat
2018-03-02 04:25:09 Opening LevelDB in /home/lee/.bitcoinessence/chainstate
2018-03-02 04:25:09 Opened LevelDB successfully
2018-03-02 04:25:09 Wrote new obfuscate key for /home/lee/.bitcoinessence/chainstate: 735383118d952a83
2018-03-02 04:25:09 Using obfuscation key for /home/lee/.bitcoinessence/chainstate: 735383118d952a83
2018-03-02 04:25:09 init message: Rewinding blocks...
2018-03-02 04:25:09  block index              11ms
2018-03-02 04:25:09 init message: Loading wallet...
2018-03-02 04:25:09 nFileVersion = 150100
2018-03-02 04:25:09 Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total
2018-03-02 04:25:09 Performing wallet upgrade to 60000
2018-03-02 04:25:10 keypool added 2000 keys (1000 internal), size=2000 (1000 internal)
2018-03-02 04:25:10 keypool reserve 1
2018-03-02 04:25:10 keypool keep 1
2018-03-02 04:25:10  wallet                 1434ms
2018-03-02 04:25:10 keypool added 1 keys (0 internal), size=2000 (1000 internal)
2018-03-02 04:25:10 setKeyPool.size() = 2000
2018-03-02 04:25:10 mapWallet.size() = 0
2018-03-02 04:25:10 mapAddressBook.size() = 1
2018-03-02 04:25:10
case 2
2018-03-02 04:25:10 ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)
2018-03-02 04:25:10 *** Failed to read block
2018-03-02 04:25:10 Error: Error: A fatal internal error occurred, see debug.log for details
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
March 02, 2018, 05:27:32 AM
 #6

Did you reset your datadir before trying with the new genesis block? Reset as in delete the blocks and chainstate folders.

wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
March 02, 2018, 05:59:14 AM
 #7

Did you reset your datadir before trying with the new genesis block? Reset as in delete the blocks and chainstate folders.
Yes I deleted whole folders, files inside Home/.(coin name) folder.
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!