Search in sources :

Example 1 with HistoricalBatch

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

the class AbstractEpochProcessor method processHistoricalRootsUpdate.

@Override
public void processHistoricalRootsUpdate(final MutableBeaconState state) {
    final UInt64 nextEpoch = beaconStateAccessors.getCurrentEpoch(state).plus(1);
    // Set historical root accumulator
    if (nextEpoch.mod(specConfig.getSlotsPerHistoricalRoot() / specConfig.getSlotsPerEpoch()).equals(UInt64.ZERO)) {
        HistoricalBatch historicalBatch = schemaDefinitions.getHistoricalBatchSchema().create(state.getBlock_roots(), state.getState_roots());
        state.getHistorical_roots().appendElement(historicalBatch.hashTreeRoot());
    }
}
Also used : HistoricalBatch(tech.pegasys.teku.spec.datastructures.state.HistoricalBatch) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64)

Aggregations

UInt64 (tech.pegasys.teku.infrastructure.unsigned.UInt64)1 HistoricalBatch (tech.pegasys.teku.spec.datastructures.state.HistoricalBatch)1