State RFC: fix block height contextual validation

This commit is contained in:
teor 2020-10-27 19:29:32 +10:00 committed by GitHub
parent ea510b7d41
commit 08910e0378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -559,8 +559,9 @@ New `non-finalized` blocks are commited as follows:
self.queued_blocks.dequeue_children(parent);` self.queued_blocks.dequeue_children(parent);`
- for each queued `block` - for each queued `block`
- **Run contextual validation** on `block` - **Run contextual validation** on `block`
- contextual validation will reject blocks that are past the reorg limit, - contextual validation should check that the block height is
because the finalized block at that height is already known. equal to the previous block height plus 1. This check will
reject blocks with invalid heights.
- If the block fails contextual validation send the result to the - If the block fails contextual validation send the result to the
associated channel associated channel
- Else if the block's previous hash is the finalized tip add to the - Else if the block's previous hash is the finalized tip add to the