use of tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair in project teku by ConsenSys.
the class ValidatorDataProvider method getAggregationBits.
private IntIterable getAggregationBits(final Bytes aggregationBits, final UInt64 slot) {
final SchemaDefinitionsAltair altairDefinitions = SchemaDefinitionsAltair.required(spec.atSlot(slot).getSchemaDefinitions());
final SyncCommitteeContributionSchema syncCommitteeContributionSchema = altairDefinitions.getSyncCommitteeContributionSchema();
final SszBitvector aggregationBitsVector = syncCommitteeContributionSchema.getAggregationBitsSchema().fromBytes(aggregationBits);
return aggregationBitsVector.getAllSetBits();
}
use of tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair in project teku by ConsenSys.
the class SyncCommitteeContribution method asInternalSyncCommitteeContribution.
public static tech.pegasys.teku.spec.datastructures.operations.versions.altair.SyncCommitteeContribution asInternalSyncCommitteeContribution(final Spec spec, final SyncCommitteeContribution syncCommitteeContribution) {
final SchemaDefinitionsAltair altairDefinitions = SchemaDefinitionsAltair.required(spec.atSlot(syncCommitteeContribution.slot).getSchemaDefinitions());
final SyncCommitteeContributionSchema syncCommitteeContributionSchema = altairDefinitions.getSyncCommitteeContributionSchema();
final SszBitvector aggregationBitsVector = syncCommitteeContributionSchema.getAggregationBitsSchema().fromBytes(syncCommitteeContribution.aggregationBits);
return spec.getSyncCommitteeUtilRequired(syncCommitteeContribution.slot).createSyncCommitteeContribution(syncCommitteeContribution.slot, syncCommitteeContribution.beaconBlockRoot, syncCommitteeContribution.subcommitteeIndex, aggregationBitsVector.getAllSetBits(), syncCommitteeContribution.signature.asInternalBLSSignature());
}
use of tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair in project teku by ConsenSys.
the class GossipForkSubscriptionsAltair method addGossipManagers.
@Override
protected void addGossipManagers(final ForkInfo forkInfo) {
super.addGossipManagers(forkInfo);
final SchemaDefinitionsAltair schemaDefinitions = SchemaDefinitionsAltair.required(spec.atEpoch(getActivationEpoch()).getSchemaDefinitions());
syncCommitteeContributionGossipManager = new SignedContributionAndProofGossipManager(recentChainData, schemaDefinitions, asyncRunner, discoveryNetwork, gossipEncoding, forkInfo, signedContributionAndProofOperationProcessor, getMessageMaxSize());
addGossipManager(syncCommitteeContributionGossipManager);
final SyncCommitteeSubnetSubscriptions syncCommitteeSubnetSubscriptions = new SyncCommitteeSubnetSubscriptions(spec, recentChainData, discoveryNetwork, gossipEncoding, schemaDefinitions, asyncRunner, syncCommitteeMessageOperationProcessor, forkInfo, getMessageMaxSize());
syncCommitteeMessageGossipManager = new SyncCommitteeMessageGossipManager(metricsSystem, spec, new SyncCommitteeStateUtils(spec, recentChainData), syncCommitteeSubnetSubscriptions);
addGossipManager(syncCommitteeMessageGossipManager);
}
use of tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair in project teku by ConsenSys.
the class SpecVersion method createAltair.
static SpecVersion createAltair(final SpecConfigAltair specConfig) {
final SchemaDefinitionsAltair schemaDefinitions = new SchemaDefinitionsAltair(specConfig);
final SpecLogic specLogic = SpecLogicAltair.create(specConfig, schemaDefinitions);
return new SpecVersion(SpecMilestone.ALTAIR, specConfig, schemaDefinitions, specLogic);
}
Aggregations