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 Update for Weak Subjectivity Sync #2561

Merged
merged 18 commits into from
Sep 14, 2021
Merged

Conversation

AgeManning
Copy link
Member

This adds the network part to the weak subjectivity sync.

@AgeManning AgeManning force-pushed the network-wss branch 2 times, most recently from f89b69b to 626b0e8 Compare September 6, 2021 08:57
@AgeManning AgeManning marked this pull request as ready for review September 7, 2021 05:17
Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

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

Posting this partial review so it doesn't get eaten by github

beacon_node/client/src/notifier.rs Outdated Show resolved Hide resolved
beacon_node/client/src/notifier.rs Outdated Show resolved Hide resolved
beacon_node/client/src/notifier.rs Outdated Show resolved Hide resolved
beacon_node/eth2_libp2p/src/types/sync_state.rs Outdated Show resolved Hide resolved
beacon_node/http_api/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

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

Seems to work really well, and I can't find any major faults! Happy to merge down!

Just a few minor nitpicks

);
"invalid_signature".into()
}
HistoricalBlockError::ValidatorPubkeyCacheTimeout => {
Copy link
Member

Choose a reason for hiding this comment

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

I had to add this error type when adding signature verification. Unlike the other errors this is our fault rather than the peer's, so we probably shouldn't penalise them, although I realise that might be hard to tweak.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. This is a bit more work.
I think maybe we leave this, unless we expect this to occur regularly. Maybe we see how it goes in the wild and if its necessary, I can add in extra conditions where we don't penalize the peer.

Copy link
Member

Choose a reason for hiding this comment

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

I've set the timeout super long so it really shouldn't happen unless the hardware is getting completely slogged. Should be fine to leave as-is.

beacon_node/network/src/sync/manager.rs Show resolved Hide resolved
beacon_node/network/src/sync/backfill_sync/mod.rs Outdated Show resolved Hide resolved
beacon_node/network/src/sync/backfill_sync/mod.rs Outdated Show resolved Hide resolved
beacon_node/eth2_libp2p/src/types/sync_state.rs Outdated Show resolved Hide resolved
beacon_node/network/src/sync/backfill_sync/mod.rs Outdated Show resolved Hide resolved
beacon_node/network/src/sync/backfill_sync/mod.rs Outdated Show resolved Hide resolved
@michaelsproul michaelsproul added the work-in-progress PR is a work-in-progress label Sep 9, 2021
@AgeManning AgeManning added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels Sep 14, 2021
Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

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

Perfect! Let's merge this!

@michaelsproul michaelsproul merged commit f06bf2a into weak-subj-sync Sep 14, 2021
@michaelsproul michaelsproul deleted the network-wss branch September 14, 2021 23:31
bors bot pushed a commit that referenced this pull request Sep 22, 2021
## Issue Addressed

Closes #1891
Closes #1784

## Proposed Changes

Implement checkpoint sync for Lighthouse, enabling it to start from a weak subjectivity checkpoint.

## Additional Info

- [x] Return unavailable status for out-of-range blocks requested by peers (#2561)
- [x] Implement sync daemon for fetching historical blocks (#2561)
- [x] Verify chain hashes (either in `historical_blocks.rs` or the calling module)
- [x] Consistency check for initial block + state
- [x] Fetch the initial state and block from a beacon node HTTP endpoint
- [x] Don't crash fetching beacon states by slot from the API
- [x] Background service for state reconstruction, triggered by CLI flag or API call.

Considered out of scope for this PR:

- Drop the requirement to provide the `--checkpoint-block` (this would require some pretty heavy refactoring of block verification)


Co-authored-by: Diva M <[email protected]>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants