2

While consulting documentation on the prevalidator, it describes portions of the mempool as bounded sets:

For instance, in Alpha, contracts have counters, and operations with counters in the future are classified as temporarily refused. A malicious peer could easily flood the mempool with such operations, so they are put in a bounded set. Another bounded set is also kept for a third kind of non inclusion: operations that could be valid in another branch.

What are the bounds / limitations on portions of the mempool?

  • Is there a limit on the number of operations with future counters an address can have?
  • Is there a maximum size in bytes?
  • Are there cases where valid operations could be submitted to the node which do not persist in the mempool?
2

Currently, the cardinality of the valid operations set in the mempool is hard-coded at 2000. Whereas branch delayed operations (e.g. counter in the future, insufficient balance, etc.) are stored in a ring buffer of size 1000 with the semantics being that when the maximum number of operations stored has been reached, the oldest operation will be removed to make room for the newest. The source address is not considered in this process.

Regarding the persistence of operations:

  • If an operation is injected locally, by using RPCs, then it should always end in the mempool, if valid;
  • For operations shared from the network, then it has to pass through the node's mempool filters (e.g. having minimum fees) to reach the mempool. One can tweak those filters in the node's configuration if needs be.

Aside from that, operations not included in blocks should persist for 60 blocks before being evicted from the mempool. There is also a small delay until the operation gets treated by the mempool that will determine it's kind (applied/branch delayed/branch refused/refused). Aside from that, I do not recall any case of valid operations being injected and not ending up in the mempool.

Some parts of what I said is supposed to change in the future when the new mempool implementation finishes being validated: the mempool ressources will be split between peers to maximize fairness and security.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.