Skip to content

fix(transport-manager): blacklist addresses on PeerIdMismatch negotiation errors#543

Open
WilliamNwoke wants to merge 1 commit intoparitytech:masterfrom
WilliamNwoke:incorrect_address
Open

fix(transport-manager): blacklist addresses on PeerIdMismatch negotiation errors#543
WilliamNwoke wants to merge 1 commit intoparitytech:masterfrom
WilliamNwoke:incorrect_address

Conversation

@WilliamNwoke
Copy link

closes #492

Fixes an issue where PeerIdMismatch negotiation errors did not penalize address scores effectively due to a +100 (connection established) and -100 (dial failure) cancellation, causing invalid peer addresses to be retried indefinitely. Since PeerIdMismatch is a permanent structural failure (the address belongs to a different peer), it is now treated as ADDRESS_FAILURE (i32::MIN) instead of a transient CONNECTION_FAILURE. Additionally, AddressStore::insert now sets the score absolutely to i32::MIN (rather than accumulating) when handling ADDRESS_FAILURE, ensuring prior positive scores cannot offset the penalty. New tests verify permanent blacklisting for PeerIdMismatch while preserving normal behavior for transient failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

manager: Incorrect address score updates for PeerIdMismatch negotiation errors

1 participant