Skip to content

Commit

Permalink
fix focil spec loader
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-aouadi committed Jan 8, 2025
1 parent 6bff8e9 commit a3f2382
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ public Eth2NetworkConfiguration build() {
builder.electraBuilder(
electraBuilder ->
electraForkEpoch.ifPresent(electraBuilder::electraForkEpoch));
builder.eip7805Builder(
eip7805Builder ->
electraForkEpoch.ifPresent(eip7805Builder::eip7805ForkEpoch));
});
}
if (spec.getForkSchedule().getSupportedMilestones().contains(SpecMilestone.DENEB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static SpecConfigEip7805 required(final SpecConfig specConfig) {

int getIlCommitteeSize();

int getMaxTransactionPerInclusionList();
int getMaxTransactionsPerInclusionList();

@Override
Optional<SpecConfigEip7805> toVersionEip7805();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ public class SpecConfigEip7805Impl extends DelegatingSpecConfigElectra
private final Bytes4 eip7805ForkVersion;
private final UInt64 eip7805ForkEpoch;
private final int ilCommitteeSize;
private final int maxTransactionPerInclusionList;
private final int maxTransactionsPerInclusionList;

public SpecConfigEip7805Impl(
final SpecConfigElectra specConfig,
final Bytes4 eip7805ForkVersion,
final UInt64 eip7805ForkEpoch,
final int ilCommitteeSize,
final int maxTransactionPerInclusionList) {
final int maxTransactionsPerInclusionList) {
super(specConfig);
this.eip7805ForkVersion = eip7805ForkVersion;
this.eip7805ForkEpoch = eip7805ForkEpoch;
this.ilCommitteeSize = ilCommitteeSize;
this.maxTransactionPerInclusionList = maxTransactionPerInclusionList;
this.maxTransactionsPerInclusionList = maxTransactionsPerInclusionList;
}

@Override
Expand All @@ -56,8 +56,8 @@ public int getIlCommitteeSize() {
}

@Override
public int getMaxTransactionPerInclusionList() {
return maxTransactionPerInclusionList;
public int getMaxTransactionsPerInclusionList() {
return maxTransactionsPerInclusionList;
}

@Override
Expand All @@ -83,7 +83,7 @@ public boolean equals(final Object o) {
&& Objects.equals(eip7805ForkVersion, that.eip7805ForkVersion)
&& Objects.equals(eip7805ForkEpoch, that.eip7805ForkEpoch)
&& ilCommitteeSize == that.ilCommitteeSize
&& maxTransactionPerInclusionList == that.maxTransactionPerInclusionList;
&& maxTransactionsPerInclusionList == that.maxTransactionsPerInclusionList;
}

@Override
Expand All @@ -93,6 +93,6 @@ public int hashCode() {
eip7805ForkVersion,
eip7805ForkEpoch,
ilCommitteeSize,
maxTransactionPerInclusionList);
maxTransactionsPerInclusionList);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
public class SpecConfigLoader {
private static final Logger LOG = LogManager.getLogger();
private static final List<String> AVAILABLE_PRESETS =
List.of("phase0", "altair", "bellatrix", "capella", "deneb", "electra");
List.of("phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7805");
private static final String CONFIG_PATH = "configs/";
private static final String PRESET_PATH = "presets/";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Eip7805Builder implements ForkConfigBuilder<SpecConfigElectra, Spec
private UInt64 eip7805ForkEpoch;

private Integer ilCommitteeSize;
private Integer maxTransactionPerInclusionList;
private Integer maxTransactionsPerInclusionList;

Eip7805Builder() {}

Expand All @@ -46,7 +46,7 @@ public SpecConfigAndParent<SpecConfigEip7805> build(
eip7805ForkVersion,
eip7805ForkEpoch,
ilCommitteeSize,
maxTransactionPerInclusionList),
maxTransactionsPerInclusionList),
specConfigAndParent);
}

Expand All @@ -68,10 +68,10 @@ public Eip7805Builder ilCommitteeSize(final Integer ilCommitteeSize) {
return this;
}

public Eip7805Builder maxTransactionPerInclusionList(
final Integer maxTransactionPerInclusionList) {
checkNotNull(maxTransactionPerInclusionList);
this.maxTransactionPerInclusionList = maxTransactionPerInclusionList;
public Eip7805Builder maxTransactionsPerInclusionList(
final Integer maxTransactionsPerInclusionList) {
checkNotNull(maxTransactionsPerInclusionList);
this.maxTransactionsPerInclusionList = maxTransactionsPerInclusionList;
return this;
}

Expand All @@ -96,8 +96,8 @@ public Map<String, Object> getValidationMap() {

constants.put("eip7805ForkEpoch", eip7805ForkEpoch);
constants.put("eip7805ForkVersion", eip7805ForkVersion);
constants.put("ptcSize", ilCommitteeSize);
constants.put("maxPayloadAttestations", maxTransactionPerInclusionList);
constants.put("ilCommitteeSize", ilCommitteeSize);
constants.put("maxTransactionsPerInclusionList", maxTransactionsPerInclusionList);
;

return constants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.config.SpecConfig;
import tech.pegasys.teku.spec.config.SpecConfigAndParent;
import tech.pegasys.teku.spec.config.SpecConfigElectra;
import tech.pegasys.teku.spec.config.SpecConfigEip7805;
import tech.pegasys.teku.spec.config.SpecConfigPhase0;

@SuppressWarnings({"UnusedReturnValue", "unused"})
Expand Down Expand Up @@ -132,14 +132,15 @@ public class SpecConfigBuilder {
private Integer reorgParentWeightThreshold = 160;

private UInt64 maxPerEpochActivationExitChurnLimit = UInt64.valueOf(256000000000L);
private final BuilderChain<SpecConfig, SpecConfigElectra> builderChain =
private final BuilderChain<SpecConfig, SpecConfigEip7805> builderChain =
BuilderChain.create(new AltairBuilder())
.appendBuilder(new BellatrixBuilder())
.appendBuilder(new CapellaBuilder())
.appendBuilder(new DenebBuilder())
.appendBuilder(new ElectraBuilder());
.appendBuilder(new ElectraBuilder())
.appendBuilder(new Eip7805Builder());

public SpecConfigAndParent<SpecConfigElectra> build() {
public SpecConfigAndParent<SpecConfigEip7805> build() {
builderChain.addOverridableItemsToRawConfig(
(key, value) -> {
if (value != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC
# Electra
ELECTRA_FORK_VERSION: 0x05000000
ELECTRA_FORK_EPOCH: 18446744073709551615
# EIP7805
EIP7805_FORK_VERSION: 0x09000000 # temporary stub
EIP7805_FORK_EPOCH: 18446744073709551615


# Time parameters
Expand Down Expand Up @@ -155,4 +158,8 @@ BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9
# `uint64(9)`
MAX_BLOBS_PER_BLOCK_ELECTRA: 9
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152

# EIP7805
IL_COMMITTEE_SIZE: 16
MAX_TRANSACTIONS_PER_INCLUSION_LIST: 1
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ DENEB_FORK_EPOCH: 18446744073709551615
# Electra
ELECTRA_FORK_VERSION: 0x05000001
ELECTRA_FORK_EPOCH: 18446744073709551615
# EIP7805
EIP7805_FORK_VERSION: 0x09000000 # temporary stub
EIP7805_FORK_EPOCH: 18446744073709551615

# Time parameters
# ---------------------------------------------------------------
Expand Down Expand Up @@ -155,4 +158,8 @@ BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9
# `uint64(9)`
MAX_BLOBS_PER_BLOCK_ELECTRA: 9
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152

# EIP7805
IL_COMMITTEE_SIZE: 16
MAX_TRANSACTIONS_PER_INCLUSION_LIST: 1
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,8 @@ BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9
# `uint64(9)`
MAX_BLOBS_PER_BLOCK_ELECTRA: 9
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152

# EIP7805
IL_COMMITTEE_SIZE: 16
MAX_TRANSACTIONS_PER_INCLUSION_LIST: 1

0 comments on commit a3f2382

Please sign in to comment.