Add configurable event mode hop limit - #11275
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughEvent mode gains validated configurable hop limits, applies them to default configuration, routing responses, rebroadcasts, and opaque relays, and adds unit coverage for response and relay hop-field behavior. ChangesEvent-mode hop limits
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant NextHopRouter
participant capEventRelayHops
participant MockRadioInterface
NextHopRouter->>capEventRelayHops: cap relay hop fields
capEventRelayHops-->>NextHopRouter: return adjusted packet
NextHopRouter->>MockRadioInterface: send adjusted packet
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⚡ Try this PR in the Web FlasherWarning This is an automated, unreviewed CI test build. Back up your device configuration Supported boards built by this PR (31)
Build artifacts expire on 2026-08-28. Updated for |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/mesh/Default.cpp`:
- Line 95: Update the limit comparison in the relevant Default hop-limit
calculation to use >= so configured == eventModeHopLimit returns the event cap,
including when configured is 0. Add a test that passes
Default::eventModeHopLimit with config.lora.hop_limit set to HOP_MAX and
verifies the capped result.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6f8c7b69-7eec-4f0c-87db-a1dd2b5f6c1f
📒 Files selected for processing (6)
src/mesh/Default.cppsrc/mesh/Default.hsrc/mesh/NextHopRouter.cppsrc/mesh/NodeDB.cpptest/test_default/test_main.cpptest/test_nexthop_routing/test_main.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
- src/mesh/NodeDB.cpp
0fef83d
Summary
USERPREFS_EVENT_MODE_HOP_LIMITas the event profile's baked default hop count and firmware-generated/relay cap.0through7, preserve the existing default of3when omitted, and reject invalid values at compile time.Defaultowner plus one local relay helper; no separate event-mode abstraction is added.hop_startadjustments consistent and safe for legacy packets wherehop_start == 0.Why
Event mode previously hard-coded a default hop count of three in multiple routing paths. Event builds need to choose that baked default without patching firmware sources, while retaining the current behavior when the preference is not set.
Validation
trunk fmt— clean across all 8 changed files.~/.platformio/penv/bin/python -m platformio test -e native-macos— 792/792 tests passed across 39 suites.0,5, and7, covering firmware responses, decoded and opaque relays, legacyhop_start, and explicit client overrides.8and7.5failed compilation through the intendedstatic_assert.~/.platformio/penv/bin/pio run -e heltec-v3— succeeded withUSERPREFS_EVENT_MODE=1andUSERPREFS_EVENT_MODE_HOP_LIMIT=5.Attestations
Summary by CodeRabbit