Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
293 changes: 0 additions & 293 deletions docs/lora_region_preset_compatibility_client_spec.md

This file was deleted.

454 changes: 0 additions & 454 deletions docs/mesh_beacon_module.md

This file was deleted.

456 changes: 0 additions & 456 deletions docs/nexthop-routing-reliability.md

This file was deleted.

321 changes: 0 additions & 321 deletions docs/node_info_stores.md

This file was deleted.

222 changes: 0 additions & 222 deletions docs/traffic_management_module.md

This file was deleted.

9 changes: 6 additions & 3 deletions src/modules/TrafficManagementModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,8 @@ void TrafficManagementModule::reconcileNodeInfoFromNodeDBLocked()

// Membership refresh (this hourly pass owns it): clear every isMember bit, then re-mark from
// both NodeDB tiers. Runs AFTER seeding so the upsert still sees last pass's bits (spareMembers).
// Cost/lag rationale in docs/node_info_stores.md "Consistency with NodeDB (anti-entropy)".
// Cost/lag rationale in https://meshtastic.org/docs/development/reference/node-info-stores "Consistency with NodeDB
// (anti-entropy)".
Comment thread
caveman99 marked this conversation as resolved.
for (uint16_t i = 0; i < nodeInfoTargetEntries(); i++)
nodeInfoPayload[i].isMember = false;
for (size_t i = 0; i < nodeDB->getNumMeshNodes(); i++) {
Expand Down Expand Up @@ -729,7 +730,8 @@ bool TrafficManagementModule::copyPublicKey(NodeNum node, uint8_t out[32], bool
{
// Same enable gate as the write-through hooks and maintenance: a disabled module stops
// updating and sweeping the cache, so its frozen contents must not keep feeding PKI key
// resolution either. Enforces the "superset only while enabled" corollary (node_info_stores.md).
// resolution either. Enforces the "superset only while enabled" corollary
// (https://meshtastic.org/docs/development/reference/node-info-stores).
if (!moduleConfig.has_traffic_management)
return false;
if (!nodeInfoPayload || node == 0 || !out)
Expand Down Expand Up @@ -1514,7 +1516,8 @@ bool TrafficManagementModule::shouldRespondToNodeInfo(const meshtastic_MeshPacke

// Throttle the spoofed reply (per requester + per target + 1 s global floor; checked here so a
// request declined above never spends the budget). false forwards the request instead of consuming
// it. Rationale in docs/traffic_management_module.md "Throttling direct responses".
// it. Rationale in https://meshtastic.org/docs/development/reference/traffic-management-internals "Throttling direct
// responses".
if (!directResponseAllowed(getFrom(p), p->to, clockMs())) {
TM_LOG_DEBUG("NodeInfo direct response throttled for 0x%08x; forwarding request", getFrom(p));
return false;
Expand Down
15 changes: 10 additions & 5 deletions src/modules/TrafficManagementModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@

/// Packet inspection and traffic shaping: position dedup, per-node rate limiting, unknown-packet
/// filtering, NodeInfo direct response, and the next-hop/role overflow caches. One flat 10-byte
/// unified cache backs all per-node features; see docs/node_info_stores.md for the store overview.
/// unified cache backs all per-node features; see https://meshtastic.org/docs/development/reference/node-info-stores for the
/// store overview.
class TrafficManagementModule : public MeshModule, private concurrency::OSThread
{
public:
Expand Down Expand Up @@ -144,7 +145,8 @@ class TrafficManagementModule : public MeshModule, private concurrency::OSThread
private:
// 10-byte packed entry, all platforms. Tick stamps are free-running modular counters with
// non-zero presence sentinels; the 4-bit cached role rides the top bits of the two count
// bytes (tier-3 role fallback). Full layout and rationale: docs/node_info_stores.md.
// bytes (tier-3 role fallback). Full layout and rationale:
// https://meshtastic.org/docs/development/reference/node-info-stores.
#if _meshtastic_Config_DeviceConfig_Role_MAX > 15
#warning "Device role enum max exceeds 15 - TMM 4-bit role cache (rate_count[7:6]/unknown_count[7:6]) will truncate new values"
#endif
Expand Down Expand Up @@ -347,12 +349,14 @@ class TrafficManagementModule : public MeshModule, private concurrency::OSThread

/// 60 s NodeInfo-cache maintenance under cacheLock: saturate the expired obsTick stamp (wrap-safety
/// for the modular clock) and run the boot/hourly reconcile. Guarded by TMM_HAS_NODEINFO_CACHE alone
/// (never the unified cache size); see docs/node_info_stores.md "Tick clocks and wrap safety".
/// (never the unified cache size); see https://meshtastic.org/docs/development/reference/node-info-stores "Tick clocks and
/// wrap safety".
void maintainNodeInfoCacheLocked();

/// Anti-entropy under cacheLock: upsert hot-store + warm-tier records this cache lacks (never sets
/// hasObserved - seeding is knowledge, not observation), and refresh isMember from both NodeDB
/// tiers. Cost/lag: docs/node_info_stores.md "Consistency with NodeDB (anti-entropy)".
/// tiers. Cost/lag: https://meshtastic.org/docs/development/reference/node-info-stores "Consistency with NodeDB
/// (anti-entropy)".
void reconcileNodeInfoFromNodeDBLocked();
/// Learn an observed NODEINFO frame into the cache (key hygiene + provenance rules apply).
void cacheNodeInfoPacket(const meshtastic_MeshPacket &mp);
Expand All @@ -368,7 +372,8 @@ class TrafficManagementModule : public MeshModule, private concurrency::OSThread

// Direct-response throttles bounding the reflector risk of spoofed replies: three fixed bounds
// (per requester, per target, 1 s global airtime floor) via 8-slot LRU RAM tables, wrap-safe and
// PSRAM-agnostic. Design & rationale: docs/traffic_management_module.md "Throttling direct responses".
// PSRAM-agnostic. Design & rationale: https://meshtastic.org/docs/development/reference/traffic-management-internals
// "Throttling direct responses".
static constexpr uint32_t kDirectResponsePerRequesterMs = 60'000UL;
static constexpr uint32_t kDirectResponsePerTargetMs = 60'000UL;
static constexpr uint32_t kDirectResponseGlobalMs = 1'000UL;
Expand Down
2 changes: 1 addition & 1 deletion test/test_nexthop_routing/test_main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Unit tests for NextHop direct-message reliability mitigations (see docs/nexthop-routing-reliability.md):
// Unit tests for NextHop direct-message reliability mitigations (landed in meshtastic/firmware#10745):
// M1 - NodeDB::resolveLastByte / resolveUniqueLastByte (ambiguity-aware last-byte resolution)
// M2 - NextHopRouter::getNextHop strict-neighbor gate + Router::shouldDecrementHopLimit favorite check
// M3 - NextHopRouter route-health freshness / failure decay
Expand Down
Loading