Open talkol opened 5 years ago
@OdedWx do we need this for Q3?
BlockStorage should accept commits only for the latest block + 1. The above check is a debug optimization to identify an unintentional fork or an attack in order to report it. not an immediate priority.
The concern is not debug, but more of a production monitoring issue
IMO we currently test for forks during
CommitBlock
only with the latest blockForks are so dangerous that we should test for forks on every commit attempt
meaning:
when somebody calls
BlockStorage.CommitBlock
and block storage already has a block at this height, block storage should do a byte-wise compare of the block header (results header is enough)if we want something more efficient it may be enough to compare the
txBlockHash
inside the results block header