Skip to content

Commit c42c3eb

Browse files
committed
apollo_batcher: add a temp log to print sync block commitment
1 parent 0c5c7c2 commit c42c3eb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

crates/apollo_batcher/src/batcher.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ use indexmap::IndexSet;
4343
#[cfg(test)]
4444
use mockall::automock;
4545
use starknet_api::block::{BlockHeaderWithoutHash, BlockNumber};
46+
use starknet_api::block_hash::state_diff_hash::calculate_state_diff_hash;
4647
use starknet_api::consensus_transaction::InternalConsensusTransaction;
4748
use starknet_api::core::{ContractAddress, Nonce};
4849
use starknet_api::state::ThinStateDiff;
@@ -586,6 +587,20 @@ impl Batcher {
586587
}
587588

588589
let address_to_nonce = state_diff.nonces.iter().map(|(k, v)| (*k, *v)).collect();
590+
591+
let state_diff_commitment = calculate_state_diff_hash(&state_diff);
592+
info!(
593+
"add_sync_block: block number {block_number} has state_diff_commitment: \
594+
{state_diff_commitment:?}"
595+
);
596+
let n_deprecated_declared_classes = state_diff.deprecated_declared_classes.len();
597+
if n_deprecated_declared_classes > 0 {
598+
info!(
599+
"add_sync_block: block number {block_number} has {n_deprecated_declared_classes} \
600+
deprecated declared classes."
601+
)
602+
}
603+
589604
self.commit_proposal_and_block(
590605
height,
591606
state_diff,

0 commit comments

Comments
 (0)