-
Notifications
You must be signed in to change notification settings - Fork 776
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
Conversation
@@ -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 { |
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo!("implement ENR changes"); | |
//TODO(das): implement ENR changes | |
vec![] |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
}
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// The state of the blob request component of a `SingleBlockLookup`. | |
/// The state of the custody request component of a `SingleBlockLookup`. |
There was a problem hiding this comment.
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!(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ResponseType::CustodyColumn => todo!(), | |
ResponseType::CustodyColumn => todo!(), //TODO(das) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comment in 96e2363
…erdas-network-lookup
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 9fc0a66 |
* Add sync lookup custody request state * Review PR * clippy * Merge branch 'unstable' of https://github.com/sigp/lighthouse into peerdas-network-lookup
* Add sync lookup custody request state * Review PR * clippy * Merge branch 'unstable' of https://github.com/sigp/lighthouse into peerdas-network-lookup
Issue Addressed
Part of
Proposed Changes
Extend
SingleBlockLookup
with a new request typeCustodyRequestState
.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 filelighthouse/beacon_node/network/src/sync/network_context/custody.rs
Line 24 in b638019
send_custody_columns_for_processing
: expects the beacon processor to import those columns into the da_checker