mirror of
https://github.com/Colorado-Mesh/meshcore-bot-firmware.git
synced 2026-08-11 16:20:29 +00:00
forge: add patch 10 — widen coordinator delays ~25%
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.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: cj-vana <cj@depth23.online>
|
From: cj-vana <cj@depth23.online>
|
||||||
Date: Fri, 15 May 2026 11:44:21 -0600
|
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 ++
|
.../companion_radio/BotCommandRegistry.cpp | 121 ++
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: cj-vana <cj@depth23.online>
|
From: cj-vana <cj@depth23.online>
|
||||||
Date: Fri, 15 May 2026 19:58:42 -0600
|
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 +-
|
examples/companion_radio/BotCommands.cpp | 2 +-
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: cj-vana <cj@depth23.online>
|
From: cj-vana <cj@depth23.online>
|
||||||
Date: Fri, 15 May 2026 20:09:58 -0600
|
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 +-
|
examples/companion_radio/BotPolicy.cpp | 2 +-
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: cj-vana <cj@depth23.online>
|
From: cj-vana <cj@depth23.online>
|
||||||
Date: Sat, 16 May 2026 04:12:02 +0000
|
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 +-
|
.../companion_radio/BotCommandRegistry.cpp | 25 +-
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: cj-vana <cj@depth23.online>
|
From: cj-vana <cj@depth23.online>
|
||||||
Date: Sat, 16 May 2026 12:38:13 -0600
|
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
|
bounded delays
|
||||||
|
|
||||||
Adds new utility commands (TIME, LORA, ID, NEIGHBORS), neighbor tracking,
|
Adds new utility commands (TIME, LORA, ID, NEIGHBORS), neighbor tracking,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: cj-vana <cj@depth23.online>
|
From: cj-vana <cj@depth23.online>
|
||||||
Date: Sat, 16 May 2026 18:58:28 -0600
|
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
|
contacts auto-overwrite
|
||||||
|
|
||||||
Three coordination/discoverability fixes:
|
Three coordination/discoverability fixes:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: cj-vana <cj@depth23.online>
|
From: cj-vana <cj@depth23.online>
|
||||||
Date: Sat, 16 May 2026 19:33:04 -0600
|
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
|
suppression
|
||||||
|
|
||||||
Adds a 4-hex request token (low 16 bits of the request fingerprint) as a
|
Adds a 4-hex request token (low 16 bits of the request fingerprint) as a
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: cj-vana <cj@depth23.online>
|
From: cj-vana <cj@depth23.online>
|
||||||
Date: Sat, 16 May 2026 19:55:36 -0600
|
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
|
Removes BOT_ADVERT_MARKER / writeBotAdvertName / isBotAdvertName from
|
||||||
FirmwareBot, autoLearnKnownBotAdvert and getAdvertNodeName from MyMesh,
|
FirmwareBot, autoLearnKnownBotAdvert and getAdvertNodeName from MyMesh,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: cj-vana <cj@depth23.online>
|
From: cj-vana <cj@depth23.online>
|
||||||
Date: Sat, 16 May 2026 20:05:19 -0600
|
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:
|
Two changes:
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: cj-vana <cj@depth23.online>
|
||||||
|
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,
|
||||||
@@ -1560,7 +1560,7 @@ static void test_response_coordinator_hop_bias_cap() {
|
|||||||
BotMessage near = make_message("#bot", "!ping");
|
BotMessage near = make_message("#bot", "!ping");
|
||||||
near.path_hash_count = 0;
|
near.path_hash_count = 0;
|
||||||
BotMessage many_hops = near;
|
BotMessage many_hops = near;
|
||||||
many_hops.path_hash_count = 10;
|
many_hops.path_hash_count = 20;
|
||||||
BotFingerprint request = { 0x0123456789ABCDEFULL };
|
BotFingerprint request = { 0x0123456789ABCDEFULL };
|
||||||
uint32_t base_delay = BOT_RESPONSE_DELAY_BASE_MILLIS;
|
uint32_t base_delay = BOT_RESPONSE_DELAY_BASE_MILLIS;
|
||||||
uint32_t jitter = BOT_RESPONSE_DELAY_JITTER_MILLIS;
|
uint32_t jitter = BOT_RESPONSE_DELAY_JITTER_MILLIS;
|
||||||
|
|||||||
2
vendor/MeshCore
vendored
2
vendor/MeshCore
vendored
Submodule vendor/MeshCore updated: eda14782b6...fe5e3004ca
Reference in New Issue
Block a user