diff --git a/CHANGELOG.md b/CHANGELOG.md index cc38c88af..bce549d01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Next Release + +### Features Added +- Java 21 for build and runtime. [#995](https://github.com/Consensys/web3signer/pull/995) +- Electra fork support. [#1020](https://github.com/Consensys/web3signer/pull/1020) + +--- ## 24.6.0 ### Upcoming Breaking Changes diff --git a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/SignerConfiguration.java b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/SignerConfiguration.java index ebfa5618d..c3034d955 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/SignerConfiguration.java +++ b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/SignerConfiguration.java @@ -70,6 +70,7 @@ public class SignerConfiguration { private final Optional bellatrixForkEpoch; private final Optional capellaForkEpoch; private final Optional denebForkEpoch; + private final Optional electraForkEpoch; private final Optional network; private final boolean keyManagerApiEnabled; private Optional watermarkRepairParameters; @@ -119,6 +120,7 @@ public SignerConfiguration( final Optional bellatrixForkEpoch, final Optional capellaForkEpoch, final Optional denebForkEpoch, + final Optional electraForkEpoch, final Optional network, final boolean keyManagerApiEnabled, final Optional watermarkRepairParameters, @@ -164,6 +166,7 @@ public SignerConfiguration( this.bellatrixForkEpoch = bellatrixForkEpoch; this.capellaForkEpoch = capellaForkEpoch; this.denebForkEpoch = denebForkEpoch; + this.electraForkEpoch = electraForkEpoch; this.network = network; this.keyManagerApiEnabled = keyManagerApiEnabled; this.watermarkRepairParameters = watermarkRepairParameters; @@ -322,6 +325,10 @@ public Optional getDenebForkEpoch() { return denebForkEpoch; } + public Optional getElectraForkEpoch() { + return electraForkEpoch; + } + public Optional getNetwork() { return network; } diff --git a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/SignerConfigurationBuilder.java b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/SignerConfigurationBuilder.java index 9c83c1d12..d396d5303 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/SignerConfigurationBuilder.java +++ b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/SignerConfigurationBuilder.java @@ -72,6 +72,7 @@ public class SignerConfigurationBuilder { private Long bellatrixForkEpoch = null; private Long capellaForkEpoch = null; private Long denebForkEpoch = null; + private Long electraForkEpoch = null; private String network = null; private boolean keyManagerApiEnabled = false; private KeystoresParameters keystoresParameters; @@ -272,6 +273,11 @@ public SignerConfigurationBuilder withDenebForkEpoch(final long denebForkEpoch) return this; } + public SignerConfigurationBuilder withElectraForkEpoch(final long electraForkEpoch) { + this.electraForkEpoch = electraForkEpoch; + return this; + } + public SignerConfigurationBuilder withNetwork(final String network) { this.network = network; return this; @@ -367,6 +373,7 @@ public SignerConfiguration build() { Optional.ofNullable(bellatrixForkEpoch), Optional.ofNullable(capellaForkEpoch), Optional.ofNullable(denebForkEpoch), + Optional.ofNullable(electraForkEpoch), Optional.ofNullable(network), keyManagerApiEnabled, Optional.ofNullable(watermarkRepairParameters), diff --git a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/runner/CmdLineParamsConfigFileImpl.java b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/runner/CmdLineParamsConfigFileImpl.java index 346fdf609..c909bb37b 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/runner/CmdLineParamsConfigFileImpl.java +++ b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/runner/CmdLineParamsConfigFileImpl.java @@ -494,6 +494,14 @@ private String createEth2SlashingProtectionArgs() { signerConfig.getDenebForkEpoch().get())); } + if (signerConfig.getElectraForkEpoch().isPresent()) { + yamlConfig.append( + String.format( + YAML_NUMERIC_FMT, + "eth2.Xnetwork-electra-fork-epoch", + signerConfig.getElectraForkEpoch().get())); + } + if (signerConfig.getNetwork().isPresent()) { yamlConfig.append( String.format(YAML_STRING_FMT, "eth2.network", signerConfig.getNetwork().get())); diff --git a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/runner/CmdLineParamsDefaultImpl.java b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/runner/CmdLineParamsDefaultImpl.java index c6b567984..d5725f30d 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/runner/CmdLineParamsDefaultImpl.java +++ b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/runner/CmdLineParamsDefaultImpl.java @@ -301,6 +301,11 @@ private Collection createEth2Args() { params.add(Long.toString(signerConfig.getDenebForkEpoch().get())); } + if (signerConfig.getElectraForkEpoch().isPresent()) { + params.add("--Xnetwork-electra-fork-epoch"); + params.add(Long.toString(signerConfig.getElectraForkEpoch().get())); + } + if (signerConfig.getNetwork().isPresent()) { params.add("--network"); params.add(signerConfig.getNetwork().get()); diff --git a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/utils/DataStructureUtilAdapter.java b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/utils/DataStructureUtilAdapter.java index fdfa1f0e6..93d90d1bf 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/utils/DataStructureUtilAdapter.java +++ b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/utils/DataStructureUtilAdapter.java @@ -135,7 +135,10 @@ private ExecutionPayload randomExecutionPayload(final SpecVersion specVersion) { .transactions(util.randomExecutionPayloadTransactions()) .withdrawals(() -> randomExecutionPayloadWithdrawals(specVersion)) .excessBlobGas(util::randomUInt64) - .blobGasUsed(util::randomUInt64)); + .blobGasUsed(util::randomUInt64) + .depositRequests(util::randomExecutionPayloadDepositRequests) + .withdrawalRequests(util::randomWithdrawalRequests) + .consolidationRequests(util::randomConsolidationRequests)); } private List randomExecutionPayloadWithdrawals(final SpecVersion specVersion) { diff --git a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/utils/Eth2BlockSigningRequestUtil.java b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/utils/Eth2BlockSigningRequestUtil.java index 8616972e9..82356fb3a 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/utils/Eth2BlockSigningRequestUtil.java +++ b/acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/utils/Eth2BlockSigningRequestUtil.java @@ -76,6 +76,7 @@ public Eth2SigningRequestBody createBlockV2Request() { case BELLATRIX: case CAPELLA: case DENEB: + case ELECTRA: return createBlockV2Request(new BlockRequest(specMilestone, getBeaconBlockHeader())); default: throw new IllegalStateException( diff --git a/acceptance-tests/src/test/java/tech/pegasys/web3signer/tests/signing/Eth2BlockSigningAcceptanceTest.java b/acceptance-tests/src/test/java/tech/pegasys/web3signer/tests/signing/Eth2BlockSigningAcceptanceTest.java index ec329e56f..6f007f8a0 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/web3signer/tests/signing/Eth2BlockSigningAcceptanceTest.java +++ b/acceptance-tests/src/test/java/tech/pegasys/web3signer/tests/signing/Eth2BlockSigningAcceptanceTest.java @@ -59,7 +59,7 @@ void setup() { @ParameterizedTest(name = "#{index} - Sign and verify BlockV2 Signature for spec {0}") @EnumSource( value = SpecMilestone.class, - names = {"PHASE0", "ALTAIR", "BELLATRIX", "CAPELLA", "DENEB"}) + names = {"PHASE0", "ALTAIR", "BELLATRIX", "CAPELLA", "DENEB", "ELECTRA"}) void signAndVerifyBlockV2Signature(final SpecMilestone specMilestone) throws Exception { final Eth2BlockSigningRequestUtil util = new Eth2BlockSigningRequestUtil(specMilestone); @@ -90,7 +90,7 @@ void signAndVerifyLegacyBlockSignature() throws Exception { name = "#{index} - Empty block request for spec {0} should return bad request status") @EnumSource( value = SpecMilestone.class, - names = {"PHASE0", "ALTAIR", "BELLATRIX", "CAPELLA", "DENEB"}) + names = {"PHASE0", "ALTAIR", "BELLATRIX", "CAPELLA", "DENEB", "ELECTRA"}) void emptyBlockRequestReturnsBadRequestStatus(final SpecMilestone specMilestone) throws JsonProcessingException { final Eth2BlockSigningRequestUtil util = new Eth2BlockSigningRequestUtil(specMilestone); diff --git a/acceptance-tests/src/test/java/tech/pegasys/web3signer/tests/signing/SigningAcceptanceTestBase.java b/acceptance-tests/src/test/java/tech/pegasys/web3signer/tests/signing/SigningAcceptanceTestBase.java index 37a516f24..e3fc31257 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/web3signer/tests/signing/SigningAcceptanceTestBase.java +++ b/acceptance-tests/src/test/java/tech/pegasys/web3signer/tests/signing/SigningAcceptanceTestBase.java @@ -99,6 +99,13 @@ private void setForkEpochs( builder.withCapellaForkEpoch(0L); builder.withDenebForkEpoch(0L); break; + case ELECTRA: + builder.withAltairForkEpoch(0L); + builder.withBellatrixForkEpoch(0L); + builder.withCapellaForkEpoch(0L); + builder.withDenebForkEpoch(0L); + builder.withElectraForkEpoch(0L); + break; default: throw new IllegalStateException( "Setting manual fork epoch is not yet implemented for " + specMilestone); diff --git a/commandline/src/main/java/tech/pegasys/web3signer/commandline/subcommands/Eth2SubCommand.java b/commandline/src/main/java/tech/pegasys/web3signer/commandline/subcommands/Eth2SubCommand.java index 9799bf94d..d80a4efdd 100644 --- a/commandline/src/main/java/tech/pegasys/web3signer/commandline/subcommands/Eth2SubCommand.java +++ b/commandline/src/main/java/tech/pegasys/web3signer/commandline/subcommands/Eth2SubCommand.java @@ -126,6 +126,15 @@ private static class NetworkCliCompletionCandidates extends ArrayList { converter = UInt64Converter.class) private UInt64 denebForkEpoch; + @CommandLine.Option( + names = {"--Xnetwork-electra-fork-epoch"}, + hidden = true, + paramLabel = "", + description = "Override the Electra fork activation epoch.", + arity = "1", + converter = UInt64Converter.class) + private UInt64 electraForkEpoch; + @CommandLine.Option( names = {"--Xtrusted-setup"}, hidden = true, @@ -215,6 +224,9 @@ private Eth2NetworkConfiguration createEth2NetworkConfig() { if (denebForkEpoch != null) { builder.denebForkEpoch(denebForkEpoch); } + if (electraForkEpoch != null) { + builder.electraForkEpoch(electraForkEpoch); + } if (trustedSetup != null) { builder.trustedSetup(trustedSetup); } diff --git a/gradle/versions.gradle b/gradle/versions.gradle index de8516318..e8ddd510e 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -92,7 +92,7 @@ dependencyManagement { dependency 'org.xipki.iaik:sunpkcs11-wrapper:1.4.10' - dependencySet(group: 'tech.pegasys.teku.internal', version: '24.6.1') { + dependencySet(group: 'tech.pegasys.teku.internal', version: '24.8.0') { entry ('bls') { exclude group: 'org.bouncycastle', name: 'bcprov-jdk15on' }