chore(kerykeion): scratch RED-verification for load_from_bytes fixture (temporary, will close) - #385
Closed
forkwright wants to merge 6 commits into
Closed
chore(kerykeion): scratch RED-verification for load_from_bytes fixture (temporary, will close)#385forkwright wants to merge 6 commits into
forkwright wants to merge 6 commits into
Conversation
added 6 commits
August 16, 2026 22:20
…208) Adds tests for a monotonic outbound packet-id counter (#209), live node/topology cardinality bounds (#204), and non-fail-open routing error classification (#208), plus the new PacketIdCounter and RoutingResult::UnknownError types the fixes need. Enforcement itself (cap+eviction in NodeDb::insert/MeshTopology::add_node/update_link, and the fail-open fix in RoutingProcessor::process_routing) lands in the next commit -- this commit's new assertions fail against the current, unmodified logic, demonstrating each defect is live before the fix.
…n routing codes as ACKs Salvaged from a crashed session: this work was uncommitted on disk when the orchestrating machine died mid-wave. It has had no gate and no review. #204 -- the node table and topology graph were unbounded, and the `from` field on an inbound frame is unauthenticated, so an over-the-air peer could announce unlimited distinct identities and exhaust memory. Both are now capped, with least-recently-heard eviction, and update_link is protected from evicting the two endpoints it is in the middle of adding. #208 -- an unrecognised routing error code fell back to Error::None, which the caller reads as delivered. That is fail-open: an unknown code meant success. Unknown now means not-delivered. #209 (AES-CTR nonce reuse) is NOT addressed here. Its code lives in crypto.rs and packet_id.rs, neither of which this change touches; the session ended before that unit ran. The issue stays open.
…iction Sibling to update_link_never_evicts_its_own_two_new_endpoints (#204). load_from_bytes's link-restore loop calls plain add_node for both of a link's endpoints instead of add_node_protecting, so the second call can evict the node the first one just inserted before their edge exists, leaving a dangling NodeIndex. This assertion fails against the current, unmodified load_from_bytes -- the fix lands in the next commit.
rustc ignores an outer attribute placed directly on a macro-call statement (here, assert_eq!) rather than on the let binding above it -- the built-in-attribute note names this explicitly -- so the #[expect] was dead and -D warnings (from -D unused-attributes) failed the whole lib-test compile of kerykeion, taking every test in the crate down with it, including the ones this PR's own #204/#208/#209 fixes depend on. Bind the unwrap to a name first, matching the working pattern already used one test up in this same file.
Neither is related to #204/#208/#209 -- both predate this PR's fixes and were never caught locally (the PR's own commits admit no gate, no review, no local build). - node_db.rs evict_stalest: map(f).unwrap_or(a) on an Option triggers clippy::map_unwrap_or under -D warnings; use map_or(a, f) instead, same value. - packet_id.rs: PacketIdCounter::next(&mut self) -> Result<u32, Error> triggers clippy::should_implement_trait -- the name collides with Iterator::next, which returns Option, not Result, and PacketIdCounter implements no such trait. Renamed to next_id across its one call site in MessageBuilder::build and its own tests; no behavior change.
Owner
Author
|
Verification complete -- RED confirmed (topology::tests::load_from_bytes_never_evicts_its_own_two_new_endpoints panicked at topology_tests.rs:514 against the pre-fix code, run https://github.com/forkwright/akroasis/actions/runs/32044433789) and GREEN confirmed on PR #384's branch (1085/1085 passed, run https://github.com/forkwright/akroasis/actions/runs/32043867713). Closing this scratch PR; not for merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Temporary verification PR only -- confirms load_from_bytes_never_evicts_its_own_two_new_endpoints panics against the pre-fix load_from_bytes. Not for merge. Will be closed once CI reports the panic. See PR #384.