Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Sep 11, 2024
1 parent f021d80 commit f20dc2b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ ya-service-api-interfaces = { path = "core/serv-api/interfaces" }
ya-service-api-web = { path = "core/serv-api/web" }

## CLIENT
ya-client = { git = "https://github.com/golemfactory/ya-client.git", rev = "c8675c4eb0d42119b1cfa2f5772ba91f877d81f9" }
ya-client = { git = "https://github.com/golemfactory/ya-client.git", rev = "8dc4ccec33ad4d51fe975b038677bcbbd920653a" }
#ya-client = { path = "../ya-client" }
ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "c8675c4eb0d42119b1cfa2f5772ba91f877d81f9" }
ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "8dc4ccec33ad4d51fe975b038677bcbbd920653a" }
golem-certificate = { git = "https://github.com/golemfactory/golem-certificate.git", rev = "952fdbd47adc57e46b7370935111e046271ef415" }

## RELAY and networking stack
Expand Down
12 changes: 10 additions & 2 deletions core/payment-driver/base/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,16 @@ pub trait PaymentDriver {
let s: [u8; 32] = msg.signature[33..65].try_into().unwrap();
let signature = Signature { v, r, s };

let payload = if msg.canonicalized {
utils::payment_hash_canonicalized(&msg.payment)
let payload = if let Some(payload) = msg.canonical {
match msg.payment.verify_canonical(payload.as_slice()) {
Ok(_) => prepare_signature_hash(&payload),
Err(e) => {
log::info!(
"Signature verification: canonical representation doesn't match struct: {e}"
);
return Ok(false);
}
}
} else {
// Backward compatibility version for older Nodes that don't send canonical
// signed bytes and used Payment debug formatting as representation.
Expand Down
3 changes: 2 additions & 1 deletion core/payment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ impl PaymentService {
let config = Arc::new(Config::from_env()?);

let processor = Arc::new(PaymentProcessor::new(db.clone()));
self::service::bind_service(&db, processor.clone(), BindOptions::default(), config);
self::service::bind_service(&db, processor.clone(), config);

processor.process_post_migration_jobs().await?;

tokio::task::spawn(async move {
Expand Down
2 changes: 1 addition & 1 deletion core/payment/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::ops::Sub;
use std::str::FromStr;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::time::Duration;
use std::time::{Duration, Instant};
use thiserror::Error;
use tokio::sync::{Mutex, RwLock};

Expand Down

0 comments on commit f20dc2b

Please sign in to comment.