Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.
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
1,085 changes: 582 additions & 503 deletions Cargo.lock

Large diffs are not rendered by default.

36 changes: 34 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
[workspace]
members = ["discovery", "worker", "validator", "shared", "orchestrator", "dev-utils"]
members = [
"discovery",
"worker",
"validator",
"shared",
"orchestrator",
"dev-utils",
]
resolver = "2"

[workspace.dependencies]
shared = { path = "shared" }
actix-web = "4.9.0"
clap = { version = "4.5.27", features = ["derive"] }
serde = { version = "1.0.219", features = ["derive"] }
tokio = { version = "1.43.0", features = ["full"] }
uuid = { version = "1.12.1", features = ["v4", "serde"] }
log = { version = "0.4.26" }
env_logger = { version = "0.11.6" }
futures-util = { version = "0.3.31" }
alloy = { version = "0.9.2", features = ["full"] }
url = "2.5.4"
serde_json = "1.0.137"
reqwest = "0.12.12"
hex = "0.4.3"
anyhow = "1.0.95"
toml = "0.8.20"
tokio-util = "0.7.13"
futures = "0.3.31"
chrono = "0.4.40"
directories = "6.0.0"
nalgebra = "0.33.2"
redis = "0.28.1"
redis-test = "0.8.0"

[workspace.package]
version = "0.2.4"
version = "0.2.5"
edition = "2021"

[workspace.features]
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,8 @@ submit-work:
invalidate-work:
set -a; source ${ENV_FILE}; set +a; \
cargo run -p dev-utils --example invalidate_work -- --pool-id $${POOL_ID:-0} --penalty $${PENALTY} --work-key $${WORK_KEY} --key $${PRIVATE_KEY_VALIDATOR} --rpc-url $${RPC_URL}

deregister-worker:
set -a; source ${ENV_FILE}; set +a; \
cargo run --bin worker -- deregister --compute-pool-id $${WORKER_COMPUTE_POOL_ID} --private-key-provider $${PRIVATE_KEY_PROVIDER} --private-key-node $${PRIVATE_KEY_NODE} --rpc-url $${RPC_URL}

Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@ spec:
value: "{{ .Values.env.LOG_LEVEL }}"
- name: HOURLY_S3_UPLOAD_LIMIT
value: "{{ .Values.env.HOURLY_S3_UPLOAD_LIMIT }}"
{{- if .Values.env.WEBHOOK_URLS }}
- name: WEBHOOK_URLS
value: "{{ .Values.env.WEBHOOK_URLS }}"
{{- end }}
12 changes: 6 additions & 6 deletions dev-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ version = "0.1.0"
edition = "2021"

[dependencies]
shared = { path = "../shared" }
tokio = { version = "1", features = ["full"] }
shared = { workspace = true }
tokio = { workspace = true }
eyre = "0.6"
clap = { version = "4.5.26", features = ["derive"] }
url = "2.5.4"
alloy = "0.9.2"
tokio-util = "0.7.13"
clap = { workspace = true }
url = { workspace = true }
alloy = { workspace = true }
tokio-util = { workspace = true }
alloy-node-bindings = "0.9.2"
hex = "0.4.3"
28 changes: 14 additions & 14 deletions discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ version.workspace = true
edition.workspace = true

[dependencies]
actix-web = "4.9.0"
alloy = "0.9.2"
anyhow = "1.0.95"
clap = { version ="4.5.27", features = ["derive"] }
env_logger = "0.11.6"
log = "0.4.25"
redis = "0.28.1"
redis-test = "0.8.0"
serde = "1.0.217"
serde_json = "1.0.137"
shared = { path = "../shared" }
tokio = "1.43.0"
tokio-util = "0.7.13"
url = "2.5.4"
actix-web = { workspace = true }
alloy = { workspace = true }
anyhow = { workspace = true }
clap = { workspace = true }
env_logger = { workspace = true }
log = { workspace = true }
redis = { workspace = true }
redis-test = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
shared = { workspace = true }
tokio = { workspace = true }
tokio-util = { workspace = true }
url = { workspace = true }
36 changes: 18 additions & 18 deletions orchestrator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ version.workspace = true
edition.workspace = true

[dependencies]
actix-web = "4.9.0"
alloy = "0.9.2"
anyhow = "1.0.95"
actix-web = { workspace = true }
alloy = { workspace = true }
anyhow = { workspace = true }
base64 = "0.22.1"
chrono = { version = "0.4.40", features = ["serde"] }
clap = { version = "4.5.26", features = ["derive"] }
env_logger = "0.11.6"
futures = "0.3.31"
chrono = { workspace = true, features = ["serde"] }
clap = { workspace = true }
env_logger = { workspace = true }
futures = { workspace = true }
google-cloud-auth = "0.18.0"
google-cloud-storage = "0.24.0"
hex = "0.4.3"
log = "0.4.25"
hex = { workspace = true }
log = { workspace = true }
rand = "0.9.0"
redis = "0.28.1"
redis-test = "0.8.0"
reqwest = "0.12.12"
serde = "1.0.217"
serde_json = "1.0.135"
shared = { path = "../shared" }
tokio = "1.43.0"
url = "2.5.4"
uuid = { version = "1.12.1", features = ["v4", "serde"] }
redis = { workspace = true }
redis-test = { workspace = true }
reqwest = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
shared = { workspace = true }
tokio = { workspace = true }
url = { workspace = true }
uuid = { workspace = true }
2 changes: 2 additions & 0 deletions orchestrator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ENV S3_CREDENTIALS=""
ENV BUCKET_NAME=""
ENV LOG_LEVEL=""
ENV HOURLY_S3_UPLOAD_LIMIT="2"
ENV WEBHOOK_URLS=""

RUN echo '#!/bin/sh\n\
exec /usr/local/bin/orchestrator \
Expand All @@ -40,6 +41,7 @@ $([ ! -z "$S3_CREDENTIALS" ] && echo "--s3-credentials $S3_CREDENTIALS") \
$([ ! -z "$BUCKET_NAME" ] && echo "--bucket-name $BUCKET_NAME") \
$([ ! -z "$LOG_LEVEL" ] && echo "--log-level $LOG_LEVEL") \
$([ ! -z "$HOURLY_S3_UPLOAD_LIMIT" ] && echo "--hourly-s3-upload-limit $HOURLY_S3_UPLOAD_LIMIT") \
$([ ! -z "$WEBHOOK_URLS" ] && echo "--webhook-urls $WEBHOOK_URLS") \
"$@"' > /entrypoint.sh && \
chmod +x /entrypoint.sh

Expand Down
12 changes: 12 additions & 0 deletions orchestrator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ struct Args {
/// Log level
#[arg(short = 'l', long, default_value = "info")]
log_level: String,

/// Webhook urls (comma-separated string)
#[arg(long, default_value = "")]
webhook_urls: Option<String>,
}

#[tokio::main]
Expand Down Expand Up @@ -174,6 +178,13 @@ async fn main() -> Result<()> {
let status_update_store_context = store_context.clone();
let status_update_heartbeats = heartbeats.clone();
let status_update_contracts = contracts.clone();
let webhook_urls = args
.webhook_urls
.clone()
.unwrap_or_default()
.split(',')
.map(|s| s.to_string())
.collect();
tasks.spawn(async move {
let status_updater = NodeStatusUpdater::new(
status_update_store_context.clone(),
Expand All @@ -183,6 +194,7 @@ async fn main() -> Result<()> {
compute_pool_id,
args.disable_ejection,
status_update_heartbeats.clone(),
webhook_urls,
);
status_updater.run().await
});
Expand Down
9 changes: 7 additions & 2 deletions orchestrator/src/models/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use shared::models::node::DiscoveryNode;
use shared::models::task::TaskState;
use std::fmt;
use std::fmt::{self, Display};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OrchestratorNode {
Expand Down Expand Up @@ -57,7 +57,6 @@ impl fmt::Display for OrchestratorNode {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub enum NodeStatus {
Discovered,
Expand All @@ -68,3 +67,9 @@ pub enum NodeStatus {
Ejected,
Banned,
}

impl Display for NodeStatus {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", self)
}
}
Loading