Skip to content

Commit 2822af2

Browse files
Update ref tests to v1.6.0-beta.1 (#10048)
1 parent 127c174 commit 2822af2

File tree

24 files changed

+189
-118
lines changed

24 files changed

+189
-118
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,10 @@ allprojects {
331331
}
332332

333333
def nightly = System.getenv("NIGHTLY") != null
334-
def refTestVersion = nightly ? "nightly" : "v1.6.0-beta.0"
334+
def refTestVersion = nightly ? "nightly" : "v1.6.0-beta.1"
335335
def blsRefTestVersion = 'v0.1.2'
336336
def slashingProtectionInterchangeRefTestVersion = 'v5.3.0'
337-
def refTestBaseUrl = 'https://github.com/ethereum/consensus-spec-tests/releases/download'
337+
def refTestBaseUrl = 'https://github.com/ethereum/consensus-specs/releases/download'
338338
def blsRefTestBaseUrl = 'https://github.com/ethereum/bls12-381-tests/releases/download'
339339
def slashingProtectionInterchangeRefTestBaseUrl = 'https://github.com/eth-clients/slashing-protection-interchange-tests/archive/refs/tags'
340340
def refTestDownloadDir = "${buildDir}/refTests/${refTestVersion}"

eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/ssz_generic/SszGenericTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class SszGenericTests {
2929
.put("ssz_generic/containers", new SszGenericContainerTestExecutor())
3030
.put("ssz_generic/progressive_bitlist", TestExecutor.IGNORE_TESTS)
3131
.put("ssz_generic/progressive_containers", TestExecutor.IGNORE_TESTS)
32+
.put("ssz_generic/compatible_unions", TestExecutor.IGNORE_TESTS)
3233
.put("ssz_generic/uints", new SszGenericUIntTestExecutor())
3334
.build();
3435
}

ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/DataColumnSidecarBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public interface DataColumnSidecarBuilder {
3636

3737
DataColumnSidecarBuilder kzgCommitmentsInclusionProof(List<Bytes32> kzgCommitmentsInclusionProof);
3838

39-
DataColumnSidecarBuilder beaconBlockRoot(Bytes32 beaconBlockRoot);
40-
4139
DataColumnSidecarBuilder slot(UInt64 slot);
4240

41+
DataColumnSidecarBuilder beaconBlockRoot(Bytes32 beaconBlockRoot);
42+
4343
DataColumnSidecar build();
4444
}

ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/DataColumnSidecarSchema.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public interface DataColumnSidecarSchema<T extends DataColumnSidecar>
3030
SszFieldName FIELD_KZG_PROOFS = () -> "kzg_proofs";
3131
SszFieldName FIELD_SIGNED_BLOCK_HEADER = () -> "signed_block_header";
3232
SszFieldName FIELD_KZG_COMMITMENTS_INCLUSION_PROOF = () -> "kzg_commitments_inclusion_proof";
33+
SszFieldName FIELD_SLOT = () -> "slot";
3334
SszFieldName FIELD_BEACON_BLOCK_ROOT = () -> "beacon_block_root";
3435

3536
@Override

ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/fulu/DataColumnSidecarBuilderFulu.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ public DataColumnSidecarBuilder kzgCommitmentsInclusionProof(
8080
}
8181

8282
@Override
83-
public DataColumnSidecarBuilder beaconBlockRoot(final Bytes32 beaconBlockRoot) {
83+
public DataColumnSidecarBuilder slot(final UInt64 slot) {
8484
// NO-OP for Fulu
8585
return this;
8686
}
8787

8888
@Override
89-
public DataColumnSidecarBuilder slot(final UInt64 slot) {
89+
public DataColumnSidecarBuilder beaconBlockRoot(final Bytes32 beaconBlockRoot) {
9090
// NO-OP for Fulu
9191
return this;
9292
}

ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/gloas/DataColumnSidecarBuilderGloas.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class DataColumnSidecarBuilderGloas extends DataColumnSidecarBuilderFulu
2727

2828
private DataColumnSidecarSchemaGloas schema;
2929

30+
protected UInt64 slot;
3031
protected Bytes32 beaconBlockRoot;
3132

3233
public DataColumnSidecarBuilderGloas schema(final DataColumnSidecarSchemaGloas schema) {
@@ -49,22 +50,22 @@ public DataColumnSidecarBuilder kzgCommitmentsInclusionProof(
4950
}
5051

5152
@Override
52-
public DataColumnSidecarBuilder beaconBlockRoot(final Bytes32 beaconBlockRoot) {
53-
this.beaconBlockRoot = beaconBlockRoot;
53+
public DataColumnSidecarBuilder slot(final UInt64 slot) {
54+
this.slot = slot;
5455
return this;
5556
}
5657

5758
@Override
58-
public DataColumnSidecarBuilder slot(final UInt64 slot) {
59-
// TODO-GLOAS: https://github.com/ethereum/consensus-specs/pull/4645
59+
public DataColumnSidecarBuilder beaconBlockRoot(final Bytes32 beaconBlockRoot) {
60+
this.beaconBlockRoot = beaconBlockRoot;
6061
return this;
6162
}
6263

6364
@Override
6465
public DataColumnSidecar build() {
6566
validate();
6667
return new DataColumnSidecarGloas(
67-
schema, index, column, kzgCommitments, kzgProofs, beaconBlockRoot);
68+
schema, index, column, kzgCommitments, kzgProofs, slot, beaconBlockRoot);
6869
}
6970

7071
@Override
@@ -74,6 +75,7 @@ protected void validate() {
7475
checkNotNull(column, "column must be specified");
7576
checkNotNull(kzgCommitments, "kzgCommitments must be specified");
7677
checkNotNull(kzgProofs, "kzgProofs must be specified");
78+
checkNotNull(slot, "slot must be specified");
7779
checkNotNull(beaconBlockRoot, "beaconBlockRoot must be specified");
7880
}
7981
}

ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/gloas/DataColumnSidecarGloas.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import java.util.Optional;
1717
import org.apache.tuweni.bytes.Bytes32;
1818
import tech.pegasys.teku.infrastructure.ssz.SszList;
19-
import tech.pegasys.teku.infrastructure.ssz.containers.Container5;
19+
import tech.pegasys.teku.infrastructure.ssz.containers.Container6;
2020
import tech.pegasys.teku.infrastructure.ssz.primitive.SszBytes32;
2121
import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64;
2222
import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode;
@@ -28,12 +28,13 @@
2828
import tech.pegasys.teku.spec.datastructures.type.SszKZGProof;
2929

3030
public class DataColumnSidecarGloas
31-
extends Container5<
31+
extends Container6<
3232
DataColumnSidecarGloas,
3333
SszUInt64,
3434
DataColumn,
3535
SszList<SszKZGCommitment>,
3636
SszList<SszKZGProof>,
37+
SszUInt64,
3738
SszBytes32>
3839
implements DataColumnSidecar {
3940

@@ -47,13 +48,15 @@ public class DataColumnSidecarGloas
4748
final DataColumn column,
4849
final SszList<SszKZGCommitment> kzgCommitments,
4950
final SszList<SszKZGProof> kzgProofs,
51+
final UInt64 slot,
5052
final Bytes32 beaconBlockRoot) {
5153
super(
5254
schema,
5355
SszUInt64.of(index),
5456
column,
5557
kzgCommitments,
5658
kzgProofs,
59+
SszUInt64.of(slot),
5760
SszBytes32.of(beaconBlockRoot));
5861
}
5962

@@ -77,15 +80,14 @@ public SszList<SszKZGProof> getKzgProofs() {
7780
return getField3();
7881
}
7982

80-
// TODO-GLOAS: https://github.com/ethereum/consensus-specs/pull/4645
8183
@Override
8284
public UInt64 getSlot() {
83-
throw new UnsupportedOperationException("Not yet implemented");
85+
return getField4().get();
8486
}
8587

8688
@Override
8789
public Bytes32 getBeaconBlockRoot() {
88-
return getField4().get();
90+
return getField5().get();
8991
}
9092

9193
@Override

ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/gloas/DataColumnSidecarSchemaGloas.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import java.util.function.Consumer;
1717
import tech.pegasys.teku.infrastructure.ssz.SszList;
18-
import tech.pegasys.teku.infrastructure.ssz.containers.ContainerSchema5;
18+
import tech.pegasys.teku.infrastructure.ssz.containers.ContainerSchema6;
1919
import tech.pegasys.teku.infrastructure.ssz.primitive.SszBytes32;
2020
import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64;
2121
import tech.pegasys.teku.infrastructure.ssz.schema.SszListSchema;
@@ -33,12 +33,13 @@
3333
import tech.pegasys.teku.spec.datastructures.type.SszKZGProofSchema;
3434

3535
public class DataColumnSidecarSchemaGloas
36-
extends ContainerSchema5<
36+
extends ContainerSchema6<
3737
DataColumnSidecarGloas,
3838
SszUInt64,
3939
DataColumn,
4040
SszList<SszKZGCommitment>,
4141
SszList<SszKZGProof>,
42+
SszUInt64,
4243
SszBytes32>
4344
implements DataColumnSidecarSchema<DataColumnSidecarGloas> {
4445

@@ -56,6 +57,7 @@ public DataColumnSidecarSchemaGloas(
5657
FIELD_KZG_PROOFS,
5758
SszListSchema.create(
5859
SszKZGProofSchema.INSTANCE, specConfig.getMaxBlobCommitmentsPerBlock())),
60+
namedSchema(FIELD_SLOT, SszPrimitiveSchemas.UINT64_SCHEMA),
5961
namedSchema(FIELD_BEACON_BLOCK_ROOT, SszPrimitiveSchemas.BYTES32_SCHEMA));
6062
}
6163

ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/BlockRewardCalculatorUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private long calculateAttestationRewards(
159159
.map(
160160
attestation ->
161161
blockProcessor
162-
.calculateAttestationProcessingResult(
162+
.processAttestation(
163163
mutableBeaconStateAltair, attestation, indexedAttestationProvider)
164164
.proposerReward())
165165
.filter(Optional::isPresent)

ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/altair/block/BlockProcessorAltair.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,14 @@ protected void processAttestation(
136136
final IndexedAttestationProvider indexedAttestationProvider) {
137137
final MutableBeaconStateAltair state = MutableBeaconStateAltair.required(genericState);
138138
final AttestationProcessingResult result =
139-
calculateAttestationProcessingResult(state, attestation, indexedAttestationProvider);
139+
processAttestation(state, attestation, indexedAttestationProvider);
140140
consumeAttestationProcessingResult(attestation.getData(), result, genericState);
141141
}
142142

143143
public record AttestationProcessingResult(
144-
Optional<UInt64> proposerReward,
145-
boolean currentEpochTarget,
146-
UInt64 builderPaymentWeightDelta) {}
144+
Optional<UInt64> proposerReward, int builderPaymentIndex, UInt64 builderPaymentWeightDelta) {}
147145

148-
public AttestationProcessingResult calculateAttestationProcessingResult(
146+
public AttestationProcessingResult processAttestation(
149147
final MutableBeaconStateAltair state,
150148
final Attestation attestation,
151149
final IndexedAttestationProvider indexedAttestationProvider) {
@@ -164,6 +162,8 @@ public AttestationProcessingResult calculateAttestationProcessingResult(
164162
} else {
165163
epochParticipation = state.getPreviousEpochParticipation();
166164
}
165+
final int builderPaymentIndex = getBuilderPaymentIndex(forCurrentEpoch, data);
166+
167167
// track the weight for pending builder payment
168168
UInt64 builderPaymentWeightDelta = UInt64.ZERO;
169169

@@ -201,7 +201,8 @@ public AttestationProcessingResult calculateAttestationProcessingResult(
201201
miscHelpersAltair.hasFlag(newParticipationFlags, TIMELY_HEAD_FLAG_INDEX));
202202

203203
builderPaymentWeightDelta =
204-
updateBuilderPaymentWeight(builderPaymentWeightDelta, data, index, state);
204+
updateBuilderPaymentWeight(
205+
builderPaymentIndex, builderPaymentWeightDelta, data, index, state);
205206
}
206207
}
207208

@@ -217,10 +218,16 @@ public AttestationProcessingResult calculateAttestationProcessingResult(
217218
}
218219

219220
return new AttestationProcessingResult(
220-
proposerReward, forCurrentEpoch, builderPaymentWeightDelta);
221+
proposerReward, builderPaymentIndex, builderPaymentWeightDelta);
222+
}
223+
224+
protected int getBuilderPaymentIndex(final boolean forCurrentEpoch, final AttestationData data) {
225+
// NO-OP
226+
return 0;
221227
}
222228

223229
protected UInt64 updateBuilderPaymentWeight(
230+
final int builderPaymentIndex,
224231
final UInt64 builderPaymentWeightDelta,
225232
final AttestationData data,
226233
final int attestingIndex,

0 commit comments

Comments
 (0)