Skip to content

Commit

Permalink
fix: State Sync Header Request no longer crashes a node (#10313)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikurt authored Dec 11, 2023
1 parent fe26cd5 commit add3187
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chain/chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3006,7 +3006,11 @@ impl Chain {
);

let mut root_proofs_cur = vec![];
assert_eq!(receipt_proofs.len(), block_header.chunks_included() as usize);
if receipt_proofs.len() != block_header.chunks_included() as usize {
// Happens if a node doesn't track all shards and can't provide
// all incoming receipts to a chunk.
return Err(Error::Other("Not tracking all shards".to_owned()));
}
for receipt_proof in receipt_proofs.iter() {
let ReceiptProof(receipts, shard_proof) = receipt_proof;
let ShardProof { from_shard_id, to_shard_id: _, proof } = shard_proof;
Expand Down

0 comments on commit add3187

Please sign in to comment.