Skip to content

Commit

Permalink
Merge branch 'master' into feat/lukso-deneb-fork
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolmin committed Sep 27, 2024
2 parents da74cce + b91c432 commit 730456e
Show file tree
Hide file tree
Showing 117 changed files with 2,786 additions and 2,757 deletions.
12 changes: 11 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ executors:
architecture: "amd64"
platform: "linux/amd64"

machine_large_executor_amd64:
machine:
image: ubuntu-2204:2024.01.1 # https://circleci.com/developer/machine/image/ubuntu-2204
docker_layer_caching: true
resource_class: large
working_directory: ~/project
environment:
architecture: "amd64"
platform: "linux/amd64"

machine_executor_arm64:
machine:
image: ubuntu-2204:2024.01.1 # https://circleci.com/developer/machine/image/ubuntu-2204
Expand Down Expand Up @@ -354,7 +364,7 @@ jobs:

acceptanceTests:
parallelism: 5
executor: machine_executor_amd64
executor: machine_large_executor_amd64
steps:
- install_java_21
- prepare
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
- Implemented [PostAggregateAndProofsV2](https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Validator/publishAggregateAndProofsV2) (adding support for Electra)
- Added support for [Ephemery Testnet](https://github.com/ephemery.dev) `--network=ephemery`
- Renamed metrics `validator_attestation_publication_delay`,`validator_block_publication_delay` and `beacon_block_import_delay_counter` to include the suffix `_total` added by the current version of prometheus.
- Updated bootnodes for Holesky network
- Added new `--p2p-flood-publish-enabled` parameter to control whenever flood publishing behaviour is enabled (applies to all subnets). Previous teku versions always had this behaviour enabled. Default is `true`.
- Add a fix for [CVE-2024-7254](https://avd.aquasec.com/nvd/2024/cve-2024-7254/)

### Bug Fixes
- removed a warning from logs about non blinded blocks being requested (#8562)
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class CapellaUpgradeAcceptanceTest extends AcceptanceTestBase {
@Test
void shouldUpgradeToCapella() throws Exception {
final UInt64 currentTime = timeProvider.getTimeInSeconds();
final int genesisTime = currentTime.plus(30).intValue(); // magic node startup time
final int genesisTime = currentTime.plus(60).intValue(); // magic node startup time
final int shanghaiTime = genesisTime + 4 * 2; // 4 slots, 2 seconds each
final Map<String, String> genesisOverrides =
Map.of("shanghaiTime", String.valueOf(shanghaiTime));
Expand All @@ -51,6 +51,15 @@ void shouldUpgradeToCapella() throws Exception {
genesisOverrides);
primaryEL.start();

TekuBeaconNode primaryNode =
createTekuBeaconNode(
beaconNodeConfigWithForks(genesisTime, primaryEL)
.withStartupTargetPeerCount(0)
.build());

primaryNode.start();
primaryNode.waitForMilestone(SpecMilestone.CAPELLA);

BesuNode secondaryEL =
createBesuNode(
BesuDockerVersion.STABLE,
Expand All @@ -64,15 +73,6 @@ void shouldUpgradeToCapella() throws Exception {
secondaryEL.start();
secondaryEL.addPeer(primaryEL);

TekuBeaconNode primaryNode =
createTekuBeaconNode(
beaconNodeConfigWithForks(genesisTime, primaryEL)
.withStartupTargetPeerCount(0)
.build());

primaryNode.start();
primaryNode.waitForMilestone(SpecMilestone.CAPELLA);

final int primaryNodeGenesisTime = primaryNode.getGenesisTime().intValue();

TekuBeaconNode lateJoiningNode =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class DenebUpgradeAcceptanceTest extends AcceptanceTestBase {
@Test
void shouldUpgradeToDeneb() throws Exception {
final UInt64 currentTime = timeProvider.getTimeInSeconds();
final int genesisTime = currentTime.plus(30).intValue(); // magic node startup time
final int genesisTime = currentTime.plus(60).intValue(); // magic node startup time
final int epochDuration = 4 * 2; // 4 slots, 2 seconds each for swift
final int shanghaiTime = genesisTime + epochDuration;
final Map<String, String> genesisOverrides =
Expand All @@ -56,6 +56,15 @@ void shouldUpgradeToDeneb() throws Exception {
genesisOverrides);
primaryEL.start();

TekuBeaconNode primaryNode =
createTekuBeaconNode(
beaconNodeWithTrustedSetup(genesisTime, primaryEL)
.withStartupTargetPeerCount(0)
.build());

primaryNode.start();
primaryNode.waitForMilestone(SpecMilestone.DENEB);

BesuNode secondaryEL =
createBesuNode(
BesuDockerVersion.STABLE,
Expand All @@ -69,15 +78,6 @@ void shouldUpgradeToDeneb() throws Exception {
secondaryEL.start();
secondaryEL.addPeer(primaryEL);

TekuBeaconNode primaryNode =
createTekuBeaconNode(
beaconNodeWithTrustedSetup(genesisTime, primaryEL)
.withStartupTargetPeerCount(0)
.build());

primaryNode.start();
primaryNode.waitForMilestone(SpecMilestone.DENEB);

final int primaryNodeGenesisTime = primaryNode.getGenesisTime().intValue();

TekuBeaconNode lateJoiningNode =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.google.common.io.Resources;
import java.net.URL;
import java.util.Map;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import tech.pegasys.teku.ethereum.execution.types.Eth1Address;
import tech.pegasys.teku.infrastructure.time.SystemTimeProvider;
Expand All @@ -30,6 +31,7 @@
import tech.pegasys.teku.test.acceptance.dsl.TekuNodeConfigBuilder;
import tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores;

@Disabled("Won't work until we update Engine API for Electra + EL changes")
public class ElectraUpgradeAcceptanceTest extends AcceptanceTestBase {

private static final String NETWORK_NAME = "swift";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.google.common.io.Resources;
import java.net.URL;
import java.util.Map;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import tech.pegasys.teku.bls.BLSPublicKey;
import tech.pegasys.teku.ethereum.execution.types.Eth1Address;
Expand All @@ -37,6 +38,7 @@ public class ExecutionLayerTriggeredExitAcceptanceTest extends AcceptanceTestBas
private static final URL JWT_FILE = Resources.getResource("auth/ee-jwt-secret.hex");

@Test
@Disabled("Won't work until we update Engine API for Electra")
void triggerValidatorExitWithFullWithdrawal() throws Exception {
final UInt64 currentTime = new SystemTimeProvider().getTimeInSeconds();
final int genesisTime =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadContext;
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader;
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadResult;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequestsBuilderElectra;
import tech.pegasys.teku.spec.datastructures.operations.Attestation;
import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing;
import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing;
Expand All @@ -63,6 +64,7 @@
import tech.pegasys.teku.spec.schemas.SchemaDefinitions;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsBellatrix;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsDeneb;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsElectra;
import tech.pegasys.teku.statetransition.OperationPool;
import tech.pegasys.teku.statetransition.attestation.AggregatingAttestationPool;
import tech.pegasys.teku.statetransition.attestation.AttestationForkChecker;
Expand Down Expand Up @@ -238,6 +240,15 @@ private SafeFuture<Void> setExecutionData(
requestedBuilderBoostFactor,
blockProductionPerformance);

// TODO Update as part of Electra Engine API updates
// (https://github.com/Consensys/teku/issues/8620)
if (bodyBuilder.supportsExecutionRequests()) {
bodyBuilder.executionRequests(
new ExecutionRequestsBuilderElectra(
SchemaDefinitionsElectra.required(schemaDefinitions).getExecutionRequestsSchema())
.build());
}

return SafeFuture.allOf(
cacheExecutionPayloadValue(executionPayloadResult, blockSlotState),
setPayloadOrPayloadHeader(bodyBuilder, executionPayloadResult),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ private SafeFuture<BlockPerformance> getBlockPerformanceForEpoch(final UInt64 cu

private boolean isInHistoricBlockRoots(
final BeaconState state, final SlotAndBlockRoot producedBlock) {
LOG.debug(
"Checking if block {} is in historic block roots {} of the state {}",
producedBlock,
state.getBlockRoots(),
state.hashTreeRoot());
return producedBlock.getSlot().isLessThan(state.getSlot())
&& spec.getBlockRootAtSlot(state, producedBlock.getSlot())
.equals(producedBlock.getBlockRoot());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import tech.pegasys.teku.spec.datastructures.execution.FallbackData;
import tech.pegasys.teku.spec.datastructures.execution.FallbackReason;
import tech.pegasys.teku.spec.datastructures.execution.GetPayloadResponse;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequests;
import tech.pegasys.teku.spec.datastructures.operations.Attestation;
import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing;
import tech.pegasys.teku.spec.datastructures.operations.Deposit;
Expand Down Expand Up @@ -1165,6 +1166,11 @@ private static class CapturingBeaconBlockBodyBuilder implements BeaconBlockBodyB
protected ExecutionPayloadHeader executionPayloadHeader;
protected SszList<SszKZGCommitment> blobKzgCommitments;

// TODO Update as part of Electra Engine API updates
// (https://github.com/Consensys/teku/issues/8620)
@SuppressWarnings("unused")
protected ExecutionRequests executionRequests;

public CapturingBeaconBlockBodyBuilder(final boolean supportsKzgCommitments) {
this.supportsKzgCommitments = supportsKzgCommitments;
}
Expand Down Expand Up @@ -1243,6 +1249,12 @@ public BeaconBlockBodyBuilder blsToExecutionChanges(
return this;
}

@Override
public BeaconBlockBodyBuilder executionRequests(final ExecutionRequests executionRequests) {
this.executionRequests = executionRequests;
return this;
}

@Override
public Boolean supportsSyncAggregate() {
return true;
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ allprojects {
}
}

def refTestVersion = 'v1.5.0-alpha.5'
def refTestVersion = 'v1.5.0-alpha.6'
def blsRefTestVersion = 'v0.1.2'
def slashingProtectionInterchangeRefTestVersion = 'v5.3.0'
def refTestBaseUrl = 'https://github.com/ethereum/consensus-spec-tests/releases/download'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title" : "BeaconBlockBodyElectra",
"type" : "object",
"required" : [ "randao_reveal", "eth1_data", "graffiti", "proposer_slashings", "attester_slashings", "attestations", "deposits", "voluntary_exits", "sync_aggregate", "execution_payload", "bls_to_execution_changes", "blob_kzg_commitments" ],
"required" : [ "randao_reveal", "eth1_data", "graffiti", "proposer_slashings", "attester_slashings", "attestations", "deposits", "voluntary_exits", "sync_aggregate", "execution_payload", "bls_to_execution_changes", "blob_kzg_commitments", "execution_requests" ],
"properties" : {
"randao_reveal" : {
"type" : "string",
Expand Down Expand Up @@ -52,7 +52,7 @@
"$ref" : "#/components/schemas/SyncAggregate"
},
"execution_payload" : {
"$ref" : "#/components/schemas/ExecutionPayloadElectra"
"$ref" : "#/components/schemas/ExecutionPayloadDeneb"
},
"bls_to_execution_changes" : {
"type" : "array",
Expand All @@ -68,6 +68,9 @@
"description" : "Bytes48 hexadecimal",
"format" : "bytes"
}
},
"execution_requests" : {
"$ref" : "#/components/schemas/ExecutionRequests"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"$ref" : "#/components/schemas/SyncCommittee"
},
"latest_execution_payload_header" : {
"$ref" : "#/components/schemas/ExecutionPayloadHeaderElectra"
"$ref" : "#/components/schemas/ExecutionPayloadHeaderDeneb"
},
"next_withdrawal_index" : {
"type" : "string",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title" : "BlindedBlockBodyElectra",
"type" : "object",
"required" : [ "randao_reveal", "eth1_data", "graffiti", "proposer_slashings", "attester_slashings", "attestations", "deposits", "voluntary_exits", "sync_aggregate", "execution_payload_header", "bls_to_execution_changes", "blob_kzg_commitments" ],
"required" : [ "randao_reveal", "eth1_data", "graffiti", "proposer_slashings", "attester_slashings", "attestations", "deposits", "voluntary_exits", "sync_aggregate", "execution_payload_header", "bls_to_execution_changes", "blob_kzg_commitments", "execution_requests" ],
"properties" : {
"randao_reveal" : {
"type" : "string",
Expand Down Expand Up @@ -52,7 +52,7 @@
"$ref" : "#/components/schemas/SyncAggregate"
},
"execution_payload_header" : {
"$ref" : "#/components/schemas/ExecutionPayloadHeaderElectra"
"$ref" : "#/components/schemas/ExecutionPayloadHeaderDeneb"
},
"bls_to_execution_changes" : {
"type" : "array",
Expand All @@ -68,6 +68,9 @@
"description" : "Bytes48 hexadecimal",
"format" : "bytes"
}
},
"execution_requests" : {
"$ref" : "#/components/schemas/ExecutionRequests"
}
}
}
Loading

0 comments on commit 730456e

Please sign in to comment.