Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -170,13 +170,13 @@ void needsToBeValidatedChecks() {

// advance less then required
timeProvider.advanceTimeBySeconds(
Constants.ETH1_INVALID_ENDPOINT_CHECK_INTERVAL.getSeconds() - 10);
Constants.ETH1_INVALID_ENDPOINT_CHECK_INTERVAL.toSeconds() - 10);

// just failed, no need to validate
assertThat(provider.needsToBeValidated()).isFalse();

// advance to go after
timeProvider.advanceTimeBySeconds(Constants.ETH1_INVALID_ENDPOINT_CHECK_INTERVAL.getSeconds());
timeProvider.advanceTimeBySeconds(Constants.ETH1_INVALID_ENDPOINT_CHECK_INTERVAL.toSeconds());

// after the interval needs to be validated
assertThat(provider.needsToBeValidated()).isTrue();
Expand All @@ -186,8 +186,7 @@ void needsToBeValidatedChecks() {
// just validated, no need to validate
assertThat(provider.needsToBeValidated()).isFalse();

timeProvider.advanceTimeBySeconds(
Constants.ETH1_VALID_ENDPOINT_CHECK_INTERVAL.getSeconds() + 1);
timeProvider.advanceTimeBySeconds(Constants.ETH1_VALID_ENDPOINT_CHECK_INTERVAL.toSeconds() + 1);

// after the interval needs to be validated
assertThat(provider.needsToBeValidated()).isTrue();
Expand All @@ -198,13 +197,13 @@ void needsToBeValidatedChecks() {

// advance less then required
timeProvider.advanceTimeBySeconds(
Constants.ETH1_FAILED_ENDPOINT_CHECK_INTERVAL.getSeconds() - 10);
Constants.ETH1_FAILED_ENDPOINT_CHECK_INTERVAL.toSeconds() - 10);

// just failed a call, no need to validate
assertThat(provider.needsToBeValidated()).isFalse();

// advance to go after
timeProvider.advanceTimeBySeconds(Constants.ETH1_FAILED_ENDPOINT_CHECK_INTERVAL.getSeconds());
timeProvider.advanceTimeBySeconds(Constants.ETH1_FAILED_ENDPOINT_CHECK_INTERVAL.toSeconds());

// after the interval needs to be validated
assertThat(provider.needsToBeValidated()).isTrue();
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ plugins {
id 'com.github.ben-manes.versions' version '0.51.0'
id 'com.github.jk1.dependency-license-report' version '2.9'
id 'io.spring.dependency-management' version '1.1.6'
id 'net.ltgt.errorprone' version '4.0.1' apply false
id 'net.ltgt.errorprone' version '4.1.0' apply false
id 'de.undercouch.download' version '5.6.0'
id 'org.ajoberstar.grgit' version '5.2.2'
id 'org.ajoberstar.grgit' version '5.3.0'
}

rootProject.version = calculatePublishVersion()
Expand Down
2 changes: 2 additions & 0 deletions ethereum/spec/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@ dependencies {
testImplementation testFixtures(project(':infrastructure:ssz'))
testImplementation testFixtures(project(':infrastructure:metrics'))
testImplementation testFixtures(project(':infrastructure:time'))

testFixturesImplementation 'org.hyperledger.besu.internal:metrics-core'
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

package tech.pegasys.teku.spec.datastructures.interop;

import java.util.Collections;
import org.hyperledger.besu.config.GenesisConfigFile;
import org.hyperledger.besu.config.GenesisConfigOptions;
import org.hyperledger.besu.datatypes.Wei;
Expand All @@ -24,6 +23,7 @@
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem;
import tech.pegasys.teku.infrastructure.bytes.Bytes20;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader;
Expand All @@ -35,12 +35,15 @@ public class MergedGenesisTestBuilder {
public static ExecutionPayloadHeader createPayloadForBesuGenesis(
final SchemaDefinitions schemaDefinitions, final String genesisConfigFile) {
final GenesisConfigFile configFile = GenesisConfigFile.fromConfig(genesisConfigFile);
final GenesisConfigOptions genesisConfigOptions =
configFile.getConfigOptions(Collections.emptyMap());
final GenesisConfigOptions genesisConfigOptions = configFile.getConfigOptions();
final BadBlockManager badBlockManager = new BadBlockManager();
final ProtocolSchedule protocolSchedule =
MainnetProtocolSchedule.fromConfig(
genesisConfigOptions, MiningParameters.MINING_DISABLED, badBlockManager);
genesisConfigOptions,
MiningParameters.MINING_DISABLED,
badBlockManager,
false,
new NoOpMetricsSystem());
final GenesisState genesisState = GenesisState.fromConfig(configFile, protocolSchedule);
final Block genesisBlock = genesisState.getBlock();
final BlockHeader header = genesisBlock.getHeader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ private void updateLocalSubmissionsErrorHandler(final Throwable throwable) {
}

private void updateLocalSubmissions() {
final UInt64 staleTime =
timeProvider.getTimeInSeconds().minus(Duration.ofHours(2).getSeconds());
final UInt64 staleTime = timeProvider.getTimeInSeconds().minus(Duration.ofHours(2).toSeconds());
final List<OperationPoolEntry<T>> staleLocalOperations =
operations.values().stream()
.filter(OperationPoolEntry::isLocal)
Expand Down
48 changes: 24 additions & 24 deletions gradle/versions.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
dependencyManagement {
dependencies {
dependency 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
dependency 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.2'
dependency 'com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.17.2'
dependency 'com.fasterxml.jackson.module:jackson-module-kotlin:2.17.2'
dependency 'com.fasterxml.jackson.core:jackson-databind:2.18.1'
dependency 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.1'
dependency 'com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.18.1'
dependency 'com.fasterxml.jackson.module:jackson-module-kotlin:2.18.1'

dependencySet(group: 'com.google.errorprone', version: '2.34.0') {
dependencySet(group: 'com.google.errorprone', version: '2.35.1') {
entry 'error_prone_annotation'
entry 'error_prone_check_api'
entry 'error_prone_core'
Expand Down Expand Up @@ -38,11 +38,11 @@ dependencyManagement {

dependency 'org.hdrhistogram:HdrHistogram:2.2.2'

dependency 'org.jetbrains.kotlin:kotlin-stdlib:2.0.20'
dependency 'org.jetbrains.kotlin:kotlin-stdlib:2.0.21'

dependency 'org.mock-server:mockserver-junit-jupiter:5.15.0'

dependencySet(group: 'io.swagger.core.v3', version: '2.2.23') {
dependencySet(group: 'io.swagger.core.v3', version: '2.2.25') {
entry 'swagger-parser'
entry 'swagger-core'
entry 'swagger-models'
Expand All @@ -53,26 +53,26 @@ dependencyManagement {
dependency 'org.webjars:swagger-ui:5.17.14'

dependency 'org.thymeleaf:thymeleaf:3.1.2.RELEASE'
dependency 'io.github.classgraph:classgraph:4.8.175'
dependencySet(group: 'com.github.oshi', version: '6.6.3') {
dependency 'io.github.classgraph:classgraph:4.8.177'
dependencySet(group: 'com.github.oshi', version: '6.6.5') {
entry 'oshi-core'
entry 'oshi-core-java11'
}

dependencySet(group: 'io.netty', version: '4.1.112.Final') {
dependencySet(group: 'io.netty', version: '4.1.114.Final') {
entry 'netty-handler'
entry 'netty-codec-http'
}

dependencySet(group: 'io.vertx', version: '4.5.9') {
dependencySet(group: 'io.vertx', version: '4.5.10') {
entry 'vertx-codegen'
entry 'vertx-core'
entry 'vertx-unit'
entry 'vertx-web'
}
dependency 'io.projectreactor:reactor-core:3.6.9'
dependency 'io.projectreactor:reactor-core:3.6.11'

dependency 'it.unimi.dsi:fastutil:8.5.14'
dependency 'it.unimi.dsi:fastutil:8.5.15'

dependency 'javax.annotation:javax.annotation-api:1.3.2'

Expand All @@ -86,10 +86,10 @@ dependencyManagement {

dependency 'org.apache.commons:commons-text:1.12.0'
dependency 'org.apache.commons:commons-lang3:3.17.0'
dependency 'commons-io:commons-io:2.16.1'
dependency 'commons-io:commons-io:2.17.0'
dependency 'org.commonjava.mimeparse:mimeparse:0.1.3.3'

dependencySet(group: 'org.apache.logging.log4j', version: '2.23.1') {
dependencySet(group: 'org.apache.logging.log4j', version: '2.24.1') {
entry 'log4j-api'
entry 'log4j-core'
entry 'log4j-slf4j-impl'
Expand All @@ -102,20 +102,20 @@ dependencyManagement {

dependency 'org.awaitility:awaitility:4.2.2'

dependencySet(group: 'org.bouncycastle', version: '1.78.1') {
dependencySet(group: 'org.bouncycastle', version: '1.79') {
entry 'bcprov-jdk18on'
entry 'bcpkix-jdk18on'
}

dependencySet(group: 'org.junit.jupiter', version: '5.11.0') {
dependencySet(group: 'org.junit.jupiter', version: '5.11.3') {
entry 'junit-jupiter-api'
entry 'junit-jupiter-engine'
entry 'junit-jupiter-params'
}

dependency 'net.java.dev.jna:jna:5.14.0'
dependency 'net.java.dev.jna:jna:5.15.0'

dependencySet(group: 'org.mockito', version: '5.13.0') {
dependencySet(group: 'org.mockito', version: '5.14.2') {
entry 'mockito-core'
entry 'mockito-junit-jupiter'
}
Expand All @@ -137,22 +137,22 @@ dependencyManagement {
entry 'utils'
}

dependency 'org.xerial.snappy:snappy-java:1.1.10.6'
dependency 'org.xerial.snappy:snappy-java:1.1.10.7'

dependency 'io.prometheus:simpleclient:0.16.0'

dependencySet(group: 'org.hyperledger.besu.internal', version: '24.7.0') {
dependencySet(group: 'org.hyperledger.besu.internal', version: '24.10.0') {
entry('metrics-core')
entry('core')
entry('config')
}
dependencySet(group: 'org.hyperledger.besu', version: '24.8.0') {
dependencySet(group: 'org.hyperledger.besu', version: '24.10.0') {
entry('besu-datatypes')
entry('evm')
entry('plugin-api')
}

dependencySet(group: 'org.testcontainers', version: '1.20.1') {
dependencySet(group: 'org.testcontainers', version: '1.20.3') {
entry "testcontainers"
entry "junit-jupiter"
}
Expand All @@ -176,6 +176,6 @@ dependencyManagement {
entry 'jjwt-jackson'
}

dependency 'net.jqwik:jqwik:1.9.0'
dependency 'net.jqwik:jqwik:1.9.1'
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=1541fa36599e12857140465f3c91a97409b4512501c26f9631fb113e392c5bd1
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ public LabelledMetric<OperationTimer> createLabelledTimer(
.computeIfAbsent(name, __ -> new StubLabelledOperationTimer(category, name, help));
}

@Override
public LabelledMetric<OperationTimer> createSimpleLabelledTimer(
final MetricCategory category,
final String name,
final String help,
final String... labelNames) {
return createLabelledTimer(category, name, help, labelNames);
}

public StubGauge getGauge(final MetricCategory category, final String name) {
validateMetricName(name);
return Optional.ofNullable(gauges.get(category))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private void ensureRequestReceivedWithinTimeLimit(final RpcStream stream) {
if (!requestHandled.get()) {
LOG.debug(
"Failed to receive incoming request data within {} sec for protocol {}. Close stream.",
timeout.getSeconds(),
timeout.toSeconds(),
protocolId);
stream.closeAbruptly().ifExceptionGetsHereRaiseABug();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public RpcTimeoutException(final String message, final Duration timeout) {
}

private static String generateMessage(final String message, final Duration timeout) {
return String.format("Rpc request timed out after %d sec: %s", timeout.getSeconds(), message);
return String.format("Rpc request timed out after %d sec: %s", timeout.toSeconds(), message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public RpcTimeoutException(final String message, final Duration timeout) {
}

private static String generateMessage(final String message, final Duration timeout) {
return String.format("Rpc request timed out after %d sec: %s", timeout.getSeconds(), message);
return String.format("Rpc request timed out after %d sec: %s", timeout.toSeconds(), message);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -431,17 +431,17 @@ public void shouldSwitchToLongDelayAfterFirstPeerIsFound() {
advanceTimeByWarmupSearchInterval();
verify(discoveryService, times(3)).searchForPeers();

timeProvider.advanceTimeBySeconds(ConnectionManager.DISCOVERY_INTERVAL.getSeconds());
timeProvider.advanceTimeBySeconds(ConnectionManager.DISCOVERY_INTERVAL.toSeconds());
asyncRunner.executeDueActionsRepeatedly();
verify(discoveryService, times(4)).searchForPeers();

timeProvider.advanceTimeBySeconds(ConnectionManager.DISCOVERY_INTERVAL.getSeconds());
timeProvider.advanceTimeBySeconds(ConnectionManager.DISCOVERY_INTERVAL.toSeconds());
asyncRunner.executeDueActionsRepeatedly();
verify(discoveryService, times(5)).searchForPeers();
}

private void advanceTimeByWarmupSearchInterval() {
timeProvider.advanceTimeBySeconds(ConnectionManager.WARMUP_DISCOVERY_INTERVAL.getSeconds());
timeProvider.advanceTimeBySeconds(ConnectionManager.WARMUP_DISCOVERY_INTERVAL.toSeconds());
asyncRunner.executeDueActionsRepeatedly();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void onUpdatedValidatorStatuses(
.finish(
error -> {
VALIDATOR_LOGGER.registeringValidatorsFailed(error);
LOG.info("Will retry to register validators in {} seconds", RETRY_DELAY.getSeconds());
LOG.info("Will retry to register validators in {} seconds", RETRY_DELAY.toSeconds());
asyncRunner.runAfterDelay(
() -> onUpdatedValidatorStatuses(newValidatorStatuses, possibleMissingEvents),
RETRY_DELAY);
Expand Down