package octez-shell-libs
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
    
    
  sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a
    
    
  doc/octez-shell-libs.shell/Tezos_shell/Prevalidator_bounding/index.html
Module Tezos_shell.Prevalidator_boundingSource
Bound the valid operations in the mempool by limiting both their cardinal and their total byte size.
type config = {- max_operations : int;(*- Maximal allowed number of valid operations in the mempool. *)
- max_total_bytes : int;(*- Maximal allowed sum of the byte sizes of all valid operations in the mempool. *)
}Mempool bounds.
They can be retrieved/set using RPCs GET/POST /chains/<chain>/mempool/filter.
Default max_total_bytes is 10_000_000.
A block can have at most around 700k bytes of operations (see validation_passes in proto_xxx/lib_protocol/main.ml). So with this bound, a mempool can have the content of more than 10 blocks, which is more than enough.
Default max_operations is 10_000.
The smallest operations are around 140 bytes (e.g. 139 bytes for a (pre)attestation, 146 bytes for a delegation) so a block can have at most around 5_000 operations. But many operations are much larger, so in practice a block contains much less operations, so keeping 10_000 of them in the mempool is enough.
Encoding for config.
It is internally an object without any variable field, so it is possible to use it in a Data_encoding.merge_objs.
module Make
  (Proto : Tezos_protocol_environment.PROTOCOL) : 
  T with type protocol_operation = Proto.operationBuild a mempool bounding module.