Witness Block Error due to Block Too Old

in #witness-category2 months ago

Most blocks missing are due to "attempting to push a block that is too old"


This is thrown at: https://github.com/steemit/steem/blob/ff9b801615ba8c347a0c3f534ad06adc551b58e5/libraries/chain/fork_database.cpp#L57

void  fork_database::_push_block(const item_ptr& item)
   if( _head ) // make sure the block is within the range that we are caching
      FC_ASSERT( item-&gt;num &gt; std::max<int64_t>( 0, int64_t(_head-&gt;num) - (_max_size) ),
                 "attempting to push a block that is too old",

   if( _head &amp;&amp; item-&gt;previous_id() != block_id_type() )
      auto&amp; index = _index.get<block_id>();
      auto itr = index.find(item-&gt;previous_id());
      STEEM_ASSERT(itr != index.end(), unlinkable_block_exception, "block does not link to known chain");
      item-&gt;prev = *itr;

   if( !_head || item-&gt;num &gt; _head-&gt;num ) _head = item;

That is caused by: when the witness server is to slow to generate a block within 3 seconds - even it managed to generate a block shortly afterwards, it is too late (the block is missed)

How to avoid this? Make sure a good network connection (low latency) is one first thing to check.

Also, make sure the time/clock (NTP) on the server is accurately synchronized.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Thank you for reading ^^^^^^^^^^^^^^^

Follow me for topics of Algorithms, Blockchain and Cloud.
I am @justyy - a Steem Witness

My contributions

Delegation Service

  1. Voting Algorithm Updated to Favor those High Delegations!
  • Delegate 1000 to justyy: Link
  • Delegate 5000 to justyy: Link
  • Delegate 10000 to justyy: Link

Support me

If you like my work, please:

  1. Delegate SP: https://steemyy.com/sp-delegate-form/?delegatee=justyy
  2. Vote @justyy as Witness: https://steemyy.com/witness-voting/?witness=justyy&action=approve
  3. Set @justyy as Proxy: https://steemyy.com/witness-voting/?witness=justyy&action=proxy
    Alternatively, you can vote witness or set proxy here: https://steemit.com/~witnesses