From 1a1195402ea657f1f519d6bfbc6f4e50f073a698 Mon Sep 17 00:00:00 2001 From: qima Date: Thu, 2 Jan 2025 21:29:11 +0800 Subject: [PATCH 1/2] chore(node): more logs when carry out payment verification --- ant-node/src/put_validation.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ant-node/src/put_validation.rs b/ant-node/src/put_validation.rs index 67a01b275b..85db239d16 100644 --- a/ant-node/src/put_validation.rs +++ b/ant-node/src/put_validation.rs @@ -640,7 +640,7 @@ impl Node { ) -> Result<()> { let key = address.to_record_key(); let pretty_key = PrettyPrintRecordKey::from(&key).into_owned(); - debug!("Validating record payment for {pretty_key}"); + info!("Validating record payment for {pretty_key}"); // check if the quote is valid let self_peer_id = self.network().peer_id(); @@ -665,6 +665,7 @@ impl Node { let mut payees = payment.payees(); payees.retain(|peer_id| !closest_k_peers.contains(peer_id)); if !payees.is_empty() { + info!("Payment quote has out-of-range payees {payees:?}"); return Err(Error::InvalidRequest(format!( "Payment quote has out-of-range payees {payees:?}" ))); @@ -678,10 +679,12 @@ impl Node { // check if payment is valid on chain let payments_to_verify = payment.digest(); debug!("Verifying payment for record {pretty_key}"); - let reward_amount = + let verify_data_payment_result = verify_data_payment(self.evm_network(), owned_payment_quotes, payments_to_verify) .await - .map_err(|e| Error::EvmNetwork(format!("Failed to verify chunk payment: {e}")))?; + .map_err(|e| Error::EvmNetwork(format!("Failed to verify chunk payment: {e}"))); + info!("Data payemnt of record {pretty_key} verification result is {verify_data_payment_result:?}."); + let reward_amount = verify_data_payment_result?; debug!("Payment of {reward_amount:?} is valid for record {pretty_key}"); // Notify `record_store` that the node received a payment. From 9c63da4821243788d525ea49237a3c4b4c99b18b Mon Sep 17 00:00:00 2001 From: qima Date: Fri, 3 Jan 2025 19:39:15 +0800 Subject: [PATCH 2/2] chore(client): logging the fetched price --- evmlib/src/contract/payment_vault/handler.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/evmlib/src/contract/payment_vault/handler.rs b/evmlib/src/contract/payment_vault/handler.rs index 1000d7d108..29e4e60505 100644 --- a/evmlib/src/contract/payment_vault/handler.rs +++ b/evmlib/src/contract/payment_vault/handler.rs @@ -36,6 +36,8 @@ where let metrics: Vec<_> = metrics.into_iter().map(|v| v.into()).collect(); let mut amounts = self.contract.getQuote(metrics.clone()).call().await?.prices; + info!("Fetched amounts are {amounts:?}, for the quiting_metris of {metrics:?}"); + // FIXME: temporary logic until the smart contract gets updated if amounts.len() == 1 { let value = amounts[0];