Split a range of blocks into a list of span batch ranges. This is a simple implementation used when the safeDB is not activated on the L2 Node.
(start: u64, end: u64, max_range_size: u64)
| 75 | /// |
| 76 | /// This is a simple implementation used when the safeDB is not activated on the L2 Node. |
| 77 | pub fn split_range_basic(start: u64, end: u64, max_range_size: u64) -> Vec<SpanBatchRange> { |
| 78 | let mut ranges = Vec::new(); |
| 79 | let mut current_start = start; |
| 80 | |
| 81 | while current_start < end { |
| 82 | let current_end = min(current_start + max_range_size, end); |
| 83 | ranges.push(SpanBatchRange { start: current_start, end: current_end }); |
| 84 | current_start = current_end; |
| 85 | } |
| 86 | |
| 87 | ranges |
| 88 | } |
| 89 | |
| 90 | /// Split a range of blocks into a list of span batch ranges based on L2 safeHeads. |
| 91 | /// |