Skip to content

Commit

Permalink
Fix wrong activation for EIP7594
Browse files Browse the repository at this point in the history
  • Loading branch information
zilm13 committed Nov 28, 2024
1 parent b6fbe82 commit 5365458
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
import tech.pegasys.teku.spec.datastructures.operations.versions.altair.SignedContributionAndProof;
import tech.pegasys.teku.spec.datastructures.operations.versions.altair.ValidatableSyncCommitteeMessage;
import tech.pegasys.teku.spec.datastructures.state.Checkpoint;
import tech.pegasys.teku.spec.datastructures.state.Fork;
import tech.pegasys.teku.spec.datastructures.util.ForkAndSpecMilestone;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsSupplier;
import tech.pegasys.teku.statetransition.datacolumns.DataColumnSidecarByRootCustody;
Expand Down Expand Up @@ -239,16 +240,17 @@ private GossipForkManager buildGossipForkManager(
.forEach(gossipForkManagerBuilder::fork);
// TODO: fix ELECTRA and EIP7594 hardcode
if (spec.isFeatureScheduled(SpecFeature.EIP7594)) {
final UInt64 activationEpoch =
Eip7594.required(spec.forMilestone(SpecMilestone.ELECTRA).getConfig())
.getEip7594FeatureEpoch();
final Fork fork = spec.getForkSchedule().getFork(activationEpoch);
spec.getEnabledFeatures().stream()
.map(
specFeature ->
createFeatureSubscriptions(
spec.getEnabledMilestones().stream()
.filter(
forkAndSpecMilestone ->
forkAndSpecMilestone
.getSpecMilestone()
.equals(SpecMilestone.ELECTRA))
forkAndSpecMilestone -> forkAndSpecMilestone.getFork().equals(fork))
.findFirst()
.orElseThrow(),
specFeature,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

package tech.pegasys.teku.networking.eth2.gossip.forks.versions;

import com.google.common.base.MoreObjects;
import java.util.ArrayList;
import java.util.List;
import org.apache.tuweni.bytes.Bytes32;
Expand Down Expand Up @@ -264,4 +265,12 @@ public void subscribeToAttestationSubnetId(final int subnetId) {
public void unsubscribeFromAttestationSubnetId(final int subnetId) {
attestationGossipManager.unsubscribeFromSubnetId(subnetId);
}

@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("fork", fork)
.add("activationEpoch", getActivationEpoch())
.toString();
}
}

0 comments on commit 5365458

Please sign in to comment.