MCPcopy Create free account
hub / github.com/base/base / split_range_basic

Function split_range_basic

crates/proof/succinct/utils/host/src/block_range.rs:77–88  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

75///
76/// This is a simple implementation used when the safeDB is not activated on the L2 Node.
77pub 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///

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected