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

Add sync lookup custody request state #6257

Merged
merged 4 commits into from
Aug 15, 2024

Conversation

dapplion
Copy link
Collaborator

@dapplion dapplion commented Aug 14, 2024

Issue Addressed

Part of

Proposed Changes

Extend SingleBlockLookup with a new request type CustodyRequestState.

Note that this is not functionally complete, in the diff I'll comment which code will be extended in other PRs. In summary

  • custody_lookup_request: expects the network context to issue N requests to fetch all the columns the node has to custody for a given block root. To see how this "super-request" will look like, check out this file
    pub struct ActiveCustodyRequest<T: BeaconChainTypes> {
  • send_custody_columns_for_processing: expects the beacon processor to import those columns into the da_checker

@dapplion dapplion requested review from jimmygchen and realbigsean and removed request for jimmygchen August 14, 2024 16:45
@dapplion dapplion added ready-for-review The code is ready for review das Data Availability Sampling das-unstable-merge labels Aug 14, 2024
@@ -6777,6 +6777,27 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
self.data_availability_checker.data_availability_boundary()
}

/// Returns true if epoch is within the data availability boundary
pub fn is_within_data_availability_boundary(&self, epoch: Epoch) -> bool {
Copy link
Member

Choose a reason for hiding this comment

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

We do already have a method, we could pass through here self.data_availability_checker.da_check_required_for_epoch()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Switched to da_check_required_for_epoch in 96e2363

/// Compute custody data columns the node is assigned to custody.
pub fn custody_columns(&self, _spec: &ChainSpec) -> Vec<ColumnIndex> {
let _enr = self.local_enr();
todo!("implement ENR changes");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
todo!("implement ENR changes");
//TODO(das): implement ENR changes
vec![]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 96e2363

@@ -46,6 +46,10 @@ pub enum RangeRequestId {
},
}

/// 0: expected blob count
/// 1: block slot
pub type DownloadedBlockSummary = (/* expected blob count */ usize, Slot);
Copy link
Member

Choose a reason for hiding this comment

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

a struct might be nice here

pub struct DownloadedBlockSummary {
    expected_blob_count: usize,
    block_slot: Slot
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed the type / struct altogether by just passing the full block around in 96e2363

@@ -307,19 +328,19 @@ impl<E: EthSpec> BlobRequestState<E> {
}
}

/// The state of the block request component of a `SingleBlockLookup`.
/// The state of the blob request component of a `SingleBlockLookup`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// The state of the blob request component of a `SingleBlockLookup`.
/// The state of the custody request component of a `SingleBlockLookup`.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 96e2363

@@ -723,6 +723,7 @@ impl TestRig {
(ev.work_type() == beacon_processor::RPC_BLOBS).then_some(())
})
.unwrap_or_else(|e| panic!("Expected blobs work event: {e}")),
ResponseType::CustodyColumn => todo!(),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ResponseType::CustodyColumn => todo!(),
ResponseType::CustodyColumn => todo!(), //TODO(das)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added comment in 96e2363

@dapplion dapplion requested a review from realbigsean August 15, 2024 14:30
@realbigsean
Copy link
Member

@mergify queue

Copy link

mergify bot commented Aug 15, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 9fc0a66

mergify bot added a commit that referenced this pull request Aug 15, 2024
@mergify mergify bot merged commit 9fc0a66 into sigp:unstable Aug 15, 2024
28 checks passed
@dapplion dapplion deleted the peerdas-network-lookup branch August 16, 2024 07:36
AgeManning pushed a commit to AgeManning/lighthouse that referenced this pull request Sep 3, 2024
* Add sync lookup custody request state

* Review PR

* clippy

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into peerdas-network-lookup
chong-he pushed a commit to chong-he/lighthouse that referenced this pull request Nov 26, 2024
* Add sync lookup custody request state

* Review PR

* clippy

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into peerdas-network-lookup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
das Data Availability Sampling das-unstable-merge ready-for-review The code is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants