Merge branch 'main' into 7311-add-peertask-foundation-code

pull/7628/head
Matilda-Clerke 2 months ago committed by GitHub
commit fa22e938a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  2. 6
      config/src/main/java/org/hyperledger/besu/config/GenesisConfigOptions.java
  3. 8
      config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java
  4. 13
      config/src/main/java/org/hyperledger/besu/config/StubGenesisConfigOptions.java
  5. 9
      config/src/test/java/org/hyperledger/besu/config/GenesisConfigOptionsTest.java
  6. 2
      datatypes/src/main/java/org/hyperledger/besu/datatypes/HardforkId.java
  7. 3
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceipts.java
  8. 12
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/GenesisState.java
  9. 4
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecFactory.java
  10. 13
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java
  11. 9
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolScheduleBuilder.java
  12. 2
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/CodeValidateSubCommand.java
  13. 4
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EOFTestSubCommand.java
  14. 11
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/MainnetGenesisFileModule.java
  15. 2
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/PrettyPrintSubCommand.java
  16. 16
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BenchmarkExecutor.java
  17. 43
      ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/block-test/osaka-eof-rjump.json
  18. 4
      ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/create-eof.json
  19. 4
      ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/create-invalid-eof.json
  20. 2
      ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/create-eof-error.json
  21. 4
      ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/create-eof.json
  22. 8
      ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/eof-section.json
  23. 4
      ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/eof.json
  24. 2
      ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/initcode-error.json
  25. 11
      ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java
  26. 27
      ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/eof/EOFReferenceTestTools.java
  27. 8
      evm/src/main/java/org/hyperledger/besu/evm/EvmSpecVersion.java
  28. 102
      evm/src/main/java/org/hyperledger/besu/evm/MainnetEVMs.java
  29. 16
      evm/src/main/java/org/hyperledger/besu/evm/fluent/EVMExecutor.java
  30. 6
      evm/src/main/java/org/hyperledger/besu/evm/gascalculator/OsakaGasCalculator.java
  31. 27
      evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractExtCallOperation.java
  32. 9
      evm/src/main/java/org/hyperledger/besu/evm/operation/CallFOperation.java
  33. 4
      evm/src/main/java/org/hyperledger/besu/evm/tracing/StandardJsonTracer.java
  34. 8
      evm/src/test/java/org/hyperledger/besu/evm/code/CodeFactoryTest.java
  35. 2
      evm/src/test/java/org/hyperledger/besu/evm/code/CodeV0Test.java
  36. 6
      evm/src/test/java/org/hyperledger/besu/evm/fluent/EVMExecutorTest.java
  37. 6
      evm/src/test/java/org/hyperledger/besu/evm/gascalculator/OsakaGasCalculatorTest.java
  38. 2
      evm/src/test/java/org/hyperledger/besu/evm/internal/CodeCacheTest.java
  39. 2
      evm/src/test/java/org/hyperledger/besu/evm/operation/Create2OperationTest.java
  40. 4
      evm/src/test/java/org/hyperledger/besu/evm/operation/CreateOperationTest.java
  41. 2
      evm/src/test/java/org/hyperledger/besu/evm/operation/DataCopyOperationTest.java
  42. 4
      evm/src/test/java/org/hyperledger/besu/evm/operation/EofCreateOperationTest.java
  43. 12
      evm/src/test/java/org/hyperledger/besu/evm/operation/ExtCallOperationTest.java
  44. 12
      evm/src/test/java/org/hyperledger/besu/evm/operation/ExtDelegateCallOperationTest.java
  45. 13
      evm/src/test/java/org/hyperledger/besu/evm/operation/ExtStaticCallOperationTest.java
  46. 2
      evm/src/test/java/org/hyperledger/besu/evm/operation/JumpOperationTest.java
  47. 2
      evm/src/test/java/org/hyperledger/besu/evm/operation/SelfDestructOperationTest.java
  48. 2
      evm/src/test/java/org/hyperledger/besu/evm/processor/ContractCreationProcessorTest.java
  49. 4
      evm/src/test/java/org/hyperledger/besu/evm/tracing/ExtendedOperationTracerTest.java
  50. 2
      testfuzz/src/main/java/org/hyperledger/besu/testfuzz/EofContainerSubCommand.java
  51. 2
      testfuzz/src/main/java/org/hyperledger/besu/testfuzz/InternalClient.java

@ -1407,7 +1407,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
if (genesisConfigOptionsSupplier.get().getCancunTime().isPresent() if (genesisConfigOptionsSupplier.get().getCancunTime().isPresent()
|| genesisConfigOptionsSupplier.get().getCancunEOFTime().isPresent() || genesisConfigOptionsSupplier.get().getCancunEOFTime().isPresent()
|| genesisConfigOptionsSupplier.get().getPragueTime().isPresent() || genesisConfigOptionsSupplier.get().getPragueTime().isPresent()
|| genesisConfigOptionsSupplier.get().getPragueEOFTime().isPresent()) { || genesisConfigOptionsSupplier.get().getOsakaTime().isPresent()) {
if (kzgTrustedSetupFile != null) { if (kzgTrustedSetupFile != null) {
KZGPointEvalPrecompiledContract.init(kzgTrustedSetupFile); KZGPointEvalPrecompiledContract.init(kzgTrustedSetupFile);
} else { } else {

@ -257,11 +257,11 @@ public interface GenesisConfigOptions {
OptionalLong getPragueTime(); OptionalLong getPragueTime();
/** /**
* Gets Prague EOF time. * Gets Osaka time.
* *
* @return the prague time * @return the osaka time
*/ */
OptionalLong getPragueEOFTime(); OptionalLong getOsakaTime();
/** /**
* Gets future eips time. * Gets future eips time.

@ -308,8 +308,8 @@ public class JsonGenesisConfigOptions implements GenesisConfigOptions {
} }
@Override @Override
public OptionalLong getPragueEOFTime() { public OptionalLong getOsakaTime() {
return getOptionalLong("pragueeoftime"); return getOptionalLong("osakatime");
} }
@Override @Override
@ -486,7 +486,7 @@ public class JsonGenesisConfigOptions implements GenesisConfigOptions {
getCancunTime().ifPresent(l -> builder.put("cancunTime", l)); getCancunTime().ifPresent(l -> builder.put("cancunTime", l));
getCancunEOFTime().ifPresent(l -> builder.put("cancunEOFTime", l)); getCancunEOFTime().ifPresent(l -> builder.put("cancunEOFTime", l));
getPragueTime().ifPresent(l -> builder.put("pragueTime", l)); getPragueTime().ifPresent(l -> builder.put("pragueTime", l));
getPragueEOFTime().ifPresent(l -> builder.put("pragueEOFTime", l)); getOsakaTime().ifPresent(l -> builder.put("osakaTime", l));
getTerminalBlockNumber().ifPresent(l -> builder.put("terminalBlockNumber", l)); getTerminalBlockNumber().ifPresent(l -> builder.put("terminalBlockNumber", l));
getTerminalBlockHash().ifPresent(h -> builder.put("terminalBlockHash", h.toHexString())); getTerminalBlockHash().ifPresent(h -> builder.put("terminalBlockHash", h.toHexString()));
getFutureEipsTime().ifPresent(l -> builder.put("futureEipsTime", l)); getFutureEipsTime().ifPresent(l -> builder.put("futureEipsTime", l));
@ -640,7 +640,7 @@ public class JsonGenesisConfigOptions implements GenesisConfigOptions {
getCancunTime(), getCancunTime(),
getCancunEOFTime(), getCancunEOFTime(),
getPragueTime(), getPragueTime(),
getPragueEOFTime(), getOsakaTime(),
getFutureEipsTime(), getFutureEipsTime(),
getExperimentalEipsTime()); getExperimentalEipsTime());
// when adding forks add an entry to ${REPO_ROOT}/config/src/test/resources/all_forks.json // when adding forks add an entry to ${REPO_ROOT}/config/src/test/resources/all_forks.json

@ -50,7 +50,7 @@ public class StubGenesisConfigOptions implements GenesisConfigOptions, Cloneable
private OptionalLong cancunTime = OptionalLong.empty(); private OptionalLong cancunTime = OptionalLong.empty();
private OptionalLong cancunEOFTime = OptionalLong.empty(); private OptionalLong cancunEOFTime = OptionalLong.empty();
private OptionalLong pragueTime = OptionalLong.empty(); private OptionalLong pragueTime = OptionalLong.empty();
private OptionalLong pragueEOFTime = OptionalLong.empty(); private OptionalLong osakaTime = OptionalLong.empty();
private OptionalLong futureEipsTime = OptionalLong.empty(); private OptionalLong futureEipsTime = OptionalLong.empty();
private OptionalLong experimentalEipsTime = OptionalLong.empty(); private OptionalLong experimentalEipsTime = OptionalLong.empty();
private OptionalLong terminalBlockNumber = OptionalLong.empty(); private OptionalLong terminalBlockNumber = OptionalLong.empty();
@ -252,8 +252,8 @@ public class StubGenesisConfigOptions implements GenesisConfigOptions, Cloneable
} }
@Override @Override
public OptionalLong getPragueEOFTime() { public OptionalLong getOsakaTime() {
return pragueEOFTime; return osakaTime;
} }
@Override @Override
@ -671,14 +671,13 @@ public class StubGenesisConfigOptions implements GenesisConfigOptions, Cloneable
} }
/** /**
* PragueEOF time. * Osaka time.
* *
* @param timestamp the timestamp * @param timestamp the timestamp
* @return the stub genesis config options * @return the stub genesis config options
*/ */
public StubGenesisConfigOptions pragueEOFTime(final long timestamp) { public StubGenesisConfigOptions osakaTime(final long timestamp) {
pragueTime = OptionalLong.of(timestamp); osakaTime = OptionalLong.of(timestamp);
pragueEOFTime = pragueTime;
return this; return this;
} }

@ -207,10 +207,9 @@ class GenesisConfigOptionsTest {
} }
@Test @Test
void shouldGetPragueEOFTime() { void shouldGetOsakaTime() {
final GenesisConfigOptions config = final GenesisConfigOptions config = fromConfigOptions(singletonMap("osakaTime", 1670470143));
fromConfigOptions(singletonMap("pragueEOFTime", 1670470143)); assertThat(config.getOsakaTime()).hasValue(1670470143);
assertThat(config.getPragueEOFTime()).hasValue(1670470143);
} }
@Test @Test
@ -247,7 +246,7 @@ class GenesisConfigOptionsTest {
assertThat(config.getCancunTime()).isEmpty(); assertThat(config.getCancunTime()).isEmpty();
assertThat(config.getCancunEOFTime()).isEmpty(); assertThat(config.getCancunEOFTime()).isEmpty();
assertThat(config.getPragueTime()).isEmpty(); assertThat(config.getPragueTime()).isEmpty();
assertThat(config.getPragueEOFTime()).isEmpty(); assertThat(config.getOsakaTime()).isEmpty();
assertThat(config.getFutureEipsTime()).isEmpty(); assertThat(config.getFutureEipsTime()).isEmpty();
assertThat(config.getExperimentalEipsTime()).isEmpty(); assertThat(config.getExperimentalEipsTime()).isEmpty();
} }

@ -81,8 +81,6 @@ public interface HardforkId {
CANCUN_EOF(false, "Cancun + EOF"), CANCUN_EOF(false, "Cancun + EOF"),
/** Prague fork. */ /** Prague fork. */
PRAGUE(false, "Prague"), PRAGUE(false, "Prague"),
/** Prague + EOF fork. */
PRAGUE_EOF(false, "Prague + EOF"),
/** Osaka fork. */ /** Osaka fork. */
OSAKA(false, "Osaka"), OSAKA(false, "Osaka"),
/** Amsterdam fork. */ /** Amsterdam fork. */

@ -95,7 +95,8 @@ public class EthGetBlockReceipts extends AbstractBlockParameterOrBlockHashMethod
.map( .map(
block -> block ->
block.getTransactions().stream() block.getTransactions().stream()
.map(tx -> txReceipt(tx).get()) .map(this::txReceipt)
.flatMap(Optional::stream)
.collect(Collectors.toList())) .collect(Collectors.toList()))
.orElse(new ArrayList<>()); .orElse(new ArrayList<>());

@ -312,7 +312,7 @@ public final class GenesisState {
if (cancunEOFTimestamp.isPresent()) { if (cancunEOFTimestamp.isPresent()) {
return genesis.getTimestamp() >= cancunEOFTimestamp.getAsLong(); return genesis.getTimestamp() >= cancunEOFTimestamp.getAsLong();
} }
return isPragueEOFAtGenesis(genesis); return false;
} }
private static boolean isPragueAtGenesis(final GenesisConfigFile genesis) { private static boolean isPragueAtGenesis(final GenesisConfigFile genesis) {
@ -320,13 +320,13 @@ public final class GenesisState {
if (pragueTimestamp.isPresent()) { if (pragueTimestamp.isPresent()) {
return genesis.getTimestamp() >= pragueTimestamp.getAsLong(); return genesis.getTimestamp() >= pragueTimestamp.getAsLong();
} }
return isPragueEOFAtGenesis(genesis); return isOsakaAtGenesis(genesis);
} }
private static boolean isPragueEOFAtGenesis(final GenesisConfigFile genesis) { private static boolean isOsakaAtGenesis(final GenesisConfigFile genesis) {
final OptionalLong pragueEOFTimestamp = genesis.getConfigOptions().getPragueEOFTime(); final OptionalLong osakaTimestamp = genesis.getConfigOptions().getOsakaTime();
if (pragueEOFTimestamp.isPresent()) { if (osakaTimestamp.isPresent()) {
return genesis.getTimestamp() >= pragueEOFTimestamp.getAsLong(); return genesis.getTimestamp() >= osakaTimestamp.getAsLong();
} }
return isFutureEipsTimeAtGenesis(genesis); return isFutureEipsTimeAtGenesis(genesis);
} }

@ -224,8 +224,8 @@ public class MainnetProtocolSpecFactory {
metricsSystem); metricsSystem);
} }
public ProtocolSpecBuilder pragueEOFDefinition(final GenesisConfigOptions genesisConfigOptions) { public ProtocolSpecBuilder osakaDefinition(final GenesisConfigOptions genesisConfigOptions) {
return MainnetProtocolSpecs.pragueEOFDefinition( return MainnetProtocolSpecs.osakaDefinition(
chainId, chainId,
isRevertReasonEnabled, isRevertReasonEnabled,
genesisConfigOptions, genesisConfigOptions,

@ -57,8 +57,8 @@ import org.hyperledger.besu.evm.gascalculator.FrontierGasCalculator;
import org.hyperledger.besu.evm.gascalculator.HomesteadGasCalculator; import org.hyperledger.besu.evm.gascalculator.HomesteadGasCalculator;
import org.hyperledger.besu.evm.gascalculator.IstanbulGasCalculator; import org.hyperledger.besu.evm.gascalculator.IstanbulGasCalculator;
import org.hyperledger.besu.evm.gascalculator.LondonGasCalculator; import org.hyperledger.besu.evm.gascalculator.LondonGasCalculator;
import org.hyperledger.besu.evm.gascalculator.OsakaGasCalculator;
import org.hyperledger.besu.evm.gascalculator.PetersburgGasCalculator; import org.hyperledger.besu.evm.gascalculator.PetersburgGasCalculator;
import org.hyperledger.besu.evm.gascalculator.PragueEOFGasCalculator;
import org.hyperledger.besu.evm.gascalculator.PragueGasCalculator; import org.hyperledger.besu.evm.gascalculator.PragueGasCalculator;
import org.hyperledger.besu.evm.gascalculator.ShanghaiGasCalculator; import org.hyperledger.besu.evm.gascalculator.ShanghaiGasCalculator;
import org.hyperledger.besu.evm.gascalculator.SpuriousDragonGasCalculator; import org.hyperledger.besu.evm.gascalculator.SpuriousDragonGasCalculator;
@ -815,7 +815,7 @@ public abstract class MainnetProtocolSpecs {
.name("Prague"); .name("Prague");
} }
static ProtocolSpecBuilder pragueEOFDefinition( static ProtocolSpecBuilder osakaDefinition(
final Optional<BigInteger> chainId, final Optional<BigInteger> chainId,
final boolean enableRevertReason, final boolean enableRevertReason,
final GenesisConfigOptions genesisConfigOptions, final GenesisConfigOptions genesisConfigOptions,
@ -833,7 +833,7 @@ public abstract class MainnetProtocolSpecs {
miningParameters, miningParameters,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);
return addEOF(chainId, evmConfiguration, protocolSpecBuilder).name("PragueEOF"); return addEOF(chainId, evmConfiguration, protocolSpecBuilder).name("Osaka");
} }
private static ProtocolSpecBuilder addEOF( private static ProtocolSpecBuilder addEOF(
@ -842,12 +842,11 @@ public abstract class MainnetProtocolSpecs {
final ProtocolSpecBuilder protocolSpecBuilder) { final ProtocolSpecBuilder protocolSpecBuilder) {
return protocolSpecBuilder return protocolSpecBuilder
// EIP-7692 EOF v1 Gas calculator // EIP-7692 EOF v1 Gas calculator
.gasCalculator(PragueEOFGasCalculator::new) .gasCalculator(OsakaGasCalculator::new)
// EIP-7692 EOF v1 EVM and opcodes // EIP-7692 EOF v1 EVM and opcodes
.evmBuilder( .evmBuilder(
(gasCalculator, jdCacheConfig) -> (gasCalculator, jdCacheConfig) ->
MainnetEVMs.pragueEOF( MainnetEVMs.osaka(gasCalculator, chainId.orElse(BigInteger.ZERO), evmConfiguration))
gasCalculator, chainId.orElse(BigInteger.ZERO), evmConfiguration))
// EIP-7698 EOF v1 creation transaction // EIP-7698 EOF v1 creation transaction
.contractCreationProcessorBuilder( .contractCreationProcessorBuilder(
evm -> evm ->
@ -867,7 +866,7 @@ public abstract class MainnetProtocolSpecs {
final MiningParameters miningParameters, final MiningParameters miningParameters,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
return pragueEOFDefinition( return osakaDefinition(
chainId, chainId,
enableRevertReason, enableRevertReason,
genesisConfigOptions, genesisConfigOptions,

@ -16,6 +16,7 @@ package org.hyperledger.besu.ethereum.mainnet;
import org.hyperledger.besu.config.GenesisConfigOptions; import org.hyperledger.besu.config.GenesisConfigOptions;
import org.hyperledger.besu.datatypes.HardforkId; import org.hyperledger.besu.datatypes.HardforkId;
import org.hyperledger.besu.datatypes.HardforkId.MainnetHardforkId;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
@ -277,7 +278,7 @@ public class ProtocolScheduleBuilder {
lastForkBlock = validateForkOrder("Cancun", config.getCancunTime(), lastForkBlock); lastForkBlock = validateForkOrder("Cancun", config.getCancunTime(), lastForkBlock);
lastForkBlock = validateForkOrder("CancunEOF", config.getCancunEOFTime(), lastForkBlock); lastForkBlock = validateForkOrder("CancunEOF", config.getCancunEOFTime(), lastForkBlock);
lastForkBlock = validateForkOrder("Prague", config.getPragueTime(), lastForkBlock); lastForkBlock = validateForkOrder("Prague", config.getPragueTime(), lastForkBlock);
lastForkBlock = validateForkOrder("PragueEOF", config.getPragueEOFTime(), lastForkBlock); lastForkBlock = validateForkOrder("Osaka", config.getOsakaTime(), lastForkBlock);
lastForkBlock = validateForkOrder("FutureEips", config.getFutureEipsTime(), lastForkBlock); lastForkBlock = validateForkOrder("FutureEips", config.getFutureEipsTime(), lastForkBlock);
lastForkBlock = lastForkBlock =
validateForkOrder("ExperimentalEips", config.getExperimentalEipsTime(), lastForkBlock); validateForkOrder("ExperimentalEips", config.getExperimentalEipsTime(), lastForkBlock);
@ -413,9 +414,9 @@ public class ProtocolScheduleBuilder {
config.getPragueTime(), config.getPragueTime(),
specFactory.pragueDefinition(config)), specFactory.pragueDefinition(config)),
timestampMilestone( timestampMilestone(
HardforkId.MainnetHardforkId.PRAGUE_EOF, MainnetHardforkId.OSAKA,
config.getPragueEOFTime(), config.getOsakaTime(),
specFactory.pragueEOFDefinition(config)), specFactory.osakaDefinition(config)),
timestampMilestone( timestampMilestone(
HardforkId.MainnetHardforkId.FUTURE_EIPS, HardforkId.MainnetHardforkId.FUTURE_EIPS,
config.getFutureEipsTime(), config.getFutureEipsTime(),

@ -86,7 +86,7 @@ public class CodeValidateSubCommand implements Runnable {
String fork = String fork =
parentCommand != null && parentCommand.hasFork() parentCommand != null && parentCommand.hasFork()
? parentCommand.getFork() ? parentCommand.getFork()
: EvmSpecVersion.PRAGUE.getName(); : EvmSpecVersion.OSAKA.getName();
evm = evm =
Suppliers.memoize( Suppliers.memoize(

@ -94,7 +94,7 @@ public class EOFTestSubCommand implements Runnable {
} }
ProtocolSpec protocolSpec = ProtocolSpec protocolSpec =
ReferenceTestProtocolSchedules.getInstance() ReferenceTestProtocolSchedules.getInstance()
.geSpecByName(fork == null ? EvmSpecVersion.PRAGUE.getName() : fork); .geSpecByName(fork == null ? EvmSpecVersion.OSAKA.getName() : fork);
evm = protocolSpec.getEvm(); evm = protocolSpec.getEvm();
final JavaType javaType = final JavaType javaType =
@ -181,7 +181,7 @@ public class EOFTestSubCommand implements Runnable {
continue; continue;
} }
TestResult actualResult; TestResult actualResult;
if (evmVersion.ordinal() < EvmSpecVersion.PRAGUE_EOF.ordinal()) { if (evmVersion.ordinal() < EvmSpecVersion.OSAKA.ordinal()) {
actualResult = failed("EOF_InvalidCode"); actualResult = failed("EOF_InvalidCode");
} else { } else {
actualResult = considerCode(code); actualResult = considerCode(code);

@ -157,15 +157,16 @@ class MainnetGenesisFileModule extends GenesisFileModule {
.chainId(chainId))), .chainId(chainId))),
Map.entry( Map.entry(
"prague", "prague",
createSchedule(
new StubGenesisConfigOptions().pragueTime(0).baseFeePerGas(0x0a).chainId(chainId))),
Map.entry(
"pragueeof",
createSchedule( createSchedule(
new StubGenesisConfigOptions() new StubGenesisConfigOptions()
.pragueEOFTime(0) .pragueTime(0)
.osakaTime(0) // TODO remove this once osaka_devnet_0 launches
.baseFeePerGas(0x0a) .baseFeePerGas(0x0a)
.chainId(chainId))), .chainId(chainId))),
Map.entry(
"osaka",
createSchedule(
new StubGenesisConfigOptions().osakaTime(0).baseFeePerGas(0x0a).chainId(chainId))),
Map.entry( Map.entry(
"futureeips", "futureeips",
createSchedule( createSchedule(

@ -101,7 +101,7 @@ public class PrettyPrintSubCommand implements Runnable {
"Pretty printing of legacy EVM is not supported. Patches welcome!"); "Pretty printing of legacy EVM is not supported. Patches welcome!");
} else { } else {
String fork = EvmSpecVersion.PRAGUE.getName(); String fork = EvmSpecVersion.OSAKA.getName();
if (parentCommand.hasFork()) { if (parentCommand.hasFork()) {
fork = parentCommand.getFork(); fork = parentCommand.getFork();
} }

@ -30,8 +30,8 @@ import org.hyperledger.besu.evm.gascalculator.GasCalculator;
import org.hyperledger.besu.evm.gascalculator.HomesteadGasCalculator; import org.hyperledger.besu.evm.gascalculator.HomesteadGasCalculator;
import org.hyperledger.besu.evm.gascalculator.IstanbulGasCalculator; import org.hyperledger.besu.evm.gascalculator.IstanbulGasCalculator;
import org.hyperledger.besu.evm.gascalculator.LondonGasCalculator; import org.hyperledger.besu.evm.gascalculator.LondonGasCalculator;
import org.hyperledger.besu.evm.gascalculator.OsakaGasCalculator;
import org.hyperledger.besu.evm.gascalculator.PetersburgGasCalculator; import org.hyperledger.besu.evm.gascalculator.PetersburgGasCalculator;
import org.hyperledger.besu.evm.gascalculator.PragueEOFGasCalculator;
import org.hyperledger.besu.evm.gascalculator.PragueGasCalculator; import org.hyperledger.besu.evm.gascalculator.PragueGasCalculator;
import org.hyperledger.besu.evm.gascalculator.ShanghaiGasCalculator; import org.hyperledger.besu.evm.gascalculator.ShanghaiGasCalculator;
import org.hyperledger.besu.evm.precompile.PrecompiledContract; import org.hyperledger.besu.evm.precompile.PrecompiledContract;
@ -142,17 +142,11 @@ public abstract class BenchmarkExecutor {
case LONDON, PARIS -> new LondonGasCalculator(); case LONDON, PARIS -> new LondonGasCalculator();
case SHANGHAI -> new ShanghaiGasCalculator(); case SHANGHAI -> new ShanghaiGasCalculator();
case CANCUN -> new CancunGasCalculator(); case CANCUN -> new CancunGasCalculator();
case CANCUN_EOF -> new OsakaGasCalculator();
case PRAGUE -> new PragueGasCalculator(); case PRAGUE -> new PragueGasCalculator();
case CANCUN_EOF, case OSAKA -> new OsakaGasCalculator();
PRAGUE_EOF, case AMSTERDAM, BOGOTA, POLIS, BANGKOK, FUTURE_EIPS, EXPERIMENTAL_EIPS ->
OSAKA, new OsakaGasCalculator();
AMSTERDAM,
BOGOTA,
POLIS,
BANGKOK,
FUTURE_EIPS,
EXPERIMENTAL_EIPS ->
new PragueEOFGasCalculator();
}; };
} }

@ -4,13 +4,13 @@
"stdin" "stdin"
], ],
"stdin": { "stdin": {
"tests/prague/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py::test_rjump_zero[fork_PragueEIP7692-blockchain_test]": { "tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py::test_rjump_zero[fork_Osaka-blockchain_test]": {
"network": "Prague", "network": "Osaka",
"genesisBlockHeader": { "genesisBlockHeader": {
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"uncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "uncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"coinbase": "0x0000000000000000000000000000000000000000", "coinbase": "0x0000000000000000000000000000000000000000",
"stateRoot": "0x34ccf8774a5b8833da9451a3f7f8a0af0147956c058f0831dab07c348d7ac0d9", "stateRoot": "0xbeb30acb62768b375f7e7d36f6ba9240cb692ebd0ee04c9321c756cf4ff1c437",
"transactionsTrie": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "transactionsTrie": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"receiptTrie": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "receiptTrie": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
@ -28,7 +28,7 @@
"excessBlobGas": "0x00", "excessBlobGas": "0x00",
"parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"requestsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "requestsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"hash": "0xc9397e8a1b99cbb2b885852fde56de8fa686091a4f4430163f5237d7aaf33a14" "hash": "0x367310df4a31070aa9a5c92cb61ab8bb2742db0162619ed77594fbec6f0ddbd9"
}, },
"pre": { "pre": {
"0x00000000219ab540356cbb839cbe05303d7705fa": { "0x00000000219ab540356cbb839cbe05303d7705fa": {
@ -75,6 +75,12 @@
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe146090573615156028575f545f5260205ff35b366038141561012e5760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061012e57600154600101600155600354806003026004013381556001015f3581556001016020359055600101600355005b6003546002548082038060101160a4575060105b5f5b81811460dd5780604c02838201600302600401805490600101805490600101549160601b83528260140152906034015260010160a6565b910180921460ed579060025560f8565b90505f6002555f6003555b5f548061049d141561010757505f5b60015460028282011161011c5750505f610122565b01600290035b5f555f600155604c025ff35b5f5ffd", "code": "0x3373fffffffffffffffffffffffffffffffffffffffe146090573615156028575f545f5260205ff35b366038141561012e5760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061012e57600154600101600155600354806003026004013381556001015f3581556001016020359055600101600355005b6003546002548082038060101160a4575060105b5f5b81811460dd5780604c02838201600302600401805490600101805490600101549160601b83528260140152906034015260010160a6565b910180921460ed579060025560f8565b90505f6002555f6003555b5f548061049d141561010757505f5b60015460028282011161011c5750505f610122565b01600290035b5f555f600155604c025ff35b5f5ffd",
"storage": {} "storage": {}
}, },
"0x00b42dbf2194e931e80326d950320f7d9dbeac02": {
"nonce": "0x01",
"balance": "0x00",
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe146098573615156028575f545f5260205ff35b36606014156101445760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061014457600154600101600155600354806004026004013381556001015f35815560010160203581556001016040359055600101600355005b6003546002548082038060011160ac575060015b5f5b81811460f15780607402838201600402600401805490600101805490600101805490600101549260601b84529083601401528260340152906054015260010160ae565b9101809214610103579060025561010e565b90505f6002555f6003555b5f548061049d141561011d57505f5b6001546001828201116101325750505f610138565b01600190035b5f555f6001556074025ff35b5f5ffd",
"storage": {}
},
"0x0aae40965e6800cd9b1f4b05ff21581047e3f91e": { "0x0aae40965e6800cd9b1f4b05ff21581047e3f91e": {
"nonce": "0x01", "nonce": "0x01",
"balance": "0x00", "balance": "0x00",
@ -161,12 +167,18 @@
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe146090573615156028575f545f5260205ff35b366038141561012e5760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061012e57600154600101600155600354806003026004013381556001015f3581556001016020359055600101600355005b6003546002548082038060101160a4575060105b5f5b81811460dd5780604c02838201600302600401805490600101805490600101549160601b83528260140152906034015260010160a6565b910180921460ed579060025560f8565b90505f6002555f6003555b5f548061049d141561010757505f5b60015460028282011161011c5750505f610122565b01600290035b5f555f600155604c025ff35b5f5ffd", "code": "0x3373fffffffffffffffffffffffffffffffffffffffe146090573615156028575f545f5260205ff35b366038141561012e5760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061012e57600154600101600155600354806003026004013381556001015f3581556001016020359055600101600355005b6003546002548082038060101160a4575060105b5f5b81811460dd5780604c02838201600302600401805490600101805490600101549160601b83528260140152906034015260010160a6565b910180921460ed579060025560f8565b90505f6002555f6003555b5f548061049d141561010757505f5b60015460028282011161011c5750505f610122565b01600290035b5f555f600155604c025ff35b5f5ffd",
"storage": {} "storage": {}
}, },
"0x00b42dbf2194e931e80326d950320f7d9dbeac02": {
"nonce": "0x01",
"balance": "0x00",
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe146098573615156028575f545f5260205ff35b36606014156101445760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061014457600154600101600155600354806004026004013381556001015f35815560010160203581556001016040359055600101600355005b6003546002548082038060011160ac575060015b5f5b81811460f15780607402838201600402600401805490600101805490600101805490600101549260601b84529083601401528260340152906054015260010160ae565b9101809214610103579060025561010e565b90505f6002555f6003555b5f548061049d141561011d57505f5b6001546001828201116101325750505f610138565b01600190035b5f555f6001556074025ff35b5f5ffd",
"storage": {}
},
"0x0aae40965e6800cd9b1f4b05ff21581047e3f91e": { "0x0aae40965e6800cd9b1f4b05ff21581047e3f91e": {
"nonce": "0x01", "nonce": "0x01",
"balance": "0x00", "balance": "0x00",
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460575767ffffffffffffffff5f3511605357600143035f3511604b575f35612000014311604b57611fff5f3516545f5260205ff35b5f5f5260205ff35b5f5ffd5b5f35611fff60014303165500", "code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460575767ffffffffffffffff5f3511605357600143035f3511604b575f35612000014311604b57611fff5f3516545f5260205ff35b5f5f5260205ff35b5f5ffd5b5f35611fff60014303165500",
"storage": { "storage": {
"0x00": "0xc9397e8a1b99cbb2b885852fde56de8fa686091a4f4430163f5237d7aaf33a14" "0x00": "0x367310df4a31070aa9a5c92cb61ab8bb2742db0162619ed77594fbec6f0ddbd9"
} }
}, },
"0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba": { "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba": {
@ -182,14 +194,15 @@
"storage": {} "storage": {}
} }
}, },
"genesisRLP": "0xf90262f9025ba00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a034ccf8774a5b8833da9451a3f7f8a0af0147956c058f0831dab07c348d7ac0d9a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000808088016345785d8a0000808000a0000000000000000000000000000000000000000000000000000000000000000088000000000000000007a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a00000000000000000000000000000000000000000000000000000000000000000a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421c0c0c0c0", "lastblockhash": "0xfb5d1d0e218fa7873bc188f07f3e0a7c78027ff6e6e199c48ba1facd3c3726fd",
"genesisRLP": "0xf90262f9025ba00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0beb30acb62768b375f7e7d36f6ba9240cb692ebd0ee04c9321c756cf4ff1c437a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000808088016345785d8a0000808000a0000000000000000000000000000000000000000000000000000000000000000088000000000000000007a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a00000000000000000000000000000000000000000000000000000000000000000a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421c0c0c0c0",
"blocks": [ "blocks": [
{ {
"blockHeader": { "blockHeader": {
"parentHash": "0xc9397e8a1b99cbb2b885852fde56de8fa686091a4f4430163f5237d7aaf33a14", "parentHash": "0x367310df4a31070aa9a5c92cb61ab8bb2742db0162619ed77594fbec6f0ddbd9",
"uncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "uncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"coinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "coinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"stateRoot": "0x1a4885d1f64bac16e5ab17fb13e23fb5d1a0ec2ca4519c81714683f69c8d9a84", "stateRoot": "0x4ab70cbe1abe50d6bb3c8cdb3e9e66111f142cd68ab73870e9ce9e0dd1d6ead2",
"transactionsTrie": "0xec9d10cff79619f2df45db8c66526ef3fbd32d283fdd2dcc9b55c0efe643d8c3", "transactionsTrie": "0xec9d10cff79619f2df45db8c66526ef3fbd32d283fdd2dcc9b55c0efe643d8c3",
"receiptTrie": "0x9593f56abf23bcbb26d27b0c6e46a56415d9103ed6b4d8ac7b4182f9f250cafa", "receiptTrie": "0x9593f56abf23bcbb26d27b0c6e46a56415d9103ed6b4d8ac7b4182f9f250cafa",
"bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
@ -207,7 +220,7 @@
"excessBlobGas": "0x00", "excessBlobGas": "0x00",
"parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"requestsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "requestsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"hash": "0x879cf54bf493b6585db592b1b24ec30a8a7fbe3b9146d3fb20ca36200f2aca87" "hash": "0xfb5d1d0e218fa7873bc188f07f3e0a7c78027ff6e6e199c48ba1facd3c3726fd"
}, },
"transactions": [ "transactions": [
{ {
@ -229,22 +242,22 @@
"withdrawals": [], "withdrawals": [],
"depositRequests": [], "depositRequests": [],
"withdrawalRequests": [], "withdrawalRequests": [],
"rlp": "0xf902c9f9025fa0c9397e8a1b99cbb2b885852fde56de8fa686091a4f4430163f5237d7aaf33a14a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347942adc25665018aa1fe0e6bc666dac8fc2697ff9baa01a4885d1f64bac16e5ab17fb13e23fb5d1a0ec2ca4519c81714683f69c8d9a84a0ec9d10cff79619f2df45db8c66526ef3fbd32d283fdd2dcc9b55c0efe643d8c3a09593f56abf23bcbb26d27b0c6e46a56415d9103ed6b4d8ac7b4182f9f250cafab9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800188016345785d8a000082a8648203e800a0000000000000000000000000000000000000000000000000000000000000000088000000000000000007a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a00000000000000000000000000000000000000000000000000000000000000000a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421f862f860800a83989680940000000000000000000000000000000000001000808026a0e5d462429669f661291a8dc4c49a092cfd4922b6f3f31c9189a2f4adf5ecd730a001494afaf472fbb80bcb107ffeb918a2b9115f454027840615d6d20d63c69ac0c0c0c0", "consolidationRequests": [],
"rlp": "0xf902c9f9025fa0367310df4a31070aa9a5c92cb61ab8bb2742db0162619ed77594fbec6f0ddbd9a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347942adc25665018aa1fe0e6bc666dac8fc2697ff9baa04ab70cbe1abe50d6bb3c8cdb3e9e66111f142cd68ab73870e9ce9e0dd1d6ead2a0ec9d10cff79619f2df45db8c66526ef3fbd32d283fdd2dcc9b55c0efe643d8c3a09593f56abf23bcbb26d27b0c6e46a56415d9103ed6b4d8ac7b4182f9f250cafab9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800188016345785d8a000082a8648203e800a0000000000000000000000000000000000000000000000000000000000000000088000000000000000007a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a00000000000000000000000000000000000000000000000000000000000000000a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421f862f860800a83989680940000000000000000000000000000000000001000808026a0e5d462429669f661291a8dc4c49a092cfd4922b6f3f31c9189a2f4adf5ecd730a001494afaf472fbb80bcb107ffeb918a2b9115f454027840615d6d20d63c69ac0c0c0c0",
"blocknumber": "1" "blocknumber": "1"
} }
], ],
"lastblockhash": "0x879cf54bf493b6585db592b1b24ec30a8a7fbe3b9146d3fb20ca36200f2aca87",
"sealEngine": "NoProof", "sealEngine": "NoProof",
"_info": { "_info": {
"hash": "0xbfd1223f9b5b8dbf202178f7c1f18dc089cb24e54c9cb7fc9831907547e937c4", "hash": "0xd0cc15d832c8c0b9cf5bdc0eab79c3b632193a11fde3d5ef32bb07e8c65ba6bd",
"comment": "`execution-spec-tests` generated test", "comment": "`execution-spec-tests` generated test",
"filling-transition-tool": "Hyperledger Besu evm 24.7-develop-8ca7129", "filling-transition-tool": "Hyperledger Besu evm 24.9-develop-0d63955",
"description": "Test function documentation:\nEOF1V4200_0002 (Valid) EOF code containing RJUMP (Zero)", "description": "Test function documentation:\nEOF1V4200_0002 (Valid) EOF code containing RJUMP (Zero)",
"url": "https://github.com/ethereum/execution-spec-tests/blob/891a6111370c89d4ce89bf91589c6d5ff6785158/tests/prague/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py#L63", "url": "https://github.com/ethereum/execution-spec-tests/blob/96efd737b258eeb8efb615e9123d931b6dfda302/tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py#L44",
"reference-spec": "https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4200.md", "reference-spec": "https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4200.md",
"reference-spec-version": "17d4a8d12d2b5e0f2985c866376c16c8c6df7cba" "reference-spec-version": "17d4a8d12d2b5e0f2985c866376c16c8c6df7cba"
} }
} }
}, },
"stdout": "Considering tests/prague/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py::test_rjump_zero[fork_PragueEIP7692-blockchain_test]\nBlock 1 (0x879cf54bf493b6585db592b1b24ec30a8a7fbe3b9146d3fb20ca36200f2aca87) Imported\nChain import successful - tests/prague/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py::test_rjump_zero[fork_PragueEIP7692-blockchain_test]\n" "stdout": "Considering tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py::test_rjump_zero[fork_Osaka-blockchain_test]\nBlock 1 (0xfb5d1d0e218fa7873bc188f07f3e0a7c78027ff6e6e199c48ba1facd3c3726fd) Imported\nChain import successful - tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py::test_rjump_zero[fork_Osaka-blockchain_test]\n"
} }

@ -45,7 +45,7 @@
}, },
"out": "0x", "out": "0x",
"post": { "post": {
"CancunEOF": [ "Osaka": [
{ {
"hash": "0x1a8642a04dae90535f00f53d3a30284c4db051d508a653db89eb100ba9aecbf3", "hash": "0x1a8642a04dae90535f00f53d3a30284c4db051d508a653db89eb100ba9aecbf3",
"logs": "0xf48b954a6a6f4ce6b28e4950b7027413f4bdc8f459df6003b6e8d7a1567c8940", "logs": "0xf48b954a6a6f4ce6b28e4950b7027413f4bdc8f459df6003b6e8d7a1567c8940",
@ -79,7 +79,7 @@
{"pc":5,"section":0,"op":95,"gas":"0x793d71","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH0"}, {"pc":5,"section":0,"op":95,"gas":"0x793d71","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH0"},
{"pc":6,"section":0,"op":95,"gas":"0x793d6f","gasCost":"0x2","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH0"}, {"pc":6,"section":0,"op":95,"gas":"0x793d6f","gasCost":"0x2","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH0"},
{"pc":7,"section":0,"op":238,"immediate":"0x00","gas":"0x793d6d","gasCost":"0x0","memSize":0,"stack":["0x0","0x0"],"depth":1,"refund":0,"opName":"RETURNCONTRACT"}, {"pc":7,"section":0,"op":238,"immediate":"0x00","gas":"0x793d6d","gasCost":"0x0","memSize":0,"stack":["0x0","0x0"],"depth":1,"refund":0,"opName":"RETURNCONTRACT"},
{"output":"","gasUsed":"0xe433","test":"create-eof","fork":"CancunEOF","d":0,"g":0,"v":0,"postHash":"0x1a8642a04dae90535f00f53d3a30284c4db051d508a653db89eb100ba9aecbf3","postLogsHash":"0xf48b954a6a6f4ce6b28e4950b7027413f4bdc8f459df6003b6e8d7a1567c8940","pass":true}, {"output":"","gasUsed":"0xe433","test":"create-eof","fork":"Osaka","d":0,"g":0,"v":0,"postHash":"0x1a8642a04dae90535f00f53d3a30284c4db051d508a653db89eb100ba9aecbf3","postLogsHash":"0xf48b954a6a6f4ce6b28e4950b7027413f4bdc8f459df6003b6e8d7a1567c8940","pass":true},
{"pc":0,"op":239,"gas":"0x794068","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"INVALID","error":"Bad instruction"}, {"pc":0,"op":239,"gas":"0x794068","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"INVALID","error":"Bad instruction"},
{"output":"","gasUsed":"0x7a1200","test":"create-eof","fork":"Cancun","d":0,"g":0,"v":0,"postHash":"0xaa80d89bc89f58da8de41d3894bd1a241896ff91f7a5964edaefb39e8e3a4a98","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true,"error":"INVALID_OPERATION"} {"output":"","gasUsed":"0x7a1200","test":"create-eof","fork":"Cancun","d":0,"g":0,"v":0,"postHash":"0xaa80d89bc89f58da8de41d3894bd1a241896ff91f7a5964edaefb39e8e3a4a98","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true,"error":"INVALID_OPERATION"}
] ]

@ -45,7 +45,7 @@
}, },
"out": "0x", "out": "0x",
"post": { "post": {
"Prague": [ "Osaka": [
{ {
"hash": "0x1a8642a04dae90535f00f53d3a30284c4db051d508a653db89eb100ba9aecbf3", "hash": "0x1a8642a04dae90535f00f53d3a30284c4db051d508a653db89eb100ba9aecbf3",
"logs": "0xf48b954a6a6f4ce6b28e4950b7027413f4bdc8f459df6003b6e8d7a1567c8940", "logs": "0xf48b954a6a6f4ce6b28e4950b7027413f4bdc8f459df6003b6e8d7a1567c8940",
@ -71,7 +71,7 @@
} }
}, },
"stdout": [ "stdout": [
{"output":"","gasUsed":"0xd198","test":"create-eof","fork":"Prague","d":0,"g":0,"v":0,"postHash":"0x2a9c58298ba5d4ec86ca682b9fcc9ff67c3fc44dbd39f85a2f9b74bfe4e5178e","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":false,"error":"Invalid EOF Layout: unexpected_header_kind expected 1 actual 17"}, {"output":"","gasUsed":"0xd198","test":"create-eof","fork":"Osaka","d":0,"g":0,"v":0,"postHash":"0x2a9c58298ba5d4ec86ca682b9fcc9ff67c3fc44dbd39f85a2f9b74bfe4e5178e","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":false,"error":"Invalid EOF Layout: unexpected_header_kind expected 1 actual 17"},
{"pc":0,"op":239,"gas":"0x794068","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"INVALID","error":"Bad instruction"}, {"pc":0,"op":239,"gas":"0x794068","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"INVALID","error":"Bad instruction"},
{"output":"","gasUsed":"0x7a1200","test":"create-eof","fork":"Cancun","d":0,"g":0,"v":0,"postHash":"0xaa80d89bc89f58da8de41d3894bd1a241896ff91f7a5964edaefb39e8e3a4a98","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true,"error":"INVALID_OPERATION"} {"output":"","gasUsed":"0x7a1200","test":"create-eof","fork":"Cancun","d":0,"g":0,"v":0,"postHash":"0xaa80d89bc89f58da8de41d3894bd1a241896ff91f7a5964edaefb39e8e3a4a98","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true,"error":"INVALID_OPERATION"}
] ]

@ -8,7 +8,7 @@
"--coinbase", "--coinbase",
"4444588443C3A91288C5002483449ABA1054192B", "4444588443C3A91288C5002483449ABA1054192B",
"--fork", "--fork",
"CancunEOF" "Osaka"
], ],
"stdin": "", "stdin": "",
"stdout": "EOF Code Invalid : incompatible_container_kind opcode STOP is only valid for runtime.\n" "stdout": "EOF Code Invalid : incompatible_container_kind opcode STOP is only valid for runtime.\n"

@ -8,7 +8,7 @@
"--coinbase", "--coinbase",
"4444588443C3A91288C5002483449ABA1054192B", "4444588443C3A91288C5002483449ABA1054192B",
"--fork", "--fork",
"CancunEOF" "Osaka"
], ],
"stdin": "", "stdin": "",
"stdout": [ "stdout": [
@ -20,6 +20,6 @@
{"pc":5,"section":0,"op":95,"gas":"0x2540be109","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH0"}, {"pc":5,"section":0,"op":95,"gas":"0x2540be109","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH0"},
{"pc":6,"section":0,"op":95,"gas":"0x2540be107","gasCost":"0x2","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH0"}, {"pc":6,"section":0,"op":95,"gas":"0x2540be107","gasCost":"0x2","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH0"},
{"pc":7,"section":0,"op":238,"immediate":"0x00","gas":"0x2540be105","gasCost":"0x0","memSize":0,"stack":["0x0","0x0"],"depth":1,"refund":0,"opName":"RETURNCONTRACT"}, {"pc":7,"section":0,"op":238,"immediate":"0x00","gas":"0x2540be105","gasCost":"0x0","memSize":0,"stack":["0x0","0x0"],"depth":1,"refund":0,"opName":"RETURNCONTRACT"},
{"stateRoot":"0x9790b070a5749acec6a7252a867f795df3c2cb5b800fb509ea259a1c0b5d96c1","output":"0x","gasUsed":"0x129b","pass":true,"fork":"CancunEOF"} {"stateRoot":"0x9790b070a5749acec6a7252a867f795df3c2cb5b800fb509ea259a1c0b5d96c1","output":"0x","gasUsed":"0x129b","pass":true,"fork":"Osaka"}
] ]
} }

@ -7,17 +7,17 @@
"--coinbase", "--coinbase",
"4444588443C3A91288C5002483449ABA1054192B", "4444588443C3A91288C5002483449ABA1054192B",
"--fork", "--fork",
"PragueEOF" "Osaka"
], ],
"stdin": "", "stdin": "",
"stdout": [ "stdout": [
{"pc":0,"section":0,"op":227,"immediate":"0x0002","gas":"0x2540be400","gasCost":"0x5","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"CALLF"}, {"pc":0,"section":0,"op":227,"immediate":"0x0002","gas":"0x2540be400","gasCost":"0x5","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"CALLF"},
{"pc":0,"section":2,"op":229,"immediate":"0x0002","gas":"0x2540be3fb","gasCost":"0x5","memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"JUMPF"}, {"pc":11,"section":2,"op":229,"immediate":"0x0001","gas":"0x2540be3fb","gasCost":"0x5","memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"JUMPF"},
{"pc":0,"section":1,"op":228,"gas":"0x2540be3f6","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"RETF"}, {"pc":10,"section":1,"op":228,"gas":"0x2540be3f6","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"RETF"},
{"pc":3,"section":0,"op":97,"immediate":"0x2015","gas":"0x2540be3f3","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH2"}, {"pc":3,"section":0,"op":97,"immediate":"0x2015","gas":"0x2540be3f3","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH2"},
{"pc":6,"section":0,"op":96,"immediate":"0x01","gas":"0x2540be3f0","gasCost":"0x3","memSize":0,"stack":["0x2015"],"depth":1,"refund":0,"opName":"PUSH1"}, {"pc":6,"section":0,"op":96,"immediate":"0x01","gas":"0x2540be3f0","gasCost":"0x3","memSize":0,"stack":["0x2015"],"depth":1,"refund":0,"opName":"PUSH1"},
{"pc":8,"section":0,"op":85,"gas":"0x2540be3ed","gasCost":"0x5654","memSize":0,"stack":["0x2015","0x1"],"depth":1,"refund":0,"opName":"SSTORE"}, {"pc":8,"section":0,"op":85,"gas":"0x2540be3ed","gasCost":"0x5654","memSize":0,"stack":["0x2015","0x1"],"depth":1,"refund":0,"opName":"SSTORE"},
{"pc":9,"section":0,"op":0,"gas":"0x2540b8d99","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP"}, {"pc":9,"section":0,"op":0,"gas":"0x2540b8d99","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP"},
{"stateRoot":"0x761f723ceabb467d438fe74abf025c10bf65592b84ec389850038eb572f2b0fa","output":"0x","gasUsed":"0x5667","pass":true,"fork":"PragueEOF"} {"stateRoot":"0x761f723ceabb467d438fe74abf025c10bf65592b84ec389850038eb572f2b0fa","output":"0x","gasUsed":"0x5667","pass":true,"fork":"Osaka"}
] ]
} }

@ -7,11 +7,11 @@
"--coinbase", "--coinbase",
"4444588443C3A91288C5002483449ABA1054192B", "4444588443C3A91288C5002483449ABA1054192B",
"--fork", "--fork",
"PragueEOF" "Osaka"
], ],
"stdin": "", "stdin": "",
"stdout": [ "stdout": [
{"pc":0,"section":0,"op":0,"gas":"0x2540be400","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP"}, {"pc":0,"section":0,"op":0,"gas":"0x2540be400","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP"},
{"stateRoot":"0xdae5f2c233bf9fbb7413d06ce744a3345dbf971b5bb5638736c0388f43a61a4b","output":"0x","gasUsed":"0x0","pass":true,"fork":"PragueEOF"} {"stateRoot":"0xdae5f2c233bf9fbb7413d06ce744a3345dbf971b5bb5638736c0388f43a61a4b","output":"0x","gasUsed":"0x0","pass":true,"fork":"Osaka"}
] ]
} }

@ -7,7 +7,7 @@
"--coinbase", "--coinbase",
"4444588443C3A91288C5002483449ABA1054192B", "4444588443C3A91288C5002483449ABA1054192B",
"--fork", "--fork",
"CancunEOF" "Osaka"
], ],
"stdin": "", "stdin": "",
"stdout": "To evaluate INITCODE mode EOF code use the --create flag\n" "stdout": "To evaluate INITCODE mode EOF code use the --create flag\n"

@ -105,8 +105,15 @@ public class ReferenceTestProtocolSchedules {
Map.entry( Map.entry(
"CancunToPragueAtTime15k", "CancunToPragueAtTime15k",
createSchedule(genesisStub.clone().cancunTime(0).pragueTime(15000))), createSchedule(genesisStub.clone().cancunTime(0).pragueTime(15000))),
Map.entry("Prague", createSchedule(genesisStub.clone().pragueEOFTime(0))), Map.entry(
Map.entry("Osaka", createSchedule(genesisStub.clone().futureEipsTime(0))), "Prague",
createSchedule(
genesisStub
.clone()
.pragueTime(0)
.osakaTime(0) // TODO remove this once osaka_devnet_0 ships
)),
Map.entry("Osaka", createSchedule(genesisStub.clone().osakaTime(0))),
Map.entry("Amsterdam", createSchedule(genesisStub.clone().futureEipsTime(0))), Map.entry("Amsterdam", createSchedule(genesisStub.clone().futureEipsTime(0))),
Map.entry("Bogota", createSchedule(genesisStub.clone().futureEipsTime(0))), Map.entry("Bogota", createSchedule(genesisStub.clone().futureEipsTime(0))),
Map.entry("Polis", createSchedule(genesisStub.clone().futureEipsTime(0))), Map.entry("Polis", createSchedule(genesisStub.clone().futureEipsTime(0))),

@ -15,6 +15,7 @@
package org.hyperledger.besu.ethereum.eof; package org.hyperledger.besu.ethereum.eof;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Arrays; import java.util.Arrays;
@ -33,6 +34,7 @@ import org.hyperledger.besu.ethereum.referencetests.ReferenceTestProtocolSchedul
import org.hyperledger.besu.evm.Code; import org.hyperledger.besu.evm.Code;
import org.hyperledger.besu.evm.EVM; import org.hyperledger.besu.evm.EVM;
import org.hyperledger.besu.evm.code.CodeInvalid; import org.hyperledger.besu.evm.code.CodeInvalid;
import org.hyperledger.besu.evm.code.CodeV1;
import org.hyperledger.besu.evm.code.EOFLayout; import org.hyperledger.besu.evm.code.EOFLayout;
import org.hyperledger.besu.testutil.JsonTestParameters; import org.hyperledger.besu.testutil.JsonTestParameters;
@ -41,7 +43,7 @@ public class EOFReferenceTestTools {
static { static {
final String eips = final String eips =
System.getProperty("test.ethereum.eof.eips", "Prague,Osaka,Amsterdam,Bogota,Polis,Bangkok"); System.getProperty("test.ethereum.eof.eips", "Osaka,Amsterdam,Bogota,Polis,Bangkok");
EIPS_TO_RUN = Arrays.asList(eips.split(",")); EIPS_TO_RUN = Arrays.asList(eips.split(","));
} }
@ -79,6 +81,10 @@ public class EOFReferenceTestTools {
if (EIPS_TO_RUN.isEmpty()) { if (EIPS_TO_RUN.isEmpty()) {
params.ignoreAll(); params.ignoreAll();
} }
// EOF was moved from Prague to Osaka
params.ignore("-Prague\\[");
} }
private EOFReferenceTestTools() { private EOFReferenceTestTools() {
@ -132,16 +138,26 @@ public class EOFReferenceTestTools {
} else { } else {
parsedCode = evm.getCodeUncached(code); parsedCode = evm.getCodeUncached(code);
} }
if (expected.result()) { if (expected.result()) {
assertThat(parsedCode.isValid()) assertThat(parsedCode.isValid())
.withFailMessage( .withFailMessage(
() -> "Valid code failed with " + ((CodeInvalid) parsedCode).getInvalidReason()) () -> "Valid code failed with " + ((CodeInvalid) parsedCode).getInvalidReason())
.isTrue(); .isTrue();
} else if (parsedCode.isValid()) {
if (parsedCode instanceof CodeV1 codeV1
&& expected.exception().contains("EOF_IncompatibleContainerKind")) {
// one last container type check
var parsedMode = codeV1.getEofLayout().containerMode().get();
String actual = parsedMode == null ? "RUNTIME" : parsedMode.toString();
String expectedContainerKind = containerKind == null ? "RUNTIME" : containerKind;
assertThat(actual)
.withFailMessage("EOF_IncompatibleContainerKind expected")
.isNotEqualTo(expectedContainerKind);
} else { } else {
assertThat(parsedCode.isValid()) fail("Invalid code expected " + expected.exception() + " but was valid");
.withFailMessage("Invalid code expected " + expected.exception() + " but was valid") }
.isFalse(); } else if (name.contains("eip7692")) {
if (name.contains("eip7692")) {
// if the test is from EEST, validate the exception name. // if the test is from EEST, validate the exception name.
assertThat(((CodeInvalid) parsedCode).getInvalidReason()) assertThat(((CodeInvalid) parsedCode).getInvalidReason())
.withFailMessage( .withFailMessage(
@ -154,7 +170,6 @@ public class EOFReferenceTestTools {
: ((CodeInvalid) parsedCode).getInvalidReason()))) : ((CodeInvalid) parsedCode).getInvalidReason())))
.containsIgnoringCase(expected.exception().replace("EOFException.", "")); .containsIgnoringCase(expected.exception().replace("EOFException.", ""));
} }
}
} else { } else {
assertThat(false) assertThat(false)
.withFailMessage( .withFailMessage(

@ -55,8 +55,6 @@ public enum EvmSpecVersion {
CANCUN_EOF(MainnetHardforkId.CANCUN_EOF, 0x6000, 0xc000, 1), CANCUN_EOF(MainnetHardforkId.CANCUN_EOF, 0x6000, 0xc000, 1),
/** Prague evm spec version. */ /** Prague evm spec version. */
PRAGUE(MainnetHardforkId.PRAGUE, 0x6000, 0xc000, 0), PRAGUE(MainnetHardforkId.PRAGUE, 0x6000, 0xc000, 0),
/** PragueEOF evm spec version. */
PRAGUE_EOF(MainnetHardforkId.PRAGUE_EOF, 0x6000, 0xc000, 1),
/** Osaka evm spec version. */ /** Osaka evm spec version. */
OSAKA(MainnetHardforkId.OSAKA, 0x6000, 0xc000, 1), OSAKA(MainnetHardforkId.OSAKA, 0x6000, 0xc000, 1),
/** Amsterdam evm spec version. */ /** Amsterdam evm spec version. */
@ -183,11 +181,11 @@ public enum EvmSpecVersion {
* @return the EVM spec version for that fork, or null if no fork matched. * @return the EVM spec version for that fork, or null if no fork matched.
*/ */
public static EvmSpecVersion fromName(final String name) { public static EvmSpecVersion fromName(final String name) {
// TODO remove once PragueEOF settles // TODO remove once CancunEOF tests are removed from EEST
if ("prague".equalsIgnoreCase(name)) { if ("prague".equalsIgnoreCase(name)) {
return EvmSpecVersion.PRAGUE_EOF; return EvmSpecVersion.OSAKA;
} }
// TODO remove once PragueEOF settles // TODO remove once CancunEOF tests are removed from EEST
if ("cancuneof".equalsIgnoreCase(name)) { if ("cancuneof".equalsIgnoreCase(name)) {
return EvmSpecVersion.CANCUN_EOF; return EvmSpecVersion.CANCUN_EOF;
} }

@ -23,8 +23,8 @@ import org.hyperledger.besu.evm.gascalculator.GasCalculator;
import org.hyperledger.besu.evm.gascalculator.HomesteadGasCalculator; import org.hyperledger.besu.evm.gascalculator.HomesteadGasCalculator;
import org.hyperledger.besu.evm.gascalculator.IstanbulGasCalculator; import org.hyperledger.besu.evm.gascalculator.IstanbulGasCalculator;
import org.hyperledger.besu.evm.gascalculator.LondonGasCalculator; import org.hyperledger.besu.evm.gascalculator.LondonGasCalculator;
import org.hyperledger.besu.evm.gascalculator.OsakaGasCalculator;
import org.hyperledger.besu.evm.gascalculator.PetersburgGasCalculator; import org.hyperledger.besu.evm.gascalculator.PetersburgGasCalculator;
import org.hyperledger.besu.evm.gascalculator.PragueEOFGasCalculator;
import org.hyperledger.besu.evm.gascalculator.PragueGasCalculator; import org.hyperledger.besu.evm.gascalculator.PragueGasCalculator;
import org.hyperledger.besu.evm.gascalculator.ShanghaiGasCalculator; import org.hyperledger.besu.evm.gascalculator.ShanghaiGasCalculator;
import org.hyperledger.besu.evm.gascalculator.SpuriousDragonGasCalculator; import org.hyperledger.besu.evm.gascalculator.SpuriousDragonGasCalculator;
@ -1025,72 +1025,70 @@ public class MainnetEVMs {
final GasCalculator gasCalculator, final GasCalculator gasCalculator,
final BigInteger chainID) { final BigInteger chainID) {
registerCancunOperations(registry, gasCalculator, chainID); registerCancunOperations(registry, gasCalculator, chainID);
// TODO add EOF operations here once PragueEOF is collapsed into Prague
} }
/** /**
* PragueEOF evm. * Osaka evm.
* *
* @param evmConfiguration the evm configuration * @param evmConfiguration the evm configuration
* @return the evm * @return the evm
*/ */
public static EVM pragueEOF(final EvmConfiguration evmConfiguration) { public static EVM osaka(final EvmConfiguration evmConfiguration) {
return pragueEOF(DEV_NET_CHAIN_ID, evmConfiguration); return osaka(DEV_NET_CHAIN_ID, evmConfiguration);
} }
/** /**
* PragueEOF evm. * Osaka evm.
* *
* @param chainId the chain id * @param chainId the chain id
* @param evmConfiguration the evm configuration * @param evmConfiguration the evm configuration
* @return the evm * @return the evm
*/ */
public static EVM pragueEOF(final BigInteger chainId, final EvmConfiguration evmConfiguration) { public static EVM osaka(final BigInteger chainId, final EvmConfiguration evmConfiguration) {
return pragueEOF(new PragueEOFGasCalculator(), chainId, evmConfiguration); return osaka(new OsakaGasCalculator(), chainId, evmConfiguration);
} }
/** /**
* PragueEOF evm. * Osaka evm.
* *
* @param gasCalculator the gas calculator * @param gasCalculator the gas calculator
* @param chainId the chain id * @param chainId the chain id
* @param evmConfiguration the evm configuration * @param evmConfiguration the evm configuration
* @return the evm * @return the evm
*/ */
public static EVM pragueEOF( public static EVM osaka(
final GasCalculator gasCalculator, final GasCalculator gasCalculator,
final BigInteger chainId, final BigInteger chainId,
final EvmConfiguration evmConfiguration) { final EvmConfiguration evmConfiguration) {
return new EVM( return new EVM(
pragueEOFOperations(gasCalculator, chainId), osakaOperations(gasCalculator, chainId),
gasCalculator, gasCalculator,
evmConfiguration, evmConfiguration,
EvmSpecVersion.PRAGUE_EOF); EvmSpecVersion.OSAKA);
} }
/** /**
* Operation registry for PragueEOF's operations. * Operation registry for Osaka's operations.
* *
* @param gasCalculator the gas calculator * @param gasCalculator the gas calculator
* @param chainId the chain id * @param chainId the chain id
* @return the operation registry * @return the operation registry
*/ */
public static OperationRegistry pragueEOFOperations( public static OperationRegistry osakaOperations(
final GasCalculator gasCalculator, final BigInteger chainId) { final GasCalculator gasCalculator, final BigInteger chainId) {
OperationRegistry operationRegistry = new OperationRegistry(); OperationRegistry operationRegistry = new OperationRegistry();
registerPragueEOFOperations(operationRegistry, gasCalculator, chainId); registerOsakaOperations(operationRegistry, gasCalculator, chainId);
return operationRegistry; return operationRegistry;
} }
/** /**
* Register PragueEOF's operations. * Register Osaka's operations.
* *
* @param registry the registry * @param registry the registry
* @param gasCalculator the gas calculator * @param gasCalculator the gas calculator
* @param chainID the chain id * @param chainID the chain id
*/ */
public static void registerPragueEOFOperations( public static void registerOsakaOperations(
final OperationRegistry registry, final OperationRegistry registry,
final GasCalculator gasCalculator, final GasCalculator gasCalculator,
final BigInteger chainID) { final BigInteger chainID) {
@ -1140,74 +1138,6 @@ public class MainnetEVMs {
registry.put(new ReturnContractOperation(gasCalculator)); registry.put(new ReturnContractOperation(gasCalculator));
} }
/**
* Osaka evm.
*
* @param evmConfiguration the evm configuration
* @return the evm
*/
public static EVM osaka(final EvmConfiguration evmConfiguration) {
return osaka(DEV_NET_CHAIN_ID, evmConfiguration);
}
/**
* Osaka evm.
*
* @param chainId the chain id
* @param evmConfiguration the evm configuration
* @return the evm
*/
public static EVM osaka(final BigInteger chainId, final EvmConfiguration evmConfiguration) {
return osaka(new PragueGasCalculator(), chainId, evmConfiguration);
}
/**
* Osaka evm.
*
* @param gasCalculator the gas calculator
* @param chainId the chain id
* @param evmConfiguration the evm configuration
* @return the evm
*/
public static EVM osaka(
final GasCalculator gasCalculator,
final BigInteger chainId,
final EvmConfiguration evmConfiguration) {
return new EVM(
osakaOperations(gasCalculator, chainId),
gasCalculator,
evmConfiguration,
EvmSpecVersion.OSAKA);
}
/**
* Operation registry for osaka's operations.
*
* @param gasCalculator the gas calculator
* @param chainId the chain id
* @return the operation registry
*/
public static OperationRegistry osakaOperations(
final GasCalculator gasCalculator, final BigInteger chainId) {
OperationRegistry operationRegistry = new OperationRegistry();
registerOsakaOperations(operationRegistry, gasCalculator, chainId);
return operationRegistry;
}
/**
* Register osaka operations.
*
* @param registry the registry
* @param gasCalculator the gas calculator
* @param chainID the chain id
*/
public static void registerOsakaOperations(
final OperationRegistry registry,
final GasCalculator gasCalculator,
final BigInteger chainID) {
registerPragueEOFOperations(registry, gasCalculator, chainID);
}
/** /**
* Amsterdam evm. * Amsterdam evm.
* *

@ -164,7 +164,6 @@ public class EVMExecutor {
case CANCUN -> cancun(chainId, evmConfiguration); case CANCUN -> cancun(chainId, evmConfiguration);
case CANCUN_EOF -> cancunEOF(chainId, evmConfiguration); case CANCUN_EOF -> cancunEOF(chainId, evmConfiguration);
case PRAGUE -> prague(chainId, evmConfiguration); case PRAGUE -> prague(chainId, evmConfiguration);
case PRAGUE_EOF -> pragueEOF(chainId, evmConfiguration);
case OSAKA -> osaka(chainId, evmConfiguration); case OSAKA -> osaka(chainId, evmConfiguration);
case AMSTERDAM -> amsterdam(chainId, evmConfiguration); case AMSTERDAM -> amsterdam(chainId, evmConfiguration);
case BOGOTA -> bogota(chainId, evmConfiguration); case BOGOTA -> bogota(chainId, evmConfiguration);
@ -525,21 +524,6 @@ public class EVMExecutor {
return executor; return executor;
} }
/**
* Instantiate PragueEOF evm executor.
*
* @param chainId the chain ID
* @param evmConfiguration the evm configuration
* @return the evm executor
*/
public static EVMExecutor pragueEOF(
final BigInteger chainId, final EvmConfiguration evmConfiguration) {
final EVMExecutor executor = new EVMExecutor(MainnetEVMs.pragueEOF(chainId, evmConfiguration));
executor.precompileContractRegistry =
MainnetPrecompiledContracts.prague(executor.evm.getGasCalculator());
return executor;
}
/** /**
* Instantiate Osaka evm executor. * Instantiate Osaka evm executor.
* *

@ -26,13 +26,13 @@ import static org.hyperledger.besu.datatypes.Address.BLS12_MAP_FP2_TO_G2;
* <LI>TBD * <LI>TBD
* </UL> * </UL>
*/ */
public class PragueEOFGasCalculator extends PragueGasCalculator { public class OsakaGasCalculator extends PragueGasCalculator {
static final long MIN_RETAINED_GAS = 5_000; static final long MIN_RETAINED_GAS = 5_000;
static final long MIN_CALLEE_GAS = 2300; static final long MIN_CALLEE_GAS = 2300;
/** Instantiates a new Prague Gas Calculator. */ /** Instantiates a new Prague Gas Calculator. */
public PragueEOFGasCalculator() { public OsakaGasCalculator() {
this(BLS12_MAP_FP2_TO_G2.toArrayUnsafe()[19]); this(BLS12_MAP_FP2_TO_G2.toArrayUnsafe()[19]);
} }
@ -41,7 +41,7 @@ public class PragueEOFGasCalculator extends PragueGasCalculator {
* *
* @param maxPrecompile the max precompile * @param maxPrecompile the max precompile
*/ */
protected PragueEOFGasCalculator(final int maxPrecompile) { protected OsakaGasCalculator(final int maxPrecompile) {
super(maxPrecompile); super(maxPrecompile);
} }

@ -109,15 +109,16 @@ public abstract class AbstractExtCallOperation extends AbstractCallOperation {
long inputOffset = inputDataOffset(frame); long inputOffset = inputDataOffset(frame);
long inputLength = inputDataLength(frame); long inputLength = inputDataLength(frame);
GasCalculator gasCalculator = gasCalculator();
if (!zeroValue && isStatic(frame)) { if (!zeroValue && isStatic(frame)) {
return new OperationResult( return new OperationResult(
gasCalculator().callValueTransferGasCost(), ExceptionalHaltReason.ILLEGAL_STATE_CHANGE); gasCalculator.callValueTransferGasCost(), ExceptionalHaltReason.ILLEGAL_STATE_CHANGE);
} }
if (toBytes.size() > Address.SIZE) { if (toBytes.size() > Address.SIZE) {
return new OperationResult( return new OperationResult(
gasCalculator().memoryExpansionGasCost(frame, inputOffset, inputLength) gasCalculator.memoryExpansionGasCost(frame, inputOffset, inputLength)
+ (zeroValue ? 0 : gasCalculator().callValueTransferGasCost()) + (zeroValue ? 0 : gasCalculator.callValueTransferGasCost())
+ gasCalculator().getColdAccountAccessCost(), + gasCalculator.getColdAccountAccessCost(),
ExceptionalHaltReason.ADDRESS_OUT_OF_RANGE); ExceptionalHaltReason.ADDRESS_OUT_OF_RANGE);
} }
Address to = Words.toAddress(toBytes); Address to = Words.toAddress(toBytes);
@ -125,7 +126,7 @@ public abstract class AbstractExtCallOperation extends AbstractCallOperation {
if (contract != null) { if (contract != null) {
final DelegatedCodeGasCostHelper.Result result = final DelegatedCodeGasCostHelper.Result result =
deductDelegatedCodeGasCost(frame, gasCalculator(), contract); deductDelegatedCodeGasCost(frame, gasCalculator, contract);
if (result.status() != DelegatedCodeGasCostHelper.Status.SUCCESS) { if (result.status() != DelegatedCodeGasCostHelper.Status.SUCCESS) {
return new Operation.OperationResult( return new Operation.OperationResult(
result.gasCost(), ExceptionalHaltReason.INSUFFICIENT_GAS); result.gasCost(), ExceptionalHaltReason.INSUFFICIENT_GAS);
@ -134,12 +135,12 @@ public abstract class AbstractExtCallOperation extends AbstractCallOperation {
boolean accountCreation = contract == null && !zeroValue; boolean accountCreation = contract == null && !zeroValue;
long cost = long cost =
gasCalculator().memoryExpansionGasCost(frame, inputOffset, inputLength) gasCalculator.memoryExpansionGasCost(frame, inputOffset, inputLength)
+ (zeroValue ? 0 : gasCalculator().callValueTransferGasCost()) + (zeroValue ? 0 : gasCalculator.callValueTransferGasCost())
+ (frame.warmUpAddress(to) + (frame.warmUpAddress(to) || gasCalculator.isPrecompile(to)
? gasCalculator().getWarmStorageReadCost() ? gasCalculator.getWarmStorageReadCost()
: gasCalculator().getColdAccountAccessCost()) : gasCalculator.getColdAccountAccessCost())
+ (accountCreation ? gasCalculator().newAccountGasCost() : 0); + (accountCreation ? gasCalculator.newAccountGasCost() : 0);
long currentGas = frame.getRemainingGas() - cost; long currentGas = frame.getRemainingGas() - cost;
if (currentGas < 0) { if (currentGas < 0) {
return new OperationResult(cost, ExceptionalHaltReason.INSUFFICIENT_GAS); return new OperationResult(cost, ExceptionalHaltReason.INSUFFICIENT_GAS);
@ -163,14 +164,14 @@ public abstract class AbstractExtCallOperation extends AbstractCallOperation {
return softFailure(frame, cost); return softFailure(frame, cost);
} }
long retainedGas = Math.max(currentGas / 64, gasCalculator().getMinRetainedGas()); long retainedGas = Math.max(currentGas / 64, gasCalculator.getMinRetainedGas());
long childGas = currentGas - retainedGas; long childGas = currentGas - retainedGas;
final Account account = frame.getWorldUpdater().get(frame.getRecipientAddress()); final Account account = frame.getWorldUpdater().get(frame.getRecipientAddress());
final Wei balance = (zeroValue || account == null) ? Wei.ZERO : account.getBalance(); final Wei balance = (zeroValue || account == null) ? Wei.ZERO : account.getBalance();
// There myst be a minimum gas for a call to have access to. // There myst be a minimum gas for a call to have access to.
if (childGas < gasCalculator().getMinCalleeGas()) { if (childGas < gasCalculator.getMinCalleeGas()) {
return softFailure(frame, cost); return softFailure(frame, cost);
} }
// transferring value you don't have is not a halting exception, just a failure // transferring value you don't have is not a halting exception, just a failure

@ -17,6 +17,7 @@ package org.hyperledger.besu.evm.operation;
import org.hyperledger.besu.evm.Code; import org.hyperledger.besu.evm.Code;
import org.hyperledger.besu.evm.EVM; import org.hyperledger.besu.evm.EVM;
import org.hyperledger.besu.evm.code.CodeSection; import org.hyperledger.besu.evm.code.CodeSection;
import org.hyperledger.besu.evm.frame.ExceptionalHaltReason;
import org.hyperledger.besu.evm.frame.MessageFrame; import org.hyperledger.besu.evm.frame.MessageFrame;
import org.hyperledger.besu.evm.gascalculator.GasCalculator; import org.hyperledger.besu.evm.gascalculator.GasCalculator;
import org.hyperledger.besu.evm.internal.ReturnStack; import org.hyperledger.besu.evm.internal.ReturnStack;
@ -30,6 +31,9 @@ public class CallFOperation extends AbstractOperation {
/** The Call F success. */ /** The Call F success. */
static final OperationResult callfSuccess = new OperationResult(5, null); static final OperationResult callfSuccess = new OperationResult(5, null);
static final OperationResult callfStackOverflow =
new OperationResult(5, ExceptionalHaltReason.TOO_MANY_STACK_ITEMS);
/** /**
* Instantiates a new Call F operation. * Instantiates a new Call F operation.
* *
@ -49,6 +53,11 @@ public class CallFOperation extends AbstractOperation {
int pc = frame.getPC(); int pc = frame.getPC();
int section = code.readBigEndianU16(pc + 1); int section = code.readBigEndianU16(pc + 1);
CodeSection info = code.getCodeSection(section); CodeSection info = code.getCodeSection(section);
int operandStackSize = frame.stackSize();
if (operandStackSize >= 1024
|| operandStackSize > 1024 - info.getMaxStackHeight() + info.getInputs()) {
return callfStackOverflow;
}
frame.getReturnStack().push(new ReturnStack.ReturnStackItem(frame.getSection(), pc + 2)); frame.getReturnStack().push(new ReturnStack.ReturnStackItem(frame.getSection(), pc + 2));
frame.setPC(info.getEntryPoint() - 1); // will be +1ed at end of operations loop frame.setPC(info.getEntryPoint() - 1); // will be +1ed at end of operations loop
frame.setSection(section); frame.setSection(section);

@ -127,9 +127,7 @@ public class StandardJsonTracer implements OperationTracer {
for (int i = messageFrame.stackSize() - 1; i >= 0; i--) { for (int i = messageFrame.stackSize() - 1; i >= 0; i--) {
stack.add("\"" + shortBytes(messageFrame.getStackItem(i)) + "\""); stack.add("\"" + shortBytes(messageFrame.getStackItem(i)) + "\"");
} }
pc = pc = messageFrame.getPC() - messageFrame.getCode().getCodeSection(0).getEntryPoint();
messageFrame.getPC()
- messageFrame.getCode().getCodeSection(messageFrame.getSection()).getEntryPoint();
section = messageFrame.getSection(); section = messageFrame.getSection();
gas = shortNumber(messageFrame.getRemainingGas()); gas = shortNumber(messageFrame.getRemainingGas());
memorySize = messageFrame.memoryWordSize() * 32; memorySize = messageFrame.memoryWordSize() * 32;

@ -594,26 +594,26 @@ class CodeFactoryTest {
} }
private static void validCode(final String str) { private static void validCode(final String str) {
EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
Code code = evm.getCodeUncached(bytesFromPrettyPrint(str)); Code code = evm.getCodeUncached(bytesFromPrettyPrint(str));
assertThat(code.isValid()).isTrue(); assertThat(code.isValid()).isTrue();
} }
private static void invalidCode(final String str, final String error) { private static void invalidCode(final String str, final String error) {
EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
Code code = evm.getCodeUncached(bytesFromPrettyPrint(str)); Code code = evm.getCodeUncached(bytesFromPrettyPrint(str));
assertThat(code.isValid()).isFalse(); assertThat(code.isValid()).isFalse();
assertThat(((CodeInvalid) code).getInvalidReason()).contains(error); assertThat(((CodeInvalid) code).getInvalidReason()).contains(error);
} }
private static void invalidCode(final String str) { private static void invalidCode(final String str) {
EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
Code code = evm.getCodeUncached(bytesFromPrettyPrint(str)); Code code = evm.getCodeUncached(bytesFromPrettyPrint(str));
assertThat(code.isValid()).isFalse(); assertThat(code.isValid()).isFalse();
} }
private static void invalidCodeForCreation(final String str) { private static void invalidCodeForCreation(final String str) {
EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
Code code = evm.getCodeForCreation(bytesFromPrettyPrint(str)); Code code = evm.getCodeForCreation(bytesFromPrettyPrint(str));
assertThat(code.isValid()).isFalse(); assertThat(code.isValid()).isFalse();
} }

@ -47,7 +47,7 @@ class CodeV0Test {
@BeforeEach @BeforeEach
void startUp() { void startUp() {
evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
} }
@Test @Test

@ -131,9 +131,13 @@ class EVMExecutorTest {
assertThat(cancunEOFEVM.getChainId()).contains(defaultChainId); assertThat(cancunEOFEVM.getChainId()).contains(defaultChainId);
EVMExecutor pragueEVM = EVMExecutor pragueEVM =
EVMExecutor.pragueEOF(defaultChainId.toBigInteger(), EvmConfiguration.DEFAULT); EVMExecutor.prague(defaultChainId.toBigInteger(), EvmConfiguration.DEFAULT);
assertThat(pragueEVM.getChainId()).contains(defaultChainId); assertThat(pragueEVM.getChainId()).contains(defaultChainId);
EVMExecutor osakaEVM =
EVMExecutor.osaka(defaultChainId.toBigInteger(), EvmConfiguration.DEFAULT);
assertThat(osakaEVM.getChainId()).contains(defaultChainId);
EVMExecutor futureEipsVM = EVMExecutor.futureEips(EvmConfiguration.DEFAULT); EVMExecutor futureEipsVM = EVMExecutor.futureEips(EvmConfiguration.DEFAULT);
assertThat(futureEipsVM.getChainId()).contains(defaultChainId); assertThat(futureEipsVM.getChainId()).contains(defaultChainId);
} }

@ -20,11 +20,11 @@ import org.hyperledger.besu.datatypes.Address;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
class PragueEOFGasCalculatorTest { class OsakaGasCalculatorTest {
@Test @Test
void testPrecompileSize() { void testPrecompileSize() {
PragueEOFGasCalculator subject = new PragueEOFGasCalculator(); OsakaGasCalculator subject = new OsakaGasCalculator();
assertThat(subject.isPrecompile(Address.precompiled(0x14))).isFalse(); assertThat(subject.isPrecompile(Address.precompiled(0x14))).isFalse();
assertThat(subject.isPrecompile(Address.BLS12_MAP_FP2_TO_G2)).isTrue(); assertThat(subject.isPrecompile(Address.BLS12_MAP_FP2_TO_G2)).isTrue();
} }
@ -32,7 +32,7 @@ class PragueEOFGasCalculatorTest {
@Test @Test
void testNewConstants() { void testNewConstants() {
CancunGasCalculator cancunGas = new CancunGasCalculator(); CancunGasCalculator cancunGas = new CancunGasCalculator();
PragueEOFGasCalculator praugeGasCalculator = new PragueEOFGasCalculator(); OsakaGasCalculator praugeGasCalculator = new OsakaGasCalculator();
assertThat(praugeGasCalculator.getMinCalleeGas()).isGreaterThan(cancunGas.getMinCalleeGas()); assertThat(praugeGasCalculator.getMinCalleeGas()).isGreaterThan(cancunGas.getMinCalleeGas());
assertThat(praugeGasCalculator.getMinRetainedGas()) assertThat(praugeGasCalculator.getMinRetainedGas())

@ -30,7 +30,7 @@ class CodeCacheTest {
@Test @Test
void testScale() { void testScale() {
EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
final Bytes contractBytes = final Bytes contractBytes =
Bytes.fromHexString("0xDEAD" + op + "BEEF" + op + "B0B0" + op + "C0DE" + op + "FACE"); Bytes.fromHexString("0xDEAD" + op + "BEEF" + op + "B0B0" + op + "C0DE" + op + "FACE");
final CodeScale scale = new CodeScale(); final CodeScale scale = new CodeScale();

@ -56,7 +56,7 @@ public class Create2OperationTest {
private MessageFrame messageFrame; private MessageFrame messageFrame;
private final WorldUpdater worldUpdater = mock(WorldUpdater.class); private final WorldUpdater worldUpdater = mock(WorldUpdater.class);
private final MutableAccount account = mock(MutableAccount.class); private final MutableAccount account = mock(MutableAccount.class);
private final EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); private final EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
private final MutableAccount newAccount = mock(MutableAccount.class); private final MutableAccount newAccount = mock(MutableAccount.class);
private final Create2Operation operation = private final Create2Operation operation =

@ -219,7 +219,7 @@ class CreateOperationTest {
@Test @Test
void eofV1CannotCall() { void eofV1CannotCall() {
final EVM pragueEvm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); final EVM pragueEvm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
final UInt256 memoryOffset = UInt256.fromHexString("0xFF"); final UInt256 memoryOffset = UInt256.fromHexString("0xFF");
final UInt256 memoryLength = UInt256.valueOf(SIMPLE_CREATE.size()); final UInt256 memoryLength = UInt256.valueOf(SIMPLE_CREATE.size());
final MessageFrame messageFrame = final MessageFrame messageFrame =
@ -248,7 +248,7 @@ class CreateOperationTest {
final UInt256 memoryLength, final UInt256 memoryLength,
final UInt256 value, final UInt256 value,
final int depth) { final int depth) {
final EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); final EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
final MessageFrame messageFrame = final MessageFrame messageFrame =
MessageFrame.builder() MessageFrame.builder()
.type(MessageFrame.Type.CONTRACT_CREATION) .type(MessageFrame.Type.CONTRACT_CREATION)

@ -36,7 +36,7 @@ import org.junit.jupiter.params.provider.MethodSource;
class DataCopyOperationTest { class DataCopyOperationTest {
static EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); static EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
static Collection<Object[]> datacopyTestVector() { static Collection<Object[]> datacopyTestVector() {
return Arrays.asList( return Arrays.asList(

@ -62,7 +62,7 @@ class EofCreateOperationTest {
@Test @Test
void innerContractIsCorrect() { void innerContractIsCorrect() {
final EVM evm = MainnetEVMs.cancunEOF(EvmConfiguration.DEFAULT); final EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
Code code = evm.getCodeUncached(INNER_CONTRACT); Code code = evm.getCodeUncached(INNER_CONTRACT);
assertThat(code.isValid()).isTrue(); assertThat(code.isValid()).isTrue();
@ -92,7 +92,7 @@ class EofCreateOperationTest {
@Test @Test
void eofCreatePassesInCallData() { void eofCreatePassesInCallData() {
Bytes outerContract = EOF_CREATE_CONTRACT; Bytes outerContract = EOF_CREATE_CONTRACT;
final EVM evm = MainnetEVMs.cancunEOF(EvmConfiguration.DEFAULT); final EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
Code code = evm.getCodeUncached(outerContract); Code code = evm.getCodeUncached(outerContract);
if (!code.isValid()) { if (!code.isValid()) {

@ -27,7 +27,7 @@ import org.hyperledger.besu.evm.MainnetEVMs;
import org.hyperledger.besu.evm.account.MutableAccount; import org.hyperledger.besu.evm.account.MutableAccount;
import org.hyperledger.besu.evm.frame.ExceptionalHaltReason; import org.hyperledger.besu.evm.frame.ExceptionalHaltReason;
import org.hyperledger.besu.evm.frame.MessageFrame; import org.hyperledger.besu.evm.frame.MessageFrame;
import org.hyperledger.besu.evm.gascalculator.PragueEOFGasCalculator; import org.hyperledger.besu.evm.gascalculator.OsakaGasCalculator;
import org.hyperledger.besu.evm.internal.EvmConfiguration; import org.hyperledger.besu.evm.internal.EvmConfiguration;
import org.hyperledger.besu.evm.testutils.TestMessageFrameBuilder; import org.hyperledger.besu.evm.testutils.TestMessageFrameBuilder;
import org.hyperledger.besu.evm.worldstate.WorldUpdater; import org.hyperledger.besu.evm.worldstate.WorldUpdater;
@ -44,7 +44,7 @@ public class ExtCallOperationTest {
private final WorldUpdater worldUpdater = mock(WorldUpdater.class); private final WorldUpdater worldUpdater = mock(WorldUpdater.class);
private final MutableAccount account = mock(MutableAccount.class); private final MutableAccount account = mock(MutableAccount.class);
private static final EVM EOF_EVM = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); private static final EVM EOF_EVM = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
public static final Code LEGACY_CODE = public static final Code LEGACY_CODE =
EOF_EVM.getCodeUncached(Bytes.of(ExtCallOperation.OPCODE, 1)); EOF_EVM.getCodeUncached(Bytes.of(ExtCallOperation.OPCODE, 1));
public static final Code SIMPLE_EOF = public static final Code SIMPLE_EOF =
@ -115,7 +115,7 @@ public class ExtCallOperationTest {
final Bytes stackItem, final Bytes stackItem,
final boolean validCode, final boolean validCode,
final boolean warmAddress) { final boolean warmAddress) {
final ExtCallOperation operation = new ExtCallOperation(new PragueEOFGasCalculator()); final ExtCallOperation operation = new ExtCallOperation(new OsakaGasCalculator());
final var messageFrame = final var messageFrame =
new TestMessageFrameBuilder() new TestMessageFrameBuilder()
@ -206,7 +206,7 @@ public class ExtCallOperationTest {
final Wei valueSent, final Wei valueSent,
final Wei valueWeiHave, final Wei valueWeiHave,
final boolean isStatic) { final boolean isStatic) {
final ExtCallOperation operation = new ExtCallOperation(new PragueEOFGasCalculator()); final ExtCallOperation operation = new ExtCallOperation(new OsakaGasCalculator());
final var messageFrame = final var messageFrame =
new TestMessageFrameBuilder() new TestMessageFrameBuilder()
@ -242,7 +242,7 @@ public class ExtCallOperationTest {
@Test @Test
void overflowTest() { void overflowTest() {
final ExtCallOperation operation = new ExtCallOperation(new PragueEOFGasCalculator()); final ExtCallOperation operation = new ExtCallOperation(new OsakaGasCalculator());
final var messageFrame = final var messageFrame =
new TestMessageFrameBuilder() new TestMessageFrameBuilder()
@ -281,7 +281,7 @@ public class ExtCallOperationTest {
@Test @Test
void legacyTest() { void legacyTest() {
final ExtCallOperation operation = new ExtCallOperation(new PragueEOFGasCalculator()); final ExtCallOperation operation = new ExtCallOperation(new OsakaGasCalculator());
final var messageFrame = final var messageFrame =
new TestMessageFrameBuilder() new TestMessageFrameBuilder()

@ -27,7 +27,7 @@ import org.hyperledger.besu.evm.MainnetEVMs;
import org.hyperledger.besu.evm.account.MutableAccount; import org.hyperledger.besu.evm.account.MutableAccount;
import org.hyperledger.besu.evm.frame.ExceptionalHaltReason; import org.hyperledger.besu.evm.frame.ExceptionalHaltReason;
import org.hyperledger.besu.evm.frame.MessageFrame; import org.hyperledger.besu.evm.frame.MessageFrame;
import org.hyperledger.besu.evm.gascalculator.PragueEOFGasCalculator; import org.hyperledger.besu.evm.gascalculator.OsakaGasCalculator;
import org.hyperledger.besu.evm.internal.EvmConfiguration; import org.hyperledger.besu.evm.internal.EvmConfiguration;
import org.hyperledger.besu.evm.testutils.TestMessageFrameBuilder; import org.hyperledger.besu.evm.testutils.TestMessageFrameBuilder;
import org.hyperledger.besu.evm.worldstate.WorldUpdater; import org.hyperledger.besu.evm.worldstate.WorldUpdater;
@ -45,7 +45,7 @@ public class ExtDelegateCallOperationTest {
private final WorldUpdater worldUpdater = mock(WorldUpdater.class); private final WorldUpdater worldUpdater = mock(WorldUpdater.class);
private final MutableAccount account = mock(MutableAccount.class); private final MutableAccount account = mock(MutableAccount.class);
// private final MutableAccount targetAccount = mock(MutableAccount.class); // private final MutableAccount targetAccount = mock(MutableAccount.class);
private static final EVM EOF_EVM = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); private static final EVM EOF_EVM = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
public static final Code LEGACY_CODE = public static final Code LEGACY_CODE =
EOF_EVM.getCodeUncached(Bytes.of(ExtDelegateCallOperation.OPCODE, 1)); EOF_EVM.getCodeUncached(Bytes.of(ExtDelegateCallOperation.OPCODE, 1));
public static final Code SIMPLE_EOF = public static final Code SIMPLE_EOF =
@ -119,7 +119,7 @@ public class ExtDelegateCallOperationTest {
final boolean validCode, final boolean validCode,
final boolean warmAddress) { final boolean warmAddress) {
final ExtDelegateCallOperation operation = final ExtDelegateCallOperation operation =
new ExtDelegateCallOperation(new PragueEOFGasCalculator()); new ExtDelegateCallOperation(new OsakaGasCalculator());
final var messageFrame = final var messageFrame =
new TestMessageFrameBuilder() new TestMessageFrameBuilder()
@ -180,7 +180,7 @@ public class ExtDelegateCallOperationTest {
final ExceptionalHaltReason haltReason, final ExceptionalHaltReason haltReason,
final Bytes stackItem) { final Bytes stackItem) {
final ExtDelegateCallOperation operation = final ExtDelegateCallOperation operation =
new ExtDelegateCallOperation(new PragueEOFGasCalculator()); new ExtDelegateCallOperation(new OsakaGasCalculator());
final var messageFrame = final var messageFrame =
new TestMessageFrameBuilder() new TestMessageFrameBuilder()
@ -227,7 +227,7 @@ public class ExtDelegateCallOperationTest {
@Test @Test
void overflowTest() { void overflowTest() {
final ExtDelegateCallOperation operation = final ExtDelegateCallOperation operation =
new ExtDelegateCallOperation(new PragueEOFGasCalculator()); new ExtDelegateCallOperation(new OsakaGasCalculator());
final var messageFrame = final var messageFrame =
new TestMessageFrameBuilder() new TestMessageFrameBuilder()
.initialGas(400000) .initialGas(400000)
@ -265,7 +265,7 @@ public class ExtDelegateCallOperationTest {
@Test @Test
void legacyTest() { void legacyTest() {
final ExtDelegateCallOperation operation = final ExtDelegateCallOperation operation =
new ExtDelegateCallOperation(new PragueEOFGasCalculator()); new ExtDelegateCallOperation(new OsakaGasCalculator());
final var messageFrame = final var messageFrame =
new TestMessageFrameBuilder() new TestMessageFrameBuilder()

@ -27,7 +27,7 @@ import org.hyperledger.besu.evm.MainnetEVMs;
import org.hyperledger.besu.evm.account.MutableAccount; import org.hyperledger.besu.evm.account.MutableAccount;
import org.hyperledger.besu.evm.frame.ExceptionalHaltReason; import org.hyperledger.besu.evm.frame.ExceptionalHaltReason;
import org.hyperledger.besu.evm.frame.MessageFrame; import org.hyperledger.besu.evm.frame.MessageFrame;
import org.hyperledger.besu.evm.gascalculator.PragueEOFGasCalculator; import org.hyperledger.besu.evm.gascalculator.OsakaGasCalculator;
import org.hyperledger.besu.evm.internal.EvmConfiguration; import org.hyperledger.besu.evm.internal.EvmConfiguration;
import org.hyperledger.besu.evm.testutils.TestMessageFrameBuilder; import org.hyperledger.besu.evm.testutils.TestMessageFrameBuilder;
import org.hyperledger.besu.evm.worldstate.WorldUpdater; import org.hyperledger.besu.evm.worldstate.WorldUpdater;
@ -44,7 +44,7 @@ public class ExtStaticCallOperationTest {
private final WorldUpdater worldUpdater = mock(WorldUpdater.class); private final WorldUpdater worldUpdater = mock(WorldUpdater.class);
private final MutableAccount account = mock(MutableAccount.class); private final MutableAccount account = mock(MutableAccount.class);
private static final EVM EOF_EVM = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); private static final EVM EOF_EVM = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
public static final Code LEGACY_CODE = public static final Code LEGACY_CODE =
EOF_EVM.getCodeUncached(Bytes.of(ExtStaticCallOperation.OPCODE, 1)); EOF_EVM.getCodeUncached(Bytes.of(ExtStaticCallOperation.OPCODE, 1));
public static final Code SIMPLE_EOF = public static final Code SIMPLE_EOF =
@ -115,8 +115,7 @@ public class ExtStaticCallOperationTest {
final Bytes stackItem, final Bytes stackItem,
final boolean validCode, final boolean validCode,
final boolean warmAddress) { final boolean warmAddress) {
final ExtStaticCallOperation operation = final ExtStaticCallOperation operation = new ExtStaticCallOperation(new OsakaGasCalculator());
new ExtStaticCallOperation(new PragueEOFGasCalculator());
final var messageFrame = final var messageFrame =
new TestMessageFrameBuilder() new TestMessageFrameBuilder()
@ -152,8 +151,7 @@ public class ExtStaticCallOperationTest {
@Test @Test
void overflowTest() { void overflowTest() {
final ExtStaticCallOperation operation = final ExtStaticCallOperation operation = new ExtStaticCallOperation(new OsakaGasCalculator());
new ExtStaticCallOperation(new PragueEOFGasCalculator());
final var messageFrame = final var messageFrame =
new TestMessageFrameBuilder() new TestMessageFrameBuilder()
.initialGas(400000) .initialGas(400000)
@ -190,8 +188,7 @@ public class ExtStaticCallOperationTest {
@Test @Test
void legacyTest() { void legacyTest() {
final ExtStaticCallOperation operation = final ExtStaticCallOperation operation = new ExtStaticCallOperation(new OsakaGasCalculator());
new ExtStaticCallOperation(new PragueEOFGasCalculator());
final var messageFrame = final var messageFrame =
new TestMessageFrameBuilder() new TestMessageFrameBuilder()

@ -56,7 +56,7 @@ class JumpOperationTest {
@BeforeEach @BeforeEach
void init() { void init() {
evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
} }
@Test @Test

@ -55,7 +55,7 @@ public class SelfDestructOperationTest {
@Mock private WorldUpdater worldUpdater; @Mock private WorldUpdater worldUpdater;
@Mock private MutableAccount accountOriginator; @Mock private MutableAccount accountOriginator;
@Mock private MutableAccount accountBeneficiary; @Mock private MutableAccount accountBeneficiary;
private final EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); private final EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
private final SelfDestructOperation frontierOperation = private final SelfDestructOperation frontierOperation =
new SelfDestructOperation(new ConstantinopleGasCalculator()); new SelfDestructOperation(new ConstantinopleGasCalculator());

@ -45,7 +45,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
class ContractCreationProcessorTest class ContractCreationProcessorTest
extends AbstractMessageProcessorTest<ContractCreationProcessor> { extends AbstractMessageProcessorTest<ContractCreationProcessor> {
EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
private ContractCreationProcessor processor; private ContractCreationProcessor processor;

@ -55,7 +55,7 @@ class ExtendedOperationTracerTest {
@Test @Test
void shouldCallTraceAccountCreationResultIfIsExtendedTracing() { void shouldCallTraceAccountCreationResultIfIsExtendedTracing() {
EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
final ContractCreationProcessor contractCreationProcessor = final ContractCreationProcessor contractCreationProcessor =
new ContractCreationProcessor(evm, false, Collections.emptyList(), 0); new ContractCreationProcessor(evm, false, Collections.emptyList(), 0);
@ -69,7 +69,7 @@ class ExtendedOperationTracerTest {
@Test @Test
void shouldNotCallTraceAccountCreationResultIfIsNotExtendedTracing() { void shouldNotCallTraceAccountCreationResultIfIsNotExtendedTracing() {
EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
final ContractCreationProcessor contractCreationProcessor = final ContractCreationProcessor contractCreationProcessor =
new ContractCreationProcessor(evm, false, Collections.emptyList(), 0); new ContractCreationProcessor(evm, false, Collections.emptyList(), 0);

@ -119,7 +119,7 @@ public class EofContainerSubCommand implements Runnable {
.constructParametricType(Map.class, String.class, EOFTestCaseSpec.class); .constructParametricType(Map.class, String.class, EOFTestCaseSpec.class);
List<FuzzingClient> fuzzingClients = new ArrayList<>(); List<FuzzingClient> fuzzingClients = new ArrayList<>();
EVM evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); EVM evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
long validContainers; long validContainers;
long totalContainers; long totalContainers;

@ -31,7 +31,7 @@ class InternalClient implements FuzzingClient {
public InternalClient(final String clientName) { public InternalClient(final String clientName) {
this.name = clientName; this.name = clientName;
this.evm = MainnetEVMs.pragueEOF(EvmConfiguration.DEFAULT); this.evm = MainnetEVMs.osaka(EvmConfiguration.DEFAULT);
} }
@Override @Override

Loading…
Cancel
Save