Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ allprojects {
}

def nightly = System.getenv("NIGHTLY") != null
def refTestVersion = nightly ? "nightly" : "v1.5.0"
def refTestVersion = nightly ? "nightly" : "v1.6.0-alpha.0"
def blsRefTestVersion = 'v0.1.2'
def slashingProtectionInterchangeRefTestVersion = 'v5.3.0'
def refTestBaseUrl = 'https://github.com/ethereum/consensus-spec-tests/releases/download'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import tech.pegasys.teku.reference.common.epoch_processing.EpochProcessingTestExecutor;
import tech.pegasys.teku.reference.common.operations.OperationsTestExecutor;
import tech.pegasys.teku.reference.deneb.merkle_proof.MerkleProofTests;
import tech.pegasys.teku.reference.fulu.network.ComputeColumnsForCustodyGroupTestExecutor;
import tech.pegasys.teku.reference.fulu.network.GetCustodyGroupTestExecutor;
import tech.pegasys.teku.reference.phase0.bls.BlsTests;
import tech.pegasys.teku.reference.phase0.forkchoice.ForkChoiceTestExecutor;
import tech.pegasys.teku.reference.phase0.genesis.GenesisTests;
Expand Down Expand Up @@ -100,14 +102,14 @@ public abstract class Eth2ReferenceTestCase {

private static final ImmutableMap<String, TestExecutor> FULU_TEST_TYPES =
ImmutableMap.<String, TestExecutor>builder()
.putAll(TransitionTestExecutor.TRANSITION_TEST_TYPES)
.putAll(ForkUpgradeTestExecutor.FORK_UPGRADE_TEST_TYPES)
.putAll(RewardsTestExecutorBellatrix.REWARDS_TEST_TYPES)
.put("merkle_proof/single_merkle_proof", TestExecutor.IGNORE_TESTS)
// TODO-fulu enable merkle proof tests
// .putAll(MerkleProofTests.MERKLE_PROOF_TEST_TYPES)
// TODO-fulu networking test types (networking/compute_columns_for_custody_group)
.put("networking/get_custody_groups", TestExecutor.IGNORE_TESTS)
.put("networking/compute_columns_for_custody_group", TestExecutor.IGNORE_TESTS)
.putAll(MerkleProofTests.MERKLE_PROOF_TEST_TYPES)
.put("networking/get_custody_groups", new GetCustodyGroupTestExecutor())
.put(
"networking/compute_columns_for_custody_group",
new ComputeColumnsForCustodyGroupTestExecutor())
.build();

protected void runReferenceTest(final TestDefinition testDefinition) throws Throwable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ private void processUpgrade(final TestDefinition testDefinition, final MetaData
.capellaBuilder(c -> c.capellaForkEpoch(UInt64.ZERO))
.denebBuilder(d -> d.denebForkEpoch(UInt64.ZERO))
.electraBuilder(e -> e.electraForkEpoch(forkEpoch));
case FULU ->
builder
.altairBuilder(a -> a.altairForkEpoch(UInt64.ZERO))
.bellatrixBuilder(b -> b.bellatrixForkEpoch(UInt64.ZERO))
.capellaBuilder(c -> c.capellaForkEpoch(UInt64.ZERO))
.denebBuilder(d -> d.denebForkEpoch(UInt64.ZERO))
.electraBuilder(e -> e.electraForkEpoch(UInt64.ZERO))
.fuluBuilder(f -> f.fuluForkEpoch(forkEpoch));
default ->
throw new IllegalStateException(
"Unhandled fork transition for test "
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright Consensys Software Inc., 2025
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/

package tech.pegasys.teku.reference.fulu.network;

import static org.assertj.core.api.Assertions.assertThat;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.IOException;
import java.util.List;
import java.util.stream.Collectors;
import tech.pegasys.teku.ethtests.finder.TestDefinition;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.reference.TestDataUtils;
import tech.pegasys.teku.reference.TestExecutor;
import tech.pegasys.teku.spec.logic.versions.fulu.helpers.MiscHelpersFulu;

public class ComputeColumnsForCustodyGroupTestExecutor implements TestExecutor {

@Override
public void runTest(final TestDefinition testDefinition) throws Throwable {
final MiscHelpersFulu miscHelpersFulu =
MiscHelpersFulu.required(testDefinition.getSpec().getGenesisSpec().miscHelpers());
final Data data = loadDataFile(testDefinition, Data.class);

final List<UInt64> calculatedColumns =
miscHelpersFulu.computeColumnsForCustodyGroup(data.custodyGroup());

assertThat(calculatedColumns).isEqualTo(data.expectedColumns());
}

private static class Data {

@JsonProperty(value = "custody_group", required = true)
private Integer custodyGroup;

@JsonProperty(value = "result", required = true)
private List<Integer> result;

public UInt64 custodyGroup() {
return UInt64.valueOf(custodyGroup);
}

public List<UInt64> expectedColumns() {
return result.stream().map(UInt64::valueOf).collect(Collectors.toList());
}
}

protected <T> T loadDataFile(final TestDefinition testDefinition, final Class<T> type)
throws IOException {
return TestDataUtils.loadYaml(testDefinition, "meta.yaml", type);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright Consensys Software Inc., 2025
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/

package tech.pegasys.teku.reference.fulu.network;

import static org.assertj.core.api.Assertions.assertThat;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.IOException;
import java.math.BigInteger;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.tuweni.units.bigints.UInt256;
import tech.pegasys.teku.ethtests.finder.TestDefinition;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.reference.TestDataUtils;
import tech.pegasys.teku.reference.TestExecutor;
import tech.pegasys.teku.spec.logic.versions.fulu.helpers.MiscHelpersFulu;

public class GetCustodyGroupTestExecutor implements TestExecutor {

@Override
public void runTest(final TestDefinition testDefinition) throws Throwable {
final MiscHelpersFulu miscHelpersFulu =
MiscHelpersFulu.required(testDefinition.getSpec().getGenesisSpec().miscHelpers());
final Data data = loadDataFile(testDefinition, Data.class);

final List<UInt64> calculatedCustodyGroups =
miscHelpersFulu.getCustodyGroups(data.nodeId(), data.custodyGroupCount);

assertThat(calculatedCustodyGroups).isEqualTo(data.expectedCustodyGroups());
}

private static class Data {

@JsonProperty(value = "node_id", required = true)
private String nodeId;

@JsonProperty(value = "custody_group_count", required = true)
private Integer custodyGroupCount;

@JsonProperty(value = "result", required = true)
private List<Integer> result;

public UInt256 nodeId() {
return UInt256.valueOf(new BigInteger(this.nodeId, 10));
}

public List<UInt64> expectedCustodyGroups() {
return result.stream().map(UInt64::valueOf).collect(Collectors.toList());
}
}

protected <T> T loadDataFile(final TestDefinition testDefinition, final Class<T> type)
throws IOException {
return TestDataUtils.loadYaml(testDefinition, "meta.yaml", type);
}
}