# A mempool issue?

**URL:** https://forum.zcashcommunity.com/t/a-mempool-issue/45578
**Category:** General
**Created:** [September 7, 2023, 2:44pm UTC](https://forum.zcashcommunity.com/t/a-mempool-issue/45578 "2023-09-07T14:44:46Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Olek](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/olek/32/32740_2.png) [@Olek](https://forum.zcashcommunity.com/u/Olek)
#### Post date: [September 7, 2023, 2:44pm UTC](https://forum.zcashcommunity.com/t/a-mempool-issue/45578/1 "2023-09-07T14:44:46Z")

</div>

According to the documentation on [this page](https://zcash.readthedocs.io/en/latest/rtd_pages/basics.html), transactions in the mempool should expire within 1 hour, but in every single blockexplorer we can see that there are days old transactions in the mempool. This raises the question: where is the issue? Is it in the documentation, in the network, or in the block explorers?

---

<div class="post-metadata">

### Author: ![ChileBob](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/chilebob/32/26546_2.png) [@ChileBob](https://forum.zcashcommunity.com/u/ChileBob)
#### Post date: [September 7, 2023, 3:11pm UTC](https://forum.zcashcommunity.com/t/a-mempool-issue/45578/2 "2023-09-07T15:11:07Z")

</div>

If I understand correctly, the expiry time for a transaction is set by the sending wallet & appears completely optional - so a spammer pushed crud txns into the mempool that has really, really, really long expiry times.

(sigh)

---

<div class="post-metadata">

### Author: ![str4d](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/str4d/32/64_2.png) [@str4d](https://forum.zcashcommunity.com/u/str4d)
#### Post date: [September 7, 2023, 3:49pm UTC](https://forum.zcashcommunity.com/t/a-mempool-issue/45578/3 "2023-09-07T15:49:58Z")

</div>

Yep, I see expiry heights of e.g. around height 2,407,000 (the current chain tip is 2,218,840). My guess is the transaction author is setting the expiry height to `chain_tip + 200,000`.

It might be worth revisiting the weighting function of ZIP 401. If a transaction author sets their expiry height to a very long-off block height (or `0` to disable expiry) then they should expect to need to retransmit if their transactions drop out of the mempool. And the combination of “long expiry + significant number of unpaid actions” might be a reasonable heuristic for “spam” (definitely moreso than the number of actions is) - although every heuristic can be gamed.

---

<div class="post-metadata">

### Author: ![noamchom](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/noamchom/32/20269_2.png) [@noamchom](https://forum.zcashcommunity.com/u/noamchom)
#### Post date: [September 7, 2023, 5:21pm UTC](https://forum.zcashcommunity.com/t/a-mempool-issue/45578/4 "2023-09-07T17:21:37Z")

</div>

How soon could anything be done to defend against this sort of mempool spam problem?

It does feel quite reasonable to construct a _spam transactor hypothesis_ around any chronologically excessive, or non existent (shouldn’t it be invalid to set zero value?), expiration values.

---

<div class="post-metadata">

### Author: ![teor](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/teor/32/17846_2.png) [@teor](https://forum.zcashcommunity.com/u/teor)
#### Post date: [September 7, 2023, 9:19pm UTC](https://forum.zcashcommunity.com/t/a-mempool-issue/45578/5 "2023-09-07T21:19:32Z")

</div>

There’s a compatibility issue with banning no-expiry transactions, because they have previously been accepted. All wallets would need to upgrade to stop generating those transactions, then we could ban them.

However, we can treat “long expiry” and “no expiry” as spam signals, particularly when the mempool is full.

---

<div class="post-metadata">

### Author: ![hanh](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/hanh/32/27853_2.png) [@hanh](https://forum.zcashcommunity.com/u/hanh)
#### Post date: [September 7, 2023, 11:34pm UTC](https://forum.zcashcommunity.com/t/a-mempool-issue/45578/6 "2023-09-07T23:34:57Z")

</div>

> [@str4d](#):
>
> And the combination of “long expiry + significant number of unpaid actions” might be a reasonable heuristic for “spam” (definitely moreso than the number of actions is) - although every heuristic can be gamed.

Tracked by [Improve spam filter · Issue #103 · hhanh00/zwallet · GitHub](https://github.com/hhanh00/zwallet/issues/103)

---

<div class="post-metadata">

### Author: ![zkcroc](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/zkcroc/32/26962_2.png) [@zkcroc](https://forum.zcashcommunity.com/u/zkcroc)
#### Post date: [November 24, 2023, 2:14am UTC](https://forum.zcashcommunity.com/t/a-mempool-issue/45578/7 "2023-11-24T02:14:13Z")

</div>

Mempool appears to be completely spam free now according to [Zcash Mempool](https://zcashblockexplorer.com/mempool) has this been resolved?

---

<div class="post-metadata">

### Author: ![Olek](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/olek/32/32740_2.png) [@Olek](https://forum.zcashcommunity.com/u/Olek)
#### Post date: [November 24, 2023, 4:00pm UTC](https://forum.zcashcommunity.com/t/a-mempool-issue/45578/8 "2023-11-24T16:00:17Z")

</div>

Yes, it seems to have been resolved.
