mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 12:11:59 +00:00
Add Fulu boilerplate (#6695)
* Add Fulu boilerplate * Add more boilerplate * Change fulu_time to osaka_time * Merge branch 'unstable' into fulu-boilerplate * Fix tests * Merge branch 'unstable' into fulu-boilerplate * More test fixes * Apply suggestions * Remove `get_payload` boilerplate * Add lightclient fulu types and fix beacon-chain-tests * Disable Fulu in ef-tests * Reduce boilerplate for future forks * Small fixes * One more fix * Apply suggestions * Merge branch 'unstable' into fulu-boilerplate * Fix lints
This commit is contained in:
@@ -44,22 +44,15 @@ pub fn get_attestation_participation_flag_indices<E: EthSpec>(
|
||||
if is_matching_source && inclusion_delay <= E::slots_per_epoch().integer_sqrt() {
|
||||
participation_flag_indices.push(TIMELY_SOURCE_FLAG_INDEX);
|
||||
}
|
||||
match state {
|
||||
&BeaconState::Base(_)
|
||||
| &BeaconState::Altair(_)
|
||||
| &BeaconState::Bellatrix(_)
|
||||
| &BeaconState::Capella(_) => {
|
||||
if is_matching_target && inclusion_delay <= E::slots_per_epoch() {
|
||||
participation_flag_indices.push(TIMELY_TARGET_FLAG_INDEX);
|
||||
}
|
||||
}
|
||||
&BeaconState::Deneb(_) | &BeaconState::Electra(_) => {
|
||||
if is_matching_target {
|
||||
// [Modified in Deneb:EIP7045]
|
||||
participation_flag_indices.push(TIMELY_TARGET_FLAG_INDEX);
|
||||
}
|
||||
if state.fork_name_unchecked().deneb_enabled() {
|
||||
if is_matching_target {
|
||||
// [Modified in Deneb:EIP7045]
|
||||
participation_flag_indices.push(TIMELY_TARGET_FLAG_INDEX);
|
||||
}
|
||||
} else if is_matching_target && inclusion_delay <= E::slots_per_epoch() {
|
||||
participation_flag_indices.push(TIMELY_TARGET_FLAG_INDEX);
|
||||
}
|
||||
|
||||
if is_matching_head && inclusion_delay == spec.min_attestation_inclusion_delay {
|
||||
participation_flag_indices.push(TIMELY_HEAD_FLAG_INDEX);
|
||||
}
|
||||
|
||||
@@ -55,15 +55,12 @@ pub fn slash_validator<E: EthSpec>(
|
||||
let whistleblower_index = opt_whistleblower_index.unwrap_or(proposer_index);
|
||||
let whistleblower_reward = validator_effective_balance
|
||||
.safe_div(spec.whistleblower_reward_quotient_for_state(state))?;
|
||||
let proposer_reward = match state {
|
||||
BeaconState::Base(_) => whistleblower_reward.safe_div(spec.proposer_reward_quotient)?,
|
||||
BeaconState::Altair(_)
|
||||
| BeaconState::Bellatrix(_)
|
||||
| BeaconState::Capella(_)
|
||||
| BeaconState::Deneb(_)
|
||||
| BeaconState::Electra(_) => whistleblower_reward
|
||||
let proposer_reward = if state.fork_name_unchecked().altair_enabled() {
|
||||
whistleblower_reward
|
||||
.safe_mul(PROPOSER_WEIGHT)?
|
||||
.safe_div(WEIGHT_DENOMINATOR)?,
|
||||
.safe_div(WEIGHT_DENOMINATOR)?
|
||||
} else {
|
||||
whistleblower_reward.safe_div(spec.proposer_reward_quotient)?
|
||||
};
|
||||
|
||||
// Ensure the whistleblower index is in the validator registry.
|
||||
|
||||
Reference in New Issue
Block a user