diff --git a/CHANGELOG.md b/CHANGELOG.md index 80a72717fe9..cd4dcc545b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ## Unreleased Changes ### Breaking Changes + - Removed the legacy web3j-based Eth1/PoW deposit-log fetching. A node no longer requires an Eth1 JSON-RPC endpoint to run; deposits are sourced from the finalized deposit-tree snapshot and in-protocol (EIP-6110) execution requests. The following CLI options have been removed: `--eth1-endpoints` / `--eth1-endpoint`, `--eth1-deposit-contract-max-request-size`. ### Additions and Improvements - Added ssz output for validator balances api. diff --git a/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuNodeConfigBuilder.java b/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuNodeConfigBuilder.java index a9535b6b1fc..3484d3aadb6 100644 --- a/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuNodeConfigBuilder.java +++ b/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuNodeConfigBuilder.java @@ -478,9 +478,7 @@ public TekuNodeConfigBuilder withDepositsFrom(final BesuNode eth1Node) { mustBe(NodeType.BEACON_NODE); configMap.put("Xinterop-enabled", false); LOG.debug("eth1-deposit-contract-address={}}", eth1Node.getDepositContractAddress().toString()); - LOG.debug("eth1-endpoint={}", eth1Node.getInternalJsonRpcUrl()); configMap.put("eth1-deposit-contract-address", eth1Node.getDepositContractAddress().toString()); - configMap.put("eth1-endpoint", eth1Node.getInternalJsonRpcUrl()); return this; } diff --git a/services/powchain/src/main/java/tech/pegasys/teku/services/powchain/PowchainConfiguration.java b/services/powchain/src/main/java/tech/pegasys/teku/services/powchain/PowchainConfiguration.java index 36dd93f4ad7..3fb1cb716c7 100644 --- a/services/powchain/src/main/java/tech/pegasys/teku/services/powchain/PowchainConfiguration.java +++ b/services/powchain/src/main/java/tech/pegasys/teku/services/powchain/PowchainConfiguration.java @@ -21,17 +21,13 @@ import java.util.Optional; import org.apache.commons.lang3.StringUtils; import tech.pegasys.teku.ethereum.execution.types.Eth1Address; -import tech.pegasys.teku.infrastructure.exceptions.InvalidConfigurationException; import tech.pegasys.teku.infrastructure.http.UrlSanitizer; import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.spec.Spec; import tech.pegasys.teku.spec.networks.Eth2Network; public class PowchainConfiguration { - public static final int DEFAULT_ETH1_LOGS_MAX_BLOCK_RANGE = 10_000; - public static final boolean DEFAULT_USE_MISSING_DEPOSIT_EVENT_LOGGING = false; public static final boolean DEFAULT_DEPOSIT_SNAPSHOT_ENABLED = true; - public static final boolean DEFAULT_DEPOSIT_CONTRACT_LOGS_SYNCING_ENABLED = true; public static final String DEPOSIT_SNAPSHOT_URL_PATH = "/eth/v1/beacon/deposit_snapshot"; private final Spec spec; @@ -39,27 +35,18 @@ public class PowchainConfiguration { private final Eth1Address depositContract; private final Optional depositContractDeployBlock; private final DepositTreeSnapshotConfiguration depositTreeSnapshotConfiguration; - private final int eth1LogsMaxBlockRange; - private final boolean useMissingDepositEventLogging; - private final boolean depositContractLogsSyncingEnabled; private PowchainConfiguration( final Spec spec, final List eth1Endpoints, final Eth1Address depositContract, final Optional depositContractDeployBlock, - final DepositTreeSnapshotConfiguration depositTreeSnapshotConfiguration, - final int eth1LogsMaxBlockRange, - final boolean useMissingDepositEventLogging, - final boolean depositContractLogsSyncingEnabled) { + final DepositTreeSnapshotConfiguration depositTreeSnapshotConfiguration) { this.spec = spec; this.eth1Endpoints = eth1Endpoints; this.depositContract = depositContract; this.depositContractDeployBlock = depositContractDeployBlock; this.depositTreeSnapshotConfiguration = depositTreeSnapshotConfiguration; - this.eth1LogsMaxBlockRange = eth1LogsMaxBlockRange; - this.useMissingDepositEventLogging = useMissingDepositEventLogging; - this.depositContractLogsSyncingEnabled = depositContractLogsSyncingEnabled; } public static Builder builder() { @@ -90,18 +77,6 @@ public DepositTreeSnapshotConfiguration getDepositTreeSnapshotConfiguration() { return depositTreeSnapshotConfiguration; } - public int getEth1LogsMaxBlockRange() { - return eth1LogsMaxBlockRange; - } - - public boolean useMissingDepositEventLogging() { - return useMissingDepositEventLogging; - } - - public boolean isDepositContractLogsSyncingEnabled() { - return depositContractLogsSyncingEnabled; - } - public static class Builder { private Spec spec; private List eth1Endpoints = new ArrayList<>(); @@ -110,11 +85,7 @@ public static class Builder { private Optional customDepositSnapshotPath = Optional.empty(); private Optional checkpointSyncDepositSnapshotUrl = Optional.empty(); private Optional bundledDepositSnapshotPath = Optional.empty(); - private int eth1LogsMaxBlockRange = DEFAULT_ETH1_LOGS_MAX_BLOCK_RANGE; - private boolean useMissingDepositEventLogging = DEFAULT_USE_MISSING_DEPOSIT_EVENT_LOGGING; private boolean depositSnapshotEnabled = DEFAULT_DEPOSIT_SNAPSHOT_ENABLED; - private boolean depositContractLogsSyncingEnabled = - DEFAULT_DEPOSIT_CONTRACT_LOGS_SYNCING_ENABLED; private Builder() {} @@ -133,10 +104,7 @@ public PowchainConfiguration build() { customDepositSnapshotPath, checkpointSyncDepositSnapshotUrl, bundledDepositSnapshotPath, - isBundledSnapshotEnabled), - eth1LogsMaxBlockRange, - useMissingDepositEventLogging, - depositContractLogsSyncingEnabled); + isBundledSnapshotEnabled)); } private void validate() { @@ -222,29 +190,9 @@ public Builder depositSnapshotEnabled(final boolean depositSnapshotEnabled) { return this; } - public Builder depositContractLogsSyncingEnabled( - final boolean depositContractLogsSyncingEnabled) { - this.depositContractLogsSyncingEnabled = depositContractLogsSyncingEnabled; - return this; - } - - public Builder eth1LogsMaxBlockRange(final int eth1LogsMaxBlockRange) { - if (eth1LogsMaxBlockRange < 0) { - throw new InvalidConfigurationException( - String.format("Invalid eth1LogsMaxBlockRange: %d", eth1LogsMaxBlockRange)); - } - this.eth1LogsMaxBlockRange = eth1LogsMaxBlockRange; - return this; - } - public Builder specProvider(final Spec spec) { this.spec = spec; return this; } - - public Builder useMissingDepositEventLogging(final boolean useMissingDepositEventLogging) { - this.useMissingDepositEventLogging = useMissingDepositEventLogging; - return this; - } } } diff --git a/teku/src/main/java/tech/pegasys/teku/cli/options/DepositOptions.java b/teku/src/main/java/tech/pegasys/teku/cli/options/DepositOptions.java index 0fa76a56e0d..7e092ed3c97 100644 --- a/teku/src/main/java/tech/pegasys/teku/cli/options/DepositOptions.java +++ b/teku/src/main/java/tech/pegasys/teku/cli/options/DepositOptions.java @@ -13,8 +13,6 @@ package tech.pegasys.teku.cli.options; -import java.util.ArrayList; -import java.util.List; import picocli.CommandLine; import picocli.CommandLine.Help.Visibility; import picocli.CommandLine.Option; @@ -23,33 +21,6 @@ public class DepositOptions { - @Option( - names = {"--eth1-endpoints", "--eth1-endpoint"}, - paramLabel = "", - description = "URLs for Eth1 nodes.", - split = ",", - arity = "1..*") - private List eth1Endpoints = new ArrayList<>(); - - @Option( - names = {"--eth1-deposit-contract-max-request-size"}, - paramLabel = "", - description = - "Maximum number of blocks to request deposit contract event logs for in a single request.", - arity = "1") - private int eth1LogsMaxBlockRange = PowchainConfiguration.DEFAULT_ETH1_LOGS_MAX_BLOCK_RANGE; - - @Option( - names = {"--Xeth1-missing-deposits-event-logging-enabled"}, - paramLabel = "", - description = "Enable logging an event on each slot whenever deposits are missing", - hidden = true, - showDefaultValue = Visibility.ALWAYS, - arity = "0..1", - fallbackValue = "true") - private boolean useMissingDepositEventLogging = - PowchainConfiguration.DEFAULT_USE_MISSING_DEPOSIT_EVENT_LOGGING; - @CommandLine.Option( names = {"--Xdeposit-snapshot"}, paramLabel = "", @@ -68,27 +39,11 @@ public class DepositOptions { fallbackValue = "true") private boolean depositSnapshotEnabled = PowchainConfiguration.DEFAULT_DEPOSIT_SNAPSHOT_ENABLED; - @Option( - names = {"--Xdeposit-contract-logs-syncing-enabled"}, - paramLabel = "", - description = - "Enable syncing of deposit contract logs from the Execution Engine node. This is required for block production.", - hidden = true, - showDefaultValue = Visibility.ALWAYS, - arity = "0..1", - fallbackValue = "true") - private boolean depositContractLogsSyncingEnabled = - PowchainConfiguration.DEFAULT_DEPOSIT_CONTRACT_LOGS_SYNCING_ENABLED; - public void configure(final TekuConfiguration.Builder builder) { builder.powchain( b -> { - b.eth1Endpoints(eth1Endpoints); - b.eth1LogsMaxBlockRange(eth1LogsMaxBlockRange); - b.useMissingDepositEventLogging(useMissingDepositEventLogging); b.customDepositSnapshotPath(depositSnapshotPath); b.depositSnapshotEnabled(depositSnapshotEnabled); - b.depositContractLogsSyncingEnabled(depositContractLogsSyncingEnabled); }); } } diff --git a/teku/src/test/java/tech/pegasys/teku/cli/BeaconNodeCommandTest.java b/teku/src/test/java/tech/pegasys/teku/cli/BeaconNodeCommandTest.java index 081750bd138..997c47a61ee 100644 --- a/teku/src/test/java/tech/pegasys/teku/cli/BeaconNodeCommandTest.java +++ b/teku/src/test/java/tech/pegasys/teku/cli/BeaconNodeCommandTest.java @@ -568,8 +568,6 @@ private String[] createCliArgs() { "true", "--eth1-deposit-contract-address", "0x77f7bED277449F51505a4C54550B074030d989bC", - "--eth1-endpoint", - "http://localhost:8545", "--ee-endpoint", "http://localhost:8550", "--metrics-enabled", @@ -615,8 +613,7 @@ private TekuConfiguration.Builder expectedDefaultConfigurationBuilder() { .powchain( b -> { b.depositContract(networkConfig.getEth1DepositContractAddress()); - b.eth1Endpoints(new ArrayList<>()) - .depositContractDeployBlock(networkConfig.getEth1DepositContractDeployBlock()); + b.depositContractDeployBlock(networkConfig.getEth1DepositContractDeployBlock()); }) .storageConfiguration( b -> @@ -651,11 +648,7 @@ private TekuConfiguration.Builder expectedConfigurationBuilder() { return TekuConfiguration.builder() .eth2NetworkConfig(b -> b.applyMinimalNetworkDefaults().eth1DepositContractAddress(address)) .executionLayer(b -> b.engineEndpoint("http://localhost:8550")) - .powchain( - b -> - b.eth1Endpoints(List.of("http://localhost:8545")) - .depositContract(address) - .eth1LogsMaxBlockRange(10_000)) + .powchain(b -> b.depositContract(address)) .store(b -> b.hotStatePersistenceFrequencyInEpochs(2)) .storageConfiguration( b -> diff --git a/teku/src/test/java/tech/pegasys/teku/cli/options/DepositOptionsTest.java b/teku/src/test/java/tech/pegasys/teku/cli/options/DepositOptionsTest.java index 8ca96f2b184..ebf19527d4b 100644 --- a/teku/src/test/java/tech/pegasys/teku/cli/options/DepositOptionsTest.java +++ b/teku/src/test/java/tech/pegasys/teku/cli/options/DepositOptionsTest.java @@ -28,70 +28,6 @@ public class DepositOptionsTest extends AbstractBeaconNodeCommandTest { - @Test - public void shouldReadDepositOptionsFromConfigurationFile() { - final TekuConfiguration config = getTekuConfigurationFromFile("depositOptions_config.yaml"); - - assertThat(config.powchain().isEnabled()).isTrue(); - assertThat(config.powchain().getEth1Endpoints()) - .containsExactly("http://example.com:1234/path/"); - } - - @Test - public void shouldReportEth1EnabledIfEndpointSpecified() { - final String[] args = {"--eth1-endpoint", "http://example.com:1234/path/"}; - final TekuConfiguration config = getTekuConfigurationFromArguments(args); - assertThat(config.powchain().isEnabled()).isTrue(); - } - - @Test - public void shouldReportEth1DisabledIfEndpointNotSpecified() { - final TekuConfiguration config = getTekuConfigurationFromArguments(); - assertThat(config.powchain().isEnabled()).isFalse(); - } - - @Test - public void shouldReportEth1DisabledIfEndpointIsEmpty() { - final String[] args = {"--eth1-endpoint", " "}; - final TekuConfiguration config = getTekuConfigurationFromArguments(args); - assertThat(config.powchain().isEnabled()).isFalse(); - } - - @Test - public void multiple_eth1Endpoints_areSupported() { - final String[] args = { - "--eth1-endpoints", - "http://example.com:1234/path/,http://example-2.com:1234/path/", - "http://example-3.com:1234/path/" - }; - final TekuConfiguration config = getTekuConfigurationFromArguments(args); - assertThat(config.powchain().getEth1Endpoints()) - .containsExactlyInAnyOrder( - "http://example.com:1234/path/", - "http://example-2.com:1234/path/", - "http://example-3.com:1234/path/"); - assertThat(config.powchain().isEnabled()).isTrue(); - } - - @Test - public void multiple_eth1Endpoints_areSupported_mixedParams() { - final String[] args = { - "--eth1-endpoint", - "http://example-single.com:1234/path/", - "--eth1-endpoints", - "http://example.com:1234/path/,http://example-2.com:1234/path/", - "http://example-3.com:1234/path/" - }; - final TekuConfiguration config = getTekuConfigurationFromArguments(args); - assertThat(config.powchain().getEth1Endpoints()) - .containsExactlyInAnyOrder( - "http://example-single.com:1234/path/", - "http://example.com:1234/path/", - "http://example-2.com:1234/path/", - "http://example-3.com:1234/path/"); - assertThat(config.powchain().isEnabled()).isTrue(); - } - @ParameterizedTest(name = "{0}") @ValueSource(strings = {"mainnet", "holesky", "gnosis", "sepolia"}) public void shouldSetDefaultBundleSnapshotPathForSupportedNetwork(final String network) { @@ -183,11 +119,4 @@ public void shouldSetCheckpointSyncDepositSnapshotUrlWhenUsingCheckpointSyncUrl( assertThat(depositTreeSnapshotConfiguration.getCustomDepositSnapshotPath()) .hasValue("/foo/bar"); } - - @Test - public void shouldHaveDepositContractLogsSyncingEnabledByDefault() { - final String[] args = {}; - final TekuConfiguration config = getTekuConfigurationFromArguments(args); - assertThat(config.powchain().isDepositContractLogsSyncingEnabled()).isTrue(); - } } diff --git a/teku/src/test/resources/beaconAndValidatorOptions_config.yaml b/teku/src/test/resources/beaconAndValidatorOptions_config.yaml index c1a8d38c69d..025885f6665 100644 --- a/teku/src/test/resources/beaconAndValidatorOptions_config.yaml +++ b/teku/src/test/resources/beaconAndValidatorOptions_config.yaml @@ -8,7 +8,6 @@ Xinterop-enabled: True # deposit eth1-deposit-contract-address: "0x77f7bED277449F51505a4C54550B074030d989bC" -eth1-endpoint: "http://localhost:8545" # validator network: "mainnet" diff --git a/teku/src/test/resources/complete_config.yaml b/teku/src/test/resources/complete_config.yaml index 8812d8eac36..a69f03c6d6c 100644 --- a/teku/src/test/resources/complete_config.yaml +++ b/teku/src/test/resources/complete_config.yaml @@ -21,8 +21,6 @@ Xinterop-enabled: True # deposit eth1-deposit-contract-address: "0x77f7bED277449F51505a4C54550B074030d989bC" -eth1-endpoint: "http://localhost:8545" -#Xeth1-deposits-from-storage-enabled: true # execution engine ee-endpoint: "http://localhost:8550" diff --git a/teku/src/test/resources/depositOptions_config.yaml b/teku/src/test/resources/depositOptions_config.yaml deleted file mode 100644 index 2951a1e41b1..00000000000 --- a/teku/src/test/resources/depositOptions_config.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# eth1 -eth1-endpoint: "http://example.com:1234/path/" \ No newline at end of file