lightweight com.atproto.sync.listReposByCollection
45
fork

Configure Feed

Select the types of activity you want to include in your feed.

wip: jacquard dep hell

phil d2eea4ce 7ea5ead9

+7 -40
+1 -1
Cargo.toml
··· 20 20 jacquard-derive = "0.9.5" 21 21 jacquard-identity = "0.9.5" 22 22 jacquard-lexicon = "0.9.5" 23 - jacquard-repo = "0.9.6" 23 + jacquard-repo = { git = "https://tangled.org/nonbinary.computer/jacquard", rev = "f2f45e460bfce6dfa4319f29d1cfc19011cd3c50" } 24 24 metrics = "0.24.3" 25 25 metrics-exporter-prometheus = { version = "0.18.1", features = ["http-listener"] } 26 26 mini-moka = "0.10"
+4
src/mst/mortality.rs
··· 23 23 use jacquard_common::types::string::Nsid; 24 24 use repo_stream::{DriverBuilder, JacquardLoadError, WalkError}; 25 25 26 + use super::Span; 27 + 26 28 #[derive(Debug, thiserror::Error)] 27 29 pub enum MstMortalityError { 28 30 #[error("failed to load CAR: {0}")] ··· 32 34 } 33 35 34 36 type Result<T> = std::result::Result<T, MstMortalityError>; 37 + 38 + type KeySpan = Span<String>; 35 39 36 40 /// Collect every MST leaf path visible in a (possibly partial) CAR. 37 41 ///
+2 -39
src/sync/firehose/commit_event.rs
··· 18 18 19 19 use jacquard_api::com_atproto::sync::subscribe_repos::Commit; 20 20 use jacquard_common::types::{string::Did, string::Nsid, tid::Tid}; 21 - use jacquard_repo::commit::firehose::{FirehoseCommit, RepoOp as FirehoseRepoOp}; 21 + use jacquard_repo::commit::firehose::validate_v1_1; 22 22 use tracing::{debug, error, info, trace, warn}; 23 23 24 24 use super::validate::{self, CarDrop}; ··· 149 149 150 150 // ── Step 5: Inductive proof ─────────────────────────────────────────────── 151 151 if pds_mode == Sync11Mode::Strict 152 - && let Err(e) = to_firehose_commit(&commit) 153 - .validate_v1_1(&resolved.pubkey) 154 - .await 152 + && let Err(e) = validate_v1_1(&commit, &resolved.pubkey).await 155 153 { 156 154 metrics::counter!("lightrail_commit_dropped_total", "reason" => "proof_failed") 157 155 .increment(1); ··· 248 246 metrics::histogram!("lightrail_commit_car_bytes").record(commit.blocks.len() as f64); 249 247 let mst_root_cid = repo_commit.data; 250 248 Ok((mst_root_cid.to_bytes(), parsed)) 251 - } 252 - 253 - // --------------------------------------------------------------------------- 254 - // Step 5: Inductive proof (async, MST mutations) 255 - // --------------------------------------------------------------------------- 256 - 257 - fn to_firehose_commit<'a>(commit: &Commit<'a>) -> FirehoseCommit<'a> { 258 - FirehoseCommit { 259 - repo: commit.repo.clone(), 260 - rev: commit.rev.clone(), 261 - seq: commit.seq, 262 - since: commit.since.clone().unwrap_or_else(|| { 263 - trace!("putting in a phony TID for FirehoseCommit (None on Commit)"); 264 - Tid::now_0() 265 - }), 266 - time: commit.time.clone(), 267 - commit: commit.commit.clone(), 268 - blocks: commit.blocks.clone(), 269 - // HACK: reverse op order for inductive proof -- when upgrading jacquard this is fixed 270 - ops: commit 271 - .ops 272 - .iter() 273 - .rev() 274 - .map(|op| FirehoseRepoOp { 275 - action: op.action.clone(), 276 - cid: op.cid.clone(), 277 - path: op.path.clone(), 278 - prev: op.prev.clone(), 279 - }) 280 - .collect(), 281 - prev_data: commit.prev_data.clone(), 282 - blobs: commit.blobs.clone(), 283 - too_big: commit.too_big, 284 - rebase: commit.rebase, 285 - } 286 249 } 287 250 288 251 // ---------------------------------------------------------------------------