pub fn validate_header(header: &Header, max_payload_size: u32) -> Result<()>
Validate a header for protocol compliance (standalone function).