Search in sources :

Example 1 with SchemaDefinitionsAltair

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();
}
Also used : SchemaDefinitionsAltair(tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair) SyncCommitteeContributionSchema(tech.pegasys.teku.spec.datastructures.operations.versions.altair.SyncCommitteeContributionSchema) SszBitvector(tech.pegasys.teku.infrastructure.ssz.collections.SszBitvector)

Example 2 with SchemaDefinitionsAltair

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());
}
Also used : SchemaDefinitionsAltair(tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair) SyncCommitteeContributionSchema(tech.pegasys.teku.spec.datastructures.operations.versions.altair.SyncCommitteeContributionSchema) SszBitvector(tech.pegasys.teku.infrastructure.ssz.collections.SszBitvector)

Example 3 with SchemaDefinitionsAltair

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);
}
Also used : SyncCommitteeStateUtils(tech.pegasys.teku.statetransition.synccommittee.SyncCommitteeStateUtils) SchemaDefinitionsAltair(tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair) SignedContributionAndProofGossipManager(tech.pegasys.teku.networking.eth2.gossip.SignedContributionAndProofGossipManager) SyncCommitteeSubnetSubscriptions(tech.pegasys.teku.networking.eth2.gossip.subnets.SyncCommitteeSubnetSubscriptions) SyncCommitteeMessageGossipManager(tech.pegasys.teku.networking.eth2.gossip.SyncCommitteeMessageGossipManager)

Example 4 with SchemaDefinitionsAltair

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);
}
Also used : SchemaDefinitionsAltair(tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair) DelegatingSpecLogic(tech.pegasys.teku.spec.logic.DelegatingSpecLogic) SpecLogic(tech.pegasys.teku.spec.logic.SpecLogic)

Aggregations

SchemaDefinitionsAltair (tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair)4 SszBitvector (tech.pegasys.teku.infrastructure.ssz.collections.SszBitvector)2 SyncCommitteeContributionSchema (tech.pegasys.teku.spec.datastructures.operations.versions.altair.SyncCommitteeContributionSchema)2 SignedContributionAndProofGossipManager (tech.pegasys.teku.networking.eth2.gossip.SignedContributionAndProofGossipManager)1 SyncCommitteeMessageGossipManager (tech.pegasys.teku.networking.eth2.gossip.SyncCommitteeMessageGossipManager)1 SyncCommitteeSubnetSubscriptions (tech.pegasys.teku.networking.eth2.gossip.subnets.SyncCommitteeSubnetSubscriptions)1 DelegatingSpecLogic (tech.pegasys.teku.spec.logic.DelegatingSpecLogic)1 SpecLogic (tech.pegasys.teku.spec.logic.SpecLogic)1 SyncCommitteeStateUtils (tech.pegasys.teku.statetransition.synccommittee.SyncCommitteeStateUtils)1