fix(#146): MpoolPushMessage lotus-parity hardening - #149
Merged
Conversation
- Work on a copy: never mutate the caller's message (old code did *msg = *estim through the caller's pointer) - Per-sender push lock across estimate+sign+publish: concurrent pushes from one From can no longer read the same nonce and produce colliding messages (mirrors lotus PushLocks) - Rewrite ID-typed From (f0...) to the deterministic pubkey address before signing (ID addresses are not reorg-stable) - Balance gate: reject when balance < Value + RequiredFunds instead of publishing a doomed message that loops in the #47 rebroadcaster (skipped when no state accessor is wired, e.g. wallet-only CLI) - Reject GasPremium > GasFeeCap after estimation Three new tests incl. a -race concurrent-sender test.
This was referenced Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the correctness tier of #146 (items 1, 2, 3, 5, 6 — MsgUuid dedup stays open as the follow-up):
*msg = *estimthrough the caller's pointer; embedded consumers (pkg/daemon / curio-core) got their structs rewritten under them.PushLocks): concurrent pushes from oneFromcan't grab the same nonce anymore.balance < Value + RequiredFundsis rejected instead of published-and-doomed (the mpool: pending-tx confirm + rebroadcast loop (published-but-unmined messages silently stall) #47 rebroadcaster used to loop on those). Skipped when no state accessor is wired (wallet-only CLI shapes).Tests: no-mutation, premium>feecap rejection, and an 8-goroutine same-sender
-racetest. Full./rpc/handlerssuite green.Closes nothing yet — #146 item 4 (MsgUuid dedup) remains.