radrootsd

JSON-RPC bridge for Radroots event publishing
git clone https://radroots.dev/git/radrootsd.git
Log | Files | Refs | README | LICENSE

commit d9116fd34401367f6d6503859b25a3a7829bda92
parent 41f2754526aeaf5441007c8e6abcc9b807667bb2
Author: triesap <tyson@radroots.org>
Date:   Wed, 15 Jul 2026 02:12:03 +0000

sqlite: align daemon bundled runtime

- update rusqlite to 0.39 on the shared patched SQLite source crate
- patch libsqlite3-sys to the verified SQLite 3.53.3 runtime
- convert publish target counts explicitly for rusqlite storage parameters
- refresh the daemon lockfile against the new runtime dependency floor

Diffstat:
MCargo.lock | 64++++++++++++++++++++++++++++++++++++++++------------------------
MCargo.toml | 5++++-
Msrc/core/transport_publish.rs | 29++++++++++++++++++++++++-----
3 files changed, 68 insertions(+), 30 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -612,6 +612,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] name = "form_urlencoded" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -805,7 +811,7 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "foldhash", + "foldhash 0.1.5", ] [[package]] @@ -813,6 +819,9 @@ name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash 0.2.0", +] [[package]] name = "hashlink" @@ -825,11 +834,11 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.9.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +checksum = "824e001ac4f3012dd16a264bec811403a67ca9deb6c102fc5049b32c4574b35f" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.16.1", ] [[package]] @@ -1281,13 +1290,9 @@ checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" [[package]] name = "libsqlite3-sys" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +version = "0.37.0" dependencies = [ "cc", - "pkg-config", - "vcpkg", ] [[package]] @@ -1639,12 +1644,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "pkg-config" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" - -[[package]] name = "poly1305" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2111,17 +2110,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" [[package]] +name = "rsqlite-vfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c" +dependencies = [ + "hashbrown 0.16.1", + "thiserror 2.0.18", +] + +[[package]] name = "rusqlite" -version = "0.32.1" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e" +checksum = "a0d2b0146dd9661bf67bb107c0bb2a55064d556eeb3fc314151b957f313bcd4e" dependencies = [ "bitflags", "fallible-iterator", "fallible-streaming-iterator", - "hashlink 0.9.1", + "hashlink 0.11.1", "libsqlite3-sys", "smallvec", + "sqlite-wasm-rs", ] [[package]] @@ -2436,6 +2446,18 @@ dependencies = [ ] [[package]] +name = "sqlite-wasm-rs" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3efc0da82635d7e1ced0053bbbfa8c7ab9645d0bf36ceb4f7127bb85315d75" +dependencies = [ + "cc", + "js-sys", + "rsqlite-vfs", + "wasm-bindgen", +] + +[[package]] name = "stable_deref_trait" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2991,12 +3013,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" diff --git a/Cargo.toml b/Cargo.toml @@ -37,7 +37,7 @@ anyhow = { version = "1" } clap = { version = "4", features = ["derive"] } jsonrpsee = { version = "0.26", features = ["server"] } rand = { version = "0.9" } -rusqlite = { version = "0.32", features = ["bundled"] } +rusqlite = { version = "0.39.0", features = ["bundled"] } serde = { version = "1", default-features = false, features = ["derive"] } serde_json = { version = "1", default-features = false } serde_qs = { version = "1.0" } @@ -49,5 +49,8 @@ tracing = { version = "0.1" } uuid = { version = "1.22.0", features = ["v4"] } url = { version = "2.5.8" } +[patch.crates-io] +libsqlite3-sys = { path = "../lib/crates/libsqlite3_sys_3_53_3" } + [dev-dependencies] tempfile = { version = "3" } diff --git a/src/core/transport_publish.rs b/src/core/transport_publish.rs @@ -1188,6 +1188,12 @@ impl TransportPublishStore { let job_id = Uuid::new_v4().to_string(); let now = current_unix_millis(); let request_json = serde_json::to_string(&insert.request)?; + let requested_target_count = storage_count_i64( + insert.request.target_policy.request_target_count(), + "requested_target_count", + )?; + let effective_target_count = + storage_count_i64(insert.effective_target_count, "effective_target_count")?; let mut connection = self .inner .lock() @@ -1225,8 +1231,8 @@ impl TransportPublishStore { insert.event.kind, serde_json::to_string(&insert.request.target_policy)?, serde_json::to_string(&insert.request.delivery_policy)?, - insert.request.target_policy.request_target_count(), - insert.effective_target_count, + requested_target_count, + effective_target_count, request_json, now, now, @@ -1368,7 +1374,7 @@ impl TransportPublishStore { last_error: Option<String>, ) -> Result<(), TransportPublishError> { let now = current_unix_millis(); - let target_count = outcomes.len(); + let target_count = storage_count_i64(outcomes.len(), "effective_target_count")?; let connection = self .inner .lock() @@ -2068,6 +2074,7 @@ fn recover_interrupted_publish_jobs(connection: &Connection) -> Result<(), Trans continue; } let status = delivery_status(&row.view.delivery_policy, snapshots.len(), &snapshots); + let effective_target_count = storage_count_i64(snapshots.len(), "effective_target_count")?; let last_error = if status == TransportPublishJobStatus::DeliveryUnsatisfiedRetryable { Some("publish_attempt_interrupted".to_owned()) } else { @@ -2089,7 +2096,7 @@ fn recover_interrupted_publish_jobs(connection: &Connection) -> Result<(), Trans now, now, last_error, - snapshots.len(), + effective_target_count, ], )?; replace_target_outcomes(connection, job_id.as_str(), &snapshots, now)?; @@ -3059,6 +3066,14 @@ fn checked_usize_column( }) } +fn storage_count_i64(value: usize, field: &'static str) -> Result<i64, TransportPublishError> { + i64::try_from(value).map_err(|_| { + TransportPublishError::InvalidPublishJobState(format!( + "{field} value exceeds i64 storage range" + )) + }) +} + fn checked_optional_u64_column( row: &Row<'_>, index: usize, @@ -4333,7 +4348,11 @@ mod tests { 30_402_i64, serde_json::to_string(&request.target_policy).expect("target policy"), serde_json::to_string(&request.delivery_policy).expect("delivery policy"), - request.target_policy.request_target_count(), + super::storage_count_i64( + request.target_policy.request_target_count(), + "requested_target_count", + ) + .expect("requested target count"), 1_i64, serde_json::to_string(&request).expect("request"), now,