package octez-shell-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13
doc/octez-shell-libs.shell/Tezos_shell/Bootstrap_pipeline/index.html
Module Tezos_shell.Bootstrap_pipeline
Source
The bootstrap pipeline works as follows: 1. From a locator, it computes a list of subchains (identified by a Block_locator.step
) to fetch. 2. A worker starts to fetch all the headers (top to bottom) from a subchain, starting with the top subchain. 3. A worker starts to download the list of operations by batch of blocks once a batch of headers is available. 4. A worker validates blocks one by one (bottom to top).
These three workers work concurrently.
val create :
?notify_new_block:(Block_validator.new_block -> unit) ->
block_header_timeout:Tezos_base.Time.System.Span.t ->
block_operations_timeout:Tezos_base.Time.System.Span.t ->
Block_validator.t ->
Tezos_base.P2p_peer.Id.t ->
Distributed_db.chain_db ->
Tezos_base.Block_locator.t ->
t
create ?notify_new_block ~block_header_timeout ~block_operations_timeout validator peer ddb locator
initializes a bootstrap_pipeline
for a locator
sent by peer
. It uses the Distributed_db
to fetch the data needed and validator
to validate blocks one by one with the function Block_validator.validate
.
Moreover:
notify_new_block
is a called everytime a valid block is received.block_header_timeout
is the timeout to fetch ablock_header
.block_operations_timeout
is the timeout to fetch a block operation.
If a timeout is triggered, the whole bootstrap_pipeline
is canceled.
length pipeline
returns the number of the headers and blocks fetched