Still destake delinquents on poor block production (#10646)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
@ -565,15 +565,8 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
let (quality_block_producers, poor_block_producers) =
|
let (quality_block_producers, poor_block_producers) =
|
||||||
classify_block_producers(&rpc_client, &config, last_epoch)?;
|
classify_block_producers(&rpc_client, &config, last_epoch)?;
|
||||||
|
|
||||||
if poor_block_producers.len()
|
let too_many_poor_block_producers = poor_block_producers.len()
|
||||||
> quality_block_producers.len() * config.max_poor_block_productor_percentage / 100
|
> quality_block_producers.len() * config.max_poor_block_productor_percentage / 100;
|
||||||
{
|
|
||||||
error!(
|
|
||||||
"Something is wrong. More than {}% of validators classified as poor block producers",
|
|
||||||
config.max_poor_block_productor_percentage
|
|
||||||
);
|
|
||||||
process::exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch vote account status for all the validator_listed validators
|
// Fetch vote account status for all the validator_listed validators
|
||||||
let vote_account_status = rpc_client.get_vote_accounts()?;
|
let vote_account_status = rpc_client.get_vote_accounts()?;
|
||||||
@ -729,6 +722,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !too_many_poor_block_producers {
|
||||||
if quality_block_producers.contains(&node_pubkey) {
|
if quality_block_producers.contains(&node_pubkey) {
|
||||||
// Delegate bonus stake
|
// Delegate bonus stake
|
||||||
if !stake_activated_in_current_epoch.contains(&bonus_stake_address) {
|
if !stake_activated_in_current_epoch.contains(&bonus_stake_address) {
|
||||||
@ -769,6 +763,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Destake the validator if it has been delinquent for longer than the grace period
|
// Destake the validator if it has been delinquent for longer than the grace period
|
||||||
if *root_slot
|
if *root_slot
|
||||||
@ -869,6 +864,18 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
&config.authorized_staker,
|
&config.authorized_staker,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
if too_many_poor_block_producers {
|
||||||
|
let message = format!(
|
||||||
|
"Note: Something is wrong, more than {}% of validators classified \
|
||||||
|
as poor block producers in epoch {}. Bonus stake frozen",
|
||||||
|
config.max_poor_block_productor_percentage, last_epoch,
|
||||||
|
);
|
||||||
|
warn!("{}", message);
|
||||||
|
if !config.dry_run {
|
||||||
|
notifier.send(&message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if !process_confirmations(
|
if !process_confirmations(
|
||||||
confirmations,
|
confirmations,
|
||||||
if config.dry_run {
|
if config.dry_run {
|
||||||
|
Reference in New Issue
Block a user