columba/python
torlando-tech d71de9f86f perf: Optimize peer identity restoration from minutes to milliseconds
"Apply Changes" was taking 4.5+ minutes with ~4000 peer identities because
the previous implementation created full RNS objects for each peer:
- Created RNS.Identity from public key
- Created RNS.Destination for LXMF delivery
- Registered with RNS.Transport
- Called RNS.Identity.recall() to verify

But RNS's Identity.known_destinations is just a dict that remember() populates
directly. This change bypasses the expensive object creation and directly
populates the dict.

## Changes

### Python (`reticulum_wrapper.py`)
- Add `bulk_restore_announce_identities()`: Direct dict population for announces
  where destination_hash is already available (no computation needed)
- Add `bulk_restore_peer_identities()`: Lightweight hash computation for peer
  identities - computes LXMF delivery destination hash from public key without
  creating full RNS objects

### Kotlin
- Add `restoreAnnounceIdentities()` to AIDL interface, binder, and protocol
- Update `MessagingManager` to call new bulk Python methods
- Update `InterfaceConfigManager` to use appropriate bulk restore for each type

### Tests
- Add 25 new Python tests for bulk restore functions covering:
  - Success cases with valid data
  - Invalid inputs (missing fields, invalid hex, invalid base64)
  - Empty lists
  - Large batch performance
  - Equivalence with Identity.remember() dict format

## Performance Results (tested with ~4000 identities)

| Operation | Before | After |
|-----------|--------|-------|
| 1832 peer identities | ~4.5 min | 88ms |
| 2080 announce identities | (included above) | 142ms |
| **Total** | ~4.5 min | **~230ms** |

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 22:13:35 -05:00
..
ble_modules fix(ble): Fix MAC rotation reconnection and dual connection deduplication 2025-12-11 13:02:35 -05:00
drivers initial commit 2025-11-30 19:59:14 -05:00
jnius fix: Correct TCP RNode config format and add stub modules 2025-12-14 00:10:49 -05:00
patches initial commit 2025-11-30 19:59:14 -05:00
usb4a fix: Correct TCP RNode config format and add stub modules 2025-12-14 00:10:49 -05:00
usbserial4a fix: Correct TCP RNode config format and add stub modules 2025-12-14 00:10:49 -05:00
android_ble_interface.py initial commit 2025-11-30 19:59:14 -05:00
columba_logo.py feat: display Columba logo on RNode OLED via external framebuffer 2025-12-08 21:58:48 -05:00
conftest.py test: Add comprehensive unit tests for reticulum_wrapper.py 2025-12-12 22:22:10 -05:00
logging_utils.py initial commit 2025-11-30 19:59:14 -05:00
requirements.txt fix: use patched RNS fork for shared instance RPC fix (#42) 2025-12-08 12:10:58 -05:00
reticulum_wrapper.py perf: Optimize peer identity restoration from minutes to milliseconds 2025-12-14 22:13:35 -05:00
rnode_interface.py fix: TDD fixes for BLE deduplication cooldown asymmetry and test stability 2025-12-09 18:56:16 -05:00
test_android_ble_driver.py fix(ble): Fix MAC rotation reconnection and dual connection deduplication 2025-12-11 13:02:35 -05:00
test_announce_handler.py test: Add Phase 2 tests for reticulum_wrapper.py coverage 2025-12-12 22:39:49 -05:00
test_opportunistic_timeout.py fix: Distinguish propagated vs delivered status for relay messages 2025-12-13 00:50:04 -05:00
test_path_request.py feat: Auto-request path for unknown destinations 2025-12-12 19:18:48 -05:00
test_propagation_fallback.py feat: Add automatic relay fallback and manual retry for failed messages 2025-12-13 00:01:13 -05:00
test_rnode_interface.py fix: TDD fixes for BLE deduplication cooldown asymmetry and test stability 2025-12-09 18:56:16 -05:00
test_stub_modules.py test: Improve patch coverage from 20.94% to 80%+ with 61 new tests 2025-12-14 01:30:09 -05:00
test_wrapper_announce_polling.py test: Add Phase 2 tests for reticulum_wrapper.py coverage 2025-12-12 22:39:49 -05:00
test_wrapper_ble.py test: Add 30 tests to improve TCP RNode patch coverage to 80%+ 2025-12-14 01:58:19 -05:00
test_wrapper_config.py test: Add 30 tests to improve TCP RNode patch coverage to 80%+ 2025-12-14 01:58:19 -05:00
test_wrapper_destination.py test: Add comprehensive unit tests for reticulum_wrapper.py 2025-12-12 22:22:10 -05:00
test_wrapper_identity.py test: Add comprehensive unit tests for reticulum_wrapper.py 2025-12-12 22:22:10 -05:00
test_wrapper_initialization.py test: Add comprehensive unit tests for reticulum_wrapper.py 2025-12-12 22:22:10 -05:00
test_wrapper_messaging.py fix: Distinguish propagated vs delivered status for relay messages 2025-12-13 00:50:04 -05:00
test_wrapper_path.py test: Add comprehensive unit tests for reticulum_wrapper.py 2025-12-12 22:22:10 -05:00
test_wrapper_peer_identity.py perf: Optimize peer identity restoration from minutes to milliseconds 2025-12-14 22:13:35 -05:00
test_wrapper_propagation.py test: Add comprehensive unit tests for reticulum_wrapper.py 2025-12-12 22:22:10 -05:00
test_wrapper_utilities.py test: Add comprehensive unit tests for reticulum_wrapper.py 2025-12-12 22:22:10 -05:00