Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Teku and Besu version to 24.10.3 and 24.10.0 respectively #1044

Merged
merged 3 commits into from
Nov 27, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- 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) and [#1023](https://github.com/Consensys/web3signer/pull/1023)
- Commit boost API - Get Public Keys. [#1031](https://github.com/Consensys/web3signer/pull/1031)
- Teku and Besu libraries updated to 24.10.3 and 24.10.0 respectively.

### Bugs fixed
- Override protobuf-java to 3.25.5 which is a transitive dependency from google-cloud-secretmanager. It fixes CVE-2024-7254.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import tech.pegasys.teku.spec.datastructures.blocks.BeaconBlock;
import tech.pegasys.teku.spec.datastructures.state.ForkInfo;
import tech.pegasys.teku.spec.signatures.SigningRootUtil;
import tech.pegasys.teku.spec.util.DataStructureUtil;
import tech.pegasys.web3signer.core.service.http.ArtifactType;
import tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.BlockRequest;
import tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.Eth2SigningRequestBody;
Expand All @@ -32,7 +33,7 @@

public class Eth2BlockSigningRequestUtil {
private final SpecMilestone specMilestone;
private final DataStructureUtilAdapter beaconBlockUtil;
private final DataStructureUtil beaconBlockUtil;
private final SigningRootUtil signingRootUtil;
private final ForkInfo tekuForkInfo;
private final Fork tekuFork;
Expand All @@ -41,23 +42,13 @@ public class Eth2BlockSigningRequestUtil {
private final Bytes signingRoot;

public Eth2BlockSigningRequestUtil(final SpecMilestone specMilestone) {
final Spec spec = TestSpecFactory.createMinimal(specMilestone);
this.specMilestone = specMilestone;
beaconBlockUtil = new DataStructureUtilAdapter(spec);
signingRootUtil = new SigningRootUtil(spec);
tekuForkInfo = Eth2RequestUtils.forkInfo().asInternalForkInfo();
tekuFork = new Fork(tekuForkInfo.getFork());
forkInfo =
new tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.ForkInfo(
tekuFork, tekuForkInfo.getGenesisValidatorsRoot());
beaconBlock = beaconBlockUtil.randomBeaconBlock(UInt64.valueOf(0L));
signingRoot = signingRootUtil.signingRootForSignBlock(beaconBlock, tekuForkInfo);
this(TestSpecFactory.createMinimal(specMilestone), UInt64.ONE, UInt64.ZERO);
}

public Eth2BlockSigningRequestUtil(
final Spec spec, final UInt64 forkEpoch, final UInt64 beaconBlockSlot) {
specMilestone = spec.atEpoch(forkEpoch).getMilestone();
beaconBlockUtil = new DataStructureUtilAdapter(spec);
beaconBlockUtil = new DataStructureUtil(spec);
signingRootUtil = new SigningRootUtil(spec);
tekuForkInfo = Eth2RequestUtils.forkInfo(forkEpoch.longValue()).asInternalForkInfo();
tekuFork = new Fork(tekuForkInfo.getFork());
Expand All @@ -69,19 +60,12 @@ public Eth2BlockSigningRequestUtil(
}

public Eth2SigningRequestBody createBlockV2Request() {
switch (specMilestone) {
case PHASE0:
case ALTAIR:
return createBlockV2Request(new BlockRequest(specMilestone, getBeaconBlock()));
case BELLATRIX:
case CAPELLA:
case DENEB:
case ELECTRA:
return createBlockV2Request(new BlockRequest(specMilestone, getBeaconBlockHeader()));
default:
throw new IllegalStateException(
"Spec not yet implemented for BLOCKV2 Signing AT: " + specMilestone);
}
return switch (specMilestone) {
case PHASE0, ALTAIR ->
createBlockV2Request(new BlockRequest(specMilestone, getBeaconBlock()));
case BELLATRIX, CAPELLA, DENEB, ELECTRA ->
createBlockV2Request(new BlockRequest(specMilestone, getBeaconBlockHeader()));
};
}

public Eth2SigningRequestBody createBlockV2Request(final BlockRequest blockRequest) {
Expand Down Expand Up @@ -117,19 +101,18 @@ private BeaconBlockHeader getBeaconBlockHeader() {
}

private tech.pegasys.teku.api.schema.BeaconBlock getBeaconBlock() {
switch (specMilestone) {
case PHASE0:
return new BeaconBlockPhase0(beaconBlock);
case ALTAIR:
return new BeaconBlockAltair(
beaconBlock.getSlot(),
beaconBlock.getProposerIndex(),
beaconBlock.getParentRoot(),
beaconBlock.getStateRoot(),
getBeaconBlockBodyAltair(beaconBlock.getBody()));
default:
throw new IllegalStateException("BeaconBlock only supported for PHASE0 and ALTAIR in AT");
}
return switch (specMilestone) {
case PHASE0 -> new BeaconBlockPhase0(beaconBlock);
case ALTAIR ->
new BeaconBlockAltair(
beaconBlock.getSlot(),
beaconBlock.getProposerIndex(),
beaconBlock.getParentRoot(),
beaconBlock.getStateRoot(),
getBeaconBlockBodyAltair(beaconBlock.getBody()));
default ->
throw new IllegalStateException("BeaconBlock only supported for PHASE0 and ALTAIR in AT");
};
}

private BeaconBlockBodyAltair getBeaconBlockBodyAltair(
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
besuVersion=24.7.0
besuVersion=24.10.0
besuDistroUrl=https://github.com/hyperledger/besu/releases/download/${besuVersion}/besu-${besuVersion}.tar.gz

hashicorpVaultVersion=1.9.2
Expand Down
4 changes: 4 additions & 0 deletions gradle/license-report-config/allowed-licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
"moduleName": "jakarta.validation:jakarta.validation-api",
"moduleLicense": "Apache License, Version 2.0"
},
{
"moduleName": "jakarta.inject:jakarta.inject-api",
"moduleLicense": "Apache License, Version 2.0"
},
{
"moduleName": "javax.xml.bind:jaxb-api",
"moduleLicense": "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1"
Expand Down
2 changes: 1 addition & 1 deletion gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ dependencyManagement {

dependency 'org.xipki.iaik:sunpkcs11-wrapper:1.4.10'

dependencySet(group: 'tech.pegasys.teku.internal', version: '24.8.0') {
dependencySet(group: 'tech.pegasys.teku.internal', version: '24.10.3') {
entry ('bls') {
exclude group: 'org.bouncycastle', name: 'bcprov-jdk15on'
}
Expand Down
Loading