Module ckb_types::core::tx_pool

source ·
Expand description

Tx-pool shared type define.

Structs

Enums

Constants

  • Equal to MAX_BLOCK_BYTES / MAX_BLOCK_CYCLES, see ckb-chain-spec. The precision is set so that the difference between MAX_BLOCK_CYCLES * DEFAULT_BYTES_PER_CYCLES and MAX_BLOCK_BYTES is less than 1.
  • The maximum size of the tx-pool to accept transactions The ckb consensus does not limit the size of a single transaction, but if the size of the transaction is close to the limit of the block, it may cause the transaction to fail to be packed

Functions

  • vbytes has been deprecated, renamed to weight to prevent ambiguity
  • The miners select transactions to fill the limited block space which gives the highest fee. Because there are two different limits, serialized size and consumed cycles, the selection algorithm is a multi-dimensional knapsack problem. Introducing the transaction weight converts the multi-dimensional knapsack to a typical knapsack problem, which has a simple greedy algorithm.