evmtool was not respecting the --genesis option (#7518)

* EVMTool should respect --genesis option

Update the code so that the genesis file option will be respected when
set. Also, default --fork options should set a rational base fee.

Signed-off-by: Danno Ferrin <danno@numisight.com>

---------

Signed-off-by: Danno Ferrin <danno@numisight.com>
This commit is contained in:
Danno Ferrin
2024-08-25 22:33:05 -06:00
committed by GitHub
parent d87650b944
commit a851507cb3
6 changed files with 54 additions and 30 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. */