fix(node): reject sendTx when node has no peers to propagate the tx - #25182
Closed
spalladino wants to merge 2 commits into
Closed
fix(node): reject sendTx when node has no peers to propagate the tx#25182spalladino wants to merge 2 commits into
spalladino wants to merge 2 commits into
Conversation
A node whose p2p stack is up but has zero connected peers used to accept txs over RPC and "gossip" them to nobody: the tx sat in the local pool forever while the caller believed it had been submitted. The failure was silent — no error, no receipt, nothing actionable. `#sendTx` now checks p2p connectivity before doing any work and rejects with a clear error when p2p is enabled and no peers are connected, so callers fail immediately and can retry against a healthy node. The check runs ahead of `isValidTx` so a peerless node does not pay for full tx validation before rejecting, and the rejection is counted in the received-tx metric like the other failure paths. Nodes running without a p2p stack (sandbox, single-node setups) report `enabled: false` and are unaffected — they keep accepting txs, since their local sequencer mines straight from the local pool. Part of A-1701.
`single-node/misc/missed_l1_slot` is the only test that runs a single node on the in-memory mock gossip bus (it needs the bus so the proposer's own broadcasts route through the local proposal handler). With one member on the bus, `DummyPeerManager` filters the node itself out and reports zero peers, so the node ends up looking peerless to every connectivity gate: `sendTx` now rejects because there is nobody to propagate to, and a proposer under `minPeersToPropose: 1` skips its slot. Adds `registerPhantomGossipPeer` to the p2p test helpers: it registers a bare `MockGossipSubService` on the network and returns its peer id. The phantom peer subscribes to no topics and drops anything delivered to it, so it changes nothing about message flow — it only makes the node count one connected peer. The test registers one right after setup. Test-infra only; the production gates are unchanged. Part of A-1701.
This was referenced Aug 11, 2026
Contributor
Author
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.
A node whose p2p stack is up but has zero connected peers used to accept txs
over RPC and "gossip" them to nobody: the tx sat in the local pool forever
while the caller believed it had been submitted. The failure was silent — no
error, no receipt, nothing actionable.
#sendTxnow checks p2p connectivity before doing any work and rejects with aclear error when p2p is enabled and no peers are connected, so callers fail
immediately and can retry against a healthy node. The check runs ahead of
isValidTxso a peerless node does not pay for full tx validation beforerejecting, and the rejection is counted in the received-tx metric like the
other failure paths.
Nodes running without a p2p stack (sandbox, single-node setups) report
enabled: falseand are unaffected — they keep accepting txs, since theirlocal sequencer mines straight from the local pool.
Also includes a test-infra commit:
registerPhantomGossipPeerin the p2p test helpers, so the one single-node e2e test that runs on the in-memory mock gossip bus (missed_l1_slot) presents one connected peer to the connectivity gates instead of looking peerless.Part of A-1701.
Part of a stacked-PR chain (bottom → top) hardening the node against running with a dead p2p stack; each PR targets the branch below it and the bottom targets
merge-train/spartan-v5:GET /statussendTxwhen the node has no peers to propagate the tx