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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## Unreleased Changes

### Breaking Changes
- Previous versions of teku will not be able to read configuration from this version of teku (including VC) due to BPO configuration being added.

### Additions and Improvements
- Added `--p2p-static-peers-url` option to read static peers from a URL or file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import java.util.Map;
import java.util.Optional;
import okhttp3.Response;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.units.bigints.UInt256;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -58,6 +60,7 @@
@TestSpecContext(allMilestones = true)
public class GetNewBlockV3IntegrationTest extends AbstractDataBackedRestAPIIntegrationTest {

private static final Logger LOG = LogManager.getLogger();
private DataStructureUtil dataStructureUtil;
private SpecMilestone specMilestone;

Expand Down Expand Up @@ -235,6 +238,8 @@ private String getExpectedBlockAsJson(
blinded ? "Blinded" : "",
blockContents ? "BlockContents" : "Block",
specMilestone.name());

LOG.info("Read expected json file: {}", fileName);
return Resources.toString(
Resources.getResource(GetNewBlockV3IntegrationTest.class, fileName), UTF_8);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
"$ref" : "#/components/schemas/SignedBlockContentsDeneb"
}, {
"$ref" : "#/components/schemas/SignedBlockContentsElectra"
}, {
"$ref" : "#/components/schemas/SignedBlockContentsFulu"
} ]
}]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
"$ref" : "#/components/schemas/SignedBlockContentsDeneb"
}, {
"$ref" : "#/components/schemas/SignedBlockContentsElectra"
}, {
"$ref" : "#/components/schemas/SignedBlockContentsFulu"
} ]
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
"$ref" : "#/components/schemas/BlockContentsElectra"
}, {
"$ref" : "#/components/schemas/BlindedBeaconBlockElectra"
}, {
"$ref" : "#/components/schemas/BlockContentsFulu"
} ]
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": "fulu",
"execution_payload_blinded": true,
"execution_payload_value": "70091777274856981794352123785798699314161189490191767166854046474344034863608",
"consensus_block_value": "78291679983577647606856001912576699955529486494073092274184166309422601585026",
"execution_payload_value": "52335047088093692175629908587741169571103578927521980677976976500308305025762",
"consensus_block_value": "60987255743756591490802410911397502078420277537860810465656654307850393571949",
"data": {
"slot": "1",
"proposer_index": "4666673844721362956",
Expand Down Expand Up @@ -352,43 +352,37 @@
"blob_kzg_commitments": [
"0x36d44642cfa8a73b4c27b317e2d9bff5469b1cbe5c05d35f4b2286f9dd9a1da1edf7f9ff3b52088c513683aed613efc8",
"0x49f540426ff48680416a1a43b562d4c24d9e1b5012cefb1979a3c9c1b8fbd42b8517c05e35b3e879984ec65a9ddb52af",
"0xa99a23428f6ee3d80bb91e1cd80e3bc46cad162aa2b9c7bc5e291babfcdf69e17bb59e3819984a1ffcc715b881c2452f",
"0xbcbb1d422fbac21d01fc8547ab974f9172b015bc5882f0768caa5e73d640216c13d5649714f92a0d43e05864498aa915",
"0x83582f424fd7244f213350c530fd112a5fa71806352876480227941a471efbcb4c76127b24d689436e978f5ff3327e62",
"0x96792942ef2204941676b7f0048626f766aa1798ecf09e0230a8d7e2217fb256e395d8d91f376a31b5afd20bbafae148",
"0x594150410d114a888823a4369a4c1e9b4d1af3b146f383eace5399d4b17e3363cc267b8c513bd892003285f184da4d95",
"0x6c624a41ad5c29cd7d660b626ed53268531df243fdbbaca4fbd4dc9c8cdfeaed644641eb4c9cb880484ac89d4ba2b17b",
"0x32ff5b41cd798bfe9d9dd5dff33af5004014f58dda61327672511244fcbcc44d9de7eece5c7917b77201ff98f64a86c8"
"0xa99a23428f6ee3d80bb91e1cd80e3bc46cad162aa2b9c7bc5e291babfcdf69e17bb59e3819984a1ffcc715b881c2452f"
],
"execution_requests": {
"deposits": [
{
"pubkey": "0x82265d267f8473b8b95581d5cff9b19c81ca410538259c96c7418ef433e3c0a89d8ce7f7b91dc0789ceddd7e5f8f1f45",
"withdrawal_credentials": "0x010000000000000000000000594150410d114a888823a4369a4c1e9b4d1af3b1",
"amount": "4704680975884967085",
"signature": "0xb710f44c80db8d91f996614df20b5e9293a578f28f55e4cd65f017063fa9e36eead8417ff871fda70f6f8238fa906376066788d928178215cf5b285a0630956453a2b53fd2ecdd614e247a7c89502de682385310134924ee896501d9a1a5265a",
"index": "4707985942318335341"
},
{
"pubkey": "0xaacb0e7f3717c59e23c32cb07ce03be33c2bb8366da2d27a9954b77f2c9198a1b5f3aea585faffcdfa4800b592c4d5d8",
"withdrawal_credentials": "0x0100000000000000000000007f8344414da8081272a9728d415e47355920f1d5",
"amount": "4701376009451598829",
"signature": "0xa9bf2689fe47ca9ac1fb90da3b08259115adab480b4f387669f209ee7747f7451af8f61e4a9c057bc33ffc18f0b08c3407be0a59b8c61c741572f5d28e2a1f6af0fc17db7c3f48901c9267606c3d7831a3d3647b885946fc95fb5689d24f7b8d",
"index": "4691461101561559469"
},
{
"pubkey": "0xb8fa03e47468016f15b89212a91f203194684e0cbbac07b6cd428fc7e10cb7d8a363985b46972eedd7bc434fc701c4b3",
"withdrawal_credentials": "0x0100000000000000000000003ece09418d9cc1c206477b3f86b61438983ee789",
"amount": "4684851168694822957",
"signature": "0xa529495633ab9ab138c0756646074fc7753fafbb44389490ddd46048f29267f6b85e46abbc1fe71c42fc98513ed0f6f800ebc9eaa04b484e29af7d7bb0c38b5e088435aee8583a812545b3057c184a4634957604ec0647d1fa81da2d15a5f198",
"index": "4688156139423158509"
}
],
"withdrawals": [
{
"source_address": "0x01eeb941cebf96b04a6e6129b9adac2fdce3046e",
"validator_pubkey": "0x97995c0a4cf28bb77bfea20753ecd1e3b3469492921c9542d99a1e81355f6d09ea4cbcb35e3b8f1240e8261d20da657b",
"amount": "4726163266291795342"
"source_address": "0x3ece09418d9cc1c206477b3f86b61438983ee789",
"validator_pubkey": "0xb7fbe0486f002e790bb3d674b4259c18c6bf66510576e381e128aee6c2de771d3d5c9dda65b4078b058b2667f30e1637",
"amount": "4689808622639842637"
}
],
"consolidations": [
{
"source_address": "0x60939c41ee39f30814bd6502db591331fcf2ff47",
"source_pubkey": "0xa4a90125ab79fbbe706de307f1de84a6b0dc21adef413c6a5e91ab58e575164bd13c0517a318394a56adab9326607e82",
"target_pubkey": "0x83feea64397a7a9d3fbac0b9a16ccbfd63c4d4fa5d0fd8bbfa13739148e752ce1e9b1e01654b56cb56a196fd8d64db3f"
"source_address": "0x3a51a841aea2347f293797ab3448ea96efec0124",
"source_pubkey": "0x88f8fa6c349ee56559e614799a5788c17fdcde24ea5922a7c7fe6bed8df5c0140aeebbb46d0cadc7a9107e98344194f1",
"target_pubkey": "0x97995c0a4cf28bb77bfea20753ecd1e3b3469492921c9542d99a1e81355f6d09ea4cbcb35e3b8f1240e8261d20da657b"
}
]
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
"FIELD_ELEMENTS_PER_CELL":"64",
"KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH":"4",
"MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS":"4096",
"MAX_BLOBS_PER_BLOCK_FULU":"12",
"FULU_FORK_EPOCH":"18446744073709551615",
"FULU_FORK_VERSION":"0x06000000",
"NUMBER_OF_COLUMNS":"128",
Expand Down
31 changes: 31 additions & 0 deletions ethereum/spec/src/main/java/tech/pegasys/teku/spec/Spec.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
import static com.google.common.base.Preconditions.checkState;
import static tech.pegasys.teku.infrastructure.time.TimeUtilities.millisToSeconds;
import static tech.pegasys.teku.infrastructure.time.TimeUtilities.secondsToMillis;
import static tech.pegasys.teku.spec.SpecMilestone.CAPELLA;
import static tech.pegasys.teku.spec.SpecMilestone.DENEB;
import static tech.pegasys.teku.spec.SpecMilestone.ELECTRA;
import static tech.pegasys.teku.spec.SpecMilestone.FULU;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Preconditions;
Expand Down Expand Up @@ -104,6 +107,7 @@
import tech.pegasys.teku.spec.logic.common.util.LightClientUtil;
import tech.pegasys.teku.spec.logic.common.util.SyncCommitteeUtil;
import tech.pegasys.teku.spec.logic.versions.bellatrix.block.OptimisticExecutionPayloadExecutor;
import tech.pegasys.teku.spec.logic.versions.fulu.helpers.MiscHelpersFulu;
import tech.pegasys.teku.spec.schemas.SchemaDefinitions;
import tech.pegasys.teku.spec.schemas.registry.SchemaRegistryBuilder;

Expand Down Expand Up @@ -969,6 +973,15 @@ public Optional<Integer> getMaxBlobsPerBlockForHighestMilestone() {
final SpecMilestone highestSupportedMilestone =
getForkSchedule().getHighestSupportedMilestone();

// once blob schedule is fully defined back to deneb,
// this function will just be able to query the blob_schedule
if (highestSupportedMilestone.isGreaterThanOrEqualTo(FULU)) {
return forMilestone(FULU)
.miscHelpers()
.toVersionFulu()
.map(MiscHelpersFulu::getHighestMaxBlobsPerBlockFromSchedule);
}

final Optional<Integer> maybeHighestMaxBlobsPerBlock =
forMilestone(highestSupportedMilestone)
.getConfig()
Expand Down Expand Up @@ -1095,4 +1108,22 @@ public boolean equals(final Object o) {
public int hashCode() {
return Objects.hash(forkSchedule);
}

public Optional<Integer> getMaxBlobsPerBlockAtSlot(final UInt64 slot) {
Comment thread
rolfyone marked this conversation as resolved.
final SpecVersion specVersion = atSlot(slot);
switch (specVersion.getMilestone()) {
case PHASE0, ALTAIR, BELLATRIX, CAPELLA -> {
return Optional.empty();
}
case DENEB, ELECTRA -> {
return Optional.of(
specVersion.getConfig().toVersionDeneb().orElseThrow().getMaxBlobsPerBlock());
}
default -> {
final UInt64 epoch = atSlot(slot).miscHelpers().computeEpochAtSlot(slot);
return Optional.of(
specVersion.miscHelpers().toVersionFulu().orElseThrow().getMaxBlobsPerBlock(epoch));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class SpecConfigFuluImpl extends DelegatingSpecConfigElectra implements S
private final UInt64 kzgCommitmentsInclusionProofDepth;
private final int minEpochsForDataColumnSidecarsRequests;
private final int maxRequestDataColumnSidecars;
private final int maxBlobsPerBlockFulu;
private final UInt64 balancePerAdditionalCustodyGroup;
private final List<BlobSchedule> blobSchedule;

Expand All @@ -55,7 +54,6 @@ public SpecConfigFuluImpl(
final int samplesPerSlot,
final int minEpochsForDataColumnSidecarsRequests,
final int maxRequestDataColumnSidecars,
final int maxBlobsPerBlockFulu,
final UInt64 balancePerAdditionalCustodyGroup,
final List<BlobSchedule> blobSchedule) {
super(specConfig);
Expand All @@ -72,7 +70,6 @@ public SpecConfigFuluImpl(
this.samplesPerSlot = samplesPerSlot;
this.minEpochsForDataColumnSidecarsRequests = minEpochsForDataColumnSidecarsRequests;
this.maxRequestDataColumnSidecars = maxRequestDataColumnSidecars;
this.maxBlobsPerBlockFulu = maxBlobsPerBlockFulu;
this.balancePerAdditionalCustodyGroup = balancePerAdditionalCustodyGroup;
this.blobSchedule = blobSchedule;
}
Expand Down Expand Up @@ -147,11 +144,6 @@ public int getMaxRequestDataColumnSidecars() {
return maxRequestDataColumnSidecars;
}

@Override
public int getMaxBlobsPerBlock() {
return maxBlobsPerBlockFulu;
}

@Override
public SpecMilestone getMilestone() {
return SpecMilestone.FULU;
Expand Down Expand Up @@ -189,7 +181,6 @@ public boolean equals(final Object o) {
&& custodyRequirement == that.custodyRequirement
&& minEpochsForDataColumnSidecarsRequests == that.minEpochsForDataColumnSidecarsRequests
&& maxRequestDataColumnSidecars == that.maxRequestDataColumnSidecars
&& maxBlobsPerBlockFulu == that.maxBlobsPerBlockFulu
&& validatorCustodyRequirement == that.validatorCustodyRequirement
&& samplesPerSlot == that.samplesPerSlot;
}
Expand All @@ -209,7 +200,6 @@ public int hashCode() {
kzgCommitmentsInclusionProofDepth,
minEpochsForDataColumnSidecarsRequests,
maxRequestDataColumnSidecars,
maxBlobsPerBlockFulu,
validatorCustodyRequirement,
samplesPerSlot,
balancePerAdditionalCustodyGroup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ public class FuluBuilder implements ForkConfigBuilder<SpecConfigElectra, SpecCon
private Integer samplesPerSlot;
private Integer minEpochsForDataColumnSidecarsRequests;
private Integer maxRequestDataColumnSidecars;
private Integer maxBlobsPerBlockFulu;
private UInt64 balancePerAdditionalCustodyGroup;
private List<BlobSchedule> blobSchedule = new ArrayList<>();
private final List<BlobSchedule> blobSchedule = new ArrayList<>();

FuluBuilder() {}

Expand All @@ -72,7 +71,6 @@ public SpecConfigAndParent<SpecConfigFulu> build(
samplesPerSlot,
minEpochsForDataColumnSidecarsRequests,
maxRequestDataColumnSidecars,
maxBlobsPerBlockFulu,
balancePerAdditionalCustodyGroup,
blobSchedule),
specConfigAndParent);
Expand Down Expand Up @@ -110,7 +108,10 @@ public FuluBuilder kzgCommitmentsInclusionProofDepth(
}

public FuluBuilder blobSchedule(final List<BlobSchedule> blobSchedule) {
this.blobSchedule = blobSchedule;
checkNotNull(this.blobSchedule);
this.blobSchedule.clear();
// copy list rather than use the one passed in case we need to add to the list during validation
this.blobSchedule.addAll(blobSchedule);
Comment thread
rolfyone marked this conversation as resolved.
return this;
}

Expand Down Expand Up @@ -163,12 +164,6 @@ public FuluBuilder maxRequestDataColumnSidecars(final Integer maxRequestDataColu
return this;
}

public FuluBuilder maxBlobsPerBlockFulu(final Integer maxBlobsPerBlockFulu) {
checkNotNull(maxBlobsPerBlockFulu);
this.maxBlobsPerBlockFulu = maxBlobsPerBlockFulu;
return this;
}

public FuluBuilder balancePerAdditionalCustodyGroup(
final UInt64 balancePerAdditionalCustodyGroup) {
checkNotNull(balancePerAdditionalCustodyGroup);
Expand Down Expand Up @@ -224,7 +219,6 @@ public Map<String, Object> getValidationMap() {
constants.put("kzgCommitmentsInclusionProofDepth", kzgCommitmentsInclusionProofDepth);
constants.put("minEpochsForDataColumnSidecarsRequests", minEpochsForDataColumnSidecarsRequests);
constants.put("maxRequestDataColumnSidecars", maxRequestDataColumnSidecars);
constants.put("maxBlobsPerBlockFulu", maxBlobsPerBlockFulu);
constants.put("balancePerAdditionalCustodyGroup", balancePerAdditionalCustodyGroup);

return constants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ public BlockContentsSchema(
namedSchema("block", schemaRegistry.get(BEACON_BLOCK_SCHEMA)),
namedSchema(
FIELD_KZG_PROOFS,
SszListSchema.create(SszKZGProofSchema.INSTANCE, specConfig.getMaxBlobsPerBlock())),
SszListSchema.create(
SszKZGProofSchema.INSTANCE, specConfig.getMaxBlobCommitmentsPerBlock())),
namedSchema(
FIELD_BLOBS,
SszListSchema.create(
schemaRegistry.get(BLOB_SCHEMA), specConfig.getMaxBlobsPerBlock())));
schemaRegistry.get(BLOB_SCHEMA), specConfig.getMaxBlobCommitmentsPerBlock())));
}

public BlockContents create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ public SignedBlockContentsSchema(
namedSchema("signed_block", schemaRegistry.get(SIGNED_BEACON_BLOCK_SCHEMA)),
namedSchema(
FIELD_KZG_PROOFS,
SszListSchema.create(SszKZGProofSchema.INSTANCE, specConfig.getMaxBlobsPerBlock())),
SszListSchema.create(
SszKZGProofSchema.INSTANCE, specConfig.getMaxBlobCommitmentsPerBlock())),
namedSchema(
FIELD_BLOBS,
SszListSchema.create(
schemaRegistry.get(BLOB_SCHEMA), specConfig.getMaxBlobsPerBlock())));
schemaRegistry.get(BLOB_SCHEMA), specConfig.getMaxBlobCommitmentsPerBlock())));
}

public SignedBlockContents create(
Expand Down
Loading