feat: add ccc debug logs (#430)

add ccc debug logs
This commit is contained in:
Péter Garamvölgyi 2023-08-03 10:11:09 +02:00 committed by GitHub
parent 60e260b2f1
commit 21d430f018
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -24,7 +24,7 @@ import (
const (
VersionMajor = 4 // Major version component of the current release
VersionMinor = 3 // Minor version component of the current release
VersionPatch = 10 // Patch version component of the current release
VersionPatch = 11 // Patch version component of the current release
VersionMeta = "sepolia" // Version metadata to append to the version string
)

View file

@ -60,6 +60,13 @@ pub mod checker {
pub unsafe extern "C" fn apply_tx(id: u64, tx_traces: *const c_char) -> *const c_char {
let result = panic::catch_unwind(|| {
let tx_traces_vec = c_char_to_vec(tx_traces);
log::debug!(
"ccc apply_tx raw input, id: {:?}, tx_traces: {:?}",
id,
String::from(tx_traces_vec)
);
let traces = serde_json::from_slice::<BlockTrace>(&tx_traces_vec)
.unwrap_or_else(|_| panic!("id: {id:?}, fail to deserialize tx_traces"));
if traces.transactions.len() != 1 {
@ -114,6 +121,13 @@ pub mod checker {
pub unsafe extern "C" fn apply_block(id: u64, block_trace: *const c_char) -> *const c_char {
let result = panic::catch_unwind(|| {
let block_trace = c_char_to_vec(block_trace);
log::debug!(
"ccc apply_block raw input, id: {:?}, block_trace: {:?}",
id,
String::from(block_trace)
);
let traces = serde_json::from_slice::<BlockTrace>(&block_trace)
.unwrap_or_else(|_| panic!("id: {id:?}, fail to deserialize block_trace"));
CHECKERS