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: remove handling of validation protocol versions 1 and 2 #7449

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

sw10pa
Copy link
Member

@sw10pa sw10pa commented Feb 4, 2025

Issue

[#7410] Remove validation protocol versions 1 and 2

TODO

  • Remove ValidationVersion V1 and V2;
  • Clean up ApprovalDistributionMessage;
  • Clean up BitfieldDistributionMessage;
  • Clean up StatementDistributionMessage;
  • Cleanup the Versioned enum: remove old versions of the above messages and separate collation from validation (this is more complicated and better to do in the next cleaning iteration);
  • Add PRdoc.

@sw10pa sw10pa added the T8-polkadot This PR/Issue is related to/affects the Polkadot network. label Feb 4, 2025
@sw10pa sw10pa requested a review from alindima February 4, 2025 12:51
@sw10pa sw10pa self-assigned this Feb 4, 2025
@sw10pa sw10pa linked an issue Feb 4, 2025 that may be closed by this pull request
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/13262880297
Failed job name: build-rustdoc

@sw10pa sw10pa changed the title [WIP] network: remove validation protocol versions 1 and 2 [WIP] network: remove handling of validation protocol versions 1 and 2 Feb 12, 2025
@sw10pa sw10pa changed the title [WIP] network: remove handling of validation protocol versions 1 and 2 network: remove handling of validation protocol versions 1 and 2 Feb 12, 2025
@sw10pa sw10pa marked this pull request as ready for review February 12, 2025 12:53
Copy link
Contributor

@alexggh alexggh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good job, nice! Left you some minor comments.

One thing, that we need to make sure is that we did not broke anything, so I would recommend once this PR gets approved and we are happy with it, to burn it on a kusama validators for a few days, to make sure everything works ok out in the wild.

@@ -639,6 +558,14 @@ fn validator_index_for_msg(
(None, Some(split))
},
},
_ => {
gum::warn!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now a bad validator can spam everyone with this warning, can we use warn_if_frequent or make it a trace ?

)
.await;
_ => {
gum::warn!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@@ -544,111 +493,7 @@ impl AssignmentCriteria for MockAssignmentCriteria {
/// import an assignment
/// connect a new peer
/// the new peer sends us the same assignment
#[test]
fn try_import_the_same_assignment() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be removed it should be ported to V3.

@@ -1165,145 +1014,6 @@ fn peer_sending_us_duplicates_while_aggression_enabled_is_ok() {
);
}

#[test]
fn import_approval_happy_path_v1_v2_peers() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, I would migrate it to V3 to keep coverage the same.

@@ -2518,112 +2236,7 @@ fn import_remotely_then_locally() {
);
}

#[test]
fn sends_assignments_even_when_state_is_approved() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be removed it should be ported to V3.

never!(
"Only versions 1 and 2 are supported; peer set connection checked above; qed"
);
never!("Only version 3 is supported; peer set connection checked above; qed");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we remove the ability to connect using the other protocols ? Because if we didn't then this never! might be triggered by malicious or bad validators, so we need to avoid this.

)
.await;
}

if target.targets_current() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably this can be removed as well, wouldn't it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T8-polkadot This PR/Issue is related to/affects the Polkadot network.
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

Remove validation protocol versions 1 and 2
2 participants