Repository navigation
refactor(engine): replace bincode IPC codec with postcard (RUSTSEC-2025-0141) - #406
Conversation
bincode is unmaintained (RUSTSEC-2025-0141) and was carried in deny.toml's ignore list. The dependency existed only for the engine-worker wire format, which is entirely internal — both ends ship from the same workspace, so there is no format compatibility to keep. - ttymap-engine: bincode 2 -> postcard 1.1 (default-features off, use-std; pulls only cobs) - write_message / read_message swap encode_to_vec / decode_from_slice for to_stdvec / from_bytes; the u32-LE length prefix and the 16 MB cap are unchanged - drop the RUSTSEC-2025-0141 ignore from deny.toml - ipc_handshake now drives Init -> Ready -> Draw -> FrameReady -> Shutdown, so a real MapFrame crosses the wire in the test rather than only Config / ThemeId in one direction - correct the FrameReady size note: 240x80 measures ~115 KB encoded, not the ~430 KB the comment claimed Closes #395 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GFGFsYeFLqRaWUAzXonwd3
There was a problem hiding this comment.
This PR successfully addresses RUSTSEC-2025-0141 by replacing the unmaintained bincode codec with postcard for internal IPC. The implementation is clean and well-tested. The codec swap is straightforward (bincode's encode_to_vec/decode_from_slice → postcard's to_stdvec/from_bytes), the wire format contract is preserved (u32-LE length prefix, 16 MB cap, UnexpectedEof-on-close), and the enhanced test now verifies that large MapFrame payloads survive the round trip. Documentation and deny.toml have been updated accordingly. No blocking issues identified.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
Closes #395.
bincodeis unmaintained (RUSTSEC-2025-0141) and was sitting indeny.toml's ignore list. It existed solely for theengine-workerwire format, which is internal — parent and child are the same binary, so there is no format compatibility to preserve and the swap is free.ttymap-engine:bincode 2→postcard 1.1(default-features = false,use-std) — adds onlycobsto the tree, noheapless.write_message/read_messageswapencode_to_vec/decode_from_sliceforto_stdvec/from_bytes. The u32-LE length prefix, the 16 MB cap and theUnexpectedEof-on-peer-close contract are untouched.RUSTSEC-2025-0141ignore fromdeny.toml(thelruone stays — see RUSTSEC-2026-0253: Potential use-after-free due to lack of panic safety inLruCache::pop()#402).ipc_handshakenow drives Init → Ready → Draw → FrameReady → Shutdown. Previously noMapFrameever crossed the wire in a test, so the large child→parent payload — the one at real risk from a codec swap — was unverified.FrameReadysize note: a 240×80 frame measures ~115 KB encoded, not the ~430 KB the comment claimed.CLAUDE.md,docs/architecture.mdand the three "bincode-framed" doc comments.Verification
cargo clippy --all-targets -- -D warningsclean,cargo fmt --checkclean.cargo test: full workspace green, including the extendedipc_handshake(2 passed) that now asserts frame dims and centre survive the round trip../target/release/ttymap --lat 35.68 --lon 139.76 --zoom 8on a 160×50 pty for 20 s and counted what it painted — 6481 Braille cells, 6226 of them non-blank. Real tile geometry is arriving over the postcard pipe and rendering.🤖 Generated with Claude Code
https://claude.ai/code/session_01GFGFsYeFLqRaWUAzXonwd3