package octez-protocol-alpha-libs

  1. Overview
  2. Docs
Octez protocol alpha libraries

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-18.0.tar.gz
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a

doc/octez-protocol-alpha-libs.plugin/Tezos_protocol_plugin_alpha/Mempool/Conflict_map/index.html

Module Mempool.Conflict_mapSource

The purpose of this module is to provide the fee_needed_to_replace_by_fee function. For this function to be correct, the caller must maintain the state of type t by calling update on each successfully validated operation and its induced replacements.

Sourcetype t

Internal state needed by fee_needed_to_replace_by_fee.

Sourceval empty : t

Initial state.

Sourceval update : t -> new_operation:Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation -> replacements: Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation list -> t

Removes all the replacements from the state then adds new_operation.

Sourceval fee_needed_to_replace_by_fee : config -> candidate_op:Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation -> conflict_map:t -> int64 option

This function should be called when Protocol.Mempool.add_operation has returned Unchanged. This means that the candidate_op has been rejected because there was a conflict with an pre-existing operation and the conflict_handler has returned `Keep. When both operations are manager operations, this function returns the minimal fee (in mutez) that candidate_op would need in order to win the conflict, i.e. make the conflict_handler return `Replace instead. Otherwise, it returns None.

OCaml

Innovation. Community. Security.