-
Notifications
You must be signed in to change notification settings - Fork 6
Block Validation
Leo Cornelius edited this page Apr 7, 2021
·
4 revisions
-
Check version tags are supported by our node software
-
Check network tag is correct
-
Check block hash
-
Check if we have the block, in raw files or in checkpoints
-
If height = 0:
- Check if prev hash == "00000000000"
- Check if we have a preset genesis block for that chain, if we do make sure they are the same
- Check if the account already exists (ensure it does not)
- Check if the block is a Send block
- Make sure there are no transactions in the block
- check block signature
-
Else:
- Check account does exist
- Get block at height block.height - 1 for block.chain_key
- Make sure got block (call it prev_block).hash = block.prev_hash
- Check block's timestamp is not
transaction_timestamp_max_offset
in the future or past - Check block's timestamp is above the previous block/ prev_block
- Check block.txn.len() <= 10
- If Send block:
- Check signature
- For each transaction, validate it
- check each transaction's sender key is the creator of this block
- Else:
- Check we have the Send block for this block
- Check all block.txns.recieve_key == block.chain_key
- Check send block is in fact a send block
- Check block hash
- Check for conflicting block
- Check all signatures
- Perform minimal transaction validation
Written by the Avrio Project Team.