Skip to content

Pr1 nodedb warmstore#10705

Merged
NomDeTom merged 16 commits into
meshtastic:developfrom
NomDeTom:pr1-nodedb-warmstore
Jun 18, 2026
Merged

Pr1 nodedb warmstore#10705
NomDeTom merged 16 commits into
meshtastic:developfrom
NomDeTom:pr1-nodedb-warmstore

Conversation

@NomDeTom

@NomDeTom NomDeTom commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

NodeDB: 3-tier node store with warm tier + blocked-node retention
Reworks the NodeDB into a tiered store so the device retains identity for far more nodes than fit in the full-record store, and hardens how blocked (ignored) nodes are received and kept.

What it does

  • 3-tier store:
  1. hot store of full NodeInfoLite (MAX_NUM_NODES, 120 on nRF52);
  2. per-map satellite caps (MAX_SATELLITE_NODES, 40 freshest keep position/telemetry/etc.);
  3. a warm tier of 40 B {num, last_heard, public_key} records for evicted nodes so DMs to/from long-tail nodes keep encrypting/decrypting.
  • nRF52840 persists the warm tier in a dedicated 12 KB raw-flash ring below LittleFS; everywhere else in /prefs/warm.dat.
  • Router PKI decrypt/encode resolve peer keys via NodeDB::copyPublicKey (hot store → warm tier).
  • NodeInfoLite gains snr_q4 (Q4-encoded SNR on disk).

Load-time migration

  • a database from a larger-cap build (e.g. the old 150-node nRF52 store) demotes its oldest overflow into the warm tier instead of dropping it;
  • favourites/ignored/verified and our own node are preserved.

Blocked-node handling

  • blocking keeps the node's public key
  • set_ignored_node can block by node ID even for an unknown node (incl. remote admin); ignored nodes are protected from eviction, cleanup and migration.
  • The protected set (favourite + ignored + verified) is capped at MAX_NUM_NODES − 2 so ≥2 evictable slots always remain; a locally-set favourite/ignore that hits the cap reports back to the phone.

Tests:
test_warm_store,
test_nodedb_blocked (migration, favourite/ignored eviction protection, protected-cap).

Note: the snr_q4 field needs the matching deviceonly.proto change in the protobufs submodule before merge (generated header is updated here).

MCP server used to confirm migration behaviour - 150 nodes becomes 120 cleanly after startup.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)
      @alecperkins has tested on a heltec V4 - many thanks

@NomDeTom NomDeTom requested a review from thebentern June 12, 2026 22:22
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Flash this PR in the Web Flasher

firmware commit boards expires

Warning

This is an automated, unreviewed CI test build. Back up your device configuration
before flashing, and only flash devices you are able to recover.

Supported boards built by this PR (24)
Device Board Platform
Crowpanel Adv 3.5 TFT elecrow-adv-35-tft esp32-s3
Heltec HT62 heltec-ht62-esp32c3-sx1262 esp32-c3
Heltec Mesh Node 096 heltec-mesh-node-t096 nrf52840
Heltec Mesh Node T1 heltec-mesh-node-t1 nrf52840
Heltec Mesh Node T114 heltec-mesh-node-t114 nrf52840
Heltec V3 heltec-v3 esp32-s3
Heltec V4 heltec-v4 esp32-s3
Raspberry Pi Pico pico rp2040
Raspberry Pi Pico W picow rp2040
RAK WisMesh Tag rak_wismeshtag nrf52840
RAK WisBlock 11200 rak11200 esp32
RAK WisBlock 11310 rak11310 rp2040
RAK3312 rak3312 esp32-s3
RAK WisBlock 4631 rak4631 nrf52840
Seeed Wio Tracker L1 seeed_wio_tracker_L1 nrf52840
Seeed Xiao NRF52840 Kit seeed_xiao_nrf52840_kit nrf52840
Seeed Xiao ESP32-S3 seeed-xiao-s3 esp32-s3
Station G2 station-g2 esp32-s3
Station G3 station-g3 esp32-s3
LILYGO T-Deck t-deck-tft esp32-s3
LILYGO T-Echo t-echo nrf52840
LILYGO T-Echo Plus t-echo-plus nrf52840
LilyGo T3-C6 tlora-c6 esp32-c6
Seeed SenseCAP T1000-E tracker-t1000-e nrf52840

Build artifacts expire on 2026-07-18. Updated for 162e447.

@github-actions github-actions Bot added needs-review Needs human review hardware-support Hardware related: new devices or modules, problems specific to hardware labels Jun 12, 2026
@NomDeTom NomDeTom added 2.8 ai-generated Possible AI-generated low-quality content and removed hardware-support Hardware related: new devices or modules, problems specific to hardware labels Jun 12, 2026
@thebentern thebentern requested a review from Copilot June 12, 2026 22:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reworks NodeDB into a tiered storage model by adding a warm (“long-tail”) node tier that preserves minimal identity (notably PKI public keys) for nodes evicted from the hot NodeInfoLite store, and tightens retention/eviction rules for protected nodes (favorite/ignored/verified). It also adds a raw-flash persistence backend for the warm tier on nRF52840 and caps satellite-map growth to bound memory and nodes.db size.

Changes:

  • Add WarmNodeStore (RAM + persistence) and integrate it into NodeDB load/evict/cleanup flows, plus Router PKI key resolution via NodeDB::copyPublicKey().
  • Enforce satellite-map caps (MAX_SATELLITE_NODES) and protected-node cap (MAX_NUM_NODES - 2) with user-facing warnings in some admin/UI paths.
  • Add unit tests for warm-tier policy and blocked/protected-node eviction/migration behavior; add nRF52840 linker/guard tooling to reserve flash for the warm ring.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
variants/nrf52840/nrf52840.ini Force capped linker script for S140 v6 boards to keep the warm raw-flash region clear.
variants/nrf52840/nrf52.ini Add post-link guard script to prevent images from overlapping the warm-store flash reservation.
extra_scripts/nrf52_warm_region.py Post-link nm-based guard ensuring the firmware image ends below the reserved warm-store region.
src/platform/nrf52/nrf52840_s140_v6.ld New linker script variant capping FLASH length to protect the warm-store ring area (S140 v6 layout).
src/platform/nrf52/nrf52840_s140_v7.ld Cap FLASH length for S140 v7 layout to protect the warm-store ring area.
src/mesh/WarmNodeStore.h Define warm-tier entry format, policies, and nRF52840 ring layout constants.
src/mesh/WarmNodeStore.cpp Implement warm-tier admission/eviction, persistence (raw-flash ring vs /prefs/warm.dat), and replay.
src/mesh/NodeDB.h Add warm-tier member + copyPublicKey(), setProtectedFlag(), and related helpers.
src/mesh/NodeDB.cpp Integrate warm tier into eviction/migration/cleanup/reset flows; add satellite caps; add protected-cap enforcement.
src/mesh/Router.cpp Resolve PKI keys via NodeDB::copyPublicKey() so long-tail nodes can still encrypt/decrypt DMs.
src/modules/AdminModule.cpp Route favorite/ignore through setProtectedFlag(); allow blocking unknown nodes via getOrCreateMeshNode().
src/graphics/draw/MenuHandler.cpp Use setProtectedFlag() for ignore toggling (cap-aware).
src/mesh/mesh-pb-constants.h Set new defaults for MAX_NUM_NODES, add MAX_SATELLITE_NODES, and define WARM_NODE_COUNT per platform.
src/mesh/generated/meshtastic/deviceonly.pb.h Add persisted snr_q4 field to NodeInfoLite generated struct.
test/test_warm_store/test_main.cpp New unit tests for warm-store admission/eviction/take/persistence behavior.
test/test_nodedb_blocked/test_main.cpp New unit tests for hot-store migration and favorite/ignored retention + protected cap behavior.

Comment thread src/mesh/WarmNodeStore.cpp
Comment thread src/graphics/draw/MenuHandler.cpp Outdated
Comment thread src/mesh/NodeDB.cpp Outdated
Comment thread variants/nrf52840/nrf52.ini Outdated
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Firmware Size Report

22 targets | vs develop: 22 increased, net +116,504 (+113.8 KB)

Target Size vs develop
rak11200 1,839,968 📈 +7,376 (+7.2 KB)
rak3312 2,250,240 📈 +6,528 (+6.4 KB)
seeed-xiao-s3 2,254,176 📈 +6,448 (+6.3 KB)
t-eth-elite 2,469,696 📈 +6,432 (+6.3 KB)
elecrow-adv-35-tft 3,395,712 📈 +6,384 (+6.2 KB)
Show 17 more target(s)
Target Size vs develop
station-g3 2,244,928 📈 +6,336 (+6.2 KB)
heltec-v4 2,263,536 📈 +6,320 (+6.2 KB)
heltec-v3 2,243,024 📈 +6,288 (+6.1 KB)
t-deck-tft 3,789,392 📈 +6,144 (+6.0 KB)
heltec-vision-master-e213-inkhud 2,203,680 📈 +6,032 (+5.9 KB)
station-g2 2,254,208 📈 +6,032 (+5.9 KB)
heltec-ht62-esp32c3-sx1262 2,114,768 📈 +5,952 (+5.8 KB)
tlora-c6 2,348,176 📈 +5,792 (+5.7 KB)
pico2w 1,202,776 📈 +5,140 (+5.0 KB)
picow 1,226,236 📈 +5,120 (+5.0 KB)
pico2 753,424 📈 +4,704 (+4.6 KB)
seeed_xiao_rp2350 751,576 📈 +4,688 (+4.6 KB)
pico 765,480 📈 +4,656 (+4.5 KB)
rak11310 788,104 📈 +4,656 (+4.5 KB)
seeed_xiao_rp2040 763,680 📈 +4,640 (+4.5 KB)
rak3172 181,028 📈 +532
wio-e5 233,220 📈 +304

Updated for ca08228

@NomDeTom NomDeTom mentioned this pull request Jun 14, 2026
8 tasks
@NomDeTom NomDeTom force-pushed the pr1-nodedb-warmstore branch from 0770379 to 20114e1 Compare June 16, 2026 09:47
@thebentern thebentern requested a review from Copilot June 17, 2026 01:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 6 comments.

Comment thread src/modules/AdminModule.cpp
Comment thread src/mesh/NodeDB.cpp
Comment thread src/mesh/NodeDB.cpp
Comment thread src/mesh/NodeDB.cpp
Comment thread src/graphics/draw/MenuHandler.cpp Outdated
Comment thread src/mesh/NodeDB.cpp

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/mesh/NodeDB.cpp:3252

  • NodeDB::getOrCreateMeshNode() will happily create an entry for NodeNum 0. Across the codebase, node num 0 is used as a sentinel for “local” (e.g. MeshPacket.from == 0), so allowing 0 into the hot store can create a bogus protected/ignored node, consume a slot, and potentially trigger avoidable evictions (now that AdminModule can create nodes by ID). It should defensively reject n==0 up front.
meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
{
    meshtastic_NodeInfoLite *lite = getMeshNode(n);

    if (!lite) {

@NomDeTom NomDeTom requested a review from Copilot June 17, 2026 13:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Comment thread src/modules/AdminModule.cpp
Comment thread src/mesh/WarmNodeStore.cpp Outdated
Comment thread src/mesh/Router.cpp Outdated
Comment thread src/mesh/WarmNodeStore.cpp
Comment thread src/mesh/NodeDB.cpp
Comment thread extra_scripts/nrf52_warm_region.py Outdated
NomDeTom and others added 5 commits June 18, 2026 00:10
…ty retention)

Introduces a tiered NodeDB so the device retains identity (public key,
last_heard) for far more nodes than fit in the full-record hot store,
without growing heap or the persisted nodes.proto unboundedly.

- Hot store: full NodeInfoLite, MAX_NUM_NODES (120 on nRF52).
- Satellite maps: position/telemetry/environment/status capped at
  MAX_SATELLITE_NODES (40 freshest); eviction via enforceSatelliteCaps /
  evictSatelliteOverCap.
- Warm tier (WarmNodeStore): 40 B {num,last_heard,public_key} records for
  evicted nodes so DMs to/from long-tail nodes keep encrypting/decrypting.
  Persisted to /prefs/warm.dat, or on nRF52840 a dedicated 12 KB raw-flash
  record-ring below LittleFS (3x4 KB pages; see linker scripts + the
  nrf52_warm_region.py post-link guard).

NodeDB::getOrCreateMeshNode now demotes evicted nodes into the warm tier and
re-admits them (restoring key/last_heard). Router PKI decrypt/encode resolve
the peer key via NodeDB::copyPublicKey (hot store, then warm tier).

NodeInfoLite gains snr_q4 (sint32, Q4-encoded dB); the float snr is zeroed on
disk. NodeInfoLite grows 105 -> 112 B; backup 2432 -> 2468 B.

Note: the snr_q4 .proto change still needs to land in the protobufs submodule
(generated header is updated here; submodule pointer left at upstream).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Hardens how ignored/favourite nodes are received over admin and retained,
closing paths where a block could be lost or accidentally cleared.

- Blocking keeps the node's public key (admin set_ignored_node and
  addFromContact no longer zero it / drop the warm-tier key), so a blocked
  peer stays a verifiable identity.
- set_ignored_node creates the node if absent, so a block by node ID sticks
  even for a node we've never heard from (e.g. pushed by a remote admin) with
  no NodeInfo or key.
- Eviction protection (favourite/ignored/manually-verified) now also applies to
  the load-time hot-store migration and is never undone by cleanupMeshDB, which
  previously purged ignored nodes that lacked user info.
- The hot-store migration leaves our own node (index 0) in place and prefers to
  demote non-protected nodes, like the runtime eviction scan.

Caps the protected set (favourite + ignored + verified) at MAX_NUM_NODES-2 via
NodeDB::setProtectedFlag(), so at least two evictable slots always remain and
getOrCreateMeshNode can always make room — replacing the previous unconditional
append that could run off the end of the node vector when every node was
protected. A locally-set favourite/ignore that hits the cap reports back to the
phone via a ClientNotification.

Adds test_nodedb_blocked covering the migration, favourite/ignored eviction
protection, ignored-survives-cleanup, and the protected-node cap. The
maintenance methods stay private in production; the test reaches them through a
PIO_UNIT_TESTING-guarded friend shim.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

# Conflicts:
#	src/mesh/NodeDB.h
Zero-initialise `stranded[]` and `seqs[]/order[]` VLAs so cppcheck can
verify there are no unguarded reads of uninitialised memory (the guards
exist but are not visible to static analysis). Mark two local pointers
`const` where the pointed-to entry is never mutated after assignment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
NomDeTom and others added 9 commits June 18, 2026 00:10
Style/cleanup pass over the branch (no behavior change except the noted
preprocessor simplifications, which are semantically identical):

- Comments: move function descriptions to the headers, cap in-function
  comments at ~3-4 lines, drop leading-number step markers, label stacked
  #endif blocks, de-decorate banner comments.
- dumpToLog: fully gate decl + definition + AdminModule call site behind
  MESHTASTIC_NODEDB_MIGRATION_VERBOSE so it compiles out when disabled
  (~1.2 KB when off).
- mesh-pb-constants: drop the dead nRF52832 WARM_NODE_COUNT branch and trim
  the macro docs.
- WarmNodeStore: simplify the redundant `ARCH_NRF52 && NRF52840_XXAA` guards
  to `NRF52840_XXAA`, add a kNoPage sentinel for the ring page state.
- Shorten the always-on LOG_WARN strings (~120 B flash).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: NomDeTom <116762865+NomDeTom@users.noreply.github.com>
…dedb)

- WarmNodeStore.h: default MIGRATION_VERBOSE to 0 (suppress info-level
  chatter on production builds; opt in with =1)
- WarmNodeStore.cpp load(): move memset to top of function so all
  failure paths (header-read fail, invalid header) leave entries clear
- WarmNodeStore.cpp save(): replace manual spiLock lock/unlock around
  mkdir with LockGuard covering the full SafeFile sequence, matching
  the lock discipline in load()
- Router.cpp: memcpy(&p->public_key.bytes, ...) -> memcpy(p->public_key.bytes,
  ...) — pass decayed uint8_t* rather than pointer-to-array
- AdminModule.cpp: check setProtectedFlag return for PKC auto-favorite;
  log cap-refusal warning instead of unconditional "auto-favoriting"
- nrf52_warm_region.py: error message references both v6.ld and v7.ld

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@NomDeTom NomDeTom force-pushed the pr1-nodedb-warmstore branch from fe0bd6d to f57e53e Compare June 17, 2026 23:34
@NomDeTom NomDeTom merged commit 79a7dcc into meshtastic:develop Jun 18, 2026
88 checks passed
@NomDeTom NomDeTom deleted the pr1-nodedb-warmstore branch June 19, 2026 13:05
cvaldess added a commit to cvaldess/firmware that referenced this pull request Jun 20, 2026
…NT=0)

The warmstore (meshtastic#10705) reboots RP2350/W5500 boards via the 8s hardware
watchdog when a full NodeDB (120) save is followed by the extra warm.dat
write. RP2350 has no dedicated branch in the per-platform WARM_NODE_COUNT
selector (src/mesh/mesh-pb-constants.h) so it inherits the generic #else
(320). Disable the warm tier on both W5500 variants via WARM_NODE_COUNT=0
(compiles clean thanks to the new #if WARM_NODE_COUNT > 0 guards).

Validated on-hardware (wiznet_5500_evb_pico2_e22p): DB filled to 120,
the exact eviction-at-full sequence fired, board survived with no
watchdog reboot. See firmware#10746.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@HarukiToreda

HarukiToreda commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

getting hard reboots from this PR on ESP32-S3 nodes with no PSRAM like the Wireless Paper. Crash happens when connected to Bluetooth or attempting to connect. It's chocking heap @NomDeTom

@HarukiToreda

HarukiToreda commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

clanker suggests

  • Reduce WARM_NODE_COUNT for no-PSRAM ESP32-S3 — currently 320, could drop to 100 or 150. Saves 8-8.8KB heap.
  • Reduce TRAFFIC_MANAGEMENT_CACHE_SIZE for no-PSRAM ESP32-S3 — currently 1000, drop to 400-500. Saves 5-6KB heap.
  • Both together — likely enough to prevent the crash. Total savings ~12-15KB.

thebentern pushed a commit that referenced this pull request Jun 22, 2026
…10759)

* fix: right-size warm tier for constrained platforms and feed RP2040 watchdog during NodeDB save

* fix: size warm tier and traffic cache per-MCU RAM, lowering no-PSRAM ESP32 (classic/S2/C3) tiers

* docs: document nRF52/RP2040 #else fall-through in warm tier and TM cache cascades
raghumad pushed a commit to raghumad/mezulla-firmware that referenced this pull request Jun 25, 2026
* NodeDB: 3-tier node store with persistent warm tier (long-tail identity retention)

Introduces a tiered NodeDB so the device retains identity (public key,
last_heard) for far more nodes than fit in the full-record hot store,
without growing heap or the persisted nodes.proto unboundedly.

- Hot store: full NodeInfoLite, MAX_NUM_NODES (120 on nRF52).
- Satellite maps: position/telemetry/environment/status capped at
  MAX_SATELLITE_NODES (40 freshest); eviction via enforceSatelliteCaps /
  evictSatelliteOverCap.
- Warm tier (WarmNodeStore): 40 B {num,last_heard,public_key} records for
  evicted nodes so DMs to/from long-tail nodes keep encrypting/decrypting.
  Persisted to /prefs/warm.dat, or on nRF52840 a dedicated 12 KB raw-flash
  record-ring below LittleFS (3x4 KB pages; see linker scripts + the
  nrf52_warm_region.py post-link guard).

NodeDB::getOrCreateMeshNode now demotes evicted nodes into the warm tier and
re-admits them (restoring key/last_heard). Router PKI decrypt/encode resolve
the peer key via NodeDB::copyPublicKey (hot store, then warm tier).

NodeInfoLite gains snr_q4 (sint32, Q4-encoded dB); the float snr is zeroed on
disk. NodeInfoLite grows 105 -> 112 B; backup 2432 -> 2468 B.

Note: the snr_q4 .proto change still needs to land in the protobufs submodule
(generated header is updated here; submodule pointer left at upstream).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* NodeDB: robust receive + retention for blocked (ignored) nodes

Hardens how ignored/favourite nodes are received over admin and retained,
closing paths where a block could be lost or accidentally cleared.

- Blocking keeps the node's public key (admin set_ignored_node and
  addFromContact no longer zero it / drop the warm-tier key), so a blocked
  peer stays a verifiable identity.
- set_ignored_node creates the node if absent, so a block by node ID sticks
  even for a node we've never heard from (e.g. pushed by a remote admin) with
  no NodeInfo or key.
- Eviction protection (favourite/ignored/manually-verified) now also applies to
  the load-time hot-store migration and is never undone by cleanupMeshDB, which
  previously purged ignored nodes that lacked user info.
- The hot-store migration leaves our own node (index 0) in place and prefers to
  demote non-protected nodes, like the runtime eviction scan.

Caps the protected set (favourite + ignored + verified) at MAX_NUM_NODES-2 via
NodeDB::setProtectedFlag(), so at least two evictable slots always remain and
getOrCreateMeshNode can always make room — replacing the previous unconditional
append that could run off the end of the node vector when every node was
protected. A locally-set favourite/ignore that hits the cap reports back to the
phone via a ClientNotification.

Adds test_nodedb_blocked covering the migration, favourite/ignored eviction
protection, ignored-survives-cleanup, and the protected-node cap. The
maintenance methods stay private in production; the test reaches them through a
PIO_UNIT_TESTING-guarded friend shim.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

# Conflicts:
#	src/mesh/NodeDB.h

* fix copilot comments

* once again

* WarmNodeStore: fix cppcheck warnings (uninitvar, constVariablePointer)

Zero-initialise `stranded[]` and `seqs[]/order[]` VLAs so cppcheck can
verify there are no unguarded reads of uninitialised memory (the guards
exist but are not visible to static analysis). Mark two local pointers
`const` where the pointed-to entry is never mutated after assignment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* self-care added to assist 2.7 and 2.8 nodedb migration

* Tidy warm-store/self-care: comments, guards, log + flash cleanup

Style/cleanup pass over the branch (no behavior change except the noted
preprocessor simplifications, which are semantically identical):

- Comments: move function descriptions to the headers, cap in-function
  comments at ~3-4 lines, drop leading-number step markers, label stacked
  #endif blocks, de-decorate banner comments.
- dumpToLog: fully gate decl + definition + AdminModule call site behind
  MESHTASTIC_NODEDB_MIGRATION_VERBOSE so it compiles out when disabled
  (~1.2 KB when off).
- mesh-pb-constants: drop the dead nRF52832 WARM_NODE_COUNT branch and trim
  the macro docs.
- WarmNodeStore: simplify the redundant `ARCH_NRF52 && NRF52840_XXAA` guards
  to `NRF52840_XXAA`, add a kNoPage sentinel for the ring page state.
- Shorten the always-on LOG_WARN strings (~120 B flash).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* more tidying up, aligning with docs and undoing other-arch regressions

* Update protobufs (meshtastic#19)

Co-authored-by: NomDeTom <116762865+NomDeTom@users.noreply.github.com>

* made the migration pathway cleareer

* address copilot review

* fixed a copilot review on a downstream PR.

* Address Copilot review comments for PR meshtastic#10705 (warmstore/nodedb)

- WarmNodeStore.h: default MIGRATION_VERBOSE to 0 (suppress info-level
  chatter on production builds; opt in with =1)
- WarmNodeStore.cpp load(): move memset to top of function so all
  failure paths (header-read fail, invalid header) leave entries clear
- WarmNodeStore.cpp save(): replace manual spiLock lock/unlock around
  mkdir with LockGuard covering the full SafeFile sequence, matching
  the lock discipline in load()
- Router.cpp: memcpy(&p->public_key.bytes, ...) -> memcpy(p->public_key.bytes,
  ...) — pass decayed uint8_t* rather than pointer-to-array
- AdminModule.cpp: check setProtectedFlag return for PKC auto-favorite;
  log cap-refusal warning instead of unconditional "auto-favoriting"
- nrf52_warm_region.py: error message references both v6.ld and v7.ld

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* NodeDB: formatting cleanup (blank lines after preprocessor blocks)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Lukewarm store

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
raghumad pushed a commit to raghumad/mezulla-firmware that referenced this pull request Jun 25, 2026
…meshtastic#10705) (meshtastic#10759)

* fix: right-size warm tier for constrained platforms and feed RP2040 watchdog during NodeDB save

* fix: size warm tier and traffic cache per-MCU RAM, lowering no-PSRAM ESP32 (classic/S2/C3) tiers

* docs: document nRF52/RP2040 #else fall-through in warm tier and TM cache cascades
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.8 ai-generated Possible AI-generated low-quality content enhancement New feature or request needs-review Needs human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants