diff --git a/Cargo.lock b/Cargo.lock index f5071d1..67da767 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -478,7 +478,7 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "c0mpute-api" -version = "0.2.42" +version = "0.2.43" dependencies = [ "anyhow", "c0mpute-proto", @@ -493,7 +493,7 @@ dependencies = [ [[package]] name = "c0mpute-bench" -version = "0.2.42" +version = "0.2.43" dependencies = [ "anyhow", "blake3", @@ -504,7 +504,7 @@ dependencies = [ [[package]] name = "c0mpute-cli" -version = "0.2.42" +version = "0.2.43" dependencies = [ "anyhow", "axum", @@ -534,7 +534,7 @@ dependencies = [ [[package]] name = "c0mpute-core" -version = "0.2.42" +version = "0.2.43" dependencies = [ "aes-gcm", "anyhow", @@ -574,7 +574,7 @@ dependencies = [ [[package]] name = "c0mpute-doctor" -version = "0.2.42" +version = "0.2.43" dependencies = [ "anyhow", "serde", @@ -586,7 +586,7 @@ dependencies = [ [[package]] name = "c0mpute-envelope" -version = "0.2.42" +version = "0.2.43" dependencies = [ "blake3", "bs58", @@ -599,7 +599,7 @@ dependencies = [ [[package]] name = "c0mpute-gateway" -version = "0.2.42" +version = "0.2.43" dependencies = [ "anyhow", "axum", @@ -621,7 +621,7 @@ dependencies = [ [[package]] name = "c0mpute-market" -version = "0.2.42" +version = "0.2.43" dependencies = [ "c0mpute-envelope", "serde", @@ -631,7 +631,7 @@ dependencies = [ [[package]] name = "c0mpute-net" -version = "0.2.42" +version = "0.2.43" dependencies = [ "anyhow", "async-trait", @@ -648,7 +648,7 @@ dependencies = [ [[package]] name = "c0mpute-placement" -version = "0.2.42" +version = "0.2.43" dependencies = [ "anyhow", "async-trait", @@ -669,7 +669,7 @@ dependencies = [ [[package]] name = "c0mpute-proto" -version = "0.2.42" +version = "0.2.43" dependencies = [ "blake3", "hex", @@ -681,7 +681,7 @@ dependencies = [ [[package]] name = "c0mpute-secure-chat" -version = "0.2.42" +version = "0.2.43" dependencies = [ "aes-gcm", "anyhow", @@ -704,7 +704,7 @@ dependencies = [ [[package]] name = "c0mpute-store" -version = "0.2.42" +version = "0.2.43" dependencies = [ "anyhow", "blake3", @@ -722,7 +722,7 @@ dependencies = [ [[package]] name = "c0mpute-transcode" -version = "0.2.42" +version = "0.2.43" dependencies = [ "anyhow", "c0mpute-proto", @@ -735,7 +735,7 @@ dependencies = [ [[package]] name = "c0mpute-update" -version = "0.2.42" +version = "0.2.43" dependencies = [ "anyhow", "hex", @@ -749,7 +749,7 @@ dependencies = [ [[package]] name = "c0mpute-verify" -version = "0.2.42" +version = "0.2.43" dependencies = [ "anyhow", "blake3", diff --git a/Cargo.toml b/Cargo.toml index 1d56d53..f8b14a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ members = [ ] [workspace.package] -version = "0.2.42" +version = "0.2.43" edition = "2024" license = "MIT" repository = "https://github.com/profullstack/c0mpute" diff --git a/apps/tui/package.json b/apps/tui/package.json index 0d859be..e14eafc 100644 --- a/apps/tui/package.json +++ b/apps/tui/package.json @@ -1,6 +1,6 @@ { "name": "@c0mpute/tui", - "version": "0.2.42", + "version": "0.2.43", "private": true, "type": "module", "bin": { diff --git a/apps/web/package.json b/apps/web/package.json index 4827a0a..e208a58 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "c0mpute", - "version": "0.2.42", + "version": "0.2.43", "private": true, "type": "module", "scripts": { diff --git a/apps/web/src/app/releases/latest.json/route.ts b/apps/web/src/app/releases/latest.json/route.ts index 4c0e9ba..215ce76 100644 --- a/apps/web/src/app/releases/latest.json/route.ts +++ b/apps/web/src/app/releases/latest.json/route.ts @@ -28,7 +28,7 @@ export const dynamic = "force-dynamic"; * this in sync with the workspace version in `Cargo.toml` on each release so a * freshly built CLI reports "already latest" rather than a phantom upgrade. */ -const FALLBACK_VERSION = "0.2.42"; +const FALLBACK_VERSION = "0.2.43"; const FALLBACK_MIN_REQUIRED = "0.0.1"; type Channel = "stable" | "beta" | "nightly"; diff --git a/node/crates/c0mpute-bench/src/lib.rs b/node/crates/c0mpute-bench/src/lib.rs index 7f5204f..55f0a78 100644 --- a/node/crates/c0mpute-bench/src/lib.rs +++ b/node/crates/c0mpute-bench/src/lib.rs @@ -607,6 +607,17 @@ fn host_info() -> (String, String, Option) { (cpu, kernel, ram_bytes) } +/// Current public host hardware summary for capability adverts. Bench reports +/// remain the source of performance results, but this lets unbenchmarked nodes +/// publish CPU, core count and installed memory too. +pub fn hardware_summary() -> (String, usize, Option) { + let (cpu, _kernel, ram_bytes) = host_info(); + let cores = std::thread::available_parallelism() + .map(|n| n.get()) + .unwrap_or(1); + (cpu, cores, ram_bytes) +} + fn rfc3339_now() -> String { let secs = SystemTime::now() .duration_since(UNIX_EPOCH) diff --git a/node/crates/c0mpute-cli/src/main.rs b/node/crates/c0mpute-cli/src/main.rs index 75160e3..b38fbcf 100644 --- a/node/crates/c0mpute-cli/src/main.rs +++ b/node/crates/c0mpute-cli/src/main.rs @@ -63,6 +63,7 @@ enum Cmd { /// Benchmark this machine (fib / matmul / hash at 1…N threads) and record /// a score the worker advertises to the network. Report lands in /// `/bench.json`, same shape as fleetcode's runtime-benchmarks. + #[command(alias = "benchmark")] Bench { #[command(subcommand)] cmd: Option, diff --git a/node/crates/c0mpute-core/src/capabilities.rs b/node/crates/c0mpute-core/src/capabilities.rs index 1fb10eb..3b3eab2 100644 --- a/node/crates/c0mpute-core/src/capabilities.rs +++ b/node/crates/c0mpute-core/src/capabilities.rs @@ -143,12 +143,13 @@ pub fn hardware_blob(config: &Config) -> serde_json::Value { "version": env!("CARGO_PKG_VERSION"), "free_disk_root": config.storage.root.display().to_string(), }); + let (cpu, cores, ram_bytes) = c0mpute_bench::hardware_summary(); + blob["cpu"] = serde_json::Value::String(cpu); + blob["cores"] = serde_json::Value::from(cores); + if let Some(ram_bytes) = ram_bytes { + blob["ram_bytes"] = serde_json::Value::from(ram_bytes); + } if let Some(report) = bench_report_path().and_then(|p| c0mpute_bench::load(&p).ok().flatten()) { - blob["cpu"] = serde_json::Value::String(report.metadata.cpu.clone()); - blob["cores"] = serde_json::Value::from(report.metadata.cores); - if let Some(ram_bytes) = report.metadata.ram_bytes { - blob["ram_bytes"] = serde_json::Value::from(ram_bytes); - } blob["bench_at"] = serde_json::Value::String(report.metadata.start_time.clone()); if !report.metadata.quick && report.score > 0 { blob["benchmark"] = benchmark_details(&report); diff --git a/node/crates/c0mpute-update/src/lib.rs b/node/crates/c0mpute-update/src/lib.rs index 9ad6834..5459c6c 100644 --- a/node/crates/c0mpute-update/src/lib.rs +++ b/node/crates/c0mpute-update/src/lib.rs @@ -131,13 +131,41 @@ pub async fn upgrade_now(current_version: &str, release_feed_url: &str) -> Resul current: current_version.to_string(), }); } + // Save the executable path before replacing its on-disk inode. After the + // swap, launch the new binary's full benchmark under this node's identity + // so its refreshed report is what the worker advertises on restart. + let new_exe = std::env::current_exe().ok(); perform_upgrade(&manifest).await?; + if let Some(exe) = new_exe { + if let Err(error) = run_post_update_benchmark(exe).await { + warn!(err = %error, "post-update benchmark failed; continuing with the updated binary"); + } + } else { + warn!("could not locate updated executable to run the post-update benchmark"); + } Ok(UpgradeOutcome::Upgraded { from: current_version.to_string(), to: manifest.version, }) } +async fn run_post_update_benchmark(exe: std::path::PathBuf) -> Result<()> { + let status = tokio::task::spawn_blocking(move || { + std::process::Command::new(exe) + .arg("benchmark") + // The child already is the newly installed version; avoid another + // release-feed request before it starts measuring this machine. + .env("C0MPUTE_NO_AUTO_UPDATE", "1") + .status() + }) + .await + .context("join post-update benchmark")??; + if !status.success() { + anyhow::bail!("`c0mpute benchmark` exited with {status}"); + } + Ok(()) +} + /// Map the compile-time target to the release artifact's os/arch tokens /// (matching `.github/workflows/release.yml` naming). fn target_os_arch() -> Result<(&'static str, &'static str)> { diff --git a/package.json b/package.json index 261e067..38701be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "c0mpute-monorepo", - "version": "0.2.42", + "version": "0.2.43", "private": true, "workspaces": [ "apps/*", diff --git a/packages/shared/package.json b/packages/shared/package.json index 1686282..72f73ea 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@c0mpute/shared", - "version": "0.2.42", + "version": "0.2.43", "private": true, "type": "module", "main": "./dist/index.js", diff --git a/plugins/ads-manager/module.toml b/plugins/ads-manager/module.toml index 28ab8b2..f15d6d5 100644 --- a/plugins/ads-manager/module.toml +++ b/plugins/ads-manager/module.toml @@ -18,7 +18,7 @@ [module] id = "ads-manager" name = "Ads Manager — shared ad operations layer" -version = "0.2.42" +version = "0.2.43" kind = "service" category = "applications" description = "Unified ad operations for the c0mpute network: campaign management, creative registry, publisher inventory, OpenRTB auction primitives, CoinPay escrow, and reporting. Required dependency for ctv-ads and all future ad format plugins." diff --git a/plugins/coinpay/module.toml b/plugins/coinpay/module.toml index 20958db..853095c 100644 --- a/plugins/coinpay/module.toml +++ b/plugins/coinpay/module.toml @@ -7,7 +7,7 @@ [module] id = "coinpay" name = "CoinPay — DID, payments, escrow, reputation" -version = "0.2.42" +version = "0.2.43" kind = "service" category = "applications" description = "Decentralized identifiers, wallet linking, escrow, signed receipts, and worker reputation. The trust spine of the c0mpute network." diff --git a/plugins/crawl/module.toml b/plugins/crawl/module.toml index d4439c8..4f923d6 100644 --- a/plugins/crawl/module.toml +++ b/plugins/crawl/module.toml @@ -14,7 +14,7 @@ [module] id = "crawl" name = "Crawl — distributed web fetching" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "data" description = "Decentralized web crawling and page-rendering pool. Static fetches and JS-rendered pages, robots-aware, WARC-capable." diff --git a/plugins/ctv-ads/module.toml b/plugins/ctv-ads/module.toml index cf08a69..53e76b1 100644 --- a/plugins/ctv-ads/module.toml +++ b/plugins/ctv-ads/module.toml @@ -20,7 +20,7 @@ [module] id = "ctv-ads" name = "CTV Ads — Connected TV ad marketplace" -version = "0.2.42" +version = "0.2.43" kind = "service" category = "applications" description = "Decentralised Connected TV advertising on the c0mpute network. VAST 4.x endpoint, OpenRTB real-time auction, cryptographically verified impressions, CoinPay settlement. Supports Roku, Fire TV, Apple TV, Smart TVs, and FAST channels. Live-stream integration for ad-monetised broadcasts." diff --git a/plugins/diffusion/module.toml b/plugins/diffusion/module.toml index 85defd8..c9cb610 100644 --- a/plugins/diffusion/module.toml +++ b/plugins/diffusion/module.toml @@ -14,7 +14,7 @@ [module] id = "diffusion" name = "Diffusion — image generation" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "ai" description = "Decentralized image generation (Stable Diffusion, SDXL, Flux) on consumer/prosumer GPUs." diff --git a/plugins/embed/module.toml b/plugins/embed/module.toml index 5e4fb02..e28a185 100644 --- a/plugins/embed/module.toml +++ b/plugins/embed/module.toml @@ -13,7 +13,7 @@ [module] id = "embed" name = "Embeddings — vector generation" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "ai" description = "Bulk text-embedding generation (sentence-transformers, BGE, Nomic) with CPU fallback and optional GPU acceleration." diff --git a/plugins/gameserver/module.toml b/plugins/gameserver/module.toml index 286e3c6..f2bed3b 100644 --- a/plugins/gameserver/module.toml +++ b/plugins/gameserver/module.toml @@ -14,7 +14,7 @@ [module] id = "gameserver" name = "Game server — Minecraft / Factorio / Valheim" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "infrastructure" description = "Continuous-reservation hosting for game servers. Multi-replica placement, persistent world state on c0mpute storage, proof-of-serve settlement." diff --git a/plugins/hosting/module.toml b/plugins/hosting/module.toml index b492391..5e7b0f8 100644 --- a/plugins/hosting/module.toml +++ b/plugins/hosting/module.toml @@ -12,7 +12,7 @@ [module] id = "hosting" name = "Hosting — censorship-resistant static sites" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "data" description = "Static-site hosting with multi-replica placement, mutable naming, epoch settlement, and slashable proof-of-serve. See DIP-0015." diff --git a/plugins/infernet/module.toml b/plugins/infernet/module.toml index 25c9c09..03ca956 100644 --- a/plugins/infernet/module.toml +++ b/plugins/infernet/module.toml @@ -10,7 +10,7 @@ [module] id = "infernet" name = "Infernet Protocol — AI inference" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "ai" description = "Decentralized AI inference workloads on c0mpute. Runs models on consumer/prosumer GPUs with model-hash and runtime-image verification. Also trains and serves temporal policies (CfC/LTC liquid networks, GRU baseline) on CPU or GPU." diff --git a/plugins/live-stream/module.toml b/plugins/live-stream/module.toml index 010a5dd..c408649 100644 --- a/plugins/live-stream/module.toml +++ b/plugins/live-stream/module.toml @@ -23,7 +23,7 @@ [module] id = "live-stream" name = "Live Stream — p2p HLS live streaming" -version = "0.2.42" +version = "0.2.43" kind = "service" category = "media" description = "Decentralized live video streaming via BitTorrent-style HLS segment swarming. Broadcaster pushes RTMP/SRT; c0mpute nodes swarm segments to viewers. No central CDN. Censorship-resistant. Per-GB micropayments via CoinPay." diff --git a/plugins/ocr/module.toml b/plugins/ocr/module.toml index 598b102..e18011b 100644 --- a/plugins/ocr/module.toml +++ b/plugins/ocr/module.toml @@ -12,7 +12,7 @@ [module] id = "ocr" name = "OCR — document text extraction" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "ai" description = "Decentralized OCR for PDFs and scanned documents (Tesseract, PaddleOCR, docTR) with CPU or GPU runners." diff --git a/plugins/podcast-ads/module.toml b/plugins/podcast-ads/module.toml index 71e8df9..fdef23d 100644 --- a/plugins/podcast-ads/module.toml +++ b/plugins/podcast-ads/module.toml @@ -22,7 +22,7 @@ [module] id = "podcast-ads" name = "Podcast Ads — audio ad marketplace" -version = "0.2.42" +version = "0.2.43" kind = "service" category = "applications" description = "Decentralised audio advertising for c0mpute-hosted podcasts. DAAST 1.0 endpoint, dynamic ad insertion, Podcasting 2.0 revenue splits, and CoinPay settlement. Publishers sell ad slots; advertisers run campaigns — zero platform cut beyond protocol split." diff --git a/plugins/podcasting/module.toml b/plugins/podcasting/module.toml index 04f6695..3fab24b 100644 --- a/plugins/podcasting/module.toml +++ b/plugins/podcasting/module.toml @@ -20,7 +20,7 @@ [module] id = "podcasting" name = "Podcasting — p2p podcast publishing" -version = "0.2.42" +version = "0.2.43" kind = "service" category = "media" description = "Censorship-resistant podcast hosting on the c0mpute network. Upload episodes, stream live shows, auto-transcribe, and monetise via CoinPay subscriptions, pay-per-episode, value-for-value, and audio ads — with zero platform cut. RSS 2.0 + Podcasting 2.0 compatible with all major podcast apps." diff --git a/plugins/podcasts/module.toml b/plugins/podcasts/module.toml index de34d8c..c986439 100644 --- a/plugins/podcasts/module.toml +++ b/plugins/podcasts/module.toml @@ -19,7 +19,7 @@ [module] id = "podcasts" name = "Podcasts — p2p podcast listener" -version = "0.2.42" +version = "0.2.43" kind = "service" category = "media" description = "Discover, subscribe to, and play podcasts hosted on the c0mpute network or any standard RSS feed. Stream live episodes, tip creators directly via CoinPay, and participate in value-for-value streaming payments. Works alongside any existing podcast app via OPML export and local RSS proxy." diff --git a/plugins/render/module.toml b/plugins/render/module.toml index 3503427..340c44c 100644 --- a/plugins/render/module.toml +++ b/plugins/render/module.toml @@ -13,7 +13,7 @@ [module] id = "render" name = "Render — Blender 3D rendering" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "media" description = "Decentralized 3D rendering using Blender headless (Cycles/Eevee) across consumer GPUs and CPUs." diff --git a/plugins/secure-chat/module.toml b/plugins/secure-chat/module.toml index d591267..7394f22 100644 --- a/plugins/secure-chat/module.toml +++ b/plugins/secure-chat/module.toml @@ -18,7 +18,7 @@ [module] id = "secure-chat" name = "Secure Chat — E2E encrypted p2p messaging" -version = "0.2.42" +version = "0.2.43" kind = "service" category = "applications" description = "End-to-end encrypted peer-to-peer messaging across the c0mpute network. No central server. Keys stay with the user. Identity and reputation via CoinPay DID. Group chats, sealed-sender mode, and offline store-and-forward included." diff --git a/plugins/storage/module.toml b/plugins/storage/module.toml index a9aba94..2dd2b48 100644 --- a/plugins/storage/module.toml +++ b/plugins/storage/module.toml @@ -12,7 +12,7 @@ [module] id = "storage" name = "Storage — Reed-Solomon shard service" -version = "0.2.42" +version = "0.2.43" kind = "service" category = "data" description = "Reed-Solomon 10/14 shard storage with auto-repair. Compute-locality, E2E encryption, content-addressed, pay-as-you-go. See DIP-0012." diff --git a/plugins/train/module.toml b/plugins/train/module.toml index 0a7c58f..0a5c6af 100644 --- a/plugins/train/module.toml +++ b/plugins/train/module.toml @@ -13,7 +13,7 @@ [module] id = "train" name = "Fine-tune — LoRA/QLoRA training" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "ai" description = "Decentralized model fine-tuning (LoRA, QLoRA) on consumer/prosumer GPUs using axolotl or unsloth." diff --git a/plugins/transcode/module.toml b/plugins/transcode/module.toml index 57ea9d3..7a58ac3 100644 --- a/plugins/transcode/module.toml +++ b/plugins/transcode/module.toml @@ -7,7 +7,7 @@ [module] id = "transcode" name = "FFmpeg Transcoding" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "media" description = "Decentralized audio/video transcoding via FFmpeg with hardware acceleration (NVENC, QSV, AMF, VideoToolbox, AV1)." diff --git a/plugins/tts/module.toml b/plugins/tts/module.toml index e70d4d6..bac274f 100644 --- a/plugins/tts/module.toml +++ b/plugins/tts/module.toml @@ -8,7 +8,7 @@ [module] id = "tts" name = "TTS — text-to-speech" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "ai" description = "CPU text-to-speech inference over c0mpute using Piper or Kokoro." diff --git a/plugins/whisper/module.toml b/plugins/whisper/module.toml index 696c890..9287637 100644 --- a/plugins/whisper/module.toml +++ b/plugins/whisper/module.toml @@ -7,7 +7,7 @@ [module] id = "whisper" name = "Whisper — speech-to-text" -version = "0.2.42" +version = "0.2.43" kind = "workload" category = "ai" description = "CPU speech-to-text inference over c0mpute using faster-whisper."