`fairness advert <hours>|clear`: each origin's flood advert is forwarded at
most once per window (0 = off, max 720 h), keyed on the first 4 B of its
pubkey in a 256-entry ring (2 KB RAM). Ported from DutchMeshCore's
AdvertLimiter (d26421b0); runs ahead of the advert bucket, so a held advert
takes no token. Motivation: companion CP1 floods an advert every 60 s since
30. 10. 2026 and still made up 18 % of the adverts our masts forwarded --
the 7-bit advert bucket cannot single it out without hurting the ~8 nodes
that share its bucket.
`fairness dryrun on|off`: window and buckets count every verdict but
forward anyway. `fairness air`: estimated airtime shed per reason. The
bucket kill switch (`fairness off`) no longer disables the window. Both new
settings persist (fair_advh, fair_dry).
Bench 1. 11. 2026 (x3 DUT, x1 spammer + witness, 866.5/SF8, advert every
30 s, echoes counted on the witness): dry-run 6/6 forwarded with 5 counted
as held, enforced 1/6, window off 3/3, buckets in dry-run 5/5 with 3
counted; settings survive a reboot. Native tests 26/26 fairness, 119 total.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in the RadioLibWrapper constructor: our txpow fields + upstream's
n_recv_errors init, both kept. Builds Xiao_nrf52_sensor and
SenseCap_Solar_repeater_ble, native tests 109/109.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SX126x::getStatus() asks SPIreadStream for zero data bytes, so the status
never reaches the caller and radiostat showed mode=0 on a receiving chip.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bench-sensor stopped receiving on 31. 10. 2026 (recv frozen for minutes,
noise_floor -120, last_rssi 0, nothing in the debug log); a reboot revived it.
Before fixing anything, find out WHERE it is stuck:
radiostat wrapper state, DIO1 ISR count/age, last good RX age, plus the
SX1262 side: chip mode, cmd status, IRQ register, device errors,
instantaneous RSSI, DIO1/RXEN pin levels, boosted gain. Read only.
radiokick one recovery step at a time (rx | clrirq | standby | agc); the
first one that brings recv back names the broken layer.
Compiled only with -D RADIO_DIAG; the sensor example wires the commands in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shfmt over tools/ and .claude/hooks/ (layout only: `shfmt -mn` output is
identical before and after). flash_node.sh: `cd "$ROOT" || die`, and the
three `ls /dev/serial/by-id | grep "$TARGET"` keep their regex semantics
under a commented SC2010 exemption instead of a glob rewrite in the
flasher. mypy: budka_telem's `# type:` comment was parsed as a type
comment, mesh_sniffer's Counter got an annotation, build_version (SCons)
exempts the SCons builtins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Layout and naming only: split import lists and `a; b` one-liners, drop
an unused `subprocess` import (board_probe) and a placeholder-less
f-string (openhop_observer_config), rename `l` to `ln` (E741).
build_version.py is a SCons script whose `Import`/`env` are SCons
builtins and must come first, so it gets a commented file-wide noqa
instead of a rewrite. ASTs unchanged apart from those edits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in CustomSX1262Wrapper.h was whitespace only: upstream added
lastRxHadCRC() next to isReceivingPacket(), whose trailing space we had
stripped. Kept both; our LORA_POLL_IRQ irqDoneMask() is untouched.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in examples/companion_radio/ui-new/UITask.cpp: upstream replaced
UI_SHOW_CLOCK with the runtime pref ui_show_clock; kept that and our
BLE pin condition (shown only while Bluetooth is enabled).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
'sensor list' appended 'name=value' lines into the 160-byte CLI reply with
unbounded sprintf, only checking the position before each write (< 134).
A single long value (or several medium ones) could write past the end of
the buffer.
Write each entry with snprintf against the remaining space, keep room for
the '... next:N' paging hint, and move entries that do not fit to the next
page. Also guard against NULL names/values from a sensor manager.
Upstream test_empty_contact_slots #includes helpers/AdvertDataHelpers.cpp
itself, while our native envs also compiled it via build_src_filter, so the
native test binary failed to link (multiple definition) and upstream-sync
stopped pushing since 2026-10-27. Drop it from the filter and include it in
test_battery_icon the same way upstream tests do.
native_asan skips test_empty_contact_slots: it is the first test to run
ed25519 on the host and UBSan stops on the ref10 left-shift idiom in
lib/ed25519/fe.c, not on our code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ESP32Board.h defined _rtc_backup_time and _rtc_backup_magic as static in the
header, so every translation unit that includes it has its own copy, and the
inline members of ESP32RTCClock read and write the copy of the unit they are
compiled in. Today one unit per image uses them; a second one could restore a
copy that setCurrentTime() never wrote. The header now declares them, and
ESP32Board.cpp defines them once.