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

Do not request current child lookup peers #5724

Merged
merged 2 commits into from
May 13, 2024

Conversation

dapplion
Copy link
Collaborator

@dapplion dapplion commented May 6, 2024

Issue Addressed

Description of the problem ⬇️

Proposed Changes

Implement solution 1 from #5707

  • Only add peers to a lookup that MUST be able to serve the lookup's components
  • Allow lookups to have zero peers ONLY IF they are awaiting a parent (some future event will make progress)

Todo

  • Update lookup tests, behaviour has slightly changed

Closes #5707

@dapplion dapplion changed the base branch from stable to unstable May 6, 2024 15:52
@dapplion dapplion force-pushed the no-request-current-lookup-peers branch from 7269d79 to c55dd1b Compare May 6, 2024 15:53
@dapplion dapplion changed the title No request current lookup peers Do not request current child lookup peers May 6, 2024
@realbigsean realbigsean added ready-for-review The code is ready for review v5.2.0 Q2 2024 labels May 6, 2024
@dapplion dapplion force-pushed the no-request-current-lookup-peers branch from c55dd1b to a356c75 Compare May 7, 2024 02:45
michaelsproul added a commit that referenced this pull request May 7, 2024
Squashed commit of the following:

commit a356c75
Author: dapplion <[email protected]>
Date:   Tue May 7 00:50:54 2024 +0900

    Do not request current child lookup peers
@michaelsproul michaelsproul mentioned this pull request May 7, 2024
Copy link
Member

@AgeManning AgeManning left a comment

Choose a reason for hiding this comment

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

LGTM

@dapplion dapplion force-pushed the no-request-current-lookup-peers branch from 3073087 to f30dd96 Compare May 13, 2024 14:33
}

#[test]
fn parent_block_and_blob_lookup_child_returned_first_blob_trigger() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not possible now, child is not requested until parent is imported

}

#[test]
fn parent_block_and_blob_lookup_child_returned_first() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not possible now, child is not requested until parent is imported

@@ -1287,19 +1317,6 @@ fn test_skip_creating_failed_parent_lookup() {
rig.expect_no_active_lookups();
}

#[test]
fn test_skip_creating_failed_current_lookup() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not applicable anymore. A peer makes no claim that it has imported the child block, so it should not be downscored

// Processing succeeds, now the rest of the chain should be sent for processing.
rig.parent_block_processed_imported(block_root);
rig.expect_parent_chain_process();
rig.parent_chain_processed_success(block_root, &[]);
rig.expect_no_active_lookups();
}

#[test]
fn test_parent_lookup_empty_response() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Duplicated test, child and parent logic are the same now

@dapplion dapplion force-pushed the no-request-current-lookup-peers branch from f30dd96 to 0b340b0 Compare May 13, 2024 14:38
@realbigsean
Copy link
Member

great simplification !

@realbigsean
Copy link
Member

@mergify queue

Copy link

mergify bot commented May 13, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at f37ffe4

@mergify mergify bot merged commit f37ffe4 into sigp:unstable May 13, 2024
27 checks passed
@dapplion dapplion deleted the no-request-current-lookup-peers branch May 13, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review The code is ready for review v5.2.0 Q2 2024
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync lookup requests blocks from peers that may not have it
3 participants