Merge branch 'main' into zkbesu

# Conflicts:
#	build.gradle
This commit is contained in:
Fabio Di Fabio
2024-08-27 15:05:02 +02:00
65 changed files with 2062 additions and 268 deletions

View File

@@ -14,6 +14,9 @@
*/
package org.hyperledger.besu.datatypes;
import java.util.Comparator;
import java.util.stream.Stream;
/** Description and metadata for a hard fork */
public interface HardforkId {
@@ -112,6 +115,19 @@ public interface HardforkId {
public String description() {
return description;
}
/**
* The most recent finalized mainnet hardfork Besu supports. This will change across versions
* and will be updated after mainnet activations.
*
* @return the most recently activated mainnet spec.
*/
public static MainnetHardforkId mostRecent() {
return Stream.of(MainnetHardforkId.values())
.filter(MainnetHardforkId::finalized)
.max(Comparator.naturalOrder())
.orElseThrow();
}
}
/** List of all Ethereum Classic hard forks. */