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());
}
}
Aggregations