Skip to content

Commit 3f8091a

Browse files
committed
Fix build errors: mb_index scope and unused Digest import
Made-with: Cursor
1 parent 504e6e2 commit 3f8091a

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

development/qnet-integration/src/crypto/solana_derivation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ pub fn derive_qnet_signing_key_from_mnemonic(mnemonic: &str) -> Result<ed25519_d
254254
/// 5. Format: {19hex}eon{15hex}{4hex SHA3-256 checksum}
255255
pub fn derive_qnet_address_from_mnemonic(mnemonic: &str) -> Result<String, String> {
256256
use sha2::{Sha512, Digest as Sha2Digest};
257-
use sha3::{Sha3_256, Digest};
257+
use sha3::Sha3_256;
258258

259259
let mnemonic = mnemonic.trim();
260260
if mnemonic.is_empty() {

development/qnet-integration/src/node.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22858,15 +22858,16 @@ if is_info() { println!("[INFO][SYNC] recovered node={} lag={}", node_id_for_syn
2285822858
Ok(_) => {
2285922859
// v4.4: Update finality only if all constituent microblocks are present (defense-in-depth)
2286022860
let round = macroblock.height * 90;
22861-
let cons_mb_start = if mb_index == 1 { 1 } else { (mb_index - 1) * 90 + 1 };
22862-
let cons_mb_end = mb_index * 90;
22861+
let cons_mb_height = macroblock.height;
22862+
let cons_mb_start = if cons_mb_height == 1 { 1 } else { (cons_mb_height - 1) * 90 + 1 };
22863+
let cons_mb_end = cons_mb_height * 90;
2286322864
let cons_all_present = (cons_mb_start..=cons_mb_end)
2286422865
.all(|h| storage.load_microblock(h).unwrap_or(None).is_some());
2286522866
if cons_all_present {
2286622867
LAST_FINALIZED_CONSENSUS_ROUND.store(round, std::sync::atomic::Ordering::SeqCst);
2286722868
LAST_FINALIZED_HEIGHT.store(round, std::sync::atomic::Ordering::SeqCst);
2286822869
} else {
22869-
println!("[WARN][MB] skip_finality_update mb={} round={} — microblocks incomplete", mb_index, round);
22870+
println!("[WARN][MB] skip_finality_update mb={} round={} — microblocks incomplete", cons_mb_height, round);
2287022871
}
2287122872

2287222873
println!("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");

0 commit comments

Comments
 (0)