Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit 0f38f96

Browse files
authored
chore: adjust taskbridge to simple new logfmt (#368)
* adjust taskbridge to simple new logfmt
1 parent 4b96a09 commit 0f38f96

10 files changed

Lines changed: 479 additions & 273 deletions

File tree

Cargo.lock

Lines changed: 116 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/dev-utils/examples/submit_work.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async fn main() -> Result<()> {
5353

5454
let call = contracts
5555
.compute_pool
56-
.build_work_submission_call(pool_id, node, work_key)
56+
.build_work_submission_call(pool_id, node, work_key, U256::from(1))
5757
.await
5858
.map_err(|e| eyre::eyre!("Failed to build work submission call: {}", e))?;
5959

crates/orchestrator/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ edition.workspace = true
55

66
[dependencies]
77
actix-web = { workspace = true }
8+
actix-web-prometheus = "0.1.2"
89
alloy = { workspace = true }
910
anyhow = { workspace = true }
1011
async-trait = "0.1.88"

crates/shared/src/web3/contracts/implementations/compute_pool_contract.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,12 @@ impl ComputePool {
131131
pool_id: U256,
132132
node: Address,
133133
data: Vec<u8>,
134+
work_units: U256,
134135
) -> Result<PrimeCallBuilder<'_, alloy::json_abi::Function>, Box<dyn std::error::Error>> {
135136
// Extract the work key from the first 32 bytes
136137
// Create a new data vector with work key and work units (set to 1)
137138
let mut submit_data = Vec::with_capacity(64);
138139
submit_data.extend_from_slice(&data[0..32]); // Work key
139-
140-
// We leave work units simple for now and only set this to 1 (1 file = 1 work unit)
141-
let work_units = U256::from(1);
142140
submit_data.extend_from_slice(&work_units.to_be_bytes::<32>());
143141

144142
let call = self.instance.instance().function(

crates/worker/src/cli/command.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ pub enum Commands {
9797
#[arg(long, default_value = "false")]
9898
skip_system_checks: bool,
9999

100-
/// Silence metrics logging
101-
#[arg(long, default_value = "false")]
102-
silence_metrics: bool,
103-
104100
/// Loki URL
105101
#[arg(long)]
106102
loki_url: Option<String>,
@@ -184,7 +180,6 @@ pub async fn execute_command(
184180
auto_accept,
185181
funding_retry_count,
186182
skip_system_checks,
187-
silence_metrics,
188183
loki_url: _,
189184
log_level: _,
190185
} => {
@@ -401,16 +396,15 @@ pub async fn execute_command(
401396
Some(specs) => specs.storage_path.clone(),
402397
None => None,
403398
};
404-
let task_bridge = Arc::new(TaskBridge::new(
399+
let task_bridge = TaskBridge::new(
405400
None,
406401
metrics_store,
407402
Some(bridge_contracts),
408403
Some(node_config.clone()),
409404
Some(bridge_wallet),
410405
docker_storage_path.clone(),
411406
state.clone(),
412-
*silence_metrics,
413-
));
407+
);
414408

415409
let system_memory = node_config
416410
.compute_specs
@@ -437,10 +431,11 @@ pub async fn execute_command(
437431

438432
let bridge_cancellation_token = cancellation_token.clone();
439433
tokio::spawn(async move {
434+
let bridge_clone = task_bridge.clone();
440435
tokio::select! {
441436
_ = bridge_cancellation_token.cancelled() => {
442437
}
443-
_ = task_bridge.run() => {
438+
_ = bridge_clone.run() => {
444439
}
445440
}
446441
});

0 commit comments

Comments
 (0)