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

Improve validators_buffer behavior in collator protocol #1525

Open
rphmeier opened this issue Sep 12, 2023 · 1 comment
Open

Improve validators_buffer behavior in collator protocol #1525

rphmeier opened this issue Sep 12, 2023 · 1 comment
Assignees
Labels
I3-annoyance The node behaves within expectations, however this “expected behaviour” itself is at issue.

Comments

@rphmeier
Copy link
Contributor

rphmeier commented Sep 12, 2023

The new connection management for collator->validator connections has some issues. It occasionally disconnects from validators right before receiving the next collation and attempting to reconnect, triggering an underlying network issue.

#1499

We are probably too aggressive in resetting interest in collations. Validators will often not request a collation until its parent is backed, which can take some time.

It may be better to eagerly disconnect from validators we have sent collations to as soon as we provide it as well.
Alternatively, we might combine a two-pronged approach:

  1. only disconnect validators 3 seconds after a new leaf
  2. introduce a CollatorProtocolMessage::CollatorHeadsUp(RelayParent) to pre-connect to validators when the collator begins authoring.
@rphmeier rphmeier added the I3-annoyance The node behaves within expectations, however this “expected behaviour” itself is at issue. label Sep 12, 2023
@slumber
Copy link
Contributor

slumber commented Sep 13, 2023

Regardless whether validator requests collation its interest will be discarded after timeout:

/// A timeout for resetting validators' interests in collations.
pub const RESET_INTEREST_TIMEOUT: Duration = Duration::from_secs(6);

Then, when RECONNECT_TIMEOUT secs pass (or if we issue another connection request because of new collation built), the connection-set will be updated, validators whose interest was reset will be disconnected.

/// Ensure that collator issues a connection request at least once every this many seconds.
/// Usually it's done when advertising new collation. However, if the core stays occupied or
/// it's not our turn to produce a candidate, it's important to disconnect from previous
/// peers.
///
/// Validators are obtained from [`ValidatorGroupsBuffer::validators_to_connect`].
const RECONNECT_TIMEOUT: Duration = Duration::from_secs(12);

These values were chosen for sync backing, so we should just tune it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I3-annoyance The node behaves within expectations, however this “expected behaviour” itself is at issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants