Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,4 @@ VALIDATOR_CUSTODY_REQUIREMENT: 8
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: 4096
BALANCE_PER_ADDITIONAL_CUSTODY_GROUP: 32000000000

BLOB_SCHEDULE:
# Deneb
- EPOCH: 0
MAX_BLOBS_PER_BLOCK: 9
BLOB_SCHEDULE: []
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,5 @@
"CUSTODY_REQUIREMENT":"4",
"VALIDATOR_CUSTODY_REQUIREMENT":"8",
"BALANCE_PER_ADDITIONAL_CUSTODY_GROUP":"32000000000",
"BLOB_SCHEDULE":[
{"EPOCH": "269568", "MAX_BLOBS_PER_BLOCK": "6"},
{"EPOCH": "364032", "MAX_BLOBS_PER_BLOCK": "9"}
]
"BLOB_SCHEDULE":[]
}
3 changes: 1 addition & 2 deletions ethereum/spec/src/main/java/tech/pegasys/teku/spec/Spec.java
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,7 @@ 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
// query the blob_schedule after FULU
if (highestSupportedMilestone.isGreaterThanOrEqualTo(FULU)) {
return forMilestone(FULU)
.miscHelpers()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,15 @@
import java.util.Map;
import java.util.Optional;
import java.util.function.BiConsumer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import tech.pegasys.teku.infrastructure.bytes.Bytes4;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.config.BlobScheduleEntry;
import tech.pegasys.teku.spec.config.SpecConfig;
import tech.pegasys.teku.spec.config.SpecConfigAndParent;
import tech.pegasys.teku.spec.config.SpecConfigCapella;
import tech.pegasys.teku.spec.config.SpecConfigDeneb;
import tech.pegasys.teku.spec.config.SpecConfigDenebImpl;

public class DenebBuilder implements ForkConfigBuilder<SpecConfigCapella, SpecConfigDeneb> {
private static final Logger LOG = LogManager.getLogger();
private Bytes4 denebForkVersion;
private UInt64 denebForkEpoch;

Expand Down Expand Up @@ -70,14 +66,6 @@ public SpecConfigAndParent<SpecConfigDeneb> build(
specConfigAndParent);
}

public Optional<BlobScheduleEntry> getBlobSchedule() {
if (denebForkEpoch == null || maxBlobsPerBlock == null) {
LOG.debug("denebForkEpoch = {}, maxBlobsPerBlock = {}", denebForkEpoch, maxBlobsPerBlock);
return Optional.empty();
}
return Optional.of(new BlobScheduleEntry(denebForkEpoch, maxBlobsPerBlock));
}

public DenebBuilder denebForkEpoch(final UInt64 denebForkEpoch) {
checkNotNull(denebForkEpoch);
this.denebForkEpoch = denebForkEpoch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,16 @@

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.function.BiConsumer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import tech.pegasys.teku.infrastructure.bytes.Bytes4;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.config.BlobScheduleEntry;
import tech.pegasys.teku.spec.config.SpecConfig;
import tech.pegasys.teku.spec.config.SpecConfigAndParent;
import tech.pegasys.teku.spec.config.SpecConfigDeneb;
import tech.pegasys.teku.spec.config.SpecConfigElectra;
import tech.pegasys.teku.spec.config.SpecConfigElectraImpl;

public class ElectraBuilder implements ForkConfigBuilder<SpecConfigDeneb, SpecConfigElectra> {
private static final Logger LOG = LogManager.getLogger();
private Bytes4 electraForkVersion;
private UInt64 electraForkEpoch;

Expand Down Expand Up @@ -256,17 +251,6 @@ public Map<String, Object> getValidationMap() {
return constants;
}

public Optional<BlobScheduleEntry> getBlobSchedule() {
if (maxBlobsPerBlockElectra == null || electraForkEpoch == null) {
LOG.debug(
"electraForkEpoch = {}, maxBlobsPerBlockElectra = {}",
electraForkEpoch,
maxBlobsPerBlockElectra);
return Optional.empty();
}
return Optional.of(new BlobScheduleEntry(electraForkEpoch, maxBlobsPerBlockElectra));
}

@Override
public void addOverridableItemsToRawConfig(final BiConsumer<String, Object> rawConfig) {
rawConfig.accept("ELECTRA_FORK_EPOCH", electraForkEpoch);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.BiConsumer;
import tech.pegasys.teku.infrastructure.bytes.Bytes4;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
Expand Down Expand Up @@ -186,23 +185,6 @@ public void validate() {
validateConstants();
}

public void validateBlobSchedule(
final Optional<BlobScheduleEntry> denebSchedule,
final Optional<BlobScheduleEntry> electraSchedule) {
denebSchedule.ifPresent(
schedule -> {
if (!blobSchedule.contains(schedule)) {
blobSchedule.add(schedule);
}
});
electraSchedule.ifPresent(
schedule -> {
if (!blobSchedule.contains(schedule)) {
blobSchedule.add(schedule);
}
});
}

@Override
public Map<String, Object> getValidationMap() {
final Map<String, Object> constants = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,6 @@ private void validate() {
"The specified network configuration had missing or invalid values for constants %s",
String.join(", ", fieldsFailingValidation)));
}
fuluBuilder.validateBlobSchedule(
denebBuilder.getBlobSchedule(), electraBuilder.getBlobSchedule());
builderChain.validate();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

package tech.pegasys.teku.spec.logic.versions.fulu.helpers;

import static com.google.common.base.Preconditions.checkArgument;
import static tech.pegasys.teku.spec.logic.common.helpers.MathHelpers.bytesToUInt64;
import static tech.pegasys.teku.spec.logic.common.helpers.MathHelpers.uint256ToBytes;

Expand All @@ -30,8 +29,6 @@
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.tuweni.bytes.Bytes32;
import org.apache.tuweni.units.bigints.UInt256;
import tech.pegasys.teku.infrastructure.crypto.Hash;
Expand Down Expand Up @@ -75,7 +72,6 @@

public class MiscHelpersFulu extends MiscHelpersElectra {
private static final MathContext BIGDECIMAL_PRECISION = MathContext.DECIMAL128;
private static final Logger LOG = LogManager.getLogger();

public static MiscHelpersFulu required(final MiscHelpers miscHelpers) {
return miscHelpers
Expand Down Expand Up @@ -122,27 +118,20 @@ public Optional<MiscHelpersFulu> toVersionFulu() {

// get_max_blobs_per_block
public int getMaxBlobsPerBlock(final UInt64 epoch) {
checkArgument(!blobSchedule.isEmpty(), "Blob schedule not correctly defined.");

final Optional<BlobScheduleEntry> maybeSchedule =
blobSchedule.stream()
.filter(blobSchedule -> blobSchedule.epoch().isLessThanOrEqualTo(epoch))
.max(Comparator.comparing(BlobScheduleEntry::epoch));

final int maxBlobs =
maybeSchedule
.map(BlobScheduleEntry::maxBlobsPerBlock)
.orElseGet(() -> blobSchedule.getFirst().maxBlobsPerBlock());
LOG.debug("Max blobs at epoch {} found to be {}", epoch, maxBlobs);
return maxBlobs;
return maybeSchedule
.map(BlobScheduleEntry::maxBlobsPerBlock)
.orElseGet(specConfigFulu::getMaxBlobsPerBlock);
}

public int getHighestMaxBlobsPerBlockFromSchedule() {
checkArgument(!blobSchedule.isEmpty(), "Blob schedule not correctly defined.");
return blobSchedule.stream()
.max(Comparator.comparing(BlobScheduleEntry::maxBlobsPerBlock))
.map(BlobScheduleEntry::maxBlobsPerBlock)
.orElseGet(() -> blobSchedule.getLast().maxBlobsPerBlock());
.orElseGet(specConfigFulu::getMaxBlobsPerBlock);
Comment on lines -145 to +134
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this is quite right, but then the previous isnt really either given they can go down... we can come back to this if its not causing issues, but i think we'd need to get the list and sort and find max blobs per block from schedule if we do need that value...

}

private UInt256 incrementByModule(final UInt256 n) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,4 @@ MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 256
# Blob Scheduling
# ---------------------------------------------------------------

BLOB_SCHEDULE:
# Deneb
- EPOCH: 516608
MAX_BLOBS_PER_BLOCK: 2
# Electra
- EPOCH: 948224
MAX_BLOBS_PER_BLOCK: 2
BLOB_SCHEDULE: []
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,4 @@ MAX_BLOBS_PER_BLOCK_ELECTRA: 9
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152

BLOB_SCHEDULE:
# Deneb
- EPOCH: 0
MAX_BLOBS_PER_BLOCK: 6
# Electra
- EPOCH: 10
MAX_BLOBS_PER_BLOCK: 9
BLOB_SCHEDULE: []
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,4 @@ MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 256
# Blob Scheduling
# ---------------------------------------------------------------

BLOB_SCHEDULE:
# Deneb
- EPOCH: 889856
MAX_BLOBS_PER_BLOCK: 2
# Electra
- EPOCH: 1337856
MAX_BLOBS_PER_BLOCK: 2
BLOB_SCHEDULE: []
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,4 @@ CUSTODY_REQUIREMENT: 4
VALIDATOR_CUSTODY_REQUIREMENT: 8
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: 4096

BLOB_SCHEDULE:
# Deneb
- EPOCH: 29696
MAX_BLOBS_PER_BLOCK: 6
# Electra
- EPOCH: 115968
MAX_BLOBS_PER_BLOCK: 9
BLOB_SCHEDULE: []
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,4 @@ MAX_BLOBS_PER_BLOCK_ELECTRA: 9
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152

BLOB_SCHEDULE:
# Deneb
- EPOCH: 0
MAX_BLOBS_PER_BLOCK: 6
# Electra
- EPOCH: 2048
MAX_BLOBS_PER_BLOCK: 9
BLOB_SCHEDULE: []
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,4 @@ BALANCE_PER_ADDITIONAL_CUSTODY_GROUP: 32000000000
# Blob Scheduling
# ---------------------------------------------------------------

BLOB_SCHEDULE:
# Deneb
- EPOCH: 269568
MAX_BLOBS_PER_BLOCK: 6
# Electra
- EPOCH: 364032
MAX_BLOBS_PER_BLOCK: 9
BLOB_SCHEDULE: []
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,4 @@ VALIDATOR_CUSTODY_REQUIREMENT: 8
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: 4096
BALANCE_PER_ADDITIONAL_CUSTODY_GROUP: 32000000000

BLOB_SCHEDULE:
# Deneb
- EPOCH: 18446744073709551615
MAX_BLOBS_PER_BLOCK: 6
# Electra
- EPOCH: 18446744073709551615
MAX_BLOBS_PER_BLOCK: 9
BLOB_SCHEDULE: []
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,4 @@ MAX_BLOBS_PER_BLOCK_ELECTRA: 9
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152

BLOB_SCHEDULE:
# Deneb
- EPOCH: 132608
MAX_BLOBS_PER_BLOCK: 6
# Electra
- EPOCH: 222464
MAX_BLOBS_PER_BLOCK: 9
BLOB_SCHEDULE: []
Loading