ethereum / ethereumj

DEPRECATED! Java implementation of the Ethereum yellowpaper. For JSON-RPC and other client features check Ethereum Harmony
GNU Lesser General Public License v3.0
2.18k stars 1.1k forks source link

Address timestamp block validity #1159

Closed mkalinin closed 5 years ago

mkalinin commented 6 years ago

Beacon chain processing section of the spec reads:

  • The parent pointed to by the parent_hash has already been processed and accepted
  • The PoW chain block pointed to by the pow_chain_ref has already been processed and accepted
  • The node’s local clock time is greater than or equal to the minimum timestamp as computed by GENESIS_TIME + slot_number * SLOT_DURATION

If these three conditions are not met, the client should delay processing the block until the three conditions are all satisfied.

Mentioned delay doesn't look as a reliable thing from implementation point of view. For example, it may open an attack vector if such blocks are held in memory until their processing time has come. It should make more sense to consider such blocks invalid. This consideration has a side effect that relates to incorrect local time. Fortunately, it is mitigated by setting up an NTP service.