Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ members = [
]

[workspace.package]
version = "0.3.5"
version = "0.3.6"
edition = "2024"
license = "MIT"
repository = "https://github.com/profullstack/c0mpute"
Expand Down
2 changes: 1 addition & 1 deletion apps/tui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@c0mpute/tui",
"version": "0.3.5",
"version": "0.3.6",
"private": true,
"type": "module",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "c0mpute",
"version": "0.3.5",
"version": "0.3.6",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/releases/latest.json/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.5";
const FALLBACK_VERSION = "0.3.6";
const FALLBACK_MIN_REQUIRED = "0.0.1";

type Channel = "stable" | "beta" | "nightly";
Expand Down
44 changes: 42 additions & 2 deletions node/crates/c0mpute-core/src/buyer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ pub async fn run_auction(net: Arc<Libp2pNetwork>, auction: JobAuction) -> Result
}

// ── wait for receipt ────────────────────────────────────────────
let recv_deadline = Instant::now() + auction.receipt_timeout;
let receipt_timeout = receipt_wait(auction.receipt_timeout, &winner);
let recv_deadline = Instant::now() + receipt_timeout;
while Instant::now() < recv_deadline {
let remaining = recv_deadline.saturating_duration_since(Instant::now());
match tokio::time::timeout(remaining, rx.recv()).await {
Expand Down Expand Up @@ -510,7 +511,7 @@ pub async fn run_auction(net: Arc<Libp2pNetwork>, auction: JobAuction) -> Result

Err(AuctionFailure::NoReceipt(format!(
"no receipt from winner {} within {:?}",
winner.bidder_peer_id, auction.receipt_timeout
winner.bidder_peer_id, receipt_timeout
))
.into())
}
Expand Down Expand Up @@ -653,6 +654,27 @@ async fn publish_json<T: serde::Serialize>(
net.publish(topic, bytes).await
}

/// Bench score a workload's receipt timeout is calibrated for (dev2's image
/// worker scores ~5,500 and draws a 512x512 image in ~2 min).
pub const REFERENCE_BENCH_SCORE: u32 = 5_000;

/// How long to wait for `winner`'s receipt: the auction's timeout, longer
/// for a winner that says it needs longer (2.5x its quoted ETA) or that
/// benchmarks slower than [`REFERENCE_BENCH_SCORE`] (scaled by how much
/// slower), never more than 4x the timeout. A slow CPU node (bench 1,606)
/// needed ~7 min per image against a 6 min timeout: it was benched for
/// "never delivered", the job re-queued and went straight back to it.
pub fn receipt_wait(base: Duration, winner: &JobBid) -> Duration {
let by_eta = Duration::from_secs(winner.eta_seconds.saturating_mul(5) / 2);
let by_bench = match winner.bench_score {
Some(score) if score > 0 && score < REFERENCE_BENCH_SCORE => {
base.mul_f64(REFERENCE_BENCH_SCORE as f64 / score as f64)
}
_ => base,
};
base.max(by_eta).max(by_bench).min(base.saturating_mul(4))
}

/// Gossipsub gives us a cryptographically-authenticated `source: Option<PeerId>`
/// (see `c0mpute_net::GossipMessage`) that cannot be forged by another peer —
/// `capabilities.rs`'s ad registry already keys off it for the same reason.
Expand Down Expand Up @@ -742,4 +764,22 @@ mod tests {
None
);
}

#[test]
fn slow_or_busy_winners_get_longer_to_deliver() {
let base = Duration::from_secs(360);
let mut b = bid("w", None);
b.eta_seconds = 60;
b.bench_score = Some(5_560);
assert_eq!(receipt_wait(base, &b), base, "a reference-speed node: the plain timeout");
b.bench_score = Some(1_606);
let slow = receipt_wait(base, &b);
assert!(slow > Duration::from_secs(1100) && slow < Duration::from_secs(1200), "{slow:?}");
b.bench_score = None;
b.eta_seconds = 400;
assert_eq!(receipt_wait(base, &b), Duration::from_secs(1000), "2.5x its own ETA");
b.eta_seconds = 1_000_000;
assert_eq!(receipt_wait(base, &b), base * 4, "capped");
}

}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "c0mpute-monorepo",
"version": "0.3.5",
"version": "0.3.6",
"private": true,
"workspaces": [
"apps/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/captcha/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@profullstack/c0mpute-captcha",
"version": "0.3.5",
"version": "0.3.6",
"description": "Solve image, slider, gap, click-text, audio and math captchas on the c0mpute network: library (fetch().then(solveCaptcha)), CLI and stdio MCP server.",
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@c0mpute/shared",
"version": "0.3.5",
"version": "0.3.6",
"private": true,
"type": "module",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion plugins/ad-generator-agent/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
[module]
id = "ad-generator-agent"
name = "Ad Generator Agent — every ad type from one URL"
version = "0.3.5"
version = "0.3.6"
kind = "service"
category = "applications"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/ads-manager/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
[module]
id = "ads-manager"
name = "Ads Manager — shared ad operations layer"
version = "0.3.5"
version = "0.3.6"
kind = "service"
category = "applications"
status = "partial"
Expand Down
2 changes: 1 addition & 1 deletion plugins/apps/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[module]
id = "apps"
name = "Apps — backends with 3x redundancy"
version = "0.3.5"
version = "0.3.6"
kind = "workload"
category = "infrastructure"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/captcha/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
[module]
id = "captcha"
name = "Captcha — image, slider, audio and math solving"
version = "0.3.5"
version = "0.3.6"
kind = "workload"
category = "ai"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/coinpay/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[module]
id = "coinpay"
name = "CoinPay — DID, payments, escrow, reputation"
version = "0.3.5"
version = "0.3.6"
kind = "service"
category = "applications"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/crawl/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[module]
id = "crawl"
name = "Crawl — distributed web fetching"
version = "0.3.5"
version = "0.3.6"
kind = "workload"
category = "data"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/crowdgpt/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
[module]
id = "crowdgpt"
name = "CrowdGPT: donate idle compute"
version = "0.3.5"
version = "0.3.6"
kind = "donation"
category = "ai"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/ctv-ads/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[module]
id = "ctv-ads"
name = "CTV Ads — VAST and VMAP from every gateway"
version = "0.3.5"
version = "0.3.6"
kind = "service"
category = "applications"
status = "partial"
Expand Down
2 changes: 1 addition & 1 deletion plugins/diffusion/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[module]
id = "diffusion"
name = "Diffusion — image generation"
version = "0.3.5"
version = "0.3.6"
kind = "workload"
category = "ai"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/embed/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[module]
id = "embed"
name = "Embeddings — vector generation"
version = "0.3.5"
version = "0.3.6"
kind = "workload"
category = "ai"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/gameserver/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
[module]
id = "gameserver"
name = "Game server — Minecraft / Factorio / Valheim"
version = "0.3.5"
version = "0.3.6"
kind = "workload"
category = "infrastructure"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/hosting/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
[module]
id = "hosting"
name = "Hosting — p2p static sites"
version = "0.3.5"
version = "0.3.6"
kind = "service"
category = "data"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/infernet/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
[module]
id = "infernet"
name = "Infernet Protocol — AI inference"
version = "0.3.5"
version = "0.3.6"
kind = "workload"
category = "ai"
status = "available"
Expand Down
Loading
Loading