Skip to content

feat(mempool): raise MaxUntrustedActorPendingMessages from 10 to 100 - #13636

Merged
rvagg merged 1 commit into
filecoin-project:masterfrom
beck-8:feat/mpool-bump-untrusted-pending
May 27, 2026
Merged

feat(mempool): raise MaxUntrustedActorPendingMessages from 10 to 100#13636
rvagg merged 1 commit into
filecoin-project:masterfrom
beck-8:feat/mpool-bump-untrusted-pending

Conversation

@beck-8

@beck-8 beck-8 commented May 25, 2026

Copy link
Copy Markdown
Contributor

Related Issues

None. The current value has been unchanged since the untrusted push path was introduced in 3c72461 (2020).

Proposed Changes

  • Raise MaxUntrustedActorPendingMessages from 10 to 100 in chain/messagepool/messagepool.go.
  • Update the corresponding comment on PushUntrusted.
  • Add a CHANGELOG.md entry under ## 👌 Improvements.

Additional Info

The per-actor cap on the untrusted push path — used by lotus-gateway and therefore every public RPC relaying MpoolPush from external clients — has been 10 since this path was introduced in 2020.

That value is too tight for normal usage. A sender pushing at modest cadence can easily have more than 10 messages in flight when basefee spikes briefly or block inclusion stalls, after which every subsequent send is rejected with ErrTooManyPendingMessages. The failure surfaces as a hard error on the send path rather than backpressure.

Impact

  • Cap raised 10x but still an order of magnitude below the trusted-path cap (MaxActorPendingMessages = 1000), preserving the asymmetry that protects gateway operators from external spam.
  • maxNonceGap = 0 for untrusted messages is unchanged — pending messages must still form a contiguous nonce sequence from the on-chain nonce, so an attacker cannot park arbitrary future nonces.
  • Worst-case additional per-actor memory: ~90 extra SignedMessage entries, negligible against the existing global pool bounds.
  • No API or wire-format changes.

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title conforms with contribution conventions
  • Update CHANGELOG.md or signal that this change does not need it per contribution conventions
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior (no test references the literal 10; behavior is unchanged apart from the constant)
  • CI is green

@github-project-automation github-project-automation Bot moved this to 📌 Triage in FilOz May 25, 2026
@beck-8
beck-8 force-pushed the feat/mpool-bump-untrusted-pending branch from ebf2fe7 to bf3f5ed Compare May 25, 2026 23:04
@beck-8

beck-8 commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

The problem I actually encountered was: I often encountered too many pending messages for actor when using glif rpc (run pdp node), regardless of whether it is a paid plan or not. This limit is too low.

The per-actor cap on the untrusted push path (lotus-gateway / public
RPC) has been 10 since the untrusted path was introduced in 2020
(3c72461). In practice 10 is too tight for normal usage: a sender
pushing at modest cadence can easily have more than 10 messages in
flight when basefee spikes briefly or block inclusion stalls, after
which every subsequent send is rejected with ErrTooManyPendingMessages.

100 is still an order of magnitude below the trusted-path cap (1000),
and the nonce-gap-zero rule for untrusted messages is unchanged, so
spam/DoS protection for gateway operators is preserved.

TestMemPoolPushSingleNode and TestContractInvocationMultiple previously
hard-coded the cap at 10; pin the package var in each test so they keep
exercising a small, bounded scenario regardless of the package default.
@beck-8
beck-8 force-pushed the feat/mpool-bump-untrusted-pending branch from bf3f5ed to cf9a8c2 Compare May 25, 2026 23:25
@rvagg
rvagg requested a review from Copilot May 26, 2026 01:21
@github-project-automation github-project-automation Bot moved this from 📌 Triage to ✔️ Approved by reviewer in FilOz May 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the mempool’s untrusted message push limits (used by lotus-gateway / public RPC paths) to reduce unnecessary ErrTooManyPendingMessages failures for normal senders when inclusion temporarily stalls.

Changes:

  • Increase MaxUntrustedActorPendingMessages default from 10 to 100.
  • Update the PushUntrusted comment to reflect the new cap.
  • Pin the untrusted cap to 10 in relevant integration tests to keep the scenarios bounded and independent of the package default.
  • Add an UNRELEASED changelog entry under 👌 Improvements.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
chain/messagepool/messagepool.go Raises the default per-actor untrusted pending-message cap and updates the related comment.
itests/mempool_test.go Pins MaxUntrustedActorPendingMessages to 10 for the test to keep expectations stable after the default changes.
itests/eth_transactions_test.go Pins MaxUntrustedActorPendingMessages to 10 for the multi-transaction untrusted-path test scenario.
CHANGELOG.md Documents the behavioral change under UNRELEASED improvements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rvagg
rvagg merged commit b14ad28 into filecoin-project:master May 27, 2026
175 of 176 checks passed
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

3 participants