mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 14:54:45 +00:00
Split validator into ValidatorMutable
This commit is contained in:
@@ -52,7 +52,7 @@ pub fn get_effective_balances<T: EthSpec>(state: &BeaconState<T>) -> Vec<u64> {
|
||||
.iter()
|
||||
.map(|validator| {
|
||||
if validator.is_active_at(state.current_epoch()) {
|
||||
validator.effective_balance
|
||||
validator.effective_balance()
|
||||
} else {
|
||||
0
|
||||
}
|
||||
|
||||
@@ -1084,7 +1084,7 @@ fn scrape_head_state<T: EthSpec>(state: &BeaconState<T>, state_root: Hash256) {
|
||||
num_active += 1;
|
||||
}
|
||||
|
||||
if v.slashed {
|
||||
if v.slashed() {
|
||||
num_slashed += 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -327,12 +327,12 @@ impl<T: EthSpec> ValidatorMonitor<T> {
|
||||
metrics::set_int_gauge(
|
||||
&metrics::VALIDATOR_MONITOR_EFFECTIVE_BALANCE_GWEI,
|
||||
&[id],
|
||||
u64_to_i64(validator.effective_balance),
|
||||
u64_to_i64(validator.effective_balance()),
|
||||
);
|
||||
metrics::set_int_gauge(
|
||||
&metrics::VALIDATOR_MONITOR_SLASHED,
|
||||
&[id],
|
||||
if validator.slashed { 1 } else { 0 },
|
||||
if validator.slashed() { 1 } else { 0 },
|
||||
);
|
||||
metrics::set_int_gauge(
|
||||
&metrics::VALIDATOR_MONITOR_ACTIVE,
|
||||
@@ -364,22 +364,22 @@ impl<T: EthSpec> ValidatorMonitor<T> {
|
||||
metrics::set_int_gauge(
|
||||
&metrics::VALIDATOR_ACTIVATION_ELIGIBILITY_EPOCH,
|
||||
&[id],
|
||||
u64_to_i64(validator.activation_eligibility_epoch),
|
||||
u64_to_i64(validator.activation_eligibility_epoch()),
|
||||
);
|
||||
metrics::set_int_gauge(
|
||||
&metrics::VALIDATOR_ACTIVATION_EPOCH,
|
||||
&[id],
|
||||
u64_to_i64(validator.activation_epoch),
|
||||
u64_to_i64(validator.activation_epoch()),
|
||||
);
|
||||
metrics::set_int_gauge(
|
||||
&metrics::VALIDATOR_EXIT_EPOCH,
|
||||
&[id],
|
||||
u64_to_i64(validator.exit_epoch),
|
||||
u64_to_i64(validator.exit_epoch()),
|
||||
);
|
||||
metrics::set_int_gauge(
|
||||
&metrics::VALIDATOR_WITHDRAWABLE_EPOCH,
|
||||
&[id],
|
||||
u64_to_i64(validator.withdrawable_epoch),
|
||||
u64_to_i64(validator.withdrawable_epoch()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user