Module zebra_rpc::methods::get_block_template_rpcs::zip317
source ยท Expand description
The ZIP-317 block production algorithm.
This is recommended algorithm, so these calculations are not consensus-critical, or standardised across node implementations:
it is sufficient to use floating point arithmetic to calculate the argument to
floor
when computingsize_target
, since there is no consensus requirement for this to be exactly the same between implementations.
Traitsยง
- TryUpdate
Block ๐Limits
Functionsยง
- Chooses a random transaction from
txs
using the weighted indextx_weights
, and tries to add it toselected_txs
. - Choose a transaction from
transactions
, using the previously set upweighted_index
. - Returns a fake coinbase transaction that can be used during transaction selection.
- Checks if every item in
candidate_tx_deps
is present inselected_txs
. - Selects mempool transactions for block production according to ZIP-317, using a fake coinbase transaction and the mempool.
- Returns a fee-weighted index and the total weight of
transactions
.
Type Aliasesยง
- Selected
Mempool ๐Tx Used in the return type ofselect_mempool_transactions()
for non-test compilations.