Commit Graph
28 Commits
Author SHA1 Message Date
Chad Attermann f5a23a5a56 Add OOM hardening across Transport, Identity, Destination, and Packet
- Transport::inbound(): pre-emptive cull before destination-table insert;
  try/catch around insert for explicit OOM diagnostics
- Transport::jobs(): split stale-entry culling into 5 independent
  per-phase try/catch blocks so a failure in one phase doesn't abort
  the others; reserve() before push_back loops in each phase
- cull_path_table()/cull_known_destinations(): std::min_element fallback
  when sort-index allocation fails, breaking the cull-OOM-still-full loop
- Identity::remember(): wrapped _known_destinations.insert in try/catch
  for explicit OOM diagnostic logging
- Destination::announce(): outer try/catch covers all OOM-prone ops
  (Bytes concat, sign, Packet ctor, send); inner _path_responses.insert
  catch preserved for degraded-mode behavior
- Packet::unpack(): dedicated std::bad_alloc catch returns false cleanly
- Type.h: MAX_RECEIPTS and MAX_QUEUED_ANNOUNCES now overridable at
  compile time via RNS_RECEIPTS_MAX / RNS_QUEUED_ANNOUNCES_MAX
- Transport.h: hashlist_maxsize and max_pr_tags exposed as runtime
  accessors for dynamic capacity tuning
2026-02-27 12:53:49 -07:00
Chad Attermann c3edde10e9 WIP: Progress toward Link support with example app 2025-08-23 14:12:13 -06:00
Chad Attermann fcfda66365 WIP: General improvements in persistence efficiency 2024-08-14 21:59:23 -06:00
Chad Attermann 4a30a0a4b4 WIP: Filesystem support and persistence defines 2024-07-21 17:27:09 -06:00
Chad Attermann 3af5111606 WIP: Logging optimizations and memory management
Changed a few key logs to use printf-style instead of string
concatenation to avoid dynamic memory allocation. Still need to move
all remaining logging over to printf-style.

Added option (-DRNS_USE_ALLOCATOR=1) to override new/delete operators for
both allocation metrics and the ability to implement an alternate memory
allocator.

Added option (-DRNS_USE_TLSF=1) to use the alternate TLSF allocator
(must also define RNS_USE_ALLOCATOR). This allocator is well known for
reducing fragmentation and providing constant, O(1)-time allocation
and deallocation for real-time embedded systems.

This TLSF allocator appears to already be the default allocator for
ESP32 boards, but the allocator used by NRF52 is unknown at this time so
the TLSF allocator internal to microReticulum is only being used for
NRF52 boards at this time.

Future memory management improvements will include custom allocators for
long-lived structures like the path table that will segregate them from
the general pool of memory that is constantly cycling, thereby further
reducing fragmentation. It will also allow these structures to use
alternate memory like PSRAM present on T-Beam boards.
2024-07-16 10:40:46 -06:00
Chad Attermann 36ff1c5f00 WIP: Refactored logging to use macros 2024-07-03 11:30:01 -06:00
Chad Attermann bef8dbc1b0 WIP: Stable memory and flash with limited paths 2024-07-03 06:55:06 -06:00
Chad Attermann 518db13ec8 WIP: Switched to macros for build control of logs 2024-07-01 20:25:46 -06:00
Chad Attermann cc25dbab8f WIP: Major improvements in memory management 2024-07-01 20:12:51 -06:00
Chad Attermann ae7b324378 WIP: Improved persistence 2024-06-20 15:37:01 -06:00
Chad Attermann f415b5e0b5 WIP: Enhancements to persistence 2024-06-03 08:13:45 -06:00
Chad Attermann 9443f8a3f7 WIP: Changes in support of transport node formware 2024-01-05 14:51:55 -07:00
attermann 03cfb1c03f WIP: More porting and work on persistence
Ported packet PROOFs.
Implemented Transport probe destination.
SPIFFs filesystem checks and formatting when necessary.
2023-12-20 11:52:48 -07:00
attermann 162dcff6cd WIP: Continued work of persistence and refactoring 2023-12-11 13:42:20 -07:00
attermann f9a679ffc2 WIP: Initial implementation of persistence
Persistence implemented with the help of the ArduinoJson library using
MessagePack format.
2023-12-05 11:06:49 -07:00
attermann 642486ac7e WIP: Fixes, optimizations, and more Transport
Changed all time references to use decimal seconds to match Python
reference implementation.
Fixed memory issues caused by storing references to objects instead of
copies.
More implementation of Transport logic.
This is the first build that fully implements end-to-end path finding
and routing.
2023-12-02 08:52:45 -07:00
attermann ea7b4603ed WIP: Added super basic UDP interface for testing
Basic UDP interface enabled testing with RNS reference implementation.
Added to basic Transport implementation.
2023-11-26 18:10:46 -07:00
attermann 8d943318a6 WIP: Collection optimizations and Transport
Tested and optimized collections used in Transport.
Additional Transport implementation.
2023-11-21 06:21:03 -07:00
attermann 263f589801 WIP: Refactor pointer/reference style. 2023-11-20 10:51:56 -07:00
attermann d09331ec0e WIP: Optimizations with reference return types. 2023-11-20 10:26:14 -07:00
attermann 9f1602067d WIP: More refactoring to reduce need for headers 2023-11-19 13:17:42 -07:00
attermann 33fda8a7f9 WIP: Refactored to minimize circular dependenies
Moved core class constants and enums into single header Types.h.
Switched form class-specific NoneContructor to single
Type::NoneConstructor.
2023-11-19 11:36:09 -07:00
attermann a2e956eced WIP update
Minimal transport implementation.
2023-11-19 08:51:10 -07:00
attermann 2c8006f3a9 WIP update
Finished moving Packet over to implicit sharing.
2023-10-09 09:39:11 -06:00
attermann f9e3a22911 WIP update
Implemented AES.
Implemented AES-CBC.
Implemented HKDF.
Implemented HMAC.
Implemented PKCS7.
Implemented Fernet.
Added extensive logging and successfully tested ability to encrypt and
decrypt a packet.
2023-10-08 23:59:43 -06:00
attermann 4b062aa485 WIP update
Implemented X25519.
2023-10-07 15:03:21 -06:00
attermann 1b919a9489 WIP Update
Cleaned up and organized test functions.
Implemented Ed25519.
2023-10-07 01:03:15 -06:00
attermann eef5f1b326 Initial commit 2023-10-06 17:24:48 -06:00