HomePhabricator

Parallelize script verification
f9cae832e6f5Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Parallelize script verification

  • During block verification (when parallelism is requested), script check actions are stored instead of being executed immediately.
  • After every processed transactions, its signature actions are pushed to a CScriptCheckQueue, which maintains a queue and some synchronization mechanism.
  • Two or more threads (if enabled) start processing elements from this queue,
  • When the block connection code is finished processing transactions, it joins the worker pool until the queue is empty.

As cs_main is held the entire time, and all verification must be
finished before the block continues processing, this does not reach
the best possible performance. It is a less drastic change than
some more advanced mechanisms (like doing verification out-of-band
entirely, and rolling back blocks when a failure is detected).

The -par=N flag controls the number of threads (1-16). 0 means auto,
and is the default.

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on Dec 1 2012, 22:04
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGING1d70f4bde8f6: Remove CheckSig_mode and move logic out of CheckInputs()
Branches
Unknown
Tags
Unknown

Event Timeline

Pieter Wuille <pieter.wuille@gmail.com> committed rSTAGINGf9cae832e6f5: Parallelize script verification (authored by Pieter Wuille <pieter.wuille@gmail.com>).Jan 8 2013, 01:00