Network_pool.Indexed_poolThe data structure underlying the transaction pool. We want to efficently support all the operations necessary. We also need to make sure that an attacker can't craft transactions or sequences thereof that take up an unacceptable amount of resources leading to a DoS.
module Command_error : sig ... endval replace_fee : Currency.Fee.tmodule Config : sig ... endmodule Sender_local_state : sig ... endval sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.tval get_sender_local_state :
t ->
Mina_base.Account_id.t ->
Sender_local_state.tval set_sender_local_state : t -> Sender_local_state.t -> tmodule Update : sig ... endval empty :
constraint_constants:Genesis_constants.Constraint_constants.t ->
consensus_constants:Consensus.Constants.t ->
time_controller:Block_time.Controller.t ->
tEmpty pool
val size : t -> intHow many transactions are currently in the pool
val min_fee : t -> Currency.Fee_rate.t optionval transactions :
logger:Logger.t ->
t ->
Mina_transaction.Transaction_hash.User_command_with_valid_signature.t
Core.Sequence.tval remove_lowest_fee :
t ->
Mina_transaction.Transaction_hash.User_command_with_valid_signature.t
Core.Sequence.t
* tRemove the command from the pool with the lowest fee per wu, along with any others from the same account with higher nonces.
val remove_expired :
t ->
Mina_transaction.Transaction_hash.User_command_with_valid_signature.t
Core.Sequence.t
* tRemove all the user commands that are expired. (Valid-until < Current-global-slot)
val get_highest_fee :
t ->
Mina_transaction.Transaction_hash.User_command_with_valid_signature.t optionGet the applicable command in the pool with the highest fee per wu
val add_from_gossip_exn :
t ->
Mina_transaction.Transaction_hash.User_command_with_valid_signature.t ->
Mina_numbers.Account_nonce.t ->
Currency.Amount.t ->
( Mina_transaction.Transaction_hash.User_command_with_valid_signature.t
* t
* Mina_transaction.Transaction_hash.User_command_with_valid_signature.t
Core.Sequence.t,
Command_error.t )
Core.Result.tAdd a command to the pool. Pass the current nonce for the account and its current balance. Throws if the contents of the pool before adding the new command are invalid given the supplied current nonce and balance - you are required to keep the pool in sync with the ledger you are applying transactions against.
Returns the commands dropped as a result of adding the command, which will be empty unless we're replacing one.
val add_from_backtrack :
t ->
Mina_transaction.Transaction_hash.User_command_with_valid_signature.t ->
( t, Command_error.t ) Core.Result.tAdd a command to the pool that was removed from the best tip because we're switching chains. Must be called in reverse order i.e. newest-to-oldest.
val member : t -> Mina_transaction.Transaction_hash.User_command.t -> boolCheck whether a command is in the pool
val has_commands_for_fee_payer : t -> Mina_base.Account_id.t -> boolCheck whether the pool has any commands for a given fee payer
val all_from_account :
t ->
Mina_base.Account_id.t ->
Mina_transaction.Transaction_hash.User_command_with_valid_signature.t listGet all the user commands sent by a user with a particular account
val get_all :
t ->
Mina_transaction.Transaction_hash.User_command_with_valid_signature.t listGet all user commands in the pool.
val find_by_hash :
t ->
Mina_transaction.Transaction_hash.t ->
Mina_transaction.Transaction_hash.User_command_with_valid_signature.t optionval revalidate :
t ->
logger:Logger.t ->
[ `Entire_pool | `Subset of Mina_base.Account_id.Set.t ] ->
( Mina_base.Account_id.t ->
Mina_numbers.Account_nonce.t * Currency.Amount.t ) ->
t
* Mina_transaction.Transaction_hash.User_command_with_valid_signature.t
Core.Sequence.tCheck the contents of the pool are valid against the current ledger. Call this whenever the transition frontier is (re)created.
val global_slot_since_genesis : t -> Mina_numbers.Global_slot.tGet the global slot since genesis according to the pool's time controller.
module For_tests : sig ... end