Skip to content

How Foundry verifies a block

Junha Yang(양준하) edited this page Jul 20, 2020 · 1 revision

The order of verification

  1. Receive a block from block sync or Tendermint consensus.
  2. Verify the block
    • Verify the block without history in the verification queue
      • Call Client::import_block function
      • Verify block without history in the verification queue
      • If blocks are verified, client::import_verified_blocks is called
    • Verify the block using history
      • Call check_and_close_block in the import_verified_blocks
      • Call verify_block_family, verify_block_external, and verify_block_final in the check_and_close_block function
  3. The verified block will be saved in the disk of the commit_block function.

Why we need verification queues

Verification queues verify signatures in a block using threads.