Search in sources :

Example 1 with ValidatorStatuses

use of tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatuses in project teku by ConsenSys.

the class RewardsTestExecutorAltair method runTest.

@Override
public void runTest(final TestDefinition testDefinition) throws Throwable {
    final BeaconState preState = loadStateFromSsz(testDefinition, "pre.ssz_snappy");
    final ValidatorStatusFactory statusFactory = testDefinition.getSpec().getGenesisSpec().getValidatorStatusFactory();
    final ValidatorStatuses validatorStatuses = statusFactory.createValidatorStatuses(preState);
    final SpecVersion spec = testDefinition.getSpec().getGenesisSpec();
    final RewardsAndPenaltiesCalculatorAltair calculator = createRewardsAndPenaltiesCalculator(preState, validatorStatuses, spec);
    runTest(testDefinition, calculator, validatorStatuses);
}
Also used : ValidatorStatuses(tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatuses) SpecVersion(tech.pegasys.teku.spec.SpecVersion) ValidatorStatusFactory(tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatusFactory) RewardsAndPenaltiesCalculatorAltair(tech.pegasys.teku.spec.logic.versions.altair.statetransition.epoch.RewardsAndPenaltiesCalculatorAltair) BeaconState(tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState)

Example 2 with ValidatorStatuses

use of tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatuses in project teku by ConsenSys.

the class RewardsTestExecutorPhase0 method runTest.

@Override
public void runTest(final TestDefinition testDefinition) throws Throwable {
    final BeaconState preState = loadStateFromSsz(testDefinition, "pre.ssz_snappy");
    final ValidatorStatusFactory statusFactory = testDefinition.getSpec().getGenesisSpec().getValidatorStatusFactory();
    final ValidatorStatuses validatorStatuses = statusFactory.createValidatorStatuses(preState);
    final SpecVersion spec = testDefinition.getSpec().getGenesisSpec();
    final RewardsAndPenaltiesCalculatorPhase0 calculator = new RewardsAndPenaltiesCalculatorPhase0(spec.getConfig(), preState, validatorStatuses, spec.miscHelpers(), spec.beaconStateAccessors());
    runTest(testDefinition, calculator);
}
Also used : ValidatorStatuses(tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatuses) SpecVersion(tech.pegasys.teku.spec.SpecVersion) RewardsAndPenaltiesCalculatorPhase0(tech.pegasys.teku.spec.logic.versions.phase0.statetransition.epoch.RewardsAndPenaltiesCalculatorPhase0) ValidatorStatusFactory(tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatusFactory) BeaconState(tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState)

Example 3 with ValidatorStatuses

use of tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatuses in project teku by ConsenSys.

the class AbstractEpochProcessor method processEpoch.

protected void processEpoch(final BeaconState preState, final MutableBeaconState state) throws EpochProcessingException {
    final ValidatorStatuses validatorStatuses = validatorStatusFactory.createValidatorStatuses(preState);
    processJustificationAndFinalization(state, validatorStatuses.getTotalBalances());
    processInactivityUpdates(state, validatorStatuses);
    processRewardsAndPenalties(state, validatorStatuses);
    processRegistryUpdates(state, validatorStatuses.getStatuses());
    processSlashings(state, validatorStatuses.getTotalBalances().getCurrentEpochActiveValidators());
    processEth1DataReset(state);
    processEffectiveBalanceUpdates(state);
    processSlashingsReset(state);
    processRandaoMixesReset(state);
    processHistoricalRootsUpdate(state);
    processParticipationUpdates(state);
    processSyncCommitteeUpdates(state);
}
Also used : ValidatorStatuses(tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatuses)

Aggregations

ValidatorStatuses (tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatuses)3 SpecVersion (tech.pegasys.teku.spec.SpecVersion)2 BeaconState (tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState)2 ValidatorStatusFactory (tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatusFactory)2 RewardsAndPenaltiesCalculatorAltair (tech.pegasys.teku.spec.logic.versions.altair.statetransition.epoch.RewardsAndPenaltiesCalculatorAltair)1 RewardsAndPenaltiesCalculatorPhase0 (tech.pegasys.teku.spec.logic.versions.phase0.statetransition.epoch.RewardsAndPenaltiesCalculatorPhase0)1