Full predicted STEPS of a shard under a partition: floor + member step-cost + cross-ingress (foreign producers' bytes). Mirrors the packer's cap test.
(p: &BlockProfile, shard_of: &[u32], s: u32)
| 2161 | return Err(format!( |
| 2162 | "refine: shard {} needs at least two parts, got {}", |
| 2163 | r.id, |
| 2164 | r.parts.len() |
| 2165 | )); |
| 2166 | } |
| 2167 | if r.part_peaks.len() != r.parts.len() { |
| 2168 | return Err(format!( |
| 2169 | "refine: shard {}: {} peaks for {} parts", |
| 2170 | r.id, |
| 2171 | r.part_peaks.len(), |
| 2172 | r.parts.len() |
| 2173 | )); |
| 2174 | } |
| 2175 | if let Some(k) = r.parts.iter().position(Vec::is_empty) { |
| 2176 | return Err(format!("refine: shard {} part {k} is empty", r.id)); |
| 2177 | } |
| 2178 | if by_id.insert(r.id, i).is_some() { |
| 2179 | return Err(format!("refine: shard {} listed twice", r.id)); |
| 2180 | } |
| 2181 | } |
| 2182 | |
| 2183 | // The new shard list in id order: slots 0..n keep their ids (part 0 of a |