looping twice over block, let's see what the logs say

This commit is contained in:
Greg Coppola
2022-07-07 16:55:33 -05:00
parent 33372af5c0
commit c566656830
3 changed files with 51 additions and 47 deletions

View File

@@ -1507,7 +1507,7 @@ impl<'a> ClarityDatabase<'a> {
pub fn get_account_stx_balance(&mut self, principal: &PrincipalData) -> STXBalance {
let key = ClarityDatabase::make_key_for_account_balance(principal);
debug!("Fetching account balance"; "principal" => %principal.to_string());
// debug!("Fetching account balance"; "principal" => %principal.to_string());
let result = self.get(&key);
match result {
None => STXBalance::zero(),

View File

@@ -1053,7 +1053,7 @@ impl MemPoolDB {
remember_start_with_estimate = Some(start_with_no_estimate);
let mut last_addr = None;
for address in addresses.into_iter() {
debug!("Update nonce"; "address" => %address);
// debug!("Update nonce"; "address" => %address);
// do not recheck nonces if the sponsor == origin
if last_addr.as_ref() == Some(&address) {
continue;

View File

@@ -767,52 +767,56 @@ simulating a miner.
settings.max_miner_time_ms = max_time;
settings.mempool_settings.min_tx_fee = min_fee;
let result = StacksBlockBuilder::build_anchored_block(
&chain_state,
&sort_db.index_conn(),
&mut mempool_db,
&parent_header,
chain_tip.total_burn,
VRFProof::empty(),
Hash160([0; 20]),
&coinbase_tx,
settings,
None,
);
let stop = get_epoch_time_ms();
println!(
"{} mined block @ height = {} off of {} ({}/{}) in {}ms. Min-fee: {}, Max-time: {}",
if result.is_ok() {
"Successfully"
} else {
"Failed to"
},
parent_header.stacks_block_height + 1,
StacksBlockHeader::make_index_block_hash(
&parent_header.consensus_hash,
&parent_header.anchored_header.block_hash()
),
&parent_header.consensus_hash,
&parent_header.anchored_header.block_hash(),
stop.saturating_sub(start),
min_fee,
max_time
);
if let Ok((block, execution_cost, size)) = result {
let mut total_fees = 0;
for tx in block.txs.iter() {
total_fees += tx.get_tx_fee();
}
println!(
"Block {}: {} uSTX, {} bytes, cost {:?}",
block.block_hash(),
total_fees,
size,
&execution_cost
for i in 0..2 {
let result = StacksBlockBuilder::build_anchored_block(
&chain_state,
&sort_db.index_conn(),
&mut mempool_db,
&parent_header,
chain_tip.total_burn,
VRFProof::empty(),
Hash160([0; 20]),
&coinbase_tx,
settings.clone(),
None,
);
let stop = get_epoch_time_ms();
info!("round {} finishes with: {:?}", i, &result);
println!(
"{} mined block @ height = {} off of {} ({}/{}) in {}ms. Min-fee: {}, Max-time: {}",
if result.is_ok() {
"Successfully"
} else {
"Failed to"
},
parent_header.stacks_block_height + 1,
StacksBlockHeader::make_index_block_hash(
&parent_header.consensus_hash,
&parent_header.anchored_header.block_hash()
),
&parent_header.consensus_hash,
&parent_header.anchored_header.block_hash(),
stop.saturating_sub(start),
min_fee,
max_time
);
if let Ok((block, execution_cost, size)) = result {
let mut total_fees = 0;
for tx in block.txs.iter() {
total_fees += tx.get_tx_fee();
}
println!(
"Block {}: {} uSTX, {} bytes, cost {:?}",
block.block_hash(),
total_fees,
size,
&execution_cost
);
}
}
process::exit(0);