Skip to main content

Module compact

Module compact 

Source
Expand description

Provisional compact-block relay and bounded reconstruction. Provisional compact relay encoding version 1, requiring both peers to opt in.

Short IDs commit to witnessed identities, not just transaction effects. Reconstruction checks size, ordering, transaction Merkle roots and duplicates; callers must authenticate authorizing data against the committed tip before submitting the resulting block to consensus. Hashing and reconstruction are synchronous and must run on a blocking worker.

StructsΒ§

BlockTransactions
Complete transactions in the corresponding recovery request’s order.
BlockTransactionsRequest
A single recovery request for missing absolute transaction positions.
CompactBlock
A full Zcash header and ordered compact transaction identities.
ExpectedBlockTransactions πŸ”’
The blocktxn response that a connection is waiting for.
Reconstruction
Bounded partial reconstruction; not a consensus or authorizing-data validation verdict.

ConstantsΒ§

MAX_INITIAL_ALLOCATION πŸ”’
The largest number of items that memory is reserved for before any of them is read.

FunctionsΒ§

add_bytes πŸ”’
check_bytes πŸ”’
check_count πŸ”’
check_transactions_size πŸ”’
Returns an error if the first parsed transactions of a message, which take up bytes bytes, average fewer bytes than the smallest valid transaction. The block decoder has the same rule for a block’s transactions.
read_count πŸ”’
read_index πŸ”’
short_id πŸ”’
vec_for_count πŸ”’
Returns an empty vector for the count items that a peer’s message says it has.
write_count πŸ”’
write_index πŸ”’