-
Notifications
You must be signed in to change notification settings - Fork 968
Forward sync columns by root #7946
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
Closed
Closed
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
490b627
Penalize if invalid EL block
pawanjay176 836f9c6
Priorotize status v2
pawanjay176 156449c
Increase columns_by_root quota
pawanjay176 6bd8944
Reduce backfill buffer size
pawanjay176 9455153
Without retries
pawanjay176 5337e46
Add a function to retry column requests that could not be made
pawanjay176 ca9cfd5
Small fixes
pawanjay176 68cce37
Try to avoid chains failing for rpc errors
pawanjay176 6da924b
Fix bug in initialization code
pawanjay176 1a0df30
Also penalize all batch peers for availability check errors
pawanjay176 17c4e34
Avoid root requests for backfill sync
pawanjay176 fdce537
Implement responsible peer tracking
pawanjay176 4540195
Request columns from global peer pool
pawanjay176 521778b
Random logs
pawanjay176 da27441
Merge branch 'unstable' into blocks-then-columns
pawanjay176 52762b9
Handle 0 blobs per epoch case
pawanjay176 7c214f5
Merge branch 'unstable' into blocks-then-columns
pawanjay176 90d319f
Merge branch 'unstable' into blocks-then-columns
pawanjay176 27d0b36
Remove debug statements
pawanjay176 a97cf88
Add docs
pawanjay176 05adb71
Fix bug with partial column responses before all column requests sent
pawanjay176 b4bc7fe
Remove more debug logs
pawanjay176 8386bd9
Merge branch 'unstable' into blocks-then-columns
pawanjay176 7331323
AwaitingValidation state only needs block peer
pawanjay176 da1aaba
Revise error tolerance
pawanjay176 8e1337d
Merge branch 'unstable' into blocks-then-columns
pawanjay176 19b0a5c
Merge branch 'unstable' into blocks-then-columns
pawanjay176 b07bc6d
Force requests if batch buffer is full under certain conditions
pawanjay176 4f60e86
Add logs to debug stuck range sync
pawanjay176 7a6d0d9
Force processing_target request
pawanjay176 8458df6
Attempt sending awaitingDownload batches when restarting sync
pawanjay176 29c2f83
Cleanup SyncingChain
pawanjay176 7e91eeb
Merge branch 'unstable' into blocks-then-columns
pawanjay176 e0d8f04
Tests compile
pawanjay176 6a2a33d
Fix some issues from review
pawanjay176 e259ecd
More renamings
pawanjay176 4f62a9c
Merge branch 'unstable' into blocks-then-columns
pawanjay176 04398ad
Fix some more issues from review
pawanjay176 bf09d57
Fix some issues from lion's review
pawanjay176 cffbd34
Reduce code duplication
pawanjay176 08bba3f
fmt
pawanjay176 9db4c30
Fix small bug
pawanjay176 baee27a
Merge branch 'unstable' into blocks-then-columns
pawanjay176 e3aed89
Remove retry test that we do not use anymore
pawanjay176 b3b3756
Fix tests
pawanjay176 2f35c36
Add some metrics
pawanjay176 4a59d35
Merge branch 'unstable' into blocks-then-columns
pawanjay176 27195ca
Merge branch 'unstable' into blocks-then-columns
pawanjay176 aa6a1bc
Create a custom penalize_sync_peer method for clarity
pawanjay176 4b0b655
Fix nits
pawanjay176 7650032
Rename DataColumnsFromRange
dapplion 7488755
De-duplicate data columns by root request type
dapplion c2aa4ae
Revert type change in UnexpectedRequestId
dapplion cf46d10
Fix issues from review
pawanjay176 d99df0a
Only send data coumn subnet discovery requests after peerdas is sched…
jimmygchen 3f8998f
Only mark block lookups as pending if block is importing from gossip …
dapplion 421e954
Revert "Revert type change in UnexpectedRequestId"
pawanjay176 826a06e
Fix variant name
pawanjay176 c491856
Merge branch 'unstable' into blocks-then-columns
pawanjay176 15df3d2
Merge branch 'unstable' into blocks-then-columns
pawanjay176 5c562c6
Fix some more issues
pawanjay176 9b2de09
Rethink peer scoring
pawanjay176 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -535,6 +535,18 @@ impl<E: EthSpec> DataColumnsByRootRequest<E> { | |
| Ok(Self { data_column_ids }) | ||
| } | ||
|
|
||
| pub fn from_single_block(block_root: Hash256, indices: Vec<u64>) -> Result<Self, &'static str> { | ||
| let columns = VariableList::new(indices) | ||
| .map_err(|_| "Number of indices exceeds total number of columns")?; | ||
| DataColumnsByRootRequest::new( | ||
| vec![DataColumnsByRootIdentifier { | ||
| block_root, | ||
| columns, | ||
| }], | ||
| 1, | ||
| ) | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unused and can be removed? |
||
|
|
||
| pub fn max_requested(&self) -> usize { | ||
| self.data_column_ids.iter().map(|id| id.columns.len()).sum() | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,12 @@ use types::{ | |
|
|
||
| pub type Id = u32; | ||
|
|
||
| #[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)] | ||
| pub enum RangeRequestType { | ||
| ForwardSync, | ||
| BackfillSync, | ||
| } | ||
|
|
||
| #[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)] | ||
| pub struct SingleLookupReqId { | ||
| pub lookup_id: Id, | ||
|
|
@@ -38,6 +44,7 @@ pub enum SyncRequestId { | |
| pub struct DataColumnsByRootRequestId { | ||
| pub id: Id, | ||
| pub requester: DataColumnsByRootRequester, | ||
| pub peer: PeerId, | ||
| } | ||
|
|
||
| #[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)] | ||
|
|
@@ -46,6 +53,20 @@ pub struct BlocksByRangeRequestId { | |
| pub id: Id, | ||
| /// The Id of the overall By Range request for block components. | ||
| pub parent_request_id: ComponentsByRangeRequestId, | ||
| /// The peer that we made this request to | ||
| pub peer_id: PeerId, | ||
| } | ||
|
|
||
| impl BlocksByRangeRequestId { | ||
| pub fn batch_id(&self) -> Epoch { | ||
| match self.parent_request_id.requester { | ||
| RangeRequestId::BackfillSync { batch_id } => batch_id, | ||
| RangeRequestId::RangeSync { | ||
| chain_id: _, | ||
| batch_id, | ||
| } => batch_id, | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)] | ||
|
|
@@ -86,12 +107,31 @@ pub enum RangeRequestId { | |
| RangeSync { chain_id: Id, batch_id: Epoch }, | ||
| BackfillSync { batch_id: Epoch }, | ||
| } | ||
| impl RangeRequestId { | ||
| pub fn batch_id(&self) -> Epoch { | ||
| match &self { | ||
| RangeRequestId::BackfillSync { batch_id } => *batch_id, | ||
| RangeRequestId::RangeSync { | ||
| chain_id: _, | ||
| batch_id, | ||
| } => *batch_id, | ||
| } | ||
| } | ||
|
|
||
| pub fn batch_type(&self) -> RangeRequestType { | ||
| match &self { | ||
| RangeRequestId::BackfillSync { .. } => RangeRequestType::BackfillSync, | ||
| RangeRequestId::RangeSync { .. } => RangeRequestType::ForwardSync, | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // TODO(das) refactor in a separate PR. We might be able to remove this and replace | ||
| // [`DataColumnsByRootRequestId`] with a [`SingleLookupReqId`]. | ||
| #[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)] | ||
| pub enum DataColumnsByRootRequester { | ||
| Custody(CustodyId), | ||
| RangeSync { parent: ComponentsByRangeRequestId }, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| } | ||
|
|
||
| #[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)] | ||
|
|
@@ -222,6 +262,7 @@ impl Display for DataColumnsByRootRequester { | |
| fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { | ||
| match self { | ||
| Self::Custody(id) => write!(f, "Custody/{id}"), | ||
| Self::RangeSync { parent } => write!(f, "Range/{parent}"), | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -255,6 +296,7 @@ mod tests { | |
| lookup_id: 101, | ||
| }), | ||
| }), | ||
| peer: PeerId::random(), | ||
| }; | ||
| assert_eq!(format!("{id}"), "123/Custody/121/Lookup/101"); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It may be worth extracting the duplicate logic we have in
has_good_custody_range_sync_peerinto a function inPeerInfoso we avoid the danger of these two functions going out of sync? maybe we can even just put it inhas_slot()I think we may also be able to request backfill batches from a peer that is
Behindif it has the slot? we'll have to add check againsthead_slotinto the function though