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

Migrate Teku to Java 21 #8462

Merged
merged 13 commits into from
Jul 23, 2024
Merged

Conversation

StefanBratanov
Copy link
Contributor

@StefanBratanov StefanBratanov commented Jul 22, 2024

PR Description

  • Changed source/target compatibility to 21
  • Changed CircleCI openjdk images to 21
  • Updated Besu libraries since now we support 21 as well

Fixed Issue(s)

fixes #8381

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

@StefanBratanov StefanBratanov added the doc-change-required Indicates an issue or PR that requires doc to be updated label Jul 22, 2024
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Migrated Teku to Java 21, updating build configurations, dependencies, and Docker setups.

  • Updated .circleci/config.yml to use cimg/openjdk:21.0.2 for all CircleCI jobs.
  • Modified build.gradle to set source and target compatibility to Java 21.
  • Deleted docker/jdk17/Dockerfile and added docker/jdk21/Dockerfile for Java 21.
  • Updated gradle/versions.gradle to use Hyperledger Besu 24.7.0.
  • Refactored beacon/sync/src/main/java/tech/pegasys/teku/beacon/sync/forward/multipeer/batches/SyncSourceBatch.java and PeerSync.java to use Java 21 features.

9 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated infrastructure/ssz/src/testFixtures/java/tech/pegasys/teku/infrastructure/ssz/RandomSszDataGenerator.java to suppress warnings for PatternMatchingInstanceof, aligning with Java 21's new features.
  • No significant logical changes were made to the functionality of the RandomSszDataGenerator class.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated build.gradle to set source and target compatibility to Java 21.
  • Modified CircleCI configuration to use OpenJDK 21 images.
  • Updated Besu libraries to ensure compatibility with Java 21.
  • Added docker/jdk21/Dockerfile to create a custom runtime and install Teku on Ubuntu 24.04 with JDK 21.
  • Adjusted infrastructure/ssz/src/testFixtures/java/tech/pegasys/teku/infrastructure/ssz/RandomSszDataGenerator.java to suppress PatternMatchingInstanceof warnings.

No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated infrastructure/ssz/src/testFixtures/java/tech/pegasys/teku/infrastructure/ssz/RandomSszDataGenerator.java to use Java 21's pattern matching for instanceof.
  • Modified infrastructure/ssz/src/testFixtures/java/tech/pegasys/teku/infrastructure/ssz/SszDataAssert.java to leverage Java 21's pattern matching for instanceof.
  • Ensured all tests pass to verify the new syntax does not introduce issues.

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated infrastructure/ssz/src/testFixtures/java/tech/pegasys/teku/infrastructure/ssz/RandomSszDataGenerator.java to use Java 21's pattern matching for instanceof.
  • Modified infrastructure/ssz/src/testFixtures/java/tech/pegasys/teku/infrastructure/ssz/SszDataAssert.java to leverage Java 21's pattern matching for instanceof.
  • Ensured all tests pass to verify the new syntax does not introduce issues.

No major changes found since the last review.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated infrastructure/ssz/src/testFixtures/java/tech/pegasys/teku/infrastructure/ssz/SszTestUtils.java to use Java 21 features like toList() and instanceof pattern matching.
  • Ensured compatibility with Java 21 by changing CircleCI openjdk images to 21.
  • Updated Besu libraries to support Java 21.

No major changes found since the last review.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated infrastructure/ssz/src/test/java/tech/pegasys/teku/infrastructure/ssz/schema/TreeNodeAssert.java to use Java 21's pattern matching for instanceof.
  • Changed source/target compatibility to Java 21.
  • Updated CircleCI openjdk images to version 21.
  • Upgraded Besu libraries to ensure compatibility with Java 21.

No major changes found since the last review.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated fork-choice-tests/src/integration-test/java/tech/pegasys/teku/forkChoiceTests/ForkChoiceIntegrationTest.java to use Java 21 features like pattern matching and toList().
  • Changed source/target compatibility to Java 21.
  • Updated CircleCI openjdk images to version 21.
  • Upgraded Besu libraries to ensure compatibility with Java 21.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated .circleci/config.yml to use cimg/openjdk:21.0.2 for CI builds.
  • Modified build.gradle to set source and target compatibility to Java 21.
  • Deleted docker/jdk17/Dockerfile and added docker/jdk21/Dockerfile for Java 21.
  • Updated NodeDataProvider and DataProvider to include new parameters and methods for handling recent chain data.
  • Enhanced NodeDataProviderTest.java with new tests for getAttestationsAndMetaData method.

17 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/ssz_generic/SszGenericContainerTestExecutor.java to leverage Java 21's enhanced pattern matching.
  • Updated .circleci/config.yml to use cimg/openjdk:21.0.2 for CI builds.
  • Modified build.gradle to set source and target compatibility to Java 21.
  • Deleted docker/jdk17/Dockerfile and added docker/jdk21/Dockerfile for Java 21.
  • Updated Besu libraries to ensure compatibility with Java 21.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated .circleci/config.yml to use cimg/openjdk:21.0.2 for CI builds.
  • Modified build.gradle to set source and target compatibility to Java 21.
  • Deleted docker/jdk17/Dockerfile and added docker/jdk21/Dockerfile for Java 21.
  • Updated Besu libraries to ensure compatibility with Java 21.
  • Corrected indentation in eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/ssz_generic/SszGenericContainerTestExecutor.java for better readability.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated .circleci/config.yml to support Java 21, ensuring CI pipeline compatibility.
  • Modified build.gradle to set source and target compatibility to Java 21.
  • Added docker/jdk21/Dockerfile for Java 21, replacing the old JDK 17 Dockerfile.
  • Updated Besu libraries to ensure compatibility with Java 21.
  • Corrected indentation in eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/ssz_generic/SszGenericContainerTestExecutor.java for better readability.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The migration to Java 21 for Teku includes updates to build configurations, dependencies, and Docker setups.

  • Updated .circleci/config.yml to support Java 21, ensuring CI pipeline compatibility.
  • Modified build.gradle to set source and target compatibility to Java 21.
  • Added docker/jdk21/Dockerfile for Java 21, replacing the old JDK 17 Dockerfile.
  • Updated Besu libraries to ensure compatibility with Java 21.
  • Corrected indentation in eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/ssz_generic/SszGenericContainerTestExecutor.java for better readability.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@tbenr tbenr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StefanBratanov StefanBratanov enabled auto-merge (squash) July 23, 2024 15:09
@StefanBratanov StefanBratanov merged commit 39f5968 into Consensys:master Jul 23, 2024
16 checks passed
@StefanBratanov StefanBratanov deleted the teku_java21 branch July 23, 2024 16:43
@bgravenorst bgravenorst removed the doc-change-required Indicates an issue or PR that requires doc to be updated label Jul 24, 2024
@bgravenorst
Copy link
Contributor

Teku docs already mention that Java 21+ is required: https://docs.teku.consensys.io/development/get-started/install/build-from-source#prerequisites

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate Teku to build on Java 21
3 participants