add context bytes to blob messages, fix rpc limits, sync past finalized checkpoint during finalized sync so we can advance our own finalization, fix stream termination bug in blobs by range

This commit is contained in:
realbigsean
2022-12-21 13:56:52 -05:00
parent a67fa516c7
commit ff772311fa
6 changed files with 74 additions and 59 deletions

View File

@@ -689,7 +689,7 @@ impl<T: BeaconChainTypes> Worker<T> {
self.log,
"BlobsByRange Response processed";
"peer" => %peer_id,
"msg" => "Failed to return all requested blocks",
"msg" => "Failed to return all requested blobs",
"start_slot" => req.start_slot,
"current_slot" => current_slot,
"requested" => req.count,

View File

@@ -319,12 +319,18 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
let maybe_block_wrapped = info.pop_response().map(|block_sidecar_pair| {
BlockWrapper::BlockAndBlob { block_sidecar_pair }
});
if stream_terminator && !info.is_finished() {
return None;
}
if !stream_terminator && maybe_block_wrapped.is_none() {
return None;
}
if info.is_finished() {
entry.remove();
}
if !stream_terminator && maybe_block_wrapped.is_none() {
return None
}
Some((chain_id, batch_id, maybe_block_wrapped))
}
Entry::Vacant(_) => None,
@@ -365,12 +371,19 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
let maybe_block = info
.pop_response()
.map(|block_sidecar_pair| BlockWrapper::BlockAndBlob { block_sidecar_pair });
if stream_terminator && !info.is_finished() {
return None;
}
if !stream_terminator && maybe_block.is_none() {
return None;
}
if info.is_finished() {
entry.remove();
}
if !stream_terminator && maybe_block.is_none() {
return None
}
Some((chain_id, batch_id, maybe_block))
}
Entry::Vacant(_) => None,

View File

@@ -137,10 +137,16 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
let id = SyncingChain::<T>::id(&target_head_root, &target_head_slot);
let target_slot = if is_finalized_segment {
target_head_slot + (2 * T::EthSpec::slots_per_epoch()) + 1
} else {
target_head_slot
};
SyncingChain {
id,
start_epoch,
target_head_slot,
target_head_slot: target_slot,
target_head_root,
batches: BTreeMap::new(),
peers,