Message: AddBlockHeader
The AddBlockHeader
message handler is used to add a new block header into the store. It initiates ballot voting for the block header in question, using the hash of the message as the ballot index.
Once the block header has been sufficiently voted on, it ensures the following:
The block header does not already exist in the store.
The block header timestamp is valid.
For Ethereum, no validation is necessary.
For Bitcoin, it checks the timestamp precision and ensures it is not more than two hours into the future compared to ZetaChain's time.
The block header's parent hash must not be
nil
.
It then finally inserts the new block header into the store.