Search in sources :

Example 1 with SpecConfigBellatrix

use of tech.pegasys.teku.spec.config.SpecConfigBellatrix in project teku by ConsenSys.

the class SpecVersionTest method shouldCreateBellatrixSpec.

@Test
void shouldCreateBellatrixSpec() {
    final SpecConfigBellatrix bellatrixSpecConfig = SpecConfigBellatrix.required(minimalConfig);
    final SpecVersion expectedVersion = SpecVersion.createBellatrix(bellatrixSpecConfig);
    final Optional<SpecVersion> actualVersion = SpecVersion.create(SpecMilestone.BELLATRIX, minimalConfig);
    assertThat(actualVersion).isPresent();
    assertThat(actualVersion.get().getMilestone()).isEqualTo(SpecMilestone.BELLATRIX);
    assertThat(actualVersion.get().getSchemaDefinitions()).hasSameClassAs(expectedVersion.getSchemaDefinitions());
}
Also used : SpecConfigBellatrix(tech.pegasys.teku.spec.config.SpecConfigBellatrix) Test(org.junit.jupiter.api.Test)

Example 2 with SpecConfigBellatrix

use of tech.pegasys.teku.spec.config.SpecConfigBellatrix in project teku by ConsenSys.

the class TerminalPowBlockMonitor method start.

public synchronized void start() {
    if (timer.isPresent()) {
        return;
    }
    Optional<SpecConfigBellatrix> maybeSpecConfigBellatrix = getSpecConfigBellatrix();
    if (maybeSpecConfigBellatrix.isEmpty()) {
        LOG.error("Bellatrix spec config not found. Monitor will shutdown.");
        stop();
        return;
    }
    specConfigBellatrix = maybeSpecConfigBellatrix.get();
    localTransitionConfiguration = new TransitionConfiguration(specConfigBellatrix.getTerminalTotalDifficulty(), specConfigBellatrix.getTerminalBlockHash(), UInt64.ZERO);
    final Duration pollingPeriod = Duration.ofSeconds(spec.getGenesisSpec().getConfig().getSecondsPerEth1Block());
    timer = Optional.of(asyncRunner.runWithFixedDelay(this::monitor, pollingPeriod, (error) -> LOG.error("An error occurred while executing the monitor task", error)));
    LOG.info("Monitor has started. Waiting BELLATRIX fork activation. Polling every {}", pollingPeriod);
}
Also used : TransitionConfiguration(tech.pegasys.teku.spec.executionengine.TransitionConfiguration) SpecConfigBellatrix(tech.pegasys.teku.spec.config.SpecConfigBellatrix) Duration(java.time.Duration)

Aggregations

SpecConfigBellatrix (tech.pegasys.teku.spec.config.SpecConfigBellatrix)2 Duration (java.time.Duration)1 Test (org.junit.jupiter.api.Test)1 TransitionConfiguration (tech.pegasys.teku.spec.executionengine.TransitionConfiguration)1