From 0010842ac20691d8008a7c3daf788e239e8f76c2 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Sat, 16 May 2026 20:31:20 -0600 Subject: [PATCH] =?UTF-8?q?forge:=20add=20patch=2010=20=E2=80=94=20widen?= =?UTF-8?q?=20coordinator=20delays=20~25%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps base/jitter/hop_step/cap/TTL ~25% for more reliable token suppression at the multi-hop edge. Bumps BOT_PREFS_VERSION 4 -> 5 to force re-default of hop_step_ms on existing bots. Test bumped many_hops.path_hash_count 10 -> 20 so the cap-check still trips with the new 15000ms cap. --- ...on-radio-firmware-bot-command-parity.patch | 2 +- ...n-firmware-bot-response-coordination.patch | 2 +- ...03-Allow-prefixless-firmware-bot-DMs.patch | 2 +- ...-bot-commands-with-upstream-behavior.patch | 2 +- ...t-coordination-utility-commands-and-.patch | 2 +- ...-speed-up-initial-advert-default-con.patch | 2 +- ...nses-with-request-token-for-inter-bo.patch | 2 +- ...t-suffix-and-auto-learn-known-bot-pa.patch | 3 +- ...p-drop-ack-prefix-from-test-response.patch | 2 +- ...n-coordinator-delays-a-tiny-bit-more.patch | 60 +++++++++++++++++++ tests/firmware_bot/test_firmware_bot.cpp | 2 +- vendor/MeshCore | 2 +- 12 files changed, 72 insertions(+), 11 deletions(-) create mode 100644 patches/meshcore/0010-Widen-coordinator-delays-a-tiny-bit-more.patch diff --git a/patches/meshcore/0001-Add-companion-radio-firmware-bot-command-parity.patch b/patches/meshcore/0001-Add-companion-radio-firmware-bot-command-parity.patch index d2789af..ff37efa 100644 --- a/patches/meshcore/0001-Add-companion-radio-firmware-bot-command-parity.patch +++ b/patches/meshcore/0001-Add-companion-radio-firmware-bot-command-parity.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Fri, 15 May 2026 11:44:21 -0600 -Subject: [PATCH 1/9] Add companion radio firmware bot command parity +Subject: [PATCH 01/10] Add companion radio firmware bot command parity --- .../companion_radio/BotCommandRegistry.cpp | 121 ++ diff --git a/patches/meshcore/0002-Harden-firmware-bot-response-coordination.patch b/patches/meshcore/0002-Harden-firmware-bot-response-coordination.patch index aa143fd..f62940a 100644 --- a/patches/meshcore/0002-Harden-firmware-bot-response-coordination.patch +++ b/patches/meshcore/0002-Harden-firmware-bot-response-coordination.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Fri, 15 May 2026 19:58:42 -0600 -Subject: [PATCH 2/9] Harden firmware bot response coordination +Subject: [PATCH 02/10] Harden firmware bot response coordination --- examples/companion_radio/BotCommands.cpp | 2 +- diff --git a/patches/meshcore/0003-Allow-prefixless-firmware-bot-DMs.patch b/patches/meshcore/0003-Allow-prefixless-firmware-bot-DMs.patch index 4f779d6..ed4b3b6 100644 --- a/patches/meshcore/0003-Allow-prefixless-firmware-bot-DMs.patch +++ b/patches/meshcore/0003-Allow-prefixless-firmware-bot-DMs.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Fri, 15 May 2026 20:09:58 -0600 -Subject: [PATCH 3/9] Allow prefixless firmware bot DMs +Subject: [PATCH 03/10] Allow prefixless firmware bot DMs --- examples/companion_radio/BotPolicy.cpp | 2 +- diff --git a/patches/meshcore/0004-Align-firmware-bot-commands-with-upstream-behavior.patch b/patches/meshcore/0004-Align-firmware-bot-commands-with-upstream-behavior.patch index 4282505..30e0889 100644 --- a/patches/meshcore/0004-Align-firmware-bot-commands-with-upstream-behavior.patch +++ b/patches/meshcore/0004-Align-firmware-bot-commands-with-upstream-behavior.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Sat, 16 May 2026 04:12:02 +0000 -Subject: [PATCH 4/9] Align firmware bot commands with upstream behavior +Subject: [PATCH 04/10] Align firmware bot commands with upstream behavior --- .../companion_radio/BotCommandRegistry.cpp | 25 +- diff --git a/patches/meshcore/0005-Add-hop-aware-bot-coordination-utility-commands-and-.patch b/patches/meshcore/0005-Add-hop-aware-bot-coordination-utility-commands-and-.patch index 842ca92..4c6e6e8 100644 --- a/patches/meshcore/0005-Add-hop-aware-bot-coordination-utility-commands-and-.patch +++ b/patches/meshcore/0005-Add-hop-aware-bot-coordination-utility-commands-and-.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Sat, 16 May 2026 12:38:13 -0600 -Subject: [PATCH 5/9] Add hop-aware bot coordination, utility commands, and +Subject: [PATCH 05/10] Add hop-aware bot coordination, utility commands, and bounded delays Adds new utility commands (TIME, LORA, ID, NEIGHBORS), neighbor tracking, diff --git a/patches/meshcore/0006-Mark-bot-adverts-speed-up-initial-advert-default-con.patch b/patches/meshcore/0006-Mark-bot-adverts-speed-up-initial-advert-default-con.patch index 45d74f8..3683f8b 100644 --- a/patches/meshcore/0006-Mark-bot-adverts-speed-up-initial-advert-default-con.patch +++ b/patches/meshcore/0006-Mark-bot-adverts-speed-up-initial-advert-default-con.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Sat, 16 May 2026 18:58:28 -0600 -Subject: [PATCH 6/9] Mark bot adverts, speed up initial advert, default +Subject: [PATCH 06/10] Mark bot adverts, speed up initial advert, default contacts auto-overwrite Three coordination/discoverability fixes: diff --git a/patches/meshcore/0007-Prefix-bot-responses-with-request-token-for-inter-bo.patch b/patches/meshcore/0007-Prefix-bot-responses-with-request-token-for-inter-bo.patch index 1d29e2d..e5b55e1 100644 --- a/patches/meshcore/0007-Prefix-bot-responses-with-request-token-for-inter-bo.patch +++ b/patches/meshcore/0007-Prefix-bot-responses-with-request-token-for-inter-bo.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Sat, 16 May 2026 19:33:04 -0600 -Subject: [PATCH 7/9] Prefix bot responses with request token for inter-bot +Subject: [PATCH 07/10] Prefix bot responses with request token for inter-bot suppression Adds a 4-hex request token (low 16 bits of the request fingerprint) as a diff --git a/patches/meshcore/0008-Drop-MCBOT-advert-suffix-and-auto-learn-known-bot-pa.patch b/patches/meshcore/0008-Drop-MCBOT-advert-suffix-and-auto-learn-known-bot-pa.patch index c61965a..bcdd4ae 100644 --- a/patches/meshcore/0008-Drop-MCBOT-advert-suffix-and-auto-learn-known-bot-pa.patch +++ b/patches/meshcore/0008-Drop-MCBOT-advert-suffix-and-auto-learn-known-bot-pa.patch @@ -1,7 +1,8 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Sat, 16 May 2026 19:55:36 -0600 -Subject: [PATCH 8/9] Drop [MCBOT] advert suffix and auto-learn known-bot path +Subject: [PATCH 08/10] Drop [MCBOT] advert suffix and auto-learn known-bot + path Removes BOT_ADVERT_MARKER / writeBotAdvertName / isBotAdvertName from FirmwareBot, autoLearnKnownBotAdvert and getAdvertNodeName from MyMesh, diff --git a/patches/meshcore/0009-Widen-hop-step-drop-ack-prefix-from-test-response.patch b/patches/meshcore/0009-Widen-hop-step-drop-ack-prefix-from-test-response.patch index de24b08..af017d1 100644 --- a/patches/meshcore/0009-Widen-hop-step-drop-ack-prefix-from-test-response.patch +++ b/patches/meshcore/0009-Widen-hop-step-drop-ack-prefix-from-test-response.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Sat, 16 May 2026 20:05:19 -0600 -Subject: [PATCH 9/9] Widen hop-step + drop "ack " prefix from test response +Subject: [PATCH 09/10] Widen hop-step + drop "ack " prefix from test response Two changes: diff --git a/patches/meshcore/0010-Widen-coordinator-delays-a-tiny-bit-more.patch b/patches/meshcore/0010-Widen-coordinator-delays-a-tiny-bit-more.patch new file mode 100644 index 0000000..43a2e7c --- /dev/null +++ b/patches/meshcore/0010-Widen-coordinator-delays-a-tiny-bit-more.patch @@ -0,0 +1,60 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: cj-vana +Date: Sat, 16 May 2026 20:31:12 -0600 +Subject: [PATCH 10/10] Widen coordinator delays a tiny bit more + +~25% bump across the main coordination knobs: +- BOT_RESPONSE_DELAY_BASE_MILLIS 1200 -> 1500 +- BOT_RESPONSE_DELAY_JITTER_MILLIS 1800 -> 2200 +- BOT_HOP_STEP_MILLIS_DEFAULT 2500 -> 3000 +- BOT_HOP_BIAS_MAX_MILLIS 12000 -> 15000 +- BOT_RESPONSE_PENDING_TTL_MILLIS 60000 -> 75000 + +BOT_PREFS_VERSION bumped 4 -> 5 so existing bots re-derive the new +hop_step_ms default instead of carrying the old value. + +Gives near and far bots more breathing room so far bots reliably hear +near bots' acks before firing their own (token suppression). Worst-case +6-hop scheduled delay rises from ~17.6s to ~22.5s, still well under the +new 75s TTL. +--- + examples/companion_radio/BotTypes.h | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/examples/companion_radio/BotTypes.h b/examples/companion_radio/BotTypes.h +index 5a953639..ee3f8984 100644 +--- a/examples/companion_radio/BotTypes.h ++++ b/examples/companion_radio/BotTypes.h +@@ -28,16 +28,16 @@ + #define BOT_KNOWN_BOT_SLOTS 8 + #define BOT_NEIGHBOR_SLOTS 16 + #define BOT_NEIGHBOR_RECENT_MILLIS (60UL * 60UL * 1000UL) +-#define BOT_RESPONSE_DELAY_BASE_MILLIS 1200UL +-#define BOT_RESPONSE_DELAY_JITTER_MILLIS 1800UL +-#define BOT_RESPONSE_PENDING_TTL_MILLIS 60000UL ++#define BOT_RESPONSE_DELAY_BASE_MILLIS 1500UL ++#define BOT_RESPONSE_DELAY_JITTER_MILLIS 2200UL ++#define BOT_RESPONSE_PENDING_TTL_MILLIS 75000UL + #define BOT_RESPONSE_RECENT_TTL_MILLIS 30000UL + #define BOT_KNOWN_BOT_FLAG_SUPPRESS_NORMAL 0x01 + #define BOT_SENDER_KEY_PREFIX_LEN 6 + #define BOT_MIN_AUTH_SENDER_KEY_PREFIX_LEN 4 + #define BOT_KNOWN_BOT_LABEL_LEN 12 + #define BOT_PREFS_MAGIC 0x31504642UL +-#define BOT_PREFS_VERSION 4 ++#define BOT_PREFS_VERSION 5 + #define BOT_PREFS_DEFAULT_LOCAL_ADVERT_MILLIS (24UL * 60UL * 60UL * 1000UL) + #define BOT_PREFS_DEFAULT_FLOOD_ADVERT_MILLIS (24UL * 60UL * 60UL * 1000UL) + #define BOT_PREFS_INITIAL_LOCAL_ADVERT_MILLIS 60000UL +@@ -45,9 +45,9 @@ + #define BOT_PREFS_MAX_DELAY_MILLIS 60000U + #define BOT_PREFS_MAX_ADVERT_MILLIS (7UL * 24UL * 60UL * 60UL * 1000UL) + #define BOT_PREFS_SERIALIZED_SIZE 296 +-#define BOT_HOP_STEP_MILLIS_DEFAULT 2500U ++#define BOT_HOP_STEP_MILLIS_DEFAULT 3000U + #define BOT_HOP_STEP_MILLIS_MAX 30000U +-#define BOT_HOP_BIAS_MAX_MILLIS 12000UL ++#define BOT_HOP_BIAS_MAX_MILLIS 15000UL + + enum BotChannelKind : uint8_t { + BOT_CHANNEL_DM = 0, diff --git a/tests/firmware_bot/test_firmware_bot.cpp b/tests/firmware_bot/test_firmware_bot.cpp index 053cd39..2d59b76 100644 --- a/tests/firmware_bot/test_firmware_bot.cpp +++ b/tests/firmware_bot/test_firmware_bot.cpp @@ -1560,7 +1560,7 @@ static void test_response_coordinator_hop_bias_cap() { BotMessage near = make_message("#bot", "!ping"); near.path_hash_count = 0; BotMessage many_hops = near; - many_hops.path_hash_count = 10; + many_hops.path_hash_count = 20; BotFingerprint request = { 0x0123456789ABCDEFULL }; uint32_t base_delay = BOT_RESPONSE_DELAY_BASE_MILLIS; uint32_t jitter = BOT_RESPONSE_DELAY_JITTER_MILLIS; diff --git a/vendor/MeshCore b/vendor/MeshCore index eda1478..fe5e300 160000 --- a/vendor/MeshCore +++ b/vendor/MeshCore @@ -1 +1 @@ -Subproject commit eda14782b6decea23048f1a3228a555be2614106 +Subproject commit fe5e3004caefd6d4e9f2b67dc4b81d07a8ff5295