Skip to content

Migrate from bincode to rkyv v0.8.14 for memory-mapped serialization#20

Merged
doublegate merged 4 commits intodependabot/cargo/cargo-920260e05efrom
copilot/sub-pr-18
Jan 24, 2026
Merged

Migrate from bincode to rkyv v0.8.14 for memory-mapped serialization#20
doublegate merged 4 commits intodependabot/cargo/cargo-920260e05efrom
copilot/sub-pr-18

Conversation

Copy link
Contributor

Copilot AI commented Jan 24, 2026

Replace deprecated bincode dependency with rkyv v0.8.14 for memory-mapped scan result serialization. The migration addresses both the dependency update requirement and resolves a dead link in the Phase 4 documentation.

Changes

Serialization Migration

  • Dependency: Replace bincode = "1.3" with rkyv = "0.8.14" in workspace and affected crates
  • Type Compatibility: Add ScanResultRkyv wrapper struct to handle types incompatible with rkyv's Archive trait (DateTime<Utc>, Duration):
#[derive(Debug, Clone, Archive, RkyvSerialize, RkyvDeserialize)]
pub struct ScanResultRkyv {
    target_ip: IpAddr,
    port: u16,
    state: PortState,
    response_time_nanos: u128,      // Duration as primitive
    timestamp_nanos: i64,             // DateTime as primitive
    banner: Option<String>,
    // ...
}

impl From<&ScanResult> for ScanResultRkyv { /* ... */ }
impl From<ScanResultRkyv> for ScanResult { /* ... */ }
  • Alignment Handling: Add 8-byte length prefix and copy-to-aligned-buffer for deserialization to satisfy rkyv's 16-byte alignment requirement
  • API: Update mmap_writer.rs to use rkyv::to_bytes() and mmap_reader.rs to use rkyv::from_bytes()

Documentation

  • Remove dead link to findsec.org (HTTP 522) in docs/archive/19-PHASE4-ENHANCEMENTS.md

Trade-offs

  • Performance: Slight overhead from buffer copy during deserialization vs. bincode's direct access
  • Benefit: Zero-copy deserialization capability and active maintenance vs. deprecated bincode

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 24, 2026 22:02
Co-authored-by: doublegate <6858123+doublegate@users.noreply.github.com>
Co-authored-by: doublegate <6858123+doublegate@users.noreply.github.com>
Co-authored-by: doublegate <6858123+doublegate@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 24, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/prtip_core-732d160ed1dd70ab /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/prtip_core-732d160ed1dd70ab /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62-C /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62embed-bitcode=no /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62-C /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62debuginfo=2 /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62-C /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62debug-assertions=on /lib.rs /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62feature=&#34;alloc&#34; -Wl,--as-needed -Wl,-Bstatic /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/libsyn-af45282b5bfd4304.rlib f8fd�� f8fd.0pgm1s1rlgpibp9497gk85943.0limpxy.rcgu.o f8fd.0u0sj8e6yfn3jv48bjplrjq6q.0limpxy.rcgu.o stup/toolchains/stable-x86_64-un/home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/build/mlua-sys-indicatif son c-rendered-ansi,--crate-name -o 53546ebb541105d4--edition=2021 (dns block)
  • nonexistent.invalid.hostname.example
    • Triggering command: /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/prtip_core-732d160ed1dd70ab /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/prtip_core-732d160ed1dd70ab /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62-C /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62embed-bitcode=no /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62-C /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62debuginfo=2 /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62-C /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62debug-assertions=on /lib.rs /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/zerocopy_derive-5ea2ed2e62feature=&#34;alloc&#34; -Wl,--as-needed -Wl,-Bstatic /home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/deps/libsyn-af45282b5bfd4304.rlib f8fd�� f8fd.0pgm1s1rlgpibp9497gk85943.0limpxy.rcgu.o f8fd.0u0sj8e6yfn3jv48bjplrjq6q.0limpxy.rcgu.o stup/toolchains/stable-x86_64-un/home/REDACTED/work/ProRT-IP/ProRT-IP/target/debug/build/mlua-sys-indicatif son c-rendered-ansi,--crate-name -o 53546ebb541105d4--edition=2021 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update cargo group dependency for RSA Migrate from bincode to rkyv v0.8.14 for memory-mapped serialization Jan 24, 2026
Copilot AI requested a review from doublegate January 24, 2026 22:12
Copy link
Owner

@doublegate doublegate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed / Approved - x9 file changes; migration from bincode to rkyv -- DG 1/24

@doublegate doublegate marked this pull request as ready for review January 24, 2026 22:20
Copilot AI review requested due to automatic review settings January 24, 2026 22:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates from the deprecated bincode serialization library to rkyv v0.8.14 for memory-mapped scan result storage. The migration introduces a wrapper type (ScanResultRkyv) to handle types incompatible with rkyv's Archive trait, adds an 8-byte length prefix for alignment, and removes a dead documentation link.

Changes:

  • Replace bincode dependency with rkyv v0.8.14 across workspace and affected crates
  • Add ScanResultRkyv wrapper struct with conversions to/from ScanResult for rkyv compatibility
  • Implement length-prefixed serialization format with alignment handling via buffer copying
  • Remove dead link to findsec.org in Phase 4 documentation

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Cargo.toml Replace bincode workspace dependency with rkyv 0.8.14
Cargo.lock Add rkyv and its dependencies, remove bincode
crates/prtip-core/Cargo.toml Add rkyv dependency to core crate
crates/prtip-core/src/types.rs Add ScanResultRkyv wrapper with Archive derives and conversions
crates/prtip-core/src/lib.rs Export ScanResultRkyv type
crates/prtip-scanner/Cargo.toml Replace bincode with rkyv (alloc feature)
crates/prtip-scanner/src/output/mmap_writer.rs Update serialization to use rkyv with length prefixing
crates/prtip-scanner/src/output/mmap_reader.rs Update deserialization with aligned buffer copying
docs/archive/19-PHASE4-ENHANCEMENTS.md Remove dead findsec.org links

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@doublegate doublegate merged commit 58ef878 into dependabot/cargo/cargo-920260e05e Jan 24, 2026
12 checks passed
@doublegate doublegate deleted the copilot/sub-pr-18 branch January 24, 2026 22:33
@doublegate doublegate restored the copilot/sub-pr-18 branch January 24, 2026 22:43
@doublegate doublegate deleted the copilot/sub-pr-18 branch January 24, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants