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

impl ApprovedPeer UMP signal and add node feature for enabling it #7955

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

alindima
Copy link
Contributor

@alindima alindima commented Mar 18, 2025

#7731

TODO:

@alindima alindima added the T8-polkadot This PR/Issue is related to/affects the Polkadot network. label Mar 18, 2025
@alindima alindima marked this pull request as draft March 18, 2025 11:26
@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/13922030991
Failed job name: test-linux-stable-no-try-runtime

1 similar comment
@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/13922030991
Failed job name: test-linux-stable-no-try-runtime

@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/13922030991
Failed job name: test-linux-stable

@@ -447,7 +457,7 @@ pub fn skip_ump_signals<'a>(
impl CandidateCommitments {
/// Returns the core selector and claim queue offset determined by `UMPSignal::SelectCore`
/// commitment, if present.
pub fn core_selector(
fn core_selector_before_approved_peer_allowed(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really see why we want to change the functionality of this method and it's name. It can just return the core selector as it used to. If there are other signals, so be it. It should ignore them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there are two cases we need to handle, depending on whether the new node feature is enabled or not.
If it is disabled, preserve functionality, which is what this function does. (We can't just ignore new signals because they used to be errors). This function is private.
If it is enabled, allow approved peer ump signals. This is decided by the pub fn ump_signals.

I like your suggestion about having a CandidateUMPSignals, I'll do that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


/// Returns the ump signals of this candidate, if any, or an error if they violate the expected
/// format.
pub fn ump_signals(
Copy link
Contributor

Choose a reason for hiding this comment

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

This should rather be an internal method. The public methods should be core_selector() and approved_peer() that internally call ump_signals().

Or if we are afraid it's not efficient to do that, let's create a CandidateUMPSignals struct that this function returns. Then we can have the above methods live in there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea, added a CandidateUMPSignals

@@ -471,126 +472,12 @@ impl ValidationBackend for MockValidateCandidateBackend {
}
}

#[test]
fn session_index_checked_only_in_backing() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this test because the same scenario was exercised in invalid_session_or_core_index

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
None yet
Development

Successfully merging this pull request may close these issues.

2 participants