File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -564,7 +564,12 @@ impl<N: Network> Primary<N> {
564
564
}
565
565
566
566
// Ensure the transaction doesn't bring the proposal above the spend limit.
567
- let block_height = self . ledger . latest_block_height ( ) + 1 ;
567
+ //
568
+ // Validators start following the new consensus rules early, in order to guarantee a smooth transition.
569
+ // The activation height is offset by the maximum number of blocks that can be produced within gc to
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 ) ;
568
573
if N :: CONSENSUS_VERSION ( block_height) ? >= ConsensusVersion :: V4 {
569
574
match self . ledger . compute_cost ( transaction_id, transaction) {
570
575
Ok ( cost) if proposal_cost + cost <= N :: BATCH_SPEND_LIMIT => proposal_cost += cost,
@@ -2241,7 +2246,9 @@ mod tests {
2241
2246
1 ,
2242
2247
& accounts,
2243
2248
committee,
2244
- CurrentNetwork :: CONSENSUS_HEIGHT ( ConsensusVersion :: V4 ) . unwrap ( ) ,
2249
+ CurrentNetwork :: CONSENSUS_HEIGHT ( ConsensusVersion :: V4 ) . unwrap ( )
2250
+ // Offset to check soft activation.
2251
+ - ( BatchHeader :: < CurrentNetwork > :: MAX_GC_ROUNDS as u32 / 2 ) ,
2245
2252
) ;
2246
2253
2247
2254
// Check there is no batch currently proposed.
You can’t perform that action at this time.
0 commit comments