File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
data_structures/src/staking
node/src/actors/chain_manager Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -444,7 +444,10 @@ where
444444 let stake_entry = self . by_key . get_mut ( key) ;
445445 if let Some ( stake_entry) = stake_entry {
446446 let penalty_epochs = Epoch :: from ( ( 1 + winner_rank - index) as u32 ) ;
447- log:: debug!( "Disabling mining power of {} during +{} epochs" , key, penalty_epochs) ;
447+ log:: info!(
448+ "Resetting and disabling mining power of {} (ranked as #{}) during +{} epochs" ,
449+ key, index + 1 , penalty_epochs
450+ ) ;
448451 stake_entry
449452 . value
450453 . write ( )
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ impl ChainManager {
110110 let checkpoint_zero_timestamp = chain_info. consensus_constants . checkpoint_zero_timestamp ;
111111 let halving_period = chain_info. consensus_constants . halving_period ;
112112
113+ let previous_block_epoch = chain_info. highest_block_checkpoint . checkpoint ;
113114 let mut beacon = chain_info. highest_block_checkpoint ;
114115 let mut vrf_input = chain_info. highest_vrf_output ;
115116 let protocol_version = get_protocol_version ( self . current_epoch ) ;
@@ -251,6 +252,7 @@ impl ChainManager {
251252 . and_then ( move |block, act, _ctx| {
252253 act. future_process_validations (
253254 block. clone ( ) ,
255+ previous_block_epoch,
254256 current_epoch,
255257 vrf_input,
256258 beacon,
Original file line number Diff line number Diff line change @@ -2325,6 +2325,7 @@ impl ChainManager {
23252325 pub fn future_process_validations (
23262326 & mut self ,
23272327 block : Block ,
2328+ previous_block_epoch : Epoch ,
23282329 current_epoch : Epoch ,
23292330 vrf_input : CheckpointVRF ,
23302331 chain_beacon : CheckpointBeacon ,
@@ -2340,7 +2341,7 @@ impl ChainManager {
23402341 let protocol_version = ProtocolVersion :: from_epoch ( block. block_header . beacon . checkpoint ) ;
23412342 let replication_factor = self
23422343 . consensus_constants_wit2
2343- . get_replication_factor ( current_epoch , chain_beacon . checkpoint ) ;
2344+ . get_replication_factor ( block . block_header . beacon . checkpoint , previous_block_epoch ) ;
23442345 let res = validate_block (
23452346 & block,
23462347 current_epoch,
@@ -3127,7 +3128,7 @@ pub fn process_validations(
31273128 stakes : & StakesTracker ,
31283129 protocol_version : ProtocolVersion ,
31293130) -> Result < Diff , failure:: Error > {
3130- let replication_factor = consensus_constants_wit2. get_replication_factor ( current_epoch , chain_beacon. checkpoint ) ;
3131+ let replication_factor = consensus_constants_wit2. get_replication_factor ( block . block_header . beacon . checkpoint , chain_beacon. checkpoint ) ;
31313132 if !resynchronizing {
31323133 let mut signatures_to_verify = vec ! [ ] ;
31333134 validate_block (
You can’t perform that action at this time.
0 commit comments