File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -565,11 +565,18 @@ impl<N: Network> Primary<N> {
565
565
566
566
// Ensure the transaction doesn't bring the proposal above the spend limit.
567
567
//
568
- // Validators start following the new consensus rules early, in order to guarantee a smooth transition.
568
+ // Validators start following the new consensus rules early to guarantee a smooth transition.
569
569
// The activation height is offset by the maximum number of blocks that can be produced within gc to
570
570
// ensure honest validators can't mismatch due to differing views of the dag.
571
- let block_height =
572
- self . ledger . latest_block_height ( ) + 1 + ( BatchHeader :: < N > :: MAX_GC_ROUNDS as u32 / 2 ) ;
571
+ let block_height = self
572
+ . ledger
573
+ . latest_block_height ( )
574
+ // Add one to get the next block height.
575
+ . saturating_add ( 1 )
576
+ // Estimate and upper bound the block height for the number of rounds within gc.
577
+ // Blocks contain at least two dag rounds and in max_gc_rounds we'll produce max_gc_rounds / 2 blocks.
578
+ . saturating_add ( ( BatchHeader :: < N > :: MAX_GC_ROUNDS as u32 ) . saturating_div ( 2 ) ) ;
579
+
573
580
if N :: CONSENSUS_VERSION ( block_height) ? >= ConsensusVersion :: V4 {
574
581
match self . ledger . compute_cost ( transaction_id, transaction) {
575
582
Ok ( cost) if proposal_cost + cost <= N :: BATCH_SPEND_LIMIT => proposal_cost += cost,
You can’t perform that action at this time.
0 commit comments