@ -77,7 +77,9 @@ public class EVMExecutor {
private OperationTracer tracer = OperationTracer . NO_TRACING ;
private OperationTracer tracer = OperationTracer . NO_TRACING ;
private boolean requireDeposit = true ;
private boolean requireDeposit = true ;
private List < ContractValidationRule > contractValidationRules =
private List < ContractValidationRule > contractValidationRules =
List . of ( MaxCodeSizeRule . from ( EvmSpecVersion . SPURIOUS_DRAGON ) , PrefixCodeRule . of ( ) ) ;
List . of (
MaxCodeSizeRule . from ( EvmSpecVersion . SPURIOUS_DRAGON , EvmConfiguration . DEFAULT ) ,
PrefixCodeRule . of ( ) ) ;
private long initialNonce = 1 ;
private long initialNonce = 1 ;
private Collection < Address > forceCommitAddresses = List . of ( Address . fromHexString ( "0x03" ) ) ;
private Collection < Address > forceCommitAddresses = List . of ( Address . fromHexString ( "0x03" ) ) ;
private Set < Address > accessListWarmAddresses = new BytesTrieSet < > ( Address . SIZE ) ;
private Set < Address > accessListWarmAddresses = new BytesTrieSet < > ( Address . SIZE ) ;
@ -241,8 +243,7 @@ public class EVMExecutor {
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . spuriousDragon ( evmConfiguration ) ) ;
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . spuriousDragon ( evmConfiguration ) ) ;
executor . precompileContractRegistry =
executor . precompileContractRegistry =
MainnetPrecompiledContracts . frontier ( executor . evm . getGasCalculator ( ) ) ;
MainnetPrecompiledContracts . frontier ( executor . evm . getGasCalculator ( ) ) ;
executor . contractValidationRules =
executor . contractValidationRules = List . of ( MaxCodeSizeRule . from ( executor . evm ) ) ;
List . of ( MaxCodeSizeRule . from ( EvmSpecVersion . SPURIOUS_DRAGON ) ) ;
return executor ;
return executor ;
}
}
@ -256,7 +257,7 @@ public class EVMExecutor {
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . byzantium ( evmConfiguration ) ) ;
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . byzantium ( evmConfiguration ) ) ;
executor . precompileContractRegistry =
executor . precompileContractRegistry =
MainnetPrecompiledContracts . byzantium ( executor . evm . getGasCalculator ( ) ) ;
MainnetPrecompiledContracts . byzantium ( executor . evm . getGasCalculator ( ) ) ;
executor . contractValidationRules = List . of ( MaxCodeSizeRule . from ( EvmSpecVersion . BYZANTIUM ) ) ;
executor . contractValidationRules = List . of ( MaxCodeSizeRule . from ( executor . evm ) ) ;
return executor ;
return executor ;
}
}
@ -270,7 +271,7 @@ public class EVMExecutor {
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . constantinople ( evmConfiguration ) ) ;
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . constantinople ( evmConfiguration ) ) ;
executor . precompileContractRegistry =
executor . precompileContractRegistry =
MainnetPrecompiledContracts . byzantium ( executor . evm . getGasCalculator ( ) ) ;
MainnetPrecompiledContracts . byzantium ( executor . evm . getGasCalculator ( ) ) ;
executor . contractValidationRules = List . of ( MaxCodeSizeRule . from ( EvmSpecVersion . CONSTANTINOPLE ) ) ;
executor . contractValidationRules = List . of ( MaxCodeSizeRule . from ( executor . evm ) ) ;
return executor ;
return executor ;
}
}
@ -284,7 +285,7 @@ public class EVMExecutor {
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . petersburg ( evmConfiguration ) ) ;
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . petersburg ( evmConfiguration ) ) ;
executor . precompileContractRegistry =
executor . precompileContractRegistry =
MainnetPrecompiledContracts . byzantium ( executor . evm . getGasCalculator ( ) ) ;
MainnetPrecompiledContracts . byzantium ( executor . evm . getGasCalculator ( ) ) ;
executor . contractValidationRules = List . of ( MaxCodeSizeRule . from ( EvmSpecVersion . PETERSBURG ) ) ;
executor . contractValidationRules = List . of ( MaxCodeSizeRule . from ( executor . evm ) ) ;
return executor ;
return executor ;
}
}
@ -319,7 +320,7 @@ public class EVMExecutor {
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . istanbul ( chainId , evmConfiguration ) ) ;
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . istanbul ( chainId , evmConfiguration ) ) ;
executor . precompileContractRegistry =
executor . precompileContractRegistry =
MainnetPrecompiledContracts . istanbul ( executor . evm . getGasCalculator ( ) ) ;
MainnetPrecompiledContracts . istanbul ( executor . evm . getGasCalculator ( ) ) ;
executor . contractValidationRules = List . of ( MaxCodeSizeRule . from ( EvmSpecVersion . ISTANBUL ) ) ;
executor . contractValidationRules = List . of ( MaxCodeSizeRule . from ( executor . evm ) ) ;
return executor ;
return executor ;
}
}
@ -354,7 +355,7 @@ public class EVMExecutor {
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . berlin ( chainId , evmConfiguration ) ) ;
final EVMExecutor executor = new EVMExecutor ( MainnetEVMs . berlin ( chainId , evmConfiguration ) ) ;
executor . precompileContractRegistry =
executor . precompileContractRegistry =
MainnetPrecompiledContracts . istanbul ( executor . evm . getGasCalculator ( ) ) ;
MainnetPrecompiledContracts . istanbul ( executor . evm . getGasCalculator ( ) ) ;
executor . contractValidationRules = List . of ( MaxCodeSizeRule . from ( EvmSpecVersion . BERLIN ) ) ;
executor . contractValidationRules = List . of ( MaxCodeSizeRule . from ( executor . evm ) ) ;
return executor ;
return executor ;
}
}