Search in sources :

Example 1 with MutableBeaconState

use of tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState in project teku by ConsenSys.

the class BlockProcessorAltair method processSyncAggregate.

@Override
public void processSyncAggregate(final MutableBeaconState baseState, final SyncAggregate aggregate, final BLSSignatureVerifier signatureVerifier) throws BlockProcessingException {
    final MutableBeaconStateAltair state = MutableBeaconStateAltair.required(baseState);
    final List<BLSPublicKey> participantPubkeys = new ArrayList<>();
    final List<BLSPublicKey> idlePubkeys = new ArrayList<>();
    for (int i = 0; i < specConfigAltair.getSyncCommitteeSize(); i++) {
        final BLSPublicKey publicKey = syncCommitteeUtil.getCurrentSyncCommitteeParticipantPubKey(state, i);
        if (aggregate.getSyncCommitteeBits().getBit(i)) {
            participantPubkeys.add(publicKey);
        } else {
            idlePubkeys.add(publicKey);
        }
    }
    final UInt64 previousSlot = state.getSlot().minusMinZero(1);
    final Bytes32 domain = beaconStateAccessors.getDomain(state.getForkInfo(), Domain.SYNC_COMMITTEE, miscHelpers.computeEpochAtSlot(previousSlot));
    final Bytes32 signingRoot = miscHelpersAltair.computeSigningRoot(beaconStateAccessors.getBlockRootAtSlot(state, previousSlot), domain);
    if (!eth2FastAggregateVerify(signatureVerifier, participantPubkeys, signingRoot, aggregate.getSyncCommitteeSignature().getSignature())) {
        throw new BlockProcessingException("Invalid sync committee signature in " + aggregate);
    }
    // Compute participant and proposer rewards
    final UInt64 totalActiveIncrements = beaconStateAccessors.getTotalActiveBalance(state).dividedBy(specConfig.getEffectiveBalanceIncrement());
    final UInt64 totalBaseRewards = beaconStateAccessorsAltair.getBaseRewardPerIncrement(state).times(totalActiveIncrements);
    final UInt64 maxParticipantRewards = totalBaseRewards.times(SYNC_REWARD_WEIGHT).dividedBy(WEIGHT_DENOMINATOR).dividedBy(specConfig.getSlotsPerEpoch());
    final UInt64 participantReward = maxParticipantRewards.dividedBy(specConfigAltair.getSyncCommitteeSize());
    final UInt64 proposerReward = participantReward.times(PROPOSER_WEIGHT).dividedBy(WEIGHT_DENOMINATOR.minus(PROPOSER_WEIGHT));
    // Apply participant and proposer rewards
    participantPubkeys.stream().map(pubkey -> validatorsUtil.getValidatorIndex(state, pubkey).orElseThrow()).forEach(participantIndex -> beaconStateMutators.increaseBalance(state, participantIndex, participantReward));
    UInt64 totalProposerReward = proposerReward.times(participantPubkeys.size());
    beaconStateMutators.increaseBalance(state, beaconStateAccessors.getBeaconProposerIndex(state), totalProposerReward);
    // impose penalties for any idle validators
    idlePubkeys.stream().map(pubkey -> validatorsUtil.getValidatorIndex(state, pubkey).orElseThrow()).forEach(participantIndex -> beaconStateMutators.decreaseBalance(state, participantIndex, participantReward));
}
Also used : BeaconBlockBodyAltair(tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.BeaconBlockBodyAltair) MiscHelpersAltair(tech.pegasys.teku.spec.logic.versions.altair.helpers.MiscHelpersAltair) AbstractBlockProcessor(tech.pegasys.teku.spec.logic.common.block.AbstractBlockProcessor) PARTICIPATION_FLAG_WEIGHTS(tech.pegasys.teku.spec.logic.versions.altair.helpers.MiscHelpersAltair.PARTICIPATION_FLAG_WEIGHTS) BeaconBlock(tech.pegasys.teku.spec.datastructures.blocks.BeaconBlock) BLSSignatureVerifier(tech.pegasys.teku.bls.BLSSignatureVerifier) ArrayList(java.util.ArrayList) AttestationData(tech.pegasys.teku.spec.datastructures.operations.AttestationData) ExecutionPayload(tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload) SyncCommitteeUtil(tech.pegasys.teku.spec.logic.common.util.SyncCommitteeUtil) SYNC_REWARD_WEIGHT(tech.pegasys.teku.spec.constants.IncentivizationWeights.SYNC_REWARD_WEIGHT) WEIGHT_DENOMINATOR(tech.pegasys.teku.spec.constants.IncentivizationWeights.WEIGHT_DENOMINATOR) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) BeaconStateUtil(tech.pegasys.teku.spec.logic.common.util.BeaconStateUtil) Bytes32(org.apache.tuweni.bytes.Bytes32) Attestation(tech.pegasys.teku.spec.datastructures.operations.Attestation) OperationValidator(tech.pegasys.teku.spec.logic.common.operations.validation.OperationValidator) BlockProcessingException(tech.pegasys.teku.spec.logic.common.statetransition.exceptions.BlockProcessingException) Domain(tech.pegasys.teku.spec.constants.Domain) BeaconStateAccessorsAltair(tech.pegasys.teku.spec.logic.versions.altair.helpers.BeaconStateAccessorsAltair) BLSSignature(tech.pegasys.teku.bls.BLSSignature) BLSPublicKey(tech.pegasys.teku.bls.BLSPublicKey) OptimisticExecutionPayloadExecutor(tech.pegasys.teku.spec.logic.versions.bellatrix.block.OptimisticExecutionPayloadExecutor) SszUInt64List(tech.pegasys.teku.infrastructure.ssz.collections.SszUInt64List) MutableBeaconStateAltair(tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.altair.MutableBeaconStateAltair) ValidatorsUtil(tech.pegasys.teku.spec.logic.common.util.ValidatorsUtil) Deposit(tech.pegasys.teku.spec.datastructures.operations.Deposit) Predicates(tech.pegasys.teku.spec.logic.common.helpers.Predicates) MutableBeaconState(tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState) List(java.util.List) IndexedAttestationCache(tech.pegasys.teku.spec.cache.IndexedAttestationCache) AttestationUtil(tech.pegasys.teku.spec.logic.common.util.AttestationUtil) SszByte(tech.pegasys.teku.infrastructure.ssz.primitive.SszByte) BeaconStateMutators(tech.pegasys.teku.spec.logic.common.helpers.BeaconStateMutators) SszMutableList(tech.pegasys.teku.infrastructure.ssz.SszMutableList) SpecConfigAltair(tech.pegasys.teku.spec.config.SpecConfigAltair) PROPOSER_WEIGHT(tech.pegasys.teku.spec.constants.IncentivizationWeights.PROPOSER_WEIGHT) SszUInt64(tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64) SyncAggregate(tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.SyncAggregate) OperationSignatureVerifier(tech.pegasys.teku.spec.logic.common.operations.OperationSignatureVerifier) BlockProcessingException(tech.pegasys.teku.spec.logic.common.statetransition.exceptions.BlockProcessingException) ArrayList(java.util.ArrayList) BLSPublicKey(tech.pegasys.teku.bls.BLSPublicKey) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) SszUInt64(tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64) MutableBeaconStateAltair(tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.altair.MutableBeaconStateAltair) Bytes32(org.apache.tuweni.bytes.Bytes32)

Example 2 with MutableBeaconState

use of tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState in project teku by ConsenSys.

the class BeaconStateAccessorsAltair method getNextSyncCommittee.

/**
 * Return the *next* sync committee for a given state.
 *
 * <p>SyncCommittee contains an aggregate pubkey that enables resource-constrained clients to save
 * some computation when verifying the sync committee's signature.
 *
 * <p>SyncCommittee can also contain duplicate pubkeys, when {@link
 * #getNextSyncCommitteeIndices(BeaconState)} returns duplicate indices. Implementations must take
 * care when handling optimizations relating to aggregation and verification in the presence of
 * duplicates.
 *
 * <p>Note: This function should only be called at sync committee period boundaries by {@link
 * tech.pegasys.teku.spec.logic.common.statetransition.epoch.EpochProcessor#processSyncCommitteeUpdates(MutableBeaconState)}
 * as {@link #getNextSyncCommitteeIndices(BeaconState)} is not stable within a given period.
 *
 * @param state the state to get the sync committee for
 * @return the SyncCommittee
 */
public SyncCommittee getNextSyncCommittee(final BeaconState state) {
    final IntList indices = getNextSyncCommitteeIndices(state);
    final List<BLSPublicKey> pubkeys = indices.intStream().mapToObj(index -> getValidatorPubKey(state, UInt64.valueOf(index)).orElseThrow()).collect(toList());
    final BLSPublicKey aggregatePubkey = BLSPublicKey.aggregate(pubkeys);
    return state.getBeaconStateSchema().getNextSyncCommitteeSchemaOrThrow().create(pubkeys.stream().map(SszPublicKey::new).collect(toList()), new SszPublicKey(aggregatePubkey));
}
Also used : SszList(tech.pegasys.teku.infrastructure.ssz.SszList) ParticipationFlags(tech.pegasys.teku.spec.constants.ParticipationFlags) SszPublicKey(tech.pegasys.teku.spec.datastructures.type.SszPublicKey) BeaconStateAccessors(tech.pegasys.teku.spec.logic.common.helpers.BeaconStateAccessors) ArrayList(java.util.ArrayList) AttestationData(tech.pegasys.teku.spec.datastructures.operations.AttestationData) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) Bytes32(org.apache.tuweni.bytes.Bytes32) ByteUtil(tech.pegasys.teku.infrastructure.unsigned.ByteUtil) Domain(tech.pegasys.teku.spec.constants.Domain) Validator(tech.pegasys.teku.spec.datastructures.state.Validator) BLSPublicKey(tech.pegasys.teku.bls.BLSPublicKey) MathHelpers.integerSquareRoot(tech.pegasys.teku.spec.logic.common.helpers.MathHelpers.integerSquareRoot) Predicates(tech.pegasys.teku.spec.logic.common.helpers.Predicates) Hash(tech.pegasys.teku.infrastructure.crypto.Hash) SyncCommittee(tech.pegasys.teku.spec.datastructures.state.SyncCommittee) MutableBeaconState(tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState) Collectors.toList(java.util.stream.Collectors.toList) MathHelpers.uint64ToBytes(tech.pegasys.teku.spec.logic.common.helpers.MathHelpers.uint64ToBytes) List(java.util.List) IntList(it.unimi.dsi.fastutil.ints.IntList) BeaconStateCache(tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconStateCache) Checkpoint(tech.pegasys.teku.spec.datastructures.state.Checkpoint) IntArrayList(it.unimi.dsi.fastutil.ints.IntArrayList) SpecConfigAltair(tech.pegasys.teku.spec.config.SpecConfigAltair) BeaconState(tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState) SszPublicKey(tech.pegasys.teku.spec.datastructures.type.SszPublicKey) BLSPublicKey(tech.pegasys.teku.bls.BLSPublicKey) IntList(it.unimi.dsi.fastutil.ints.IntList)

Example 3 with MutableBeaconState

use of tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState in project teku by ConsenSys.

the class BeaconStateMutators method initiateValidatorExit.

public void initiateValidatorExit(MutableBeaconState state, int index) {
    Validator validator = state.getValidators().get(index);
    // Return if validator already initiated exit
    if (!validator.getExit_epoch().equals(FAR_FUTURE_EPOCH)) {
        return;
    }
    // Compute exit queue epoch
    List<UInt64> exit_epochs = state.getValidators().stream().map(Validator::getExit_epoch).filter(exitEpoch -> !exitEpoch.equals(FAR_FUTURE_EPOCH)).collect(toList());
    exit_epochs.add(miscHelpers.computeActivationExitEpoch(beaconStateAccessors.getCurrentEpoch(state)));
    UInt64 exit_queue_epoch = Collections.max(exit_epochs);
    final UInt64 final_exit_queue_epoch = exit_queue_epoch;
    UInt64 exit_queue_churn = UInt64.valueOf(state.getValidators().stream().filter(v -> v.getExit_epoch().equals(final_exit_queue_epoch)).count());
    if (exit_queue_churn.compareTo(beaconStateAccessors.getValidatorChurnLimit(state)) >= 0) {
        exit_queue_epoch = exit_queue_epoch.plus(UInt64.ONE);
    }
    // Set validator exit epoch and withdrawable epoch
    state.getValidators().set(index, validator.withExit_epoch(exit_queue_epoch).withWithdrawable_epoch(exit_queue_epoch.plus(specConfig.getMinValidatorWithdrawabilityDelay())));
}
Also used : MutableBeaconState(tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState) FAR_FUTURE_EPOCH(tech.pegasys.teku.spec.config.SpecConfig.FAR_FUTURE_EPOCH) Collectors.toList(java.util.stream.Collectors.toList) List(java.util.List) SpecConfig(tech.pegasys.teku.spec.config.SpecConfig) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) Collections(java.util.Collections) Validator(tech.pegasys.teku.spec.datastructures.state.Validator) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) Validator(tech.pegasys.teku.spec.datastructures.state.Validator)

Example 4 with MutableBeaconState

use of tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState in project teku by ConsenSys.

the class AbstractBlockProcessor method processDepositWithoutCheckingMerkleProof.

@Override
public void processDepositWithoutCheckingMerkleProof(final MutableBeaconState state, final Deposit deposit, final Object2IntMap<BLSPublicKey> pubKeyToIndexMap) {
    final BLSPublicKey pubkey = deposit.getData().getPubkey();
    state.setEth1_deposit_index(state.getEth1_deposit_index().plus(UInt64.ONE));
    // Find the validator index associated with this deposit, if it exists
    OptionalInt existingIndex;
    if (pubKeyToIndexMap != null) {
        if (pubKeyToIndexMap.containsKey(pubkey)) {
            existingIndex = OptionalInt.of(pubKeyToIndexMap.get(pubkey));
        } else {
            pubKeyToIndexMap.put(pubkey, state.getValidators().size());
            existingIndex = OptionalInt.empty();
        }
    } else {
        Function<Integer, BLSPublicKey> validatorPubkey = index -> beaconStateAccessors.getValidatorPubKey(state, UInt64.valueOf(index)).orElse(null);
        existingIndex = IntStream.range(0, state.getValidators().size()).filter(index -> pubkey.equals(validatorPubkey.apply(index))).findFirst();
    }
    if (existingIndex.isEmpty()) {
        // contract
        if (depositSignatureIsValid(deposit, pubkey)) {
            processNewValidator(state, deposit);
        } else {
            handleInvalidDeposit(deposit, pubkey, pubKeyToIndexMap);
        }
    } else {
        // This validator already exists, increase their balance
        beaconStateMutators.increaseBalance(state, existingIndex.getAsInt(), deposit.getData().getAmount());
    }
}
Also used : IndexedAttestation(tech.pegasys.teku.spec.datastructures.operations.IndexedAttestation) SszList(tech.pegasys.teku.infrastructure.ssz.SszList) BeaconBlock(tech.pegasys.teku.spec.datastructures.blocks.BeaconBlock) BLSSignatureVerifier(tech.pegasys.teku.bls.BLSSignatureVerifier) AttesterSlashing(tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing) OperationInvalidReason(tech.pegasys.teku.spec.logic.common.operations.validation.OperationInvalidReason) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) Eth1Data(tech.pegasys.teku.spec.datastructures.blocks.Eth1Data) Bytes32(org.apache.tuweni.bytes.Bytes32) MiscHelpers(tech.pegasys.teku.spec.logic.common.helpers.MiscHelpers) BLS(tech.pegasys.teku.bls.BLS) BatchSignatureVerifier(tech.pegasys.teku.spec.logic.common.statetransition.blockvalidator.BatchSignatureVerifier) Predicates(tech.pegasys.teku.spec.logic.common.helpers.Predicates) BeaconBlockBody(tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBody) MutableBeaconState(tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState) StateTransitionException(tech.pegasys.teku.spec.logic.common.statetransition.exceptions.StateTransitionException) FAR_FUTURE_EPOCH(tech.pegasys.teku.spec.config.SpecConfig.FAR_FUTURE_EPOCH) List(java.util.List) Logger(org.apache.logging.log4j.Logger) IndexedAttestationCache(tech.pegasys.teku.spec.cache.IndexedAttestationCache) AttestationUtil(tech.pegasys.teku.spec.logic.common.util.AttestationUtil) Optional(java.util.Optional) DepositMessage(tech.pegasys.teku.spec.datastructures.operations.DepositMessage) BeaconStateMutators(tech.pegasys.teku.spec.logic.common.helpers.BeaconStateMutators) OperationSignatureVerifier(tech.pegasys.teku.spec.logic.common.operations.OperationSignatureVerifier) IntStream(java.util.stream.IntStream) AttestationProcessingResult(tech.pegasys.teku.spec.datastructures.util.AttestationProcessingResult) BeaconBlockSummary(tech.pegasys.teku.spec.datastructures.blocks.BeaconBlockSummary) CapturingIndexedAttestationCache(tech.pegasys.teku.spec.cache.CapturingIndexedAttestationCache) SignedVoluntaryExit(tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit) BeaconStateAccessors(tech.pegasys.teku.spec.logic.common.helpers.BeaconStateAccessors) Bytes(org.apache.tuweni.bytes.Bytes) OptionalInt(java.util.OptionalInt) Function(java.util.function.Function) BeaconBlockHeader(tech.pegasys.teku.spec.datastructures.blocks.BeaconBlockHeader) ArrayList(java.util.ArrayList) AttestationData(tech.pegasys.teku.spec.datastructures.operations.AttestationData) ProposerSlashing(tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) Math.toIntExact(java.lang.Math.toIntExact) SignedBeaconBlock(tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock) BeaconStateUtil(tech.pegasys.teku.spec.logic.common.util.BeaconStateUtil) Attestation(tech.pegasys.teku.spec.datastructures.operations.Attestation) OperationValidator(tech.pegasys.teku.spec.logic.common.operations.validation.OperationValidator) BlockProcessingException(tech.pegasys.teku.spec.logic.common.statetransition.exceptions.BlockProcessingException) Domain(tech.pegasys.teku.spec.constants.Domain) Validator(tech.pegasys.teku.spec.datastructures.state.Validator) BlockValidationResult(tech.pegasys.teku.spec.logic.common.statetransition.blockvalidator.BlockValidationResult) BLSPublicKey(tech.pegasys.teku.bls.BLSPublicKey) SpecConfig(tech.pegasys.teku.spec.config.SpecConfig) OptimisticExecutionPayloadExecutor(tech.pegasys.teku.spec.logic.versions.bellatrix.block.OptimisticExecutionPayloadExecutor) ValidatorsUtil(tech.pegasys.teku.spec.logic.common.util.ValidatorsUtil) Deposit(tech.pegasys.teku.spec.datastructures.operations.Deposit) Hash(tech.pegasys.teku.infrastructure.crypto.Hash) CheckReturnValue(javax.annotation.CheckReturnValue) DepositWithIndex(tech.pegasys.teku.spec.datastructures.operations.DepositWithIndex) IntList(it.unimi.dsi.fastutil.ints.IntList) Object2IntMap(it.unimi.dsi.fastutil.objects.Object2IntMap) Bytes4(tech.pegasys.teku.infrastructure.bytes.Bytes4) LogFormatter(tech.pegasys.teku.infrastructure.logging.LogFormatter) LogManager(org.apache.logging.log4j.LogManager) DepositData(tech.pegasys.teku.spec.datastructures.operations.DepositData) BeaconState(tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState) OptionalInt(java.util.OptionalInt) BLSPublicKey(tech.pegasys.teku.bls.BLSPublicKey)

Example 5 with MutableBeaconState

use of tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState in project teku by ConsenSys.

the class AbstractEpochProcessor method processRegistryUpdates.

/**
 * Processes validator registry updates
 */
@Override
public void processRegistryUpdates(MutableBeaconState state, List<ValidatorStatus> statuses) throws EpochProcessingException {
    try {
        // Process activation eligibility and ejections
        SszMutableList<Validator> validators = state.getValidators();
        final UInt64 currentEpoch = beaconStateAccessors.getCurrentEpoch(state);
        for (int index = 0; index < validators.size(); index++) {
            final ValidatorStatus status = statuses.get(index);
            // confirm it isn't already in the queue.
            if (!status.isActiveInCurrentEpoch() && status.getCurrentEpochEffectiveBalance().equals(specConfig.getMaxEffectiveBalance())) {
                final Validator validator = validators.get(index);
                if (validator.getActivation_eligibility_epoch().equals(SpecConfig.FAR_FUTURE_EPOCH)) {
                    validators.set(index, validator.withActivation_eligibility_epoch(currentEpoch.plus(UInt64.ONE)));
                }
            }
            if (status.isActiveInCurrentEpoch() && status.getCurrentEpochEffectiveBalance().isLessThanOrEqualTo(specConfig.getEjectionBalance())) {
                beaconStateMutators.initiateValidatorExit(state, index);
            }
        }
        // Queue validators eligible for activation and not yet dequeued for activation
        List<Integer> activationQueue = IntStream.range(0, state.getValidators().size()).filter(index -> !statuses.get(index).isActiveInCurrentEpoch()).filter(index -> {
            Validator validator = state.getValidators().get(index);
            return validatorsUtil.isEligibleForActivation(state, validator);
        }).boxed().sorted((index1, index2) -> {
            int comparisonResult = state.getValidators().get(index1).getActivation_eligibility_epoch().compareTo(state.getValidators().get(index2).getActivation_eligibility_epoch());
            if (comparisonResult == 0) {
                return index1.compareTo(index2);
            } else {
                return comparisonResult;
            }
        }).collect(Collectors.toList());
        // Dequeued validators for activation up to churn limit (without resetting activation epoch)
        int churnLimit = beaconStateAccessors.getValidatorChurnLimit(state).intValue();
        int sublistSize = Math.min(churnLimit, activationQueue.size());
        for (Integer index : activationQueue.subList(0, sublistSize)) {
            state.getValidators().update(index, validator -> validator.withActivation_epoch(miscHelpers.computeActivationExitEpoch(currentEpoch)));
        }
    } catch (IllegalArgumentException e) {
        throw new EpochProcessingException(e);
    }
}
Also used : IntStream(java.util.stream.IntStream) ValidatorStatusFactory(tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatusFactory) SszList(tech.pegasys.teku.infrastructure.ssz.SszList) BeaconStateAccessors(tech.pegasys.teku.spec.logic.common.helpers.BeaconStateAccessors) TotalBalances(tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.TotalBalances) HistoricalBatch(tech.pegasys.teku.spec.datastructures.state.HistoricalBatch) RewardAndPenalty(tech.pegasys.teku.spec.logic.common.statetransition.epoch.RewardAndPenaltyDeltas.RewardAndPenalty) SszBitvector(tech.pegasys.teku.infrastructure.ssz.collections.SszBitvector) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) ValidatorStatus(tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatus) BeaconStateUtil(tech.pegasys.teku.spec.logic.common.util.BeaconStateUtil) ValidatorStatuses(tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatuses) Validator(tech.pegasys.teku.spec.datastructures.state.Validator) MiscHelpers(tech.pegasys.teku.spec.logic.common.helpers.MiscHelpers) SszMutableUInt64List(tech.pegasys.teku.infrastructure.ssz.collections.SszMutableUInt64List) SpecConfig(tech.pegasys.teku.spec.config.SpecConfig) SszUInt64List(tech.pegasys.teku.infrastructure.ssz.collections.SszUInt64List) SchemaDefinitions(tech.pegasys.teku.spec.schemas.SchemaDefinitions) ValidatorsUtil(tech.pegasys.teku.spec.logic.common.util.ValidatorsUtil) Collectors(java.util.stream.Collectors) MutableBeaconState(tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState) List(java.util.List) EpochProcessingException(tech.pegasys.teku.spec.logic.common.statetransition.exceptions.EpochProcessingException) BeaconStateMutators(tech.pegasys.teku.spec.logic.common.helpers.BeaconStateMutators) SszMutableList(tech.pegasys.teku.infrastructure.ssz.SszMutableList) Checkpoint(tech.pegasys.teku.spec.datastructures.state.Checkpoint) BeaconState(tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState) EpochProcessingException(tech.pegasys.teku.spec.logic.common.statetransition.exceptions.EpochProcessingException) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) Validator(tech.pegasys.teku.spec.datastructures.state.Validator) Checkpoint(tech.pegasys.teku.spec.datastructures.state.Checkpoint) ValidatorStatus(tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatus)

Aggregations

MutableBeaconState (tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState)6 List (java.util.List)5 UInt64 (tech.pegasys.teku.infrastructure.unsigned.UInt64)5 Validator (tech.pegasys.teku.spec.datastructures.state.Validator)4 ArrayList (java.util.ArrayList)3 Bytes32 (org.apache.tuweni.bytes.Bytes32)3 BLSPublicKey (tech.pegasys.teku.bls.BLSPublicKey)3 SszList (tech.pegasys.teku.infrastructure.ssz.SszList)3 SpecConfig (tech.pegasys.teku.spec.config.SpecConfig)3 Domain (tech.pegasys.teku.spec.constants.Domain)3 AttestationData (tech.pegasys.teku.spec.datastructures.operations.AttestationData)3 BeaconState (tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState)3 BeaconStateAccessors (tech.pegasys.teku.spec.logic.common.helpers.BeaconStateAccessors)3 BeaconStateMutators (tech.pegasys.teku.spec.logic.common.helpers.BeaconStateMutators)3 Predicates (tech.pegasys.teku.spec.logic.common.helpers.Predicates)3 BeaconStateUtil (tech.pegasys.teku.spec.logic.common.util.BeaconStateUtil)3 ValidatorsUtil (tech.pegasys.teku.spec.logic.common.util.ValidatorsUtil)3 IntList (it.unimi.dsi.fastutil.ints.IntList)2 Collectors.toList (java.util.stream.Collectors.toList)2 BLSSignatureVerifier (tech.pegasys.teku.bls.BLSSignatureVerifier)2