Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[network/notifications] A remote peer is not backed off when it rejects a substream #1827

Open
dmitry-markin opened this issue Oct 9, 2023 · 0 comments
Labels
I2-bug The node fails to follow expected behavior.

Comments

@dmitry-markin
Copy link
Contributor

dmitry-markin commented Oct 9, 2023

When the remote closes the entire connection, it's backed off, while if it closes a substream only, it's not.
When the remote closes the entire connection, the back-off is introduced here:

let ban_dur = Uniform::new(5, 10).sample(&mut rand::thread_rng());
let delay_id = self.next_delay_id;
self.next_delay_id.0 += 1;
let delay = futures_timer::Delay::new(Duration::from_secs(ban_dur));
self.delays.push(
async move {
delay.await;
(delay_id, peer_id, set_id)
}
.boxed(),
);
*entry.get_mut() = PeerState::Backoff {
timer: delay_id,
timer_deadline: Instant::now() + Duration::from_secs(ban_dur),
};

At the same time, if the remote just closes a substream, no back-off is applied here:
*entry.into_mut() =
PeerState::Disabled { connections, backoff_until: None };

Originally discussed in #1563 (comment).

Relates to paritytech/substrate#13778.

@dmitry-markin dmitry-markin added the I2-bug The node fails to follow expected behavior. label Oct 9, 2023
@dmitry-markin dmitry-markin moved this to Backlog 🗒 in Networking Oct 9, 2023
@dmitry-markin dmitry-markin changed the title [network/notifications] A remote peer is not banned when it rejects a substream [network/notifications] A remote peer is not backed off when it rejects a substream Oct 9, 2023
bkchr pushed a commit that referenced this issue Apr 10, 2024
* do not read parachain heads from ancient relay headers

* revert test change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior.
Projects
Status: Backlog 🗒
Development

No branches or pull requests

1 participant