Skip to content

Commit

Permalink
Merge branch 'master' into ephemery-startup-test
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfyone authored Oct 31, 2024
2 parents 0235962 + 4910514 commit 5def828
Show file tree
Hide file tree
Showing 234 changed files with 17,611 additions and 2,680 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
### Breaking Changes

### Additions and Improvements
- Clean up old beacon states when switching from ARCHIVE to PRUNE or MINIMAL data storage mode

### Bug Fixes
- Fixed a block production issue for Validator Client (24.10.0 to 24.10.2 teku VC), where required headers were not provided for JSON payloads. Default SSZ block production was unaffected.
- Block production now uses json data (more like 24.8.0 did than 24.10) if the Eth-Consensus-version header is absent.
- Added a startup script for unix systems to ensure that when jemalloc is installed the script sets the LD_PRELOAD environment variable to the use the jemalloc library
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,7 @@ private String addRemoteValidators(final List<BLSPublicKey> publicKeys, final St
throws IOException {

List<Map<String, String>> requestPayload =
publicKeys.stream()
.map(k -> remotePostRequestBody(k, signerUrl))
.collect(Collectors.toList());
publicKeys.stream().map(k -> remotePostRequestBody(k, signerUrl)).toList();
final String body = objectMapper.writeValueAsString(Map.of("remote_keys", requestPayload));

final String result = httpClient.post(validatorUri.get(), REMOTE_KEYS_URL, body, authHeaders());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package tech.pegasys.teku.test.acceptance.dsl.tools.deposits;

import java.util.List;
import java.util.stream.Collectors;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import tech.pegasys.teku.ethereum.execution.types.Eth1Address;
Expand All @@ -40,9 +39,7 @@ public SafeFuture<Void> sendDeposits(final ValidatorKeystores validators) {
return SafeFuture.of(
() -> {
final List<SafeFuture<TransactionReceipt>> transactionReceipts =
validators.getValidatorKeys().stream()
.map(this::sendDeposit)
.collect(Collectors.toList());
validators.getValidatorKeys().stream().map(this::sendDeposit).toList();
return SafeFuture.allOf(transactionReceipts.toArray(SafeFuture[]::new));
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class ValidatorKeys {
private final BLSKeyPair validatorKey;

private boolean locked = false;
private final boolean locked;
private final Bytes32 withdrawalCredentials;
private final Optional<BLSKeyPair> withdrawalKey;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public class SyncingNodeManager {
private final BlockGossipChannel blockGossipChannel;

private SyncingNodeManager(
final AsyncRunner asyncRunner,
final EventChannels eventChannels,
final RecentChainData recentChainData,
final BeaconChainUtil chainUtil,
Expand All @@ -94,7 +95,7 @@ private SyncingNodeManager(
this.chainUtil = chainUtil;
this.eth2P2PNetwork = eth2P2PNetwork;
this.syncService = syncService;
this.blockGossipChannel = eventChannels.getPublisher(BlockGossipChannel.class);
this.blockGossipChannel = eventChannels.getPublisher(BlockGossipChannel.class, asyncRunner);
}

@SuppressWarnings("FutureReturnValueIgnored")
Expand Down Expand Up @@ -215,7 +216,7 @@ public static SyncingNodeManager create(
syncService.start().join();

return new SyncingNodeManager(
eventChannels, recentChainData, chainUtil, eth2P2PNetwork, syncService);
asyncRunner, eventChannels, recentChainData, chainUtil, eth2P2PNetwork, syncService);
}

public SafeFuture<Peer> connect(final SyncingNodeManager peer) {
Expand Down Expand Up @@ -250,6 +251,6 @@ public void setSlot(final UInt64 slot) {
}

public void gossipBlock(final SignedBeaconBlock block) {
blockGossipChannel.publishBlock(block);
blockGossipChannel.publishBlock(block).ifExceptionGetsHereRaiseABug();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ void publishBlockAndBlobSidecars(
final SignedBeaconBlock block,
final List<BlobSidecar> blobSidecars,
final BlockPublishingPerformance blockPublishingPerformance) {
blockGossipChannel.publishBlock(block);
blobSidecarGossipChannel.publishBlobSidecars(blobSidecars);
blockGossipChannel.publishBlock(block).ifExceptionGetsHereRaiseABug();
blobSidecarGossipChannel.publishBlobSidecars(blobSidecars).ifExceptionGetsHereRaiseABug();
blockPublishingPerformance.blockAndBlobSidecarsPublishingInitiated();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void publishBlockAndBlobSidecars(
final SignedBeaconBlock block,
final List<BlobSidecar> blobSidecars,
final BlockPublishingPerformance blockPublishingPerformance) {
blockGossipChannel.publishBlock(block);
blockGossipChannel.publishBlock(block).ifExceptionGetsHereRaiseABug();
blockPublishingPerformance.blockPublishingInitiated();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ public void setUp() {
this.epochStartSlot = spec.computeStartSlotAtEpoch(EPOCH);
this.previousEpochStartSlot = spec.computeStartSlotAtEpoch(PREVIOUS_EPOCH);
this.dataStructureUtil = new DataStructureUtil(spec);
when(blockGossipChannel.publishBlock(any())).thenReturn(SafeFuture.COMPLETE);
when(blobSidecarGossipChannel.publishBlobSidecar(any())).thenReturn(SafeFuture.COMPLETE);
when(blobSidecarGossipChannel.publishBlobSidecars(any())).thenReturn(SafeFuture.COMPLETE);
when(dutyMetrics.getValidatorDutyMetric())
.thenReturn(ValidatorDutyMetricUtils.createValidatorDutyMetric(new StubMetricsSystem()));
this.validatorApiHandler =
Expand Down
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -574,11 +574,11 @@ task autocomplete(type: JavaExec) {
}

installDist {
dependsOn checkLicense, autocomplete
dependsOn checkLicense, startScripts, autocomplete
}

distTar {
dependsOn checkLicense, autocomplete
dependsOn checkLicense, startScripts, autocomplete
doFirst {
delete fileTree(dir: 'build/distributions', include: '*.tar.gz')
}
Expand All @@ -591,7 +591,7 @@ distTar {
}

distZip {
dependsOn checkLicense, autocomplete
dependsOn checkLicense, startScripts, autocomplete
doFirst {
delete fileTree(dir: 'build/distributions', include: '*.zip')
}
Expand All @@ -603,6 +603,8 @@ distZip {

startScripts {

unixStartScriptGenerator.template = resources.text.fromFile("${projectDir}/teku/src/main/scripts/unixStartScript.txt")

def shortenWindowsClasspath = { line ->
line = line.replaceAll(/^set CLASSPATH=.*$/, "set CLASSPATH=%APP_HOME%/lib/*")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void checkResponseData(final Response response, final String metadata)
throws IOException {
final JsonNode data = getResponseData(response);

assertThat(data.get("peer_id").asText()).isEqualTo(node1.toBase58().toString());
assertThat(data.get("peer_id").asText()).isEqualTo(node1.toBase58());
assertThat(data.get("enr").asText()).isEqualTo(enr);
assertThat(data.get("p2p_addresses").get(0).asText()).isEqualTo(address);
assertThat(data.get("discovery_addresses").get(0).asText()).isEqualTo(discoveryAddress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void shouldGetPeerById() throws IOException {
assertThat(response.code()).isEqualTo(SC_OK);

final JsonNode data = getResponseData(response);
assertThat(data.get("peer_id").asText()).isEqualTo(node1.toBase58().toString());
assertThat(data.get("peer_id").asText()).isEqualTo(node1.toBase58());
assertThat(data.get("enr")).isNull();
assertThat(data.get("last_seen_p2p_address").asText())
.isEqualTo("/ip/1.2.3.4/tcp/4242/p2p/aeiou");
Expand Down
Loading

0 comments on commit 5def828

Please sign in to comment.