Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Review block verification logic #459

Closed
4 of 9 tasks
karmacoma opened this issue Mar 3, 2017 · 2 comments
Closed
4 of 9 tasks

Review block verification logic #459

karmacoma opened this issue Mar 3, 2017 · 2 comments
Assignees

Comments

@karmacoma
Copy link
Contributor

karmacoma commented Mar 3, 2017

Belongs to: #449

Previous task list:

  • Provide single entry point for block verification
  • Improve block verifications/checks, low-cost ones should be done first, heavy ones - last
  • Break block verification on first error (performance, we don't need to complete all other checks if one failed and block is already invalid)
  • Eliminate any double checks

New task list:

  1. Normalize
  2. Verify
  3. Broadcast
  4. Apply block

checkExists, validateBlockSlot and checkTransactions should all be performed inside of the verify logic.

  • Refactor onReceiveBlock behaviors to occur during verify, instead of occurring at a separate point in time
  1. postBlock: https://github.com/LiskHQ/lisk/blob/development/modules/transport.js#L493
  2. onReceiveBlock: https://github.com/LiskHQ/lisk/blob/development/modules/blocks/process.js#L382
    These checks should move to verify, and occur as the first checks of verify, onReceiveBlock should serve as the master thread for block receipt, with logic being performed inside of it.
  • Move blockId and Height generation into a new place to allow them to be added by the forger, rather than the recipient
  1. Remove this entry from here: https://github.com/LiskHQ/lisk/blob/development/modules/blocks/verify.js#L172
  2. Remove this function here: https://github.com/LiskHQ/lisk/blob/development/modules/blocks/verify.js#L287
  3. Create a new function that adds the functions when generating the block and attach them then. These items should not be removed from a block
@Isabello
Copy link
Contributor

Isabello commented Aug 18, 2017

This issue has been reopened:

Block ID and Height should be included in every block, and not added during other steps (such as block verify).
There is still not a single entry point for blocks verification, verification is occurring in many places along the way.

@Isabello Isabello reopened this Aug 18, 2017
@karmacoma
Copy link
Contributor Author

Task list resolved indirectly through recent 0.9.* patch releases.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants