From f0b6d93df13089c821773abda32fb82a3962ab37 Mon Sep 17 00:00:00 2001 From: Federico Franzoni <8609060+fed-franz@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:28:00 +0100 Subject: [PATCH] rusk: udpate vm logs --- rusk/src/lib/http/chain.rs | 11 ++++++++++- rusk/src/lib/node/vm.rs | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/rusk/src/lib/http/chain.rs b/rusk/src/lib/http/chain.rs index 1054ab96b..c345b8c62 100644 --- a/rusk/src/lib/http/chain.rs +++ b/rusk/src/lib/http/chain.rs @@ -26,6 +26,7 @@ use async_graphql::{ EmptyMutation, EmptySubscription, Name, Schema, Variables, }; use serde_json::{json, Map, Value}; +use tracing::error; use super::*; use crate::node::RuskNode; @@ -182,7 +183,15 @@ impl RuskNode { .map_err(|e| anyhow::anyhow!("Invalid Data {e:?}"))?; let db = self.inner().database(); let vm = self.inner().vm_handler(); - MempoolSrv::check_tx(&db, &vm, &tx.into(), true, usize::MAX).await?; + let tx = tx.into(); + + MempoolSrv::check_tx(&db, &vm, &tx, true, usize::MAX) + .await + .map_err(|e| { + error!("Tx {} not accepted: {e}", hex::encode(tx.id())); + e + })?; + Ok(ResponseData::new(DataType::None)) } diff --git a/rusk/src/lib/node/vm.rs b/rusk/src/lib/node/vm.rs index e33a06239..ee337a752 100644 --- a/rusk/src/lib/node/vm.rs +++ b/rusk/src/lib/node/vm.rs @@ -8,7 +8,7 @@ mod query; use dusk_consensus::errors::VstError; use node_data::events::contract::ContractEvent; -use tracing::info; +use tracing::{debug, info}; use dusk_bytes::DeserializableSlice; use dusk_consensus::operations::{CallParams, VerificationOutput, Voter}; @@ -90,7 +90,7 @@ impl VMExecution for Rusk { VerificationOutput, Vec, )> { - info!("Received accept request"); + debug!("Received accept request"); let generator = blk.header().generator_bls_pubkey; let generator = BlsPublicKey::from_slice(&generator.0) .map_err(|e| anyhow::anyhow!("Error in from_slice {e:?}"))?; @@ -129,7 +129,7 @@ impl VMExecution for Rusk { commit: [u8; 32], to_merge: Vec<[u8; 32]>, ) -> anyhow::Result<()> { - info!("Received finalize request"); + debug!("Received finalize request"); self.finalize_state(commit, to_merge) .map_err(|e| anyhow::anyhow!("Cannot finalize state: {e}")) }