@@ -8,6 +8,7 @@ use std::thread;
88use stacks:: burnchains:: Burnchain ;
99use stacks:: burnchains:: Txid ;
1010use stacks:: chainstate:: burn:: operations:: BlockstackOperationType ;
11+ use stacks:: chainstate:: stacks:: db:: StacksChainState ;
1112use stacks:: chainstate:: stacks:: StacksPrivateKey ;
1213use stacks:: chainstate:: stacks:: StacksTransaction ;
1314use stacks:: chainstate:: stacks:: TransactionPayload ;
@@ -17,6 +18,7 @@ use stacks::core::StacksEpochId;
1718use stacks:: types:: chainstate:: BlockHeaderHash ;
1819use stacks:: types:: chainstate:: BurnchainHeaderHash ;
1920use stacks:: types:: chainstate:: StacksAddress ;
21+ use stacks:: types:: chainstate:: StacksBlockHeader ;
2022use stacks:: util:: hash:: hex_bytes;
2123use stacks:: vm:: types:: PrincipalData ;
2224use stacks:: vm:: ContractName ;
@@ -235,6 +237,7 @@ fn test_exact_block_costs() {
235237 // check that we processed at least 32 transactions...
236238 // the reason not to do an exact check here is that there *is* some variability in microblock production,
237239 // so sometimes the miner doesn't produce a microblock
240+ eprintln ! ( "Got {} total txs" , total_txs) ;
238241 assert ! ( total_txs >= 32 ) ;
239242
240243 test_observer:: clear ( ) ;
@@ -520,6 +523,38 @@ fn transition_empty_blocks() {
520523 // also, make *huge* block-commits with invalid marker bytes once we reach the new
521524 // epoch, and verify that it fails.
522525 let tip_info = get_chain_info ( & conf) ;
526+
527+ // this block is the epoch transition?
528+ let ( chainstate, _) = StacksChainState :: open (
529+ false ,
530+ conf. burnchain . chain_id ,
531+ & conf. get_chainstate_path_str ( ) ,
532+ )
533+ . unwrap ( ) ;
534+ let res = StacksChainState :: block_crosses_epoch_boundary (
535+ & chainstate. db ( ) ,
536+ & tip_info. stacks_tip_consensus_hash ,
537+ & tip_info. stacks_tip ,
538+ )
539+ . unwrap ( ) ;
540+ debug ! (
541+ "Epoch transition at {} ({}/{}) height {}: {}" ,
542+ & StacksBlockHeader :: make_index_block_hash(
543+ & tip_info. stacks_tip_consensus_hash,
544+ & tip_info. stacks_tip
545+ ) ,
546+ & tip_info. stacks_tip_consensus_hash,
547+ & tip_info. stacks_tip,
548+ tip_info. burn_block_height,
549+ res
550+ ) ;
551+
552+ if tip_info. burn_block_height == epoch_2_05 {
553+ assert ! ( res) ;
554+ } else {
555+ assert ! ( !res) ;
556+ }
557+
523558 if tip_info. burn_block_height + 1 >= epoch_2_05 {
524559 let burn_fee_cap = 100000000 ; // 1 BTC
525560 let sunset_burn =
0 commit comments