Skip to content

Commit

Permalink
Rename remaining EIP4844 references to Deneb (#6842)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov authored Feb 21, 2023
1 parent e2cc589 commit 596a9ac
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public SafeFuture<FetchBlockResult> fetchBlock(final Eth2Peer peer) {
final Throwable rootException = Throwables.getRootCause(throwable);
if (rootException instanceof RpcException) {
final RpcException rpcException = (RpcException) rootException;
// TODO: update link for Deneb
// based on behaviour described at
// https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/p2p-interface.md#beaconblocksbyroot-v2
if (rpcException.getResponseCode() == RpcResponseStatus.RESOURCE_UNAVAILABLE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ public class ForkUpgradeTestExecutor implements TestExecutor {
public void runTest(final TestDefinition testDefinition) throws Throwable {
final MetaData metadata = TestDataUtils.loadYaml(testDefinition, "meta.yaml", MetaData.class);
final String fork = metadata.fork.toUpperCase();
// TODO: simplify when reference tests are updated to Deneb
final SpecMilestone specMilestone =
SpecMilestone.valueOf(fork.equals("EIP4844") ? "DENEB" : fork);
final SpecMilestone specMilestone = SpecMilestone.valueOf(fork);
processUpgrade(testDefinition, specMilestone);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ public void runTest(final TestDefinition testDefinition) throws Throwable {

private void processUpgrade(final TestDefinition testDefinition, final MetaData metadata) {
final String postFork = metadata.postFork.toUpperCase();
// TODO: simplify when reference tests are updated to Deneb
final SpecMilestone milestone =
SpecMilestone.valueOf(postFork.equals("EIP4844") ? "DENEB" : postFork);
final SpecMilestone milestone = SpecMilestone.valueOf(postFork);
final UInt64 forkEpoch = UInt64.valueOf(metadata.forkEpoch);
final SpecConfig config =
SpecConfigLoader.loadConfig(
Expand All @@ -76,7 +74,7 @@ private void processUpgrade(final TestDefinition testDefinition, final MetaData
.altairBuilder(a -> a.altairForkEpoch(UInt64.ZERO))
.bellatrixBuilder(b -> b.bellatrixForkEpoch(UInt64.ZERO))
.capellaBuilder(c -> c.capellaForkEpoch(UInt64.ZERO))
.denebBuilder(d -> d.eip4844ForkEpoch(forkEpoch).kzgNoop(true));
.denebBuilder(d -> d.denebForkEpoch(forkEpoch).kzgNoop(true));
break;
default:
throw new IllegalStateException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ public class TestFork {
public static final String ALTAIR = "altair";
public static final String BELLATRIX = "bellatrix";
public static final String CAPELLA = "capella";
// TODO: rename to DENEB when reference tests are updated
public static final String DENEB = "eip4844";
public static final String DENEB = "deneb";
}
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public Eth2NetworkConfiguration build() {
});
builder.denebBuilder(
denebBuilder -> {
denebForkEpoch.ifPresent(denebBuilder::eip4844ForkEpoch);
denebForkEpoch.ifPresent(denebBuilder::denebForkEpoch);
trustedSetup.ifPresent(denebBuilder::trustedSetupPath);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import tech.pegasys.teku.spec.config.SpecConfigDeneb;
import tech.pegasys.teku.spec.config.SpecConfigDenebImpl;

// TODO: Update to Deneb
public class DenebBuilder implements ForkConfigBuilder<SpecConfigCapella, SpecConfigDeneb> {

private Bytes4 denebForkVersion;
Expand All @@ -50,13 +49,13 @@ public SpecConfigDeneb build(final SpecConfigCapella specConfig) {
kzgNoop);
}

public DenebBuilder eip4844ForkEpoch(final UInt64 denebForkEpoch) {
public DenebBuilder denebForkEpoch(final UInt64 denebForkEpoch) {
checkNotNull(denebForkEpoch);
this.denebForkEpoch = denebForkEpoch;
return this;
}

public DenebBuilder eip4844ForkVersion(final Bytes4 denebForkVersion) {
public DenebBuilder denebForkVersion(final Bytes4 denebForkVersion) {
checkNotNull(denebForkVersion);
this.denebForkVersion = denebForkVersion;
return this;
Expand Down Expand Up @@ -99,6 +98,6 @@ public void validate() {

@Override
public void addOverridableItemsToRawConfig(final BiConsumer<String, Object> rawConfig) {
rawConfig.accept("EIP4844_FORK_EPOCH", denebForkEpoch);
rawConfig.accept("DENEB_FORK_EPOCH", denebForkEpoch);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC
# Capella
CAPELLA_FORK_VERSION: 0x03000000
CAPELLA_FORK_EPOCH: 18446744073709551615
# TODO: update to Deneb
EIP4844_FORK_VERSION: 0x04000000
EIP4844_FORK_EPOCH: 18446744073709551615
# Deneb
DENEB_FORK_VERSION: 0x04000000
DENEB_FORK_EPOCH: 18446744073709551615



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ BELLATRIX_FORK_EPOCH: 18446744073709551615
# Capella
CAPELLA_FORK_VERSION: 0x03000001
CAPELLA_FORK_EPOCH: 18446744073709551615
# TODO: update to Deneb
EIP4844_FORK_VERSION: 0x04000001
EIP4844_FORK_EPOCH: 18446744073709551615
# Deneb
DENEB_FORK_VERSION: 0x04000001
DENEB_FORK_EPOCH: 18446744073709551615


# Time parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ BELLATRIX_FORK_EPOCH: 18446744073709551615
# Capella
CAPELLA_FORK_VERSION: 0x03000001
CAPELLA_FORK_EPOCH: 18446744073709551615
# TODO: update to Deneb
EIP4844_FORK_VERSION: 0x04000001
EIP4844_FORK_EPOCH: 18446744073709551615
# Deneb
DENEB_FORK_VERSION: 0x04000001
DENEB_FORK_EPOCH: 18446744073709551615


# Time parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ BELLATRIX_FORK_EPOCH: 18446744073709551615
# Capella
CAPELLA_FORK_VERSION: 0x03000000
CAPELLA_FORK_EPOCH: 18446744073709551615
# TODO: update to Deneb
EIP4844_FORK_VERSION: 0x04000000
EIP4844_FORK_EPOCH: 18446744073709551615
# Deneb
DENEB_FORK_VERSION: 0x04000000
DENEB_FORK_EPOCH: 18446744073709551615

# Transition
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ BELLATRIX_FORK_EPOCH: 18446744073709551615
# Capella
CAPELLA_FORK_VERSION: 0x03000001
CAPELLA_FORK_EPOCH: 18446744073709551615
# TODO: update to Deneb
EIP4844_FORK_VERSION: 0x04000001
EIP4844_FORK_EPOCH: 18446744073709551615
# Deneb
DENEB_FORK_VERSION: 0x04000001
DENEB_FORK_EPOCH: 18446744073709551615

# Transition
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ BELLATRIX_FORK_EPOCH: 18446744073709551615
# Capella
CAPELLA_FORK_VERSION: 0x03000001
CAPELLA_FORK_EPOCH: 18446744073709551615
# TODO: update to Deneb
EIP4844_FORK_VERSION: 0x04000001
EIP4844_FORK_EPOCH: 18446744073709551615
# Deneb
DENEB_FORK_VERSION: 0x04000001
DENEB_FORK_EPOCH: 18446744073709551615

# Transition
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public static Spec create(
z.altairBuilder(a -> a.altairForkEpoch(UInt64.ZERO))
.bellatrixBuilder(b -> b.bellatrixForkEpoch(UInt64.ZERO))
.capellaBuilder(c -> c.capellaForkEpoch(UInt64.ZERO))
.denebBuilder(d -> d.eip4844ForkEpoch(UInt64.ZERO).kzgNoop(true)));
.denebBuilder(d -> d.denebForkEpoch(UInt64.ZERO).kzgNoop(true)));
break;
default:
throw new IllegalStateException("unsupported milestone");
Expand Down Expand Up @@ -350,7 +350,7 @@ private static SpecConfigDeneb getDenebSpecConfig(
z.altairBuilder(a -> a.altairForkEpoch(altairForkEpoch))
.bellatrixBuilder(b -> b.bellatrixForkEpoch(bellatrixForkEpoch))
.capellaBuilder(c -> c.capellaForkEpoch(capellaForkEpoch))
.denebBuilder(d -> d.eip4844ForkEpoch(denebForkEpoch).kzgNoop(true)));
.denebBuilder(d -> d.denebForkEpoch(denebForkEpoch).kzgNoop(true)));
}

private static SpecConfigDeneb getDenebSpecConfig(
Expand All @@ -363,7 +363,7 @@ private static SpecConfigDeneb getDenebSpecConfig(
.altairBuilder(a -> a.altairForkEpoch(UInt64.ZERO))
.bellatrixBuilder(b -> b.bellatrixForkEpoch(UInt64.ZERO))
.capellaBuilder(c -> c.capellaForkEpoch(UInt64.ZERO))
.denebBuilder(d -> d.eip4844ForkEpoch(UInt64.ZERO).kzgNoop(true));
.denebBuilder(d -> d.denebForkEpoch(UInt64.ZERO).kzgNoop(true));
configAdapter.accept(builder);
}));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ public void onIncomingMessage(
}

/**
* TODO: Update link for Deneb
*
* <p>See <a
* See <a
* href="https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/p2p-interface.md#blobssidecarsbyrange-v1">BlobsSidecarsByRange
* v1</a>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void updateStatus_shouldReportAllStatusesToSubscribers() {

@Test
@SuppressWarnings({"unchecked", "FutureReturnValueIgnored"})
public void shouldModifyRequestSpanningTheEip4844ForkTransition() {
public void shouldModifyRequestSpanningTheDenebForkTransition() {

final Eth2RpcMethod<BlobsSidecarsByRangeRequestMessage, BlobsSidecar>
blobsSidecarsByRangeMethod = mock(Eth2RpcMethod.class);
Expand Down

0 comments on commit 596a9ac

Please sign in to comment.