pub fn graph_weight(height: u64, edge_bits: u8) -> u64 {
	let mut xpr_edge_bits = edge_bits as u64;

	let bits_over_min = edge_bits.saturating_sub(global::min_edge_bits());
	let expiry_height = (1 << bits_over_min) * YEAR_HEIGHT;
	if edge_bits < 32 && height >= expiry_height {
		xpr_edge_bits = xpr_edge_bits.saturating_sub(1 + (height - expiry_height) / WEEK_HEIGHT);
	}
	// For C31 xpr_edge_bits reaches 0 at height YEAR_HEIGHT + 30 * WEEK_HEIGHT
	// 30 weeks after Jan 15, 2020 would be Aug 12, 2020

	(2u64 << (edge_bits - global::base_edge_bits()) as u64) * xpr_edge_bits
}
/// Compute weight of a graph as number of siphash bits defining the graph
/// Must be made dependent on height to phase out C31 in early 2020
/// Later phase outs are on hold for now
Compute weight of a graph as number of siphash bits defining the graph
Must be made dependent on height to phase out C31 in early 2020
Later phase outs are on hold for now
Compute weight of a graph as number of siphash bits defining the graph Must be made dependent on height to phase out C31 in early 2020 Later phase outs are on hold for now
pub fn graph_weight(height: u64, edge_bits: u8) -> u64 {
	let mut xpr_edge_bits = edge_bits as u64;
	let bits_over_min = edge_bits.saturating_sub(global::min_edge_bits());
	let expiry_height = (1 << bits_over_min) * YEAR_HEIGHT;
	if edge_bits < 32 && height >= expiry_height {
		xpr_edge_bits = xpr_edge_bits.saturating_sub(1 + (height - expiry_height) / WEEK_HEIGHT);
	}
	// For C31 xpr_edge_bits reaches 0 at height YEAR_HEIGHT + 30 * WEEK_HEIGHT
	// 30 weeks after Jan 15, 2020 would be Aug 12, 2020
	(2u64 << (edge_bits - global::base_edge_bits()) as u64) * xpr_edge_bits
}
pub fn graph_weight ( height : u64 , edge_bits : u8 ) -> u64 { let mut xpr_edge_bits = edge_bits as u64 ; let bits_over_min = edge_bits . saturating_sub ( global :: min_edge_bits ( ) ) ; let expiry_height = ( 1 << bits_over_min ) * YEAR_HEIGHT ; if edge_bits < 32 && height >= expiry_height { xpr_edge_bits = xpr_edge_bits . saturating_sub ( 1 + ( height - expiry_height ) / WEEK_HEIGHT ) ; } // For C31 xpr_edge_bits reaches 0 at height YEAR_HEIGHT + 30 * WEEK_HEIGHT // 30 weeks after Jan 15, 2020 would be Aug 12, 2020 ( 2u64 << ( edge_bits - global :: base_edge_bits ( ) ) as u64 ) * xpr_edge_bits }
Compute weight of a graph as number of siphash bits defining the graph
Must be made dependent on height to phase out C31 in early 2020
Later phase outs are on hold for now
Compute weight of a graph as number of siphash bits defining the graph Must be made dependent on height to phase out C31 in early 2020 Later phase outs are on hold for now
height
u64
edge_bits
u8
height
u64
edge_bits
u8