Skip to content

Commit 908d921

Browse files
author
Drew Robinson
committed
Replace unmaintained bincode with postcard serialization
bincode has been marked as unmaintained (RUSTSEC-2025-0141). This commit replaces it with postcard, which: - Has an API compatible with bincode (serialize/deserialize) - Is actively maintained by James Munns with 114+ libraries - Offers comparable performance and better binary size - Is well-suited for the RPC parameter passing use case Changes: - Update Cargo.toml files: bincode -> postcard with use-std feature - Replace bincode::serialize with postcard::to_stdvec - Replace bincode::deserialize with postcard::from_bytes - Update error type conversions from bincode::Error to postcard::Error - Rename internal types (BincodeValue -> PostcardValue) for clarity All tests pass except for unrelated bottomless integration test.
1 parent b5dab26 commit 908d921

File tree

9 files changed

+142
-47
lines changed

9 files changed

+142
-47
lines changed

Cargo.lock

Lines changed: 117 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libsql-replication/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cbc = "0.1.2"
2929

3030
[dev-dependencies]
3131
arbitrary = { version = "1.3.0", features = ["derive_arbitrary"] }
32-
bincode = "1.3.3"
32+
postcard = { version = "1", features = ["use-std"] }
3333
tempfile = "3.8.0"
3434
prost-build = "0.12"
3535
tonic-build = "0.11"

libsql-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async-trait = "0.1.58"
1818
axum = { version = "0.6.18", features = ["headers"] }
1919
axum-extra = { version = "0.7", features = ["json-lines", "query"] }
2020
base64 = "0.21.0"
21-
bincode = "1.3.3"
21+
postcard = { version = "1", features = ["use-std"] }
2222
bottomless = { version = "0", path = "../bottomless", features = ["libsql_linked_statically"] }
2323
bytes = { version = "1.2.1", features = ["serde"] }
2424
bytesize = { version = "1.2.0", features = ["serde"] }

libsql-server/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ impl From<tokio::sync::oneshot::error::RecvError> for Error {
244244
}
245245
}
246246

247-
impl From<bincode::Error> for Error {
248-
fn from(other: bincode::Error) -> Self {
247+
impl From<postcard::Error> for Error {
248+
fn from(other: postcard::Error) -> Self {
249249
Self::Internal(other.to_string())
250250
}
251251
}

0 commit comments

Comments
 (0)