pub fn encode_nodes_to_ctbnbdl_bundles_with_limits(
nodes: &[LedgerNode],
framing: CtbnbdlFramingDcs,
max_nodes_per_bundle: usize,
max_bytes_per_bundle: usize,
) -> Result<Vec<(u128, Vec<u8>)>>Expand description
Splits a slice of LedgerNode entries into one or more .ctbnbdl bundle buffers,
each paired with its starting node ID ((first_node_id, bundle_bytes)).
Bundles group up to max_nodes_per_bundle nodes or max_bytes_per_bundle bytes
(whichever is reached first). If a bundle must split early due to the byte limit,
the subsequent bundle is shortened so that bundle boundaries still align at
multiples of max_nodes_per_bundle relative to SYSTEM_REGION_START.