Skip to content

p2p: TODO or add peer ban behaviour#620

Open
redsh4de wants to merge 6 commits into
Cuprate:mainfrom
redsh4de:fix/peer-ban-divergences
Open

p2p: TODO or add peer ban behaviour#620
redsh4de wants to merge 6 commits into
Cuprate:mainfrom
redsh4de:fix/peer-ban-divergences

Conversation

@redsh4de
Copy link
Copy Markdown
Contributor

@redsh4de redsh4de commented May 27, 2026

What

Add ban behaviours from monerod, or TODOs in places where bans would be needed but would require ban system upgrades.

Why

Consistency, documentation for future upgrades

Where

cuprated, p2p

How

New bans added for places where monerod drops connection with a ban score contribution (drop_connection(_,true,_)).

Action Trigger Precedent (v0.18.5.0)
SHORT_BAN Duplicate tx index in fluffy missing-tx request cryptonote_protocol_handler.inl:782-794
MEDIUM_BAN Duplicate block IDs in chain response cryptonote_protocol_handler.inl:2544-2549
MEDIUM_BAN Empty block batch response cryptonote_protocol_handler.inl:1071-1077

TODOs added in places where monerod contributes to the ban score accumulator (add_host_fail / hit_score), and triggers a ban only after repeated violations. Needs ban system upgrades, as currently it's either ban or do nothing.

Trigger Precedent (v0.18.5.0)
current_blockchain_height regression (3 sites: new_fluffy_block, timed-sync request, timed-sync response) cryptonote_protocol_handler.inl:466-470 cryptonote_protocol_handler.inl:1087-1091 cryptonote_protocol_handler.inl:2509-2513
Inbound handshake wrong network ID net_node.inl:2587-2594
Outbound handshake invalid peerlist net_node.inl:1170-1175
Timed-sync invalid peerlist net_node.inl:1250-1255

@github-actions github-actions Bot added A-p2p Area: Related to P2P. A-binaries Area: Related to binaries. labels May 27, 2026
@redsh4de redsh4de changed the title p2p: address or document peer ban behaviour divergences p2p: address or TODO peer ban behaviour May 27, 2026
@redsh4de redsh4de force-pushed the fix/peer-ban-divergences branch from 57e39c7 to a8fbfae Compare May 27, 2026 18:49
@redsh4de redsh4de marked this pull request as ready for review May 27, 2026 18:51
@redsh4de redsh4de changed the title p2p: address or TODO peer ban behaviour p2p: TODO or add peer ban behaviour May 27, 2026
@redsh4de redsh4de force-pushed the fix/peer-ban-divergences branch from a8fbfae to 98577a6 Compare June 3, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-binaries Area: Related to binaries. A-p2p Area: Related to P2P.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant