Skip to content

Commit

Permalink
rusk: udpate vm logs
Browse files Browse the repository at this point in the history
  • Loading branch information
fed-franz committed Dec 20, 2024
1 parent 68d5a49 commit f0b6d93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion rusk/src/lib/http/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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))
}

Expand Down
6 changes: 3 additions & 3 deletions rusk/src/lib/node/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -90,7 +90,7 @@ impl VMExecution for Rusk {
VerificationOutput,
Vec<ContractEvent>,
)> {
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:?}"))?;
Expand Down Expand Up @@ -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}"))
}
Expand Down

0 comments on commit f0b6d93

Please sign in to comment.